/
githubmirror
/
drawio
Обзор
Документация
Войти
/
githubmirror
/
drawio
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
src/main/webapp/js/viewer.min.js
5 166 строк
3 MB
David Benson
31.1.8 release
07 авг 2026, 02:43
07 авг 2026, 02:43
a1f615b
Код
Авторство
О чём код?
window.PROXY_URL=window.PROXY_URL||"https://viewer.diagrams.net/proxy";window.STYLE_PATH=window.STYLE_PATH||"https://viewer.diagrams.net/styles";window.SHAPES_PATH=window.SHAPES_PATH||"https://viewer.diagrams.net/shapes";window.STENCIL_PATH=window.STENCIL_PATH||"https://viewer.diagrams.net/stencils";window.DRAW_MATH_URL=window.DRAW_MATH_URL||"https://viewer.diagrams.net/math4/es5";window.GRAPH_IMAGE_PATH=window.GRAPH_IMAGE_PATH||"https://viewer.diagrams.net/img"; window.mxImageBasePath=window.mxImageBasePath||"https://viewer.diagrams.net/mxgraph/images";window.mxBasePath=window.mxBasePath||"https://viewer.diagrams.net/mxgraph/";window.mxLoadStylesheets=window.mxLoadStylesheets||!1; //fgnass.github.com/spin.js#v2.0.0 !function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){"use strict";function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-"),f=.01+c/d*100,g=Math.max(1-(1-a)/b*(100-f),a),h=j.substring(0,j.indexOf("Animation")).toLowerCase(),i=h&&"-"+h+"-"||"";return l[e]||(m.insertRule("@"+i+"keyframes "+e+"{0%{opacity:"+g+"}"+f+"%{opacity:"+a+"}"+(f+.01)+"%{opacity:1}"+(f+b)%100+"%{opacity:"+a+"}100%{opacity:"+g+"}}",m.cssRules.length),l[e]=1),e}function d(a,b){var c,d,e=a.style;for(b=b.charAt(0).toUpperCase()+b.slice(1),d=0;d<k.length;d++)if(c=k[d]+b,void 0!==e[c])return c;return void 0!==e[b]?b:void 0}function e(a,b){for(var c in b)a.style[d(a,c)||c]=b[c];return a}function f(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)void 0===a[d]&&(a[d]=c[d])}return a}function g(a,b){return"string"==typeof a?a:a[b%a.length]}function h(a){this.opts=f(a||{},h.defaults,n)}function i(){function c(b,c){return a("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',c)}m.addRule(".spin-vml","behavior:url(#default#VML)"),h.prototype.lines=function(a,d){function f(){return e(c("group",{coordsize:k+" "+k,coordorigin:-j+" "+-j}),{width:k,height:k})}function h(a,h,i){b(m,b(e(f(),{rotation:360/d.lines*a+"deg",left:~~h}),b(e(c("roundrect",{arcsize:d.corners}),{width:j,height:d.width,left:d.radius,top:-d.width>>1,filter:i}),c("fill",{color:g(d.color,a),opacity:d.opacity}),c("stroke",{opacity:0}))))}var i,j=d.length+d.width,k=2*j,l=2*-(d.width+d.length)+"px",m=e(f(),{position:"absolute",top:l,left:l});if(d.shadow)for(i=1;i<=d.lines;i++)h(i,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(i=1;i<=d.lines;i++)h(i);return b(a,m)},h.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}}var j,k=["webkit","Moz","ms","O"],l={},m=function(){var c=a("style",{type:"text/css"});return b(document.getElementsByTagName("head")[0],c),c.sheet||c.styleSheet}(),n={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",position:"absolute"};h.defaults={},f(h.prototype,{spin:function(b){this.stop();{var c=this,d=c.opts,f=c.el=e(a(0,{className:d.className}),{position:d.position,width:0,zIndex:d.zIndex});d.radius+d.length+d.width}if(b&&(b.insertBefore(f,b.firstChild||null),e(f,{left:d.left,top:d.top})),f.setAttribute("role","progressbar"),c.lines(f,c.opts),!j){var g,h=0,i=(d.lines-1)*(1-d.direction)/2,k=d.fps,l=k/d.speed,m=(1-d.opacity)/(l*d.trail/100),n=l/d.lines;!function o(){h++;for(var a=0;a<d.lines;a++)g=Math.max(1-(h+(d.lines-a)*n)%l*m,d.opacity),c.opacity(f,a*d.direction+i,g,d);c.timeout=c.el&&setTimeout(o,~~(1e3/k))}()}return c},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=void 0),this},lines:function(d,f){function h(b,c){return e(a(),{position:"absolute",width:f.length+f.width+"px",height:f.width+"px",background:b,boxShadow:c,transformOrigin:"left",transform:"rotate("+~~(360/f.lines*k+f.rotate)+"deg) translate("+f.radius+"px,0)",borderRadius:(f.corners*f.width>>1)+"px"})}for(var i,k=0,l=(f.lines-1)*(1-f.direction)/2;k<f.lines;k++)i=e(a(),{position:"absolute",top:1+~(f.width/2)+"px",transform:f.hwaccel?"translate3d(0,0,0)":"",opacity:f.opacity,animation:j&&c(f.opacity,f.trail,l+k*f.direction,f.lines)+" "+1/f.speed+"s linear infinite"}),f.shadow&&b(i,e(h("#000","0 0 4px #000"),{top:"2px"})),b(d,b(i,h(g(f.color,k),"0 0 1px rgba(0,0,0,.1)")));return d},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}});var o=e(a("group"),{behavior:"url(#default#VML)"});return!d(o,"transform")&&o.adj?i():j=d(o,"animation"),h}); /*! @license DOMPurify 3.4.13 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.13/LICENSE */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t … [Строка слишком длинная. Вы можете скачать файл] //# sourceMappingURL=purify.min.js.map /*! pako 2.2.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).pako= … [Строка слишком длинная. Вы можете скачать файл] var rough=function(){"use strict";function t(t,e,s){if(t&&t.length){const[n,o]=e,a=Math.PI/180*s,h=Math.cos(a),r=Math.sin(a);for(const e of t){const[t,s]=e;e[0]=(t-n)*h-(s-o)*r+n,e[1]=(t-n)*r+(s-o)*h+ … [Строка слишком длинная. Вы можете скачать файл] var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a,b){var c="",d=0;for(null!=b&&b||(a=Base64._utf8_encode(a));d<a.length;){var e=a.charCodeAt(d++);b=a.charCodeAt(d++);var f=a.charCodeAt(d++);var g=e>>2;e=(e&3)<<4|b>>4;var k=(b&15)<<2|f>>6;var l=f&63;isNaN(b)?k=l=64:isNaN(f)&&(l=64);c=c+this._keyStr.charAt(g)+this._keyStr.charAt(e)+this._keyStr.charAt(k)+this._keyStr.charAt(l)}return c},decode:function(a,b){b=null!=b?b:!1;var c="",d=0;for(a=a.replace(/[^A-Za-z0-9\+\/=]/g, "");d<a.length;){var e=this._keyStr.indexOf(a.charAt(d++));var f=this._keyStr.indexOf(a.charAt(d++));var g=this._keyStr.indexOf(a.charAt(d++));var k=this._keyStr.indexOf(a.charAt(d++));e=e<<2|f>>4;f=(f&15)<<4|g>>2;var l=(g&3)<<6|k;c+=String.fromCharCode(e);64!=g&&(c+=String.fromCharCode(f));64!=k&&(c+=String.fromCharCode(l))}b||(c=Base64._utf8_decode(c));return c},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);if(55296<=d&&56319>=d){var e= a.charCodeAt(c+1);56320<=e&&57343>=e&&(d=((d&1023)<<10)+(e&1023)+65536,c++)}128>d?b+=String.fromCharCode(d):(2048>d?b+=String.fromCharCode(d>>6|192):(65536>d?b+=String.fromCharCode(d>>12|224):(b+=String.fromCharCode(d>>18|240),b+=String.fromCharCode(d>>12&63|128)),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){var b="",c=0;for(c1=c2=0;c<a.length;){var d=a.charCodeAt(c);if(128>d)b+=String.fromCharCode(d),c++;else if(191<d&&224>d)c2=a.charCodeAt(c+ 1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2;else if(240>d)c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3;else{c2=a.charCodeAt(c+1);c3=a.charCodeAt(c+2);var e=a.charCodeAt(c+3);b+=String.fromCodePoint((d&7)<<18|(c2&63)<<12|(c3&63)<<6|e&63);c+=4}}return b}};window.urlParams=window.urlParams||{};if(null==window.mxIsElectron||"1"==urlParams.embed)window.mxIsElectron=!1;window.isLocalStorage=window.isLocalStorage||!1;window.mxLoadSettings=window.mxLoadSettings||"1"!=urlParams.configure;window.isSvgBrowser=!0;window.isMermaidEnabled="function"===typeof structuredClone; window.DRAWIO_BASE_URL=window.DRAWIO_BASE_URL||(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)?window.location.protocol+"//"+window.location.hostname:"https://app.diagrams.net");window.DRAWIO_SERVER_URL=window.DRAWIO_SERVER_URL||window.location.origin+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/";window.DRAWIO_LIGHTBOX_URL=window.DRAWIO_LIGHTBOX_URL||"https://viewer.diagrams.net"; window.EXPORT_URL=window.EXPORT_URL||"https://convert.diagrams.net/node/export";window.DRAW_MATH_URL=window.DRAW_MATH_URL||"math4/es5";window.VSS_CONVERT_URL=window.VSS_CONVERT_URL||"https://convert.diagrams.net/VsdConverter/api/converter";window.REALTIME_URL=window.REALTIME_URL||window.DRAWIO_SERVER_URL+"cache";window.DRAWIO_GITLAB_URL=window.DRAWIO_GITLAB_URL||"https://gitlab.com";window.DRAWIO_GITLAB_ID=window.DRAWIO_GITLAB_ID||"2b14debc5feeb18ba65358d863ec870e4cc9294b28c3c941cb3014eb4af9a9b4"; window.DRAWIO_GITHUB_URL=window.DRAWIO_GITHUB_URL||"https://github.com";window.DRAWIO_GITHUB_API_URL=window.DRAWIO_GITHUB_API_URL||"https://api.github.com";window.DRAWIO_GITHUB_ID=window.DRAWIO_GITHUB_ID||"Iv1.98d62f0431e40543";window.DRAWIO_DROPBOX_ID=window.DRAWIO_DROPBOX_ID||"jg02tc0onwmhlgm";window.SAVE_URL=window.SAVE_URL||window.DRAWIO_SERVER_URL+"save";window.OPEN_URL=window.OPEN_URL||window.DRAWIO_SERVER_URL+"import";window.PROXY_URL=window.PROXY_URL||window.DRAWIO_SERVER_URL+"proxy"; window.DRAWIO_VIEWER_URL=window.DRAWIO_VIEWER_URL||null;window.NOTIFICATIONS_URL=window.NOTIFICATIONS_URL||(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)?window.DRAWIO_SERVER_URL+"notifications":null);window.RT_WEBSOCKET_URL=window.RT_WEBSOCKET_URL||"wss://"+("test.draw.io"==window.location.hostname?"app.diagrams.net":window.location.hostname)+"/rt"; window.DRAWIO_ATLASSIAN_PROMPT_LENGTH=null!=window.DRAWIO_ATLASSIAN_PROMPT_LENGTH?window.DRAWIO_ATLASSIAN_PROMPT_LENGTH:1E5;window.SHAPES_PATH=window.SHAPES_PATH||"shapes";window.GRAPH_IMAGE_PATH=window.GRAPH_IMAGE_PATH||"img";window.ICONSEARCH_PATH=window.ICONSEARCH_PATH||(urlParams.dev&&"file:"!=window.location.protocol?"iconSearch2":window.DRAWIO_SERVER_URL+"iconSearch2"); window.ICON_SERVICE_PATH=window.ICON_SERVICE_PATH||(urlParams.dev&&"file:"!=window.location.protocol?"api/icons":window.DRAWIO_SERVER_URL+"api/icons");window.TEMPLATE_PATH=window.TEMPLATE_PATH||"templates";window.NEW_DIAGRAM_CATS_PATH=window.NEW_DIAGRAM_CATS_PATH||"newDiagramCats";window.PLUGINS_BASE_PATH=window.PLUGINS_BASE_PATH||"";window.ALLOW_CUSTOM_PLUGINS=window.ALLOW_CUSTOM_PLUGINS||!1;window.RESOURCES_PATH=window.RESOURCES_PATH||"resources"; window.RESOURCE_BASE=window.RESOURCE_BASE||RESOURCES_PATH+"/dia";window.DRAWIO_CONFIG=window.DRAWIO_CONFIG||null;window.mxLoadResources=window.mxLoadResources||!1; window.mxLanguage=window.mxLanguage||function(){var a=urlParams.lang;if(null==a&&"undefined"!=typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).language||null);if(!a&&window.mxIsElectron&&(a=urlParams.appLang,null!=a)){var c=a.indexOf("-");0<=c&&(a=a.substring(0,c));a=a.toLowerCase()}}catch(d){isLocalStorage=!1}return a}(); window.mxLanguageMap=window.mxLanguageMap||{i18n:"",id:"Bahasa Indonesia",ms:"Bahasa Melayu",bs:"Bosanski",bg:"Bulgarian",ca:"Català",cs:"Čeština",da:"Dansk",de:"Deutsch",et:"Eesti",en:"English",es:"Español",eu:"Euskara",fil:"Filipino",fr:"Français",gl:"Galego",it:"Italiano",hu:"Magyar",kl:"Kalaallisut",lt:"Lietuvių",lv:"Latviešu",nl:"Nederlands",no:"Norsk",pl:"Polski","pt-br":"Português (Brasil)",pt:"Português (Portugal)",ro:"Română",fi:"Suomi",sv:"Svenska",vi:"Tiếng Việt",tr:"Türkçe",el:"Ελληνικά", ru:"Русский",sr:"Српски",uk:"Українська",he:"עברית",ar:"العربية",fa:"فارسی",th:"ไทย",ta:"தமிழ்",ko:"한국어",ja:"日本語",zh:"简体中文","zh-tw":"繁體中文"};"undefined"===typeof window.mxBasePath&&(window.mxBasePath="mxgraph",window.mxImageBasePath="mxgraph/images"); if(null==window.mxLanguages){window.mxLanguages=[];for(var lang in mxLanguageMap)"en"!=lang&&window.mxLanguages.push(lang);if(null==window.mxLanguage&&("test.draw.io"==window.location.hostname||"www.draw.io"==window.location.hostname||"viewer.diagrams.net"==window.location.hostname||"embed.diagrams.net"==window.location.hostname||"app.diagrams.net"==window.location.hostname||"jgraph.github.io"==window.location.hostname)&&(lang=navigator.language,null!=lang)){var dash=lang.indexOf("-");0<dash&&(lang= lang.substring(0,dash));0<=window.mxLanguages.indexOf(lang)&&(window.mxLanguage=lang)}}"1"==urlParams.extAuth&&/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent)&&(urlParams.gapi="0",urlParams.noDevice="1","1"!=urlParams.lightbox&&(urlParams.lightbox="1",urlParams.layers="1",urlParams.viewerOnlyMsg="1"));"viewer.diagrams.net"==window.location.hostname&&(urlParams.lightbox="1");"1"==urlParams.lightbox&&(urlParams.chrome="0"); "1"==urlParams.embedInline&&(urlParams.embed="1",urlParams.ui="sketch",urlParams.plugins="0",urlParams.proto="json",urlParams.prefetchFonts="1",null==urlParams.pv&&(urlParams.pv="0"));function setCurrentXml(a,b){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,b)} window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;"1"==urlParams.extAuth&&(a="sketch");if(null==a&&isLocalStorage&&"undefined"!==typeof JSON&&"1"!=urlParams.lightbox)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).ui||null)}catch(c){isLocalStorage=!1}"dark"==urlParams.ui&&null==urlParams.dark&&(urlParams.dark="1");"sketch"==a&&null==urlParams.sketch&&"ac.draw.io"===window.location.hostname&&(urlParams.sketch="1");return a}(); (function(){if("undefined"!==typeof JSON){var a=null!=window.DRAWIO_CONFIG?window.DRAWIO_CONFIG.showSplashOnStart:null;if(isLocalStorage)try{var b=localStorage.getItem(".configuration");if(null!=b){var c=JSON.parse(b);null!=c&&(null!=c.lockdown&&(urlParams.lockdown=c.lockdown),null!=c.showSplashOnStart&&(a=c.showSplashOnStart))}}catch(d){}1!=a&&null==urlParams.splash&&(urlParams.splash="0")}a=urlParams["export"];null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0, 8)&&(a="http://"+a),EXPORT_URL=a);a=urlParams.gitlab;null!=a&&(a=decodeURIComponent(a),"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&(a="http://"+a),DRAWIO_GITLAB_URL=a);a=urlParams["gitlab-id"];null!=a&&(DRAWIO_GITLAB_ID=a);window.DRAWIO_LOG_URL=window.DRAWIO_LOG_URL||"";a=window.location.host;"test.draw.io"!=a&&(c="diagrams.net",b=a.length-c.length,c=a.lastIndexOf(c,b),-1!==c&&c===b?window.DRAWIO_LOG_URL="https://log.diagrams.net":(c="draw.io",b=a.length-c.length,c=a.lastIndexOf(c, b),-1!==c&&c===b&&(window.DRAWIO_LOG_URL="https://log.draw.io")))})();"1"==urlParams["gapi-stealth"]&&(urlParams.stealth="1");if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local||"1"==urlParams.lockdown)urlParams.picker="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.gapi="1"==urlParams["gapi-stealth"]?"1":"0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0"; "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"],FORBID_ATTR:["data-icon","data-icon-content"],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:"31.1.8",IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),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||"[object SVGForeignObjectElement]"!==document.createElementNS("http://www.w3.org/2000/svg","foreignObject").toString()||0<=navigator.userAgent.indexOf("Opera/"),IS_WIN:0<navigator.appVersion.indexOf("Win"),IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion), IS_LINUX:/\bLinux\b/.test(navigator.appVersion),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:null!=window.PointerEvent&&!(0<navigator.appVersion.indexOf("Mac")),IS_LOCAL:0>document.location.href.indexOf("http://")&&0>document.location.href.indexOf("https://"),defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_SVG},link:function(a,b,c,d){c=c||document;var e=c.createElement("link");e.setAttribute("rel",a);e.setAttribute("href",b);e.setAttribute("charset","UTF-8");e.setAttribute("type", "text/css");d&&e.setAttribute("id",d);c.getElementsByTagName("head")[0].appendChild(e)},loadResources:function(a,b){function c(){0==--d&&a()}for(var d=mxClient.defaultBundles.length,e=0;e<mxClient.defaultBundles.length;e++)mxResources.add(mxClient.defaultBundles[e],b,c)},include:function(a){document.write('<script src="'+a+'">\x3c/script>')}};"undefined"==typeof mxLoadResources&&(mxLoadResources=!0);"undefined"==typeof mxForceIncludes&&(mxForceIncludes=!1); "undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt");"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0);"undefined"!=typeof mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath="."; "undefined"!=typeof mxImageBasePath&&0<mxImageBasePath.length?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath="images";mxClient.language="undefined"!=typeof mxLanguage&&null!=mxLanguage?mxLanguage:navigator.language;mxClient.defaultLanguage="undefined"!=typeof mxDefaultLanguage&&null!=mxDefaultLanguage?mxDefaultLanguage:"en"; mxLoadStylesheets&&mxClient.link("stylesheet","mxgraph/css/common.css");"undefined"!=typeof mxLanguages&&null!=mxLanguages&&(mxClient.languages=mxLanguages); var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(null==mxLog.window&&null!=document.body){var a=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,b=document.createElement("table");b.setAttribute("width","100%");b.setAttribute("height","100%");var c=document.createElement("tbody"),d=document.createElement("tr"),e=document.createElement("td");e.style.verticalAlign="top";mxLog.textarea=document.createElement("textarea");mxLog.textarea.setAttribute("wrap","off"); mxLog.textarea.setAttribute("readOnly","true");mxLog.textarea.style.height="100%";mxLog.textarea.style.resize="none";mxLog.textarea.value=mxLog.buffer;mxLog.textarea.style.width=mxClient.IS_NS&&"BackCompat"!=document.compatMode?"99%":"100%";e.appendChild(mxLog.textarea);d.appendChild(e);c.appendChild(d);d=document.createElement("tr");mxLog.td=document.createElement("td");mxLog.td.style.verticalAlign="top";mxLog.td.setAttribute("height","30px");d.appendChild(mxLog.td);c.appendChild(d);b.appendChild(c); mxLog.addButton("Info",function(g){mxLog.info()});mxLog.addButton("DOM",function(g){g=mxUtils.getInnerHtml(document.body);mxLog.debug(g)});mxLog.addButton("Trace",function(g){mxLog.TRACE=!mxLog.TRACE;mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")});mxLog.addButton("Show",function(g){try{mxUtils.popup(mxLog.textarea.value)}catch(k){mxUtils.alert(k)}});mxLog.addButton("Clear",function(g){mxLog.textarea.value=""});d=c=0;"number"===typeof window.innerWidth?(c=window.innerHeight, d=window.innerWidth):(c=document.documentElement.clientHeight||document.body.clientHeight,d=document.body.clientWidth);mxLog.window=new mxWindow(a,b,Math.max(0,d-320),Math.max(0,c-210),300,160);mxLog.window.setMaximizable(!0);mxLog.window.setScrollable(!1);mxLog.window.setResizable(!0);mxLog.window.setClosable(!0);mxLog.window.destroyOnClose=!1;mxLog.window.title.style.paddingRight="80px";mxLog.window.title.setAttribute("title",a);if(mxClient.IS_NS&&!mxClient.IS_GC&&!mxClient.IS_SF&&"BackCompat"!= document.compatMode||11==document.documentMode){var f=mxLog.window.getElement();a=function(g,k){mxLog.textarea.style.height=Math.max(0,f.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,a);mxLog.window.addListener(mxEvent.MAXIMIZE,a);mxLog.window.addListener(mxEvent.NORMALIZE,a);mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(a,b){var c=document.createElement("button");mxUtils.write(c,a);mxEvent.addListener(c,"click", b);mxLog.td.appendChild(c)},isVisible:function(){return null!=mxLog.window?mxLog.window.isVisible():!1},show:function(){mxLog.setVisible(!0)},setVisible:function(a){null==mxLog.window&&mxLog.init();null!=mxLog.window&&mxLog.window.setVisible(a)},enter:function(a){if(mxLog.TRACE)return mxLog.writeln("Entering "+a),(new Date).getTime()},leave:function(a,b){mxLog.TRACE&&(b=0!=b?" ("+((new Date).getTime()-b)+" ms)":"",mxLog.writeln("Leaving "+a+b))},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this, arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var a="",b=0;b<arguments.length;b++)a+=arguments[b],b<arguments.length-1&&(a+=" ");null!=mxLog.textarea?(mxLog.textarea.value+=a,null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/2.5")&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=a},writeln:function(){for(var a="",b=0;b<arguments.length;b++)a+= arguments[b],b<arguments.length-1&&(a+=" ");mxLog.write(a+"\n")}},mxObjectIdentity={FIELD_NAME:"mxObjectId",counter:0,get:function(a){if(null!=a){if(null==a[mxObjectIdentity.FIELD_NAME])if("object"===typeof a){var b=mxUtils.getFunctionName(a.constructor);a[mxObjectIdentity.FIELD_NAME]=b+"#"+mxObjectIdentity.counter++}else"function"===typeof a&&(a[mxObjectIdentity.FIELD_NAME]="Function#"+mxObjectIdentity.counter++);return a[mxObjectIdentity.FIELD_NAME]}return null},clear:function(a){"object"!==typeof a&& "function"!==typeof a||delete a[mxObjectIdentity.FIELD_NAME]}};function mxDictionary(){this.clear()}mxDictionary.prototype.map=null;mxDictionary.prototype.clear=function(){this.map={}};mxDictionary.prototype.get=function(a){a=mxObjectIdentity.get(a);return this.map[a]};mxDictionary.prototype.put=function(a,b){a=mxObjectIdentity.get(a);var c=this.map[a];this.map[a]=b;return c};mxDictionary.prototype.remove=function(a){a=mxObjectIdentity.get(a);var b=this.map[a];delete this.map[a];return b}; mxDictionary.prototype.getCount=function(){var a=0,b;for(b in this.map)a++;return a};mxDictionary.prototype.getKeys=function(){var a=[],b;for(b in this.map)a.push(b);return a};mxDictionary.prototype.getValues=function(){var a=[],b;for(b in this.map)a.push(this.map[b]);return a};mxDictionary.prototype.visit=function(a){for(var b in this.map)a(b,this.map[b])}; var mxResources={resources:{},extension:mxResourceExtension,resourcesEncoded:!1,loadDefaultBundle:!0,loadSpecialBundle:!0,isLanguageSupported:function(a){return null!=mxClient.languages?0<=mxUtils.indexOf(mxClient.languages,a):!0},getDefaultBundle:function(a,b){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(b)?a+mxResources.extension:null},getSpecialBundle:function(a,b){if(null==mxClient.languages||!this.isLanguageSupported(b)){var c=b.indexOf("-");0<c&&(b=b.substring(0,c))}return mxResources.loadSpecialBundle&& mxResources.isLanguageSupported(b)&&b!=mxClient.defaultLanguage?a+"_"+b+mxResources.extension:null},add:function(a,b,c){b=null!=b?b:null!=mxClient.language?mxClient.language.toLowerCase():mxConstants.NONE;if(b!=mxConstants.NONE){var d=mxResources.getDefaultBundle(a,b),e=mxResources.getSpecialBundle(a,b),f=function(){if(null!=e)if(c)mxUtils.get(e,function(l){mxResources.parse(l.getText());c()},function(){c()});else try{var k=mxUtils.load(e);k.isReady()&&mxResources.parse(k.getText())}catch(l){}else null!= c&&c()};if(null!=d)if(c)mxUtils.get(d,function(k){mxResources.parse(k.getText());f()},function(){f()});else try{var g=mxUtils.load(d);g.isReady()&&mxResources.parse(g.getText());f()}catch(k){}else f()}},parse:function(a){if(null!=a){a=a.split("\n");for(var b=0;b<a.length;b++)if("#"!=a[b].charAt(0)){var c=a[b].indexOf("=");if(0<c){var d=a[b].substring(0,c),e=a[b].length;13==a[b].charCodeAt(e-1)&&e--;c=a[b].substring(c+1,e);this.resourcesEncoded?(c=c.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[d]= unescape(c)):mxResources.resources[d]=c}}}},containsKey:function(a){return null!=mxResources.resources[a]},get:function(a,b,c){a=mxResources.resources[a];null==a&&(a=c);null!=a&&null!=b&&(a=mxResources.replacePlaceholders(a,b));return a},replacePlaceholders:function(a,b){for(var c=[],d=null,e=0;e<a.length;e++){var f=a.charAt(e);"{"==f?d="":null!=d&&"}"==f?(d=parseInt(d)-1,0<=d&&d<b.length&&c.push(b[d]),d=null):null!=d?d+=f:c.push(f)}return c.join("")},loadResources:function(a){mxResources.add(mxClient.basePath+ "/resources/editor",null,function(){mxResources.add(mxClient.basePath+"/resources/graph",null,a)})}};function mxPoint(a,b){this.x=null!=a?a:0;this.y=null!=b?b:0}mxPoint.prototype.x=null;mxPoint.prototype.y=null;mxPoint.prototype.equals=function(a){return null!=a&&a.x==this.x&&a.y==this.y};mxPoint.prototype.clone=function(){return mxUtils.clone(this)};function mxRectangle(a,b,c,d){mxPoint.call(this,a,b);this.width=null!=c?c:0;this.height=null!=d?d:0}mxRectangle.prototype=new mxPoint; mxRectangle.prototype.constructor=mxRectangle;mxRectangle.prototype.width=null;mxRectangle.prototype.height=null;mxRectangle.prototype.setRect=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d};mxRectangle.prototype.getCenterX=function(){return this.x+this.width/2};mxRectangle.prototype.getCenterY=function(){return this.y+this.height/2}; mxRectangle.prototype.add=function(a){if(null!=a){var b=Math.min(this.x,a.x),c=Math.min(this.y,a.y),d=Math.max(this.x+this.width,a.x+a.width);a=Math.max(this.y+this.height,a.y+a.height);this.x=b;this.y=c;this.width=d-b;this.height=a-c}};mxRectangle.prototype.intersect=function(a){if(null!=a){var b=this.x+this.width,c=a.x+a.width,d=this.y+this.height,e=a.y+a.height;this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.width=Math.min(b,c)-this.x;this.height=Math.min(d,e)-this.y}}; mxRectangle.prototype.intersectsPoint=function(a,b){return a>=this.x&&a<=this.x+this.width&&b>=this.y&&b<=this.y+this.height};mxRectangle.prototype.grow=function(a){this.x-=a;this.y-=a;this.width+=2*a;this.height+=2*a;return this};mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)};mxRectangle.prototype.rotate90=function(){var a=(this.width-this.height)/2;this.x+=a;this.y-=a;a=this.width;this.width=this.height;this.height=a}; mxRectangle.prototype.equals=function(a){return null!=a&&a.x==this.x&&a.y==this.y&&a.width==this.width&&a.height==this.height};mxRectangle.fromPoint=function(a){return new mxRectangle(a.x,a.y,0,0)};mxRectangle.fromRectangle=function(a){return new mxRectangle(a.x,a.y,a.width,a.height)}; var mxEffects={animateChanges:function(a,b,c){var d=0,e=function(){for(var g=!1,k=0;k<b.length;k++){var l=b[k];if(l instanceof mxGeometryChange||l instanceof mxTerminalChange||l instanceof mxValueChange||l instanceof mxChildChange||l instanceof mxStyleChange){var m=a.getView().getState(l.cell||l.child,!1);if(null!=m)if(g=!0,l.constructor!=mxGeometryChange||a.model.isEdge(l.cell))mxUtils.setOpacity(m.shape.node,100*d/10);else{var n=a.getView().scale,p=(l.geometry.x-l.previous.x)*n,q=(l.geometry.y- l.previous.y)*n,r=(l.geometry.width-l.previous.width)*n;n*=l.geometry.height-l.previous.height;0==d?(m.x-=p,m.y-=q,m.width-=r,m.height-=n):(m.x+=p/10,m.y+=q/10,m.width+=r/10,m.height+=n/10);a.cellRenderer.redraw(m);mxEffects.cascadeOpacity(a,l.cell,100*d/10)}}}10>d&&g?(d++,window.setTimeout(e,f)):null!=c&&c()},f=30;e()},cascadeOpacity:function(a,b,c){for(var d=a.model.getChildCount(b),e=0;e<d;e++){var f=a.model.getChildAt(b,e),g=a.getView().getState(f);null!=g&&(mxUtils.setOpacity(g.shape.node,c), mxEffects.cascadeOpacity(a,f,c))}b=a.model.getEdges(b);if(null!=b)for(e=0;e<b.length;e++)d=a.getView().getState(b[e]),null!=d&&mxUtils.setOpacity(d.shape.node,c)},fadeOut:function(a,b,c,d,e,f){d=d||40;e=e||30;var g=b||100;mxUtils.setOpacity(a,g);if(f||null==f){var k=function(){g=Math.max(g-d,0);mxUtils.setOpacity(a,g);0<g?window.setTimeout(k,e):(a.style.visibility="hidden",c&&a.parentNode&&a.parentNode.removeChild(a))};window.setTimeout(k,e)}else a.style.visibility="hidden",c&&a.parentNode&&a.parentNode.removeChild(a)}}, mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",lightDarkColorSupported:function(){var a=document.createElement("div");a.style.color="light-dark(white, black)";a=a.style.color;null!=a&&"generic-light-dark("===a.substring(0,19)&&(a=a.replace("generic-light-dark","light-dark"));return"light-dark(white, black)"===a}(),preferDarkColor:!1,lightDarkColorRegex:/light-dark\(\s*(#[0-9a-fA-F]{3,8}|rgba?\([^)]+\)|var\([^)]+\)|[a-zA-Z]+)\s*,\s*(#[0-9a-fA-F]{3,8}|rgba?\([^)]+\)|var\([^)]+\)|[a-zA-Z]+)\s*\)/, varColorRegex:/^var\([^)]+\)/,hexColorRegex:/(^#[a-zA-Z0-9]*$)/,rgbaColorRegex:/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i,canvasContext:function(){var a=null;try{a=document.createElement("canvas").getContext("2d")}catch(b){}return a}(),validInvalidColor:"rgba(0, 0, 0, 0)",normalizedValidInvalidColor:"rgba(0,0,0,0)",removeCursors:function(a){null!=a.style&&(a.style.cursor="");a=a.childNodes;if(null!=a)for(var b=a.length,c=0;c<b;c+=1)mxUtils.removeCursors(a[c])},getCurrentStyle:function(a){return null!= a?window.getComputedStyle(a,""):null},getCssFontFamily:function(a){if("string"===typeof a){a=a.split(",");for(var b=0;b<a.length;b++)a[b]=mxUtils.trim(a[b]),'"'==a[b].charAt(0)&&'"'==a[b].charAt(a[b].length-1)&&(a[b]=a[b].substring(1,a[b].length-1));a=a.join(", ")}return a},parseCssFontFamily:function(a,b){if("string"===typeof a){a=a.split(",");for(var c=0;c<a.length;c++){a[c]=mxUtils.trim(a[c]);var d=2<a[c].length&&('"'==a[c].charAt(a[c].length-1)&&'"'==a[c].charAt(0)||"'"==a[c].charAt(a[c].length- 1)&&"'"==a[c].charAt(0));d&&(a[c]=a[c].substring(1,a[c].length-1));d=d||!/^-?[A-Za-z_\u00A0-\uFFFF][\w\u00A0-\uFFFF-]*$/.test(a[c]);b&&(a[c]=mxUtils.htmlEntities(a[c]));d&&(a[c]="'"+a[c].replace(/'/g,"\\'")+"'")}a=a.join(", ")}return a},parseCssNumber:function(a){"thin"==a?a="2":"medium"==a?a="4":"thick"==a&&(a="6");a=parseFloat(a);isNaN(a)&&(a=0);return a},parseCssSpacing:function(a){var b=null;if(null!=a&&""!==a){var c=String(a).split(/\s+/);a=[];for(var d=0;d<c.length&&4>a.length;d++)if(0<c[d].length){var e= parseFloat(c[d]);a.push(isFinite(e)?Math.max(0,e):0)}0<a.length&&(c=a[0],d=1<a.length?a[1]:c,e=2<a.length?a[2]:c,a=3<a.length?a[3]:d,0<c||0<d||0<e||0<a)&&(b={top:c,right:d,bottom:e,left:a})}return b},setPrefixedStyle:function(){var a=null;mxClient.IS_OT?a="O":mxClient.IS_SF||mxClient.IS_GC?a="Webkit":mxClient.IS_MT&&(a="Moz");return function(b,c,d){b[c]=d;null!=a&&0<c.length&&(c=a+c.substring(0,1).toUpperCase()+c.substring(1),b[c]=d)}}(),hasScrollbars:function(a){a=mxUtils.getCurrentStyle(a);return null!= a&&("scroll"==a.overflow||"auto"==a.overflow)},bind:function(a,b){return function(){return b.apply(a,arguments)}},eval:function(a){var b=null;if(0<=a.indexOf("function"))try{eval("var _mxJavaScriptExpression="+a),b=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(c){mxLog.warn(c.message+" while evaluating "+a)}else try{b=eval(a)}catch(c){mxLog.warn(c.message+" while evaluating "+a)}return b},findNode:function(a,b,c){if(a.nodeType==mxConstants.NODETYPE_ELEMENT){var d=a.getAttribute(b);if(null!= d&&d==c)return a}for(a=a.firstChild;null!=a;){d=mxUtils.findNode(a,b,c);if(null!=d)return d;a=a.nextSibling}return null},getFunctionName:function(a){var b=null;null!=a&&(null!=a.name?b=a.name:(b=mxUtils.trim(a.toString()),/^function\s/.test(b)&&(b=mxUtils.ltrim(b.substring(9)),a=b.indexOf("("),0<a&&(b=b.substring(0,a)))));return b},indexOf:function(a,b){if(null!=a&&null!=b)for(var c=0;c<a.length;c++)if(a[c]==b)return c;return-1},lastIndexOf:function(a,b){if(null!=a&&null!=b)for(var c=a.length-1;0<= c;c--)if(a[c]==b)return c;return-1},forEach:function(a,b){if(null!=a&&null!=b)for(var c=0;c<a.length;c++)b(a[c]);return a},remove:function(a,b){var c=null;if("object"==typeof b)for(var d=mxUtils.indexOf(b,a);0<=d;)b.splice(d,1),c=a,d=mxUtils.indexOf(b,a);for(var e in b)b[e]==a&&(delete b[e],c=a);return c},addItems:function(a,b){for(var c=0;c<b.length;c++)null!=b[c]&&(b[c].constructor==Array?mxUtils.addItems(a,b[c]):0>mxUtils.indexOf(a,b[c])&&a.push(b[c]));return a},isNode:function(a,b,c,d){return null== a||a.constructor!==Element||null!=b&&a.nodeName.toLowerCase()!=b.toLowerCase()?!1:null==c||a.getAttribute(c)==d},isAncestorNode:function(a,b){for(;null!=b;){if(b==a)return!0;b=b.parentNode}return!1},visitNodes:function(a,b){if(a.nodeType==mxConstants.NODETYPE_ELEMENT)for(b(a),a=a.firstChild;null!=a;)mxUtils.visitNodes(a,b),a=a.nextSibling},getChildNodes:function(a,b){b=b||mxConstants.NODETYPE_ELEMENT;var c=[];for(a=a.firstChild;null!=a;)a.nodeType==b&&c.push(a),a=a.nextSibling;return c},removeChildNodes:function(a){for(;null!= a.lastChild;)a.removeChild(a.lastChild)},importNode:function(a,b,c){return a.importNode(b,c)},importNodeImplementation:function(a,b,c){switch(b.nodeType){case 1:var d=a.createElement(b.nodeName);if(b.attributes&&0<b.attributes.length)for(var e=0;e<b.attributes.length;e++)d.setAttribute(b.attributes[e].nodeName,b.getAttribute(b.attributes[e].nodeName));if(c&&b.childNodes&&0<b.childNodes.length)for(e=0;e<b.childNodes.length;e++)d.appendChild(mxUtils.importNodeImplementation(a,b.childNodes[e],c));return d; case 3:case 4:case 8:return a.createTextNode(null!=b.nodeValue?b.nodeValue:b.value)}},createXmlDocument:function(){var a=null;document.implementation&&document.implementation.createDocument&&(a=document.implementation.createDocument("","",null));return a},parseXml:function(a){var b=new DOMParser,c=b.parseFromString(a,"text/xml"),d=null!=c?c.getElementsByTagName("parsererror"):null;null!=d&&0<d.length&&(c=b.parseFromString(mxUtils.repairXml(a),"text/xml"));return c},htmlEntityCodes:{nbsp:160,iexcl:161, cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212, Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402, circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982, ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709, nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,"int":8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},repairXml:function(a){a=mxUtils.zapGremlins(a); a=a.split(/(<!\[CDATA\[[\s\S]*?\]\]>)/);for(var b=0;b<a.length;b+=2)a[b]=a[b].replace(/&(?:#([0-9]+);|#[xX]([0-9a-fA-F]+);|([a-zA-Z][a-zA-Z0-9]*);)?/g,function(c,d,e,f){if(null!=d||null!=e)return d=null!=d?parseInt(d,10):parseInt(e,16),(32<=d||9==d||10==d||13==d)&&(55296>d||57343<d)&&65534!=d&&65535!=d&&1114111>=d?c:"";if(null!=f){if("amp"==f||"lt"==f||"gt"==f||"quot"==f||"apos"==f)return c;d=mxUtils.htmlEntityCodes[f];return null!=d?"&#"+d+";":"&"+f+";"}return"&"});return a.join("")},getSvgDefs:function(a){var b= a.ownerDocument,c=a.getElementsByTagName("defs");0==c.length||c[0].parentNode!=a?(b=null!=b.createElementNS?b.createElementNS(mxConstants.NS_SVG,"defs"):b.createElement("defs"),null!=a.firstChild?a.insertBefore(b,a.firstChild):a.appendChild(b)):b=c[0];return b},clearSelection:function(){return document.selection?function(){document.selection.empty()}:window.getSelection?function(){window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges()}: function(){}}(),removeWhitespace:function(a,b){for(a=b?a.previousSibling:a.nextSibling;null!=a&&a.nodeType==mxConstants.NODETYPE_TEXT;){var c=b?a.previousSibling:a.nextSibling,d=mxUtils.getTextContent(a);0==mxUtils.trim(d).length&&a.parentNode.removeChild(a);a=c}},htmlEntities:function(a,b,c,d){a=String(null!=a?a:"");a=a.replace(/&/g,"&");a=a.replace(/</g,"<");a=a.replace(/>/g,">");if(null==c||c)a=a.replace(/"/g,"""),a=a.replace(/'/g,"'");if(null==b||b)a=a.replace(/\n/g,"
"); if(null==d||d)a=a.replace(/\t/g,"	");return a},decodeHtml:function(a){var b=document.createElement("textarea");b.innerHTML=a;return b.value},safeDecodeURIComponent:function(a){try{return decodeURIComponent(a)}catch(b){return a}},getXml:function(a,b){a=mxUtils.zapGremlins((new XMLSerializer).serializeToString(a));return a.replace(/\n/g,b||"
")},getPrettyXml:function(a,b,c,d,e){var f=[];if(null!=a)if(b=null!=b?b:" ",c=null!=c?c:"",d=null!=d?d:"\n",null!=a.namespaceURI&&a.namespaceURI!=e&&(e= a.namespaceURI,null==a.getAttribute("xmlns")&&a.setAttribute("xmlns",a.namespaceURI)),a.nodeType==mxConstants.NODETYPE_DOCUMENT)f.push(mxUtils.getPrettyXml(a.documentElement,b,c,d,e));else if(a.nodeType==mxConstants.NODETYPE_DOCUMENT_FRAGMENT){var g=a.firstChild;if(null!=g)for(;null!=g;)f.push(mxUtils.getPrettyXml(g,b,c,d,e)),g=g.nextSibling}else if(a.nodeType==mxConstants.NODETYPE_COMMENT)a=mxUtils.zapGremlins(mxUtils.getTextContent(a)),0<a.length&&f.push(c+"\x3c!--"+a+"--\x3e"+d);else if(a.nodeType== mxConstants.NODETYPE_TEXT)a=mxUtils.zapGremlins(mxUtils.trim(mxUtils.getTextContent(a))),0<a.length&&f.push(c+mxUtils.htmlEntities(a,!1,!1)+d);else if(a.nodeType==mxConstants.NODETYPE_CDATA)a=mxUtils.zapGremlins(mxUtils.getTextContent(a)),0<a.length&&f.push(c+"<![CDATA["+a+"]]\x3e"+d);else{f.push(c+"<"+a.nodeName);g=a.attributes;if(null!=g)for(var k=0;k<g.length;k++){var l=mxUtils.htmlEntities(mxUtils.zapGremlins(g[k].value)).replace(/\r/g,"
");f.push(" "+g[k].nodeName+'="'+l+'"')}g=a.firstChild; if(null!=g){for(f.push(">"+d);null!=g;)f.push(mxUtils.getPrettyXml(g,b,c+b,d,e)),g=g.nextSibling;f.push(c+"</"+a.nodeName+">"+d)}else f.push(" />"+d)}return f.join("")},extractTextWithWhitespace:function(a){function b(e){if(1!=e.length||"BR"!=e[0].nodeName&&"\n"!=e[0].innerHTML)for(var f=0;f<e.length;f++){var g=e[f];"BR"==g.nodeName||"\n"==g.innerHTML||(1==e.length||0==f)&&"DIV"==g.nodeName&&"<br>"==g.innerHTML.toLowerCase()?d.push("\n"):(3===g.nodeType||4===g.nodeType?0<g.nodeValue.length&&d.push(g.nodeValue): 8!==g.nodeType&&0<g.childNodes.length&&b(g.childNodes),f<e.length-1&&0<=mxUtils.indexOf(c,e[f+1].nodeName)&&d.push("\n"))}}var c="BLOCKQUOTE DIV H1 H2 H3 H4 H5 H6 OL P PRE TABLE UL".split(" "),d=[];b(a);return d.join("")},replaceTrailingNewlines:function(a,b){for(var c="";0<a.length&&"\n"==a.charAt(a.length-1);)a=a.substring(0,a.length-1),c+=b;return a+c},getNodeValue:function(a){a=a.firstChild;for(var b=[];null!=a;)a.nodeType!=mxConstants.NODETYPE_TEXT&&a.nodeType!=mxConstants.NODETYPE_CDATA||null== a.nodeValue||b.push(mxUtils.trim(a.nodeValue)),a=a.nextSibling;return 0<b.length?b.join(""):""},getTextContent:function(a){return null!=a?a[void 0===a.textContent?"text":"textContent"]:""},setTextContent:function(a,b){void 0!==a.innerText?a.innerText=b:a[void 0===a.textContent?"text":"textContent"]=b},getInnerHtml:function(a){return null!=a?(new XMLSerializer).serializeToString(a):""},getOuterHtml:function(a){return null!=a?(new XMLSerializer).serializeToString(a):""},write:function(a,b){b=a.ownerDocument.createTextNode(b); null!=a&&a.appendChild(b);return b},writeln:function(a,b){b=a.ownerDocument.createTextNode(b);null!=a&&(a.appendChild(b),a.appendChild(document.createElement("br")));return b},br:function(a,b){b=b||1;for(var c=null,d=0;d<b;d++)null!=a&&(c=a.ownerDocument.createElement("br"),a.appendChild(c));return c},button:function(a,b,c,d){c=null!=c?c:document;c=c.createElement("button");mxUtils.write(c,a);mxEvent.addListener(c,"click",function(e){b(e)});null!=d&&(c.className=d);return c},para:function(a,b){var c= document.createElement("p");mxUtils.write(c,b);null!=a&&a.appendChild(c);return c},addTransparentBackgroundFilter:function(a){a.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mxClient.imageBasePath+"/transparent.gif', sizingMethod='scale')"},linkAction:function(a,b,c,d,e){return mxUtils.link(a,b,function(){c.execute(d)},e)},linkInvoke:function(a,b,c,d,e,f){return mxUtils.link(a,b,function(){c[d](e)},f)},link:function(a,b,c,d){var e=document.createElement("span");e.style.color= "blue";e.style.textDecoration="underline";e.style.cursor="pointer";null!=d&&(e.style.paddingLeft=d+"px");mxEvent.addListener(e,"click",c);mxUtils.write(e,b);null!=a&&a.appendChild(e);return e},getDocumentSize:function(){var a=document.body,b=document.documentElement;try{return new mxRectangle(0,0,a.clientWidth||b.clientWidth,Math.max(a.clientHeight||0,b.clientHeight))}catch(c){return new mxRectangle}},fit:function(a,b){b=b||0;var c=mxUtils.getDocumentSize(),d=parseInt(a.offsetLeft),e=parseInt(a.offsetWidth), f=mxUtils.getDocumentScrollOrigin(a.ownerDocument),g=f.x;f=f.y;var k=g+c.width-b;d+e>k&&(a.style.left=Math.max(g+b,k-e)+"px");d=parseInt(a.offsetTop);e=parseInt(a.offsetHeight);c=f+c.height-b;d+e>c&&(a.style.top=Math.max(f+b,c-e)+"px")},load:function(a){a=new mxXmlRequest(a,null,"GET",!1);a.send();return a},get:function(a,b,c,d,e,f,g){a=new mxXmlRequest(a,null,"GET");var k=a.setRequestHeaders;g&&(a.setRequestHeaders=function(l,m){k.apply(this,arguments);for(var n in g)l.setRequestHeader(n,g[n])}); null!=d&&a.setBinary(d);a.send(b,c,e,f);return a},getAll:function(a,b,c){for(var d=a.length,e=[],f=0,g=function(){0==f&&null!=c&&c();f++},k=0;k<a.length;k++)(function(l,m){mxUtils.get(l,function(n){var p=n.getStatus();200>p||299<p?g():(e[m]=n,d--,0==d&&b(e))},g)})(a[k],k);0==d&&b(e)},post:function(a,b,c,d){return(new mxXmlRequest(a,b)).send(c,d)},submit:function(a,b,c,d){return(new mxXmlRequest(a,b)).simulate(c,d)},loadInto:function(a,b,c){b.addEventListener("load",c,!1);b.load(a)},getValue:function(a, b,c){a=null!=a?a[b]:null;null==a&&(a=c);return a},getColorValue:function(a,b,c){a=null!=a?a[b]:null;if(null==a||"default"==a)a=c;return a},getNumber:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c||0);return Number(a)},parsePadding:function(a){a=null!=a?String(a):"";try{a=decodeURIComponent(a)}catch(b){}a=a.trim().split(/\s+/).map(function(b){b=parseFloat(b);return isNaN(b)?0:b});return 1===a.length?{n:a[0],e:a[0],s:a[0],w:a[0]}:2===a.length?{n:a[0],e:a[1],s:a[0],w:a[1]}:3===a.length?{n:a[0],e:a[1], s:a[2],w:a[1]}:{n:a[0],e:a[1],s:a[2],w:a[3]}},isLightDarkColor:function(a){return"string"===typeof a&&"light-dark"==mxUtils.ltrim(a).substring(0,10)},isVarColor:function(a){return mxUtils.varColorRegex.test(a)},isHexColor:function(a){return mxUtils.hexColorRegex.test(a)},isRgbColor:function(a){return mxUtils.rgbaColorRegex.test(a)},isValidColor:function(a){if(null==a)return!1;a=String(a).replace(/\s/g,"");if(a.toLowerCase()==mxUtils.normalizedValidInvalidColor)return!0;mxUtils.canvasContext.fillStyle= mxUtils.validInvalidColor;mxUtils.canvasContext.fillStyle=a;return mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor},isDarkColor:function(a){a=mxUtils.parseColor(a);return null!=a?.3<a.a&&128>.213*a.r+.715*a.g+.072*a.b:!1},parseLightDarkColor:function(a,b,c){var d=a,e=null;null!=a&&(a=a.match(mxUtils.lightDarkColorRegex))&&3===a.length&&(d=mxUtils.trim(a[1]),e=mxUtils.trim(a[2]));null==e&&(c||mxUtils.isVarColor(d))&&(e=d);e=null!=e?e:null!=b?b:mxUtils.getInverseColor(d);return{light:d,dark:e}}, getInverseColor:function(a,b,c){function d(n){return Math.round(b/100*(255-n)+n*(1-b/100))}function e(n){return Math.round(Math.max(0,Math.min(255,n)))}c=null!=c?c:180;b=null!=b?b:93;var f=0,g=0,k=0,l=1;if("transparent"==a.toLowerCase())return a;l=mxUtils.parseColor(a);if(null==l)return a;f=l.r;g=l.g;k=l.b;l=l.a;f=d(f);g=d(g);k=d(k);a=[1,0,0,0,1,0,0,0,1];var m=Math.cos(c*Math.PI/180);c=Math.sin(c*Math.PI/180);a[0]=.2126+.7874*m-.2126*c;a[1]=.7152-.7152*m-.7152*c;a[2]=.0722-.0722*m+.9278*c;a[3]=.2126- .2126*m+.143*c;a[4]=.7152+(1-.7152)*m+.14*c;a[5]=.0722-.0722*m-.283*c;a[6]=.2126-.2126*m-.7874*c;a[7]=.7152-.7152*m+.7152*c;a[8]=.0722+.9278*m+.0722*c;c=e(a[0]*f+a[1]*g+a[2]*k);m=e(a[3]*f+a[4]*g+a[5]*k);f=e(a[6]*f+a[7]*g+a[8]*k);return"#"+(16777216|c<<16|m<<8|f).toString(16).slice(1)+(1>l?("0"+Math.round(255*l).toString(16)).slice(-2):"")},addAlphaToColor:function(a,b,c){null!=b&&null!=a&&"transparent"!=a&&(a=mxUtils.parseColor(a),a.a=c?b:a.a*b,a="rgba("+a.r+","+a.g+","+a.b+","+a.a+")");return a}, getLightDarkColor:function(a,b,c,d){var e={light:"transparent",dark:"transparent",cssText:"transparent"};null!=a&&a!=mxConstants.NONE&&("string"===typeof a?(a=mxUtils.parseLightDarkColor(a,c,d),e.light=mxUtils.addAlphaToColor(a.light,b),e.dark=mxUtils.addAlphaToColor(a.dark,b),e.cssText=mxUtils.lightDarkColorSupported?e.light==e.dark?e.light:"light-dark("+e.light+", "+e.dark+")":mxUtils.preferDarkColor?e.dark:e.light):(e.light=a,e.dark=a,e.cssText=a));return e},invertLightDarkColor:function(a){var b= {};b.light=a.dark;b.dark=a.light;b.cssText=b.light==b.dark?b.light:"light-dark("+b.light+", "+b.dark+")";return b},getColor:function(a,b,c){a=null!=a?a[b]:null;null==a?a=c:a==mxConstants.NONE&&(a=null);return a},isEmptyObject:function(a){for(var b in a)return!1;return!0},clone:function(a,b,c){c=null!=c?c:!1;var d=null;if(null!=a&&"function"==typeof a.constructor)if(a.constructor===Element)d=a.cloneNode(null!=c?!c:!1);else{d=new a.constructor;for(var e in a)e!=mxObjectIdentity.FIELD_NAME&&(null==b|| 0>mxUtils.indexOf(b,e))&&(d[e]=c||"object"!=typeof a[e]?a[e]:mxUtils.clone(a[e]))}return d},equalPoints:function(a,b){if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b)for(var c=0;c<a.length;c++)if(null!=a[c]&&null==b[c]||null==a[c]&&null!=b[c]||null!=a[c]&&null!=b[c]&&(a[c].x!=b[c].x||a[c].y!=b[c].y))return!1;return!0},equalEntries:function(a,b){var c=0;if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!= a&&null!=b){for(var d in b)c++;for(d in a)if(c--,!(mxUtils.isNaN(a[d])&&mxUtils.isNaN(b[d])||a[d]==b[d]))return!1}return 0==c},removeDuplicates:function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++)b.get(a[d])||(c.push(a[d]),b.put(a[d],!0));return c},isNaN:function(a){return"number"==typeof a&&isNaN(a)},extend:function(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},toString:function(a){var b="",c;for(c in a)try{if(null==a[c])b+=c+" = [null]\n"; else if("function"==typeof a[c])b+=c+" => [Function]\n";else if("object"==typeof a[c]){var d=mxUtils.getFunctionName(a[c].constructor);b+=c+" => ["+d+"]\n"}else b+=c+" = "+a[c]+"\n"}catch(e){b+=c+"="+e.message}return b},toRadians:function(a){return Math.PI*a/180},toDegree:function(a){return 180*a/Math.PI},arcToCurves:function(a,b,c,d,e,f,g,k,l){k-=a;l-=b;if(0===c||0===d)return A;c=Math.abs(c);d=Math.abs(d);var m=-k/2,n=-l/2,p=Math.cos(e*Math.PI/180);A=Math.sin(e*Math.PI/180);e=p*m+A*n;m=-1*A*m+p* n;n=e*e;var q=m*m,r=c*c,t=d*d,u=n/r+q/t;1<u?(c*=Math.sqrt(u),d*=Math.sqrt(u),f=0):(u=1,f===g&&(u=-1),f=u*Math.sqrt(Math.max(0,(r*t-r*q-t*n)/(r*q+t*n))));n=f*c*m/d;q=-1*f*d*e/c;k=p*n-A*q+k/2;l=A*n+p*q+l/2;r=Math.atan2((m-q)/d,(e-n)/c)-Math.atan2(0,1);f=0<=r?r:2*Math.PI+r;r=Math.atan2((-m-q)/d,(-e-n)/c)-Math.atan2((m-q)/d,(e-n)/c);e=0<=r?r:2*Math.PI+r;0==g&&0<e?e-=2*Math.PI:0!=g&&0>e&&(e+=2*Math.PI);g=2*e/Math.PI;g=Math.ceil(0>g?-1*g:g);e/=g;m=8/3*Math.sin(e/4)*Math.sin(e/4)/Math.sin(e/2);n=p*c;p*= d;c*=A;d*=A;var v=Math.cos(f),y=Math.sin(f);q=-m*(n*y+d*v);r=-m*(c*y-p*v);for(var A=[],z=0;z<g;++z){f+=e;v=Math.cos(f);y=Math.sin(f);t=n*v-d*y+k;u=c*v+p*y+l;var x=-m*(n*y+d*v);v=-m*(c*y-p*v);y=6*z;A[y]=Number(q+a);A[y+1]=Number(r+b);A[y+2]=Number(t-x+a);A[y+3]=Number(u-v+b);A[y+4]=Number(t+a);A[y+5]=Number(u+b);q=t+x;r=u+v}return A},getBoundingBox:function(a,b,c){var d=null;if(null!=a&&null!=b&&0!=b){b=mxUtils.toRadians(b);d=Math.cos(b);var e=Math.sin(b);c=null!=c?c:new mxPoint(a.x+a.width/2,a.y+ a.height/2);var f=new mxPoint(a.x,a.y);b=new mxPoint(a.x+a.width,a.y);var g=new mxPoint(b.x,a.y+a.height);a=new mxPoint(a.x,g.y);f=mxUtils.getRotatedPoint(f,d,e,c);b=mxUtils.getRotatedPoint(b,d,e,c);g=mxUtils.getRotatedPoint(g,d,e,c);a=mxUtils.getRotatedPoint(a,d,e,c);d=new mxRectangle(f.x,f.y,0,0);d.add(new mxRectangle(b.x,b.y,0,0));d.add(new mxRectangle(g.x,g.y,0,0));d.add(new mxRectangle(a.x,a.y,0,0))}return d},getRotatedPoint:function(a,b,c,d){d=null!=d?d:new mxPoint;var e=a.x-d.x;a=a.y-d.y;return new mxPoint(e* b-a*c+d.x,a*b+e*c+d.y)},getPortConstraints:function(a,b,c,d){b=mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT,mxUtils.getValue(b.style,c?mxConstants.STYLE_SOURCE_PORT_CONSTRAINT:mxConstants.STYLE_TARGET_PORT_CONSTRAINT,null));if(null==b)return d;d=b.toString();b=mxConstants.DIRECTION_MASK_NONE;c=0;1==mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0)&&(c=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0));a=0;45<c?(a=1,135<=c&&(a=2)):-45>c&&(a=3,-135>=c&&(a=2)); if(0<=d.indexOf(mxConstants.DIRECTION_NORTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:b|=mxConstants.DIRECTION_MASK_EAST;break;case 2:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:b|=mxConstants.DIRECTION_MASK_WEST}if(0<=d.indexOf(mxConstants.DIRECTION_WEST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_WEST;break;case 1:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:b|=mxConstants.DIRECTION_MASK_EAST;break;case 3:b|=mxConstants.DIRECTION_MASK_SOUTH}if(0<=d.indexOf(mxConstants.DIRECTION_SOUTH))switch(a){case 0:b|= mxConstants.DIRECTION_MASK_SOUTH;break;case 1:b|=mxConstants.DIRECTION_MASK_WEST;break;case 2:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:b|=mxConstants.DIRECTION_MASK_EAST}if(0<=d.indexOf(mxConstants.DIRECTION_EAST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_EAST;break;case 1:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:b|=mxConstants.DIRECTION_MASK_WEST;break;case 3:b|=mxConstants.DIRECTION_MASK_NORTH}return b},reversePortConstraints:function(a){var b=(a&mxConstants.DIRECTION_MASK_WEST)<< 3;b|=(a&mxConstants.DIRECTION_MASK_NORTH)<<1;b|=(a&mxConstants.DIRECTION_MASK_SOUTH)>>1;return b|(a&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(a,b,c){var d=-1;if(0<a.absolutePoints.length)for(var e=a.absolutePoints[0],f=null,g=1;g<a.absolutePoints.length;g++){var k=a.absolutePoints[g];e=mxUtils.ptSegDistSq(e.x,e.y,k.x,k.y,b,c);if(null==f||e<f)f=e,d=g-1;e=k}return d},getDirectedBounds:function(a,b,c,d,e){var f=mxUtils.getValue(c,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST); d=null!=d?d:mxUtils.getValue(c,mxConstants.STYLE_FLIPH,!1);e=null!=e?e:mxUtils.getValue(c,mxConstants.STYLE_FLIPV,!1);b.x=Math.round(Math.max(0,Math.min(a.width,b.x)));b.y=Math.round(Math.max(0,Math.min(a.height,b.y)));b.width=Math.round(Math.max(0,Math.min(a.width,b.width)));b.height=Math.round(Math.max(0,Math.min(a.height,b.height)));if(e&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||d&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.x,b.x=b.width,b.width= c;if(d&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||e&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.y,b.y=b.height,b.height=c;d=mxRectangle.fromRectangle(b);f==mxConstants.DIRECTION_SOUTH?(d.y=b.x,d.x=b.height,d.width=b.y,d.height=b.width):f==mxConstants.DIRECTION_WEST?(d.y=b.height,d.x=b.width,d.width=b.x,d.height=b.y):f==mxConstants.DIRECTION_NORTH&&(d.y=b.width,d.x=b.y,d.width=b.height,d.height=b.x);return new mxRectangle(a.x+d.x,a.y+d.y,a.width-d.width- d.x,a.height-d.height-d.y)},getPerimeterPoint:function(a,b,c){for(var d=null,e=0;e<a.length-1;e++){var f=mxUtils.intersection(a[e].x,a[e].y,a[e+1].x,a[e+1].y,b.x,b.y,c.x,c.y);if(null!=f){var g=c.x-f.x,k=c.y-f.y;f={p:f,distSq:k*k+g*g};null!=f&&(null==d||d.distSq>f.distSq)&&(d=f)}}return null!=d?d.p:null},intersectsPoints:function(a,b){for(var c=0;c<b.length-1;c++)if(mxUtils.rectangleIntersectsSegment(a,b[c],b[c+1]))return!0;return!1},rectangleIntersectsSegment:function(a,b,c){var d=a.y,e=a.x,f=d+a.height, g=e+a.width;a=b.x;var k=c.x;b.x>c.x&&(a=c.x,k=b.x);k>g&&(k=g);a<e&&(a=e);if(a>k)return!1;e=b.y;g=c.y;var l=c.x-b.x;1E-7<Math.abs(l)&&(c=(c.y-b.y)/l,b=b.y-c*b.x,e=c*a+b,g=c*k+b);e>g&&(b=g,g=e,e=b);g>f&&(g=f);e<d&&(e=d);return e>g?!1:!0},contains:function(a,b,c){return a.x<=b&&a.x+a.width>=b&&a.y<=c&&a.y+a.height>=c},intersects:function(a,b,c){var d=a.width,e=a.height,f=b.width,g=b.height;if(!c&&(0>=f||0>=g||0>=d||0>=e))return!1;c=a.x;a=a.y;var k=b.x;b=b.y;f+=k;g+=b;d+=c;e+=a;return(f<k||f>c)&&(g<b|| g>a)&&(d<c||d>k)&&(e<a||e>b)},intersectsHotspot:function(a,b,c,d,e,f){d=null!=d?d:1;e=null!=e?e:0;f=null!=f?f:0;if(0<d){var g=a.getCenterX(),k=a.getCenterY(),l=a.width,m=a.height,n=mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE)*a.view.scale;0<n&&(mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,!0)?(k=a.y+n/2,m=n):(g=a.x+n/2,l=n));l=Math.max(e,l*d);m=Math.max(e,m*d);0<f&&(l=Math.min(l,f),m=Math.min(m,f));d=new mxRectangle(g-l/2,k-m/2,l,m);g=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)|| 0);0!=g&&(e=Math.cos(-g),f=Math.sin(-g),g=new mxPoint(a.getCenterX(),a.getCenterY()),a=mxUtils.getRotatedPoint(new mxPoint(b,c),e,f,g),b=a.x,c=a.y);return mxUtils.contains(d,b,c)}return!0},getOffset:function(a,b){for(var c=0,d=0,e=!1,f=a,g=document.body,k=document.documentElement;null!=f&&f!=g&&f!=k&&!e;){var l=mxUtils.getCurrentStyle(f);null!=l&&(e=e||"fixed"==l.position);f=f.parentNode}b||e||(b=mxUtils.getDocumentScrollOrigin(a.ownerDocument),c+=b.x,d+=b.y);a=a.getBoundingClientRect();null!=a&& (c+=a.left,d+=a.top);return new mxPoint(c,d)},getDocumentScrollOrigin:function(a){a=a.defaultView||a.parentWindow;return new mxPoint(null!=a&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=a&&void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},getScrollOrigin:function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!0;for(var d=null!=a?a.ownerDocument:document, e=d.body,f=d.documentElement,g=new mxPoint,k=!1;null!=a&&a!=e&&a!=f;){isNaN(a.scrollLeft)||isNaN(a.scrollTop)||(g.x+=a.scrollLeft,g.y+=a.scrollTop);var l=mxUtils.getCurrentStyle(a);null!=l&&(k=k||"fixed"==l.position);a=b?a.parentNode:null}!k&&c&&(a=mxUtils.getDocumentScrollOrigin(d),g.x+=a.x,g.y+=a.y);return g},convertPoint:function(a,b,c){var d=mxUtils.getScrollOrigin(a,!1);a=mxUtils.getOffset(a);a.x-=d.x;a.y-=d.y;return new mxPoint(b-a.x,c-a.y)},removeJavascriptProtocol:function(a){for(a=null!= a?mxUtils.zapGremlins(a):null;null!=a&&"javascript:"===mxUtils.ltrim(a.toLowerCase()).substring(0,11);)a=a.substring(a.toLowerCase().indexOf(":")+1);return a},zapGremlins:function(a){for(var b=0,c=[],d=0;d<a.length;d++){var e=a.charCodeAt(d),f=(32<=e||9==e||10==e||13==e)&&65535!=e&&65534!=e;f&&55296<=e&&57343>=e&&(56319>=e?(e=d+1<a.length?a.charCodeAt(d+1):0,f=56320<=e&&57343>=e):(e=0<d?a.charCodeAt(d-1):0,f=55296<=e&&56319>=e));f||(c.push(a.substring(b,d)),b=d+1)}0<b&&b<a.length&&c.push(a.substring(b)); return 0==c.length?a:c.join("")},ltrim:function(a,b){return null!=a?a.replace(new RegExp("^["+(b||"\\s|\\0")+"]+","g"),""):null},rtrim:function(a,b){return null!=a?a.replace(new RegExp("["+(b||"\\s|\\0")+"]+$","g"),""):null},trim:function(a,b){return mxUtils.ltrim(mxUtils.rtrim(a,b),b)},hashCode:function(a){for(var b=5381,c=0;c<a.length;c++)b=(b<<5)+b+a.charCodeAt(c)|0;return(b>>>0).toString(36)},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)&&("string"!=typeof a||0>a.toLowerCase().indexOf("0x"))}, isInteger:function(a){return String(parseInt(a))===String(a)},mod:function(a,b){return(a%b+b)%b},intersection:function(a,b,c,d,e,f,g,k){var l=(k-f)*(c-a)-(g-e)*(d-b);g=((g-e)*(b-f)-(k-f)*(a-e))/l;e=((c-a)*(b-f)-(d-b)*(a-e))/l;return-1E-6<=g&&1.000001>=g&&-1E-6<=e&&1.000001>=e?new mxPoint(a+g*(c-a),b+g*(d-b)):null},ptSegDistSq:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;0>=e*c+f*d?c=0:(e=c-e,f=d-f,a=e*c+f*d,c=0>=a?0:a*a/(c*c+d*d));e=e*e+f*f-c;0>e&&(e=0);return e},ptLineDist:function(a,b,c,d,e,f){return Math.abs((d- b)*e-(c-a)*f+c*b-d*a)/Math.sqrt((d-b)*(d-b)+(c-a)*(c-a))},relativeCcw:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;a=e*d-f*c;0==a&&(a=e*c+f*d,0<a&&(a=(e-c)*c+(f-d)*d,0>a&&(a=0)));return 0>a?-1:0<a?1:0},animateChanges:function(a,b){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(a,b,c){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(a,b,c,d,e,f){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(a,b){a.style.opacity=b/100},createElementNs:function(a, b,c){if(null!=a.createElementNS)return a.createElementNS(b,c);a=a.createElement(c);null!=namespace&&a.setAttribute("xmlns",b);return a},createImage:function(a){var b=document.createElement("img");b.setAttribute("src",a);b.setAttribute("border","0");return b},sortCells:function(a,b){b=null!=b?b:!0;var c=new mxDictionary;a.sort(function(d,e){var f=c.get(d);null==f&&(f=mxCellPath.create(d).split(mxCellPath.PATH_SEPARATOR),c.put(d,f));d=c.get(e);null==d&&(d=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR), c.put(e,d));e=mxCellPath.compare(f,d);return 0==e?0:0<e==b?1:-1});return a},getStylename:function(a){return null!=a&&(a=a.split(";")[0],0>a.indexOf("="))?a:""},getStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0>a[c].indexOf("=")&&b.push(a[c])}return b},indexOfStylename:function(a,b){if(null!=a&&null!=b){a=a.split(";");for(var c=0,d=0;d<a.length;d++){if(a[d]==b)return c;c+=a[d].length+1}}return-1},addStylename:function(a,b){0>mxUtils.indexOfStylename(a,b)&&(null== a?a="":0<a.length&&";"!=a.charAt(a.length-1)&&(a+=";"),a+=b);return a},removeStylename:function(a,b){var c=[];if(null!=a){a=a.split(";");for(var d=0;d<a.length;d++)a[d]!=b&&c.push(a[d])}return c.join(";")},removeAllStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0<=a[c].indexOf("=")&&b.push(a[c])}return b.join(";")},setCellStyles:function(a,b,c,d){if(null!=b&&0<b.length){a.beginUpdate();try{for(var e=0;e<b.length;e++)if(null!=b[e]){var f=mxUtils.setStyle(a.getStyle(b[e]), c,d);a.setStyle(b[e],f)}}finally{a.endUpdate()}}},parseColorList:function(a){var b=[],c=a.match(/var\([^)]+\)|light-dark\([^)]+\)|(?:rgba?|hsla?|hwb|lab|lch|color)\([^)]+\)|#[0-9a-f]{3,8}|[a-z-]+/gi);if(c)return c;""!==a.trim()&&b.push(a.trim());return b},parseColor:function(a,b){b=null!=b?b:1;var c=null;if(null!=a&&a!=mxConstants.NONE){if(mxUtils.isRgbColor(a)){a=a.replace(/[^\d,.]/g,"").split(",");c=parseInt(a[0]);var d=parseInt(a[1]),e=parseInt(a[2]);4==a.length&&(b=parseFloat(a[3]))}else mxUtils.isHexColor(a)|| (a=mxUtils.color2hex(a)),a=a.substring(1),c=parseInt(a.substr(0,2),16),d=parseInt(a.substr(2,2),16),e=parseInt(a.substr(4,2),16),6<a.length&&(b=(parseInt(a.substr(6,2),16)/255).toFixed(3));c={r:c,g:d,b:e,a:b}}return c},hex2rgb:function(a){var b=mxUtils.parseColor(a);null!=b&&(a="rgb("+b.r+", "+b.g+", "+b.b+")");return a},hex2rgba:function(a,b){b=mxUtils.parseColor(a,b);null!=b&&(a="rgba("+b.r+", "+b.g+", "+b.b+", "+b.a+")");return a},rgba2hex:function(a){var b=mxUtils.parseColor(a);return null!=b? "#"+("0"+b.r.toString(16)).slice(-2)+("0"+b.g.toString(16)).slice(-2)+("0"+b.b.toString(16)).slice(-2)+(1>b.a?("0"+Math.round(255*b.a).toString(16)).slice(-2):""):a},color2hex:function(a,b){b=null!=b?b:"#000000";try{null!=a&&(a=String(a).replace(/\s/g,""),a.toLowerCase()==mxUtils.normalizedValidInvalidColor?b="#000000":(mxUtils.canvasContext.fillStyle=mxUtils.validInvalidColor,mxUtils.canvasContext.fillStyle=a,mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor?(b=mxUtils.canvasContext.fillStyle, mxUtils.isRgbColor(b)&&(b=mxUtils.rgba2hex(b))):1<a.length&&"#"==a.charAt(0)&&(mxUtils.canvasContext.fillStyle=a.substring(1),mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor&&(b=mxUtils.canvasContext.fillStyle))))}catch(c){}return b},setStyle:function(a,b,c){var d=null!=c&&("undefined"==typeof c.length||0<c.length);null!=a&&"string"!==typeof a&&(a=""+a);if(null==a||0==a.length)d&&(a=b+"="+c+";");else if(a.substring(0,b.length+1)==b+"="){var e=a.indexOf(";");if(d)a=b+"="+c+(0>e?";":a.substring(e)); else{for(;0<=e&&";"==a.charAt(e+1);)e++;a=0>e||e==a.length-1?"":a.substring(e+1)}}else{var f=a.indexOf(";"+b+"=");0>f?d&&(d=";"==a.charAt(a.length-1)?"":";",a=a+d+b+"="+c+";"):(e=a.indexOf(";",f+1),a=d?a.substring(0,f+1)+b+"="+c+(0>e?";":a.substring(e)):a.substring(0,f)+(0>e?";":a.substring(e)))}return a},setCellStyleFlags:function(a,b,c,d,e){if(null!=b&&0<b.length){a.beginUpdate();try{for(var f=0;f<b.length;f++)if(null!=b[f]){var g=mxUtils.setStyleFlag(a.getStyle(b[f]),c,d,e);a.setStyle(b[f],g)}}finally{a.endUpdate()}}}, setStyleFlag:function(a,b,c,d){if(null==a||"string"!==typeof a||0==a.length)a=d||null==d?b+"="+c:b+"=0";else{var e=a.indexOf(b+"=");if(0>e)e=";"==a.charAt(a.length-1)?"":";",a=d||null==d?a+e+b+"="+c:a+e+b+"=0";else{var f=a.indexOf(";",e),g=0>f?a.substring(e+b.length+1):a.substring(e+b.length+1,f);g=null==d?parseInt(g)^c:d?parseInt(g)|c:parseInt(g)&~c;a=a.substring(0,e)+b+"="+g+(0<=f?a.substring(f):"")}}return a},getAlignmentAsPoint:function(a,b){var c=-.5,d=-.5;a==mxConstants.ALIGN_LEFT?c=0:a==mxConstants.ALIGN_RIGHT&& (c=-1);b==mxConstants.ALIGN_TOP?d=0:b==mxConstants.ALIGN_BOTTOM&&(d=-1);return new mxPoint(c,d)},_measureDiv:null,_measureCache:null,getSizeForString:function(a,b,c,d,e){b=null!=b?b:mxConstants.DEFAULT_FONTSIZE;c=null!=c?c:mxConstants.DEFAULT_FONTFAMILY;e=null!=e?e:0;if(null==mxUtils._measureDiv){var f=document.createElement("div");f.style.position="absolute";f.style.visibility="hidden";f.style.display="inline-block";f.style.zoom="1";document.body.appendChild(f);mxUtils._measureDiv=f;mxUtils._measureCache= {}}f=mxUtils._measureDiv;var g=mxUtils._measureCache,k=Math.round(b)+"px";b=mxConstants.ABSOLUTE_LINE_HEIGHT?b*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*mxSvgCanvas2D.prototype.lineHeightCorrection;var l=(e&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold":"",m=(e&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic":"",n="";(e&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(n="underline");(e&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&(n=0<n.length? n+" line-through":"line-through");e=null!=d?"normal":"nowrap";d=null!=d?d+"px":"";g.fontFamily!==c&&(f.style.fontFamily=c,g.fontFamily=c);g.fontSizePx!==k&&(f.style.fontSize=k,g.fontSizePx=k);g.lineHeight!==b&&(f.style.lineHeight=b,g.lineHeight=b);g.fontWeight!==l&&(f.style.fontWeight=l,g.fontWeight=l);g.fontStyleCss!==m&&(f.style.fontStyle=m,g.fontStyleCss=m);g.txtDecor!==n&&(f.style.textDecoration=n,g.txtDecor=n);g.whiteSpace!==e&&(f.style.whiteSpace=e,g.whiteSpace=e);g.widthPx!==d&&(f.style.width= d,g.widthPx=d);g.text!==a&&(f.innerHTML=a,g.text=a);return new mxRectangle(0,0,f.offsetWidth,f.offsetHeight)},getViewXml:function(a,b,c,d,e){d=null!=d?d:0;e=null!=e?e:0;b=null!=b?b:1;null==c&&(c=[a.getModel().getRoot()]);var f=a.getView(),g=null,k=f.isEventsEnabled();f.setEventsEnabled(!1);var l=f.drawPane,m=f.overlayPane;a.dialect==mxConstants.DIALECT_SVG?(f.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),f.canvas.appendChild(f.drawPane),f.overlayPane=document.createElementNS(mxConstants.NS_SVG, "g")):(f.drawPane=f.drawPane.cloneNode(!1),f.canvas.appendChild(f.drawPane),f.overlayPane=f.overlayPane.cloneNode(!1));f.canvas.appendChild(f.overlayPane);var n=f.getTranslate();f.translate=new mxPoint(d,e);b=new mxTemporaryCellStates(a.getView(),b,c);try{g=(new mxCodec).encode(a.getView())}finally{b.destroy(),f.translate=n,f.canvas.removeChild(f.drawPane),f.canvas.removeChild(f.overlayPane),f.drawPane=l,f.overlayPane=m,f.setEventsEnabled(k)}return g},getScaleForPageCount:function(a,b,c,d){if(1>a)return 1; c=null!=c?c:mxConstants.PAGE_FORMAT_A4_PORTRAIT;d=null!=d?d:0;var e=c.width-2*d;c=c.height-2*d;d=mxRectangle.fromRectangle(b.getGraphBounds());b=b.getView().getScale();d.width/=b;d.height/=b;b=d.width;var f=Math.sqrt(a);d=Math.sqrt(b/d.height/(e/c));c=f*d;d=f/d;if(1>c&&d>a){var g=d/a;d=a;c/=g}1>d&&c>a&&(g=c/a,c=a,d/=g);g=Math.ceil(c)*Math.ceil(d);for(f=0;g>a;){g=Math.floor(c)/c;var k=Math.floor(d)/d;1==g&&(g=Math.floor(c-1)/c);1==k&&(k=Math.floor(d-1)/d);g=g>k?g:k;c*=g;d*=g;g=Math.ceil(c)*Math.ceil(d); f++;if(10<f)break}return e*c/b*.99999},show:function(a,b,c,d,e,f){c=null!=c?c:0;d=null!=d?d:0;null==b?b=window.open().document:b.open();var g=a.getGraphBounds(),k=Math.ceil(c-g.x),l=Math.ceil(d-g.y);null==e&&(e=Math.ceil(g.width+c)+Math.ceil(Math.ceil(g.x)-g.x));null==f&&(f=Math.ceil(g.height+d)+Math.ceil(Math.ceil(g.y)-g.y));b.writeln("<html><head>");d=document.getElementsByTagName("base");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));d=document.getElementsByTagName("link");for(c= 0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));d=document.getElementsByTagName("style");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));b.writeln('</head><body style="margin:0px;"></body></html>');b.close();c=b.createElement("div");c.position="absolute";c.overflow="hidden";c.style.width=e+"px";c.style.height=f+"px";e=b.createElement("div");e.style.position="absolute";e.style.left=k+"px";e.style.top=l+"px";f=a.container.firstChild;for(d=null;null!=f;)g=f.cloneNode(!0),f==a.view.drawPane.ownerSVGElement? (c.appendChild(g),d=g):e.appendChild(g),f=f.nextSibling;b.body.appendChild(c);null!=e.firstChild&&b.body.appendChild(e);null!=d&&(d.style.minWidth="",d.style.minHeight="",d.firstChild.setAttribute("transform","translate("+k+","+l+")"));mxUtils.removeCursors(b.body);return b},printScreen:function(a){var b=window.open();mxUtils.show(a,b.document);a=function(){b.focus();b.print();b.close()};mxClient.IS_GC?b.setTimeout(a,500):a()},popup:function(a,b){if(b){var c=document.createElement("div");c.style.overflow= "scroll";c.style.width="636px";c.style.height="460px";b=document.createElement("pre");b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," ");c.appendChild(b);c=new mxWindow("Popup Window",c,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight)/2-240,640,480,!1,!0);c.setClosable(!0);c.setVisible(!0)}else mxClient.IS_NS?(c=window.open(),c.document.writeln("<pre>"+mxUtils.htmlEntities(a)+"</pre"),c.document.close()): (c=window.open(),b=c.document.createElement("pre"),b.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," "),c.document.body.appendChild(b))},alert:function(a){alert(a)},prompt:function(a,b){return prompt(a,null!=b?b:"")},confirm:function(a){return confirm(a)},error:function(a,b,c,d){var e=document.createElement("div");e.style.padding="20px";var f=document.createElement("img");f.setAttribute("src",d||mxUtils.errorImage);f.setAttribute("valign","bottom");f.style.verticalAlign= "middle";e.appendChild(f);e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));mxUtils.write(e,a);a=document.body.clientWidth;d=document.body.clientHeight||document.documentElement.clientHeight;var g=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,e,(a-b)/2,d/4,b,null,!1,!0);c&&(mxUtils.br(e),b=document.createElement("p"),c=document.createElement("button"),c.setAttribute("style","float:right"), mxEvent.addListener(c,"click",function(k){g.destroy()}),mxUtils.write(c,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),b.appendChild(c),e.appendChild(b),mxUtils.br(e),g.setClosable(!0));g.setVisible(!0);return g},makeDraggable:function(a,b,c,d,e,f,g,k,l,m){a=new mxDragSource(a,c);a.dragOffset=new mxPoint(null!=e?e:0,null!=f?f:mxConstants.TOOLTIP_VERTICAL_OFFSET);a.autoscroll=g;a.setGuidesEnabled(!1);null!=l&&(a.highlightDropTargets=l);null!=m&&(a.getDropTarget=m);a.getGraphForEvent= function(n){return"function"==typeof b?b(n):b};null!=d&&(a.createDragElement=function(){return d.cloneNode(!0)},k&&(a.createPreviewElement=function(n){var p=d.cloneNode(!0),q=parseInt(p.style.width),r=parseInt(p.style.height);p.style.width=Math.round(q*n.view.scale)+"px";p.style.height=Math.round(r*n.view.scale)+"px";return p}));return a},isVerticalTextDirection:function(a){return null!=a&&"string"===typeof a&&"vertical-"==a.substring(0,9)},canConvertHtmlToSvg:function(a,b){var c=document.createElement("div"); c.innerHTML=null!=a?a:"";return mxUtils.convertHtmlToSvg(c,null,null,b)},convertHtmlToSvg:function(a,b,c,d){d={dir:null!=d?d.dir:null,fontScale:null!=d?d.fontScale:null,fontSize:null!=d&&null!=d.fontSize?d.fontSize:mxConstants.DEFAULT_FONTSIZE,createElement:null!=d&&null!=d.createElement?d.createElement:function(f){return document.createElementNS(mxConstants.NS_SVG,f)}};if(mxUtils.isVerticalTextDirection(d.dir))return!1;b=null!=b?b:d.createElement("text");c=null!=c?c:new mxPoint(0,0);var e=!0;null!= a&&(e=mxUtils.containsBlockChild(a)?mxUtils.convertHtmlBlocksToSvg(a,b,c,d):mxUtils.containsBrElement(a)?mxUtils.convertHtmlWithBreaksToSvg(a,b,c,d.fontScale,d):mxUtils.convertHtmlInlineToSvg(a,b,c,d.fontScale,null,d));return e},getBlockElementStyle:function(a){switch(a){case "H1":return{sizeFactor:2,weight:"bold",family:null,marginTop:.67,marginBottom:.67,indent:0};case "H2":return{sizeFactor:1.5,weight:"bold",family:null,marginTop:.83,marginBottom:.83,indent:0};case "H3":return{sizeFactor:1.17, weight:"bold",family:null,marginTop:1,marginBottom:1,indent:0};case "H4":return{sizeFactor:1,weight:"bold",family:null,marginTop:1.33,marginBottom:1.33,indent:0};case "H5":return{sizeFactor:.83,weight:"bold",family:null,marginTop:1.67,marginBottom:1.67,indent:0};case "H6":return{sizeFactor:.67,weight:"bold",family:null,marginTop:2.33,marginBottom:2.33,indent:0};case "P":return{sizeFactor:1,weight:null,family:null,marginTop:1,marginBottom:1,indent:0};case "PRE":return{sizeFactor:1,weight:null,family:"monospace", marginTop:1,marginBottom:1,indent:0};case "BLOCKQUOTE":return{sizeFactor:1,weight:null,family:null,marginTop:1,marginBottom:1,indent:40};case "DIV":return{sizeFactor:1,weight:null,family:null,marginTop:0,marginBottom:0,indent:0};default:return null}},getMaxInlineFontSize:function(a,b){for(var c=b,d=0;d<a.childNodes.length;d++){var e=a.childNodes[d];if(e.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=e.style){var f=e.style.fontSize;null!=f&&""!=f&&("px"==f.slice(-2)?(f=parseFloat(f),isNaN(f)||(c=Math.max(c, f))):"pt"==f.slice(-2)?(f=parseFloat(f),isNaN(f)||(c=Math.max(c,4*f/3))):"em"==f.slice(-2)?(f=parseFloat(f),isNaN(f)||(c=Math.max(c,f*b))):"%"==f.slice(-1)&&(f=parseFloat(f),isNaN(f)||(c=Math.max(c,f/100*b))));e=mxUtils.getMaxInlineFontSize(e,b);c=Math.max(c,e)}}return c},containsBlockChild:function(a){for(var b=0;b<a.childNodes.length;b++)if(null!=mxUtils.getBlockElementStyle(a.childNodes[b].nodeName))return!0;return!1},convertHtmlBlocksToSvg:function(a,b,c,d){function e(p){return p.nodeType!=mxConstants.NODETYPE_ELEMENT|| null==mxUtils.getBlockElementStyle(p.nodeName)}function f(p,q){for(var r=0;r<p.childNodes.length&&n;r++){var t=p.childNodes[r];if(e(t)){for(t=[];r<p.childNodes.length&&e(p.childNodes[r]);)t.push(p.childNodes[r]),r++;r--;var u=t;t=null!=q&&""!=q?mxUtils.getLightDarkColor(q):null;for(var v=document.createElement("span"),y=0;y<u.length;y++)v.appendChild(u[y].cloneNode(!0));u=!1;for(y=0;y<v.childNodes.length;y++){var A=v.childNodes[y];if(A.nodeType==mxConstants.NODETYPE_ELEMENT||A.nodeType==mxConstants.NODETYPE_TEXT&& 0<mxUtils.trim(A.nodeValue).length){u=!0;break}}if(u){if(mxUtils.containsBrElement(v))for(v=mxUtils.splitAtBr(v),y=0;y<v.length&&n;y++){var z=v[y],x=document.createElement("span");for(u=0;u<z.length;u++)x.appendChild(z[u]);u=mxUtils.getMaxInlineFontSize(x,g);k+=u;var C=d.createElement("text");C.setAttribute("y",mxUtils.format(k));C.setAttribute("data-line-font-size",u);null!=t&&(C.setAttribute("fill",t.light),C.style.fill=t.cssText);A=new mxPoint(0,0);0<z.length&&(n=mxUtils.convertHtmlInlineToSvg(x, C,A,1,g,d));b.appendChild(C);z=u*(mxConstants.LINE_HEIGHT-1);z+=mxUtils.getSupSubLineExpansion(u,A.supDyPx,A.subDyPx);k+=z}else u=mxUtils.getMaxInlineFontSize(v,g),k+=u,C=d.createElement("text"),C.setAttribute("y",mxUtils.format(k)),C.setAttribute("data-line-font-size",u),null!=t&&(C.setAttribute("fill",t.light),C.style.fill=t.cssText),A=new mxPoint(0,0),n=mxUtils.convertHtmlInlineToSvg(v,C,A,1,g,d),b.appendChild(C),z=u*(mxConstants.LINE_HEIGHT-1),z+=mxUtils.getSupSubLineExpansion(u,A.supDyPx,A.subDyPx, A.supFontSize,A.subFontSize),k+=z;l=0;m=!1}}else if(v=mxUtils.getBlockElementStyle(t.nodeName),null==v)n=!1;else if(null!=t.style&&""!=t.style.backgroundColor)n=!1;else if(u=null!=t.style&&""!=t.style.color?t.style.color:q,"DIV"==t.nodeName&&mxUtils.containsBlockChild(t))f(t,u);else{A=t;t=v;v=g*v.sizeFactor;z=t.marginTop;y=t.marginBottom;u=null!=u&&""!=u?mxUtils.getLightDarkColor(u):null;null!=A.style&&(""!=A.style.marginTop&&(x=parseFloat(A.style.marginTop),isNaN(x)||(0<=A.style.marginTop.indexOf("px")? z=x/v:0<=A.style.marginTop.indexOf("em")&&(z=x))),""!=A.style.marginBottom&&(x=parseFloat(A.style.marginBottom),isNaN(x)||(0<=A.style.marginBottom.indexOf("px")?y=x/v:0<=A.style.marginBottom.indexOf("em")&&(y=x))));z*=v;k=m?k+z:k+Math.max(l,z);if(mxUtils.containsBrElement(A))for(A=mxUtils.splitAtBr(A),z=0;z<A.length&&n;z++){var D=A[z],B=document.createElement("span");for(x=0;x<D.length;x++)B.appendChild(D[x]);x=mxUtils.getMaxInlineFontSize(B,v);k+=x;var E=d.createElement("text");E.setAttribute("y", mxUtils.format(k));E.setAttribute("data-line-font-size",x);1!=t.sizeFactor&&E.setAttribute("font-size",v+"px");null!=t.weight&&E.setAttribute("font-weight",t.weight);null!=t.family&&E.setAttribute("font-family",t.family);0<t.indent&&E.setAttribute("dx",t.indent);null!=u&&(E.setAttribute("fill",u.light),E.style.fill=u.cssText);C=new mxPoint(0,0);0<D.length&&(n=mxUtils.convertHtmlInlineToSvg(B,E,C,1,v,d));b.appendChild(E);D=x*(mxConstants.LINE_HEIGHT-1);D+=mxUtils.getSupSubLineExpansion(x,C.supDyPx, C.subDyPx);k+=D}else x=mxUtils.getMaxInlineFontSize(A,v),k+=x,E=d.createElement("text"),E.setAttribute("y",mxUtils.format(k)),E.setAttribute("data-line-font-size",x),1!=t.sizeFactor&&E.setAttribute("font-size",v+"px"),null!=t.weight&&E.setAttribute("font-weight",t.weight),null!=t.family&&E.setAttribute("font-family",t.family),0<t.indent&&E.setAttribute("dx",t.indent),null!=u&&(E.setAttribute("fill",u.light),E.style.fill=u.cssText),C=new mxPoint(0,0),n=mxUtils.convertHtmlInlineToSvg(A,E,C,1,v,d),b.appendChild(E), D=x*(mxConstants.LINE_HEIGHT-1),D+=mxUtils.getSupSubLineExpansion(x,C.supDyPx,C.subDyPx,C.supFontSize,C.subFontSize),k+=D;l=y*v;m=!1}}}var g=d.fontSize,k=0,l=0,m=!0,n=!0;f(a,null);k+=l;c.textHeight=k;return n},convertHtmlInlineToSvg:function(a,b,c,d,e,f){var g=!0;if(null!=a){d=null!=d?d:1;var k=f.fontSize;e=null!=e?e:k;for(var l=0,m=0;m<a.childNodes.length&&g;m++){var n=a.childNodes[m];if(n.nodeType==mxConstants.NODETYPE_TEXT||n.nodeType==mxConstants.NODETYPE_ELEMENT){var p=f.createElement("tspan"), q=0;if(n.nodeType==mxConstants.NODETYPE_TEXT)mxUtils.write(p,n.nodeValue);else if(""!=n.style.backgroundColor||"SUP"!=n.nodeName&&"SUB"!=n.nodeName&&"B"!=n.nodeName&&"I"!=n.nodeName&&"SPAN"!=n.nodeName&&"FONT"!=n.nodeName&&"STRIKE"!=n.nodeName&&"U"!=n.nodeName)g=!1;else{""!=n.style.cssText&&(p.style.cssText=n.style.cssText);null!=n.getAttribute("face")&&(p.style.fontFamily=mxUtils.parseCssFontFamily(n.getAttribute("face")));g=""!=n.style.color?n.style.color:n.getAttribute("color");null!=g&&""!=g&& (g=mxUtils.getLightDarkColor(g),p.setAttribute("fill",g.light),p.style.fill=g.cssText,p.style.color="");g=p.style.fontSize||"";var r=d,t=e;if("SUP"==n.nodeName||"SUB"==n.nodeName)if(""==g&&(p.style.fontSize="smaller",r=1.2*d,t=e/1.2),"SUP"==n.nodeName&&0==c.y?c.y=-.2:"SUB"==n.nodeName&&(c.y=Math.max(c.y,.15)),q=("SUP"==n.nodeName?-.35:.15)*e,"SUP"==n.nodeName){if(null==c.supDyPx||q<c.supDyPx)c.supDyPx=q,c.supFontSize=t}else{if(null==c.subDyPx||q>c.subDyPx)c.subDyPx=q,c.subFontSize=t}else"I"==n.nodeName? p.setAttribute("font-style","italic"):"B"==n.nodeName?p.setAttribute("font-weight","bold"):"STRIKE"==n.nodeName?p.setAttribute("text-decoration","line-through"):"U"==n.nodeName&&p.setAttribute("text-decoration","underline");""!=g&&"smaller"!=g&&("px"==g.slice(-2)?t=parseFloat(g):"em"==g.slice(-2)?t=parseFloat(g)*e:"%"==g.slice(-1)&&(t=parseFloat(g)/100*e));"px"==g.slice(-2)&&(p.style.fontSize=parseFloat(g)*r/k+"em");g=mxUtils.convertHtmlInlineToSvg(n,p,c,r,t,f)}n=q;0==l&&0==n||p.setAttribute("dy", Math.round(100*(n-l))/100);l=n;b.appendChild(p)}}}return g},getSupSubLineExpansion:function(a,b,c,d,e){var f=0;null!=b&&0>b&&(f=Math.max(0,(d||a/1.2)-a-b-a*(mxConstants.LINE_HEIGHT-1)/2));null!=c&&0<c&&(f=Math.max(f,c+(e||a/1.2)*(mxConstants.LINE_HEIGHT-1)-a*(mxConstants.LINE_HEIGHT-1)));return f},containsBrElement:function(a){for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if("BR"==c.nodeName||c.nodeType==mxConstants.NODETYPE_ELEMENT&&mxUtils.containsBrElement(c))return!0}return!1}, splitAtBr:function(a){for(var b=[[]],c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if("BR"==d.nodeName)b.push([]);else if(d.nodeType==mxConstants.NODETYPE_TEXT)b[b.length-1].push(d.cloneNode(!0));else if(d.nodeType==mxConstants.NODETYPE_ELEMENT)if(mxUtils.containsBrElement(d))for(var e=mxUtils.splitAtBr(d),f=0;f<e.length;f++){if(0<f&&b.push([]),0<e[f].length){for(var g=d.cloneNode(!1),k=0;k<e[f].length;k++)g.appendChild(e[f][k]);b[b.length-1].push(g)}}else b[b.length-1].push(d.cloneNode(!0))}return b}, convertHtmlWithBreaksToSvg:function(a,b,c,d,e){var f=!0,g=e.fontSize;a=mxUtils.splitAtBr(a);for(var k=0,l=0;l<a.length&&f;l++){for(var m=a[l],n=document.createElement("span"),p=0;p<m.length;p++)n.appendChild(m[p]);p=mxUtils.getMaxInlineFontSize(n,g);k+=p;var q=e.createElement("text");q.setAttribute("y",mxUtils.format(k));q.setAttribute("data-line-font-size",p);var r=new mxPoint(0,0);0<m.length&&(f=mxUtils.convertHtmlInlineToSvg(n,q,r,d||1,null,e));b.appendChild(q);m=p*(mxConstants.LINE_HEIGHT-1); m+=mxUtils.getSupSubLineExpansion(p,r.supDyPx,r.subDyPx);k+=m}c.textHeight=k;return f},format:function(a){return parseFloat(parseFloat(a).toFixed(2))}},mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml", NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"#808080",VML_SHADOWCOLOR:"#808080",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_BLUR:2,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000", OUTLINE_HIGHLIGHT_COLOR:"#00FF00",OUTLINE_HIGHLIGHT_STROKEWIDTH:5,HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000", EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF", DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100), PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_FILL_STYLE:"fillStyle",STYLE_HACHURE_GAP:"hachureGap",STYLE_HACHURE_ANGLE:"hachureAngle", STYLE_FILL_WEIGHT:"fillWeight",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",STYLE_OVERFLOW:"overflow",STYLE_BLOCK_SPACING:"blockSpacing",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_DX:"exitDx",STYLE_EXIT_DY:"exitDy",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_DX:"entryDx",STYLE_ENTRY_DY:"entryDy",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace", STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_POINTER_EVENTS:"pointerEvents",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_MARGIN:"margin",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition", STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding", STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_TEXT_SHADOW:"textShadow",STYLE_SHADOW_OFFSET_X:"shadowOffsetX",STYLE_SHADOW_OFFSET_Y:"shadowOffsetY", STYLE_SHADOW_BLUR:"shadowBlur",STYLE_SHADOWCOLOR:"shadowColor",STYLE_SHADOW_OPACITY:"shadowOpacity",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_FIXED_HEADER:"fixedHeader",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_SWIMLANE_HEAD:"swimlaneHead",STYLE_SWIMLANE_BODY:"swimlaneBody",STYLE_FOOTER_SIZE:"footerSize",STYLE_FOOTER_COLOR:"footerColor",STYLE_CENTER_RADIUS:"centerRadius",STYLE_CENTER_COLOR:"centerColor", STYLE_ENDFILL:"endFill",STYLE_ENDFILLCOLOR:"endFillColor",STYLE_STARTFILL:"startFill",STYLE_STARTFILLCOLOR:"startFillColor",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_BEZIER:"bezier",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing", STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_AUTOSIZE_GRID:"autosizeGrid",STYLE_FIXED_WIDTH:"fixedWidth",STYLE_FOLDABLE:"foldable", STYLE_GROUP_PADDING:"groupPadding",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle", STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",STYLE_CLIP_PATH:"clipPath",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,FONT_UNDERLINE_DOTTED:16,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane", SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south", DIRECTION_EAST:"east",DIRECTION_WEST:"west",DIRECTION_RADIAL:"radial",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",TEXT_DIRECTION_VERTICAL_LR:"vertical-lr",TEXT_DIRECTION_VERTICAL_RL:"vertical-rl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle", EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"}; function mxEventObject(a){this.name=a;this.properties=[];for(var b=1;b<arguments.length;b+=2)null!=arguments[b+1]&&(this.properties[arguments[b]]=arguments[b+1])}mxEventObject.prototype.name=null;mxEventObject.prototype.properties=null;mxEventObject.prototype.consumed=!1;mxEventObject.prototype.getName=function(){return this.name};mxEventObject.prototype.getProperties=function(){return this.properties};mxEventObject.prototype.getProperty=function(a){return this.properties[a]}; mxEventObject.prototype.isConsumed=function(){return this.consumed};mxEventObject.prototype.consume=function(){this.consumed=!0};function mxMouseEvent(a,b){this.evt=a;this.sourceState=this.state=b}mxMouseEvent.prototype.consumed=!1;mxMouseEvent.prototype.evt=null;mxMouseEvent.prototype.graphX=null;mxMouseEvent.prototype.graphY=null;mxMouseEvent.prototype.state=null;mxMouseEvent.prototype.sourceState=null;mxMouseEvent.prototype.getEvent=function(){return this.evt}; mxMouseEvent.prototype.getSource=function(){return mxEvent.getSource(this.evt)};mxMouseEvent.prototype.isSource=function(a){return null!=a?mxUtils.isAncestorNode(a.node,this.getSource()):!1};mxMouseEvent.prototype.getX=function(){return mxEvent.getClientX(this.getEvent())};mxMouseEvent.prototype.getY=function(){return mxEvent.getClientY(this.getEvent())};mxMouseEvent.prototype.getGraphX=function(){return this.graphX};mxMouseEvent.prototype.getGraphY=function(){return this.graphY}; mxMouseEvent.prototype.getState=function(){return this.state};mxMouseEvent.prototype.getCell=function(){var a=this.getState();return null!=a?a.cell:null};mxMouseEvent.prototype.isPopupTrigger=function(){return mxEvent.isPopupTrigger(this.getEvent())};mxMouseEvent.prototype.isConsumed=function(){return this.consumed};mxMouseEvent.prototype.consume=function(a){(null!=a?a:null!=this.evt.touches||mxEvent.isMouseEvent(this.evt))&&this.evt.preventDefault&&this.evt.preventDefault();this.consumed=!0}; function mxEventSource(a){this.setEventSource(a)}mxEventSource.prototype.eventListeners=null;mxEventSource.prototype.eventsEnabled=!0;mxEventSource.prototype.eventSource=null;mxEventSource.prototype.isEventsEnabled=function(){return this.eventsEnabled};mxEventSource.prototype.setEventsEnabled=function(a){this.eventsEnabled=a};mxEventSource.prototype.getEventSource=function(){return this.eventSource};mxEventSource.prototype.setEventSource=function(a){this.eventSource=a}; mxEventSource.prototype.addListener=function(a,b){null==this.eventListeners&&(this.eventListeners=[]);this.eventListeners.push(a);this.eventListeners.push(b)};mxEventSource.prototype.removeListener=function(a){if(null!=this.eventListeners)for(var b=0;b<this.eventListeners.length;)this.eventListeners[b+1]==a?this.eventListeners.splice(b,2):b+=2}; mxEventSource.prototype.fireEvent=function(a,b){if(null!=this.eventListeners&&this.isEventsEnabled()){null==a&&(a=new mxEventObject);null==b&&(b=this.getEventSource());null==b&&(b=this);for(var c=0;c<this.eventListeners.length;c+=2){var d=this.eventListeners[c];null!=d&&d!=a.getName()||this.eventListeners[c+1].apply(this,[b,a])}}}; var mxEvent={addListener:function(){if(window.addEventListener){var a=!1;try{document.addEventListener("test",function(){},Object.defineProperty&&Object.defineProperty({},"passive",{get:function(){a=!0}}))}catch(b){}return function(b,c,d){b.addEventListener(c,d,a?{passive:!1}:!1);null==b.mxListenerList&&(b.mxListenerList=[]);b.mxListenerList.push({name:c,f:d})}}return function(b,c,d){b.attachEvent("on"+c,d);null==b.mxListenerList&&(b.mxListenerList=[]);b.mxListenerList.push({name:c,f:d})}}(),removeListener:function(){var a= function(b,c,d){if(null!=b.mxListenerList){c=b.mxListenerList.length;for(var e=0;e<c;e++)if(b.mxListenerList[e].f==d){b.mxListenerList.splice(e,1);break}0==b.mxListenerList.length&&(b.mxListenerList=null)}};return window.removeEventListener?function(b,c,d){b.removeEventListener(c,d,!1);a(b,c,d)}:function(b,c,d){b.detachEvent("on"+c,d);a(b,c,d)}}(),removeAllListeners:function(a){var b=a.mxListenerList;if(null!=b)for(;0<b.length;){var c=b[0];mxEvent.removeListener(a,c.name,c.f)}},addGestureListeners:function(a, b,c,d){null!=b&&mxEvent.addListener(a,mxClient.IS_POINTER?"pointerdown":"mousedown",b);null!=c&&mxEvent.addListener(a,mxClient.IS_POINTER?"pointermove":"mousemove",c);null!=d&&mxEvent.addListener(a,mxClient.IS_POINTER?"pointerup":"mouseup",d);!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=b&&mxEvent.addListener(a,"touchstart",b),null!=c&&mxEvent.addListener(a,"touchmove",c),null!=d&&mxEvent.addListener(a,"touchend",d))},removeGestureListeners:function(a,b,c,d){null!=b&&mxEvent.removeListener(a,mxClient.IS_POINTER? "pointerdown":"mousedown",b);null!=c&&mxEvent.removeListener(a,mxClient.IS_POINTER?"pointermove":"mousemove",c);null!=d&&mxEvent.removeListener(a,mxClient.IS_POINTER?"pointerup":"mouseup",d);!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=b&&mxEvent.removeListener(a,"touchstart",b),null!=c&&mxEvent.removeListener(a,"touchmove",c),null!=d&&mxEvent.removeListener(a,"touchend",d))},redirectMouseEvents:function(a,b,c,d,e,f,g){var k=function(l){return"function"==typeof c?c(l):c};mxEvent.addGestureListeners(a, function(l){null!=d?d(l):mxEvent.isConsumed(l)||b.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(l,k(l)))},function(l){null!=e?e(l):mxEvent.isConsumed(l)||b.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(l,k(l)))},function(l){null!=f?f(l):mxEvent.isConsumed(l)||b.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(l,k(l)))});mxEvent.addListener(a,"dblclick",function(l){if(null!=g)g(l);else if(!mxEvent.isConsumed(l)){var m=k(l);b.dblClick(l,null!=m?m.cell:null)}})},release:function(a){try{if(null!= a){mxEvent.removeAllListeners(a);var b=a.childNodes;if(null!=b){var c=b.length;for(a=0;a<c;a+=1)mxEvent.release(b[a])}}}catch(d){}},addMouseWheelListener:function(a,b){if(null!=a){b=null!=b?b:window;if(mxClient.IS_SF&&!mxClient.IS_TOUCH){var c=1;mxEvent.addListener(b,"gesturestart",function(g){mxEvent.consume(g);c=1});mxEvent.addListener(b,"gesturechange",function(g){mxEvent.consume(g);var k=c-g.scale;.2<Math.abs(k)&&(a(g,0>k,!0),c=g.scale)});mxEvent.addListener(b,"gestureend",function(g){mxEvent.consume(g)})}else{var d= [],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&&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", SIZE:"size",SELECT:"select",FIRED:"fired",FIRE_MOUSE_EVENT:"fireMouseEvent",CONSUME_MOUSE_EVENT:"consumeMouseEvent",GESTURE:"gesture",TAP_AND_HOLD:"tapAndHold",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit", END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled", ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",EDITING_STARTED:"editingStarted",EDITING_STOPPED:"editingStopped", ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",DOUBLE_CLICK:"doubleClick",START:"start",UPDATE:"update",RESET:"reset",PINCH_THRESHOLD:10};function mxXmlRequest(a,b,c,d,e,f){this.url=a;this.params=b;this.method=c||"POST";this.async=null!=d?d:!0;this.username=e;this.password=f}mxXmlRequest.prototype.url=null;mxXmlRequest.prototype.params=null;mxXmlRequest.prototype.method=null;mxXmlRequest.prototype.async=null; mxXmlRequest.prototype.binary=!1;mxXmlRequest.prototype.withCredentials=!1;mxXmlRequest.prototype.username=null;mxXmlRequest.prototype.password=null;mxXmlRequest.prototype.request=null;mxXmlRequest.prototype.decodeSimulateValues=!1;mxXmlRequest.prototype.acceptResponse=!0;mxXmlRequest.prototype.isBinary=function(){return this.binary};mxXmlRequest.prototype.setBinary=function(a){this.binary=a};mxXmlRequest.prototype.getText=function(){return this.request.responseText}; mxXmlRequest.prototype.isReady=function(){return 4==this.request.readyState};mxXmlRequest.prototype.getDocumentElement=function(){var a=this.getXml();return null!=a?a.documentElement:null};mxXmlRequest.prototype.getXml=function(){var a=this.request.responseXML;if(9<=document.documentMode||null==a||null==a.documentElement)a=mxUtils.parseXml(this.request.responseText);return a};mxXmlRequest.prototype.getStatus=function(){return null!=this.request?this.request.status:null}; mxXmlRequest.prototype.create=function(){if(window.XMLHttpRequest)return function(){var a=new XMLHttpRequest;this.isBinary()&&a.overrideMimeType&&a.overrideMimeType("text/plain; charset=x-user-defined");return a};if("undefined"!=typeof ActiveXObject)return function(){return new ActiveXObject("Microsoft.XMLHTTP")}}(); mxXmlRequest.prototype.send=function(a,b,c,d){this.request=this.create();null!=this.request&&(null!=a&&(this.request.onreadystatechange=mxUtils.bind(this,function(){this.isReady()&&this.acceptResponse&&(this.acceptResponse=!1,a(this),this.request.onreadystatechange=null)})),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),window.XMLHttpRequest&&this.withCredentials&&(this.request.withCredentials="true"),null!=b&&(this.request.onerror= mxUtils.bind(this,function(e){this.acceptResponse&&(this.acceptResponse=!1,b(this,e))})),(null==document.documentMode||9<document.documentMode)&&window.XMLHttpRequest&&null!=c&&null!=d&&(this.request.timeout=c,this.request.ontimeout=d),this.request.send(this.params))};mxXmlRequest.prototype.setRequestHeaders=function(a,b){null!=b&&a.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}; mxXmlRequest.prototype.simulate=function(a,b){a=a||document;var c=null;a==document&&(c=window.onbeforeunload,window.onbeforeunload=null);var d=a.createElement("form");d.setAttribute("method",this.method);d.setAttribute("action",this.url);null!=b&&d.setAttribute("target",b);d.style.display="none";d.style.visibility="hidden";b=0<this.params.indexOf("&")?this.params.split("&"):this.params.split();for(var e=0;e<b.length;e++){var f=b[e].indexOf("=");if(0<f){var g=b[e].substring(0,f);f=b[e].substring(f+ 1);this.decodeSimulateValues&&(f=decodeURIComponent(f));var k=a.createElement("textarea");k.setAttribute("wrap","off");k.setAttribute("name",g);mxUtils.write(k,f);d.appendChild(k)}}a.body.appendChild(d);d.submit();null!=d.parentNode&&d.parentNode.removeChild(d);null!=c&&(window.onbeforeunload=c)}; var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,setCells:function(a){mxClipboard.cells=a},getCells:function(){return mxClipboard.cells},isEmpty:function(){return null==mxClipboard.getCells()},cut:function(a,b){b=mxClipboard.copy(a,b);mxClipboard.insertCount=0;mxClipboard.removeCells(a,b,!1);return b},removeCells:function(a,b,c){a.removeCells(b,c)},copy:function(a,b){b=b||a.getSelectionCells();b=a.getExportableCells(a.model.getTopmostCells(b));mxClipboard.insertCount=1;mxClipboard.setCells(a.cloneCells(b)); return b},paste:function(a){var b=null;if(!mxClipboard.isEmpty()){b=a.getImportableCells(mxClipboard.getCells());var c=mxClipboard.insertCount*mxClipboard.STEPSIZE,d=a.getDefaultParent();b=a.importCells(b,c,c,d);mxClipboard.insertCount++;a.setSelectionCells(b)}return b}}; function mxWindow(a,b,c,d,e,f,g,k,l,m){null!=b&&(g=null!=g?g:!0,this.content=b,this.init(c,d,e,f,m),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(g),this.setTitle(a),(null==k||k)&&this.installMoveHandler(),null!=l&&null!=l.parentNode?l.parentNode.replaceChild(this.div,l):document.body.appendChild(this.div))}mxWindow.prototype=new mxEventSource;mxWindow.prototype.constructor=mxWindow;mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif"; mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif";mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif";mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif";mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif";mxWindow.prototype.dockState=null;mxWindow.prototype.visible=!1;mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40);mxWindow.prototype.destroyOnClose=!0; mxWindow.prototype.contentHeightCorrection=8==document.documentMode||7==document.documentMode?6:2;mxWindow.prototype.title=null;mxWindow.prototype.content=null; mxWindow.prototype.init=function(a,b,c,d,e){e=null!=e?e:"mxWindow";this.div=document.createElement("div");this.div.className=e;this.div.style.left=a+"px";this.div.style.top=b+"px";this.table=document.createElement("table");this.table.className=e;mxClient.IS_POINTER&&(this.div.style.touchAction="none");null!=c&&(this.div.style.width=c+"px",this.table.style.width=c+"px");null!=d&&(this.div.style.height=d+"px",this.table.style.height=d+"px");a=document.createElement("tbody");b=document.createElement("tr"); this.title=document.createElement("td");this.title.className=e+"Title";this.buttons=document.createElement("div");this.buttons.style.position="absolute";this.buttons.style.display="inline-block";this.buttons.style.right="4px";this.title.appendChild(this.buttons);b.appendChild(this.title);a.appendChild(b);b=document.createElement("tr");this.td=document.createElement("td");this.td.className=e+"Pane";7==document.documentMode&&(this.td.style.height="100%");this.contentWrapper=document.createElement("div"); this.contentWrapper.className=e+"Pane";this.contentWrapper.style.width="100%";this.contentWrapper.appendChild(this.content);"DIV"!=this.content.nodeName.toUpperCase()&&(this.contentWrapper.style.height="100%");this.td.appendChild(this.contentWrapper);b.appendChild(this.td);a.appendChild(b);this.table.appendChild(a);this.div.appendChild(this.table);e=mxUtils.bind(this,function(f){this.activate()});mxEvent.addGestureListeners(this.title,e);mxEvent.addGestureListeners(this.table,e);this.hide()}; mxWindow.prototype.setTitle=function(a){for(var b=this.title.firstChild;null!=b;){var c=b.nextSibling;b!=this.buttons&&b.parentNode.removeChild(b);b=c}mxUtils.write(this.title,a||"");this.title.appendChild(this.buttons)};mxWindow.prototype.setScrollable=function(a){if(null==navigator.userAgent||0>navigator.userAgent.indexOf("Presto/2.5"))this.contentWrapper.style.overflow=a?"auto":"hidden"}; mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var a=mxUtils.getCurrentStyle(this.getElement());a=null!=a?a.zIndex:3;if(mxWindow.activeWindow){var b=mxWindow.activeWindow.getElement();null!=b&&null!=b.style&&(b.style.zIndex=a)}b=mxWindow.activeWindow;this.getElement().style.zIndex=parseInt(a)+1;mxWindow.activeWindow=this;this.fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",b))}};mxWindow.prototype.getElement=function(){return this.div}; mxWindow.prototype.fit=function(){mxUtils.fit(this.div)};mxWindow.prototype.isResizable=function(){return null!=this.resize?"none"!=this.resize.style.display:!1}; mxWindow.prototype.setResizable=function(a){if(a)if(null==this.resize){this.resize=document.createElement("img");this.resize.style.position="absolute";this.resize.style.bottom="0px";this.resize.style.right="0px";this.resize.style.zIndex="2";this.resize.setAttribute("src",this.resizeImage);this.resize.style.cursor="nwse-resize";var b=null,c=null,d=null,e=null;a=mxUtils.bind(this,function(k){this.activate();b=mxEvent.getClientX(k);c=mxEvent.getClientY(k);d=this.div.offsetWidth;e=this.div.offsetHeight; mxEvent.addGestureListeners(document,null,f,g);this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",k));mxEvent.consume(k)});var f=mxUtils.bind(this,function(k){if(null!=b&&null!=c){var l=mxEvent.getClientX(k)-b,m=mxEvent.getClientY(k)-c;this.setSize(d+l,e+m);this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",k));mxEvent.consume(k)}}),g=mxUtils.bind(this,function(k){null!=b&&null!=c&&(c=b=null,mxEvent.removeGestureListeners(document,null,f,g),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END, "event",k)),mxEvent.consume(k))});mxEvent.addGestureListeners(this.resize,a,f,g);this.div.appendChild(this.resize)}else this.resize.style.display="inline";else null!=this.resize&&(this.resize.style.display="none")}; mxWindow.prototype.setSize=function(a,b){a=Math.max(this.minimumSize.width,a);b=Math.max(this.minimumSize.height,b);this.div.style.width=a+"px";this.div.style.height=b+"px";this.table.style.width=a+"px";this.table.style.height=b+"px";this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"};mxWindow.prototype.setMinimizable=function(a){this.minimizeImg.style.display=a?"":"none"}; mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)}; mxWindow.prototype.toggleMinimized=function(a){this.activate();if(this.minimized)this.minimized=!1,this.minimizeImg.setAttribute("src",this.minimizeImage),this.minimizeImg.setAttribute("title",mxResources.get("minimize",null,"Minimize")),this.contentWrapper.style.display="",this.maximize.style.display=this.maxDisplay,this.div.style.height=this.height,this.table.style.height=this.height,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event", a));else{this.minimized=!0;this.minimizeImg.setAttribute("src",this.normalizeImage);this.minimizeImg.setAttribute("title",mxResources.get("restore",null,"Restore"));this.contentWrapper.style.display="none";this.maxDisplay=this.maximize.style.display;this.maximize.style.display="none";this.height=this.table.style.height;var b=this.getMinimumSize();0<b.height&&(this.div.style.height=b.height+"px",this.table.style.height=b.height+"px");0<b.width&&(this.div.style.width=b.width+"px",this.table.style.width= b.width+"px");null!=this.resize&&(this.resize.style.visibility="hidden");this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",a))}}; mxWindow.prototype.installMinimizeHandler=function(){this.minimizeImg=document.createElement("img");this.minimizeImg.setAttribute("src",this.minimizeImage);this.minimizeImg.setAttribute("title",mxResources.get("minimize",null,"Minimize"));this.minimizeImg.style.cursor="pointer";this.minimizeImg.style.marginLeft="2px";this.minimizeImg.style.display="none";this.buttons.appendChild(this.minimizeImg);this.minimized=!1;this.height=this.maxDisplay=null;var a=mxUtils.bind(this,function(b){this.toggleMinimized(b); mxEvent.consume(b)});mxEvent.addGestureListeners(this.minimizeImg,a)};mxWindow.prototype.setMaximizable=function(a){this.maximize.style.display=a?"":"none"}; mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img");this.maximize.setAttribute("src",this.maximizeImage);this.maximize.setAttribute("title",mxResources.get("maximize",null,"Maximize"));this.maximize.style.cursor="default";this.maximize.style.marginLeft="2px";this.maximize.style.cursor="pointer";this.maximize.style.display="none";this.buttons.appendChild(this.maximize);var a=!1,b=null,c=null,d=null,e=null,f=null,g=mxUtils.bind(this,function(k){this.activate(); if("none"!=this.maximize.style.display){if(a){a=!1;this.maximize.setAttribute("src",this.maximizeImage);this.maximize.setAttribute("title",mxResources.get("maximize",null,"Maximize"));this.contentWrapper.style.display="";this.minimizeImg.style.display=f;this.div.style.left=b+"px";this.div.style.top=c+"px";this.div.style.height=d;this.div.style.width=e;l=mxUtils.getCurrentStyle(this.contentWrapper);if("auto"==l.overflow||null!=this.resize)this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight- this.contentHeightCorrection+"px";this.table.style.height=d;this.table.style.width=e;null!=this.resize&&(this.resize.style.visibility="");this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",k))}else{a=!0;this.maximize.setAttribute("src",this.normalizeImage);this.maximize.setAttribute("title",mxResources.get("restore",null,"Restore"));this.contentWrapper.style.display="";f=this.minimizeImg.style.display;this.minimizeImg.style.display="none";b=parseInt(this.div.style.left);c=parseInt(this.div.style.top); d=this.table.style.height;e=this.table.style.width;this.div.style.left="0px";this.div.style.top="0px";l=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0);this.div.style.width=document.body.clientWidth-2+"px";this.div.style.height=l-2+"px";this.table.style.width=document.body.clientWidth-2+"px";this.table.style.height=l-2+"px";null!=this.resize&&(this.resize.style.visibility="hidden");var l=mxUtils.getCurrentStyle(this.contentWrapper);if("auto"==l.overflow||null!=this.resize)this.contentWrapper.style.height= this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px";this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",k))}mxEvent.consume(k)}});mxEvent.addGestureListeners(this.maximize,g);mxEvent.addListener(this.title,"dblclick",g)}; mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move";mxEvent.addGestureListeners(this.title,mxUtils.bind(this,function(a){var b=mxEvent.getClientX(a),c=mxEvent.getClientY(a),d=this.getX(),e=this.getY(),f=mxUtils.bind(this,function(k){var l=mxEvent.getClientX(k)-b,m=mxEvent.getClientY(k)-c;this.setLocation(d+l,e+m);this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",k));mxEvent.consume(k)}),g=mxUtils.bind(this,function(k){mxEvent.removeGestureListeners(document,null,f, g);this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",k));mxEvent.consume(k)});mxEvent.addGestureListeners(document,null,f,g);this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",a));mxEvent.consume(a)}));mxClient.IS_POINTER&&(this.title.style.touchAction="none")};mxWindow.prototype.setLocation=function(a,b){null!=this.div&&(this.div.style.left=a+"px",this.div.style.top=b+"px")};mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)};mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)}; mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img");this.closeImg.setAttribute("src",this.closeImage);this.closeImg.setAttribute("title",mxResources.get("close",null,"Close"));this.closeImg.style.marginLeft="2px";this.closeImg.style.cursor="pointer";this.closeImg.style.display="none";this.buttons.appendChild(this.closeImg);mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,function(a){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",a));this.destroyOnClose? this.destroy():this.setVisible(!1);mxEvent.consume(a)}))};mxWindow.prototype.setImage=function(a){this.image=document.createElement("img");this.image.setAttribute("src",a);this.image.setAttribute("align","left");this.image.style.marginRight="4px";this.image.style.marginLeft="0px";this.image.style.marginTop="-2px";this.title.insertBefore(this.image,this.title.firstChild)};mxWindow.prototype.setClosable=function(a){this.closeImg.style.display=a?"":"none"}; mxWindow.prototype.isVisible=function(){return null!=this.div?"none"!=this.div.style.display:!1};mxWindow.prototype.setVisible=function(a){null!=this.div&&(this.isVisible()!=a?a?this.show():this.hide():this.fireEvent(new mxEventObject(a?mxEvent.SHOW:mxEvent.HIDE)))}; mxWindow.prototype.show=function(){this.div.style.display="";this.activate();"auto"!=mxUtils.getCurrentStyle(this.contentWrapper).overflow&&null==this.resize||"none"==this.contentWrapper.style.display||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px");this.fireEvent(new mxEventObject(mxEvent.SHOW))};mxWindow.prototype.hide=function(){this.div.style.display="none";this.fireEvent(new mxEventObject(mxEvent.HIDE))}; mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY));null!=this.div&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null);this.contentWrapper=this.content=this.title=null};function mxForm(a){this.table=document.createElement("table");this.table.className=a;this.body=document.createElement("tbody");this.table.appendChild(this.body)}mxForm.prototype.table=null;mxForm.prototype.body=!1;mxForm.prototype.getTable=function(){return this.table}; mxForm.prototype.addButtons=function(a,b){var c=document.createElement("tr"),d=document.createElement("td");c.appendChild(d);d=document.createElement("td");var e=document.createElement("button");mxUtils.write(e,mxResources.get("ok")||"OK");d.appendChild(e);mxEvent.addListener(e,"click",function(){a()});e=document.createElement("button");mxUtils.write(e,mxResources.get("cancel")||"Cancel");d.appendChild(e);mxEvent.addListener(e,"click",function(){b()});c.appendChild(d);this.body.appendChild(c)}; mxForm.prototype.addText=function(a,b,c){var d=document.createElement("input");d.setAttribute("type",c||"text");d.value=b;return this.addField(a,d)};mxForm.prototype.addCheckbox=function(a,b){var c=document.createElement("input");c.setAttribute("type","checkbox");this.addField(a,c);b&&(c.checked=!0);return c};mxForm.prototype.addTextarea=function(a,b,c){var d=document.createElement("textarea");mxClient.IS_NS&&c--;d.setAttribute("rows",c||2);d.value=b;return this.addField(a,d)}; mxForm.prototype.addCombo=function(a,b,c){var d=document.createElement("select");null!=c&&d.setAttribute("size",c);b&&d.setAttribute("multiple","true");return this.addField(a,d)};mxForm.prototype.addOption=function(a,b,c,d){var e=document.createElement("option");mxUtils.writeln(e,b);e.setAttribute("value",c);d&&e.setAttribute("selected",d);a.appendChild(e)}; mxForm.prototype.addField=function(a,b){var c=document.createElement("tr"),d=document.createElement("td");mxUtils.write(d,a);c.appendChild(d);d=document.createElement("td");d.appendChild(b);c.appendChild(d);this.body.appendChild(c);return b};function mxImage(a,b,c,d,e){this.src=a;this.width=null!=b?b:this.width;this.height=null!=c?c:this.height;this.x=null!=d?d:this.x;this.y=null!=e?e:this.y}mxImage.prototype.src=null;mxImage.prototype.width=0;mxImage.prototype.height=0;mxImage.prototype.x=0; mxImage.prototype.y=0;function mxDivResizer(a,b){"div"==a.nodeName.toLowerCase()&&(null==b&&(b=window),this.div=a,a=mxUtils.getCurrentStyle(a),null!=a&&(this.resizeWidth="auto"==a.width,this.resizeHeight="auto"==a.height),mxEvent.addListener(b,"resize",mxUtils.bind(this,function(c){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)})),this.resize())}mxDivResizer.prototype.resizeWidth=!0;mxDivResizer.prototype.resizeHeight=!0;mxDivResizer.prototype.handlingResize=!1; mxDivResizer.prototype.resize=function(){var a=this.getDocumentWidth(),b=this.getDocumentHeight(),c=parseInt(this.div.style.left),d=parseInt(this.div.style.right),e=parseInt(this.div.style.top),f=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(c)&&!isNaN(d)&&0<=c&&0<=d&&0<a-d-c&&(this.div.style.width=a-d-c+"px");this.resizeHeight&&!isNaN(e)&&!isNaN(f)&&0<=e&&0<=f&&0<b-e-f&&(this.div.style.height=b-e-f+"px")};mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth}; mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight};function mxDragSource(a,b){this.element=a;this.dropHandler=b;mxEvent.addGestureListeners(a,mxUtils.bind(this,function(c){this.mouseDown(c);mxEvent.consume(c)}));mxEvent.addListener(a,"dragstart",function(c){mxEvent.consume(c)});this.eventConsumer=function(c,d){c=d.getProperty("eventName");d=d.getProperty("event");c!=mxEvent.MOUSE_DOWN&&d.consume()}}mxDragSource.prototype.element=null; mxDragSource.prototype.dropHandler=null;mxDragSource.prototype.dragOffset=null;mxDragSource.prototype.dragElement=null;mxDragSource.prototype.previewElement=null;mxDragSource.prototype.previewOffset=null;mxDragSource.prototype.enabled=!0;mxDragSource.prototype.currentGraph=null;mxDragSource.prototype.currentDropTarget=null;mxDragSource.prototype.currentPoint=null;mxDragSource.prototype.currentGuide=null;mxDragSource.prototype.currentHighlight=null;mxDragSource.prototype.autoscroll=!0; mxDragSource.prototype.guidesEnabled=!0;mxDragSource.prototype.gridEnabled=!0;mxDragSource.prototype.highlightDropTargets=!0;mxDragSource.prototype.dragElementZIndex=100;mxDragSource.prototype.dragElementOpacity=70;mxDragSource.prototype.checkEventSource=!0;mxDragSource.prototype.isEnabled=function(){return this.enabled};mxDragSource.prototype.setEnabled=function(a){this.enabled=a};mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled}; mxDragSource.prototype.setGuidesEnabled=function(a){this.guidesEnabled=a};mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled};mxDragSource.prototype.setGridEnabled=function(a){this.gridEnabled=a};mxDragSource.prototype.getGraphForEvent=function(a){return null};mxDragSource.prototype.getDropTarget=function(a,b,c,d){return a.getCellAt(b,c)};mxDragSource.prototype.createDragElement=function(a){return this.element.cloneNode(!0)};mxDragSource.prototype.createPreviewElement=function(a){return null}; mxDragSource.prototype.isActive=function(){return null!=this.mouseMoveHandler};mxDragSource.prototype.reset=function(){null!=this.currentGraph&&(this.dragExit(this.currentGraph),this.currentGraph=null);this.removeDragElement();this.removeListeners();this.stopDrag()}; mxDragSource.prototype.mouseDown=function(a){this.enabled&&!mxEvent.isConsumed(a)&&null==this.mouseMoveHandler&&(this.startDrag(a),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),mxClient.IS_TOUCH&&!mxEvent.isMouseEvent(a)&&(this.eventSource=mxEvent.getSource(a),mxEvent.addGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler)))}; mxDragSource.prototype.startDrag=function(a){this.dragElement=this.createDragElement(a);this.dragElement.style.position="absolute";this.dragElement.style.zIndex=this.dragElementZIndex;mxUtils.setOpacity(this.dragElement,this.dragElementOpacity);this.checkEventSource&&mxClient.IS_SVG&&(this.dragElement.style.pointerEvents="none")};mxDragSource.prototype.stopDrag=function(){this.removeDragElement()}; mxDragSource.prototype.removeDragElement=function(){null!=this.dragElement&&(null!=this.dragElement.parentNode&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)};mxDragSource.prototype.getElementForEvent=function(a){return mxEvent.isTouchEvent(a)||mxEvent.isPenEvent(a)?document.elementFromPoint(mxEvent.getClientX(a),mxEvent.getClientY(a)):mxEvent.getSource(a)}; mxDragSource.prototype.graphContainsEvent=function(a,b){var c=mxEvent.getClientX(b),d=mxEvent.getClientY(b),e=mxUtils.getOffset(a.container),f=mxUtils.getScrollOrigin();b=this.getElementForEvent(b);if(this.checkEventSource)for(;null!=b&&b!=a.container;)b=b.parentNode;return null!=b&&c>=e.x-f.x&&d>=e.y-f.y&&c<=e.x-f.x+a.container.offsetWidth&&d<=e.y-f.y+a.container.offsetHeight}; mxDragSource.prototype.mouseMove=function(a){var b=this.getGraphForEvent(a);null==b||this.graphContainsEvent(b,a)||(b=null);b!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph,a),this.currentGraph=b,null!=this.currentGraph&&this.dragEnter(this.currentGraph,a));null!=this.currentGraph&&this.dragOver(this.currentGraph,a);if(null==this.dragElement||null!=this.previewElement&&"visible"==this.previewElement.style.visibility)null!=this.dragElement&&mxUtils.setOpacity(this.dragElement, 0);else{b=mxEvent.getClientX(a);var c=mxEvent.getClientY(a);null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement);mxUtils.setOpacity(this.dragElement,this.dragElementOpacity);null!=this.dragOffset&&(b+=this.dragOffset.x,c+=this.dragOffset.y);var d=mxUtils.getDocumentScrollOrigin(document);this.dragElement.style.left=b+d.x+"px";this.dragElement.style.top=c+d.y+"px"}mxEvent.consume(a)}; mxDragSource.prototype.mouseUp=function(a){if(null!=this.currentGraph){if(null!=this.currentPoint&&(null==this.previewElement||"hidden"!=this.previewElement.style.visibility)){var b=this.currentGraph.view.scale,c=this.currentGraph.view.translate;this.drop(this.currentGraph,a,this.currentDropTarget,this.currentPoint.x/b-c.x,this.currentPoint.y/b-c.y)}this.dragExit(this.currentGraph);this.currentGraph=null}this.stopDrag();this.removeListeners();mxEvent.consume(a)}; mxDragSource.prototype.removeListeners=function(){null!=this.eventSource&&(mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler),this.eventSource=null);mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler);this.mouseUpHandler=this.mouseMoveHandler=null}; mxDragSource.prototype.dragEnter=function(a,b){a.isMouseDown=!0;a.isMouseTrigger=mxEvent.isMouseEvent(b);this.previewElement=this.createPreviewElement(a);null!=this.previewElement&&this.checkEventSource&&mxClient.IS_SVG&&(this.previewElement.style.pointerEvents="none");this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(a,a.graphHandler.getGuideStates()));this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(a,mxConstants.DROP_TARGET_COLOR));a.addListener(mxEvent.FIRE_MOUSE_EVENT, this.eventConsumer)};mxDragSource.prototype.dragExit=function(a,b){this.currentPoint=this.currentDropTarget=null;a.isMouseDown=!1;a.removeListener(this.eventConsumer);null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null);null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null);null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)}; mxDragSource.prototype.dragOver=function(a,b){var c=mxUtils.getOffset(a.container),d=mxUtils.getScrollOrigin(a.container),e=mxEvent.getClientX(b)-c.x+d.x-a.panDx;c=mxEvent.getClientY(b)-c.y+d.y-a.panDy;a.autoScroll&&(null==this.autoscroll||this.autoscroll)&&a.scrollPointToVisible(e,c,a.autoExtend);null!=this.currentHighlight&&a.isDropEnabled()&&(this.currentDropTarget=this.getDropTarget(a,e,c,b),d=a.getView().getState(this.currentDropTarget),this.currentHighlight.highlight(d));if(null!=this.previewElement){null== this.previewElement.parentNode&&(a.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");d=this.isGridEnabled()&&a.isGridEnabledEvent(b);var f=!0;if(null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(b))a=parseInt(this.previewElement.style.width),f=parseInt(this.previewElement.style.height),a=new mxRectangle(0,0,a,f),c=new mxPoint(e,c),c=this.currentGuide.move(a,c,d,!0),f=!1,e=c.x,c=c.y;else if(d){d=a.view.scale;b= a.view.translate;var g=a.gridSize/2;e=(a.snap(e/d-b.x-g)+b.x)*d;c=(a.snap(c/d-b.y-g)+b.y)*d}null!=this.currentGuide&&f&&this.currentGuide.hide();null!=this.previewOffset&&(e+=this.previewOffset.x,c+=this.previewOffset.y);this.previewElement.style.left=Math.round(e)+"px";this.previewElement.style.top=Math.round(c)+"px";this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(e,c)}; mxDragSource.prototype.drop=function(a,b,c,d,e){this.dropHandler.apply(this,arguments);"hidden"!=a.container.style.visibility&&a.container.focus()};function mxToolbar(a){this.container=a}mxToolbar.prototype=new mxEventSource;mxToolbar.prototype.constructor=mxToolbar;mxToolbar.prototype.container=null;mxToolbar.prototype.enabled=!0;mxToolbar.prototype.noReset=!1;mxToolbar.prototype.updateDefaultMode=!0; mxToolbar.prototype.addItem=function(a,b,c,d,e,f){var g=document.createElement(null!=b?"img":"button"),k=e||(null!=f?"mxToolbarMode":"mxToolbarItem");g.className=k;g.setAttribute("src",b);null!=a&&(null!=b?g.setAttribute("title",a):mxUtils.write(g,a));this.container.appendChild(g);null!=c&&(mxEvent.addListener(g,"click",c),mxClient.IS_TOUCH&&mxEvent.addListener(g,"touchend",c));a=mxUtils.bind(this,function(l){null!=d?g.setAttribute("src",b):g.style.backgroundColor=""});mxEvent.addGestureListeners(g, mxUtils.bind(this,function(l){null!=d?g.setAttribute("src",d):g.style.backgroundColor="gray";if(null!=f){null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init());var m=this.currentImg;this.menu.isMenuShowing()&&this.menu.hideMenu();m!=g&&(this.currentImg=g,this.menu.factoryMethod=f,m=new mxPoint(g.offsetLeft,g.offsetTop+g.offsetHeight),this.menu.popup(m.x,m.y,null,l),this.menu.isMenuShowing()&&(g.className=k+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this); g.className=k;this.currentImg=null}))}}),null,a);mxEvent.addListener(g,"mouseout",a);return g};mxToolbar.prototype.addCombo=function(a){var b=document.createElement("div");b.style.display="inline";b.className="mxToolbarComboContainer";var c=document.createElement("select");c.className=a||"mxToolbarCombo";b.appendChild(c);this.container.appendChild(b);return c}; mxToolbar.prototype.addActionCombo=function(a,b){var c=document.createElement("select");c.className=b||"mxToolbarCombo";this.addOption(c,a,null);mxEvent.addListener(c,"change",function(d){var e=c.options[c.selectedIndex];c.selectedIndex=0;null!=e.funct&&e.funct(d)});this.container.appendChild(c);return c};mxToolbar.prototype.addOption=function(a,b,c){var d=document.createElement("option");mxUtils.writeln(d,b);"function"==typeof c?d.funct=c:d.setAttribute("value",c);a.appendChild(d);return d}; mxToolbar.prototype.addSwitchMode=function(a,b,c,d,e){var f=document.createElement("img");f.initialClassName=e||"mxToolbarMode";f.className=f.initialClassName;f.setAttribute("src",b);f.altIcon=d;null!=a&&f.setAttribute("title",a);mxEvent.addListener(f,"click",mxUtils.bind(this,function(g){g=this.selectedMode.altIcon;null!=g?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",g)):this.selectedMode.className=this.selectedMode.initialClassName;this.updateDefaultMode&& (this.defaultMode=f);this.selectedMode=f;g=f.altIcon;null!=g?(f.altIcon=f.getAttribute("src"),f.setAttribute("src",g)):f.className=f.initialClassName+"Selected";this.fireEvent(new mxEventObject(mxEvent.SELECT));c()}));this.container.appendChild(f);null==this.defaultMode&&(this.defaultMode=f,this.selectMode(f),c());return f}; mxToolbar.prototype.addMode=function(a,b,c,d,e,f){f=null!=f?f:!0;var g=document.createElement(null!=b?"img":"button");g.initialClassName=e||"mxToolbarMode";g.className=g.initialClassName;g.setAttribute("src",b);g.altIcon=d;null!=a&&g.setAttribute("title",a);this.enabled&&f&&(mxEvent.addListener(g,"click",mxUtils.bind(this,function(k){this.selectMode(g,c);this.noReset=!1})),mxEvent.addListener(g,"dblclick",mxUtils.bind(this,function(k){this.selectMode(g,c);this.noReset=!0})),null==this.defaultMode&& (this.defaultMode=g,this.defaultFunction=c,this.selectMode(g,c)));this.container.appendChild(g);return g}; mxToolbar.prototype.selectMode=function(a,b){if(this.selectedMode!=a){if(null!=this.selectedMode){var c=this.selectedMode.altIcon;null!=c?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",c)):this.selectedMode.className=this.selectedMode.initialClassName}this.selectedMode=a;c=this.selectedMode.altIcon;null!=c?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",c)):this.selectedMode.className=this.selectedMode.initialClassName+ "Selected";this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",b))}};mxToolbar.prototype.resetMode=function(a){!a&&this.noReset||this.selectedMode==this.defaultMode||this.selectMode(this.defaultMode,this.defaultFunction)};mxToolbar.prototype.addSeparator=function(a){return this.addItem(null,a,null)};mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)}; mxToolbar.prototype.addLine=function(){var a=document.createElement("hr");a.style.marginRight="6px";a.setAttribute("size","1");this.container.appendChild(a)};mxToolbar.prototype.destroy=function(){mxEvent.release(this.container);this.selectedMode=this.defaultFunction=this.defaultMode=this.container=null;null!=this.menu&&this.menu.destroy()};function mxUndoableEdit(a,b){this.source=a;this.changes=[];this.significant=null!=b?b:!0}mxUndoableEdit.prototype.source=null; mxUndoableEdit.prototype.changes=null;mxUndoableEdit.prototype.significant=null;mxUndoableEdit.prototype.undone=!1;mxUndoableEdit.prototype.redone=!1;mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length};mxUndoableEdit.prototype.isSignificant=function(){return this.significant};mxUndoableEdit.prototype.add=function(a){this.changes.push(a)};mxUndoableEdit.prototype.notify=function(){};mxUndoableEdit.prototype.die=function(){}; mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var a=this.changes.length-1;0<=a;a--){var b=this.changes[a];null!=b.execute?b.execute():null!=b.undo&&b.undo();this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",b))}this.undone=!0;this.redone=!1;this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()}; mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var a=this.changes.length,b=0;b<a;b++){var c=this.changes[b];null!=c.execute?c.execute():null!=c.redo&&c.redo();this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",c))}this.undone=!1;this.redone=!0;this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()};function mxUndoManager(a){this.size=null!=a?a:100;this.clear()}mxUndoManager.prototype=new mxEventSource; mxUndoManager.prototype.constructor=mxUndoManager;mxUndoManager.prototype.size=null;mxUndoManager.prototype.history=null;mxUndoManager.prototype.indexOfNextAdd=0;mxUndoManager.prototype.isEmpty=function(){return 0==this.history.length};mxUndoManager.prototype.clear=function(){this.history=[];this.indexOfNextAdd=0;this.fireEvent(new mxEventObject(mxEvent.CLEAR))};mxUndoManager.prototype.canUndo=function(){return 0<this.indexOfNextAdd}; mxUndoManager.prototype.undo=function(){for(;0<this.indexOfNextAdd;){var a=this.history[--this.indexOfNextAdd];a.undo();if(a.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",a));break}}};mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd<this.history.length}; mxUndoManager.prototype.redo=function(){for(var a=this.history.length;this.indexOfNextAdd<a;){var b=this.history[this.indexOfNextAdd++];b.redo();if(b.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.REDO,"edit",b));break}}};mxUndoManager.prototype.undoableEditHappened=function(a){this.trim();0<this.size&&this.size==this.history.length&&this.history.shift();this.history.push(a);this.indexOfNextAdd=this.history.length;this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",a))}; mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var a=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),b=0;b<a.length;b++)a[b].die()};var mxUrlConverter=function(){};mxUrlConverter.prototype.enabled=!0;mxUrlConverter.prototype.baseUrl=null;mxUrlConverter.prototype.baseDomain=null; mxUrlConverter.prototype.updateBaseUrl=function(){this.baseDomain=location.protocol+"//"+location.host;this.baseUrl=this.baseDomain+location.pathname;var a=this.baseUrl.lastIndexOf("/");0<a&&(this.baseUrl=this.baseUrl.substring(0,a+1))};mxUrlConverter.prototype.isEnabled=function(){return this.enabled};mxUrlConverter.prototype.setEnabled=function(a){this.enabled=a};mxUrlConverter.prototype.getBaseUrl=function(){return this.baseUrl};mxUrlConverter.prototype.setBaseUrl=function(a){this.baseUrl=a}; mxUrlConverter.prototype.getBaseDomain=function(){return this.baseDomain};mxUrlConverter.prototype.setBaseDomain=function(a){this.baseDomain=a};mxUrlConverter.prototype.isRelativeUrl=function(a){return"string"===typeof a&&"data:image"!=a.substring(0,10)&&!/^(\/\/|[a-zA-Z][a-zA-Z\d+\-.]*:)/.test(a)};mxUrlConverter.prototype.convert=function(a){this.isEnabled()&&this.isRelativeUrl(a)&&(null==this.getBaseUrl()&&this.updateBaseUrl(),a="/"==a.charAt(0)?this.getBaseDomain()+a:this.getBaseUrl()+a);return a}; function mxPanningManager(a){this.thread=null;this.active=!1;this.dy=this.dx=this.t0y=this.t0x=this.tdy=this.tdx=0;this.scrollbars=!1;this.scrollTop=this.scrollLeft=0;this.mouseListener={mouseDown:function(c,d){},mouseMove:function(c,d){},mouseUp:mxUtils.bind(this,function(c,d){this.active&&this.stop()})};a.addMouseListener(this.mouseListener);this.mouseUpListener=mxUtils.bind(this,function(){this.active&&this.stop()});mxEvent.addListener(document,"mouseup",this.mouseUpListener);var b=mxUtils.bind(this, function(){this.scrollbars=mxUtils.hasScrollbars(a.container);this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop;return window.setInterval(mxUtils.bind(this,function(){this.tdx-=this.dx;this.tdy-=this.dy;this.scrollbars?(a.panGraph(-a.container.scrollLeft-Math.ceil(this.dx),-a.container.scrollTop-Math.ceil(this.dy)),a.panDx=this.scrollLeft-a.container.scrollLeft,a.panDy=this.scrollTop-a.container.scrollTop,a.fireEvent(new mxEventObject(mxEvent.PAN))):a.panGraph(this.getDx(), this.getDy())}),this.delay)});this.isActive=function(){return active};this.getDx=function(){return Math.round(this.tdx)};this.getDy=function(){return Math.round(this.tdy)};this.start=function(){this.t0x=a.view.translate.x;this.t0y=a.view.translate.y;this.active=!0};this.panTo=function(c,d,e,f){this.active||this.start();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop;var g=a.container;this.dx=c+(null!=e?e:0)-g.scrollLeft-g.clientWidth;this.dx=0>this.dx&&Math.abs(this.dx)< this.border?this.border+this.dx:this.handleMouseOut?Math.max(this.dx,0):0;0==this.dx&&(this.dx=c-g.scrollLeft,this.dx=0<this.dx&&this.dx<this.border?this.dx-this.border:this.handleMouseOut?Math.min(0,this.dx):0);this.dy=d+(null!=f?f:0)-g.scrollTop-g.clientHeight;this.dy=0>this.dy&&Math.abs(this.dy)<this.border?this.border+this.dy:this.handleMouseOut?Math.max(this.dy,0):0;0==this.dy&&(this.dy=d-g.scrollTop,this.dy=0<this.dy&&this.dy<this.border?this.dy-this.border:this.handleMouseOut?Math.min(0,this.dy): 0);0!=this.dx||0!=this.dy?(this.dx*=this.damper,this.dy*=this.damper,null==this.thread&&(this.thread=b())):null!=this.thread&&(window.clearInterval(this.thread),this.thread=null)};this.stop=function(){if(this.active)if(this.active=!1,null!=this.thread&&(window.clearInterval(this.thread),this.thread=null),this.tdy=this.tdx=0,this.scrollbars)a.panDx=0,a.panDy=0,a.fireEvent(new mxEventObject(mxEvent.PAN));else{var c=a.panDx,d=a.panDy;if(0!=c||0!=d)a.panGraph(0,0),a.view.setTranslate(this.t0x+c/a.view.scale, this.t0y+d/a.view.scale)}};this.destroy=function(){a.removeMouseListener(this.mouseListener);mxEvent.removeListener(document,"mouseup",this.mouseUpListener)}}mxPanningManager.prototype.damper=1/6;mxPanningManager.prototype.delay=10;mxPanningManager.prototype.handleMouseOut=!0;mxPanningManager.prototype.border=0;function mxPopupMenu(a){this.factoryMethod=a;null!=a&&this.init()}mxPopupMenu.prototype=new mxEventSource;mxPopupMenu.prototype.constructor=mxPopupMenu;mxPopupMenu.prototype.submenuImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDAwLTI4MHYtNDAwbDIwMCAyMDAtMjAwIDIwMFoiLz48L3N2Zz4="; mxPopupMenu.prototype.zIndex=10006;mxPopupMenu.prototype.factoryMethod=null;mxPopupMenu.prototype.useLeftButtonForPopup=!1;mxPopupMenu.prototype.enabled=!0;mxPopupMenu.prototype.itemCount=0;mxPopupMenu.prototype.autoExpand=!1;mxPopupMenu.prototype.smartSeparators=!1;mxPopupMenu.prototype.labels=!0; mxPopupMenu.prototype.init=function(){this.table=document.createElement("table");this.table.className="mxPopupMenu";this.tbody=document.createElement("tbody");this.table.appendChild(this.tbody);this.div=document.createElement("div");this.div.className="mxPopupMenu";this.div.style.display="inline";this.div.style.zIndex=this.zIndex;this.div.appendChild(this.table);mxEvent.disableContextMenu(this.div)};mxPopupMenu.prototype.isEnabled=function(){return this.enabled}; mxPopupMenu.prototype.setEnabled=function(a){this.enabled=a};mxPopupMenu.prototype.isPopupTrigger=function(a){return a.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(a.getEvent())}; mxPopupMenu.prototype.addItem=function(a,b,c,d,e,f,g,k){d=d||this;this.itemCount++;d.willAddSeparator&&(d.containsItems&&this.addSeparator(d,!0),d.willAddSeparator=!1);d.containsItems=!0;var l=document.createElement("tr");l.className="mxPopupMenuItem";var m=document.createElement("td");m.className="mxPopupMenuIcon";null!=b?(e=document.createElement("img"),e.src=b,m.appendChild(e)):null!=e&&(b=document.createElement("div"),b.className=e,m.appendChild(b));l.appendChild(m);this.labels&&(m=document.createElement("td"), m.className="mxPopupMenuItem"+(null==f||f?"":" mxDisabled"),mxUtils.write(m,a),m.align="left",l.appendChild(m),a=document.createElement("td"),a.className="mxPopupMenuItem"+(null==f||f?"":" mxDisabled"),a.style.paddingRight="6px",a.style.textAlign="right",l.appendChild(a),null==d.div&&this.createSubmenu(d));d.tbody.appendChild(l);if(0!=g&&0!=f){var n=null;mxEvent.addGestureListeners(l,mxUtils.bind(this,function(p){this.eventReceiver=l;d.activeRow!=l&&d.activeRow!=d&&(null!=d.activeRow&&null!=d.activeRow.div.parentNode&& this.hideSubmenu(d),null!=l.div&&(this.showSubmenu(d,l),d.activeRow=l));null!=document.selection&&8==document.documentMode&&(n=document.selection.createRange());mxEvent.consume(p)}),mxUtils.bind(this,function(p){d.activeRow!=l&&d.activeRow!=d&&(null!=d.activeRow&&null!=d.activeRow.div.parentNode&&this.hideSubmenu(d),this.autoExpand&&null!=l.div&&(this.showSubmenu(d,l),d.activeRow=l));k||(l.className="mxPopupMenuItemHover")}),mxUtils.bind(this,function(p){if(this.eventReceiver==l){d.activeRow!=l&& this.hideMenu();if(null!=n){try{n.select()}catch(q){}n=null}null!=c&&c(p)}this.eventReceiver=null;mxEvent.consume(p)}));k||mxEvent.addListener(l,"mouseout",mxUtils.bind(this,function(p){l.className="mxPopupMenuItem"}))}return l};mxPopupMenu.prototype.addCheckmark=function(a,b){a=this.addImage(a.firstChild.nextSibling,b);a.style.marginTop="-2px";a.style.left="6px"}; mxPopupMenu.prototype.addImage=function(a,b){var c=document.createElement("div");c.style.position="absolute";c.style.display="inline-block";c.style.backgroundRepeat="no-repeat";c.style.backgroundPosition="center center";c.style.backgroundImage="url("+b+")";c.style.backgroundSize="22px";c.style.height="22px";c.style.width="22px";a.appendChild(c);return c}; mxPopupMenu.prototype.createSubmenu=function(a){a.table=document.createElement("table");a.table.className="mxPopupMenu";a.tbody=document.createElement("tbody");a.table.appendChild(a.tbody);a.div=document.createElement("div");a.div.className="mxPopupMenu";a.div.style.position="absolute";a.div.style.display="inline";a.div.style.zIndex=this.zIndex;a.div.appendChild(a.table);a=this.addImage(a.firstChild.nextSibling.nextSibling,this.submenuImage);a.style.marginLeft="-18px";a.style.marginTop="-11px"}; mxPopupMenu.prototype.showSubmenu=function(a,b){if(null!=b.div){b.div.style.left=a.div.offsetLeft+b.offsetLeft+b.offsetWidth-1+"px";b.div.style.top=a.div.offsetTop+b.offsetTop+"px";document.body.appendChild(b.div);var c=parseInt(b.div.offsetLeft),d=parseInt(b.div.offsetWidth),e=mxUtils.getDocumentScrollOrigin(document),f=document.documentElement;c+d>e.x+(document.body.clientWidth||f.clientWidth)&&(b.div.style.left=Math.max(0,a.div.offsetLeft-d+16)+"px");b.div.style.overflowY="auto";b.div.style.overflowX= "hidden";b.div.style.maxHeight=Math.max(document.body.clientHeight,document.documentElement.clientHeight)-10+"px";mxUtils.fit(b.div)}}; mxPopupMenu.prototype.addSeparator=function(a,b){a=a||this;if(this.smartSeparators&&!b)a.willAddSeparator=!0;else if(null!=a.tbody){a.willAddSeparator=!1;b=document.createElement("tr");var c=document.createElement("td");c.className="mxPopupMenuIcon";c.style.padding="0 0 0 0px";b.appendChild(c);c=document.createElement("td");c.style.padding="0 0 0 0px";c.setAttribute("colSpan","2");var d=document.createElement("hr");d.setAttribute("size","1");c.appendChild(d);b.appendChild(c);a.tbody.appendChild(b)}}; mxPopupMenu.prototype.popup=function(a,b,c,d){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){this.div.style.left=a+"px";for(this.div.style.top=b+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0;this.factoryMethod(this,c,d);0<this.itemCount&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}}; mxPopupMenu.prototype.isMenuShowing=function(){return null!=this.div&&this.div.parentNode==document.body};mxPopupMenu.prototype.showMenu=function(){9<=document.documentMode&&(this.div.style.filter="none");document.body.appendChild(this.div);window.setTimeout(mxUtils.bind(this,function(){null!=this.div&&mxUtils.fit(this.div)}),0)}; mxPopupMenu.prototype.hideMenu=function(){null!=this.div&&(null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1,this.fireEvent(new mxEventObject(mxEvent.HIDE)))};mxPopupMenu.prototype.hideSubmenu=function(a){null!=a.activeRow&&(this.hideSubmenu(a.activeRow),null!=a.activeRow.div.parentNode&&a.activeRow.div.parentNode.removeChild(a.activeRow.div),a.activeRow=null)}; mxPopupMenu.prototype.destroy=function(){null!=this.div&&(mxEvent.release(this.div),null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null)};function mxAutoSaveManager(a){this.changeHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.graphModelChanged(c.getProperty("edit").changes)});this.setGraph(a)}mxAutoSaveManager.prototype=new mxEventSource;mxAutoSaveManager.prototype.constructor=mxAutoSaveManager;mxAutoSaveManager.prototype.graph=null; mxAutoSaveManager.prototype.autoSaveDelay=10;mxAutoSaveManager.prototype.autoSaveThrottle=2;mxAutoSaveManager.prototype.autoSaveThreshold=5;mxAutoSaveManager.prototype.ignoredChanges=0;mxAutoSaveManager.prototype.lastSnapshot=0;mxAutoSaveManager.prototype.enabled=!0;mxAutoSaveManager.prototype.changeHandler=null;mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled};mxAutoSaveManager.prototype.setEnabled=function(a){this.enabled=a}; mxAutoSaveManager.prototype.setGraph=function(a){null!=this.graph&&this.graph.getModel().removeListener(this.changeHandler);this.graph=a;null!=this.graph&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)};mxAutoSaveManager.prototype.save=function(){};mxAutoSaveManager.prototype.graphModelChanged=function(a){a=((new Date).getTime()-this.lastSnapshot)/1E3;a>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&a>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++}; mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime();this.ignoredChanges=0};mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)};function mxAnimation(a){this.delay=null!=a?a:20}mxAnimation.prototype=new mxEventSource;mxAnimation.prototype.constructor=mxAnimation;mxAnimation.prototype.delay=null;mxAnimation.prototype.thread=null;mxAnimation.prototype.isRunning=function(){return null!=this.thread}; mxAnimation.prototype.startAnimation=function(){null==this.thread&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))};mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))};mxAnimation.prototype.stopAnimation=function(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))}; function mxMorphing(a,b,c,d){mxAnimation.call(this,d);this.graph=a;this.steps=null!=b?b:6;this.ease=null!=c?c:1.5}mxMorphing.prototype=new mxAnimation;mxMorphing.prototype.constructor=mxMorphing;mxMorphing.prototype.graph=null;mxMorphing.prototype.steps=null;mxMorphing.prototype.step=0;mxMorphing.prototype.ease=null;mxMorphing.prototype.cells=null; mxMorphing.prototype.updateAnimation=function(){mxAnimation.prototype.updateAnimation.apply(this,arguments);var a=new mxCellStatePreview(this.graph);if(null!=this.cells)for(var b=0;b<this.cells.length;b++)this.animateCell(this.cells[b],a,!1);else this.animateCell(this.graph.getModel().getRoot(),a,!0);this.show(a);(a.isEmpty()||this.step++>=this.steps)&&this.stopAnimation()};mxMorphing.prototype.show=function(a){a.show()}; mxMorphing.prototype.animateCell=function(a,b,c){var d=this.graph.getView().getState(a),e=null;if(null!=d&&(e=this.getDelta(d),this.graph.getModel().isVertex(a)&&(0!=e.x||0!=e.y))){var f=this.graph.view.getTranslate(),g=this.graph.view.getScale();e.x+=f.x*g;e.y+=f.y*g;b.moveState(d,-e.x/this.ease,-e.y/this.ease)}if(c&&!this.stopRecursion(d,e))for(d=this.graph.getModel().getChildCount(a),e=0;e<d;e++)this.animateCell(this.graph.getModel().getChildAt(a,e),b,c)}; mxMorphing.prototype.stopRecursion=function(a,b){return null!=b&&(0!=b.x||0!=b.y)};mxMorphing.prototype.getDelta=function(a){var b=this.getOriginForCell(a.cell),c=this.graph.getView().getTranslate(),d=this.graph.getView().getScale();return new mxPoint((b.x-(a.x/d-c.x))*d,(b.y-(a.y/d-c.y))*d)}; mxMorphing.prototype.getOriginForCell=function(a){var b=null;if(null!=a){var c=this.graph.getModel().getParent(a);a=this.graph.getCellGeometry(a);b=this.getOriginForCell(c);null!=a&&(a.relative?(c=this.graph.getCellGeometry(c),null!=c&&(b.x+=a.x*c.width,b.y+=a.y*c.height)):(b.x+=a.x,b.y+=a.y))}null==b&&(b=this.graph.view.getTranslate(),b=new mxPoint(-b.x,-b.y));return b};function mxImageBundle(a){this.images=[];this.alt=null!=a?a:!1}mxImageBundle.prototype.images=null; mxImageBundle.prototype.alt=null;mxImageBundle.prototype.putImage=function(a,b,c){this.images[a]={value:b,fallback:c}};mxImageBundle.prototype.getImage=function(a){var b=null;null!=a&&(a=this.images[a],null!=a&&(b=this.alt?a.fallback:a.value));return b};function mxImageExport(){}mxImageExport.prototype.includeOverlays=!1; mxImageExport.prototype.drawState=function(a,b){null!=a&&(this.visitStatesRecursive(a,b,mxUtils.bind(this,function(){this.drawCellState.apply(this,arguments)})),this.includeOverlays&&this.visitStatesRecursive(a,b,mxUtils.bind(this,function(){this.drawOverlays.apply(this,arguments)})))}; mxImageExport.prototype.visitStatesRecursive=function(a,b,c){if(null!=a){c(a,b);for(var d=a.view.graph,e=d.model.getChildCount(a.cell),f=0;f<e;f++){var g=d.view.getState(d.model.getChildAt(a.cell,f));this.visitStatesRecursive(g,b,c)}}};mxImageExport.prototype.getTitleForCellState=function(a,b){return null};mxImageExport.prototype.getLinkForCellState=function(a,b){return null};mxImageExport.prototype.getLinkTargetForCellState=function(a,b){return null}; mxImageExport.prototype.drawCellState=function(a,b){var c=this.getLinkForCellState(a,b);null!=c&&b.setLink(c,this.getLinkTargetForCellState(a,b));var d=this.getTitleForCellState(a,b);null!=d&&b.setTitle(d);this.drawShape(a,b);this.drawText(a,b);null!=d&&b.setTitle(null);null!=c&&b.setLink(null)};mxImageExport.prototype.drawShape=function(a,b){a.shape instanceof mxShape&&this.doDrawShape(a.shape,b)};mxImageExport.prototype.drawText=function(a,b){this.doDrawShape(a.text,b)}; mxImageExport.prototype.doDrawShape=function(a,b){if(null!=a&&a.checkBounds()){var c=b.root,d=a.node;b.root=a.createSvg();c.appendChild(b.root);a.node=b.root;b.save();var e=this.getSvgShapeOffset(a,b);0!=e?a.node.setAttribute("transform","translate("+e+","+e+")"):a.node.removeAttribute("transform");a.beforePaint(b);a.paint(b);a.afterPaint(b);b.restore();a.node=d;b.root=c}}; mxImageExport.prototype.getSvgShapeOffset=function(a,b){if(a.getSvgScreenOffset!=mxShape.prototype.getSvgScreenOffset)return a.getSvgScreenOffset();var c=null!=a.stencil&&"inherit"!=a.stencil.strokewidth?Number(a.stencil.strokewidth):a.strokewidth;b=a.scale*(null!=b.state?b.state.scale:1);return null!=a.stroke&&1==mxUtils.mod(Math.round(c*b),2)?.5:0};mxImageExport.prototype.drawOverlays=function(a,b){null!=a.overlays&&a.overlays.visit(function(c,d){d instanceof mxShape&&d.paint(b)})}; function mxAbstractCanvas2D(){this.converter=this.createUrlConverter();this.reset()}mxAbstractCanvas2D.prototype.state=null;mxAbstractCanvas2D.prototype.states=null;mxAbstractCanvas2D.prototype.path=null;mxAbstractCanvas2D.prototype.rotateHtml=!0;mxAbstractCanvas2D.prototype.lastX=0;mxAbstractCanvas2D.prototype.lastY=0;mxAbstractCanvas2D.prototype.moveOp="M";mxAbstractCanvas2D.prototype.lineOp="L";mxAbstractCanvas2D.prototype.quadOp="Q";mxAbstractCanvas2D.prototype.curveOp="C"; mxAbstractCanvas2D.prototype.closeOp="Z";mxAbstractCanvas2D.prototype.pointerEvents=!1;mxAbstractCanvas2D.prototype.createUrlConverter=function(){return new mxUrlConverter};mxAbstractCanvas2D.prototype.reset=function(){this.state=this.createState();this.states=[]}; mxAbstractCanvas2D.prototype.createState=function(){return{dx:0,dy:0,scale:1,alpha:1,fillAlpha:1,strokeAlpha:1,fillColor:null,gradientFillAlpha:1,gradientColor:null,gradientAlpha:1,gradientDirection:null,strokeColor:null,strokeWidth:1,dashed:!1,dashPattern:"3 3",fixDash:!1,lineCap:"flat",lineJoin:"miter",miterLimit:10,fontColor:"#000000",fontBackgroundColor:null,fontBorderColor:null,labelPadding:null,fontSize:mxConstants.DEFAULT_FONTSIZE,fontFamily:mxConstants.DEFAULT_FONTFAMILY,fontStyle:0,shadow:!1, shadowStyle:null,shadowColor:mxConstants.SHADOWCOLOR,shadowAlpha:mxConstants.SHADOW_OPACITY,shadowDx:mxConstants.SHADOW_OFFSET_X,shadowDy:mxConstants.SHADOW_OFFSET_Y,rotation:0,rotationCx:0,rotationCy:0}};mxAbstractCanvas2D.prototype.format=function(a){return Math.round(parseFloat(a))}; mxAbstractCanvas2D.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var a=this.state,b=2;b<arguments.length;b+=2)this.lastX=arguments[b-1],this.lastY=arguments[b],this.path.push(this.format((this.lastX+a.dx)*a.scale)),this.path.push(this.format((this.lastY+a.dy)*a.scale))};mxAbstractCanvas2D.prototype.rotatePoint=function(a,b,c,d,e){c*=Math.PI/180;return mxUtils.getRotatedPoint(new mxPoint(a,b),Math.cos(c),Math.sin(c),new mxPoint(d,e))}; mxAbstractCanvas2D.prototype.save=function(){this.states.push(this.state);this.state=mxUtils.clone(this.state)};mxAbstractCanvas2D.prototype.restore=function(){0<this.states.length&&(this.state=this.states.pop())};mxAbstractCanvas2D.prototype.setTitle=function(a){};mxAbstractCanvas2D.prototype.setLink=function(a,b){};mxAbstractCanvas2D.prototype.scale=function(a){this.state.scale*=a;this.state.strokeWidth*=a};mxAbstractCanvas2D.prototype.translate=function(a,b){this.state.dx+=a;this.state.dy+=b}; mxAbstractCanvas2D.prototype.rotate=function(a,b,c,d,e){};mxAbstractCanvas2D.prototype.setAlpha=function(a){this.state.alpha=a};mxAbstractCanvas2D.prototype.setFillAlpha=function(a){this.state.fillAlpha=a};mxAbstractCanvas2D.prototype.setStrokeAlpha=function(a){this.state.strokeAlpha=a};mxAbstractCanvas2D.prototype.setFillColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fillColor=a;this.state.gradientColor=null}; mxAbstractCanvas2D.prototype.setFillStyle=function(a,b,c,d){a==mxConstants.NONE&&(a=null);this.state.fillStyle=a;this.state.hachureGap=b;this.state.fillWeight=c;this.state.hachureAngle=d};mxAbstractCanvas2D.prototype.setGradient=function(a,b,c,d,e,f,g,k,l){c=this.state;c.fillColor=a;c.gradientFillAlpha=null!=k?k:1;c.gradientColor=b;c.gradientAlpha=null!=l?l:1;c.gradientDirection=g};mxAbstractCanvas2D.prototype.setStrokeColor=function(a){a==mxConstants.NONE&&(a=null);this.state.strokeColor=a}; mxAbstractCanvas2D.prototype.setStrokeWidth=function(a){this.state.strokeWidth=a};mxAbstractCanvas2D.prototype.setDashed=function(a,b){this.state.dashed=a;this.state.fixDash=b};mxAbstractCanvas2D.prototype.setDashPattern=function(a){this.state.dashPattern=a};mxAbstractCanvas2D.prototype.setLineCap=function(a){this.state.lineCap=a};mxAbstractCanvas2D.prototype.setLineJoin=function(a){this.state.lineJoin=a};mxAbstractCanvas2D.prototype.setMiterLimit=function(a){this.state.miterLimit=a}; mxAbstractCanvas2D.prototype.setFontColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontColor=a};mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBackgroundColor=a};mxAbstractCanvas2D.prototype.setLabelPadding=function(a){this.state.labelPadding=mxUtils.parseCssSpacing(a)};mxAbstractCanvas2D.prototype.setFontBorderColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBorderColor=a}; mxAbstractCanvas2D.prototype.setFontSize=function(a){this.state.fontSize=parseFloat(a)};mxAbstractCanvas2D.prototype.setFontFamily=function(a){this.state.fontFamily=a};mxAbstractCanvas2D.prototype.setFontStyle=function(a){null==a&&(a=0);this.state.fontStyle=a};mxAbstractCanvas2D.prototype.setShadow=function(a,b){this.state.shadow=a;this.state.shadowStyle=b};mxAbstractCanvas2D.prototype.setShadowColor=function(a){a==mxConstants.NONE&&(a=null);this.state.shadowColor=a}; mxAbstractCanvas2D.prototype.setShadowAlpha=function(a){this.state.shadowAlpha=a};mxAbstractCanvas2D.prototype.setShadowOffset=function(a,b){this.state.shadowDx=a;this.state.shadowDy=b};mxAbstractCanvas2D.prototype.begin=function(){this.lastY=this.lastX=0;this.path=[]};mxAbstractCanvas2D.prototype.moveTo=function(a,b){this.addOp(this.moveOp,a,b)};mxAbstractCanvas2D.prototype.lineTo=function(a,b){this.addOp(this.lineOp,a,b)}; mxAbstractCanvas2D.prototype.quadTo=function(a,b,c,d){this.addOp(this.quadOp,a,b,c,d)};mxAbstractCanvas2D.prototype.curveTo=function(a,b,c,d,e,f){this.addOp(this.curveOp,a,b,c,d,e,f)};mxAbstractCanvas2D.prototype.arcTo=function(a,b,c,d,e,f,g){a=mxUtils.arcToCurves(this.lastX,this.lastY,a,b,c,d,e,f,g);if(null!=a)for(b=0;b<a.length;b+=6)this.curveTo(a[b],a[b+1],a[b+2],a[b+3],a[b+4],a[b+5])};mxAbstractCanvas2D.prototype.close=function(a,b,c,d,e,f){this.addOp(this.closeOp)}; mxAbstractCanvas2D.prototype.end=function(){};function mxXmlCanvas2D(a){mxAbstractCanvas2D.call(this);this.root=a;this.writeDefaults()}mxUtils.extend(mxXmlCanvas2D,mxAbstractCanvas2D);mxXmlCanvas2D.prototype.textEnabled=!0;mxXmlCanvas2D.prototype.compressed=!0; mxXmlCanvas2D.prototype.writeDefaults=function(){var a=this.createElement("fontfamily");a.setAttribute("family",mxConstants.DEFAULT_FONTFAMILY);this.root.appendChild(a);a=this.createElement("fontsize");a.setAttribute("size",mxConstants.DEFAULT_FONTSIZE);this.root.appendChild(a);a=this.createElement("shadowcolor");a.setAttribute("color",mxConstants.SHADOWCOLOR);this.root.appendChild(a);a=this.createElement("shadowalpha");a.setAttribute("alpha",mxConstants.SHADOW_OPACITY);this.root.appendChild(a);a= this.createElement("shadowoffset");a.setAttribute("dx",mxConstants.SHADOW_OFFSET_X);a.setAttribute("dy",mxConstants.SHADOW_OFFSET_Y);this.root.appendChild(a)};mxXmlCanvas2D.prototype.format=function(a){return parseFloat(parseFloat(a).toFixed(2))};mxXmlCanvas2D.prototype.createElement=function(a){return this.root.ownerDocument.createElement(a)};mxXmlCanvas2D.prototype.save=function(){this.compressed&&mxAbstractCanvas2D.prototype.save.apply(this,arguments);this.root.appendChild(this.createElement("save"))}; mxXmlCanvas2D.prototype.restore=function(){this.compressed&&mxAbstractCanvas2D.prototype.restore.apply(this,arguments);this.root.appendChild(this.createElement("restore"))};mxXmlCanvas2D.prototype.scale=function(a){var b=this.createElement("scale");b.setAttribute("scale",a);this.root.appendChild(b)};mxXmlCanvas2D.prototype.translate=function(a,b){var c=this.createElement("translate");c.setAttribute("dx",this.format(a));c.setAttribute("dy",this.format(b));this.root.appendChild(c)}; mxXmlCanvas2D.prototype.rotate=function(a,b,c,d,e){var f=this.createElement("rotate");if(0!=a||b||c)f.setAttribute("theta",this.format(a)),f.setAttribute("flipH",b?"1":"0"),f.setAttribute("flipV",c?"1":"0"),f.setAttribute("cx",this.format(d)),f.setAttribute("cy",this.format(e)),this.root.appendChild(f)}; mxXmlCanvas2D.prototype.setAlpha=function(a){if(this.compressed){if(this.state.alpha==a)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var b=this.createElement("alpha");b.setAttribute("alpha",this.format(a));this.root.appendChild(b)};mxXmlCanvas2D.prototype.setFillAlpha=function(a){if(this.compressed){if(this.state.fillAlpha==a)return;mxAbstractCanvas2D.prototype.setFillAlpha.apply(this,arguments)}var b=this.createElement("fillalpha");b.setAttribute("alpha",this.format(a));this.root.appendChild(b)}; mxXmlCanvas2D.prototype.setStrokeAlpha=function(a){if(this.compressed){if(this.state.strokeAlpha==a)return;mxAbstractCanvas2D.prototype.setStrokeAlpha.apply(this,arguments)}var b=this.createElement("strokealpha");b.setAttribute("alpha",this.format(a));this.root.appendChild(b)}; mxXmlCanvas2D.prototype.setFillColor=function(a){a==mxConstants.NONE&&(a=null);if(this.compressed){if(this.state.fillColor==a)return;mxAbstractCanvas2D.prototype.setFillColor.apply(this,arguments)}var b=this.createElement("fillcolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)}; mxXmlCanvas2D.prototype.setGradient=function(a,b,c,d,e,f,g,k,l){if(null!=a&&null!=b){mxAbstractCanvas2D.prototype.setGradient.apply(this,arguments);var m=this.createElement("gradient");m.setAttribute("c1",a);m.setAttribute("c2",b);m.setAttribute("x",this.format(c));m.setAttribute("y",this.format(d));m.setAttribute("w",this.format(e));m.setAttribute("h",this.format(f));null!=g&&m.setAttribute("direction",g);null!=k&&m.setAttribute("alpha1",k);null!=l&&m.setAttribute("alpha2",l);this.root.appendChild(m)}}; mxXmlCanvas2D.prototype.setStrokeColor=function(a){a==mxConstants.NONE&&(a=null);if(this.compressed){if(this.state.strokeColor==a)return;mxAbstractCanvas2D.prototype.setStrokeColor.apply(this,arguments)}var b=this.createElement("strokecolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)}; mxXmlCanvas2D.prototype.setStrokeWidth=function(a){if(this.compressed){if(this.state.strokeWidth==a)return;mxAbstractCanvas2D.prototype.setStrokeWidth.apply(this,arguments)}var b=this.createElement("strokewidth");b.setAttribute("width",this.format(a));this.root.appendChild(b)}; mxXmlCanvas2D.prototype.setDashed=function(a,b){if(this.compressed){if(this.state.dashed==a)return;mxAbstractCanvas2D.prototype.setDashed.apply(this,arguments)}var c=this.createElement("dashed");c.setAttribute("dashed",a?"1":"0");null!=b&&c.setAttribute("fixDash",b?"1":"0");this.root.appendChild(c)}; mxXmlCanvas2D.prototype.setDashPattern=function(a){if(this.compressed){if(this.state.dashPattern==a)return;mxAbstractCanvas2D.prototype.setDashPattern.apply(this,arguments)}var b=this.createElement("dashpattern");b.setAttribute("pattern",a);this.root.appendChild(b)};mxXmlCanvas2D.prototype.setLineCap=function(a){if(this.compressed){if(this.state.lineCap==a)return;mxAbstractCanvas2D.prototype.setLineCap.apply(this,arguments)}var b=this.createElement("linecap");b.setAttribute("cap",a);this.root.appendChild(b)}; mxXmlCanvas2D.prototype.setLineJoin=function(a){if(this.compressed){if(this.state.lineJoin==a)return;mxAbstractCanvas2D.prototype.setLineJoin.apply(this,arguments)}var b=this.createElement("linejoin");b.setAttribute("join",a);this.root.appendChild(b)};mxXmlCanvas2D.prototype.setMiterLimit=function(a){if(this.compressed){if(this.state.miterLimit==a)return;mxAbstractCanvas2D.prototype.setMiterLimit.apply(this,arguments)}var b=this.createElement("miterlimit");b.setAttribute("limit",a);this.root.appendChild(b)}; mxXmlCanvas2D.prototype.setFontColor=function(a){if(this.textEnabled){a==mxConstants.NONE&&(a=null);if(this.compressed){if(this.state.fontColor==a)return;mxAbstractCanvas2D.prototype.setFontColor.apply(this,arguments)}var b=this.createElement("fontcolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)}}; mxXmlCanvas2D.prototype.setFontBackgroundColor=function(a){if(this.textEnabled){a==mxConstants.NONE&&(a=null);if(this.compressed){if(this.state.fontBackgroundColor==a)return;mxAbstractCanvas2D.prototype.setFontBackgroundColor.apply(this,arguments)}var b=this.createElement("fontbackgroundcolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)}}; mxXmlCanvas2D.prototype.setFontBorderColor=function(a){if(this.textEnabled){a==mxConstants.NONE&&(a=null);if(this.compressed){if(this.state.fontBorderColor==a)return;mxAbstractCanvas2D.prototype.setFontBorderColor.apply(this,arguments)}var b=this.createElement("fontbordercolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)}}; mxXmlCanvas2D.prototype.setFontSize=function(a){if(this.textEnabled){if(this.compressed){if(this.state.fontSize==a)return;mxAbstractCanvas2D.prototype.setFontSize.apply(this,arguments)}var b=this.createElement("fontsize");b.setAttribute("size",a);this.root.appendChild(b)}}; mxXmlCanvas2D.prototype.setFontFamily=function(a){if(this.textEnabled){if(this.compressed){if(this.state.fontFamily==a)return;mxAbstractCanvas2D.prototype.setFontFamily.apply(this,arguments)}var b=this.createElement("fontfamily");b.setAttribute("family",a);this.root.appendChild(b)}}; mxXmlCanvas2D.prototype.setFontStyle=function(a){if(this.textEnabled){null==a&&(a=0);if(this.compressed){if(this.state.fontStyle==a)return;mxAbstractCanvas2D.prototype.setFontStyle.apply(this,arguments)}var b=this.createElement("fontstyle");b.setAttribute("style",a);this.root.appendChild(b)}}; mxXmlCanvas2D.prototype.setShadow=function(a){if(this.compressed){if(this.state.shadow==a)return;mxAbstractCanvas2D.prototype.setShadow.apply(this,arguments)}var b=this.createElement("shadow");b.setAttribute("enabled",a?"1":"0");this.root.appendChild(b)}; mxXmlCanvas2D.prototype.setShadowColor=function(a){if(this.compressed){a==mxConstants.NONE&&(a=null);if(this.state.shadowColor==a)return;mxAbstractCanvas2D.prototype.setShadowColor.apply(this,arguments)}var b=this.createElement("shadowcolor");b.setAttribute("color",null!=a?a:mxConstants.NONE);this.root.appendChild(b)}; mxXmlCanvas2D.prototype.setShadowAlpha=function(a){if(this.compressed){if(this.state.shadowAlpha==a)return;mxAbstractCanvas2D.prototype.setShadowAlpha.apply(this,arguments)}var b=this.createElement("shadowalpha");b.setAttribute("alpha",a);this.root.appendChild(b)}; mxXmlCanvas2D.prototype.setShadowOffset=function(a,b){if(this.compressed){if(this.state.shadowDx==a&&this.state.shadowDy==b)return;mxAbstractCanvas2D.prototype.setShadowOffset.apply(this,arguments)}var c=this.createElement("shadowoffset");c.setAttribute("dx",a);c.setAttribute("dy",b);this.root.appendChild(c)}; mxXmlCanvas2D.prototype.rect=function(a,b,c,d){var e=this.createElement("rect");e.setAttribute("x",this.format(a));e.setAttribute("y",this.format(b));e.setAttribute("w",this.format(c));e.setAttribute("h",this.format(d));this.root.appendChild(e)}; mxXmlCanvas2D.prototype.roundrect=function(a,b,c,d,e,f){var g=this.createElement("roundrect");g.setAttribute("x",this.format(a));g.setAttribute("y",this.format(b));g.setAttribute("w",this.format(c));g.setAttribute("h",this.format(d));g.setAttribute("dx",this.format(e));g.setAttribute("dy",this.format(f));this.root.appendChild(g)}; mxXmlCanvas2D.prototype.ellipse=function(a,b,c,d){var e=this.createElement("ellipse");e.setAttribute("x",this.format(a));e.setAttribute("y",this.format(b));e.setAttribute("w",this.format(c));e.setAttribute("h",this.format(d));this.root.appendChild(e)}; mxXmlCanvas2D.prototype.image=function(a,b,c,d,e,f,g,k){e=this.converter.convert(e);var l=this.createElement("image");l.setAttribute("x",this.format(a));l.setAttribute("y",this.format(b));l.setAttribute("w",this.format(c));l.setAttribute("h",this.format(d));l.setAttribute("src",e);l.setAttribute("aspect",f?"1":"0");l.setAttribute("flipH",g?"1":"0");l.setAttribute("flipV",k?"1":"0");this.root.appendChild(l)}; mxXmlCanvas2D.prototype.begin=function(){this.root.appendChild(this.createElement("begin"));this.lastY=this.lastX=0};mxXmlCanvas2D.prototype.moveTo=function(a,b){var c=this.createElement("move");c.setAttribute("x",this.format(a));c.setAttribute("y",this.format(b));this.root.appendChild(c);this.lastX=a;this.lastY=b}; mxXmlCanvas2D.prototype.lineTo=function(a,b){var c=this.createElement("line");c.setAttribute("x",this.format(a));c.setAttribute("y",this.format(b));this.root.appendChild(c);this.lastX=a;this.lastY=b};mxXmlCanvas2D.prototype.quadTo=function(a,b,c,d){var e=this.createElement("quad");e.setAttribute("x1",this.format(a));e.setAttribute("y1",this.format(b));e.setAttribute("x2",this.format(c));e.setAttribute("y2",this.format(d));this.root.appendChild(e);this.lastX=c;this.lastY=d}; 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=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="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_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.allowConvertHtmlToSvg=!1;mxSvgCanvas2D.prototype.setCssText=function(a,b){null!=a&&"function"===typeof a.setAttribute&&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))}; mxSvgCanvas2D.prototype.getBaseUrl=function(){var a=window.location.href,b=a.indexOf("#");0<b&&(a=a.substring(0,b));return a};mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments);this.gradients=[];this.fillPatterns=[]}; mxSvgCanvas2D.prototype.createStyle=function(a){a=this.createElement("style");a.setAttribute("type","text/css");mxUtils.write(a,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}");return a}; mxSvgCanvas2D.prototype.createElement=function(a,b){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(b||mxConstants.NS_SVG,a);a=this.root.ownerDocument.createElement(a);null!=b&&a.setAttribute("xmlns",b);return a};mxSvgCanvas2D.prototype.getAlternateText=function(a,b,c,d,e,f,g,k,l,m,n,p,q){return null!=f?this.foAltText:null}; mxSvgCanvas2D.prototype.getAlternateTextLines=function(a,b,c,d,e,f){var g=this.state;a=a.split(/\r\n|\r|\n/);d=(d||"fill"==e||"width"==e)&&0<b;var k=b+this.foreignObjectPadding,l=null;if(d||f&&0<b)l=document.createElement("canvas").getContext("2d"),l.font=((g.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic ":"")+((g.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold ":"")+g.fontSize+"px "+mxUtils.parseCssFontFamily(g.fontFamily);if(d&&null!=l){b=[];for(var m=0;m<a.length;m++){for(var n= a[m].split(/\s+/),p="",q=0;q<n.length;q++)if(0<n[q].length){var r=0<p.length?p+" "+n[q]:n[q];for(0<p.length&&l.measureText(r).width>k?(b.push(p),p=n[q]):p=r;1<p.length&&l.measureText(p).width>k&&/[\u2E80-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF]/.test(p);){for(r=p.length-1;1<r&&l.measureText(p.substring(0,r)).width>k;)r--;b.push(p.substring(0,r));p=p.substring(r)}}b.push(p)}a=b}(f||"fill"==e)&&0<c&&(c=Math.max(1,Math.floor(c/Math.round(mxConstants.LINE_HEIGHT*g.fontSize))),a.length>c&&(a=a.slice(0,c),a[a.length- 1]+="..."));if(f&&!d&&null!=l)for(m=0;m<a.length;m++)if(l.measureText(a[m]).width>k){for(r=a[m].length-1;1<r&&l.measureText(a[m].substring(0,r)+"...").width>k;)r--;a[m]=mxUtils.trim(a[m].substring(0,r))+"..."}return a}; mxSvgCanvas2D.prototype.createAlternateContent=function(a,b,c,d,e,f,g,k,l,m,n,p,q){m=this.getAlternateText(a,b,c,d,e,f,g,k,l,m,n,p,q);a=this.state;if(null!=m&&0<a.fontSize){f=k==mxConstants.ALIGN_TOP?1:k==mxConstants.ALIGN_BOTTOM?0:.3;g=g==mxConstants.ALIGN_RIGHT?"end":g==mxConstants.ALIGN_LEFT?"start":"middle";d=this.getAlternateTextLines(m,d,e,l,n,p);e=Math.round(mxConstants.LINE_HEIGHT*a.fontSize);b=Math.round(b+a.dx);c=c+a.dy+f*a.fontSize-(k==mxConstants.ALIGN_TOP?0:k==mxConstants.ALIGN_BOTTOM? (d.length-1)*e:(d.length-1)*e/2);l=this.getLightDarkColor(a.fontColor||"black");k=this.createElement("text");k.setAttribute("x",b);k.setAttribute("y",Math.round(c));"transparent"==l.light?k.setAttribute("fill","none"):(k.setAttribute("fill",l.light),k.style.fill=l.cssText);k.setAttribute("font-family",mxUtils.parseCssFontFamily(a.fontFamily));k.setAttribute("font-size",Math.round(a.fontSize)+"px");"start"!=g&&k.setAttribute("text-anchor",g);(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&& k.setAttribute("font-weight","bold");(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&k.setAttribute("font-style","italic");g=[];(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&g.push("underline");(a.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&g.push("line-through");0<g.length&&(k.setAttribute("text-decoration",g.join(" ")),(a.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(k.style.textDecorationStyle= "dotted"));if(1<d.length)for(a=0;a<d.length;a++)g=this.createElement("tspan"),g.setAttribute("x",b),g.setAttribute("y",Math.round(c+a*e)),mxUtils.write(g,d[a]),k.appendChild(g);else mxUtils.write(k,d[0]);return k}return null}; mxSvgCanvas2D.prototype.createGradientId=function(a,b,c,d,e){a=a.toLowerCase()+"-"+c;b=b.toLowerCase()+"-"+d;c=null;null==e||e==mxConstants.DIRECTION_SOUTH?c="s":e==mxConstants.DIRECTION_EAST?c="e":e==mxConstants.DIRECTION_RADIAL?c="r":(d=a,a=b,b=d,e==mxConstants.DIRECTION_NORTH?c="s":e==mxConstants.DIRECTION_WEST&&(c="e"));return((""!=this.idPrefix?this.idPrefix:"mx")+"-gradient-"+a+"-"+b+"-"+c).replace(/^[^a-z]+|[^\w:.-]+/gi,"_")}; mxSvgCanvas2D.prototype.getSvgGradient=function(a,b,c,d,e){a=this.getLightDarkColor(a);b=this.getLightDarkColor(b);var f=this.createGradientId(a.cssText,b.cssText,c,d,e),g=this.gradients[f];if(null==g){var k=this.root.ownerSVGElement,l=0,m=f+"-"+l;if(null!=k)for(g=k.ownerDocument.getElementById(m);null!=g&&g.ownerSVGElement!=k;)m=f+"-"+l++,g=k.ownerDocument.getElementById(m);else m="id"+ ++this.refCount;null==g&&(g=this.createSvgGradient(a,b,c,d,e),g.setAttribute("id",m),null!=this.defs?this.defs.appendChild(g): k.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,d,e,f,g){a=["mx-pattern",a,Math.round(100*b),c.light,c.dark,Math.round(100*d)];null==e&&null==f&&null==g||a.push(null!=e?Math.round(100*e):"a",null!=f?Math.round(100*f):"a",null!=g?Math.round(100*g):"a");return a.join("-").toLowerCase().replace(/^[^a-z]+|[^\w:.-]+/gi,"_")}; mxSvgCanvas2D.prototype.getFillPattern=function(a,b,c,d,e,f,g){c=this.getLightDarkColor(c);e=parseFloat(e);e=!isFinite(e)||0>=e?null:Math.max(1,e);var k=parseFloat(f);k=!isFinite(k)||0>=k?null:k;g=parseFloat(g);g=isFinite(g)?g:null;if(null!=e||null!=k||null!=g)e=null!=e?e:Math.max(1,4*b),k=null!=k?k:b/2,g=null!=g?g:-41;var l=this.createFillPatternId(a,b,c,d,e,k,g);f=this.fillPatterns[l];if(null==f){var m=this.root.ownerSVGElement,n=0,p=l+"-"+n;if(null!=m)for(f=m.ownerDocument.getElementById(p);null!= f&&f.ownerSVGElement!=m;)p=l+"-"+n++,f=m.ownerDocument.getElementById(p);else p="id"+ ++this.refCount;if(null==f){switch(a){case "hatch":f=this.createHatchPattern(b,c,d,e,k);break;case "dots":f=this.createDotsPattern(b,c,d,e,k);break;case "cross-hatch":f=this.createCrossHatchPattern(b,c,d,e,k);break;case "dashed":f=this.createDashedPattern(b,c,d,e,k);break;case "zigzag":case "zigzag-line":f=this.createZigZagLinePattern(b,c,d,e,k);break;default:return null}f.setAttribute("id",p);null!=this.defs?this.defs.appendChild(f): m.appendChild(f)}this.fillPatterns[l]=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("+(null!=g?90+g:45)+")":"")+" scale("+d+")");return f.getAttribute("id")}; mxSvgCanvas2D.prototype.createHatchPattern=function(a,b,c,d,e){a=null!=e?e:1.5*a;d=this.format(null!=d?d:10+a);e=null!=e?d/2:0;c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",d);c.setAttribute("height",d);c.setAttribute("x","0");c.setAttribute("y","0");var f=this.createElement("line");f.setAttribute("x1",e);f.setAttribute("y1","0");f.setAttribute("x2",e);f.setAttribute("y2",d);f.setAttribute("stroke",b.light);f.style.stroke=b.cssText;f.setAttribute("stroke-width", a);c.appendChild(f);return c}; mxSvgCanvas2D.prototype.createDashedPattern=function(a,b,c,d,e){a=null!=e?e:1.5*a;d=this.format(null!=d?d:10+a);e=null!=e?d/2:0;c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",d);c.setAttribute("height",d);c.setAttribute("x","0");c.setAttribute("y","0");var f=this.createElement("line");f.setAttribute("x1",e);f.setAttribute("y1",d/4);f.setAttribute("x2",e);f.setAttribute("y2",3*d/4);f.setAttribute("stroke",b.light);f.style.stroke=b.cssText;f.setAttribute("stroke-width", a);c.appendChild(f);return c}; mxSvgCanvas2D.prototype.createZigZagLinePattern=function(a,b,c,d,e){a=null!=e?e:1.5*a;d=this.format(null!=d?d:10+a);c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",d);c.setAttribute("height",d);c.setAttribute("x","0");c.setAttribute("y","0");e=this.createElement("path");var f=d/4,g=3*d/4;e.setAttribute("d","M "+f+" 0 L "+g+" 0 L "+f+" "+d+" L "+g+" "+d);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width",a); e.setAttribute("fill","none");c.appendChild(e);return c}; mxSvgCanvas2D.prototype.createCrossHatchPattern=function(a,b,c,d,e){a=null!=e?e:.5*a;d=this.format(null!=d?d:1.5*(10+a));c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",d);c.setAttribute("height",d);c.setAttribute("x","0");c.setAttribute("y","0");e=this.createElement("rect");e.setAttribute("x",0);e.setAttribute("y",0);e.setAttribute("width",d);e.setAttribute("height",d);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;e.setAttribute("stroke-width", a);e.setAttribute("fill","none");c.appendChild(e);return c}; mxSvgCanvas2D.prototype.createDotsPattern=function(a,b,c,d,e){a=this.format(null!=d?d:10+a);e=null!=e?Math.min(e/2,a/2):a/4;c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",a);c.setAttribute("height",a);c.setAttribute("x","0");c.setAttribute("y","0");d=this.createElement("circle");d.setAttribute("cx",a/2);d.setAttribute("cy",a/2);d.setAttribute("r",e);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 String(a.fillColor).toLowerCase()==mxConstants.NONE?c=d="none":(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,a.hachureGap,a.fillWeight,a.hachureAngle);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(" ")}; mxSvgCanvas2D.prototype.createTolerance=function(a){a=a.cloneNode(!0);var b=parseFloat(a.getAttribute("stroke-width")||1)+this.strokeTolerance;a.setAttribute("pointer-events","stroke");a.setAttribute("visibility","hidden");a.removeAttribute("stroke-dasharray");a.setAttribute("stroke-width",b);a.setAttribute("fill","none");a.setAttribute("stroke",mxClient.IS_OT?"none":"white");return a}; mxSvgCanvas2D.prototype.createShadow=function(a){a=a.cloneNode(!0);var b=this.state;"none"==a.getAttribute("fill")||mxClient.IS_FF&&"transparent"==a.getAttribute("fill")||a.setAttribute("fill",b.shadowColor);"none"!=a.getAttribute("stroke")&&a.setAttribute("stroke",b.shadowColor);a.setAttribute("transform","translate("+this.format(b.shadowDx*b.scale)+","+this.format(b.shadowDy*b.scale)+")"+(b.transform||""));a.setAttribute("opacity",b.shadowAlpha);return a}; mxSvgCanvas2D.prototype.setTitle=function(a){this.title=a};mxSvgCanvas2D.prototype.setLink=function(a,b){if(null==a)this.root=this.originalRoot;else{this.originalRoot=this.root;var c=this.createElement("a");null==c.setAttributeNS||this.root.ownerDocument!=document&&null==document.documentMode?c.setAttribute("xlink:href",a):c.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",a);null!=b&&c.setAttribute("target",b);this.root.appendChild(c);this.root=c}}; mxSvgCanvas2D.prototype.rotate=function(a,b,c,d,e){if(0!=a||b||c){var f=this.state;d+=f.dx;e+=f.dy;d*=f.scale;e*=f.scale;f.transform=f.transform||"";if(b&&c)a+=180;else if(b!=c){var g=b?d:0,k=b?-1:1,l=c?e:0,m=c?-1:1;f.transform+="translate("+this.format(g)+","+this.format(l)+")scale("+this.format(k)+","+this.format(m)+")translate("+this.format(-g)+","+this.format(-l)+")"}if(b?!c:c)a*=-1;0!=a&&(f.transform+="rotate("+this.format(a)+","+this.format(d)+","+this.format(e)+")");f.rotation+=a;f.rotationCx= d;f.rotationCy=e}};mxSvgCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments);this.node=this.createElement("path")};mxSvgCanvas2D.prototype.rect=function(a,b,c,d){var e=this.state,f=this.createElement("rect");f.setAttribute("x",this.format((a+e.dx)*e.scale));f.setAttribute("y",this.format((b+e.dy)*e.scale));f.setAttribute("width",this.format(c*e.scale));f.setAttribute("height",this.format(d*e.scale));this.node=f}; mxSvgCanvas2D.prototype.roundrect=function(a,b,c,d,e,f){this.rect(a,b,c,d);0<e&&this.node.setAttribute("rx",this.format(e*this.state.scale));0<f&&this.node.setAttribute("ry",this.format(f*this.state.scale))};mxSvgCanvas2D.prototype.ellipse=function(a,b,c,d){var e=this.state,f=this.createElement("ellipse");f.setAttribute("cx",this.format((a+c/2+e.dx)*e.scale));f.setAttribute("cy",this.format((b+d/2+e.dy)*e.scale));f.setAttribute("rx",c/2*e.scale);f.setAttribute("ry",d/2*e.scale);this.node=f}; mxSvgCanvas2D.prototype.image=function(a,b,c,d,e,f,g,k,l,m){e=this.converter.convert(e);null!=e&&/^\s*(javascript|vbscript|livescript)\s*:/i.test(String(e).replace(/[\x00-\x1F\x7F]/g,""))&&(e="");f=null!=f?f:!0;g=null!=g?g:!1;k=null!=k?k:!1;var n=this.state;a+=n.dx;b+=n.dy;var p=null;if(null!=m){var q=null!=this.createImageSymbol?this.createImageSymbol(e,f):null;if(null!=q||"data:"!=e.substring(0,5))q=null!=q?"#"+q:e,p=this.createElement("use"),""!=m&&p.setAttribute("style",m),p.setAttribute("href", q),null!=p.setAttributeNS&&p.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",q)}null==p&&this.dedupImages&&null!=this.defs?(e="#"+this.getImageDef(e,c*n.scale,d*n.scale,f),p=this.createElement("use"),p.setAttribute("href",e),null!=p.setAttributeNS&&p.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",e)):null==p&&(p=this.createElement("image"),null==p.setAttributeNS?p.setAttribute("xlink:href",e):p.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",e),f||p.setAttribute("preserveAspectRatio","none")); p.setAttribute("x",this.format(a*n.scale)+this.imageOffset);p.setAttribute("y",this.format(b*n.scale)+this.imageOffset);p.setAttribute("width",this.format(c*n.scale));p.setAttribute("height",this.format(d*n.scale));(1>n.alpha||1>n.fillAlpha)&&p.setAttribute("opacity",n.alpha*n.fillAlpha);e=this.state.transform||"";if(g||k){m=f=1;var r=q=0;g&&(f=-1,q=-c-2*a);k&&(m=-1,r=-d-2*b);e+="scale("+f+","+m+")translate("+q*n.scale+","+r*n.scale+")"}0<e.length&&p.setAttribute("transform",e);this.pointerEvents|| p.setAttribute("pointer-events","none");null!=l&&this.processClipPath(p,l,new mxRectangle(a,b,c,d));this.root.appendChild(p)}; mxSvgCanvas2D.prototype.getImageDef=function(a,b,c,d){null==this.imageDefs&&(this.imageDefs={},this.imageDefIds={});var e=a+"|"+d+"|"+(d&&0!=c?(b/c).toFixed(4):""),f=this.imageDefs[e];if(null==f){for(f="mx-image-"+mxUtils.hashCode(e);null!=this.imageDefIds[f];)f+="-1";var g=this.createElement("symbol");g.setAttribute("id",f);g.setAttribute("viewBox","0 0 "+this.format(b)+" "+this.format(c));var k=this.createElement("image");k.setAttribute("width",this.format(b));k.setAttribute("height",this.format(c)); null==k.setAttributeNS?k.setAttribute("xlink:href",a):k.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",a);d||(g.setAttribute("preserveAspectRatio","none"),k.setAttribute("preserveAspectRatio","none"));g.appendChild(k);this.defs.appendChild(g);this.imageDefs[e]=f;this.imageDefIds[f]=e}return f}; mxSvgCanvas2D.prototype.processClipPath=function(a,b,c){try{var d=this.createElement("clipPath");d.setAttribute("id",this.createClipPathId(b));d.setAttribute("clipPathUnits","objectBoundingBox");var e=this.appendClipPath(d,b,c);if(null!=e){var f=this.state;a.setAttribute("x",c.x*f.scale-c.width*f.scale*e.x/e.width+this.imageOffset);a.setAttribute("y",c.y*f.scale-c.height*f.scale*e.y/e.height+this.imageOffset);a.setAttribute("width",c.width*f.scale/e.width);a.setAttribute("height",c.height*f.scale/ e.height)}this.setClip(a,d)}catch(g){}}; mxSvgCanvas2D.prototype.convertHtml=function(a){if(this.useDomParser){var b=(new DOMParser).parseFromString(a,"text/html");null!=b&&(a=(new XMLSerializer).serializeToString(b.body),"<body"==a.substring(0,5)&&(a=a.substring(a.indexOf(">",5)+1)),"</body>"==a.substring(a.length-7,a.length)&&(a=a.substring(0,a.length-7)))}else{if(null!=document.implementation&&null!=document.implementation.createDocument){b=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null);var c=b.createElement("body"); b.documentElement.appendChild(c);var d=document.createElement("div");d.innerHTML=a;for(a=d.firstChild;null!=a;)d=a.nextSibling,c.appendChild(b.adoptNode(a)),a=d;return c.innerHTML}b=document.createElement("textarea");b.innerHTML=a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"<").replace(/>/g,">");a=b.value.replace(/&/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g, "&").replace(/<br>/g,"<br />").replace(/<hr>/g,"<hr />").replace(/(<img[^>]+)>/gm,"$1 />")}return a}; mxSvgCanvas2D.prototype.createDiv=function(a){mxUtils.isNode(a)||(a="<div><div>"+this.convertHtml(a)+"</div></div>");if(document.createElementNS){var b=document.createElementNS("http://www.w3.org/1999/xhtml","div");if(mxUtils.isNode(a)){var c=document.createElement("div"),d=c.cloneNode(!1);this.root.ownerDocument!=document?c.appendChild(a.cloneNode(!0)):c.appendChild(a);d.appendChild(c);b.appendChild(d)}else b.innerHTML=a;return b}mxUtils.isNode(a)&&(a="<div><div>"+mxUtils.getXml(a)+"</div></div>"); return mxUtils.parseXml('<div xmlns="http://www.w3.org/1999/xhtml">'+a+"</div>").documentElement}; mxSvgCanvas2D.prototype.updateText=function(a,b,c,d,e,f,g,k,l,m,n,p){if(null!=p&&null!=p.firstChild)if(null!=p.firstChild.firstChild&&"foreignObject"==p.firstChild.firstChild.nodeName)this.updateTextNodes(a,b,c,d,e,f,g,k,l,m,n,p.firstChild);else if("g"==p.nodeName){p=p.firstChild;var q=p.getAttribute("data-blockTextHeight");if(null!=q){var r=p.getAttribute("data-htmlContentWidth");r=null!=r?parseFloat(r):null;this.plainText(a,b,c,d,"",e,f,g,k,l,m,n,null,p,parseFloat(q),null==r||isNaN(r)?null:r)}else this.plainText(a, b,c,d,"",e,f,g,k,l,m,n,null,p)}}; mxSvgCanvas2D.prototype.addForeignObject=function(a,b,c,d,e,f,g,k,l,m,n,p,q,r,t){var u=this.addTitle(this.createElement("g")),v=this.createElement("foreignObject");this.setCssText(v,"overflow: visible; text-align: left;");v.setAttribute("pointer-events","none");r.ownerDocument!=document&&(r=mxUtils.importNodeImplementation(v.ownerDocument,r,!0));v.appendChild(r);u.appendChild(v);this.updateTextNodes(a,b,c,d,f,g,k,m,n,p,q,u);this.root.ownerDocument!=document&&(a=this.createAlternateContent(v,a,b,c, d,e,f,g,k,l,m,n,p),null!=a&&(v.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility"),b=this.createElement("switch"),b.appendChild(v),b.appendChild(a),u.appendChild(b)));t.appendChild(u)}; mxSvgCanvas2D.prototype.updateTextNodes=function(a,b,c,d,e,f,g,k,l,m,n,p){var q=this.state.scale,r="",t="";null!=n&&"vertical-"==n.substring(0,9)?(r="-rl"==n.substring(n.length-3),t=e==mxConstants.ALIGN_LEFT?r?"flex-end":"flex-start":e==mxConstants.ALIGN_RIGHT?r?"flex-start":"flex-end":"center",r=f==mxConstants.ALIGN_TOP?"flex-start":f==mxConstants.ALIGN_BOTTOM?"flex-end":"center"):(t=f==mxConstants.ALIGN_TOP?"flex-start":f==mxConstants.ALIGN_BOTTOM?"flex-end":"center",r=e==mxConstants.ALIGN_LEFT? "flex-start":e==mxConstants.ALIGN_RIGHT?"flex-end":"center");var u=null!=this.state.fontBackgroundColor?this.getLightDarkColor(this.state.fontBackgroundColor):null,v=null!=this.state.fontBorderColor?this.getLightDarkColor(this.state.fontBorderColor):null;mxSvgCanvas2D.createCss(c+this.foreignObjectPadding,d,e,f,g,k,l,n,null!=u?u.cssText:null,null!=v?v.cssText:null,null!=u||null!=v?this.state.labelPadding:null,"display: flex; align-items: unsafe "+t+"; justify-content: unsafe "+r+"; "+(null!=n&&"vertical-"== n.substring(0,9)?"writing-mode: "+n+";":""),this.getTextCss(),q,mxUtils.bind(this,function(y,A,z,x,C){a+=this.state.dx;b+=this.state.dy;var D=p.firstChild;"title"==D.nodeName&&(D=D.nextSibling);x+="color: "+this.getLightDarkColor(this.state.fontColor).light+"; ";x+=null!=u?"background-color: "+u.light+"; ":"";x+=null!=v?"border-color: "+v.light+"; ":"";var B=D.firstChild,E=B.firstChild,K=(this.rotateHtml?this.state.rotation:0)+(null!=m?m:0),G=(0!=this.foOffset?"translate("+this.foOffset+" "+this.foOffset+ ")":"")+(1!=q?"scale("+q+")":"");this.setCssText(E.firstChild,C);this.setCssText(E,x);D.setAttribute("width",Math.ceil(1/Math.min(1,q)*100)+"%");D.setAttribute("height",Math.ceil(1/Math.min(1,q)*100)+"%");A=Math.round(b+A);0>A?(D.setAttribute("y",A),z+="padding-top: 0; "):(D.removeAttribute("y"),z+="padding-top: "+A+"px; ");this.setCssText(B,z+"margin-left: "+Math.round(a+y)+"px;");G+=0!=K?"rotate("+K+" "+a+" "+b+")":"";""!=G?p.setAttribute("transform",G):p.removeAttribute("transform");1!=this.state.alpha? p.setAttribute("opacity",this.state.alpha):p.removeAttribute("opacity")}))}; mxSvgCanvas2D.createCss=function(a,b,c,d,e,f,g,k,l,m,n,p,q,r,t){k=null!=k&&"vertical-"==k.substring(0,9);r="box-sizing: border-box; font-size: 0; ";r=k?r+("text-align: "+(d==mxConstants.ALIGN_TOP?"left":d==mxConstants.ALIGN_BOTTOM?"right":"center")+"; "):r+("text-align: "+(c==mxConstants.ALIGN_LEFT?"left":c==mxConstants.ALIGN_RIGHT?"right":"center")+"; ");var u=mxUtils.getAlignmentAsPoint(c,d);c="overflow: hidden; ";var v="width: 1px; ",y="height: 1px; ",A=u.x*a;u=u.y*b;g?(v="width: "+Math.round(a)+ "px; ",r+="max-height: "+Math.round(b)+"px; ",u=0):"fill"==f?(v="width: "+Math.round(a)+"px; ",y="height: "+Math.round(b)+"px; ",q+="width: 100%; height: 100%; ",r+="width: "+Math.round(a-2)+"px; "+y):"width"==f?(v="width: "+Math.round(a-2)+"px; ",q+="width: 100%; ",r+=v,u=0,0<b&&(r+="max-height: "+Math.round(b)+"px; ")):"block"==f?(v="width: "+Math.round(a-2)+"px; ",q+="width: 100%; ",c="",u=0,r+=v,"middle"==d&&(r+="max-height: "+Math.round(b)+"px; ")):(c="",k?A=0:u=0);d="";null!=l&&(d+="background-color: "+ l+"; ");null!=m&&(d+="border-width: 1px; border-style: solid; border-color: inherit; border: 1px solid "+m+"; ");""!=d&&null!=n&&(d+="padding: "+n.top+"px "+n.right+"px "+n.bottom+"px "+n.left+"px; ",""==c||g)&&(d+="margin: "+-n.top+"px "+-n.right+"px "+-n.bottom+"px "+-n.left+"px; ");""==c||g?q+=d:r+=d;e&&(k&&0<b||!k&&0<a)?(q+="white-space: normal; word-wrap: "+mxConstants.WORD_WRAP+"; ",k?y="height: "+Math.round(b)+"px; ":v="width: "+Math.round(a)+"px; ",""!=c&&"fill"!=f&&(k?A=0:u=0)):(q+="white-space: nowrap; ", ""==c&&"block"!=f&&(A=0));t(A,u,p+v+y,r+c,q,c)}; mxSvgCanvas2D.prototype.getTextCss=function(){var a=this.state,b=mxConstants.ABSOLUTE_LINE_HEIGHT?a.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*this.lineHeightCorrection;b="display: inline-block; font-size: "+mxUtils.htmlEntities(a.fontSize)+"px; font-family: "+mxUtils.parseCssFontFamily(a.fontFamily,!0)+"; color: "+this.getLightDarkColor(mxUtils.htmlEntities(a.fontColor)).cssText+"; line-height: "+mxUtils.htmlEntities(b)+"; pointer-events: "+(this.pointerEvents?mxUtils.htmlEntities(this.pointerEventsValue): "none")+"; ";(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(b+="font-weight: bold; ");(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(b+="font-style: italic; ");var c=[];(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&c.push("underline");(a.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&c.push("line-through");0<c.length&&((a.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&c.push("dotted"), b+="text-decoration: "+c.join(" ")+"; ");return b};mxSvgCanvas2D.prototype.convertHtmlToSvg=function(a,b,c,d,e){return mxUtils.convertHtmlToSvg(a,b,c,{dir:e,fontScale:d,fontSize:this.state.fontSize,createElement:mxUtils.bind(this,this.createElement)})}; mxSvgCanvas2D.prototype.wrapSvgTextElement=function(a,b){function c(H,F){for(var J=0;J<H.childNodes.length;J++){var I=H.childNodes[J];if(I.nodeType==mxConstants.NODETYPE_TEXT)0<I.nodeValue.length&&n.push({text:I.nodeValue,attrs:d(F.attrs),css:d(F.css),absoluteDy:p});else if(I.nodeType==mxConstants.NODETYPE_ELEMENT){for(var M={attrs:d(F.attrs),css:d(F.css)},O=["font-weight","font-style","fill","text-decoration"],N=0;N<O.length;N++){var P=I.getAttribute(O[N]);null!=P&&(M.attrs[O[N]]=P)}if(null!=I.style){if(""!= I.style.cssText)for(O=I.style.cssText.split(";"),N=0;N<O.length;N++)if(P=O[N].split(":"),2==P.length){var R=P[0].trim();P=P[1].trim();0<R.length&&0<P.length&&(M.css[R]=P)}I.style.fill&&(M.css.fill=I.style.fill)}P=I.getAttribute("dy");null!=P&&(p+=parseFloat(P));c(I,M)}}}function d(H){var F={},J;for(J in H)H.hasOwnProperty(J)&&(F[J]=H[J]);return F}function e(H){var F=k;H=n[H].css["font-size"];null!=H&&("smaller"==H?F=k/1.2:0<=H.indexOf("em")?F=parseFloat(H)*k:0<=H.indexOf("px")&&(F=parseFloat(H))); return F}function f(H){var F=n[H.segIdx],J=F.attrs["font-weight"]||"",I=F.attrs["font-style"]||"",M=l,O=k;F.css["font-weight"]&&(J=F.css["font-weight"]);F.css["font-style"]&&(I=F.css["font-style"]);F.css["font-family"]&&(M=F.css["font-family"]);F.css["font-size"]&&(F=F.css["font-size"],"smaller"==F?O=k/1.2:0<=F.indexOf("em")?O=parseFloat(F)*k:0<=F.indexOf("px")&&(O=parseFloat(F)));J||(m&mxConstants.FONT_BOLD)!=mxConstants.FONT_BOLD||(J="bold");I||(m&mxConstants.FONT_ITALIC)!=mxConstants.FONT_ITALIC|| (I="italic");u.font=I+" "+J+" "+O+"px "+M;return u.measureText(H.text).width}var g=this.state,k=g.fontSize,l=g.fontFamily,m=g.fontStyle,n=[],p=0;c(a,{attrs:{},css:{}});if(0==n.length)return null;for(var q=[],r=0;r<n.length;r++){a=n[r].text.split(/(\s+)/);for(var t=0;t<a.length;t++)0<a[t].length&&q.push({text:a[t],segIdx:r,isSpace:/^\s+$/.test(a[t])})}var u=document.createElement("canvas").getContext("2d"),v=this.textFlow;g=null;a=[[]];var y=0;if(null!=v){var A=k*mxConstants.LINE_HEIGHT;a=function(H){var F= {lines:[[]],extras:[],height:0},J=H,I=v.available(J,J+A);F.extras.push({x:I.x,width:I.width,shift:0});for(var M=0,O=0;O<q.length;O++){var N=q[O];null==N.width&&(N.width=f(N));if(N.isSpace)0<M&&(F.lines[F.lines.length-1].push(N),M+=N.width);else{var P=0<O&&q[O-1].isSpace;M+N.width>I.width&&0<M&&P&&(I=F.lines[F.lines.length-1],0<I.length&&I[I.length-1].isSpace&&I.pop(),J+=A,F.lines.push([]),I=v.available(J,J+A),F.extras.push({x:I.x,width:I.width,shift:0}),M=0);for(P=0;0==M&&N.width>I.width&&J-H<v.boxHeight&& 400>P++;){J+=A;var R=F.extras[F.extras.length-1];R.shift+=A;I=v.available(J,J+A);R.x=I.x;R.width=I.width}F.lines[F.lines.length-1].push(N);M+=N.width}}F.height=J+A-H;return F};g=a(0);for(b=r=0;3>b;b++){var z=0;if(v.valign==mxConstants.ALIGN_MIDDLE)z=(v.boxHeight-g.height)/2;else if(v.valign==mxConstants.ALIGN_BOTTOM)z=v.boxHeight-g.height;else break;if(1>Math.abs(z-r))break;r=z;g=a(r)}a=g.lines;g=g.extras}else for(r=0;r<q.length;r++){z=q[r];var x=f(z);z.width=x;if(z.isSpace)0<y&&(a[a.length-1].push(z), y+=x);else{var C=0<r&&q[r-1].isSpace;y+x>b&&0<y&&C&&(y=a[a.length-1],0<y.length&&y[y.length-1].isSpace&&y.pop(),a.push([]),y=0);a[a.length-1].push(z);y+=x}}for(r=b=0;r<a.length;r++){z=a[r];for(x=z.length;0<x&&z[x-1].isSpace;)x--;for(C=y=0;C<x;C++)y+=z[C].width;y>b&&(b=y)}if(null==v&&1>=a.length)return{elements:null,totalHeight:0,maxLineWidth:b};z=[];for(r=x=0;r<a.length;r++)if(y=a[r],0!=y.length){C=k;for(t=0;t<y.length;t++)y[t].isSpace||(C=Math.max(C,e(y[t].segIdx)));null!=g&&null!=g[r]&&(x+=g[r].shift); x+=C;var D=this.createElement("text");D.setAttribute("y",this.format(x));if(null!=g&&null!=g[r]){var B=g[r];D.setAttribute("x",this.format(v.align==mxConstants.ALIGN_LEFT?B.x:v.align==mxConstants.ALIGN_RIGHT?B.x+B.width-v.boxWidth:B.x+B.width/2-v.boxWidth/2))}for(var E=t=0;t<y.length;){B=y[t].segIdx;for(var K="";t<y.length&&y[t].segIdx==B;)K+=y[t].text,t++;t==y.length&&(K=K.replace(/\s+$/,""));if(0<K.length){B=n[B];var G=this.createElement("tspan"),L;for(L in B.attrs)B.attrs.hasOwnProperty(L)&&G.setAttribute(L, B.attrs[L]);var Q="";for(L in B.css)B.css.hasOwnProperty(L)&&"color"!=L&&"fill"!=L&&(Q+=L+": "+B.css[L]+"; ");0<Q.length&&(G.style.cssText=Q);B.css.fill&&(G.style.fill=B.css.fill);B=B.absoluteDy;B!=E&&(G.setAttribute("dy",Math.round(100*(B-E))/100),E=B);G.textContent=K;D.appendChild(G)}}z.push(D);D=C*(mxConstants.LINE_HEIGHT-1);K=E=0;Q=G=null;for(t=0;t<y.length;t++)y[t].isSpace||(B=n[y[t].segIdx],B=B.absoluteDy,B<E&&(E=B,G=e(y[t].segIdx)),B>K&&(K=B,Q=e(y[t].segIdx)));0>E&&(D+=mxUtils.getSupSubLineExpansion(C, E,null,G,null));0<K&&(D+=mxUtils.getSupSubLineExpansion(C,null,K,null,Q));x+=D}return{elements:z,totalHeight:x,maxLineWidth:b}}; mxSvgCanvas2D.prototype.wrapSvgBlockElements=function(a,b,c){for(var d=this.state.fontSize,e=[],f=0;f<a.childNodes.length;f++)"text"==a.childNodes[f].nodeName&&e.push(a.childNodes[f]);var g=0,k=0;for(f=0;f<e.length;f++){var l=e[f],m=parseFloat(l.getAttribute("font-size"))||d,n=this.wrapSvgTextElement(l,b);null!=n&&n.maxLineWidth>k&&(k=n.maxLineWidth);if(null!=n&&null!=n.elements){var p=parseFloat(l.getAttribute("y"))||0;p+=g;var q=parseFloat(n.elements[0].getAttribute("y"))||0;m=parseFloat(l.getAttribute("data-line-font-size"))|| m;p-=m-q;for(var r=0;r<n.elements.length;r++){var t=n.elements[r],u=parseFloat(t.getAttribute("y"))||0;t.setAttribute("y",this.format(p+(u-q)));l.getAttribute("font-size")&&t.setAttribute("font-size",l.getAttribute("font-size"));l.getAttribute("font-weight")&&t.setAttribute("font-weight",l.getAttribute("font-weight"));l.getAttribute("font-family")&&t.setAttribute("font-family",l.getAttribute("font-family"));l.getAttribute("fill")&&(t.setAttribute("fill",l.getAttribute("fill")),t.style.fill=l.style.fill); a.insertBefore(t,l)}a.removeChild(l);g+=n.totalHeight-m*mxConstants.LINE_HEIGHT}else 0!=g&&(p=parseFloat(l.getAttribute("y"))||0,l.setAttribute("y",this.format(p+g)))}0!=g&&(c.textHeight+=g);c.maxLineWidth=k}; mxSvgCanvas2D.prototype.text=function(a,b,c,d,e,f,g,k,l,m,n,p,q){if(this.textEnabled&&null!=e)if(p=null!=p?p:0,this.foEnabled&&"html"==l){var r=this.createDiv(e);if(null!=r){var t=this.createElement("text"),u=new mxPoint(0,0);if(this.allowConvertHtmlToSvg&&this.convertHtmlToSvg(r.firstChild.firstChild,t,u,null,q))if(null!=u.textHeight){for(e=this.createElement("g");t.firstChild;)e.appendChild(t.firstChild);k&&0<c&&this.wrapSvgBlockElements(e,c+this.foreignObjectPadding,u);t=null;k?t=null!=u.maxLineWidth? u.maxLineWidth:null:!n||f!=mxConstants.ALIGN_CENTER&&f!=mxConstants.ALIGN_RIGHT||(t=this.measureHtmlContentWidth(r.firstChild.firstChild));this.plainText(a+this.state.dx,b+this.state.dy,c,d,"",f,g,k,m,n,p,q,e,null,u.textHeight,t)}else if(k&&0<c&&(r=this.wrapSvgTextElement(t,c+this.foreignObjectPadding),null!=r&&null!=r.elements)){e=this.createElement("g");for(u=0;u<r.elements.length;u++)e.appendChild(r.elements[u]);this.plainText(a+this.state.dx,b+this.state.dy,c,d,"",f,g,k,m,n,p,q,e,null,r.totalHeight, r.maxLineWidth)}else 0>u.y&&g==mxConstants.ALIGN_TOP?t.style.transform="translateY("+-u.y+"em)":0<u.y&&g==mxConstants.ALIGN_BOTTOM?t.style.transform="translateY("+-u.y+"em)":0<u.y&&g==mxConstants.ALIGN_TOP&&(t.style.transform="translateY("+u.y+"em)"),this.plainText(a+this.state.dx,b+this.state.dy,c,d,"",f,g,k,m,n,p,q,t);else null!=q&&"vertical-"!=q.substring(0,9)&&r.setAttribute("dir",q),this.addForeignObject(a,b,c,d,e,f,g,k,l,m,n,p,q,r,this.root)}}else this.plainText(a+this.state.dx,b+this.state.dy, c,d,e,f,g,k,m,n,p,q)};mxSvgCanvas2D.prototype.createClip=function(a,b,c,d){a=Math.round(a);b=Math.round(b);c=Math.round(c);d=Math.round(d);for(var e="mx-clip-"+a+"-"+b+"-"+c+"-"+d,f=0,g=e+"-"+f;null!=document.getElementById(g);)g=e+"-"+ ++f;e=this.createElement("clipPath");e.setAttribute("id",g);g=this.createElement("rect");g.setAttribute("x",a);g.setAttribute("y",b);g.setAttribute("width",c);g.setAttribute("height",d);e.appendChild(g);return e}; mxSvgCanvas2D.prototype.createClipPathId=function(a){a="mx-clippath-"+a.replace(/[^a-zA-Z0-9]+/g,"-");for(var b="-"==a.charAt(a.length-1)?"":"-",c=0,d=a+b+c;null!=document.getElementById(d);)d=a+b+ ++c;return d}; mxSvgCanvas2D.prototype.appendClipPath=function(a,b,c){var d=b.match(/\(([^)]+)\)/),e=null;"polygon"==b.substring(0,7)?e=this.appendPolygonClip(d[1],a,c):"circle"==b.substring(0,6)?e=this.appendCircleClip(d[1],a,c):"ellipse"==b.substring(0,7)?e=this.appendEllipseClip(d[1],a,c):"inset"==b.substring(0,5)&&(e=this.appendInsetClip(d[1],a,c));return e}; mxSvgCanvas2D.prototype.appendPolygonClip=function(a,b,c){c=this.createElement("polygon");a=a.split(/[ ,]+/);for(var d=null,e=null,f=null,g=null,k=[],l=0;l<a.length;l++){var m=this.parseClipValue(a,l);if(0==l%2){if(null==d||d>m)d=m;if(null==f||f<m)f=m}else{if(null==e||e>m)e=m;if(null==g||g<m)g=m}k.push(m)}c.setAttribute("points",k.join(","));b.appendChild(c);return new mxRectangle(d,e,f-d,g-e)}; mxSvgCanvas2D.prototype.appendCircleClip=function(a,b,c){c=this.createElement("circle");var d=a.split(/[ ,]+/);a=this.parseClipValue(d,0);var e=this.parseClipValue(d,2);d=this.parseClipValue(d,3);c.setAttribute("r",a);c.setAttribute("cx",e);c.setAttribute("cy",d);b.appendChild(c);return new mxRectangle(e-a,d-a,2*a,2*a)}; mxSvgCanvas2D.prototype.appendEllipseClip=function(a,b,c){c=this.createElement("ellipse");var d=a.split(/[ ,]+/);a=this.parseClipValue(d,0);var e=this.parseClipValue(d,1),f=this.parseClipValue(d,3);d=this.parseClipValue(d,4);c.setAttribute("rx",a);c.setAttribute("ry",e);c.setAttribute("cx",f);c.setAttribute("cy",d);b.appendChild(c);return new mxRectangle(f-a,d-e,2*a,2*e)}; mxSvgCanvas2D.prototype.appendInsetClip=function(a,b,c){c=this.createElement("rect");var d=a.split(/[ ,]+/);a=this.parseClipValue(d,0);var e=this.parseClipValue(d,1),f=this.parseClipValue(d,2),g=this.parseClipValue(d,3);e=1-e-g;f=1-a-f;c.setAttribute("x",g);c.setAttribute("y",a);c.setAttribute("width",e);c.setAttribute("height",f);4<d.length&&"round"==d[4]&&(d=this.parseClipValue(d,5),c.setAttribute("rx",d),c.setAttribute("ry",d));b.appendChild(c);return new mxRectangle(g,a,e,f)}; mxSvgCanvas2D.prototype.parseClipValue=function(a,b){b=a[Math.min(b,a.length-1)];a=1;"center"==b?a=.5:"top"==b||"left"==b?a=0:(b=parseFloat(b),isNaN(b)||(a=Math.max(0,Math.min(1,b/100))));return a}; mxSvgCanvas2D.prototype.setClip=function(a,b){if(null!=a.getAttribute("clip-path")){var c=a.getAttribute("clip-path").replace(/url\(.*#/,"").replace(/\)$/,"");c=document.getElementById(c);null!=c&&null!=c.parentNode&&c.parentNode.removeChild(c)}null!=this.defs?this.defs.appendChild(b):this.root.appendChild(b);mxClient.IS_CHROMEAPP||this.root.ownerDocument!=document?a.setAttribute("clip-path","url(#"+b.getAttribute("id")+")"):(c=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),a.setAttribute("clip-path", "url("+c+"#"+b.getAttribute("id")+")"))}; mxSvgCanvas2D.prototype.plainText=function(a,b,c,d,e,f,g,k,l,m,n,p,q,r,t,u){n=null!=n?n:0;k=this.state;var v=k.fontSize,y=k.transform||"";r=null!=r?r:this.addTitle(this.createElement("g"));this.updateFont(r);this.pointerEvents||null!=this.originalRoot?r.removeAttribute("pointer-events"):r.setAttribute("pointer-events","none");0!=n&&(y+="rotate("+n+","+this.format(a*k.scale)+","+this.format(b*k.scale)+")");null!=p&&"vertical-"!=p.substring(0,9)&&r.setAttribute("direction",p);p=f==mxConstants.ALIGN_RIGHT? "end":f==mxConstants.ALIGN_CENTER?"middle":"start";r.setAttribute("text-anchor",p);0<y.length&&r.setAttribute("transform",y);1>k.alpha&&r.setAttribute("opacity",k.alpha);y=e.split("\n");var A=Math.round(v*mxConstants.LINE_HEIGHT),z=null!=t?t:v+(y.length-1)*A;n=null!=t?b:b+v-1;if(g==mxConstants.ALIGN_MIDDLE)if("fill"==l)n-=d/2;else{var x=(this.matchHtmlAlignment&&m&&0<d?Math.min(z,d):z)/2;n-=x}else g==mxConstants.ALIGN_BOTTOM&&("fill"==l?n-=d:(x=this.matchHtmlAlignment&&m&&0<d?Math.min(z,d):z,n-=x+ 1));if(null!=q)if(null!=t){e=this.format(a*k.scale)+this.textOffset;y=this.format(n*k.scale)+this.textOffset;q.setAttribute("transform","translate("+e+","+y+") scale("+k.scale+")");r.setAttribute("data-blockTextHeight",t);null!=u&&r.setAttribute("data-htmlContentWidth",u);e=q.childNodes;for(t=0;t<e.length;t++)"text"==e[t].nodeName&&(y=parseFloat(e[t].getAttribute("dx"))||0,e[t].setAttribute("x","start"==p?y:"end"==p?-y:0),e[t].removeAttribute("dx"));r.appendChild(q);this.root.appendChild(r);r.setAttribute("font-size", v+"px");!m||"middle"!=p&&"end"!=p||this.adjustBlockTextOverflow(q,a,n,c,k.scale,u,f)}else u=this.createElement("g"),e=this.format(a*k.scale)+this.textOffset,y=this.format(n*k.scale)+this.textOffset,u.setAttribute("transform","translate("+e+","+y+") scale("+k.scale+")"),u.appendChild(q),r.appendChild(u),this.root.appendChild(r),r.setAttribute("font-size",v+"px");else if(null!=r.parentNode)null!=t?(q=r.firstChild,null!=q&&"title"==q.nodeName&&(q=q.nextSibling),null!=q&&"g"==q.nodeName&&(e=this.format(a* k.scale)+this.textOffset,y=this.format(n*k.scale)+this.textOffset,q.setAttribute("transform","translate("+e+","+y+") scale("+k.scale+")"),!m||f!=mxConstants.ALIGN_CENTER&&f!=mxConstants.ALIGN_RIGHT||(u=parseFloat(r.getAttribute("data-htmlContentWidth")),this.adjustBlockTextOverflow(q,a,n,c,k.scale,isNaN(u)?null:u,f)))):(q=r.firstChild,null!=q&&"title"==q.nodeName&&(q=q.nextSibling),e=this.format(a*k.scale)+this.textOffset,y=this.format(n*k.scale)+this.textOffset,q.setAttribute("transform","translate("+ e+","+y+") scale("+k.scale+")")),r.setAttribute("font-size",v+"px");else{this.styleEnabled&&v==mxConstants.DEFAULT_FONTSIZE||r.setAttribute("font-size",v*k.scale+"px");for(t=0;t<y.length;t++)0<y[t].length&&0<mxUtils.trim(y[t]).length&&(v=this.createElement("text"),v.setAttribute("x",this.format(a*k.scale)+this.textOffset),v.setAttribute("y",this.format(n*k.scale)+this.textOffset),mxUtils.write(v,y[t]),r.appendChild(v)),n+=A;this.root.appendChild(r);this.addTextBackground(r,e,a,b,c,"fill"==l?d:z,f, g,l)}m&&0<c&&0<d&&(n=b,f==mxConstants.ALIGN_CENTER?a-=c/2:f==mxConstants.ALIGN_RIGHT&&(a-=c),"fill"!=l&&(g==mxConstants.ALIGN_MIDDLE?n-=d/2:g==mxConstants.ALIGN_BOTTOM&&(n-=d)),this.setClip(r,this.createClip(a*k.scale-2,n*k.scale-2,c*k.scale+4,d*k.scale+4)))}; mxSvgCanvas2D.prototype.measureHtmlContentWidth=function(a){try{var b=this.state,c=document.createElement("div");c.style.cssText="position:absolute;visibility:hidden;display:inline-block;white-space:nowrap;font-size:"+b.fontSize+"px;font-family:"+mxUtils.parseCssFontFamily(b.fontFamily,!0)+";line-height:"+b.fontSize*mxConstants.LINE_HEIGHT+"px;";(b.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(c.style.fontWeight="bold");(b.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(c.style.fontStyle= "italic");for(b=0;b<a.childNodes.length;b++)c.appendChild(a.childNodes[b].cloneNode(!0));document.body.appendChild(c);var d=c.offsetWidth;document.body.removeChild(c);return d}catch(e){return null}};mxSvgCanvas2D.prototype.adjustBlockTextOverflow=function(a,b,c,d,e,f,g){try{if(null==f&&(f=a.getBBox().width),f>d){var k=this.format((b+(g==mxConstants.ALIGN_CENTER?(f-d)/2:f-d))*e)+this.textOffset,l=this.format(c*e)+this.textOffset;a.setAttribute("transform","translate("+k+","+l+") scale("+e+")")}}catch(m){}}; mxSvgCanvas2D.prototype.updateFont=function(a){var b=this.state,c=this.getLightDarkColor(b.fontColor);a.setAttribute("fill",c.light);a.style.fill=c.cssText;this.styleEnabled&&b.fontFamily==mxConstants.DEFAULT_FONTFAMILY||a.setAttribute("font-family",mxUtils.parseCssFontFamily(b.fontFamily));(b.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&a.setAttribute("font-weight","bold");(b.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&a.setAttribute("font-style","italic");c=[];(b.fontStyle& mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&c.push("underline");(b.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&c.push("line-through");0<c.length&&(a.setAttribute("text-decoration",c.join(" ")),(b.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(a.style.textDecorationStyle="dotted"))}; mxSvgCanvas2D.prototype.addTextBackground=function(a,b,c,d,e,f,g,k,l){var m=this.state;if(null!=document.body&&(null!=m.fontBackgroundColor||null!=m.fontBorderColor)){var n=null;if("fill"==l||"width"==l)g==mxConstants.ALIGN_CENTER?c-=e/2:g==mxConstants.ALIGN_RIGHT&&(c-=e),k==mxConstants.ALIGN_MIDDLE?d-=f/2:k==mxConstants.ALIGN_BOTTOM&&(d-=f),n=new mxRectangle((c+1)*m.scale,d*m.scale,(e-2)*m.scale,(f+2)*m.scale);else if(null!=a.getBBox&&this.root.ownerDocument==document)try{n=a.getBBox(),n=new mxRectangle(n.x, n.y+1,n.width,n.height)}catch(p){}if(null==n||0==n.width||0==n.height)n=mxUtils.getSizeForString(mxUtils.htmlEntities(b,!1).replace(/\n/g,"<br/>"),m.fontSize,m.fontFamily,null,m.fontStyle),e=n.width,f=n.height,g==mxConstants.ALIGN_CENTER?c-=e/2:g==mxConstants.ALIGN_RIGHT&&(c-=e),k==mxConstants.ALIGN_MIDDLE?d-=f/2:k==mxConstants.ALIGN_BOTTOM&&(d-=f),n=new mxRectangle((c+1)*m.scale,(d+2)*m.scale,e*m.scale,(f+1)*m.scale);null!=n&&null!=m.labelPadding&&"fill"!=l&&"width"!=l&&(n.x-=m.labelPadding.left* m.scale,n.y-=m.labelPadding.top*m.scale,n.width+=(m.labelPadding.left+m.labelPadding.right)*m.scale,n.height+=(m.labelPadding.top+m.labelPadding.bottom)*m.scale);null!=n&&(c=this.createElement("rect"),d=null!=m.fontBackgroundColor&&m.fontBackgroundColor!=mxConstants.NONE?this.getLightDarkColor(m.fontBackgroundColor):null,e=null!=m.fontBorderColor&&m.fontBorderColor!=mxConstants.NONE?this.getLightDarkColor(m.fontBorderColor):null,c.setAttribute("fill",null!=d?d.light:"none"),c.setAttribute("stroke", null!=e?e.light:"none"),c.setAttribute("x",Math.floor(n.x-1)),c.setAttribute("y",Math.floor(n.y-1)),c.setAttribute("width",Math.ceil(n.width+2)),c.setAttribute("height",Math.ceil(n.height)),null!=d&&(c.style.fill=d.cssText),e&&(c.style.stroke=e.cssText),m=null!=m.fontBorderColor?Math.max(1,this.format(m.scale)):0,c.setAttribute("stroke-width",m),this.root.ownerDocument==document&&1==mxUtils.mod(m,2)&&c.setAttribute("transform","translate(0.5, 0.5)"),a.insertBefore(c,a.firstChild))}}; mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)};mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)};mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)};function mxGuide(a,b){this.graph=a;this.setStates(b)}mxGuide.prototype.graph=null;mxGuide.prototype.states=null;mxGuide.prototype.horizontal=!0;mxGuide.prototype.vertical=!0;mxGuide.prototype.positionEnabled=!0;mxGuide.prototype.distanceEnabled=!0;mxGuide.prototype.guideX=null;mxGuide.prototype.guideY=null; mxGuide.prototype.distanceGuidesX=null;mxGuide.prototype.distanceGuidesY=null;mxGuide.prototype.rounded=!1;mxGuide.prototype.tolerance=2;mxGuide.prototype.setStates=function(a){this.states=a};mxGuide.prototype.isEnabledForEvent=function(a){return!0};mxGuide.prototype.getGuideTolerance=function(a){return a&&this.graph.gridEnabled?this.graph.gridSize/2:this.tolerance}; mxGuide.prototype.createGuideShape=function(a){a=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH);a.isDashed=!0;return a};mxGuide.prototype.createDistanceGuideShape=function(a){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxGuide.prototype.isStateIgnored=function(a){return!1}; mxGuide.prototype.move=function(a,b,c,d){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=a&&null!=b){d=function(B,E,K){var G=!1;K&&Math.abs(B-D)<v?(b.y=B-a.getCenterY(),v=Math.abs(B-D),G=!0):K||(Math.abs(B-x)<v?(b.y=B-a.y,v=Math.abs(B-x),G=!0):Math.abs(B-C)<v&&(b.y=B-a.y-a.height,v=Math.abs(B-C),G=!0));G&&(r=E,t=B,null==this.guideY&&(this.guideY=this.createGuideShape(!1),this.guideY.dialect=mxConstants.DIALECT_SVG,this.guideY.pointerEvents=!1,this.guideY.init(this.graph.getView().getOverlayPane()))); q=q||G};var e=function(B,E,K){var G=!1;K&&Math.abs(B-z)<u?(b.x=B-a.getCenterX(),u=Math.abs(B-z),G=!0):K||(Math.abs(B-y)<u?(b.x=B-a.x,u=Math.abs(B-y),G=!0):Math.abs(B-A)<u&&(b.x=B-a.x-a.width,u=Math.abs(B-A),G=!0));G&&(n=E,p=B,null==this.guideX&&(this.guideX=this.createGuideShape(!0),this.guideX.dialect=mxConstants.DIALECT_SVG,this.guideX.pointerEvents=!1,this.guideX.init(this.graph.getView().getOverlayPane())));m=m||G},f=this.graph.getView().scale,g=Math.max(2,this.getGuideTolerance(c)*f),k=this.distanceEnabled? this.moveDistance(a,b,Math.max(2,g/2)):null;f=null!=k?k.x:null;k=null!=k?k.y:null;null!=f&&(b.x=f);null!=k&&(b.y=k);var l=a.clone();l.x+=b.x;l.y+=b.y;var m=!1,n=null,p=null,q=!1,r=null,t=null,u=g,v=g,y=l.x,A=l.x+l.width,z=l.getCenterX(),x=l.y,C=l.y+l.height,D=l.getCenterY();if(this.positionEnabled)for(g=0;g<this.states.length;g++)l=this.states[g],null==l||this.isStateIgnored(l)||(this.horizontal&&(e.call(this,l.getCenterX(),l,!0),e.call(this,l.x,l,!1),e.call(this,l.x+l.width,l,!1),null==l.cell&&e.call(this, l.getCenterX(),l,!1)),this.vertical&&(d.call(this,l.getCenterY(),l,!0),d.call(this,l.y,l,!1),d.call(this,l.y+l.height,l,!1),null==l.cell&&d.call(this,l.getCenterY(),l,!1)));null!=f&&b.x!=f&&(b.x=f,m=!1);null!=k&&b.y!=k&&(b.y=k,q=!1);this.graph.snapDelta(b,a,!c,m||null!=f,q||null!=k);b=this.getDelta(a,n,b.x,r,b.y);m||null==this.guideX?null!=this.guideX&&(c=Math.max(a.y+a.height+b.y-this.graph.panDy,n.y+n.height),this.guideX.points=[new mxPoint(p,Math.min(a.y+b.y-this.graph.panDy,n.y)),new mxPoint(p, c)],this.guideX.stroke=this.getGuideColor(n,!0),this.guideX.node.style.visibility="visible",this.guideX.redraw()):this.guideX.node.style.visibility="hidden";q||null==this.guideY?null!=this.guideY&&(c=Math.max(a.x+a.width+b.x-this.graph.panDx,r.x+r.width),this.guideY.points=[new mxPoint(Math.min(a.x+b.x-this.graph.panDx,r.x),t),new mxPoint(c,t)],this.guideY.stroke=this.getGuideColor(r,!1),this.guideY.node.style.visibility="visible",this.guideY.redraw()):this.guideY.node.style.visibility="hidden"}return b}; mxGuide.prototype.moveDistance=function(a,b,c){b=new mxRectangle(a.x+b.x,a.y+b.y,a.width,a.height);for(var d=[],e=[],f=0;f<this.states.length;f++){var g=this.states[f];null==g||null==g.cell||this.isStateIgnored(g)||((b.x>=g.x&&b.x<=g.x+g.width||g.x>=b.x&&g.x<=b.x+b.width)&&(b.y>g.y+g.height+4||b.y+b.height+4<g.y)?e.push(g):(b.y>=g.y&&b.y<=g.y+g.height||g.y>=b.y&&g.y<=b.y+b.height)&&(b.x>g.x+g.width+4||b.x+b.width+4<g.x)&&d.push(g))}d=this.horizontal&&1<d.length?this.snapDistance(d,b,!0,c):null;c= this.vertical&&1<e.length?this.snapDistance(e,b,!1,c):null;null==d&&this.hideDistanceGuides(!0,!1);null==c&&this.hideDistanceGuides(!1,!0);return null!=d||null!=c?{x:null!=d?d-a.x:null,y:null!=c?c-a.y:null}:null}; mxGuide.prototype.snapDistance=function(a,b,c,d){function e(u){return c?u.x:u.y}function f(u){return c?u.width:u.height}a.push(b);a.sort(function(u,v){return e(u)-e(v)});var g=a[a.length-1]==b,k=!1,l=0,m=0,n=0,p=0;if(a[0]!=b&&!g)for(var q=1;q<a.length-1;q++)if(a[q]==b){n=m=p=(e(a[q+1])-e(a[q-1])-f(a[q-1])-f(b))/2;break}for(q=0;q<a.length-1;q++){g=a[q];var r=a[q+1],t=g==b||r==b;r=e(r)-e(g)-f(g);k=k||g==b;if(0==m&&0==l)m=r,l=1;else if(Math.abs(m-r)<=(t||1==q&&k?d:0))l+=1;else if(1<l&&k){a=a.slice(0, q+1);break}else if(3<=a.length-q&&!k)l=0,n=m=0!=p?p:0,a.splice(0,0==q?1:q),q=-1;else break;0!=n||t||(m=n=r)}(g=3==a.length&&a[1]==b)&&(n=0);if(1<l&&l==a.length-1&&(0<n||g)){g=a[a[0]==b?1:0];l=c?g.y+g.height:g.x+g.width;d=5*this.graph.getView().scale;k=[];m=0;if(0<n)for(q=0;q<a.length-1;q++)g=a[q],r=a[q+1],g==b?(m=this.roundToPixel(e(r)-f(b)-n),k.push(m+f(b)+d),k.push(e(r)-d)):r==b?(k.push(e(g)+f(g)+d),m=this.roundToPixel(e(g)+f(g)+n),k.push(m-d)):(k.push(e(g)+f(g)+d),k.push(e(r)-d));else g=a[0],a= a[2],m=this.roundToPixel(e(g)+f(g)+(e(a)-e(g)-f(g)-f(b))/2),k.push(e(g)+f(g)+d),k.push(m-d),k.push(m+f(b)+d),k.push(e(a)-d);this.redrawDistanceGuides(c,l,k,d);return m}return null}; mxGuide.prototype.redrawDistanceGuides=function(a,b,c,d){var e=a?this.distanceGuidesX:this.distanceGuidesY;e=null!=e?e:[];for(var f=0;f<c.length;f+=2){var g=e[f/2],k=a?new mxPoint(c[f],b):new mxPoint(b,c[f]),l=a?new mxPoint(c[f+1],b):new mxPoint(b,c[f+1]),m=a?0:d,n=a?d:0;null==g&&(g=this.createDistanceGuideShape(a),g.dialect=mxConstants.DIALECT_SVG,g.pointerEvents=!1,g.init(this.graph.getView().getOverlayPane()),e[f/2]=g);g.points=[new mxPoint(k.x-m,k.y-n),new mxPoint(k.x+m,k.y+n),k,l,new mxPoint(l.x- m,l.y-n),new mxPoint(l.x+m,l.y+n)];g.node.style.visibility="visible";g.redraw()}for(f=c.length/2;f<e.length;f++)e[f].destroy();e.splice(c.length/2,e.length-c.length/2);a?this.distanceGuidesX=e:this.distanceGuidesY=e}; mxGuide.prototype.hideDistanceGuides=function(a,b){if(a&&null!=this.distanceGuidesX)for(a=0;a<this.distanceGuidesX.length;a++)this.distanceGuidesX[a].node.style.visibility="hidden";if(b&&null!=this.distanceGuidesY)for(a=0;a<this.distanceGuidesY.length;a++)this.distanceGuidesY[a].node.style.visibility="hidden"};mxGuide.prototype.roundToPixel=function(a){var b=this.graph.getView().scale;return Math.round(a/b)*b}; mxGuide.prototype.getDelta=function(a,b,c,d,e){var f=this.graph.view.scale;if(this.rounded||null!=b&&null==b.cell)c=Math.round((a.x+c)/f)*f-a.x;if(this.rounded||null!=d&&null==d.cell)e=Math.round((a.y+e)/f)*f-a.y;return new mxPoint(c,e)};mxGuide.prototype.getGuideColor=function(a,b){return mxConstants.GUIDE_COLOR};mxGuide.prototype.hide=function(){this.setVisible(!1)}; mxGuide.prototype.setVisible=function(a){a=a?"visible":"hidden";null!=this.guideX&&(this.guideX.node.style.visibility=a);null!=this.guideY&&(this.guideY.node.style.visibility=a);if(null!=this.distanceGuidesX)for(var b=0;b<this.distanceGuidesX.length;b++)this.distanceGuidesX[b].node.style.visibility=a;if(null!=this.distanceGuidesY)for(b=0;b<this.distanceGuidesY.length;b++)this.distanceGuidesY[b].node.style.visibility=a}; mxGuide.prototype.destroy=function(){null!=this.guideX&&(this.guideX.destroy(),this.guideX=null);null!=this.guideY&&(this.guideY.destroy(),this.guideY=null);if(null!=this.distanceGuidesX){for(var a=0;a<this.distanceGuidesX.length;a++)this.distanceGuidesX[a].destroy();this.distanceGuidesX=null}if(null!=this.distanceGuidesY){for(a=0;a<this.distanceGuidesY.length;a++)this.distanceGuidesY[a].destroy();this.distanceGuidesY=null}};function mxShape(a){this.stencil=a;this.initStyles()} mxShape.forceFilledPointerEvents=!0;mxShape.prototype.dialect=null;mxShape.prototype.scale=1;mxShape.prototype.antiAlias=!0;mxShape.prototype.minSvgStrokeWidth=1;mxShape.prototype.bounds=null;mxShape.prototype.points=null;mxShape.prototype.node=null;mxShape.prototype.state=null;mxShape.prototype.style=null;mxShape.prototype.boundingBox=null;mxShape.prototype.stencil=null;mxShape.prototype.svgStrokeTolerance=8;mxShape.prototype.pointerEvents=!0;mxShape.prototype.svgPointerEvents="all"; mxShape.prototype.shapePointerEvents=!1;mxShape.prototype.stencilPointerEvents=!1;mxShape.prototype.outline=!1;mxShape.prototype.visible=!0;mxShape.prototype.useSvgBoundingBox=!1;mxShape.prototype.init=function(a){null==this.node&&(this.node=this.create(a),null!=a&&a.appendChild(this.node))};mxShape.prototype.initStyles=function(a){this.strokewidth=1;this.rotation=0;this.strokeOpacity=this.fillOpacity=this.opacity=100;this.flipV=this.flipH=!1};mxShape.prototype.isHtmlAllowed=function(){return!1}; mxShape.prototype.getSvgScreenOffset=function(){return 1==mxUtils.mod(Math.max(1,Math.round((this.stencil&&"inherit"!=this.stencil.strokewidth?Number(this.stencil.strokewidth):this.strokewidth)*this.scale)),2)?.5:0};mxShape.prototype.create=function(a){return null!=a&&null!=a.ownerSVGElement?this.createSvg(a):this.createHtml(a)};mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")}; mxShape.prototype.createHtml=function(){var a=document.createElement("div");a.style.position="absolute";return a};mxShape.prototype.reconfigure=function(){this.redraw()};mxShape.prototype.redraw=function(){this.updateBoundsFromPoints();this.visible&&this.checkBounds()?(this.node.style.visibility="visible",this.clear(),"DIV"==this.node.nodeName?this.redrawHtmlShape():this.redrawShape()):(this.node.style.visibility="hidden",this.boundingBox=null)}; mxShape.prototype.clear=function(){if(null!=this.node.ownerSVGElement)for(;null!=this.node.lastChild;)this.node.removeChild(this.node.lastChild);else this.node.style.cssText="position:absolute;"+(null!=this.cursor?"cursor:"+this.cursor+";":""),this.node.innerText=""}; mxShape.prototype.updateBoundsFromPoints=function(){var a=this.points;if(null!=a&&0<a.length&&null!=a[0]){this.bounds=new mxRectangle(Number(a[0].x),Number(a[0].y),this.scale,this.scale);for(var b=1;b<this.points.length;b++)null!=a[b]&&this.bounds.add(new mxRectangle(Number(a[b].x),Number(a[b].y),this.scale,this.scale))}};mxShape.prototype.styleChanged=function(a,b,c){}; mxShape.prototype.getLabelBounds=function(a){var b=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),c=a;b!=mxConstants.DIRECTION_SOUTH&&b!=mxConstants.DIRECTION_NORTH&&null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()&&(c=c.clone(),b=c.width,c.width=c.height,c.height=b);c=this.getLabelMargins(c);if(null!=c){var d="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,!1),e="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV, !1);null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()&&(b=c.x,c.x=c.height,c.height=c.width,c.width=c.y,c.y=b,b=d,d=e,e=b);return mxUtils.getDirectedBounds(a,c,this.style,d,e)}return a};mxShape.prototype.getLabelMargins=function(a){return null}; mxShape.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&0<this.scale&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&0<this.bounds.width&&0<this.bounds.height}; mxShape.prototype.getShadowStyle=function(){var a={dx:mxConstants.SHADOW_OFFSET_X,dy:mxConstants.SHADOW_OFFSET_Y,blur:mxConstants.SHADOW_BLUR,color:mxConstants.SHADOWCOLOR,opacity:100*mxConstants.SHADOW_OPACITY};null!=this.style&&(a.dx=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW_OFFSET_X,a.dx),a.dy=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW_OFFSET_Y,a.dy),a.blur=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW_BLUR,a.blur),a.color=mxUtils.getValue(this.style,mxConstants.STYLE_SHADOWCOLOR, 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;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}; mxShape.prototype.updateHtmlColors=function(a){var b=this.stroke;null!=b&&b!=mxConstants.NONE?(a.style.borderColor=mxUtils.getLightDarkColor(b).cssText,this.isDashed?a.style.borderStyle="dashed":0<this.strokewidth&&(a.style.borderStyle="solid"),a.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):a.style.borderWidth="0px";b=this.outline?null:this.fill;null!=b&&b!=mxConstants.NONE?(a.style.backgroundColor=mxUtils.getLightDarkColor(b).cssText,a.style.backgroundImage="none"): this.pointerEvents?a.style.backgroundColor="transparent":this.setTransparentBackgroundImage(a)}; mxShape.prototype.updateHtmlBounds=function(a){var b=Math.ceil(this.strokewidth*this.scale);a.style.borderWidth=Math.max(1,b)+"px";a.style.overflow="hidden";a.style.left=Math.round(this.bounds.x-b/2)+"px";a.style.top=Math.round(this.bounds.y-b/2)+"px";"CSS1Compat"==document.compatMode&&(b=-b);a.style.width=Math.round(Math.max(0,this.bounds.width+b))+"px";a.style.height=Math.round(Math.max(0,this.bounds.height+b))+"px"}; mxShape.prototype.destroyCanvas=function(a){if(a instanceof mxSvgCanvas2D){for(var b in a.gradients){var c=a.gradients[b];null!=c&&(c.mxRefCount=(c.mxRefCount||0)+1)}for(b in a.fillPatterns)c=a.fillPatterns[b],null!=c&&(c.mxRefCount=(c.mxRefCount||0)+1);this.releaseSvgGradients(this.oldGradients);this.releaseSvgFillPatterns(this.oldFillPatterns);this.oldGradients=a.gradients;this.oldFillPatterns=a.fillPatterns}};mxShape.prototype.beforePaint=function(a){};mxShape.prototype.afterPaint=function(a){}; mxShape.prototype.paint=function(a){var b=a.pointerEvents,c=!1;if(null!=a&&this.outline){var d=a.stroke;a.stroke=function(){c=!0;d.apply(this,arguments)};a.fillAndStroke=a.stroke}var e=this.scale,f=this.bounds.x/e,g=this.bounds.y/e,k=this.bounds.width/e,l=this.bounds.height/e;if(this.isPaintBoundsInverted()){var m=(k-l)/2;f+=m;g-=m;m=k;k=l;l=m}this.updateTransform(a,f,g,k,l);this.configureCanvas(a,f,g,k,l);this.updateSvgFilters(null!=a?a.state.scale:e);m=null;if(null==this.stencil&&null==this.points&& this.shapePointerEvents||null!=this.stencil&&this.stencilPointerEvents){var n=this.createBoundingBox();this.dialect==mxConstants.DIALECT_SVG?(m=this.createTransparentSvgRectangle(n.x,n.y,n.width,n.height),this.node.appendChild(m)):(e=a.createRect("rect",n.x/e,n.y/e,n.width/e,n.height/e),e.appendChild(a.createTransparentFill()),e.stroked="false",a.root.appendChild(e))}null!=this.stencil?this.stencil.drawShape(a,this,f,g,k,l,null!=this.state?this.state.view.graph:null):(a.setStrokeWidth(this.strokewidth), e=this.getWaypoints(),null!=e?1<e.length&&this.paintEdgeShape(a,e):(e=a.state.dx,n=a.state.dy,this.paintVertexShape(a,f,g,k,l),a.state.dx=e,a.state.dy=n));null!=m&&null!=a.state&&null!=a.state.transform&&m.setAttribute("transform",a.state.transform);null!=a&&this.outline&&!c&&(a.rect(f,g,k,l),a.stroke());a.pointerEvents=b}; mxShape.prototype.getWaypoints=function(){var a=this.points,b=null;if(null!=a&&(b=[],0<a.length)){var c=this.scale,d=Math.max(c,1),e=a[0];b.push(new mxPoint(e.x/c,e.y/c));for(var f=1;f<a.length;f++){var g=a[f];(Math.abs(e.x-g.x)>=d||Math.abs(e.y-g.y)>=d)&&b.push(new mxPoint(g.x/c,g.y/c));e=g}}return b}; mxShape.prototype.configureCanvas=function(a,b,c,d,e){var f=null;null!=this.style&&(f=this.style.dashPattern);a.setAlpha(this.opacity/100);a.setFillAlpha(this.fillOpacity/100);a.setStrokeAlpha(this.strokeOpacity/100);null!=this.isShadow&&a.setShadow(this.isShadow,this.shadowStyle);null!=this.isDashed&&a.setDashed(this.isDashed,null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);null!=f&&a.setDashPattern(f);null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&& this.gradient!=mxConstants.NONE?(b=this.getGradientBounds(a,b,c,d,e),a.setGradient(this.fill,this.gradient,b.x,b.y,b.width,b.height,this.gradientDirection)):(a.setFillColor(this.fill),a.setFillStyle(this.fillStyle,this.hachureGap,this.fillWeight,this.hachureAngle));null!=this.style&&(null!=this.style.linecap&&a.setLineCap(this.style.linecap),null!=this.style.linejoin&&a.setLineJoin(this.style.linejoin),null!=this.style.miterlimit&&a.setMiterLimit(this.style.miterlimit));a.setStrokeColor(this.stroke); this.configurePointerEvents(a)};mxShape.prototype.configurePointerEvents=function(a){null==this.style||mxShape.forceFilledPointerEvents&&null!=this.fill&&this.fill!=mxConstants.NONE&&0!=this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(a.pointerEvents=!1)};mxShape.prototype.getGradientBounds=function(a,b,c,d,e){return new mxRectangle(b,c,d,e)}; mxShape.prototype.updateTransform=function(a,b,c,d,e){a.scale(this.scale);a.rotate(this.getShapeRotation(),this.flipH,this.flipV,b+d/2,c+e/2)};mxShape.prototype.paintVertexShape=function(a,b,c,d,e){this.paintBackground(a,b,c,d,e);this.outline&&null!=this.style&&0!=mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)||(a.setShadow(!1),this.paintForeground(a,b,c,d,e))};mxShape.prototype.paintBackground=function(a,b,c,d,e){};mxShape.prototype.paintForeground=function(a,b,c,d,e){}; mxShape.prototype.paintEdgeShape=function(a,b){};mxShape.prototype.getArcSize=function(a,b){if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))a=Math.min(a/2,Math.min(b/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else{var c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;a=Math.min(a*c,b*c)}return a}; mxShape.prototype.paintGlassEffect=function(a,b,c,d,e,f){var g=Math.ceil(this.strokewidth/2);a.setGradient("#ffffff","#ffffff",b,c,d,.6*e,"south",.9,.1);a.begin();f+=2*g;this.isRounded?(a.moveTo(b-g+f,c-g),a.quadTo(b-g,c-g,b-g,c-g+f),a.lineTo(b-g,c+.4*e),a.quadTo(b+.5*d,c+.7*e,b+d+g,c+.4*e),a.lineTo(b+d+g,c-g+f),a.quadTo(b+d+g,c-g,b+d+g-f,c-g)):(a.moveTo(b-g,c-g),a.lineTo(b-g,c+.4*e),a.quadTo(b+.5*d,c+.7*e,b+d+g,c+.4*e),a.lineTo(b+d+g,c-g));a.close();a.fill()}; mxShape.prototype.addPoints=function(a,b,c,d,e,f,g){if(null!=b&&0<b.length){g=null!=g?g:!0;var k=b[b.length-1];if(e&&c){b=b.slice();var l=b[0];l=new mxPoint(k.x+(l.x-k.x)/2,k.y+(l.y-k.y)/2);b.splice(0,0,l)}var m=b[0];l=1;for(g?a.moveTo(m.x,m.y):a.lineTo(m.x,m.y);l<(e?b.length:b.length-1);){g=b[mxUtils.mod(l,b.length)];var n=m.x-g.x;m=m.y-g.y;if(c&&(0!=n||0!=m)&&(null==f||0>mxUtils.indexOf(f,l-1))){var p=Math.sqrt(n*n+m*m);a.lineTo(g.x+n*Math.min(d,p/2)/p,g.y+m*Math.min(d,p/2)/p);for(m=b[mxUtils.mod(l+ 1,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,null);this.hachureGap=mxUtils.getValue(this.style,mxConstants.STYLE_HACHURE_GAP,null);this.hachureAngle=mxUtils.getValue(this.style,mxConstants.STYLE_HACHURE_ANGLE,null);this.fillWeight=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_WEIGHT,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)}; mxShape.prototype.updateBoundingBox=function(){var a=this.useSvgBoundingBox?this.getSvgBoundingBox():null;null==a&&(a=this.getShapeBoundingBox());this.boundingBox=a};mxShape.prototype.isPaintBoundsInverted=function(){return null==this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)};mxShape.prototype.getRotation=function(){return null!=this.rotation?this.rotation:0}; mxShape.prototype.getTextRotation=function(){var a=this.getRotation();1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(a+=mxText.prototype.verticalTextRotation);return a};mxShape.prototype.getShapeRotation=function(){var a=this.getRotation();null!=this.direction&&(this.direction==mxConstants.DIRECTION_NORTH?a+=270:this.direction==mxConstants.DIRECTION_WEST?a+=180:this.direction==mxConstants.DIRECTION_SOUTH&&(a+=90));return a}; mxShape.prototype.createTransparentSvgRectangle=function(a,b,c,d){var e=document.createElementNS(mxConstants.NS_SVG,"rect");e.setAttribute("x",a);e.setAttribute("y",b);e.setAttribute("width",c);e.setAttribute("height",d);e.setAttribute("fill","none");e.setAttribute("stroke","none");e.setAttribute("pointer-events","all");return e};mxShape.prototype.setTransparentBackgroundImage=function(a){a.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"}; mxShape.prototype.intersectsRectangle=function(a,b){return null!=a&&(b||null!=this.node&&"none"!=this.node.style.display&&"hidden"!=this.node.style.visibility)&&mxUtils.intersects(this.bounds,a,!0)};mxShape.prototype.releaseSvgGradients=function(a){if(null!=a)for(var b in a){var c=a[b];null!=c&&(c.mxRefCount=(c.mxRefCount||0)-1,0==c.mxRefCount&&null!=c.parentNode&&c.parentNode.removeChild(c))}}; mxShape.prototype.releaseSvgFillPatterns=function(a){if(null!=a)for(var b in a){var c=a[b];null!=c&&(c.mxRefCount=(c.mxRefCount||0)-1,0==c.mxRefCount&&null!=c.parentNode&&c.parentNode.removeChild(c))}}; mxShape.prototype.destroy=function(){null!=this.node&&(mxEvent.release(this.node),null!=this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null);this.releaseSvgGradients(this.oldGradients);this.releaseSvgFillPatterns(this.oldFillPatterns);this.oldFillPatterns=this.oldGradients=null};function mxStencil(a){this.desc=a;this.parseDescription();this.parseConstraints()}mxUtils.extend(mxStencil,mxShape);mxStencil.defaultLocalized=!1;mxStencil.allowEval=!1; mxStencil.prototype.desc=null;mxStencil.prototype.constraints=null;mxStencil.prototype.aspect=null;mxStencil.prototype.w0=null;mxStencil.prototype.h0=null;mxStencil.prototype.bgNode=null;mxStencil.prototype.fgNode=null;mxStencil.prototype.strokewidth=null; mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0];this.bgNode=this.desc.getElementsByTagName("background")[0];this.w0=Number(this.desc.getAttribute("w")||100);this.h0=Number(this.desc.getAttribute("h")||100);var a=this.desc.getAttribute("aspect");this.aspect=null!=a?a:"variable";a=this.desc.getAttribute("strokewidth");this.strokewidth=null!=a?a:"1"}; mxStencil.prototype.parseConstraints=function(){var a=this.desc.getElementsByTagName("connections")[0];if(null!=a&&(a=mxUtils.getChildNodes(a),null!=a&&0<a.length)){this.constraints=[];for(var b=0;b<a.length;b++)this.constraints.push(this.parseConstraint(a[b]))}};mxStencil.prototype.parseConstraint=function(a){var b=Number(a.getAttribute("x")),c=Number(a.getAttribute("y")),d="1"==a.getAttribute("perimeter");a=a.getAttribute("name");return new mxConnectionConstraint(new mxPoint(b,c),d,a)}; mxStencil.prototype.evaluateTextAttribute=function(a,b,c){b=this.evaluateAttribute(a,b,c);a=a.getAttribute("localized");if(mxStencil.defaultLocalized&&null==a||"1"==a)b=mxResources.get(b);return b};mxStencil.prototype.evaluateAttribute=function(a,b,c){b=a.getAttribute(b);null==b&&(a=mxUtils.getTextContent(a),null!=a&&mxStencil.allowEval&&(a=mxUtils.eval(a),"function"==typeof a&&(b=a(c))));return b}; mxStencil.prototype.drawShape=function(a,b,c,d,e,f,g){g=null!=g?g:null!=b&&null!=b.state?b.state.view.graph:null;var k=a.states.slice(),l=mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,null);l=this.computeAspect(b.style,c,d,e,f,l);var m=Math.min(l.width,l.height);m="inherit"==this.strokewidth?Number(mxUtils.getNumber(b.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*m;a.setStrokeWidth(m);null!=b.style&&"1"==mxUtils.getValue(b.style,mxConstants.STYLE_POINTER_EVENTS,"0")&&(a.setStrokeColor(mxConstants.NONE), a.rect(c,d,e,f),a.stroke(),a.setStrokeColor(b.stroke));this.drawChildren(a,b,c,d,e,f,this.bgNode,l,!1,!0,g);this.drawChildren(a,b,c,d,e,f,this.fgNode,l,!0,!b.outline||null==b.style||0==mxUtils.getValue(b.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0),g);a.states.length!=k.length&&(a.states=k)};mxStencil.prototype.drawChildren=function(a,b,c,d,e,f,g,k,l,m,n){if(null!=g&&0<e&&0<f)for(c=g.firstChild;null!=c;)c.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,c,k,l,m,n),c=c.nextSibling}; mxStencil.prototype.computeAspect=function(a,b,c,d,e,f){a=b;b=d/this.w0;var g=e/this.h0;if(f=f==mxConstants.DIRECTION_NORTH||f==mxConstants.DIRECTION_SOUTH){g=d/this.h0;b=e/this.w0;var k=(d-e)/2;a+=k;c-=k}"fixed"==this.aspect&&(b=g=Math.min(b,g),f?(a+=(e-this.w0*b)/2,c+=(d-this.h0*g)/2):(a+=(d-this.w0*b)/2,c+=(e-this.h0*g)/2));return new mxRectangle(a,c,b,g)}; mxStencil.prototype.parseColor=function(a,b,c,d,e){"stroke"==d?d=b.stroke:"fill"==d?d=b.fill:"font"==d&&null!=b.style?d=mxUtils.getValue(b.style,mxConstants.STYLE_FONTCOLOR,"black"):null==b.style||mxUtils.isValidColor(d)||(d=this.getColorValue(b,c,d,e),"default"==d&&(d=this.getDefaultColorValue(c,e)));return d}; mxStencil.prototype.getStyleWithNone=function(a,b,c){if(null!=a&&null!=a.state&&this.cachedCellStyle!=a.state.cell.style||null==this.cachedUnresolvedStyle)this.cachedCellStyle=a.state.cell.style,this.cachedUnresolvedStyle=c.getCellStyle(a.state.cell,!1);return null!=this.cachedUnresolvedStyle?this.cachedUnresolvedStyle[b]:null}; mxStencil.prototype.getColorValue=function(a,b,c,d){b=b.getAttribute("default");var e=mxUtils.getValue(a.style,c);null==e&&null!=d?(a=this.getStyleWithNone(a,c,d),e=null==b||null!=a?a:b):"default"==e&&null!=b&&b!=mxConstants.NONE&&(e=b);return e};mxStencil.prototype.getDefaultColorValue=function(a,b){var c="#ffffff";null!=b&&(c="fillcolor"==a.nodeName?b.shapeBackgroundColor:b.shapeForegroundColor);return c}; mxStencil.prototype.drawNode=function(a,b,c,d,e,f,g){var k=c.nodeName,l=d.x,m=d.y,n=d.width,p=d.height,q=Math.min(n,p);if("save"==k)a.save();else if("restore"==k)a.restore();else if(f){if("path"==k){a.begin();q=!0;if("1"==c.getAttribute("rounded")){q=!1;for(var r=Number(c.getAttribute("arcSize")),t=0,u=[],v=c.firstChild;null!=v;){if(v.nodeType==mxConstants.NODETYPE_ELEMENT){var y=v.nodeName;if("move"==y||"line"==y)"move"!=y&&0!=u.length||u.push([]),u[u.length-1].push(new mxPoint(l+Number(v.getAttribute("x"))* n,m+Number(v.getAttribute("y"))*p)),t++;else{q=!0;break}}v=v.nextSibling}if(!q&&0<t)for(n=0;n<u.length;n++)p=!1,m=u[n][0],l=u[n][u[n].length-1],m.x==l.x&&m.y==l.y&&(u[n].pop(),p=!0),this.addPoints(a,u[n],!0,r,p);else q=!0}if(q)for(v=c.firstChild;null!=v;)v.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,v,d,e,f,g),v=v.nextSibling}else if("close"==k)a.close();else if("move"==k)a.moveTo(l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p);else if("line"==k)a.lineTo(l+Number(c.getAttribute("x"))* n,m+Number(c.getAttribute("y"))*p);else if("quad"==k)a.quadTo(l+Number(c.getAttribute("x1"))*n,m+Number(c.getAttribute("y1"))*p,l+Number(c.getAttribute("x2"))*n,m+Number(c.getAttribute("y2"))*p);else if("curve"==k)a.curveTo(l+Number(c.getAttribute("x1"))*n,m+Number(c.getAttribute("y1"))*p,l+Number(c.getAttribute("x2"))*n,m+Number(c.getAttribute("y2"))*p,l+Number(c.getAttribute("x3"))*n,m+Number(c.getAttribute("y3"))*p);else if("arc"==k)a.arcTo(Number(c.getAttribute("rx"))*n,Number(c.getAttribute("ry"))* p,Number(c.getAttribute("x-axis-rotation")),Number(c.getAttribute("large-arc-flag")),Number(c.getAttribute("sweep-flag")),l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p);else if("rect"==k)a.rect(l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p,Number(c.getAttribute("w"))*n,Number(c.getAttribute("h"))*p);else if("roundrect"==k)b=Number(c.getAttribute("arcsize")),0==b&&(b=100*mxConstants.RECTANGLE_ROUNDING_FACTOR),d=Number(c.getAttribute("w"))*n,f=Number(c.getAttribute("h"))* p,b=Number(b)/100,b=Math.min(d*b,f*b),a.roundrect(l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p,d,f,b,b);else if("ellipse"==k)a.ellipse(l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p,Number(c.getAttribute("w"))*n,Number(c.getAttribute("h"))*p);else if("image"==k)b.outline||(b=this.evaluateAttribute(c,"src",b),a.image(l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p,Number(c.getAttribute("w"))*n,Number(c.getAttribute("h"))*p,b,!1,"1"==c.getAttribute("flipH"), "1"==c.getAttribute("flipV")));else if("text"==k)b.outline||(g=this.evaluateTextAttribute(c,"str",b),d="1"==c.getAttribute("vertical")?-90:0,"0"==c.getAttribute("align-shape")&&(f=b.rotation,q=1==mxUtils.getValue(b.style,mxConstants.STYLE_FLIPH,0),b=1==mxUtils.getValue(b.style,mxConstants.STYLE_FLIPV,0),d=q&&b?d-f:q||b?d+f:d-f),d-=c.getAttribute("rotation"),a.text(l+Number(c.getAttribute("x"))*n,m+Number(c.getAttribute("y"))*p,0,0,g,c.getAttribute("align")||"left",c.getAttribute("valign")||"top", !1,"",null,!1,d));else if("include-shape"==k)q=mxStencilRegistry.getStencil(c.getAttribute("name")),null!=q&&(l+=Number(c.getAttribute("x"))*n,m+=Number(c.getAttribute("y"))*p,d=Number(c.getAttribute("w"))*n,f=Number(c.getAttribute("h"))*p,q.drawShape(a,b,l,m,d,f,g));else if("fillstroke"==k)a.fillAndStroke();else if("fill"==k)a.fill();else if("stroke"==k)a.stroke();else if("strokewidth"==k)n="1"==c.getAttribute("fixed")?1:q,a.setStrokeWidth(Number(c.getAttribute("width"))*n);else if("dashed"==k)a.setDashed("1"== c.getAttribute("dashed"));else if("dashpattern"==k){if(c=c.getAttribute("pattern"),null!=c){c=c.split(" ");p=[];for(n=0;n<c.length;n++)0<c[n].length&&p.push(Number(c[n])*q);c=p.join(" ");a.setDashPattern(c)}}else"strokecolor"==k?a.setStrokeColor(this.parseColor(a,b,c,c.getAttribute("color"),g)):"linecap"==k?a.setLineCap(c.getAttribute("cap")):"linejoin"==k?a.setLineJoin(c.getAttribute("join")):"miterlimit"==k?a.setMiterLimit(Number(c.getAttribute("limit"))):"fillcolor"==k?a.setFillColor(this.parseColor(a, b,c,c.getAttribute("color"),g)):"alpha"==k?a.setAlpha(c.getAttribute("alpha")):"fillalpha"==k?a.setAlpha(c.getAttribute("alpha")):"strokealpha"==k?a.setAlpha(c.getAttribute("alpha")):"fontcolor"==k?a.setFontColor(this.parseColor(a,b,c,c.getAttribute("color"),g)):"fontstyle"==k?a.setFontStyle(c.getAttribute("style")):"fontfamily"==k?a.setFontFamily(c.getAttribute("family")):"fontsize"==k&&a.setFontSize(Number(c.getAttribute("size"))*q);!e||"fillstroke"!=k&&"fill"!=k&&"stroke"!=k||a.setShadow(!1)}}; var mxStencilRegistry={stencils:Object.create(null),addStencil:function(a,b){mxStencilRegistry.stencils[a]=b},getStencil:function(a){return mxStencilRegistry.stencils[a]}},mxMarker={markers:Object.create(null),addMarker:function(a,b){mxMarker.markers[a]=b},createMarker:function(a,b,c,d,e,f,g,k,l,m){var n=mxMarker.markers[c];return null!=n?n(a,b,c,d,e,f,g,k,l,m):null}}; (function(){function a(d){d=null!=d?d:2;return function(e,f,g,k,l,m,n,p,q,r){f=l*q*1.118;p=m*q*1.118;l*=n+q;m*=n+q;var t=k.clone();t.x-=f;t.y-=p;n=g!=mxConstants.ARROW_CLASSIC&&g!=mxConstants.ARROW_CLASSIC_THIN?1:.75;k.x+=-l*n-f;k.y+=-m*n-p;return function(){e.begin();e.moveTo(t.x,t.y);e.lineTo(t.x-l-m/d,t.y-m+l/d);g!=mxConstants.ARROW_CLASSIC&&g!=mxConstants.ARROW_CLASSIC_THIN||e.lineTo(t.x-3*l/4,t.y-3*m/4);e.lineTo(t.x+m/d-l,t.y-m-l/d);e.close();r?e.fillAndStroke():e.stroke()}}}function b(d){d= null!=d?d:2;return function(e,f,g,k,l,m,n,p,q,r){f=l*q*1.118;g=m*q*1.118;l*=n+q;m*=n+q;var t=k.clone();t.x-=f;t.y-=g;k.x+=2*-f;k.y+=2*-g;return function(){e.begin();e.moveTo(t.x-l-m/d,t.y-m+l/d);e.lineTo(t.x,t.y);e.lineTo(t.x+m/d-l,t.y-m-l/d);e.stroke()}}}function c(d,e,f,g,k,l,m,n,p,q){n=f==mxConstants.ARROW_DIAMOND?.7071:.9862;e=k*p*n;n*=l*p;k*=m+p;l*=m+p;var r=g.clone();r.x-=e;r.y-=n;g.x+=-k-e;g.y+=-l-n;var t=f==mxConstants.ARROW_DIAMOND?2:3.4;return function(){d.begin();d.moveTo(r.x,r.y);d.lineTo(r.x- k/2-l/t,r.y+k/t-l/2);d.lineTo(r.x-k,r.y-l);d.lineTo(r.x-k/2+l/t,r.y-l/2-k/t);d.close();q?d.fillAndStroke():d.stroke()}}mxMarker.addMarker("classic",a(2));mxMarker.addMarker("classicThin",a(3));mxMarker.addMarker("block",a(2));mxMarker.addMarker("blockThin",a(3));mxMarker.addMarker("open",b(2));mxMarker.addMarker("openThin",b(3));mxMarker.addMarker("oval",function(d,e,f,g,k,l,m,n,p,q){var r=m/2,t=g.clone();g.x-=k*r;g.y-=l*r;return function(){d.ellipse(t.x-r,t.y-r,m,m);q?d.fillAndStroke():d.stroke()}}); mxMarker.addMarker("baseDash",function(d,e,f,g,k,l,m,n,p,q){var r=k*(m+p+1),t=l*(m+p+1);return function(){d.begin();d.moveTo(g.x-t/2,g.y+r/2);d.lineTo(g.x+t/2,g.y-r/2);d.stroke()}});mxMarker.addMarker("doubleBlock",function(d,e,f,g,k,l,m,n,p,q){e=k*p*1.118;n=l*p*1.118;k*=m+p;l*=m+p;var r=g.clone();r.x-=e;r.y-=n;f=f!=mxConstants.ARROW_CLASSIC&&f!=mxConstants.ARROW_CLASSIC_THIN?1:.75;g.x+=-k*f*2-e;g.y+=-l*f*2-n;return function(){d.begin();d.moveTo(r.x,r.y);d.lineTo(r.x-k-l/2,r.y-l+k/2);d.lineTo(r.x+ l/2-k,r.y-l-k/2);d.close();d.moveTo(r.x-k,r.y-l);d.lineTo(r.x-2*k-.5*l,r.y+.5*k-2*l);d.lineTo(r.x-2*k+.5*l,r.y-.5*k-2*l);d.close();q?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("diamond",c);mxMarker.addMarker("diamondThin",c);mxMarker.addMarker("manyOptional",function(d,e,f,g,k,l,m,n,p,q){var r=k*(m+p+1),t=l*(m+p+1),u=m/2,v=g.x,y=g.y;g.x-=2*r-k*p/2;g.y-=2*t-l*p/2;return function(){d.begin();d.ellipse(v-1.5*r-u,y-1.5*t-u,2*u,2*u);q?d.fillAndStroke():d.stroke();d.begin();d.moveTo(v,y);d.lineTo(v- r,y-t);d.moveTo(v+t/2,y-r/2);d.lineTo(v-r,y-t);d.lineTo(v-t/2,y+r/2);d.stroke()}})})();function mxActor(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxActor,mxShape);mxActor.prototype.paintVertexShape=function(a,b,c,d,e){a.translate(b,c);a.begin();this.redrawPath(a,b,c,d,e);a.fillAndStroke()}; mxActor.prototype.redrawPath=function(a,b,c,d,e){b=d/3;a.moveTo(0,e);a.curveTo(0,3*e/5,0,2*e/5,d/2,2*e/5);a.curveTo(d/2-b,2*e/5,d/2-b,0,d/2,0);a.curveTo(d/2+b,0,d/2+b,2*e/5,d/2,2*e/5);a.curveTo(d,2*e/5,d,3*e/5,d,e);a.close()};function mxCloud(a,b,c,d){mxActor.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxCloud,mxActor); mxCloud.prototype.redrawPath=function(a,b,c,d,e){a.moveTo(.25*d,.25*e);a.curveTo(.05*d,.25*e,0,.5*e,.16*d,.55*e);a.curveTo(0,.66*e,.18*d,.9*e,.31*d,.8*e);a.curveTo(.4*d,e,.7*d,e,.8*d,.8*e);a.curveTo(d,.8*e,d,.6*e,.875*d,.5*e);a.curveTo(d,.3*e,.8*d,.1*e,.625*d,.2*e);a.curveTo(.5*d,.05*e,.3*d,.05*e,.25*d,.25*e);a.close()};function mxRectangleShape(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxRectangleShape,mxShape); mxRectangleShape.prototype.isHtmlAllowed=function(){var a=!0;null!=this.style&&(a="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));return!this.isRounded&&!this.glass&&0==this.rotation&&(a||null!=this.fill&&this.fill!=mxConstants.NONE)}; mxRectangleShape.prototype.paintBackground=function(a,b,c,d,e){if(this.isRounded){if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))var f=Math.min(d/2,Math.min(e/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,f=Math.min(d*f,e*f);a.roundrect(b,c,d,e,f,f)}else a.rect(b,c,d,e);a.fillAndStroke()}; mxRectangleShape.prototype.isRoundable=function(){return!0};mxRectangleShape.prototype.getFooterSize=function(){return Math.max(0,mxUtils.getValue(this.style,mxConstants.STYLE_FOOTER_SIZE,0))};mxRectangleShape.prototype.getLabelBounds=function(a){var b=this.getFooterSize()*this.scale;0<b&&(a=new mxRectangle(a.x,a.y,a.width,a.height-Math.min(a.height,b)));return a}; mxRectangleShape.prototype.paintForeground=function(a,b,c,d,e){var f=Math.min(e,this.getFooterSize());0<f&&!this.outline&&this.paintFooter(a,b,c,d,e,f);this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(a,b,c,d,e,this.getArcSize(d+this.strokewidth,e+this.strokewidth))}; mxRectangleShape.prototype.paintFooter=function(a,b,c,d,e,f){var g=mxUtils.getValue(this.style,mxConstants.STYLE_FOOTER_COLOR,this.stroke),k=this.isRounded?this.getArcSize(d,e):0,l=Math.min(d/2,k);null!=g&&g!=mxConstants.NONE&&(a.setFillColor(g),a.setStrokeColor(g));a.setShadow(!1);a.begin();if(f>=k)a.moveTo(b,c+e-f),a.lineTo(b,c+e-k),a.quadTo(b,c+e,b+l,c+e),a.lineTo(b+d-l,c+e),a.quadTo(b+d,c+e,b+d,c+e-k),a.lineTo(b+d,c+e-f);else{var m=1-Math.sqrt(f/k);k=l*m*m;m*=l;a.moveTo(b+k,c+e-f);a.quadTo(b+ m,c+e,b+l,c+e);a.lineTo(b+d-l,c+e);a.quadTo(b+d-m,c+e,b+d-k,c+e-f)}a.close();null!=g&&g!=mxConstants.NONE?a.fillAndStroke():a.stroke()};function mxEllipse(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxEllipse,mxShape);mxEllipse.prototype.paintVertexShape=function(a,b,c,d,e){a.ellipse(b,c,d,e);a.fillAndStroke();null!=this.paintCenter&&this.paintCenter(a,b,c,d,e)}; mxEllipse.prototype.paintCenter=function(a,b,c,d,e){if(null!=this.style&&!this.outline){var f=Math.min(Math.max(0,mxUtils.getValue(this.style,mxConstants.STYLE_CENTER_RADIUS,0)),d/2,e/2);if(0<f){var g=mxUtils.getValue(this.style,mxConstants.STYLE_CENTER_COLOR,this.stroke);null!=g&&g!=mxConstants.NONE&&(a.setShadow(!1),a.setFillColor(g),a.ellipse(b+d/2-f,c+e/2-f,2*f,2*f),1==mxUtils.getValue(this.style,"centerStroke",0)&&null!=this.stroke&&this.stroke!=mxConstants.NONE?(a.setStrokeColor(this.stroke), a.fillAndStroke()):a.fill())}}};function mxDoubleEllipse(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxDoubleEllipse,mxShape);mxDoubleEllipse.prototype.paintBackground=function(a,b,c,d,e){a.ellipse(b,c,d,e);a.fillAndStroke()}; mxDoubleEllipse.prototype.paintForeground=function(a,b,c,d,e){if(!this.outline){var f=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(d/5,e/5)));b+=f;c+=f;d-=2*f;e-=2*f;0<d&&0<e&&a.ellipse(b,c,d,e);a.stroke()}}; mxDoubleEllipse.prototype.getLabelBounds=function(a){var b=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(a.width/5/this.scale,a.height/5/this.scale)))*this.scale;return new mxRectangle(a.x+b,a.y+b,a.width-2*b,a.height-2*b)};function mxRhombus(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxRhombus,mxShape);mxRhombus.prototype.isRoundable=function(){return!0}; mxRhombus.prototype.paintVertexShape=function(a,b,c,d,e){var f=d/2,g=e/2,k=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;a.begin();this.addPoints(a,[new mxPoint(b+f,c),new mxPoint(b+d,c+g),new mxPoint(b+f,c+e),new mxPoint(b,c+g)],this.isRounded,k,!0);a.fillAndStroke()};function mxPolyline(a,b,c){mxShape.call(this);this.points=a;this.stroke=b;this.strokewidth=null!=c?c:1}mxUtils.extend(mxPolyline,mxShape);mxPolyline.prototype.getRotation=function(){return 0}; mxPolyline.prototype.getShapeRotation=function(){return 0};mxPolyline.prototype.isPaintBoundsInverted=function(){return!1};mxPolyline.prototype.paintEdgeShape=function(a,b){var c=a.pointerEventsValue;a.pointerEventsValue="stroke";null!=this.style&&1==this.style[mxConstants.STYLE_BEZIER]?this.paintBezierLine(a,b):null!=this.style&&1==this.style[mxConstants.STYLE_CURVED]?this.paintCurvedLine(a,b):this.paintLine(a,b,this.isRounded);a.pointerEventsValue=c}; mxPolyline.prototype.paintLine=function(a,b,c){var d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;a.begin();this.addPoints(a,b,c,d,!1);a.stroke()};mxPolyline.prototype.paintCurvedLine=function(a,b){a.begin();var c=b[0],d=b.length;a.moveTo(c.x,c.y);for(c=1;c<d-2;c++){var e=b[c],f=b[c+1];a.quadTo(e.x,e.y,(e.x+f.x)/2,(e.y+f.y)/2)}e=b[d-2];f=b[d-1];a.quadTo(e.x,e.y,f.x,f.y);a.stroke()}; mxPolyline.prototype.paintBezierLine=function(a,b){var c=b.length;if(!(2>c)){a.begin();a.moveTo(b[0].x,b[0].y);if(2==c)a.lineTo(b[1].x,b[1].y);else if(0==(c-1)%3)for(var d=1;d+2<c;d+=3)a.curveTo(b[d].x,b[d].y,b[d+1].x,b[d+1].y,b[d+2].x,b[d+2].y);else{for(d=1;d<c-2;d++){var e=b[d],f=b[d+1];a.quadTo(e.x,e.y,(e.x+f.x)/2,(e.y+f.y)/2)}a.quadTo(b[c-2].x,b[c-2].y,b[c-1].x,b[c-1].y)}a.stroke()}}; function mxArrow(a,b,c,d,e,f,g){mxShape.call(this);this.points=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1;this.arrowWidth=null!=e?e:mxConstants.ARROW_WIDTH;this.spacing=null!=f?f:mxConstants.ARROW_SPACING;this.endSize=null!=g?g:mxConstants.ARROW_SIZE}mxUtils.extend(mxArrow,mxShape);mxArrow.prototype.augmentBoundingBox=function(a){mxShape.prototype.augmentBoundingBox.apply(this,arguments);a.grow((Math.max(this.arrowWidth,this.endSize)/2+this.strokewidth)*this.scale)}; mxArrow.prototype.paintEdgeShape=function(a,b){var c=mxConstants.ARROW_SPACING,d=mxConstants.ARROW_WIDTH,e=b[0];b=b[b.length-1];var f=b.x-e.x,g=b.y-e.y,k=Math.sqrt(f*f+g*g),l=k-2*c-mxConstants.ARROW_SIZE;f/=k;g/=k;k=d*g/3;d=-d*f/3;var m=e.x-k/2+c*f;e=e.y-d/2+c*g;var n=m+k,p=e+d,q=n+l*f;l=p+l*g;var r=q+k,t=l+d,u=r-3*k,v=t-3*d;a.begin();a.moveTo(m,e);a.lineTo(n,p);a.lineTo(q,l);a.lineTo(r,t);a.lineTo(b.x-c*f,b.y-c*g);a.lineTo(u,v);a.lineTo(u+k,v+d);a.close();a.fillAndStroke()}; function mxArrowConnector(a,b,c,d,e,f,g){mxShape.call(this);this.points=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1;this.arrowWidth=null!=e?e:mxConstants.ARROW_WIDTH;this.arrowSpacing=null!=f?f:mxConstants.ARROW_SPACING;this.startSize=mxConstants.ARROW_SIZE/5;this.endSize=mxConstants.ARROW_SIZE/5}mxUtils.extend(mxArrowConnector,mxShape);mxArrowConnector.prototype.useSvgBoundingBox=!0;mxArrowConnector.prototype.isRoundable=function(){return!0}; mxArrowConnector.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments);this.arrowSpacing=mxConstants.ARROW_SPACING};mxArrowConnector.prototype.apply=function(a){mxShape.prototype.apply.apply(this,arguments);null!=this.style&&(this.startSize=3*mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5),this.endSize=3*mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5))}; mxArrowConnector.prototype.augmentBoundingBox=function(a){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var b=this.getEdgeWidth();this.isMarkerStart()&&(b=Math.max(b,this.getStartArrowWidth()));this.isMarkerEnd()&&(b=Math.max(b,this.getEndArrowWidth()));a.grow((b/2+this.strokewidth)*this.scale)}; mxArrowConnector.prototype.paintEdgeShape=function(a,b){var c=this.isCurved()&&2<b.length;c&&(b=this.getCurvePoints(b));var d=this.strokewidth;this.outline&&(d=Math.max(1,mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth)));var e=this.getStartArrowWidth()+d,f=this.getEndArrowWidth()+d,g=this.outline?this.getEdgeWidth()+d:this.getEdgeWidth(),k=this.isOpenEnded(),l=this.isMarkerStart(),m=this.isMarkerEnd(),n=k?0:this.arrowSpacing+d/2,p=this.startSize+d;d=this.endSize+d;var q= !c&&this.isArrowRounded();c&&!k&&(l&&(b=this.trimCurveForMarker(b,n+p,!0)),m&&(b=this.trimCurveForMarker(b,n+d,!1)));c=b[b.length-1];var r=b[1].x-b[0].x,t=b[1].y-b[0].y,u=Math.sqrt(r*r+t*t);if(0!=u){var v=r/u,y=v,A=t/u,z=A;u=g*A;var x=-g*v,C=[];q?a.setLineJoin("round"):2<b.length&&a.setMiterLimit(1.42);a.begin();r=v;t=A;if(l&&!k)this.paintMarker(a,b[0].x,b[0].y,v,A,p,e,g,n,!0);else{var D=b[0].x+u/2+n*v,B=b[0].y+x/2+n*A,E=b[0].x-u/2+n*v,K=b[0].y-x/2+n*A;k?(a.moveTo(D,B),C.push(function(){a.lineTo(E, K)})):(a.moveTo(E,K),a.lineTo(D,B))}var G=B=D=0;for(u=0;u<b.length-2;u++)if(x=mxUtils.relativeCcw(b[u].x,b[u].y,b[u+1].x,b[u+1].y,b[u+2].x,b[u+2].y),D=b[u+2].x-b[u+1].x,B=b[u+2].y-b[u+1].y,G=Math.sqrt(D*D+B*B),0!=G){y=D/G;z=B/G;G=Math.max(Math.sqrt((v*y+A*z+1)/2),.04);D=v+y;B=A+z;var L=Math.sqrt(D*D+B*B);if(0!=L){D/=L;B/=L;L=Math.max(G,Math.min(this.strokewidth/200+.04,.35));G=0!=x&&q?Math.max(.1,L):Math.max(G,.06);var Q=b[u+1].x+B*g/2/G,H=b[u+1].y-D*g/2/G;B=b[u+1].x-B*g/2/G;D=b[u+1].y+D*g/2/G;0!= x&&q?-1==x?(x=B+z*g,G=D-y*g,a.lineTo(B+A*g,D-v*g),a.quadTo(Q,H,x,G),function(I,M){C.push(function(){a.lineTo(I,M)})}(B,D)):(a.lineTo(Q,H),function(I,M){var O=Q-A*g,N=H+v*g,P=Q-z*g,R=H+y*g;C.push(function(){a.quadTo(I,M,O,N)});C.push(function(){a.lineTo(P,R)})}(B,D)):(a.lineTo(Q,H),function(I,M){C.push(function(){a.lineTo(I,M)})}(B,D));v=y;A=z}}u=g*z;x=-g*y;if(m&&!k)this.paintMarker(a,c.x,c.y,-v,-A,d,f,g,n,!1);else{a.lineTo(c.x-n*y+u/2,c.y-n*z+x/2);var F=c.x-n*y-u/2,J=c.y-n*z-x/2;k?(a.moveTo(F,J), C.splice(0,0,function(){a.moveTo(F,J)})):a.lineTo(F,J)}for(u=C.length-1;0<=u;u--)C[u]();k?(a.end(),a.stroke()):(a.close(),a.fillAndStroke());a.setShadow(!1);a.setMiterLimit(4);q&&a.setLineJoin("flat");2<b.length&&(a.setMiterLimit(4),l&&!k&&(a.begin(),this.paintMarker(a,b[0].x,b[0].y,r,t,p,e,g,n,!0),a.stroke(),a.end()),m&&!k&&(a.begin(),this.paintMarker(a,c.x,c.y,-v,-A,d,f,g,n,!0),a.stroke(),a.end()))}}; mxArrowConnector.prototype.paintMarker=function(a,b,c,d,e,f,g,k,l,m){g=k/g;var n=k*e/2;k=-k*d/2;var p=(l+f)*d;f=(l+f)*e;m?a.moveTo(b-n+p,c-k+f):a.lineTo(b-n+p,c-k+f);a.lineTo(b-n/g+p,c-k/g+f);a.lineTo(b+l*d,c+l*e);a.lineTo(b+n/g+p,c+k/g+f);a.lineTo(b+n+p,c+k+f)};mxArrowConnector.prototype.isArrowRounded=function(){return this.isRounded};mxArrowConnector.prototype.isCurved=function(){return null!=this.style&&1==this.style[mxConstants.STYLE_CURVED]}; mxArrowConnector.prototype.getCurvePoints=function(a){for(var b=[a[0]],c=a.length,d=a[0],e=1;e<c-1;e++){var f=a[e],g=e<c-2?new mxPoint((a[e].x+a[e+1].x)/2,(a[e].y+a[e+1].y)/2):a[e+1],k=f.x-d.x,l=f.y-d.y,m=g.x-f.x,n=g.y-f.y;k=Math.max(4,Math.min(Math.ceil((Math.sqrt(k*k+l*l)+Math.sqrt(m*m+n*n))*this.scale/8),64));for(l=1;l<=k;l++)m=l/k,n=1-m,b.push(new mxPoint(n*n*d.x+2*n*m*f.x+m*m*g.x,n*n*d.y+2*n*m*f.y+m*m*g.y));d=g}return b}; mxArrowConnector.prototype.trimCurveForMarker=function(a,b,c){function d(l,m){var n=m.x-l.x;m=m.y-l.y;var p=l.x-f.x,q=l.y-f.y,r=n*n+m*m,t=2*(p*n+q*m);p=t*t-4*r*(p*p+q*q-b*b);if(0==r||0>p)return l;r=Math.max(0,Math.min(1,(-t-Math.sqrt(p))/(2*r)));return new mxPoint(l.x+r*n,l.y+r*m)}var e=a.length,f=c?a[0]:a[e-1];if(c)for(c=1;c<e-1;c++){var g=a[c].x-f.x,k=a[c].y-f.y;if(g*g+k*k>=b*b)return[f,d(a[c],a[c-1])].concat(a.slice(c))}else for(c=e-2;0<c;c--)if(g=a[c].x-f.x,k=a[c].y-f.y,g*g+k*k>=b*b)return e= a.slice(0,c+1),e.push(d(a[c],a[c+1])),e.push(f),e;return a};mxArrowConnector.prototype.getStartArrowWidth=function(){return mxConstants.ARROW_WIDTH};mxArrowConnector.prototype.getEndArrowWidth=function(){return mxConstants.ARROW_WIDTH};mxArrowConnector.prototype.getEdgeWidth=function(){return mxConstants.ARROW_WIDTH/3};mxArrowConnector.prototype.isOpenEnded=function(){return!1}; mxArrowConnector.prototype.isMarkerStart=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE};mxArrowConnector.prototype.isMarkerEnd=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE}; function mxText(a,b,c,d,e,f,g,k,l,m,n,p,q,r,t,u,v,y,A,z,x){mxShape.call(this);this.value=a;this.bounds=b;this.color=null!=e?e:"black";this.align=null!=c?c:mxConstants.ALIGN_CENTER;this.valign=null!=d?d:mxConstants.ALIGN_MIDDLE;this.family=null!=f?f:mxConstants.DEFAULT_FONTFAMILY;this.size=null!=g?g:mxConstants.DEFAULT_FONTSIZE;this.fontStyle=null!=k?k:mxConstants.DEFAULT_FONTSTYLE;this.spacing=parseInt(l||2);this.spacingTop=this.spacing+parseInt(m||0);this.spacingRight=this.spacing+parseInt(n||0); this.spacingBottom=this.spacing+parseInt(p||0);this.spacingLeft=this.spacing+parseInt(q||0);this.horizontal=null!=r?r:!0;this.background=t;this.border=u;this.wrap=null!=v?v:!1;this.clipped=null!=y?y:!1;this.overflow=null!=A?A:"visible";this.labelPadding=null!=z?z:0;this.textDirection=x;this.rotation=0;this.updateMargin()}mxUtils.extend(mxText,mxShape);mxText.prototype.baseSpacingTop=0;mxText.prototype.baseSpacingBottom=0;mxText.prototype.baseSpacingLeft=0;mxText.prototype.baseSpacingRight=0; mxText.prototype.replaceLinefeeds=!0;mxText.prototype.verticalTextRotation=-90;mxText.prototype.ignoreClippedStringSize=!0;mxText.prototype.ignoreStringSize=!1;mxText.prototype.textWidthPadding=3;mxText.prototype.lastValue=null;mxText.prototype.cacheEnabled=!0;mxText.prototype.isHtmlAllowed=function(){return!0};mxText.prototype.getSvgScreenOffset=function(){return 0}; mxText.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&0<this.scale&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)};mxText.prototype.configurePointerEvents=function(a){}; mxText.prototype.getActualTextDirection=function(){var a=this.textDirection;a==mxConstants.TEXT_DIRECTION_AUTO&&(a=this.getAutoDirection());a!=mxConstants.TEXT_DIRECTION_LTR&&a!=mxConstants.TEXT_DIRECTION_RTL&&a!=mxConstants.TEXT_DIRECTION_VERTICAL_LR&&a!=mxConstants.TEXT_DIRECTION_VERTICAL_RL&&(a=null);return a}; mxText.prototype.paint=function(a,b){var c=this.scale,d=this.bounds.x/c,e=this.bounds.y/c,f=this.bounds.width/c,g=this.bounds.height/c;this.updateTransform(a,d,e,f,g);this.configureCanvas(a,d,e,f,g);this.updateSvgFilters(null!=a?a.state.scale:c);c=this.getActualTextDirection();if(b)a.updateText(d,e,f,g,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),c,this.node);else{var k=(b=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML)?"html":"",l=this.value; b||"html"!=k||(l=mxUtils.htmlEntities(l,!1));"html"!=k||mxUtils.isNode(this.value)||(l=mxUtils.replaceTrailingNewlines(l,"<div><br></div>"));l=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==k?l.replace(/\n/g,"<br/>"):l;a.text(d,e,f,g,l,this.align,this.valign,this.wrap,k,this.overflow,this.clipped,this.getTextRotation(),c)}}; mxText.prototype.redraw=function(){if(this.wrap&&this.convertToSvg&&null!=this.style&&"wrap"==this.style.svgWhiteSpace&&null!=this.bounds){var a=this.bounds.width;null!=this.lastWrapWidth&&this.lastWrapWidth!=a&&(this.lastValue=null);this.lastWrapWidth=a}this.visible&&this.checkBounds()&&this.cacheEnabled&&this.lastValue==this.value&&(mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML)?"DIV"==this.node.nodeName?mxClient.IS_SVG?this.redrawHtmlShapeWithCss3():(this.updateSize(this.node), this.updateHtmlTransform()):(a=this.createCanvas(),null!=a&&null!=a.updateText?(a.pointerEvents=this.pointerEvents,this.paint(a,!0),this.destroyCanvas(a)):mxShape.prototype.redraw.apply(this,arguments)):(mxShape.prototype.redraw.apply(this,arguments),mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML?this.lastValue=this.value:this.lastValue=null)}; mxText.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments);this.color="black";this.align=mxConstants.ALIGN_CENTER;this.valign=mxConstants.ALIGN_MIDDLE;this.family=mxConstants.DEFAULT_FONTFAMILY;this.size=mxConstants.DEFAULT_FONTSIZE;this.fontStyle=mxConstants.DEFAULT_FONTSTYLE;this.spacingLeft=this.spacingBottom=this.spacingRight=this.spacingTop=this.spacing=2;this.horizontal=!0;delete this.background;delete this.border;this.labelPadding=0;this.textDirection=mxConstants.DEFAULT_TEXT_DIRECTION; delete this.margin}; mxText.prototype.apply=function(a){var b=this.spacing;mxShape.prototype.apply.apply(this,arguments);null!=this.style&&(this.fontStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,this.fontStyle),this.family=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,this.family),this.size=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,this.size),this.color=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,this.color),this.align=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN, this.align),this.valign=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,this.valign),this.spacing=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing)),this.spacingTop=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,this.spacingTop-b))+this.spacing,this.spacingRight=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,this.spacingRight-b))+this.spacing,this.spacingBottom=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM, this.spacingBottom-b))+this.spacing,this.spacingLeft=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_LEFT,this.spacingLeft-b))+this.spacing,this.horizontal=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,this.horizontal),this.background=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,this.background),this.border=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,this.border),this.labelPadding=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_PADDING, this.labelPadding),this.textDirection=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_OPACITY,100),this.updateMargin());this.flipH=this.flipV=null};mxText.prototype.getAutoDirection=function(){var a=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(this.value);return null!=a&&0<a.length&&"z"<a[0]?mxConstants.TEXT_DIRECTION_RTL:mxConstants.TEXT_DIRECTION_LTR}; mxText.prototype.getContentNode=function(){var a=this.node;null!=a&&(a=null==a.ownerSVGElement?this.node.firstChild.firstChild:a.firstChild.firstChild.firstChild.firstChild.firstChild);return a}; mxText.prototype.updateBoundingBox=function(){var a=this.node;this.boundingBox=this.bounds.clone();var b=this.getTextRotation(),c=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER):null,d=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE):null;if(!(this.ignoreStringSize||null==a||"fill"==this.overflow||this.clipped&&this.ignoreClippedStringSize&&c==mxConstants.ALIGN_CENTER&&d==mxConstants.ALIGN_MIDDLE)){d= c=null;if(null!=a.ownerSVGElement)if(null!=a.firstChild&&null!=a.firstChild.firstChild&&"foreignObject"==a.firstChild.firstChild.nodeName&&null!=a.firstChild.firstChild.firstChild&&null!=a.firstChild.firstChild.firstChild.firstChild)a=a.firstChild.firstChild.firstChild.firstChild,d=a.offsetHeight*this.scale,c="width"==this.overflow?this.boundingBox.width:a.offsetWidth*this.scale;else try{var e=a.getBBox();"string"==typeof this.value&&0==mxUtils.trim(this.value)?this.boundingBox=null:this.boundingBox= 0==e.width&&0==e.height?null:new mxRectangle(e.x,e.y,e.width,e.height);return}catch(f){}else{if(null==this.offsetWidth||null==this.offsetHeight)null!=a.firstChild&&"DIV"==a.firstChild.nodeName&&(a=a.firstChild),this.offsetWidth=a.offsetWidth+this.textWidthPadding,this.offsetHeight=a.offsetHeight;c=this.offsetWidth*this.scale;d=this.offsetHeight*this.scale}null!=c&&null!=d&&(this.boundingBox=new mxRectangle(this.bounds.x,this.bounds.y,c,d))}null!=this.boundingBox&&(0!=b?(b=mxUtils.getBoundingBox(new mxRectangle(this.margin.x* this.boundingBox.width,this.margin.y*this.boundingBox.height,this.boundingBox.width,this.boundingBox.height),b,new mxPoint(0,0)),this.unrotatedBoundingBox=mxRectangle.fromRectangle(this.boundingBox),this.unrotatedBoundingBox.x+=this.margin.x*this.unrotatedBoundingBox.width,this.unrotatedBoundingBox.y+=this.margin.y*this.unrotatedBoundingBox.height,this.boundingBox.x+=b.x,this.boundingBox.y+=b.y,this.boundingBox.width=b.width,this.boundingBox.height=b.height):(this.boundingBox.x+=this.margin.x*this.boundingBox.width, this.boundingBox.y+=this.margin.y*this.boundingBox.height,this.unrotatedBoundingBox=null))};mxText.prototype.getShapeRotation=function(){return 0};mxText.prototype.getTextRotation=function(){return null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0};mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)}; mxText.prototype.configureCanvas=function(a,b,c,d,e){mxShape.prototype.configureCanvas.apply(this,arguments);a.setFontColor(this.color);a.setFontBackgroundColor(this.background);a.setFontBorderColor(this.border);a.setLabelPadding(this.labelPadding);a.setFontFamily(this.family);a.setFontSize(this.size);a.setFontStyle(this.fontStyle);a.allowConvertHtmlToSvg=this.convertToSvg}; mxText.prototype.isShadowEnabled=function(){return null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_SHADOW,!1):!1};mxText.prototype.getHtmlValue=function(){var a=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(a=mxUtils.htmlEntities(a,!1));a=mxUtils.replaceTrailingNewlines(a,"<div><br></div>");return this.replaceLinefeeds?a.replace(/\n/g,"<br/>"):a}; mxText.prototype.getTextCss=function(){var a=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;a="display: inline-block; font-size: "+this.size+"px; font-family: "+mxUtils.parseCssFontFamily(this.family)+"; color: "+this.color+"; line-height: "+a+"; pointer-events: "+(this.pointerEvents?"all":"none")+"; ";(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a+="font-weight: bold; ");(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&& (a+="font-style: italic; ");var b=[];(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.push("underline");(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&b.push("line-through");0<b.length&&((this.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&b.push("dotted"),a+="text-decoration: "+b.join(" ")+"; ");return a}; mxText.prototype.redrawHtmlShape=function(){if(mxClient.IS_SVG)this.redrawHtmlShapeWithCss3();else{var a=this.node.style;a.whiteSpace="normal";a.overflow="";a.width="";a.height="";this.updateValue();this.updateFont(this.node);this.updateSize(this.node);this.offsetHeight=this.offsetWidth=null;this.updateHtmlTransform()}}; mxText.prototype.redrawHtmlShapeWithCss3=function(){var a=Math.max(0,Math.round(this.bounds.width/this.scale)),b=Math.max(0,Math.round(this.bounds.height/this.scale)),c="position: absolute; left: "+Math.round(this.bounds.x)+"px; top: "+Math.round(this.bounds.y)+"px; pointer-events: none; ",d=this.getTextCss(),e=this.getActualTextDirection();mxSvgCanvas2D.createCss(a+2,b,this.align,this.valign,this.wrap,this.overflow,this.clipped,e,null!=this.background?mxUtils.htmlEntities(this.background):null,null!= this.border?mxUtils.htmlEntities(this.border):null,mxUtils.parseCssSpacing(this.labelPadding),c,d,this.scale,mxUtils.bind(this,function(f,g,k,l,m,n){f=this.getTextRotation();f=(1!=this.scale?"scale("+this.scale+") ":"")+(0!=f?"rotate("+f+"deg) ":"")+(0!=this.margin.x||0!=this.margin.y?"translate("+100*this.margin.x+"%,"+100*this.margin.y+"%)":"");""!=f&&(f="transform-origin: 0 0; transform: "+f+"; ");"block"==this.overflow&&this.valign==mxConstants.ALIGN_MIDDLE&&(f+="max-height: "+(b+1)+"px;");""== n?(k+=l,l="display:inline-block; min-width: 100%; "+f):(l+=f,mxClient.IS_SF&&(l+="-webkit-clip-path: content-box;"));"block"==this.overflow&&(l+="width: 100%; ");100>this.opacity&&(m+="opacity: "+this.opacity/100+"; ");this.node.setAttribute("style",k);k=mxUtils.isNode(this.value)?this.value.outerHTML:this.getHtmlValue();null==this.node.firstChild&&(this.node.innerHTML="<div><div>"+k+"</div></div>");this.node.firstChild.firstChild.setAttribute("style",m);this.node.firstChild.setAttribute("style", l)}))}; mxText.prototype.updateHtmlTransform=function(){var a=this.getTextRotation(),b=this.node.style,c=this.margin.x,d=this.margin.y;0!=a?(mxUtils.setPrefixedStyle(b,"transformOrigin",100*-c+"% "+100*-d+"%"),mxUtils.setPrefixedStyle(b,"transform","translate("+100*c+"%,"+100*d+"%) scale("+this.scale+") rotate("+a+"deg)")):(mxUtils.setPrefixedStyle(b,"transformOrigin","0% 0%"),mxUtils.setPrefixedStyle(b,"transform","scale("+this.scale+") translate("+100*c+"%,"+100*d+"%)"));b.left=Math.round(this.bounds.x-Math.ceil(c* ("fill"!=this.overflow&&"width"!=this.overflow?3:1)))+"px";b.top=Math.round(this.bounds.y-d*("fill"!=this.overflow?3:1))+"px";b.opacity=100>this.opacity?this.opacity/100:""}; mxText.prototype.updateInnerHtml=function(a){if(mxUtils.isNode(this.value))a.innerHTML=this.value.outerHTML;else{var b=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(b=mxUtils.htmlEntities(b,!1));b=mxUtils.replaceTrailingNewlines(b,"<div> </div>");b=this.replaceLinefeeds?b.replace(/\n/g,"<br/>"):b;a.innerHTML='<div style="display:inline-block;_display:inline;">'+b+"</div>"}}; mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerText="",this.node.appendChild(this.value);else{var a=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(a=mxUtils.htmlEntities(a,!1));a=mxUtils.replaceTrailingNewlines(a,"<div><br></div>");a=this.replaceLinefeeds?a.replace(/\n/g,"<br/>"):a;var b=null!=this.background&&this.background!=mxConstants.NONE?this.background:null,c=null!=this.border&&this.border!=mxConstants.NONE?this.border:null;if("fill"==this.overflow|| "width"==this.overflow)null!=b&&(this.node.style.backgroundColor=b),null!=c&&(this.node.style.border="1px solid "+c);else{var d="";null!=b&&(d+="background-color:"+mxUtils.htmlEntities(b)+";");null!=c&&(d+="border:1px solid "+mxUtils.htmlEntities(c)+";");a='<div style="zoom:1;'+d+"display:inline-block;_display:inline;text-decoration:inherit;padding-bottom:1px;padding-right:1px;line-height:"+(mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT)+'">'+a+"</div>"}this.node.innerHTML= a;a=this.node.getElementsByTagName("div");0<a.length&&(b=this.textDirection,b==mxConstants.TEXT_DIRECTION_AUTO&&this.dialect!=mxConstants.DIALECT_STRICTHTML&&(b=this.getAutoDirection()),b==mxConstants.TEXT_DIRECTION_LTR||b==mxConstants.TEXT_DIRECTION_RTL?a[a.length-1].setAttribute("dir",b):a[a.length-1].removeAttribute("dir"))}}; mxText.prototype.updateFont=function(a){a=a.style;a.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;a.fontSize=this.size+"px";a.fontFamily=mxUtils.parseCssFontFamily(this.family);a.verticalAlign="top";a.color=this.color;a.fontWeight=(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold":"";a.fontStyle=(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic":"";var b=[];(this.fontStyle&mxConstants.FONT_UNDERLINE)== mxConstants.FONT_UNDERLINE&&b.push("underline");(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&b.push("line-through");0<b.length&&(this.fontStyle&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&b.push("dotted");a.textDecoration=b.join(" ");a.textAlign=this.align==mxConstants.ALIGN_CENTER?"center":this.align==mxConstants.ALIGN_RIGHT?"right":"left"}; mxText.prototype.updateSize=function(a){var b=Math.max(0,Math.round(this.bounds.width/this.scale)),c=Math.max(0,Math.round(this.bounds.height/this.scale)),d=a.style;this.clipped?(d.overflow="hidden",d.maxHeight=c+"px",d.maxWidth=b+"px"):"fill"==this.overflow?(d.width=b+1+"px",d.height=c+1+"px",d.overflow="hidden"):"width"==this.overflow?(d.width=b+1+"px",d.maxHeight=c+1+"px",d.overflow="hidden"):"block"==this.overflow&&(d.width=b+1+"px");if(this.wrap&&0<b){if(d.wordWrap=mxConstants.WORD_WRAP,d.whiteSpace= "normal",d.width=b+"px","fill"!=this.overflow&&"width"!=this.overflow){c=a;null!=c.firstChild&&"DIV"==c.firstChild.nodeName&&(c=c.firstChild,"break-word"==a.style.wordWrap&&(c.style.width="100%"));var e=c.offsetWidth;if(0==e){var f=a.parentNode;a.style.visibility="hidden";document.body.appendChild(a);e=c.offsetWidth;a.style.visibility="";f.appendChild(a)}e+=3;this.clipped&&(e=Math.min(e,b));d.width=e+"px"}}else d.whiteSpace="nowrap"}; mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)}; mxText.prototype.getSpacing=function(a,b){return new mxPoint(null!=b&&-.5==b.x||null==b&&this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:null!=b&&-1==b.x||null==b&&this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-(a?0:this.baseSpacingRight):this.spacingLeft+(a?0:this.baseSpacingLeft),this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-(a?0:this.baseSpacingBottom):this.spacingTop+(a? 0:this.baseSpacingTop))};function mxTriangle(){mxActor.call(this)}mxUtils.extend(mxTriangle,mxActor);mxTriangle.prototype.isRoundable=function(){return!0};mxTriangle.prototype.redrawPath=function(a,b,c,d,e){b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d,.5*e),new mxPoint(0,e)],this.isRounded,b,!0)};function mxHexagon(){mxActor.call(this)}mxUtils.extend(mxHexagon,mxActor); mxHexagon.prototype.redrawPath=function(a,b,c,d,e){b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(.25*d,0),new mxPoint(.75*d,0),new mxPoint(d,.5*e),new mxPoint(.75*d,e),new mxPoint(.25*d,e),new mxPoint(0,.5*e)],this.isRounded,b,!0)};function mxLine(a,b,c,d){mxShape.call(this);this.bounds=a;this.stroke=b;this.strokewidth=null!=c?c:1;this.vertical=null!=d?d:this.vertical}mxUtils.extend(mxLine,mxShape);mxLine.prototype.vertical=!1; mxLine.prototype.paintVertexShape=function(a,b,c,d,e){a.begin();if(this.vertical){var f=b+d/2;a.moveTo(f,c);a.lineTo(f,c+e)}else f=c+e/2,a.moveTo(b,f),a.lineTo(b+d,f);a.stroke()};function mxImageShape(a,b,c,d,e){mxShape.call(this);this.bounds=a;this.image=b;this.fill=c;this.stroke=d;this.strokewidth=null!=e?e:1}mxUtils.extend(mxImageShape,mxRectangleShape);mxImageShape.prototype.preserveImageAspect=!0;mxImageShape.prototype.getSvgScreenOffset=function(){return 0}; mxImageShape.prototype.apply=function(a){mxShape.prototype.apply.apply(this,arguments);this.gradient=this.stroke=this.fill=null;null!=this.style&&(this.preserveImageAspect=1==mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1),this.imageBackground=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),this.imageBorder=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null),this.flipH=this.flipH||1==mxUtils.getValue(this.style,"imageFlipH",0),this.flipV=this.flipV|| 1==mxUtils.getValue(this.style,"imageFlipV",0),this.clipPath=mxUtils.getValue(this.style,mxConstants.STYLE_CLIP_PATH,null))};mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect};mxImageShape.prototype.createHtml=function(){var a=document.createElement("div");a.style.position="absolute";return a};mxImageShape.prototype.isRoundable=function(){return!0};mxImageShape.prototype.getImageDataUri=function(a){return this.image};mxImageShape.prototype.getImageCssVars=function(a){return null}; mxImageShape.prototype.configurePointerEvents=function(a){}; mxImageShape.prototype.paintVertexShape=function(a,b,c,d,e){if(null!=this.image){var f=this.isRounded?this.getArcSize(d,e):0;null!=this.imageBackground&&(a.setFillColor(this.imageBackground),a.setStrokeColor(this.imageBorder),0<f?a.roundrect(b,c,d,e,f,f):a.rect(b,c,d,e),a.fillAndStroke());var g=this.clipPath;if(0<f){var k=" round "+100*f/Math.min(d,e)+"%";null!=g&&"inset"==g.substring(0,5)&&0>g.indexOf("round")?g=g.replace(")",k+")"):null==g&&(g="inset(0% 0% 0% 0%"+k+")")}a.image(b,c,d,e,this.getImageDataUri(a), this.preserveImageAspect,!1,!1,g,this.getImageCssVars(a));null!=this.imageBorder&&(a.setShadow(!1),a.setStrokeColor(this.imageBorder),0<f?a.roundrect(b,c,d,e,f,f):a.rect(b,c,d,e),a.stroke())}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)}; mxImageShape.prototype.redrawHtmlShape=function(){this.node.style.left=Math.round(this.bounds.x)+"px";this.node.style.top=Math.round(this.bounds.y)+"px";this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px";this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px";this.node.innerText="";if(null!=this.image){var a=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,""),b=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,"");this.node.style.backgroundColor= a;this.node.style.borderColor=b;a=document.createElement("img");a.setAttribute("border","0");a.style.position="absolute";a.src=this.image;b=100>this.opacity?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=b;this.flipH&&this.flipV?b+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?b+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(b+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)");a.style.filter!=b&&(a.style.filter=b);"image"== a.nodeName?a.style.rotation=this.rotation:0!=this.rotation?mxUtils.setPrefixedStyle(a.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(a.style,"transform","");a.style.width=this.node.style.width;a.style.height=this.node.style.height;this.node.style.backgroundImage="";this.node.appendChild(a)}else this.setTransparentBackgroundImage(this.node)};function mxLabel(a,b,c,d){mxRectangleShape.call(this,a,b,c,d)}mxUtils.extend(mxLabel,mxRectangleShape); mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE;mxLabel.prototype.spacing=2;mxLabel.prototype.indicatorSize=10;mxLabel.prototype.indicatorSpacing=2;mxLabel.prototype.init=function(a){mxShape.prototype.init.apply(this,arguments);null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.init(this.node))}; mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.redraw());mxShape.prototype.redraw.apply(this,arguments)};mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape}; mxLabel.prototype.paintForeground=function(a,b,c,d,e){this.paintImage(a,b,c,d,e);this.paintIndicator(a,b,c,d,e);mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxLabel.prototype.paintImage=function(a,b,c,d,e){null!=this.image&&(b=this.getImageBounds(b,c,d,e),c=mxUtils.getValue(this.style,mxConstants.STYLE_CLIP_PATH,null),a.image(b.x,b.y,b.width,b.height,this.image,!1,!1,!1,c))}; mxLabel.prototype.getImageBounds=function(a,b,c,d){var e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),f=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),g=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),k=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;a=e==mxConstants.ALIGN_CENTER? a+(c-g)/2:e==mxConstants.ALIGN_RIGHT?a+(c-g-l):a+l;b=f==mxConstants.ALIGN_TOP?b+l:f==mxConstants.ALIGN_BOTTOM?b+(d-k-l):b+(d-k)/2;return new mxRectangle(a,b,g,k)};mxLabel.prototype.paintIndicator=function(a,b,c,d,e){null!=this.indicator?(this.indicator.bounds=this.getIndicatorBounds(b,c,d,e),this.indicator.paint(a)):null!=this.indicatorImage&&(b=this.getIndicatorBounds(b,c,d,e),a.image(b.x,b.y,b.width,b.height,this.indicatorImage,!1,!1,!1))}; mxLabel.prototype.getIndicatorBounds=function(a,b,c,d){var e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),f=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),g=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),k=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),l=this.spacing+5;a=e==mxConstants.ALIGN_RIGHT?a+(c-g-l):e==mxConstants.ALIGN_CENTER?a+(c-g)/ 2:a+l;b=f==mxConstants.ALIGN_BOTTOM?b+(d-k-l):f==mxConstants.ALIGN_TOP?b+l:b+(d-k)/2;return new mxRectangle(a,b,g,k)}; mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(null!=this.image){var a=document.createElement("img");a.style.position="relative";a.setAttribute("border","0");var b=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);b.x-=this.bounds.x;b.y-=this.bounds.y;a.style.left=Math.round(b.x)+"px";a.style.top=Math.round(b.y)+"px";a.style.width= Math.round(b.width)+"px";a.style.height=Math.round(b.height)+"px";a.src=this.image;this.node.appendChild(a)}};function mxCylinder(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxCylinder,mxShape);mxCylinder.prototype.maxHeight=40; mxCylinder.prototype.paintVertexShape=function(a,b,c,d,e){a.translate(b,c);a.begin();this.redrawPath(a,b,c,d,e,!1);a.fillAndStroke();this.outline&&null!=this.style&&0!=mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)||(a.setShadow(!1),a.begin(),this.redrawPath(a,b,c,d,e,!0),a.stroke())};mxCylinder.prototype.getCylinderSize=function(a,b,c,d){return Math.min(this.maxHeight,Math.round(d/5))}; mxCylinder.prototype.redrawPath=function(a,b,c,d,e,f){b=this.getCylinderSize(b,c,d,e);if(f&&null!=this.fill||!f&&null==this.fill)a.moveTo(0,b),a.curveTo(0,2*b,d,2*b,d,b),f||(a.stroke(),a.begin());f||(a.moveTo(0,b),a.curveTo(0,-b/3,d,-b/3,d,b),a.lineTo(d,e-b),a.curveTo(d,e+b/3,0,e+b/3,0,e-b),a.close())};function mxConnector(a,b,c){mxPolyline.call(this,a,b,c)}mxUtils.extend(mxConnector,mxPolyline); mxConnector.prototype.updateBoundingBox=function(){this.useSvgBoundingBox=null!=this.style&&1==this.style[mxConstants.STYLE_CURVED];mxShape.prototype.updateBoundingBox.apply(this,arguments)}; mxConnector.prototype.paintEdgeShape=function(a,b){var c=this.createMarker(a,b,!0),d=this.createMarker(a,b,!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);a.setShadow(!1);a.setDashed(!1);null!=c&&(a.setFillColor(mxUtils.getValue(this.style,mxConstants.STYLE_STARTFILLCOLOR,this.stroke)),c());null!=d&&(a.setFillColor(mxUtils.getValue(this.style,mxConstants.STYLE_ENDFILLCOLOR,this.stroke)),d())}; mxConnector.prototype.createMarker=function(a,b,c){var d=null,e=b.length,f=mxUtils.getValue(this.style,c?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW),g=c?b[1]:b[e-2];b=c?b[0]:b[e-1];if(null!=f&&null!=g&&null!=b){d=b.x-g.x;e=b.y-g.y;var k=Math.sqrt(d*d+e*e);g=d/k;d=e/k;e=mxUtils.getNumber(this.style,c?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE);d=mxMarker.createMarker(a,this,f,b,g,d,e,c,this.strokewidth,0!=this.style[c?mxConstants.STYLE_STARTFILL: mxConstants.STYLE_ENDFILL])}return d}; mxConnector.prototype.augmentBoundingBox=function(a){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var b=0;mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(b=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)+1);mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(b=Math.max(b,mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE))+ 1);a.grow(b*this.scale)};function mxSwimlane(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxSwimlane,mxShape);mxSwimlane.prototype.imageSize=16;mxSwimlane.prototype.fixedHeaderDefault=!0;mxSwimlane.prototype.apply=function(a){mxShape.prototype.apply.apply(this,arguments);null!=this.style&&(this.laneFill=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE))};mxSwimlane.prototype.isRoundable=function(){return!0}; mxSwimlane.prototype.getTitleSize=function(){return Math.max(0,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE))};mxSwimlane.prototype.getFooterSize=function(){return Math.max(0,mxUtils.getValue(this.style,mxConstants.STYLE_FOOTER_SIZE,0))}; mxSwimlane.prototype.getLabelBounds=function(a){var b=this.getTitleSize(),c=mxUtils.getValue(this.style,mxConstants.STYLE_FIXED_HEADER,this.fixedHeaderDefault);if(0==b&&!c)return mxShape.prototype.getLabelBounds.apply(this,arguments);var d=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),e=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0);c=new mxRectangle(a.x,a.y,a.width,a.height);var f=this.isHorizontal(),g=this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH; f=f==!g;d=!f&&d!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST);e=f&&e!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST);if(g){b=Math.min(c.width,b*this.scale);if(d||e)c.x+=c.width-b;c.width=b}else{b=Math.min(c.height,b*this.scale);if(d||e)c.y+=c.height-b;c.height=b}return c}; mxSwimlane.prototype.getGradientBounds=function(a,b,c,d,e){a=this.getTitleSize();return this.isHorizontal()?new mxRectangle(b,c,d,Math.min(a,e)):new mxRectangle(b,c,Math.min(a,d),e)}; mxSwimlane.prototype.getSwimlaneArcSize=function(a,b,c){if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))return Math.min(a/2,Math.min(b/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;return c*a*3};mxSwimlane.prototype.isHorizontal=function(){return 1==mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)}; mxSwimlane.prototype.paintVertexShape=function(a,b,c,d,e){if(!this.outline){var f=this.getTitleSize(),g=mxUtils.getValue(this.style,mxConstants.STYLE_FIXED_HEADER,this.fixedHeaderDefault);if(0!=f||g){g=0;f=this.isHorizontal()?Math.min(f,e):Math.min(f,d);a.translate(b,c);this.isRounded?(g=this.getSwimlaneArcSize(d,e,f),g=Math.min((this.isHorizontal()?e:d)-f,Math.min(f,g)),this.paintRoundedSwimlane(a,b,c,d,e,f,g)):this.paintSwimlane(a,b,c,d,e,f);this.paintFooter(a,b,c,d,e,f,g);var k=mxUtils.getValue(this.style, mxConstants.STYLE_SEPARATORCOLOR,mxConstants.NONE);this.paintSeparator(a,b,c,d,e,f,k);null!=this.image&&(e=this.getImageBounds(b,c,d,e),k=mxUtils.getValue(this.style,mxConstants.STYLE_CLIP_PATH,null),a.image(e.x-b,e.y-c,e.width,e.height,this.image,!1,!1,!1,k));this.glass&&(a.setShadow(!1),this.paintGlassEffect(a,0,0,d,f,g))}}}; mxSwimlane.prototype.configurePointerEvents=function(a){var b=!0,c=!0,d=!0;null!=this.style&&(b="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"),c=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_HEAD,1),d=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_BODY,1));(b||c||d)&&mxShape.prototype.configurePointerEvents.apply(this,arguments)}; mxSwimlane.prototype.paintSwimlane=function(a,b,c,d,e,f){var g=this.laneFill,k=!0,l=!0,m=!0,n=!0;null!=this.style&&(k="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"),l=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),m=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_HEAD,1),n=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_BODY,1));this.isHorizontal()?(a.begin(),a.moveTo(0,f),a.lineTo(0,0),a.lineTo(d,0),a.lineTo(d,f),m?a.fillAndStroke(): a.fill(),f<e&&(g!=mxConstants.NONE&&k||(a.pointerEvents=!1),g!=mxConstants.NONE&&a.setFillColor(g),a.begin(),a.moveTo(0,f),a.lineTo(0,e),a.lineTo(d,e),a.lineTo(d,f),n?g==mxConstants.NONE?a.stroke():n&&a.fillAndStroke():g!=mxConstants.NONE&&a.fill())):(a.begin(),a.moveTo(f,0),a.lineTo(0,0),a.lineTo(0,e),a.lineTo(f,e),m?a.fillAndStroke():a.fill(),f<d&&(g!=mxConstants.NONE&&k||(a.pointerEvents=!1),g!=mxConstants.NONE&&a.setFillColor(g),a.begin(),a.moveTo(f,0),a.lineTo(d,0),a.lineTo(d,e),a.lineTo(f,e), n?g==mxConstants.NONE?a.stroke():n&&a.fillAndStroke():g!=mxConstants.NONE&&a.fill()));l&&this.paintDivider(a,b,c,d,e,f,g==mxConstants.NONE)}; mxSwimlane.prototype.paintRoundedSwimlane=function(a,b,c,d,e,f,g){var k=this.laneFill,l=!0,m=!0,n=!0,p=!0;null!=this.style&&(l="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"),m=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),n=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_HEAD,1),p=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_BODY,1));this.isHorizontal()?(a.begin(),a.moveTo(d,f),a.lineTo(d,g),a.quadTo(d,0,d-Math.min(d/2,g),0),a.lineTo(Math.min(d/ 2,g),0),a.quadTo(0,0,0,g),a.lineTo(0,f),n?a.fillAndStroke():a.fill(),f<e&&(k!=mxConstants.NONE&&l||(a.pointerEvents=!1),k!=mxConstants.NONE&&a.setFillColor(k),a.begin(),a.moveTo(0,f),a.lineTo(0,e-g),a.quadTo(0,e,Math.min(d/2,g),e),a.lineTo(d-Math.min(d/2,g),e),a.quadTo(d,e,d,e-g),a.lineTo(d,f),p?k==mxConstants.NONE?a.stroke():p&&a.fillAndStroke():k!=mxConstants.NONE&&a.fill())):(a.begin(),a.moveTo(f,0),a.lineTo(g,0),a.quadTo(0,0,0,Math.min(e/2,g)),a.lineTo(0,e-Math.min(e/2,g)),a.quadTo(0,e,g,e),a.lineTo(f, e),n?a.fillAndStroke():a.fill(),f<d&&(k!=mxConstants.NONE&&l||(a.pointerEvents=!1),k!=mxConstants.NONE&&a.setFillColor(k),a.begin(),a.moveTo(f,e),a.lineTo(d-g,e),a.quadTo(d,e,d,e-Math.min(e/2,g)),a.lineTo(d,Math.min(e/2,g)),a.quadTo(d,0,d-g,0),a.lineTo(f,0),p?k==mxConstants.NONE?a.stroke():p&&a.fillAndStroke():k!=mxConstants.NONE&&a.fill()));m&&this.paintDivider(a,b,c,d,e,f,k==mxConstants.NONE)}; mxSwimlane.prototype.paintFooter=function(a,b,c,d,e,f,g){b=this.getFooterSize();c=this.isHorizontal();b=Math.min(b,(c?e:d)-f);if(!(0>=b)){f=this.fill;null!=f&&f!=mxConstants.NONE&&a.setFillColor(f);a.setShadow(!1);a.begin();if(c)if(c=Math.min(d/2,g),b>=g)a.moveTo(0,e-b),a.lineTo(0,e-g),a.quadTo(0,e,c,e),a.lineTo(d-c,e),a.quadTo(d,e,d,e-g),a.lineTo(d,e-b);else{g=1-Math.sqrt(b/g);var k=c*g*g;g*=c;a.moveTo(k,e-b);a.quadTo(g,e,c,e);a.lineTo(d-c,e);a.quadTo(d-g,e,d-k,e-b)}else c=Math.min(e/2,g),b>=g?(a.moveTo(d- b,0),a.lineTo(d-g,0),a.quadTo(d,0,d,c),a.lineTo(d,e-c),a.quadTo(d,e,d-g,e),a.lineTo(d-b,e)):(g=1-Math.sqrt(b/g),k=c*g*g,g*=c,a.moveTo(d-b,k),a.quadTo(d,g,d,c),a.lineTo(d,e-c),a.quadTo(d,e-g,d-b,e-k));a.close();null!=f&&f!=mxConstants.NONE?a.fillAndStroke():a.stroke()}};mxSwimlane.prototype.paintDivider=function(a,b,c,d,e,f,g){0!=f&&(g||a.setShadow(!1),a.begin(),this.isHorizontal()?(a.moveTo(0,f),a.lineTo(d,f)):(a.moveTo(f,0),a.lineTo(f,e)),a.stroke())}; mxSwimlane.prototype.paintSeparator=function(a,b,c,d,e,f,g){g!=mxConstants.NONE&&(a.setStrokeColor(g),a.setDashed(!0),a.begin(),this.isHorizontal()?(a.moveTo(d,f),a.lineTo(d,e)):(a.moveTo(f,0),a.lineTo(d,0)),a.stroke(),a.setDashed(!1))};mxSwimlane.prototype.getImageBounds=function(a,b,c,d){return this.isHorizontal()?new mxRectangle(a+c-this.imageSize,b,this.imageSize,this.imageSize):new mxRectangle(a,b,this.imageSize,this.imageSize)};function mxGraphLayout(a){this.graph=a} mxGraphLayout.prototype.graph=null;mxGraphLayout.prototype.useBoundingBox=!0;mxGraphLayout.prototype.parent=null;mxGraphLayout.prototype.moveCell=function(a,b,c){};mxGraphLayout.prototype.resizeCell=function(a,b){};mxGraphLayout.prototype.execute=function(a){};mxGraphLayout.prototype.getGraph=function(){return this.graph};mxGraphLayout.prototype.getConstraint=function(a,b,c,d){return this.graph.getCurrentCellStyle(b)[a]}; mxGraphLayout.traverse=function(a,b,c,d,e){if(null!=c&&null!=a&&(b=null!=b?b:!0,e=e||new mxDictionary,!e.get(a)&&(e.put(a,!0),d=c(a,d),null==d||d))&&(d=this.graph.model.getEdgeCount(a),0<d))for(var f=0;f<d;f++){var g=this.graph.model.getEdgeAt(a,f),k=this.graph.model.getTerminal(g,!0)==a;if(!b||k)k=this.graph.view.getVisibleTerminal(g,!k),this.traverse(k,b,c,g,e)}}; mxGraphLayout.prototype.isAncestor=function(a,b,c){if(!c)return this.graph.model.getParent(b)==a;if(b==a)return!1;for(;null!=b&&b!=a;)b=this.graph.model.getParent(b);return b==a};mxGraphLayout.prototype.isVertexMovable=function(a){return this.graph.isCellMovable(a)};mxGraphLayout.prototype.isVertexIgnored=function(a){return!this.graph.getModel().isVertex(a)||!this.graph.getModel().isVisible(a)}; mxGraphLayout.prototype.isEdgeIgnored=function(a){var b=this.graph.getModel();return!b.isEdge(a)||!this.graph.getModel().isVisible(a)||null==b.getTerminal(a,!0)||null==b.getTerminal(a,!1)};mxGraphLayout.prototype.setEdgeStyleEnabled=function(a,b){this.graph.setCellStyles(mxConstants.STYLE_NOEDGESTYLE,b?"0":"1",[a])};mxGraphLayout.prototype.setOrthogonalEdge=function(a,b){this.graph.setCellStyles(mxConstants.STYLE_ORTHOGONAL,b?"1":"0",[a])}; mxGraphLayout.prototype.getParentOffset=function(a){var b=new mxPoint;if(null!=a&&a!=this.parent){var c=this.graph.getModel();if(c.isAncestor(this.parent,a))for(var d=c.getGeometry(a);a!=this.parent;)b.x+=d.x,b.y+=d.y,a=c.getParent(a),d=c.getGeometry(a)}return b}; mxGraphLayout.prototype.setEdgePoints=function(a,b){if(null!=a){var c=this.graph.model,d=c.getGeometry(a);null==d?(d=new mxGeometry,d.setRelative(!0)):d=d.clone();if(null!=this.parent&&null!=b){var e=c.getParent(a);e=this.getParentOffset(e);for(var f=0;f<b.length;f++)b[f].x-=e.x,b[f].y-=e.y}d.points=b;c.setGeometry(a,d)}}; mxGraphLayout.prototype.setVertexLocation=function(a,b,c){var d=this.graph.getModel(),e=d.getGeometry(a),f=null;if(null!=e){f=new mxRectangle(b,c,e.width,e.height);if(this.useBoundingBox){var g=this.graph.getView().getState(a);if(null!=g&&null!=g.text&&null!=g.text.boundingBox){var k=this.graph.getView().scale,l=g.text.boundingBox;g.text.boundingBox.x<g.x&&(b+=(g.x-l.x)/k,f.width=l.width);g.text.boundingBox.y<g.y&&(c+=(g.y-l.y)/k,f.height=l.height)}}null!=this.parent&&(g=d.getParent(a),null!=g&&g!= this.parent&&(g=this.getParentOffset(g),b-=g.x,c-=g.y));if(e.x!=b||e.y!=c)e=e.clone(),e.x=b,e.y=c,d.setGeometry(a,e)}return f}; mxGraphLayout.prototype.getVertexBounds=function(a){var b=this.graph.getModel().getGeometry(a);if(this.useBoundingBox){var c=this.graph.getView().getState(a);if(null!=c&&null!=c.text&&null!=c.text.boundingBox){var d=this.graph.getView().scale,e=c.text.boundingBox,f=Math.max(c.x-e.x,0)/d,g=Math.max(c.y-e.y,0)/d;b=new mxRectangle(b.x-f,b.y-g,b.width+f+Math.max(e.x+e.width-(c.x+c.width),0)/d,b.height+g+Math.max(e.y+e.height-(c.y+c.height),0)/d)}}null!=this.parent&&(a=this.graph.getModel().getParent(a), b=b.clone(),null!=a&&a!=this.parent&&(a=this.getParentOffset(a),b.x+=a.x,b.y+=a.y));return new mxRectangle(b.x,b.y,b.width,b.height)};mxGraphLayout.prototype.arrangeGroups=function(a,b,c,d,e,f){return this.graph.updateGroupBounds(a,b,!0,c,d,e,f)};function WeightedCellSorter(a,b){this.cell=a;this.weightedValue=b}WeightedCellSorter.prototype.weightedValue=0;WeightedCellSorter.prototype.nudge=!1;WeightedCellSorter.prototype.visited=!1;WeightedCellSorter.prototype.rankIndex=null; WeightedCellSorter.prototype.cell=null;WeightedCellSorter.prototype.compare=function(a,b){return null!=a&&null!=b?b.weightedValue>a.weightedValue?-1:b.weightedValue<a.weightedValue?1:b.nudge?-1:1:0};function mxStackLayout(a,b,c,d,e,f){mxGraphLayout.call(this,a);this.horizontal=null!=b?b:!0;this.spacing=null!=c?c:0;this.x0=null!=d?d:0;this.y0=null!=e?e:0;this.border=null!=f?f:0}mxStackLayout.prototype=new mxGraphLayout;mxStackLayout.prototype.constructor=mxStackLayout; mxStackLayout.prototype.horizontal=null;mxStackLayout.prototype.spacing=null;mxStackLayout.prototype.x0=null;mxStackLayout.prototype.y0=null;mxStackLayout.prototype.border=0;mxStackLayout.prototype.marginTop=0;mxStackLayout.prototype.marginLeft=0;mxStackLayout.prototype.marginRight=0;mxStackLayout.prototype.marginBottom=0;mxStackLayout.prototype.keepFirstLocation=!1;mxStackLayout.prototype.fill=!1;mxStackLayout.prototype.resizeParent=!1;mxStackLayout.prototype.resizeParentMax=!1; mxStackLayout.prototype.resizeLast=!1;mxStackLayout.prototype.wrap=null;mxStackLayout.prototype.borderCollapse=!0;mxStackLayout.prototype.allowGaps=!1;mxStackLayout.prototype.gridSize=0;mxStackLayout.prototype.isHorizontal=function(){return this.horizontal}; mxStackLayout.prototype.moveCell=function(a,b,c){var d=this.graph.getModel(),e=d.getParent(a),f=this.isHorizontal();if(null!=a&&null!=e){var g=0,k=d.getChildCount(e);c=f?b:c;b=this.graph.getView().getState(e);null!=b&&(c-=f?b.x:b.y);c/=this.graph.view.scale;for(b=0;b<k;b++){var l=d.getChildAt(e,b);if(l!=a&&(l=d.getGeometry(l),null!=l)){l=f?l.x+l.width/2:l.y+l.height/2;if(g<=c&&l>c)break;g=l}}f=e.getIndex(a);f=Math.max(0,b-(b>f?1:0));d.add(e,a,f)}}; mxStackLayout.prototype.getParentSize=function(a){var b=this.graph.getModel(),c=b.getGeometry(a);null!=this.graph.container&&(null==c&&b.isLayer(a)||a==this.graph.getView().currentRoot)&&(c=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));return c}; mxStackLayout.prototype.getLayoutCells=function(a){for(var b=this.graph.getModel(),c=b.getChildCount(a),d=[],e=0;e<c;e++){var f=b.getChildAt(a,e);!this.isVertexIgnored(f)&&this.isVertexMovable(f)&&d.push(f)}this.allowGaps&&d.sort(mxUtils.bind(this,function(g,k){g=this.graph.getCellGeometry(g);k=this.graph.getCellGeometry(k);return this.horizontal?g.x==k.x?0:g.x>k.x>0?1:-1:g.y==k.y?0:g.y>k.y>0?1:-1}));return d}; mxStackLayout.prototype.snap=function(a){if(null!=this.gridSize&&0<this.gridSize&&(a=Math.max(a,this.gridSize),1<a/this.gridSize)){var b=a%this.gridSize;a+=b>this.gridSize/2?this.gridSize-b:-b}return a}; mxStackLayout.prototype.execute=function(a){if(null!=a){var b=this.getParentSize(a),c=this.isHorizontal(),d=this.graph.getModel(),e=null;null!=b&&(e=c?b.height-this.marginTop-this.marginBottom:b.width-this.marginLeft-this.marginRight);e-=2*this.border;var f=this.x0+this.border+this.marginLeft,g=this.y0+this.border+this.marginTop,k=this.graph.getActualStartSize(a,!0);null!=b&&(k.x=Math.min(k.x,b.width),k.y=Math.min(k.y,b.height),k.width=Math.min(k.width,b.width),k.height=Math.min(k.height,b.height)); var l=this.graph.getActualFooterSize(a,!0);e=c?e-(k.y+k.height+l.y+l.height):e-(k.x+k.width+l.x+l.width);f+=k.x+l.x;g+=k.y+l.y;d.beginUpdate();try{for(var m=0,n=null,p=0,q=null,r=this.getLayoutCells(a),t=0;t<r.length;t++){var u=r[t],v=d.getGeometry(u);if(null!=v){v=v.clone();null!=this.wrap&&null!=n&&(c&&n.x+n.width+v.width+2*this.spacing>this.wrap||!c&&n.y+n.height+v.height+2*this.spacing>this.wrap)&&(n=null,c?g+=m+this.spacing:f+=m+this.spacing,m=0);m=Math.max(m,c?v.height:v.width);var y=0;if(!this.borderCollapse){var A= this.graph.getCellStyle(u);y=mxUtils.getNumber(A,mxConstants.STYLE_STROKEWIDTH,1)}if(null!=n){var z=p+this.spacing+Math.floor(y/2);c?v.x=this.snap((this.allowGaps?Math.max(z,v.x):z)-this.marginLeft)+this.marginLeft:v.y=this.snap((this.allowGaps?Math.max(z,v.y):z)-this.marginTop)+this.marginTop}else this.keepFirstLocation||(c?v.x=this.allowGaps&&v.x>f?Math.max(this.snap(v.x-this.marginLeft)+this.marginLeft,f):f:v.y=this.allowGaps&&v.y>g?Math.max(this.snap(v.y-this.marginTop)+this.marginTop,g):g);c? v.y=g:v.x=f;this.fill&&null!=e&&(c?v.height=e:v.width=e);c?v.width=this.snap(v.width):v.height=this.snap(v.height);this.setChildGeometry(u,v);q=u;n=v;p=c?n.x+n.width+Math.floor(y/2):n.y+n.height+Math.floor(y/2)}}this.resizeParent&&null!=b&&null!=n&&!this.graph.isCellCollapsed(a)?this.updateParentGeometry(a,b,n):this.resizeLast&&null!=b&&null!=n&&null!=q&&(c?n.width=b.width-n.x-this.spacing-this.marginRight-this.marginLeft-k.width-l.width:n.height=b.height-n.y-this.spacing-this.marginBottom-k.height- l.height,this.setChildGeometry(q,n))}finally{d.endUpdate()}}};mxStackLayout.prototype.setChildGeometry=function(a,b){var c=this.graph.getCellGeometry(a);null!=c&&b.x==c.x&&b.y==c.y&&b.width==c.width&&b.height==c.height||this.graph.getModel().setGeometry(a,b)}; mxStackLayout.prototype.updateParentGeometry=function(a,b,c){var d=this.isHorizontal(),e=this.graph.getModel(),f=this.graph.getActualStartSize(a,!0),g=this.graph.getActualFooterSize(a,!0),k=b.clone();d?(c=c.x+c.width+this.marginRight+this.border+f.width+g.width,k.width=this.resizeParentMax?Math.max(k.width,c):c):(c=c.y+c.height+this.marginBottom+this.border+f.height+g.height,k.height=this.resizeParentMax?Math.max(k.height,c):c);b.x==k.x&&b.y==k.y&&b.width==k.width&&b.height==k.height||e.setGeometry(a, k)};function mxPartitionLayout(a,b,c,d){mxGraphLayout.call(this,a);this.horizontal=null!=b?b:!0;this.spacing=c||0;this.border=d||0}mxPartitionLayout.prototype=new mxGraphLayout;mxPartitionLayout.prototype.constructor=mxPartitionLayout;mxPartitionLayout.prototype.horizontal=null;mxPartitionLayout.prototype.spacing=null;mxPartitionLayout.prototype.border=null;mxPartitionLayout.prototype.resizeVertices=!0;mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal}; mxPartitionLayout.prototype.moveCell=function(a,b,c){c=this.graph.getModel();var d=c.getParent(a);if(null!=a&&null!=d){var e,f=0,g=c.getChildCount(d);for(e=0;e<g;e++){var k=c.getChildAt(d,e);k=this.getVertexBounds(k);if(null!=k){k=k.x+k.width/2;if(f<b&&k>b)break;f=k}}b=d.getIndex(a);b=Math.max(0,e-(e>b?1:0));c.add(d,a,b)}}; mxPartitionLayout.prototype.execute=function(a){var b=this.isHorizontal(),c=this.graph.getModel(),d=c.getGeometry(a);null!=this.graph.container&&(null==d&&c.isLayer(a)||a==this.graph.getView().currentRoot)&&(d=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));if(null!=d){for(var e=[],f=c.getChildCount(a),g=0;g<f;g++){var k=c.getChildAt(a,g);!this.isVertexIgnored(k)&&this.isVertexMovable(k)&&e.push(k)}f=e.length;if(0<f){var l=this.border,m=this.border,n=b? d.height:d.width;n-=2*this.border;a=this.graph.isSwimlane(a)?this.graph.getStartSize(a):new mxRectangle;n-=b?a.height:a.width;l+=a.width;m+=a.height;a=this.border+(f-1)*this.spacing;d=b?(d.width-l-a)/f:(d.height-m-a)/f;if(0<d){c.beginUpdate();try{for(g=0;g<f;g++){k=e[g];var p=c.getGeometry(k);null!=p&&(p=p.clone(),p.x=l,p.y=m,b?(this.resizeVertices&&(p.width=d,p.height=n),l+=d+this.spacing):(this.resizeVertices&&(p.height=d,p.width=n),m+=d+this.spacing),c.setGeometry(k,p))}}finally{c.endUpdate()}}}}}; function mxCompactTreeLayout(a,b,c){mxGraphLayout.call(this,a);this.horizontal=null!=b?b:!0;this.invert=null!=c?c:!1}mxCompactTreeLayout.prototype=new mxGraphLayout;mxCompactTreeLayout.prototype.constructor=mxCompactTreeLayout;mxCompactTreeLayout.prototype.horizontal=null;mxCompactTreeLayout.prototype.invert=null;mxCompactTreeLayout.prototype.resizeParent=!0;mxCompactTreeLayout.prototype.maintainParentLocation=!1;mxCompactTreeLayout.prototype.groupPadding=10; mxCompactTreeLayout.prototype.groupPaddingTop=0;mxCompactTreeLayout.prototype.groupPaddingRight=0;mxCompactTreeLayout.prototype.groupPaddingBottom=0;mxCompactTreeLayout.prototype.groupPaddingLeft=0;mxCompactTreeLayout.prototype.parentsChanged=null;mxCompactTreeLayout.prototype.moveTree=!1;mxCompactTreeLayout.prototype.visited=null;mxCompactTreeLayout.prototype.levelDistance=10;mxCompactTreeLayout.prototype.nodeDistance=20;mxCompactTreeLayout.prototype.resetEdges=!0; mxCompactTreeLayout.prototype.prefHozEdgeSep=5;mxCompactTreeLayout.prototype.prefVertEdgeOff=4;mxCompactTreeLayout.prototype.minEdgeJetty=8;mxCompactTreeLayout.prototype.channelBuffer=4;mxCompactTreeLayout.prototype.edgeRouting=!0;mxCompactTreeLayout.prototype.sortEdges=!1;mxCompactTreeLayout.prototype.alignRanks=!1;mxCompactTreeLayout.prototype.maxRankHeight=null;mxCompactTreeLayout.prototype.root=null;mxCompactTreeLayout.prototype.node=null; mxCompactTreeLayout.prototype.isVertexIgnored=function(a){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(a).length};mxCompactTreeLayout.prototype.isHorizontal=function(){return this.horizontal}; mxCompactTreeLayout.prototype.execute=function(a,b){this.parent=a;var c=this.graph.getModel();if(null==b)if(0<this.graph.getEdges(a,c.getParent(a),this.invert,!this.invert,!1).length)this.root=a;else{if(b=this.graph.findTreeRoots(a,!0,this.invert),0<b.length)for(var d=0;d<b.length;d++)if(!this.isVertexIgnored(b[d])&&0<this.graph.getEdges(b[d],null,this.invert,!this.invert,!1).length){this.root=b[d];break}}else this.root=b;if(null!=this.root){this.parentsChanged=this.resizeParent?{}:null;this.parentY= this.parentX=null;if(a!=this.root&&null!=c.isVertex(a)&&this.maintainParentLocation){var e=this.graph.getCellGeometry(a);null!=e&&(this.parentX=e.x,this.parentY=e.y)}c.beginUpdate();try{if(this.visited={},this.node=this.dfs(this.root,a),this.alignRanks&&(this.maxRankHeight=[],this.findRankHeights(this.node,0),this.setCellHeights(this.node,0)),null!=this.node){this.layout(this.node);var f=this.graph.gridSize;b=f;if(!this.moveTree){var g=this.getVertexBounds(this.root);null!=g&&(f=g.x,b=g.y)}g=null; g=this.isHorizontal()?this.horizontalLayout(this.node,f,b):this.verticalLayout(this.node,null,f,b);if(null!=g){var k=d=0;0>g.x&&(d=Math.abs(f-g.x));0>g.y&&(k=Math.abs(b-g.y));0==d&&0==k||this.moveNode(this.node,d,k);this.resizeParent&&this.adjustParents();this.edgeRouting&&this.localEdgeProcessing(this.node)}null!=this.parentX&&null!=this.parentY&&(e=this.graph.getCellGeometry(a),null!=e&&(e=e.clone(),e.x=this.parentX,e.y=this.parentY,c.setGeometry(a,e)))}}finally{c.endUpdate()}}}; mxCompactTreeLayout.prototype.moveNode=function(a,b,c){a.x+=b;a.y+=c;this.apply(a);for(a=a.child;null!=a;)this.moveNode(a,b,c),a=a.next}; mxCompactTreeLayout.prototype.sortOutgoingEdges=function(a,b){var c=new mxDictionary;b.sort(function(d,e){var f=d.getTerminal(d.getTerminal(!1)==a);d=c.get(f);null==d&&(d=mxCellPath.create(f).split(mxCellPath.PATH_SEPARATOR),c.put(f,d));e=e.getTerminal(e.getTerminal(!1)==a);f=c.get(e);null==f&&(f=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),c.put(e,f));return mxCellPath.compare(d,f)})}; mxCompactTreeLayout.prototype.findRankHeights=function(a,b){if(null==this.maxRankHeight[b]||this.maxRankHeight[b]<a.height)this.maxRankHeight[b]=a.height;for(a=a.child;null!=a;)this.findRankHeights(a,b+1),a=a.next};mxCompactTreeLayout.prototype.setCellHeights=function(a,b){null!=this.maxRankHeight[b]&&this.maxRankHeight[b]>a.height&&(a.height=this.maxRankHeight[b]);for(a=a.child;null!=a;)this.setCellHeights(a,b+1),a=a.next}; mxCompactTreeLayout.prototype.dfs=function(a,b){var c=mxCellPath.create(a),d=null;if(null!=a&&null==this.visited[c]&&!this.isVertexIgnored(a)){this.visited[c]=a;d=this.createNode(a);c=this.graph.getModel();var e=null,f=this.graph.getEdges(a,b,this.invert,!this.invert,!1,!0),g=this.graph.getView();this.sortEdges&&this.sortOutgoingEdges(a,f);for(a=0;a<f.length;a++){var k=f[a];if(!this.isEdgeIgnored(k)){this.resetEdges&&this.setEdgePoints(k,null);this.edgeRouting&&(this.setEdgeStyleEnabled(k,!1),this.setEdgePoints(k, null));var l=g.getState(k);k=null!=l?l.getVisibleTerminal(this.invert):g.getVisibleTerminal(k,this.invert);l=this.dfs(k,b);null!=l&&null!=c.getGeometry(k)&&(null==e?d.child=l:e.next=l,e=l)}}}return d};mxCompactTreeLayout.prototype.layout=function(a){if(null!=a){for(var b=a.child;null!=b;)this.layout(b),b=b.next;null!=a.child?this.attachParent(a,this.join(a)):this.layoutLeaf(a)}}; mxCompactTreeLayout.prototype.horizontalLayout=function(a,b,c,d){a.x+=b+a.offsetX;a.y+=c+a.offsetY;d=this.apply(a,d);b=a.child;if(null!=b){d=this.horizontalLayout(b,a.x,a.y,d);c=a.y+b.offsetY;for(var e=b.next;null!=e;)d=this.horizontalLayout(e,a.x+b.offsetX,c,d),c+=e.offsetY,e=e.next}return d}; mxCompactTreeLayout.prototype.verticalLayout=function(a,b,c,d,e){a.x+=c+a.offsetY;a.y+=d+a.offsetX;e=this.apply(a,e);b=a.child;if(null!=b)for(e=this.verticalLayout(b,a,a.x,a.y,e),c=a.x+b.offsetY,d=b.next;null!=d;)e=this.verticalLayout(d,a,c,a.y+b.offsetX,e),c+=d.offsetY,d=d.next;return e}; mxCompactTreeLayout.prototype.attachParent=function(a,b){var c=this.nodeDistance+this.levelDistance,d=(b-a.width)/2-this.nodeDistance;b=d+a.width+2*this.nodeDistance-b;a.child.offsetX=c+a.height;a.child.offsetY=b;a.contour.upperHead=this.createLine(a.height,0,this.createLine(c,b,a.contour.upperHead));a.contour.lowerHead=this.createLine(a.height,0,this.createLine(c,d,a.contour.lowerHead))}; mxCompactTreeLayout.prototype.layoutLeaf=function(a){var b=2*this.nodeDistance;a.contour.upperTail=this.createLine(a.height+b,0);a.contour.upperHead=a.contour.upperTail;a.contour.lowerTail=this.createLine(0,-a.width-b);a.contour.lowerHead=this.createLine(a.height+b,0,a.contour.lowerTail)}; mxCompactTreeLayout.prototype.join=function(a){var b=2*this.nodeDistance,c=a.child;a.contour=c.contour;var d=c.width+b,e=d;for(c=c.next;null!=c;){var f=this.merge(a.contour,c.contour);c.offsetY=f+d;c.offsetX=0;d=c.width+b;e+=f+d;c=c.next}return e}; mxCompactTreeLayout.prototype.merge=function(a,b){for(var c=0,d=0,e=0,f=a.lowerHead,g=b.upperHead;null!=g&&null!=f;){var k=this.offset(c,d,g.dx,g.dy,f.dx,f.dy);d+=k;e+=k;c+g.dx<=f.dx?(c+=g.dx,d+=g.dy,g=g.next):(c-=f.dx,d-=f.dy,f=f.next)}null!=g?(c=this.bridge(a.upperTail,0,0,g,c,d),a.upperTail=null!=c.next?b.upperTail:c,a.lowerTail=b.lowerTail):(c=this.bridge(b.lowerTail,c,d,f,0,0),null==c.next&&(a.lowerTail=c));a.lowerHead=b.lowerHead;return e}; mxCompactTreeLayout.prototype.offset=function(a,b,c,d,e,f){if(e<=a||0>=a+c)return 0;a=0<e*d-c*f?0>a?a*d/c-b:0<a?a*f/e-b:-b:e<a+c?f-(b+(e-a)*d/c):e>a+c?(c+a)*f/e-(b+d):f-(b+d);return 0<a?a:0};mxCompactTreeLayout.prototype.bridge=function(a,b,c,d,e,f){b=e+d.dx-b;0==d.dx?e=d.dy:(e=b*d.dy,e/=d.dx);b=this.createLine(b,e,d.next);a.next=this.createLine(0,f+d.dy-e-c,b);return b}; mxCompactTreeLayout.prototype.createNode=function(a){var b={};b.cell=a;b.x=0;b.y=0;b.width=0;b.height=0;a=this.getVertexBounds(a);null!=a&&(this.isHorizontal()?(b.width=a.height,b.height=a.width):(b.width=a.width,b.height=a.height));b.offsetX=0;b.offsetY=0;b.contour={};return b}; mxCompactTreeLayout.prototype.apply=function(a,b){var c=this.graph.getModel(),d=a.cell,e=c.getGeometry(d);null!=d&&null!=e&&(this.isVertexMovable(d)&&(e=this.setVertexLocation(d,a.x,a.y),this.resizeParent&&(a=c.getParent(d),c=mxCellPath.create(a),null==this.parentsChanged[c]&&(this.parentsChanged[c]=a))),b=null==b?new mxRectangle(e.x,e.y,e.width,e.height):new mxRectangle(Math.min(b.x,e.x),Math.min(b.y,e.y),Math.max(b.x+b.width,e.x+e.width),Math.max(b.y+b.height,e.y+e.height)));return b}; mxCompactTreeLayout.prototype.createLine=function(a,b,c){var d={};d.dx=a;d.dy=b;d.next=c;return d};mxCompactTreeLayout.prototype.adjustParents=function(){var a=[],b;for(b in this.parentsChanged)a.push(this.parentsChanged[b]);this.arrangeGroups(mxUtils.sortCells(a,!0),this.groupPadding,this.groupPaddingTop,this.groupPaddingRight,this.groupPaddingBottom,this.groupPaddingLeft)}; mxCompactTreeLayout.prototype.localEdgeProcessing=function(a){this.processNodeOutgoing(a);for(a=a.child;null!=a;)this.localEdgeProcessing(a),a=a.next}; mxCompactTreeLayout.prototype.processNodeOutgoing=function(a){for(var b=a.child,c=a.cell,d=0,e=[];null!=b;){d++;var f=b.x;this.horizontal&&(f=b.y);e.push(new WeightedCellSorter(b,f));b=b.next}e.sort(WeightedCellSorter.prototype.compare);f=a.width;var g=(d+1)*this.prefHozEdgeSep;f>g+2*this.prefHozEdgeSep&&(f-=2*this.prefHozEdgeSep);a=f/d;b=a/2;f>g+2*this.prefHozEdgeSep&&(b+=this.prefHozEdgeSep);f=this.minEdgeJetty-this.prefVertEdgeOff;g=this.getVertexBounds(c);for(var k=0;k<e.length;k++){var l=e[k].cell.cell, m=this.getVertexBounds(l);l=this.graph.getEdgesBetween(c,l,!1);for(var n=[],p,q,r=0;r<l.length;r++)this.horizontal?(p=g.x+g.width,q=g.y+b,n.push(new mxPoint(p,q)),p=g.x+g.width+f,n.push(new mxPoint(p,q)),q=m.y+m.height/2):(p=g.x+b,q=g.y+g.height,n.push(new mxPoint(p,q)),q=g.y+g.height+f,n.push(new mxPoint(p,q)),p=m.x+m.width/2),n.push(new mxPoint(p,q)),this.setEdgePoints(l[r],n);k<d/2?f+=this.prefVertEdgeOff:k>d/2&&(f-=this.prefVertEdgeOff);b+=a}}; function mxRadialTreeLayout(a){mxCompactTreeLayout.call(this,a,!1)}mxUtils.extend(mxRadialTreeLayout,mxCompactTreeLayout);mxRadialTreeLayout.prototype.angleOffset=.5;mxRadialTreeLayout.prototype.rootx=0;mxRadialTreeLayout.prototype.rooty=0;mxRadialTreeLayout.prototype.levelDistance=120;mxRadialTreeLayout.prototype.nodeDistance=10;mxRadialTreeLayout.prototype.autoRadius=!1;mxRadialTreeLayout.prototype.sortEdges=!1;mxRadialTreeLayout.prototype.rowMinX=[];mxRadialTreeLayout.prototype.rowMaxX=[]; mxRadialTreeLayout.prototype.rowMinCenX=[];mxRadialTreeLayout.prototype.rowMaxCenX=[];mxRadialTreeLayout.prototype.rowRadi=[];mxRadialTreeLayout.prototype.row=[];mxRadialTreeLayout.prototype.isVertexIgnored=function(a){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(a).length}; mxRadialTreeLayout.prototype.execute=function(a,b){this.parent=a;this.edgeRouting=this.useBoundingBox=!1;mxCompactTreeLayout.prototype.execute.apply(this,arguments);var c=null,d=this.getVertexBounds(this.root);this.centerX=d.x+d.width/2;this.centerY=d.y+d.height/2;for(var e in this.visited){var f=this.getVertexBounds(this.visited[e]);c=null!=c?c:f.clone();c.add(f)}this.calcRowDims([this.node],0);var g=0,k=0;for(c=0;c<this.row.length;c++)e=(this.rowMaxX[c]-this.centerX-this.nodeDistance)/this.rowRadi[c], g=Math.max(g,(this.centerX-this.rowMinX[c]-this.nodeDistance)/this.rowRadi[c]),k=Math.max(k,e);for(c=0;c<this.row.length;c++){var l=this.centerX-this.nodeDistance-g*this.rowRadi[c],m=this.centerX+this.nodeDistance+k*this.rowRadi[c]-l;for(e=0;e<this.row[c].length;e++)f=this.row[c],d=f[e],f=this.getVertexBounds(d.cell),d.theta=(f.x+f.width/2-l)/m*Math.PI*2}for(c=this.row.length-2;0<=c;c--)for(f=this.row[c],e=0;e<f.length;e++){d=f[e];g=d.child;for(l=k=0;null!=g;)l+=g.theta,k++,g=g.next;0<k&&(g=l/k,g> d.theta&&e<f.length-1?d.theta=Math.min(g,f[e+1].theta-Math.PI/10):g<d.theta&&0<e&&(d.theta=Math.max(g,f[e-1].theta+Math.PI/10)))}for(c=0;c<this.row.length;c++)for(e=0;e<this.row[c].length;e++)f=this.row[c],d=f[e],f=this.getVertexBounds(d.cell),this.setVertexLocation(d.cell,this.centerX-f.width/2+this.rowRadi[c]*Math.cos(d.theta),this.centerY-f.height/2+this.rowRadi[c]*Math.sin(d.theta))}; mxRadialTreeLayout.prototype.calcRowDims=function(a,b){if(null!=a&&0!=a.length){this.rowMinX[b]=this.centerX;this.rowMaxX[b]=this.centerX;this.rowMinCenX[b]=this.centerX;this.rowMaxCenX[b]=this.centerX;this.row[b]=[];for(var c=!1,d=0;d<a.length;d++)for(var e=null!=a[d]?a[d].child:null;null!=e;){var f=this.getVertexBounds(e.cell);this.rowMinX[b]=Math.min(f.x,this.rowMinX[b]);this.rowMaxX[b]=Math.max(f.x+f.width,this.rowMaxX[b]);this.rowMinCenX[b]=Math.min(f.x+f.width/2,this.rowMinCenX[b]);this.rowMaxCenX[b]= Math.max(f.x+f.width/2,this.rowMaxCenX[b]);this.rowRadi[b]=f.y-this.getVertexBounds(this.root).y;null!=e.child&&(c=!0);this.row[b].push(e);e=e.next}c&&this.calcRowDims(this.row[b],b+1)}};function mxFastOrganicLayout(a){mxGraphLayout.call(this,a)}mxFastOrganicLayout.prototype=new mxGraphLayout;mxFastOrganicLayout.prototype.constructor=mxFastOrganicLayout;mxFastOrganicLayout.prototype.useInputOrigin=!0;mxFastOrganicLayout.prototype.resetEdges=!0;mxFastOrganicLayout.prototype.disableEdgeStyle=!0; mxFastOrganicLayout.prototype.forceConstant=50;mxFastOrganicLayout.prototype.forceConstantSquared=0;mxFastOrganicLayout.prototype.minDistanceLimit=2;mxFastOrganicLayout.prototype.maxDistanceLimit=500;mxFastOrganicLayout.prototype.minDistanceLimitSquared=4;mxFastOrganicLayout.prototype.initialTemp=200;mxFastOrganicLayout.prototype.temperature=0;mxFastOrganicLayout.prototype.maxIterations=0;mxFastOrganicLayout.prototype.iteration=0;mxFastOrganicLayout.prototype.allowedToRun=!0; mxFastOrganicLayout.prototype.isVertexIgnored=function(a){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(a).length}; mxFastOrganicLayout.prototype.execute=function(a){var b=this.graph.getModel();this.vertexArray=[];for(var c=this.graph.getChildVertices(a),d=0;d<c.length;d++)this.isVertexIgnored(c[d])||this.vertexArray.push(c[d]);var e=this.useInputOrigin?this.graph.getBoundingBoxFromGeometry(this.vertexArray):null,f=this.vertexArray.length;this.indices=[];this.dispX=[];this.dispY=[];this.cellLocation=[];this.isMoveable=[];this.neighbours=[];this.radius=[];this.radiusSquared=[];.001>this.forceConstant&&(this.forceConstant= .001);this.forceConstantSquared=this.forceConstant*this.forceConstant;for(d=0;d<this.vertexArray.length;d++){var g=this.vertexArray[d];this.cellLocation[d]=[];var k=mxObjectIdentity.get(g);this.indices[k]=d;var l=this.getVertexBounds(g),m=l.width,n=l.height,p=l.x,q=l.y;this.cellLocation[d][0]=p+m/2;this.cellLocation[d][1]=q+n/2;this.radius[d]=Math.min(m,n);this.radiusSquared[d]=this.radius[d]*this.radius[d]}b.beginUpdate();try{for(d=0;d<f;d++){this.dispX[d]=0;this.dispY[d]=0;this.isMoveable[d]=this.isVertexMovable(this.vertexArray[d]); var r=this.graph.getConnections(this.vertexArray[d],a);c=this.graph.getOpposites(r,this.vertexArray[d]);this.neighbours[d]=[];for(m=0;m<c.length;m++){this.resetEdges&&this.graph.resetEdge(r[m]);this.disableEdgeStyle&&this.setEdgeStyleEnabled(r[m],!1);k=mxObjectIdentity.get(c[m]);var t=this.indices[k];this.neighbours[d][m]=null!=t?t:d}}this.temperature=this.initialTemp;0==this.maxIterations&&(this.maxIterations=20*Math.sqrt(f));for(this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun)return; this.calcRepulsion();this.calcAttraction();this.calcPositions();this.reduceTemperature()}a=c=null;for(d=0;d<this.vertexArray.length;d++)g=this.vertexArray[d],this.isVertexMovable(g)&&(l=this.getVertexBounds(g),null!=l&&(this.cellLocation[d][0]-=l.width/2,this.cellLocation[d][1]-=l.height/2,p=this.graph.snap(Math.round(this.cellLocation[d][0])),q=this.graph.snap(Math.round(this.cellLocation[d][1])),this.setVertexLocation(g,p,q),c=null==c?p:Math.min(c,p),a=null==a?q:Math.min(a,q)));d=-(c||0)+1;g=-(a|| 0)+1;null!=e&&(d+=e.x,g+=e.y);this.graph.moveCells(this.vertexArray,d,g)}finally{b.endUpdate()}};mxFastOrganicLayout.prototype.calcPositions=function(){for(var a=0;a<this.vertexArray.length;a++)if(this.isMoveable[a]){var b=Math.sqrt(this.dispX[a]*this.dispX[a]+this.dispY[a]*this.dispY[a]);.001>b&&(b=.001);var c=this.dispX[a]/b*Math.min(b,this.temperature);b=this.dispY[a]/b*Math.min(b,this.temperature);this.dispX[a]=0;this.dispY[a]=0;this.cellLocation[a][0]+=c;this.cellLocation[a][1]+=b}}; mxFastOrganicLayout.prototype.calcAttraction=function(){for(var a=0;a<this.vertexArray.length;a++)for(var b=0;b<this.neighbours[a].length;b++){var c=this.neighbours[a][b];if(a!=c&&this.isMoveable[a]&&this.isMoveable[c]){var d=this.cellLocation[a][0]-this.cellLocation[c][0],e=this.cellLocation[a][1]-this.cellLocation[c][1],f=d*d+e*e-this.radiusSquared[a]-this.radiusSquared[c];f<this.minDistanceLimitSquared&&(f=this.minDistanceLimitSquared);var g=Math.sqrt(f);f/=this.forceConstant;d=d/g*f;e=e/g*f;this.dispX[a]-= d;this.dispY[a]-=e;this.dispX[c]+=d;this.dispY[c]+=e}}}; mxFastOrganicLayout.prototype.calcRepulsion=function(){for(var a=this.vertexArray.length,b=0;b<a;b++)for(var c=b;c<a;c++){if(!this.allowedToRun)return;if(c!=b&&this.isMoveable[b]&&this.isMoveable[c]){var d=this.cellLocation[b][0]-this.cellLocation[c][0],e=this.cellLocation[b][1]-this.cellLocation[c][1];0==d&&(d=.01+Math.random());0==e&&(e=.01+Math.random());var f=Math.sqrt(d*d+e*e),g=f-this.radius[b]-this.radius[c];g>this.maxDistanceLimit||(g<this.minDistanceLimit&&(g=this.minDistanceLimit),g=this.forceConstantSquared/ g,d=d/f*g,e=e/f*g,this.dispX[b]+=d,this.dispY[b]+=e,this.dispX[c]-=d,this.dispY[c]-=e)}}};mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)};function mxCircleLayout(a,b){mxGraphLayout.call(this,a);this.radius=null!=b?b:100}mxCircleLayout.prototype=new mxGraphLayout;mxCircleLayout.prototype.constructor=mxCircleLayout;mxCircleLayout.prototype.radius=null;mxCircleLayout.prototype.moveCircle=!1; mxCircleLayout.prototype.x0=0;mxCircleLayout.prototype.y0=0;mxCircleLayout.prototype.resetEdges=!0;mxCircleLayout.prototype.disableEdgeStyle=!0; mxCircleLayout.prototype.execute=function(a){var b=this.graph.getModel();b.beginUpdate();try{for(var c=0,d=null,e=null,f=[],g=b.getChildCount(a),k=0;k<g;k++){var l=b.getChildAt(a,k);if(this.isVertexIgnored(l))this.isEdgeIgnored(l)||(this.resetEdges&&this.graph.resetEdge(l),this.disableEdgeStyle&&this.setEdgeStyleEnabled(l,!1));else{f.push(l);var m=this.getVertexBounds(l);d=null==d?m.y:Math.min(d,m.y);e=null==e?m.x:Math.min(e,m.x);c=Math.max(c,Math.max(m.width,m.height))}}var n=this.getRadius(f.length, c);this.moveCircle&&(e=this.x0,d=this.y0);this.circle(f,n,e,d)}finally{b.endUpdate()}};mxCircleLayout.prototype.getRadius=function(a,b){return Math.max(a*b/Math.PI,this.radius)};mxCircleLayout.prototype.circle=function(a,b,c,d){for(var e=a.length,f=2*Math.PI/e,g=0;g<e;g++)this.isVertexMovable(a[g])&&this.setVertexLocation(a[g],Math.round(c+b+b*Math.cos(g*f-Math.PI/2)),Math.round(d+b+b*Math.sin(g*f-Math.PI/2)))};function mxParallelEdgeLayout(a){mxGraphLayout.call(this,a)} mxParallelEdgeLayout.prototype=new mxGraphLayout;mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout;mxParallelEdgeLayout.prototype.spacing=20;mxParallelEdgeLayout.prototype.checkOverlap=!1;mxParallelEdgeLayout.prototype.execute=function(a,b){a=this.findParallels(a,b);this.graph.model.beginUpdate();try{for(var c in a){var d=a[c];1<d.length&&this.layout(d)}}finally{this.graph.model.endUpdate()}}; mxParallelEdgeLayout.prototype.findParallels=function(a,b){var c=[],d=mxUtils.bind(this,function(g){if(!this.isEdgeIgnored(g)){var k=this.getEdgeId(g);null!=k&&(null==c[k]&&(c[k]=[]),c[k].push(g))}});if(null!=b)for(var e=0;e<b.length;e++)d(b[e]);else{b=this.graph.getModel();var f=b.getChildCount(a);for(e=0;e<f;e++)d(b.getChildAt(a,e))}return c}; mxParallelEdgeLayout.prototype.getEdgeId=function(a){var b=this.graph.getView(),c=b.getVisibleTerminal(a,!0);b=b.getVisibleTerminal(a,!1);var d="";if(null!=c&&null!=b){c=mxObjectIdentity.get(c);b=mxObjectIdentity.get(b);if(this.checkOverlap&&(a=this.graph.view.getState(a),null!=a&&null!=a.absolutePoints)){d=[];for(var e=0;e<a.absolutePoints.length;e++){var f=a.absolutePoints[e];null!=f&&d.push(f.x,f.y)}d=d.join(",")}return(c>b?b+"-"+c:c+"-"+b)+d}return null}; mxParallelEdgeLayout.prototype.layout=function(a){var b=a[0],c=this.graph.view.getState(b);if(null!=c&&null!=c.absolutePoints){var d=c.absolutePoints[0];c=c.absolutePoints[c.absolutePoints.length-1];if(null!=d&&null!=c){var e=this.graph.getView(),f=this.graph.getModel(),g=f.getGeometry(e.getVisibleTerminal(b,!0));b=f.getGeometry(e.getVisibleTerminal(b,!1));if(g==b)for(c=g.x+g.width+this.spacing,d=g.y+g.height/2,g=0;g<a.length;g++)this.route(a[g],c,d),c+=this.spacing;else if(null!=g&&null!=b&&(g=this.graph.view.scale, b=this.graph.view.translate,d.x=d.x/g-b.x,d.y=d.y/g-b.y,c.x=c.x/g-b.x,c.y=c.y/g-b.y,g=c.x-d.x,e=c.y-d.y,b=Math.sqrt(g*g+e*e),0<b))for(c=d.x+g/2,d=d.y+e/2,e=e*this.spacing/b,b=g*this.spacing/b,c+=e*(a.length-1)/2,d-=b*(a.length-1)/2,g=0;g<a.length;g++)this.route(a[g],c,d),c-=e,d+=b}}};mxParallelEdgeLayout.prototype.route=function(a,b,c){this.graph.isCellMovable(a)&&this.setEdgePoints(a,[new mxPoint(Math.round(b),Math.round(c))])}; function mxCompositeLayout(a,b,c){mxGraphLayout.call(this,a);this.layouts=b;this.master=c}mxCompositeLayout.prototype=new mxGraphLayout;mxCompositeLayout.prototype.constructor=mxCompositeLayout;mxCompositeLayout.prototype.layouts=null;mxCompositeLayout.prototype.master=null;mxCompositeLayout.prototype.moveCell=function(a,b,c){null!=this.master?this.master.moveCell.apply(this.master,arguments):this.layouts[0].moveCell.apply(this.layouts[0],arguments)}; mxCompositeLayout.prototype.execute=function(a){var b=this.graph.getModel();b.beginUpdate();try{for(var c=0;c<this.layouts.length;c++)this.layouts[c].execute.apply(this.layouts[c],arguments)}finally{b.endUpdate()}};function mxEdgeLabelLayout(a,b){mxGraphLayout.call(this,a)}mxEdgeLabelLayout.prototype=new mxGraphLayout;mxEdgeLabelLayout.prototype.constructor=mxEdgeLabelLayout; mxEdgeLabelLayout.prototype.execute=function(a){for(var b=this.graph.view,c=this.graph.getModel(),d=[],e=[],f=c.getChildCount(a),g=0;g<f;g++){var k=c.getChildAt(a,g),l=b.getState(k);null!=l&&(this.isVertexIgnored(k)?this.isEdgeIgnored(k)||d.push(l):e.push(l))}this.placeLabels(e,d)}; mxEdgeLabelLayout.prototype.placeLabels=function(a,b){var c=this.graph.getModel();c.beginUpdate();try{for(var d=0;d<b.length;d++){var e=b[d];if(null!=e&&null!=e.text&&null!=e.text.boundingBox)for(var f=0;f<a.length;f++){var g=a[f];null!=g&&this.avoid(e,g)}}}finally{c.endUpdate()}}; mxEdgeLabelLayout.prototype.avoid=function(a,b){var c=this.graph.getModel(),d=a.text.boundingBox;if(mxUtils.intersects(d,b)){var e=-d.y-d.height+b.y,f=-d.y+b.y+b.height;e=Math.abs(e)<Math.abs(f)?e:f;f=-d.x-d.width+b.x;b=-d.x+b.x+b.width;b=Math.abs(f)<Math.abs(b)?f:b;Math.abs(b)<Math.abs(e)?e=0:b=0;d=c.getGeometry(a.cell);null!=d&&(d=d.clone(),null!=d.offset?(d.offset.x+=b,d.offset.y+=e):d.offset=new mxPoint(b,e),c.setGeometry(a.cell,d))}}; function mxGraphAbstractHierarchyCell(){this.x=[];this.y=[];this.temp=[]}mxGraphAbstractHierarchyCell.prototype.maxRank=-1;mxGraphAbstractHierarchyCell.prototype.minRank=-1;mxGraphAbstractHierarchyCell.prototype.x=null;mxGraphAbstractHierarchyCell.prototype.y=null;mxGraphAbstractHierarchyCell.prototype.width=0;mxGraphAbstractHierarchyCell.prototype.height=0;mxGraphAbstractHierarchyCell.prototype.nextLayerConnectedCells=null;mxGraphAbstractHierarchyCell.prototype.previousLayerConnectedCells=null; mxGraphAbstractHierarchyCell.prototype.temp=null;mxGraphAbstractHierarchyCell.prototype.getNextLayerConnectedCells=function(a){return null};mxGraphAbstractHierarchyCell.prototype.getPreviousLayerConnectedCells=function(a){return null};mxGraphAbstractHierarchyCell.prototype.isEdge=function(){return!1};mxGraphAbstractHierarchyCell.prototype.isVertex=function(){return!1};mxGraphAbstractHierarchyCell.prototype.getGeneralPurposeVariable=function(a){return null}; mxGraphAbstractHierarchyCell.prototype.setGeneralPurposeVariable=function(a,b){return null};mxGraphAbstractHierarchyCell.prototype.setX=function(a,b){this.isVertex()?this.x[0]=b:this.isEdge()&&(this.x[a-this.minRank-1]=b)};mxGraphAbstractHierarchyCell.prototype.getX=function(a){return this.isVertex()?this.x[0]:this.isEdge()?this.x[a-this.minRank-1]:0};mxGraphAbstractHierarchyCell.prototype.setY=function(a,b){this.isVertex()?this.y[0]=b:this.isEdge()&&(this.y[a-this.minRank-1]=b)}; function mxGraphHierarchyNode(a){mxGraphAbstractHierarchyCell.apply(this,arguments);this.cell=a;this.id=mxObjectIdentity.get(a);this.connectsAsTarget=[];this.connectsAsSource=[]}mxGraphHierarchyNode.prototype=new mxGraphAbstractHierarchyCell;mxGraphHierarchyNode.prototype.constructor=mxGraphHierarchyNode;mxGraphHierarchyNode.prototype.cell=null;mxGraphHierarchyNode.prototype.id=null;mxGraphHierarchyNode.prototype.connectsAsTarget=null;mxGraphHierarchyNode.prototype.connectsAsSource=null; mxGraphHierarchyNode.prototype.hashCode=!1;mxGraphHierarchyNode.prototype.getRankValue=function(a){return this.maxRank};mxGraphHierarchyNode.prototype.getNextLayerConnectedCells=function(a){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[];this.nextLayerConnectedCells[0]=[];for(var b=0;b<this.connectsAsTarget.length;b++){var c=this.connectsAsTarget[b];-1==c.maxRank||c.maxRank==a+1?this.nextLayerConnectedCells[0].push(c.source):this.nextLayerConnectedCells[0].push(c)}}return this.nextLayerConnectedCells[0]}; mxGraphHierarchyNode.prototype.getPreviousLayerConnectedCells=function(a){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[];this.previousLayerConnectedCells[0]=[];for(var b=0;b<this.connectsAsSource.length;b++){var c=this.connectsAsSource[b];-1==c.minRank||c.minRank==a-1?this.previousLayerConnectedCells[0].push(c.target):this.previousLayerConnectedCells[0].push(c)}}return this.previousLayerConnectedCells[0]};mxGraphHierarchyNode.prototype.isVertex=function(){return!0}; mxGraphHierarchyNode.prototype.getGeneralPurposeVariable=function(a){return this.temp[0]};mxGraphHierarchyNode.prototype.setGeneralPurposeVariable=function(a,b){this.temp[0]=b};mxGraphHierarchyNode.prototype.isAncestor=function(a){if(null!=a&&null!=this.hashCode&&null!=a.hashCode&&this.hashCode.length<a.hashCode.length){if(this.hashCode==a.hashCode)return!0;if(null==this.hashCode||null==this.hashCode)return!1;for(var b=0;b<this.hashCode.length;b++)if(this.hashCode[b]!=a.hashCode[b])return!1;return!0}return!1}; mxGraphHierarchyNode.prototype.getCoreCell=function(){return this.cell};function mxGraphHierarchyEdge(a){mxGraphAbstractHierarchyCell.apply(this,arguments);this.edges=a;this.ids=[];for(var b=0;b<a.length;b++)this.ids.push(mxObjectIdentity.get(a[b]))}mxGraphHierarchyEdge.prototype=new mxGraphAbstractHierarchyCell;mxGraphHierarchyEdge.prototype.constructor=mxGraphHierarchyEdge;mxGraphHierarchyEdge.prototype.edges=null;mxGraphHierarchyEdge.prototype.ids=null;mxGraphHierarchyEdge.prototype.source=null; mxGraphHierarchyEdge.prototype.target=null;mxGraphHierarchyEdge.prototype.isReversed=!1;mxGraphHierarchyEdge.prototype.invert=function(a){a=this.source;this.source=this.target;this.target=a;this.isReversed=!this.isReversed}; mxGraphHierarchyEdge.prototype.getNextLayerConnectedCells=function(a){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[];for(var b=0;b<this.temp.length;b++)this.nextLayerConnectedCells[b]=[],b==this.temp.length-1?this.nextLayerConnectedCells[b].push(this.source):this.nextLayerConnectedCells[b].push(this)}return this.nextLayerConnectedCells[a-this.minRank-1]}; mxGraphHierarchyEdge.prototype.getPreviousLayerConnectedCells=function(a){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[];for(var b=0;b<this.temp.length;b++)this.previousLayerConnectedCells[b]=[],0==b?this.previousLayerConnectedCells[b].push(this.target):this.previousLayerConnectedCells[b].push(this)}return this.previousLayerConnectedCells[a-this.minRank-1]};mxGraphHierarchyEdge.prototype.isEdge=function(){return!0}; mxGraphHierarchyEdge.prototype.getGeneralPurposeVariable=function(a){return this.temp[a-this.minRank-1]};mxGraphHierarchyEdge.prototype.setGeneralPurposeVariable=function(a,b){this.temp[a-this.minRank-1]=b};mxGraphHierarchyEdge.prototype.getCoreCell=function(){return null!=this.edges&&0<this.edges.length?this.edges[0]:null}; function mxGraphHierarchyModel(a,b,c,d,e){a.getGraph();this.tightenToSource=e;this.roots=c;this.parent=d;this.vertexMapper=new mxDictionary;this.edgeMapper=new mxDictionary;this.maxRank=0;c=[];null==b&&(b=this.graph.getChildVertices(d));this.maxRank=this.SOURCESCANSTARTRANK;this.createInternalCells(a,b,c);for(d=0;d<b.length;d++){e=c[d].connectsAsSource;for(var f=0;f<e.length;f++){var g=e[f],k=g.edges;if(null!=k&&0<k.length){k=k[0];var l=a.getVisibleTerminal(k,!1);l=this.vertexMapper.get(l);c[d]== l&&(l=a.getVisibleTerminal(k,!0),l=this.vertexMapper.get(l));null!=l&&c[d]!=l&&(g.target=l,0==l.connectsAsTarget.length&&(l.connectsAsTarget=[]),0>mxUtils.indexOf(l.connectsAsTarget,g)&&l.connectsAsTarget.push(g))}}c[d].temp[0]=1}}mxGraphHierarchyModel.prototype.maxRank=null;mxGraphHierarchyModel.prototype.vertexMapper=null;mxGraphHierarchyModel.prototype.edgeMapper=null;mxGraphHierarchyModel.prototype.ranks=null;mxGraphHierarchyModel.prototype.roots=null;mxGraphHierarchyModel.prototype.parent=null; mxGraphHierarchyModel.prototype.dfsCount=0;mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1E8;mxGraphHierarchyModel.prototype.tightenToSource=!1; mxGraphHierarchyModel.prototype.createInternalCells=function(a,b,c){for(var d=a.getGraph(),e=0;e<b.length;e++){c[e]=new mxGraphHierarchyNode(b[e]);this.vertexMapper.put(b[e],c[e]);var f=a.getEdges(b[e]);c[e].connectsAsSource=[];for(var g=0;g<f.length;g++){var k=a.getVisibleTerminal(f[g],!1);if(k!=b[e]&&a.graph.model.isVertex(k)&&!a.isVertexIgnored(k)){var l=a.getEdgesBetween(b[e],k,!1);k=a.getEdgesBetween(b[e],k,!0);if(null!=l&&0<l.length&&null==this.edgeMapper.get(l[0])&&2*k.length>=l.length){k= new mxGraphHierarchyEdge(l);for(var m=0;m<l.length;m++){var n=l[m];this.edgeMapper.put(n,k);d.resetEdge(n);a.disableEdgeStyle&&(a.setEdgeStyleEnabled(n,!1),a.setOrthogonalEdge(n,!0))}k.source=c[e];0>mxUtils.indexOf(c[e].connectsAsSource,k)&&c[e].connectsAsSource.push(k)}}}c[e].temp[0]=0}}; mxGraphHierarchyModel.prototype.initialRank=function(){var a=[];if(null!=this.roots)for(var b=0;b<this.roots.length;b++){var c=this.vertexMapper.get(this.roots[b]);null!=c&&a.push(c)}var d=this.vertexMapper.getValues();for(b=0;b<d.length;b++)d[b].temp[0]=-1;for(var e=a.slice();0<a.length;){c=a[0];var f=c.connectsAsTarget,g=c.connectsAsSource,k=!0,l=this.SOURCESCANSTARTRANK;for(b=0;b<f.length;b++){var m=f[b];if(5270620==m.temp[0])m=m.source,l=Math.min(l,m.temp[0]-1);else{k=!1;break}}if(k){c.temp[0]= l;this.maxRank=Math.min(this.maxRank,l);if(null!=g)for(b=0;b<g.length;b++)m=g[b],m.temp[0]=5270620,m=m.target,-1==m.temp[0]&&(a.push(m),m.temp[0]=-2);a.shift()}else if(b=a.shift(),a.push(c),b==c&&1==a.length)break}for(b=0;b<d.length;b++)d[b].temp[0]-=this.maxRank;for(b=0;b<e.length;b++)for(c=e[b],a=0,f=c.connectsAsSource,d=0;d<f.length;d++)m=f[d],m=m.target,c.temp[0]=Math.max(a,m.temp[0]+1),a=c.temp[0];this.maxRank=this.SOURCESCANSTARTRANK-this.maxRank}; mxGraphHierarchyModel.prototype.fixRanks=function(){var a=[];this.ranks=[];for(var b=0;b<this.maxRank+1;b++)a[b]=[],this.ranks[b]=a[b];var c=null;if(null!=this.roots){var d=this.roots;c=[];for(b=0;b<d.length;b++){var e=this.vertexMapper.get(d[b]);c[b]=e}}this.visit(function(f,g,k,l,m){0==m&&0>g.maxRank&&0>g.minRank&&(a[g.temp[0]].push(g),g.maxRank=g.temp[0],g.minRank=g.temp[0],g.temp[0]=a[g.maxRank].length-1);if(null!=f&&null!=k&&1<f.maxRank-g.maxRank)for(k.maxRank=f.maxRank,k.minRank=g.maxRank,k.temp= [],k.x=[],k.y=[],f=k.minRank+1;f<k.maxRank;f++)a[f].push(k),k.setGeneralPurposeVariable(f,a[f].length-1)},c,!1,null)};mxGraphHierarchyModel.prototype.visit=function(a,b,c,d){if(null!=b){for(var e=0;e<b.length;e++){var f=b[e];null!=f&&(null==d&&(d={}),c?(f.hashCode=[],f.hashCode[0]=this.dfsCount,f.hashCode[1]=e,this.extendedDfs(null,f,null,a,d,f.hashCode,e,0)):this.dfs(null,f,null,a,d,0))}this.dfsCount++}}; mxGraphHierarchyModel.prototype.dfs=function(a,b,c,d,e,f){if(null!=b){var g=b.id;if(null==e[g])for(e[g]=b,d(a,b,c,f,0),a=b.connectsAsSource.slice(),c=0;c<a.length;c++)g=a[c],this.dfs(b,g.target,g,d,e,f+1);else d(a,b,c,f,1)}}; mxGraphHierarchyModel.prototype.extendedDfs=function(a,b,c,d,e,f,g,k){if(null!=b)if(null==a||null!=b.hashCode&&b.hashCode[0]==a.hashCode[0]||(f=a.hashCode.length+1,b.hashCode=a.hashCode.slice(),b.hashCode[f-1]=g),g=b.id,null==e[g])for(e[g]=b,d(a,b,c,k,0),a=b.connectsAsSource.slice(),c=0;c<a.length;c++)g=a[c],this.extendedDfs(b,g.target,g,d,e,b.hashCode,c,k+1);else d(a,b,c,k,1)}; function mxSwimlaneModel(a,b,c,d,e){a.getGraph();this.tightenToSource=e;this.roots=c;this.parent=d;this.vertexMapper=new mxDictionary;this.edgeMapper=new mxDictionary;this.maxRank=0;c=[];null==b&&(b=this.graph.getChildVertices(d));this.maxRank=this.SOURCESCANSTARTRANK;this.createInternalCells(a,b,c);for(d=0;d<b.length;d++){e=c[d].connectsAsSource;for(var f=0;f<e.length;f++){var g=e[f],k=g.edges;if(null!=k&&0<k.length){k=k[0];var l=a.getVisibleTerminal(k,!1);l=this.vertexMapper.get(l);c[d]==l&&(l= a.getVisibleTerminal(k,!0),l=this.vertexMapper.get(l));null!=l&&c[d]!=l&&(g.target=l,0==l.connectsAsTarget.length&&(l.connectsAsTarget=[]),0>mxUtils.indexOf(l.connectsAsTarget,g)&&l.connectsAsTarget.push(g))}}c[d].temp[0]=1}}mxSwimlaneModel.prototype.maxRank=null;mxSwimlaneModel.prototype.vertexMapper=null;mxSwimlaneModel.prototype.edgeMapper=null;mxSwimlaneModel.prototype.ranks=null;mxSwimlaneModel.prototype.roots=null;mxSwimlaneModel.prototype.parent=null;mxSwimlaneModel.prototype.dfsCount=0; mxSwimlaneModel.prototype.SOURCESCANSTARTRANK=1E8;mxSwimlaneModel.prototype.tightenToSource=!1;mxSwimlaneModel.prototype.ranksPerGroup=null; mxSwimlaneModel.prototype.createInternalCells=function(a,b,c){for(var d=a.getGraph(),e=a.swimlanes,f=0;f<b.length;f++){c[f]=new mxGraphHierarchyNode(b[f]);this.vertexMapper.put(b[f],c[f]);c[f].swimlaneIndex=-1;for(var g=0;g<e.length;g++)if(d.model.getParent(b[f])==e[g]){c[f].swimlaneIndex=g;break}g=a.getEdges(b[f]);c[f].connectsAsSource=[];for(var k=0;k<g.length;k++){var l=a.getVisibleTerminal(g[k],!1);if(l!=b[f]&&a.graph.model.isVertex(l)&&!a.isVertexIgnored(l)){var m=a.getEdgesBetween(b[f],l,!1); l=a.getEdgesBetween(b[f],l,!0);if(null!=m&&0<m.length&&null==this.edgeMapper.get(m[0])&&2*l.length>=m.length){l=new mxGraphHierarchyEdge(m);for(var n=0;n<m.length;n++){var p=m[n];this.edgeMapper.put(p,l);d.resetEdge(p);a.disableEdgeStyle&&(a.setEdgeStyleEnabled(p,!1),a.setOrthogonalEdge(p,!0))}l.source=c[f];0>mxUtils.indexOf(c[f].connectsAsSource,l)&&c[f].connectsAsSource.push(l)}}}c[f].temp[0]=0}}; mxSwimlaneModel.prototype.initialRank=function(){this.ranksPerGroup=[];var a=[],b={};if(null!=this.roots)for(var c=0;c<this.roots.length;c++){var d=this.vertexMapper.get(this.roots[c]);this.maxChainDfs(null,d,null,b,0);null!=d&&a.push(d)}d=[];b=[];for(c=this.ranksPerGroup.length-1;0<=c;c--)d[c]=c==this.ranksPerGroup.length-1?0:b[c+1]+1,b[c]=d[c]+this.ranksPerGroup[c];this.maxRank=b[0];d=this.vertexMapper.getValues();for(c=0;c<d.length;c++)d[c].temp[0]=-1;for(a.slice();0<a.length;){d=a[0];var e=d.connectsAsTarget, f=d.connectsAsSource,g=!0,k=b[0];for(c=0;c<e.length;c++){var l=e[c];if(5270620==l.temp[0])l=l.source,k=Math.min(k,l.temp[0]-1);else{g=!1;break}}if(g){k>b[d.swimlaneIndex]&&(k=b[d.swimlaneIndex]);d.temp[0]=k;if(null!=f)for(c=0;c<f.length;c++)l=f[c],l.temp[0]=5270620,l=l.target,-1==l.temp[0]&&(a.push(l),l.temp[0]=-2);a.shift()}else if(c=a.shift(),a.push(d),c==d&&1==a.length)break}}; mxSwimlaneModel.prototype.maxChainDfs=function(a,b,c,d,e){if(null!=b&&(a=mxCellPath.create(b.cell),null==d[a])){d[a]=b;a=b.swimlaneIndex;if(null==this.ranksPerGroup[a]||this.ranksPerGroup[a]<e)this.ranksPerGroup[a]=e;a=b.connectsAsSource.slice();for(c=0;c<a.length;c++){var f=a[c],g=f.target;b.swimlaneIndex<g.swimlaneIndex?this.maxChainDfs(b,g,f,mxUtils.clone(d,null,!0),0):b.swimlaneIndex==g.swimlaneIndex&&this.maxChainDfs(b,g,f,mxUtils.clone(d,null,!0),e+1)}}}; mxSwimlaneModel.prototype.fixRanks=function(){var a=[];this.ranks=[];for(var b=0;b<this.maxRank+1;b++)a[b]=[],this.ranks[b]=a[b];var c=null;if(null!=this.roots){var d=this.roots;c=[];for(b=0;b<d.length;b++){var e=this.vertexMapper.get(d[b]);c[b]=e}}this.visit(function(f,g,k,l,m){0==m&&0>g.maxRank&&0>g.minRank&&(a[g.temp[0]].push(g),g.maxRank=g.temp[0],g.minRank=g.temp[0],g.temp[0]=a[g.maxRank].length-1);if(null!=f&&null!=k&&1<f.maxRank-g.maxRank)for(k.maxRank=f.maxRank,k.minRank=g.maxRank,k.temp= [],k.x=[],k.y=[],f=k.minRank+1;f<k.maxRank;f++)a[f].push(k),k.setGeneralPurposeVariable(f,a[f].length-1)},c,!1,null)};mxSwimlaneModel.prototype.visit=function(a,b,c,d){if(null!=b){for(var e=0;e<b.length;e++){var f=b[e];null!=f&&(null==d&&(d={}),c?(f.hashCode=[],f.hashCode[0]=this.dfsCount,f.hashCode[1]=e,this.extendedDfs(null,f,null,a,d,f.hashCode,e,0)):this.dfs(null,f,null,a,d,0))}this.dfsCount++}}; mxSwimlaneModel.prototype.dfs=function(a,b,c,d,e,f){if(null!=b){var g=b.id;if(null==e[g])for(e[g]=b,d(a,b,c,f,0),a=b.connectsAsSource.slice(),c=0;c<a.length;c++)g=a[c],this.dfs(b,g.target,g,d,e,f+1);else d(a,b,c,f,1)}}; mxSwimlaneModel.prototype.extendedDfs=function(a,b,c,d,e,f,g,k){if(null!=b)if(null==a||null!=b.hashCode&&b.hashCode[0]==a.hashCode[0]||(f=a.hashCode.length+1,b.hashCode=a.hashCode.slice(),b.hashCode[f-1]=g),g=b.id,null==e[g]){e[g]=b;d(a,b,c,k,0);a=b.connectsAsSource.slice();c=b.connectsAsTarget.slice();for(g=0;g<a.length;g++){f=a[g];var l=f.target;b.swimlaneIndex<=l.swimlaneIndex&&this.extendedDfs(b,l,f,d,e,b.hashCode,g,k+1)}for(g=0;g<c.length;g++)f=c[g],l=f.source,b.swimlaneIndex<l.swimlaneIndex&& this.extendedDfs(b,l,f,d,e,b.hashCode,g,k+1)}else d(a,b,c,k,1)};function mxHierarchicalLayoutStage(){}mxHierarchicalLayoutStage.prototype.execute=function(a){};function mxMedianHybridCrossingReduction(a){this.layout=a}mxMedianHybridCrossingReduction.prototype=new mxHierarchicalLayoutStage;mxMedianHybridCrossingReduction.prototype.constructor=mxMedianHybridCrossingReduction;mxMedianHybridCrossingReduction.prototype.layout=null;mxMedianHybridCrossingReduction.prototype.maxIterations=24; mxMedianHybridCrossingReduction.prototype.nestedBestRanks=null;mxMedianHybridCrossingReduction.prototype.currentBestCrossings=0;mxMedianHybridCrossingReduction.prototype.iterationsWithoutImprovement=0;mxMedianHybridCrossingReduction.prototype.maxNoImprovementIterations=2; mxMedianHybridCrossingReduction.prototype.execute=function(a){a=this.layout.getModel();this.nestedBestRanks=[];for(var b=0;b<a.ranks.length;b++)this.nestedBestRanks[b]=a.ranks[b].slice();var c=0,d=this.calculateCrossings(a);for(b=0;b<this.maxIterations&&c<this.maxNoImprovementIterations;b++){this.weightedMedian(b,a);this.transpose(b,a);var e=this.calculateCrossings(a);if(e<d)for(d=e,e=c=0;e<this.nestedBestRanks.length;e++)for(var f=a.ranks[e],g=0;g<f.length;g++){var k=f[g];this.nestedBestRanks[e][k.getGeneralPurposeVariable(e)]= k}else for(c++,e=0;e<this.nestedBestRanks.length;e++)for(f=a.ranks[e],g=0;g<f.length;g++)k=f[g],k.setGeneralPurposeVariable(e,g);if(0==d)break}c=[];d=[];for(b=0;b<a.maxRank+1;b++)d[b]=[],c[b]=d[b];for(b=0;b<this.nestedBestRanks.length;b++)for(e=0;e<this.nestedBestRanks[b].length;e++)d[b].push(this.nestedBestRanks[b][e]);a.ranks=c};mxMedianHybridCrossingReduction.prototype.calculateCrossings=function(a){for(var b=a.ranks.length,c=0,d=1;d<b;d++)c+=this.calculateRankCrossing(d,a);return c}; mxMedianHybridCrossingReduction.prototype.calculateRankCrossing=function(a,b){var c=0,d=b.ranks[a],e=b.ranks[a-1],f=[];for(b=0;b<d.length;b++){var g=d[b],k=g.getGeneralPurposeVariable(a);g=g.getPreviousLayerConnectedCells(a);for(var l=[],m=0;m<g.length;m++){var n=g[m].getGeneralPurposeVariable(a-1);l.push(n)}l.sort(function(p,q){return p-q});f[k]=l}a=[];for(b=0;b<f.length;b++)a=a.concat(f[b]);for(d=1;d<e.length;)d<<=1;f=2*d-1;--d;e=[];for(b=0;b<f;++b)e[b]=0;for(b=0;b<a.length;b++)for(f=a[b]+d,++e[f];0< f;)f%2&&(c+=e[f+1]),f=f-1>>1,++e[f];return c}; mxMedianHybridCrossingReduction.prototype.transpose=function(a,b){for(var c=!0,d=0;c&&10>d++;){var e=1==a%2&&1==d%2;c=!1;for(var f=0;f<b.ranks.length;f++){for(var g=b.ranks[f],k=[],l=0;l<g.length;l++){var m=g[l],n=m.getGeneralPurposeVariable(f);0>n&&(n=l);k[n]=m}var p=null,q=null,r=null,t=null,u=null;for(l=0;l<g.length-1;l++){if(0==l){var v=k[l];m=v.getNextLayerConnectedCells(f);n=v.getPreviousLayerConnectedCells(f);for(var y=[],A=[],z=0;z<m.length;z++)y[z]=m[z].getGeneralPurposeVariable(f+1);for(z= 0;z<n.length;z++)A[z]=n[z].getGeneralPurposeVariable(f-1)}else m=p,n=q,y=r,A=t,v=u;u=k[l+1];p=u.getNextLayerConnectedCells(f);q=u.getPreviousLayerConnectedCells(f);r=[];t=[];for(z=0;z<p.length;z++)r[z]=p[z].getGeneralPurposeVariable(f+1);for(z=0;z<q.length;z++)t[z]=q[z].getGeneralPurposeVariable(f-1);var x=0,C=0;for(z=0;z<y.length;z++)for(var D=0;D<r.length;D++)y[z]>r[D]&&x++,y[z]<r[D]&&C++;for(z=0;z<A.length;z++)for(D=0;D<t.length;D++)A[z]>t[D]&&x++,A[z]<t[D]&&C++;if(C<x||C==x&&e)p=v.getGeneralPurposeVariable(f), v.setGeneralPurposeVariable(f,u.getGeneralPurposeVariable(f)),u.setGeneralPurposeVariable(f,p),p=m,q=n,r=y,t=A,u=v,e||(c=!0)}}}};mxMedianHybridCrossingReduction.prototype.weightedMedian=function(a,b){if(a=0==a%2)for(var c=b.maxRank-1;0<=c;c--)this.medianRank(c,a);else for(c=1;c<b.maxRank;c++)this.medianRank(c,a)}; mxMedianHybridCrossingReduction.prototype.medianRank=function(a,b){for(var c=this.nestedBestRanks[a].length,d=[],e=[],f=0;f<c;f++){var g=this.nestedBestRanks[a][f],k=new MedianCellSorter;k.cell=g;var l=b?g.getNextLayerConnectedCells(a):g.getPreviousLayerConnectedCells(a),m=b?a+1:a-1;null!=l&&0!=l.length?(k.medianValue=this.medianValue(l,m),d.push(k)):e[g.getGeneralPurposeVariable(a)]=!0}d.sort(MedianCellSorter.prototype.compare);for(f=0;f<c;f++)null==e[f]&&(g=d.shift().cell,g.setGeneralPurposeVariable(a, f))};mxMedianHybridCrossingReduction.prototype.medianValue=function(a,b){for(var c=[],d=0,e=0;e<a.length;e++){var f=a[e];c[d++]=f.getGeneralPurposeVariable(b)}c.sort(function(g,k){return g-k});if(1==d%2)return c[Math.floor(d/2)];if(2==d)return(c[0]+c[1])/2;a=d/2;b=c[a-1]-c[0];d=c[d-1]-c[a];return(c[a-1]*d+c[a]*b)/(b+d)};function MedianCellSorter(){}MedianCellSorter.prototype.medianValue=0;MedianCellSorter.prototype.cell=!1; MedianCellSorter.prototype.compare=function(a,b){return null!=a&&null!=b?b.medianValue>a.medianValue?-1:b.medianValue<a.medianValue?1:0:0};function mxMinimumCycleRemover(a){this.layout=a}mxMinimumCycleRemover.prototype=new mxHierarchicalLayoutStage;mxMinimumCycleRemover.prototype.constructor=mxMinimumCycleRemover;mxMinimumCycleRemover.prototype.layout=null; mxMinimumCycleRemover.prototype.execute=function(a){a=this.layout.getModel();for(var b={},c=a.vertexMapper.getValues(),d={},e=0;e<c.length;e++)d[c[e].id]=c[e];c=null;if(null!=a.roots){var f=a.roots;c=[];for(e=0;e<f.length;e++)c[e]=a.vertexMapper.get(f[e])}a.visit(function(g,k,l,m,n){k.isAncestor(g)&&(l.invert(),mxUtils.remove(l,g.connectsAsSource),g.connectsAsTarget.push(l),mxUtils.remove(l,k.connectsAsTarget),k.connectsAsSource.push(l));b[k.id]=k;delete d[k.id]},c,!0,null);e=mxUtils.clone(b,null, !0);a.visit(function(g,k,l,m,n){k.isAncestor(g)&&(l.invert(),mxUtils.remove(l,g.connectsAsSource),k.connectsAsSource.push(l),g.connectsAsTarget.push(l),mxUtils.remove(l,k.connectsAsTarget));b[k.id]=k;delete d[k.id]},d,!0,e)};function mxCoordinateAssignment(a,b,c,d,e,f){this.layout=a;this.intraCellSpacing=b;this.interRankCellSpacing=c;this.orientation=d;this.initialX=e;this.parallelEdgeSpacing=f}mxCoordinateAssignment.prototype=new mxHierarchicalLayoutStage; mxCoordinateAssignment.prototype.constructor=mxCoordinateAssignment;mxCoordinateAssignment.prototype.layout=null;mxCoordinateAssignment.prototype.intraCellSpacing=30;mxCoordinateAssignment.prototype.interRankCellSpacing=100;mxCoordinateAssignment.prototype.parallelEdgeSpacing=10;mxCoordinateAssignment.prototype.maxIterations=8;mxCoordinateAssignment.prototype.prefHozEdgeSep=5;mxCoordinateAssignment.prototype.prefVertEdgeOff=2;mxCoordinateAssignment.prototype.minEdgeJetty=12; mxCoordinateAssignment.prototype.channelBuffer=4;mxCoordinateAssignment.prototype.jettyPositions=null;mxCoordinateAssignment.prototype.orientation=mxConstants.DIRECTION_NORTH;mxCoordinateAssignment.prototype.initialX=null;mxCoordinateAssignment.prototype.limitX=null;mxCoordinateAssignment.prototype.currentXDelta=null;mxCoordinateAssignment.prototype.widestRank=null;mxCoordinateAssignment.prototype.rankTopY=null;mxCoordinateAssignment.prototype.rankBottomY=null; mxCoordinateAssignment.prototype.widestRankValue=null;mxCoordinateAssignment.prototype.rankWidths=null;mxCoordinateAssignment.prototype.rankY=null;mxCoordinateAssignment.prototype.fineTuning=!0;mxCoordinateAssignment.prototype.nextLayerConnectedCache=null;mxCoordinateAssignment.prototype.previousLayerConnectedCache=null;mxCoordinateAssignment.prototype.groupPadding=10; mxCoordinateAssignment.prototype.printStatus=function(){var a=this.layout.getModel();mxLog.show();mxLog.writeln("======Coord assignment debug=======");for(var b=0;b<a.ranks.length;b++){mxLog.write("Rank ",b," : ");for(var c=a.ranks[b],d=0;d<c.length;d++)mxLog.write(c[d].getGeneralPurposeVariable(b)," ");mxLog.writeln()}mxLog.writeln("====================================")}; mxCoordinateAssignment.prototype.execute=function(a){this.jettyPositions={};a=this.layout.getModel();this.currentXDelta=0;this.initialCoords(this.layout.getGraph(),a);this.fineTuning&&this.minNode(a);var b=1E8;if(this.fineTuning)for(var c=0;c<this.maxIterations;c++){0!=c&&(this.medianPos(c,a),this.minNode(a));if(this.currentXDelta<b){for(var d=0;d<a.ranks.length;d++)for(var e=a.ranks[d],f=0;f<e.length;f++){var g=e[f];g.setX(d,g.getGeneralPurposeVariable(d))}b=this.currentXDelta}else for(d=0;d<a.ranks.length;d++)for(e= a.ranks[d],f=0;f<e.length;f++)g=e[f],g.setGeneralPurposeVariable(d,g.getX(d));this.minPath(this.layout.getGraph(),a);this.currentXDelta=0}this.setCellLocations(this.layout.getGraph(),a)}; mxCoordinateAssignment.prototype.minNode=function(a){for(var b=[],c=new mxDictionary,d=[],e=0;e<=a.maxRank;e++){d[e]=a.ranks[e];for(var f=0;f<d[e].length;f++){var g=d[e][f],k=new WeightedCellSorter(g,e);k.rankIndex=f;k.visited=!0;b.push(k);c.put(g,k)}}a=10*b.length;for(f=0;0<b.length&&f<=a;){g=b.shift();e=g.cell;var l=g.weightedValue,m=parseInt(g.rankIndex);k=e.getNextLayerConnectedCells(l);var n=e.getPreviousLayerConnectedCells(l),p=k.length,q=n.length,r=this.medianXValue(k,l+1),t=this.medianXValue(n, l-1),u=p+q,v=e.getGeneralPurposeVariable(l),y=v;0<u&&(y=(r*p+t*q)/u);p=!1;y<v-1?0==m?(e.setGeneralPurposeVariable(l,y),p=!0):(m=d[l][m-1],v=m.getGeneralPurposeVariable(l),v=v+m.width/2+this.intraCellSpacing+e.width/2,v<y?(e.setGeneralPurposeVariable(l,y),p=!0):v<e.getGeneralPurposeVariable(l)-1&&(e.setGeneralPurposeVariable(l,v),p=!0)):y>v+1&&(m==d[l].length-1?(e.setGeneralPurposeVariable(l,y),p=!0):(m=d[l][m+1],v=m.getGeneralPurposeVariable(l),v=v-m.width/2-this.intraCellSpacing-e.width/2,v>y?(e.setGeneralPurposeVariable(l, y),p=!0):v>e.getGeneralPurposeVariable(l)+1&&(e.setGeneralPurposeVariable(l,v),p=!0)));if(p){for(e=0;e<k.length;e++)l=k[e],l=c.get(l),null!=l&&0==l.visited&&(l.visited=!0,b.push(l));for(e=0;e<n.length;e++)l=n[e],l=c.get(l),null!=l&&0==l.visited&&(l.visited=!0,b.push(l))}g.visited=!1;f++}};mxCoordinateAssignment.prototype.medianPos=function(a,b){if(0==a%2)for(a=b.maxRank;0<a;a--)this.rankMedianPosition(a-1,b,a);else for(a=0;a<b.maxRank-1;a++)this.rankMedianPosition(a+1,b,a)}; mxCoordinateAssignment.prototype.rankMedianPosition=function(a,b,c){b=b.ranks[a];for(var d=[],e={},f=0;f<b.length;f++){var g=b[f];d[f]=new WeightedCellSorter;d[f].cell=g;d[f].rankIndex=f;e[g.id]=d[f];var k=c<a?g.getPreviousLayerConnectedCells(a):g.getNextLayerConnectedCells(a);d[f].weightedValue=this.calculatedWeightedValue(g,k)}d.sort(WeightedCellSorter.prototype.compare);for(f=0;f<d.length;f++){g=d[f].cell;var l=0;k=c<a?g.getPreviousLayerConnectedCells(a).slice():g.getNextLayerConnectedCells(a).slice(); null!=k&&(l=k.length,l=0<l?this.medianXValue(k,c):g.getGeneralPurposeVariable(a));var m=0;k=-1E8;for(var n=d[f].rankIndex-1;0<=n;){var p=e[b[n].id];if(null!=p){var q=p.cell;p.visited?(k=q.getGeneralPurposeVariable(a)+q.width/2+this.intraCellSpacing+m+g.width/2,n=-1):(m+=q.width+this.intraCellSpacing,n--)}}m=0;q=1E8;for(n=d[f].rankIndex+1;n<d.length;)if(p=e[b[n].id],null!=p){var r=p.cell;p.visited?(q=r.getGeneralPurposeVariable(a)-r.width/2-this.intraCellSpacing-m-g.width/2,n=d.length):(m+=r.width+ this.intraCellSpacing,n++)}l>=k&&l<=q?g.setGeneralPurposeVariable(a,l):l<k?(g.setGeneralPurposeVariable(a,k),this.currentXDelta+=k-l):l>q&&(g.setGeneralPurposeVariable(a,q),this.currentXDelta+=l-q);d[f].visited=!0}};mxCoordinateAssignment.prototype.calculatedWeightedValue=function(a,b){for(var c=0,d=0;d<b.length;d++){var e=b[d];a.isVertex()&&e.isVertex()?c++:c=a.isEdge()&&e.isEdge()?c+8:c+2}return c}; mxCoordinateAssignment.prototype.medianXValue=function(a,b){if(0==a.length)return 0;for(var c=[],d=0;d<a.length;d++)c[d]=a[d].getGeneralPurposeVariable(b);c.sort(function(e,f){return e-f});if(1==a.length%2)return c[Math.floor(a.length/2)];a=a.length/2;return(c[a-1]+c[a])/2}; mxCoordinateAssignment.prototype.initialCoords=function(a,b){this.calculateWidestRank(a,b);for(var c=this.widestRank;0<=c;c--)c<b.maxRank&&this.rankCoordinates(c,a,b);for(c=this.widestRank+1;c<=b.maxRank;c++)0<c&&this.rankCoordinates(c,a,b)}; mxCoordinateAssignment.prototype.rankCoordinates=function(a,b,c){b=c.ranks[a];c=this.initialX+(this.widestRankValue-this.rankWidths[a])/2;for(var d=!1,e=0;e<b.length;e++){var f=b[e];if(f.isVertex()){var g=this.layout.getVertexBounds(f.cell);null!=g?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(f.width=g.width,f.height=g.height):(f.width=g.height,f.height=g.width):d=!0}else f.isEdge()&&(g=1,null!=f.edges?g=f.edges.length:mxLog.warn("edge.edges is null"), f.width=(g-1)*this.parallelEdgeSpacing);c+=f.width/2;f.setX(a,c);f.setGeneralPurposeVariable(a,c);c+=f.width/2;c+=this.intraCellSpacing}1==d&&mxLog.warn("At least one cell has no bounds")}; mxCoordinateAssignment.prototype.calculateWidestRank=function(a,b){a=-this.interRankCellSpacing;var c=0;this.rankWidths=[];this.rankY=[];for(var d=b.maxRank;0<=d;d--){for(var e=0,f=b.ranks[d],g=this.initialX,k=!1,l=0;l<f.length;l++){var m=f[l];if(m.isVertex()){var n=this.layout.getVertexBounds(m.cell);null!=n?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(m.width=n.width,m.height=n.height):(m.width=n.height,m.height=n.width):k=!0;e=Math.max(e,m.height)}else m.isEdge()&& (n=1,null!=m.edges?n=m.edges.length:mxLog.warn("edge.edges is null"),m.width=(n-1)*this.parallelEdgeSpacing);g+=m.width/2;m.setX(d,g);m.setGeneralPurposeVariable(d,g);g+=m.width/2;g+=this.intraCellSpacing;g>this.widestRankValue&&(this.widestRankValue=g,this.widestRank=d);this.rankWidths[d]=g}1==k&&mxLog.warn("At least one cell has no bounds");this.rankY[d]=a;g=e/2+c/2+this.interRankCellSpacing;c=e;a=this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?a+g:a- g;for(l=0;l<f.length;l++)f[l].setY(d,a)}}; mxCoordinateAssignment.prototype.minPath=function(a,b){a=b.edgeMapper.getValues();for(var c=0;c<a.length;c++){var d=a[c];if(!(1>d.maxRank-d.minRank-1)){for(var e=d.getGeneralPurposeVariable(d.minRank+1),f=!0,g=0,k=d.minRank+2;k<d.maxRank;k++){var l=d.getGeneralPurposeVariable(k);e!=l?(f=!1,e=l):g++}if(!f){f=e=0;l=[];var m=[],n=d.getGeneralPurposeVariable(d.minRank+1);for(k=d.minRank+1;k<d.maxRank-1;k++){var p=d.getX(k+1);n==p?(l[k-d.minRank-1]=n,e++):this.repositionValid(b,d,k+1,n)?(l[k-d.minRank- 1]=n,e++):n=l[k-d.minRank-1]=p}n=d.getX(k);for(k=d.maxRank-1;k>d.minRank+1;k--)p=d.getX(k-1),n==p?(m[k-d.minRank-2]=n,f++):this.repositionValid(b,d,k-1,n)?(m[k-d.minRank-2]=n,f++):(m[k-d.minRank-2]=d.getX(k-1),n=p);if(f>g||e>g)if(f>=e)for(k=d.maxRank-2;k>d.minRank;k--)d.setX(k,m[k-d.minRank-1]);else if(e>f)for(k=d.minRank+2;k<d.maxRank;k++)d.setX(k,l[k-d.minRank-2])}}}}; mxCoordinateAssignment.prototype.repositionValid=function(a,b,c,d){a=a.ranks[c];for(var e=-1,f=0;f<a.length;f++)if(b==a[f]){e=f;break}if(0>e)return!1;f=b.getGeneralPurposeVariable(c);if(d<f){if(0==e)return!0;a=a[e-1];c=a.getGeneralPurposeVariable(c);c=c+a.width/2+this.intraCellSpacing+b.width/2;if(!(c<=d))return!1}else if(d>f){if(e==a.length-1)return!0;a=a[e+1];c=a.getGeneralPurposeVariable(c);c=c-a.width/2-this.intraCellSpacing-b.width/2;if(!(c>=d))return!1}return!0}; mxCoordinateAssignment.prototype.setCellLocations=function(a,b){this.rankTopY=[];this.rankBottomY=[];for(a=0;a<b.ranks.length;a++)this.rankTopY[a]=Number.MAX_VALUE,this.rankBottomY[a]=-Number.MAX_VALUE;var c=b.vertexMapper.getValues();for(a=0;a<c.length;a++)this.setVertexLocation(c[a]);this.layout.edgeStyle!=mxHierarchicalEdgeStyle.ORTHOGONAL&&this.layout.edgeStyle!=mxHierarchicalEdgeStyle.POLYLINE&&this.layout.edgeStyle!=mxHierarchicalEdgeStyle.CURVE||this.localEdgeProcessing(b);b=b.edgeMapper.getValues(); for(a=0;a<b.length;a++)this.setEdgePosition(b[a])}; mxCoordinateAssignment.prototype.localEdgeProcessing=function(a){for(var b=0;b<a.ranks.length;b++)for(var c=a.ranks[b],d=0;d<c.length;d++){var e=c[d];if(e.isVertex())for(var f=e.getPreviousLayerConnectedCells(b),g=b-1,k=0;2>k;k++){if(-1<g&&g<a.ranks.length&&null!=f&&0<f.length){for(var l=[],m=0;m<f.length;m++){var n=new WeightedCellSorter(f[m],f[m].getX(g));l.push(n)}l.sort(WeightedCellSorter.prototype.compare);n=e.x[0]-e.width/2;var p=n+e.width,q=f=0;g=[];for(m=0;m<l.length;m++){var r=l[m].cell; if(r.isVertex())for(var t=0==k?e.connectsAsSource:e.connectsAsTarget,u=0;u<t.length;u++){if(t[u].source==r||t[u].target==r)f+=t[u].edges.length,q++,g.push(t[u])}else f+=r.edges.length,q++,g.push(r)}e.width>(f+1)*this.prefHozEdgeSep+2*this.prefHozEdgeSep&&(n+=this.prefHozEdgeSep,p-=this.prefHozEdgeSep);l=(p-n)/f;n+=l/2;p=this.minEdgeJetty-this.prefVertEdgeOff;for(m=0;m<g.length;m++)for(q=g[m].edges.length,r=this.jettyPositions[g[m].ids[0]],null==r&&(r=[],this.jettyPositions[g[m].ids[0]]=r),m<f/2?p+= this.prefVertEdgeOff:m>f/2&&(p-=this.prefVertEdgeOff),t=0;t<q;t++)r[4*t+2*k]=n,n+=l,r[4*t+2*k+1]=p}f=e.getNextLayerConnectedCells(b);g=b+1}}}; mxCoordinateAssignment.prototype.setEdgePosition=function(a){var b=0;if(101207!=a.temp[0]){var c=a.maxRank,d=a.minRank;c==d&&(c=a.source.maxRank,d=a.target.minRank);for(var e=0,f=this.jettyPositions[a.ids[0]],g=a.isReversed?a.target.cell:a.source.cell,k=this.layout.graph,l=this.orientation==mxConstants.DIRECTION_EAST||this.orientation==mxConstants.DIRECTION_SOUTH,m=0;m<a.edges.length;m++){var n=a.edges[m],p=this.layout.getVisibleTerminal(n,!0),q=[],r=a.isReversed;p!=g&&(r=!r);if(null!=f){var t=r? 2:0,u=r?l?this.rankBottomY[d]:this.rankTopY[d]:l?this.rankTopY[c]:this.rankBottomY[c],v=f[4*e+1+t];r!=l&&(v=-v);u+=v;t=f[4*e+t];var y=k.model.getTerminal(n,!0);this.layout.isPort(y)&&k.model.getParent(y)==p&&(t=k.view.getState(y),t=null!=t?t.x:p.geometry.x+a.source.width*y.geometry.x);this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(q.push(new mxPoint(t,u)),this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&q.push(new mxPoint(t,u+v))):(q.push(new mxPoint(u, t)),this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&q.push(new mxPoint(u+v,t)))}t=a.x.length-1;u=v=-1;p=a.maxRank-1;for(r&&(t=0,v=a.x.length,u=1,p=a.minRank+1);a.maxRank!=a.minRank&&t!=v;t+=u){y=a.x[t]+b;var A=(this.rankTopY[p]+this.rankBottomY[p+1])/2,z=(this.rankTopY[p-1]+this.rankBottomY[p])/2;if(r){var x=A;A=z;z=x}this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(q.push(new mxPoint(y,A)),q.push(new mxPoint(y,z))):(q.push(new mxPoint(A,y)),q.push(new mxPoint(z, y)));this.limitX=Math.max(this.limitX,y);p+=u}null!=f&&(t=r?2:0,u=r?l?this.rankTopY[c]:this.rankBottomY[c]:l?this.rankBottomY[d]:this.rankTopY[d],v=f[4*e+3-t],r!=l&&(v=-v),u-=v,t=f[4*e+2-t],r=k.model.getTerminal(n,!1),p=this.layout.getVisibleTerminal(n,!1),this.layout.isPort(r)&&k.model.getParent(r)==p&&(t=k.view.getState(r),t=null!=t?t.x:p.geometry.x+a.target.width*r.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&& q.push(new mxPoint(t,u-v)),q.push(new mxPoint(t,u))):(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&q.push(new mxPoint(u-v,t)),q.push(new mxPoint(u,t))));a.isReversed&&this.processReversedEdge(a,n);this.layout.setEdgePoints(n,q);this.layout.resetEdgeLabels&&null!=n.geometry&&(geometry=n.geometry.clone(),geometry.relative=!0,geometry.x=0,geometry.y=0,k.model.setGeometry(n,geometry));b=0==b?this.parallelEdgeSpacing:0<b?-b:-b+this.parallelEdgeSpacing;e++}a.temp[0]=101207}}; mxCoordinateAssignment.prototype.setVertexLocation=function(a){var b=a.cell,c=a.x[0]-a.width/2,d=a.y[0]-a.height/2;this.rankTopY[a.minRank]=Math.min(this.rankTopY[a.minRank],d);this.rankBottomY[a.minRank]=Math.max(this.rankBottomY[a.minRank],d+a.height);this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(b,c,d):this.layout.setVertexLocation(b,d,c);this.limitX=Math.max(this.limitX,c+a.width)}; mxCoordinateAssignment.prototype.processReversedEdge=function(a,b){};function mxSwimlaneOrdering(a){this.layout=a}mxSwimlaneOrdering.prototype=new mxHierarchicalLayoutStage;mxSwimlaneOrdering.prototype.constructor=mxSwimlaneOrdering;mxSwimlaneOrdering.prototype.layout=null; mxSwimlaneOrdering.prototype.execute=function(a){a=this.layout.getModel();var b=mxUtils.clone(a.vertexMapper,null,!0),c=null;if(null!=a.roots){var d=a.roots;c=[];for(var e=0;e<d.length;e++)c[e]=a.vertexMapper.get(d[e])}a.visit(function(f,g,k,l,m){l=null!=f&&f.swimlaneIndex==g.swimlaneIndex&&g.isAncestor(f);m=null!=f&&null!=k&&f.swimlaneIndex<g.swimlaneIndex&&k.source==g;l?(k.invert(),mxUtils.remove(k,f.connectsAsSource),g.connectsAsSource.push(k),f.connectsAsTarget.push(k),mxUtils.remove(k,g.connectsAsTarget)): m&&(k.invert(),mxUtils.remove(k,f.connectsAsTarget),g.connectsAsTarget.push(k),f.connectsAsSource.push(k),mxUtils.remove(k,g.connectsAsSource));f=mxCellPath.create(g.cell);delete b[f]},c,!0,null)};function mxHierarchicalLayout(a,b,c){mxGraphLayout.call(this,a);this.orientation=null!=b?b:mxConstants.DIRECTION_NORTH;this.deterministic=null!=c?c:!0}var mxHierarchicalEdgeStyle={ORTHOGONAL:1,POLYLINE:2,STRAIGHT:3,CURVE:4};mxHierarchicalLayout.prototype=new mxGraphLayout; mxHierarchicalLayout.prototype.constructor=mxHierarchicalLayout;mxHierarchicalLayout.prototype.roots=null;mxHierarchicalLayout.prototype.resizeParent=!1;mxHierarchicalLayout.prototype.maintainParentLocation=!1;mxHierarchicalLayout.prototype.moveParent=!1;mxHierarchicalLayout.prototype.parentBorder=0;mxHierarchicalLayout.prototype.intraCellSpacing=30;mxHierarchicalLayout.prototype.interRankCellSpacing=100;mxHierarchicalLayout.prototype.interHierarchySpacing=60; mxHierarchicalLayout.prototype.parallelEdgeSpacing=10;mxHierarchicalLayout.prototype.orientation=mxConstants.DIRECTION_NORTH;mxHierarchicalLayout.prototype.fineTuning=!0;mxHierarchicalLayout.prototype.tightenToSource=!0;mxHierarchicalLayout.prototype.disableEdgeStyle=!0;mxHierarchicalLayout.prototype.resetEdgeLabels=!0;mxHierarchicalLayout.prototype.traverseAncestors=!0;mxHierarchicalLayout.prototype.model=null;mxHierarchicalLayout.prototype.edgesCache=null; mxHierarchicalLayout.prototype.edgeSourceTermCache=null;mxHierarchicalLayout.prototype.edgesTargetTermCache=null;mxHierarchicalLayout.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE;mxHierarchicalLayout.prototype.getModel=function(){return this.model}; mxHierarchicalLayout.prototype.execute=function(a,b){this.parent=a;var c=this.graph.model;this.edgesCache=new mxDictionary;this.edgeSourceTermCache=new mxDictionary;this.edgesTargetTermCache=new mxDictionary;null==b||b instanceof Array||(b=[b]);if(null!=b||null!=a){this.parentY=this.parentX=null;if(a!=this.root&&null!=c.isVertex(a)&&this.maintainParentLocation){var d=this.graph.getCellGeometry(a);null!=d&&(this.parentX=d.x,this.parentY=d.y)}if(null!=b){for(var e=[],f=0;f<b.length;f++)(null!=a?c.isAncestor(a, b[f]):1)&&c.isVertex(b[f])&&e.push(b[f]);this.roots=e}c.beginUpdate();try{this.run(a),this.resizeParent&&!this.graph.isCellCollapsed(a)&&this.graph.updateGroupBounds([a],this.parentBorder,this.moveParent),null!=this.parentX&&null!=this.parentY&&(d=this.graph.getCellGeometry(a),null!=d&&(d=d.clone(),d.x=this.parentX,d.y=this.parentY,c.setGeometry(a,d)))}finally{c.endUpdate()}}}; mxHierarchicalLayout.prototype.findRoots=function(a,b){var c=[];if(null!=a&&null!=b){a=this.graph.model;var d=null,e=-1E5,f;for(f in b){var g=b[f];if(a.isVertex(g)&&this.graph.isCellVisible(g)){for(var k=this.getEdges(g),l=0,m=0,n=0;n<k.length;n++)this.getVisibleTerminal(k[n],!0)==g?l++:m++;0==m&&0<l&&c.push(g);k=l-m;k>e&&(e=k,d=g)}}0==c.length&&null!=d&&c.push(d)}return c}; mxHierarchicalLayout.prototype.getEdges=function(a){var b=this.edgesCache.get(a);if(null!=b)return b;var c=this.graph.model;b=[];for(var d=this.graph.isCellCollapsed(a),e=c.getChildCount(a),f=0;f<e;f++){var g=c.getChildAt(a,f);if(this.isPort(g))b=b.concat(c.getEdges(g,!0,!0));else if(d||!this.graph.isCellVisible(g))b=b.concat(c.getEdges(g,!0,!0))}b=b.concat(c.getEdges(a,!0,!0));c=[];for(f=0;f<b.length;f++)d=this.getVisibleTerminal(b[f],!0),e=this.getVisibleTerminal(b[f],!1),(d==e||d!=e&&(e==a&&(null== this.parent||this.isAncestor(this.parent,d,this.traverseAncestors))||d==a&&(null==this.parent||this.isAncestor(this.parent,e,this.traverseAncestors))))&&c.push(b[f]);this.edgesCache.put(a,c);return c}; mxHierarchicalLayout.prototype.getVisibleTerminal=function(a,b){var c=this.edgesTargetTermCache;b&&(c=this.edgeSourceTermCache);var d=c.get(a);if(null!=d)return d;d=this.graph.view.getState(a);var e=null!=d?d.getVisibleTerminal(b):this.graph.view.getVisibleTerminal(a,b);null==e&&(e=null!=d?d.getVisibleTerminal(b):this.graph.view.getVisibleTerminal(a,b));null!=e&&(this.isPort(e)&&(e=this.graph.model.getParent(e)),c.put(a,e));return e}; mxHierarchicalLayout.prototype.run=function(a){var b=[],c=[];if(null==this.roots&&null!=a){var d={};this.filterDescendants(a,d);this.roots=[];var e=!0,f;for(f in d)if(null!=d[f]){e=!1;break}for(;!e;){var g=this.findRoots(a,d);for(e=0;e<g.length;e++){var k={};b.push(k);this.traverse(g[e],!0,null,c,k,b,d)}for(e=0;e<g.length;e++)this.roots.push(g[e]);e=!0;for(f in d)if(null!=d[f]){e=!1;break}}}else for(e=0;e<this.roots.length;e++)k={},b.push(k),this.traverse(this.roots[e],!0,null,c,k,b,null);for(e=c= 0;e<b.length;e++){k=b[e];d=[];for(f in k)d.push(k[f]);this.model=new mxGraphHierarchyModel(this,d,this.roots,a,this.tightenToSource);this.cycleStage(a);this.layeringStage();this.crossingStage(a);c=this.placementStage(c,a)}}; mxHierarchicalLayout.prototype.filterDescendants=function(a,b){var c=this.graph.model;c.isVertex(a)&&a!=this.parent&&this.graph.isCellVisible(a)&&(b[mxObjectIdentity.get(a)]=a);if(this.traverseAncestors||a==this.parent&&this.graph.isCellVisible(a))for(var d=c.getChildCount(a),e=0;e<d;e++){var f=c.getChildAt(a,e);this.isPort(f)||this.filterDescendants(f,b)}};mxHierarchicalLayout.prototype.isPort=function(a){return null!=a&&null!=a.geometry?a.geometry.relative:!1}; mxHierarchicalLayout.prototype.getEdgesBetween=function(a,b,c){c=null!=c?c:!1;for(var d=this.getEdges(a),e=[],f=0;f<d.length;f++){var g=this.getVisibleTerminal(d[f],!0),k=this.getVisibleTerminal(d[f],!1);(g==a&&k==b||!c&&g==b&&k==a)&&e.push(d[f])}return e}; mxHierarchicalLayout.prototype.traverse=function(a,b,c,d,e,f,g){if(null!=a&&null!=d){var k=mxObjectIdentity.get(a);if(null==d[k]&&(null==g||null!=g[k])){null==e[k]&&(e[k]=a);null==d[k]&&(d[k]=a);null!==g&&delete g[k];var l=this.getEdges(a);k=[];for(c=0;c<l.length;c++)k[c]=this.getVisibleTerminal(l[c],!0)==a;for(c=0;c<l.length;c++)if(!b||k[c]){a=this.getVisibleTerminal(l[c],!k[c]);for(var m=1,n=0;n<l.length;n++)if(n!=c){var p=k[n];this.getVisibleTerminal(l[n],!p)==a&&(p?m++:m--)}0<=m&&(e=this.traverse(a, b,l[c],d,e,f,g))}}else if(null==e[k])for(c=0;c<f.length;c++)if(b=f[c],null!=b[k]){for(l in b)e[l]=b[l];f.splice(c,1);break}}return e};mxHierarchicalLayout.prototype.cycleStage=function(a){(new mxMinimumCycleRemover(this)).execute(a)};mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank();this.model.fixRanks()};mxHierarchicalLayout.prototype.crossingStage=function(a){(new mxMedianHybridCrossingReduction(this)).execute(a)}; mxHierarchicalLayout.prototype.placementStage=function(a,b){a=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,a,this.parallelEdgeSpacing);a.fineTuning=this.fineTuning;a.execute(b);return a.limitX+this.interHierarchySpacing};function mxSwimlaneLayout(a,b,c){mxGraphLayout.call(this,a);this.orientation=null!=b?b:mxConstants.DIRECTION_NORTH;this.deterministic=null!=c?c:!0}mxSwimlaneLayout.prototype=new mxGraphLayout; mxSwimlaneLayout.prototype.constructor=mxSwimlaneLayout;mxSwimlaneLayout.prototype.roots=null;mxSwimlaneLayout.prototype.swimlanes=null;mxSwimlaneLayout.prototype.dummyVertexWidth=50;mxSwimlaneLayout.prototype.resizeParent=!1;mxSwimlaneLayout.prototype.maintainParentLocation=!1;mxSwimlaneLayout.prototype.moveParent=!1;mxSwimlaneLayout.prototype.parentBorder=30;mxSwimlaneLayout.prototype.intraCellSpacing=30;mxSwimlaneLayout.prototype.interRankCellSpacing=100; mxSwimlaneLayout.prototype.interHierarchySpacing=60;mxSwimlaneLayout.prototype.parallelEdgeSpacing=10;mxSwimlaneLayout.prototype.orientation=mxConstants.DIRECTION_NORTH;mxSwimlaneLayout.prototype.fineTuning=!0;mxSwimlaneLayout.prototype.tightenToSource=!0;mxSwimlaneLayout.prototype.disableEdgeStyle=!0;mxSwimlaneLayout.prototype.traverseAncestors=!0;mxSwimlaneLayout.prototype.model=null;mxSwimlaneLayout.prototype.edgesCache=null;mxHierarchicalLayout.prototype.edgeSourceTermCache=null; mxHierarchicalLayout.prototype.edgesTargetTermCache=null;mxHierarchicalLayout.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE;mxSwimlaneLayout.prototype.getModel=function(){return this.model}; mxSwimlaneLayout.prototype.execute=function(a,b){this.parent=a;var c=this.graph.model;this.edgesCache=new mxDictionary;this.edgeSourceTermCache=new mxDictionary;this.edgesTargetTermCache=new mxDictionary;if(!(null==b||1>b.length)){null==a&&(a=c.getParent(b[0]));this.parentY=this.parentX=null;if(a!=this.root&&null!=c.isVertex(a)&&this.maintainParentLocation){var d=this.graph.getCellGeometry(a);null!=d&&(this.parentX=d.x,this.parentY=d.y)}this.swimlanes=b;for(var e=[],f=0;f<b.length;f++){var g=this.graph.getChildCells(b[f]); if(null==g||0==g.length)g=this.graph.insertVertex(b[f],null,null,0,0,this.dummyVertexWidth,0),e.push(g)}c.beginUpdate();try{this.run(a),this.resizeParent&&!this.graph.isCellCollapsed(a)&&this.graph.updateGroupBounds([a],this.parentBorder,this.moveParent),null!=this.parentX&&null!=this.parentY&&(d=this.graph.getCellGeometry(a),null!=d&&(d=d.clone(),d.x=this.parentX,d.y=this.parentY,c.setGeometry(a,d))),this.graph.removeCells(e)}finally{c.endUpdate()}}}; mxSwimlaneLayout.prototype.updateGroupBounds=function(){var a=[],b=this.model;for(f in b.edgeMapper)for(var c=b.edgeMapper[f],d=0;d<c.edges.length;d++)a.push(c.edges[d]);a=this.graph.getBoundingBoxFromGeometry(a,!0);b=[];for(d=0;d<this.swimlanes.length;d++){var e=this.swimlanes[d],f=this.graph.getCellGeometry(e);if(null!=f){var g=this.graph.getChildCells(e);c=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle;e=this.graph.getBoundingBoxFromGeometry(g);b[d]=e;c=e.y+f.y-c.height-this.parentBorder; f=e.y+f.y+e.height;null==a?a=new mxRectangle(0,c,0,f-c):(a.y=Math.min(a.y,c),a.height=Math.max(a.y+a.height,f)-a.y)}}for(d=0;d<this.swimlanes.length;d++)if(e=this.swimlanes[d],f=this.graph.getCellGeometry(e),null!=f){g=this.graph.getChildCells(e);c=this.graph.isSwimlane(e)?this.graph.getStartSize(e):new mxRectangle;var k=f.clone(),l=c.width+(0==d?this.parentBorder:this.interRankCellSpacing/2),m=b[d].x-l,n=a.y-this.parentBorder;k.x+=m;k.y=n;k.width=b[d].width+l+this.interRankCellSpacing/2;k.height= a.height+c.height+2*this.parentBorder;this.graph.model.setGeometry(e,k);this.graph.moveCells(g,-m,f.y-n)}}; mxSwimlaneLayout.prototype.findRoots=function(a,b){var c=[];if(null!=a&&null!=b){var d=this.graph.model,e=null,f=-1E5,g;for(g in b){var k=b[g];if(null!=k&&d.isVertex(k)&&this.graph.isCellVisible(k)&&d.isAncestor(a,k)){for(var l=this.getEdges(k),m=0,n=0,p=0;p<l.length;p++){var q=this.getVisibleTerminal(l[p],!0);q==k?(q=this.getVisibleTerminal(l[p],!1),d.isAncestor(a,q)&&m++):d.isAncestor(a,q)&&n++}0==n&&0<m&&c.push(k);l=m-n;l>f&&(f=l,e=k)}}0==c.length&&null!=e&&c.push(e)}return c}; mxSwimlaneLayout.prototype.getEdges=function(a){var b=this.edgesCache.get(a);if(null!=b)return b;var c=this.graph.model;b=[];for(var d=this.graph.isCellCollapsed(a),e=c.getChildCount(a),f=0;f<e;f++){var g=c.getChildAt(a,f);if(this.isPort(g))b=b.concat(c.getEdges(g,!0,!0));else if(d||!this.graph.isCellVisible(g))b=b.concat(c.getEdges(g,!0,!0))}b=b.concat(c.getEdges(a,!0,!0));c=[];for(f=0;f<b.length;f++)d=this.getVisibleTerminal(b[f],!0),e=this.getVisibleTerminal(b[f],!1),(d==e||d!=e&&(e==a&&(null== this.parent||this.graph.isValidAncestor(d,this.parent,this.traverseAncestors))||d==a&&(null==this.parent||this.graph.isValidAncestor(e,this.parent,this.traverseAncestors))))&&c.push(b[f]);this.edgesCache.put(a,c);return c}; mxSwimlaneLayout.prototype.getVisibleTerminal=function(a,b){var c=this.edgesTargetTermCache;b&&(c=this.edgeSourceTermCache);var d=c.get(a);if(null!=d)return d;d=this.graph.view.getState(a);var e=null!=d?d.getVisibleTerminal(b):this.graph.view.getVisibleTerminal(a,b);null==e&&(e=null!=d?d.getVisibleTerminal(b):this.graph.view.getVisibleTerminal(a,b));null!=e&&(this.isPort(e)&&(e=this.graph.model.getParent(e)),c.put(a,e));return e}; mxSwimlaneLayout.prototype.run=function(a){var b=[],c={};if(null!=this.swimlanes&&0<this.swimlanes.length&&null!=a){for(var d={},e=0;e<this.swimlanes.length;e++)this.filterDescendants(this.swimlanes[e],d);this.roots=[];e=!0;for(var f in d)if(null!=d[f]){e=!1;break}for(var g=0;!e&&g<this.swimlanes.length;){var k=this.findRoots(this.swimlanes[g],d);if(0==k.length)g++;else{for(e=0;e<k.length;e++){var l={};b.push(l);this.traverse(k[e],!0,null,c,l,b,d,g)}for(e=0;e<k.length;e++)this.roots.push(k[e]);e= !0;for(f in d)if(null!=d[f]){e=!1;break}}}}else for(e=0;e<this.roots.length;e++)l={},b.push(l),this.traverse(this.roots[e],!0,null,c,l,b,null);b=[];for(f in c)b.push(c[f]);this.model=new mxSwimlaneModel(this,b,this.roots,a,this.tightenToSource);this.cycleStage(a);this.layeringStage();this.crossingStage(a);this.placementStage(0,a)}; mxSwimlaneLayout.prototype.filterDescendants=function(a,b){var c=this.graph.model;c.isVertex(a)&&a!=this.parent&&c.getParent(a)!=this.parent&&this.graph.isCellVisible(a)&&(b[mxObjectIdentity.get(a)]=a);if(this.traverseAncestors||a==this.parent&&this.graph.isCellVisible(a))for(var d=c.getChildCount(a),e=0;e<d;e++){var f=c.getChildAt(a,e);this.isPort(f)||this.filterDescendants(f,b)}};mxSwimlaneLayout.prototype.isPort=function(a){return a.geometry.relative?!0:!1}; mxSwimlaneLayout.prototype.getEdgesBetween=function(a,b,c){c=null!=c?c:!1;for(var d=this.getEdges(a),e=[],f=0;f<d.length;f++){var g=this.getVisibleTerminal(d[f],!0),k=this.getVisibleTerminal(d[f],!1);(g==a&&k==b||!c&&g==b&&k==a)&&e.push(d[f])}return e}; mxSwimlaneLayout.prototype.traverse=function(a,b,c,d,e,f,g,k){if(null!=a&&null!=d){var l=mxObjectIdentity.get(a);if(null==d[l]&&(null==g||null!=g[l])){null==e[l]&&(e[l]=a);null==d[l]&&(d[l]=a);null!==g&&delete g[l];var m=this.getEdges(a);l=this.graph.model;for(c=0;c<m.length;c++){var n=this.getVisibleTerminal(m[c],!0),p=n==a;p&&(n=this.getVisibleTerminal(m[c],!1));for(var q=0;q<this.swimlanes.length&&!l.isAncestor(this.swimlanes[q],n);)q++;q>=this.swimlanes.length||!(q>k||(!b||p)&&q==k)||(e=this.traverse(n, b,m[c],d,e,f,g,q))}}else if(null==e[l])for(c=0;c<f.length;c++)if(a=f[c],null!=a[l]){for(m in a)e[m]=a[m];f.splice(c,1);break}}return e};mxSwimlaneLayout.prototype.cycleStage=function(a){(new mxSwimlaneOrdering(this)).execute(a)};mxSwimlaneLayout.prototype.layeringStage=function(){this.model.initialRank();this.model.fixRanks()};mxSwimlaneLayout.prototype.crossingStage=function(a){(new mxMedianHybridCrossingReduction(this)).execute(a)}; mxSwimlaneLayout.prototype.placementStage=function(a,b){a=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,a,this.parallelEdgeSpacing);a.fineTuning=this.fineTuning;a.execute(b);return a.limitX+this.interHierarchySpacing};function mxGraphModel(a){this.currentEdit=this.createUndoableEdit();null!=a?this.setRoot(a):this.clear()}mxGraphModel.prototype=new mxEventSource;mxGraphModel.prototype.constructor=mxGraphModel;mxGraphModel.prototype.root=null; mxGraphModel.prototype.cells=null;mxGraphModel.prototype.maintainEdgeParent=!0;mxGraphModel.prototype.ignoreRelativeEdgeParent=!0;mxGraphModel.prototype.createIds=!0;mxGraphModel.prototype.prefix="";mxGraphModel.prototype.postfix="";mxGraphModel.prototype.nextId=0;mxGraphModel.prototype.currentEdit=null;mxGraphModel.prototype.updateLevel=0;mxGraphModel.prototype.endingUpdate=!1;mxGraphModel.prototype.clear=function(){this.setRoot(this.createRoot())};mxGraphModel.prototype.isCreateIds=function(){return this.createIds}; mxGraphModel.prototype.setCreateIds=function(a){this.createIds=a};mxGraphModel.prototype.createRoot=function(){var a=new mxCell;a.insert(new mxCell);return a};mxGraphModel.prototype.getCells=function(){var a=[];if(null!=this.cells)for(var b in this.cells)a.push(this.cells[b]);return a};mxGraphModel.prototype.getCellCount=function(){var a=0;if(null!=this.cells)for(var b in this.cells)a++;return a};mxGraphModel.prototype.getCell=function(a){return null!=this.cells?this.cells[a]:null}; mxGraphModel.prototype.filterCells=function(a,b){var c=null;if(null!=a){c=[];for(var d=0;d<a.length;d++)b(a[d])&&c.push(a[d])}return c};mxGraphModel.prototype.getDescendants=function(a){return this.filterDescendants(null,a)};mxGraphModel.prototype.filterDescendants=function(a,b){var c=[];b=b||this.getRoot();(null==a||a(b))&&c.push(b);for(var d=this.getChildCount(b),e=0;e<d;e++){var f=this.getChildAt(b,e);c=c.concat(this.filterDescendants(a,f))}return c}; mxGraphModel.prototype.getRoot=function(a){var b=a||this.root;if(null!=a)for(;null!=a;)b=a,a=this.getParent(a);return b};mxGraphModel.prototype.setRoot=function(a){this.execute(new mxRootChange(this,a));return a};mxGraphModel.prototype.rootChanged=function(a){var b=this.root;this.root=a;this.nextId=0;this.cells=null;this.cellAdded(a);return b};mxGraphModel.prototype.isRoot=function(a){return null!=a&&this.root==a};mxGraphModel.prototype.isLayer=function(a){return this.isRoot(this.getParent(a))}; mxGraphModel.prototype.isAncestor=function(a,b){for(;null!=b&&b!=a;)b=this.getParent(b);return b==a};mxGraphModel.prototype.contains=function(a){return this.isAncestor(this.root,a)};mxGraphModel.prototype.getParent=function(a){return null!=a?a.getParent():null};mxGraphModel.prototype.add=function(a,b,c){if(b!=a&&null!=a&&null!=b){null==c&&(c=this.getChildCount(a));var d=a!=this.getParent(b);this.execute(new mxChildChange(this,a,b,c));this.maintainEdgeParent&&d&&this.updateEdgeParents(b)}return b}; mxGraphModel.prototype.cellAdded=function(a){if(null!=a){null==a.getId()&&this.createIds&&a.setId(this.createId(a));if(null!=a.getId()){var b=this.getCell(a.getId());if(b!=a){for(;null!=b;)a.setId(this.createId(a)),b=this.getCell(a.getId());null==this.cells&&(this.cells=Object.create(null));this.cells[a.getId()]=a}}mxUtils.isNumeric(a.getId())&&(this.nextId=Math.max(this.nextId,a.getId()));b=this.getChildCount(a);for(var c=0;c<b;c++)this.cellAdded(this.getChildAt(a,c))}}; mxGraphModel.prototype.createId=function(a){a=this.nextId;this.nextId++;return this.prefix+a+this.postfix};mxGraphModel.prototype.updateEdgeParents=function(a,b){b=b||this.getRoot(a);for(var c=this.getChildCount(a),d=0;d<c;d++){var e=this.getChildAt(a,d);this.updateEdgeParents(e,b)}e=this.getEdgeCount(a);c=[];for(d=0;d<e;d++)c.push(this.getEdgeAt(a,d));for(d=0;d<c.length;d++)a=c[d],this.isAncestor(b,a)&&this.updateEdgeParent(a,b)}; mxGraphModel.prototype.updateEdgeParent=function(a,b){for(var c=this.getTerminal(a,!0),d=this.getTerminal(a,!1);null!=c&&!this.isEdge(c)&&null!=c.geometry&&c.geometry.relative;)c=this.getParent(c);for(;null!=d&&this.ignoreRelativeEdgeParent&&!this.isEdge(d)&&null!=d.geometry&&d.geometry.relative;)d=this.getParent(d);if(this.isAncestor(b,c)&&this.isAncestor(b,d)&&(b=c==d?this.getParent(c):this.getNearestCommonAncestor(c,d),null!=b&&(this.getParent(b)!=this.root||this.isAncestor(b,a))&&this.getParent(a)!= b)){c=this.getGeometry(a);if(null!=c){var e=this.getOrigin(this.getParent(a)),f=this.getOrigin(b);d=f.x-e.x;e=f.y-e.y;c=c.clone();c.translate(-d,-e);this.setGeometry(a,c)}this.add(b,a,this.getChildCount(b))}};mxGraphModel.prototype.getOrigin=function(a){if(null!=a){var b=this.getOrigin(this.getParent(a));this.isEdge(a)||(a=this.getGeometry(a),null!=a&&(b.x+=a.x,b.y+=a.y))}else b=new mxPoint;return b}; mxGraphModel.prototype.getNearestCommonAncestor=function(a,b){if(null!=a&&null!=b){var c=mxCellPath.create(b);if(null!=c&&0<c.length){var d=mxCellPath.create(a);for(c.length<d.length&&(a=b,b=d,d=c,c=b);null!=a;){b=this.getParent(a);if(0==c.indexOf(d+mxCellPath.PATH_SEPARATOR)&&null!=b)return a;d=mxCellPath.getParentPath(d);a=b}}}return null};mxGraphModel.prototype.remove=function(a){a==this.root?this.setRoot(null):null!=this.getParent(a)&&this.execute(new mxChildChange(this,null,a));return a}; mxGraphModel.prototype.cellRemoved=function(a){if(null!=a&&null!=this.cells){for(var b=this.getChildCount(a)-1;0<=b;b--)this.cellRemoved(this.getChildAt(a,b));null!=this.cells&&null!=a.getId()&&delete this.cells[a.getId()]}};mxGraphModel.prototype.parentForCellChanged=function(a,b,c){var d=this.getParent(a);null!=b?b==d&&d.getIndex(a)==c||b.insert(a,c):null!=d&&(c=d.getIndex(a),d.remove(c));b=this.contains(b);c=this.contains(d);b&&!c?this.cellAdded(a):c&&!b&&this.cellRemoved(a);return d}; mxGraphModel.prototype.getChildCount=function(a){return null!=a?a.getChildCount():0};mxGraphModel.prototype.getChildAt=function(a,b){return null!=a?a.getChildAt(b):null};mxGraphModel.prototype.getChildren=function(a){return null!=a?a.children:null};mxGraphModel.prototype.getChildVertices=function(a){return this.getChildCells(a,!0,!1)};mxGraphModel.prototype.getChildEdges=function(a){return this.getChildCells(a,!1,!0)}; mxGraphModel.prototype.getChildCells=function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!1;for(var d=this.getChildCount(a),e=[],f=0;f<d;f++){var g=this.getChildAt(a,f);(!c&&!b||c&&this.isEdge(g)||b&&this.isVertex(g))&&e.push(g)}return e};mxGraphModel.prototype.getTerminal=function(a,b){return null!=a?a.getTerminal(b):null}; mxGraphModel.prototype.setTerminal=function(a,b,c){var d=b!=this.getTerminal(a,c);this.execute(new mxTerminalChange(this,a,b,c));this.maintainEdgeParent&&d&&this.updateEdgeParent(a,this.getRoot());return b};mxGraphModel.prototype.setTerminals=function(a,b,c){this.beginUpdate();try{this.setTerminal(a,b,!0),this.setTerminal(a,c,!1)}finally{this.endUpdate()}}; mxGraphModel.prototype.terminalForCellChanged=function(a,b,c){var d=this.getTerminal(a,c);null!=b?b.insertEdge(a,c):null!=d&&d.removeEdge(a,c);return d};mxGraphModel.prototype.getEdgeCount=function(a){return null!=a?a.getEdgeCount():0};mxGraphModel.prototype.getEdgeAt=function(a,b){return null!=a?a.getEdgeAt(b):null};mxGraphModel.prototype.getDirectedEdgeCount=function(a,b,c){for(var d=0,e=this.getEdgeCount(a),f=0;f<e;f++){var g=this.getEdgeAt(a,f);g!=c&&this.getTerminal(g,b)==a&&d++}return d}; mxGraphModel.prototype.getConnections=function(a){return this.getEdges(a,!0,!0,!1)};mxGraphModel.prototype.getIncomingEdges=function(a){return this.getEdges(a,!0,!1,!1)};mxGraphModel.prototype.getOutgoingEdges=function(a){return this.getEdges(a,!1,!0,!1)}; mxGraphModel.prototype.getEdges=function(a,b,c,d){b=null!=b?b:!0;c=null!=c?c:!0;d=null!=d?d:!0;for(var e=this.getEdgeCount(a),f=[],g=0;g<e;g++){var k=this.getEdgeAt(a,g),l=this.getTerminal(k,!0),m=this.getTerminal(k,!1);(d&&l==m||l!=m&&(b&&m==a||c&&l==a))&&f.push(k)}return f}; mxGraphModel.prototype.getEdgesBetween=function(a,b,c){c=null!=c?c:!1;var d=this.getEdgeCount(a),e=this.getEdgeCount(b),f=a,g=d;e<d&&(g=e,f=b);d=[];for(e=0;e<g;e++){var k=this.getEdgeAt(f,e),l=this.getTerminal(k,!0),m=this.getTerminal(k,!1),n=m==a&&l==b;(l==a&&m==b||!c&&n)&&d.push(k)}return d}; mxGraphModel.prototype.getOpposites=function(a,b,c,d){c=null!=c?c:!0;d=null!=d?d:!0;var e=[];if(null!=a)for(var f=0;f<a.length;f++){var g=this.getTerminal(a[f],!0),k=this.getTerminal(a[f],!1);g==b&&null!=k&&k!=b&&d?e.push(k):k==b&&null!=g&&g!=b&&c&&e.push(g)}return e}; mxGraphModel.prototype.getTopmostCells=function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++)b.put(a[d],!0);for(d=0;d<a.length;d++){for(var e=a[d],f=!0,g=this.getParent(e);null!=g;){if(b.get(g)){f=!1;break}g=this.getParent(g)}f&&c.push(e)}return c};mxGraphModel.prototype.isVertex=function(a){return null!=a?a.isVertex():!1};mxGraphModel.prototype.isEdge=function(a){return null!=a?a.isEdge():!1};mxGraphModel.prototype.isConnectable=function(a){return null!=a?a.isConnectable():!1}; mxGraphModel.prototype.getValue=function(a){return null!=a?a.getValue():null};mxGraphModel.prototype.setValue=function(a,b){this.execute(new mxValueChange(this,a,b));return b};mxGraphModel.prototype.valueForCellChanged=function(a,b){return a.valueChanged(b)};mxGraphModel.prototype.getGeometry=function(a){return null!=a?a.getGeometry():null};mxGraphModel.prototype.setGeometry=function(a,b){b!=this.getGeometry(a)&&this.execute(new mxGeometryChange(this,a,b));return b}; mxGraphModel.prototype.geometryForCellChanged=function(a,b){var c=this.getGeometry(a);a.setGeometry(b);return c};mxGraphModel.prototype.getStyle=function(a){return null!=a?a.getStyle():null};mxGraphModel.prototype.setStyle=function(a,b){b!=this.getStyle(a)&&this.execute(new mxStyleChange(this,a,b));return b};mxGraphModel.prototype.styleForCellChanged=function(a,b){var c=this.getStyle(a);a.setStyle(b);return c};mxGraphModel.prototype.isCollapsed=function(a){return null!=a?a.isCollapsed():!1}; mxGraphModel.prototype.setCollapsed=function(a,b){b!=this.isCollapsed(a)&&this.execute(new mxCollapseChange(this,a,b));return b};mxGraphModel.prototype.collapsedStateForCellChanged=function(a,b){var c=this.isCollapsed(a);a.setCollapsed(b);return c};mxGraphModel.prototype.isVisible=function(a){return null!=a?a.isVisible():!1};mxGraphModel.prototype.setVisible=function(a,b){b!=this.isVisible(a)&&this.execute(new mxVisibleChange(this,a,b));return b}; mxGraphModel.prototype.visibleStateForCellChanged=function(a,b){var c=this.isVisible(a);a.setVisible(b);return c};mxGraphModel.prototype.execute=function(a){a.execute();this.beginUpdate();this.currentEdit.add(a);this.fireEvent(new mxEventObject(mxEvent.EXECUTE,"change",a));this.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",a));this.endUpdate()};mxGraphModel.prototype.beginUpdate=function(){this.updateLevel++;this.fireEvent(new mxEventObject(mxEvent.BEGIN_UPDATE));1==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.START_EDIT))}; mxGraphModel.prototype.endUpdate=function(){this.updateLevel--;0==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.END_EDIT));if(!this.endingUpdate){this.endingUpdate=0==this.updateLevel;this.fireEvent(new mxEventObject(mxEvent.END_UPDATE,"edit",this.currentEdit));try{if(this.endingUpdate&&!this.currentEdit.isEmpty()){this.fireEvent(new mxEventObject(mxEvent.BEFORE_UNDO,"edit",this.currentEdit));var a=this.currentEdit;this.currentEdit=this.createUndoableEdit();a.notify();this.fireEvent(new mxEventObject(mxEvent.UNDO, "edit",a))}}finally{this.endingUpdate=!1}}};mxGraphModel.prototype.createUndoableEdit=function(a){var b=new mxUndoableEdit(this,null!=a?a:!0);b.notify=function(){b.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",b,"changes",b.changes));b.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",b,"changes",b.changes))};return b}; mxGraphModel.prototype.mergeChildren=function(a,b,c){c=null!=c?c:!0;this.beginUpdate();try{var d={};this.mergeChildrenImpl(a,b,c,d);for(var e in d){var f=d[e],g=this.getTerminal(f,!0);null!=g&&(g=d[mxCellPath.create(g)],this.setTerminal(f,g,!0));g=this.getTerminal(f,!1);null!=g&&(g=d[mxCellPath.create(g)],this.setTerminal(f,g,!1))}}finally{this.endUpdate()}}; mxGraphModel.prototype.mergeChildrenImpl=function(a,b,c,d){this.beginUpdate();try{for(var e=a.getChildCount(),f=0;f<e;f++){var g=a.getChildAt(f);if("function"==typeof g.getId){var k=g.getId(),l=null==k||this.isEdge(g)&&c?null:this.getCell(k);if(null==l){var m=g.clone();m.setId(k);m.setTerminal(g.getTerminal(!0),!0);m.setTerminal(g.getTerminal(!1),!1);l=b.insert(m);this.cellAdded(l)}d[mxCellPath.create(g)]=l;this.mergeChildrenImpl(g,l,c,d)}}}finally{this.endUpdate()}}; mxGraphModel.prototype.getParents=function(a){var b=[];if(null!=a)for(var c=new mxDictionary,d=0;d<a.length;d++){var e=this.getParent(a[d]);null==e||c.get(e)||(c.put(e,!0),b.push(e))}return b};mxGraphModel.prototype.cloneCell=function(a,b,c){return null!=a?this.cloneCells([a],b,null,c)[0]:null}; mxGraphModel.prototype.cloneCells=function(a,b,c,d){b=null!=b?b:!0;c=null!=c?c:{};d=null!=d?d:!1;for(var e=[],f=0;f<a.length;f++)null!=a[f]?e.push(this.cloneCellImpl(a[f],c,b,d)):e.push(null);for(f=0;f<e.length;f++)null!=e[f]&&this.restoreClone(e[f],a[f],c);return e}; mxGraphModel.prototype.cloneCellImpl=function(a,b,c,d){var e=mxObjectIdentity.get(a),f=b[e];if(null==f&&(f=this.cellCloned(a),b[e]=f,d&&(f.id=a.id),c))for(c=this.getChildCount(a),e=0;e<c;e++){var g=this.cloneCellImpl(this.getChildAt(a,e),b,!0,d);f.insert(g)}return f};mxGraphModel.prototype.cellCloned=function(a){return a.clone()}; mxGraphModel.prototype.restoreClone=function(a,b,c){var d=this.getTerminal(b,!0);null!=d&&(d=c[mxObjectIdentity.get(d)],null!=d&&d.insertEdge(a,!0));d=this.getTerminal(b,!1);null!=d&&(d=c[mxObjectIdentity.get(d)],null!=d&&d.insertEdge(a,!1));d=this.getChildCount(a);for(var e=0;e<d;e++)this.restoreClone(this.getChildAt(a,e),this.getChildAt(b,e),c)};function mxRootChange(a,b){this.model=a;this.previous=this.root=b}mxRootChange.prototype.execute=function(){this.root=this.previous;this.previous=this.model.rootChanged(this.previous)}; function mxChildChange(a,b,c,d){this.model=a;this.previous=this.parent=b;this.child=c;this.previousIndex=this.index=d} mxChildChange.prototype.execute=function(){if(null!=this.child){var a=this.model.getParent(this.child),b=null!=a?a.getIndex(this.child):0;null==this.previous&&this.connect(this.child,!1);a=this.model.parentForCellChanged(this.child,this.previous,this.previousIndex);null!=this.previous&&this.connect(this.child,!0);this.parent=this.previous;this.previous=a;this.index=this.previousIndex;this.previousIndex=b}}; mxChildChange.prototype.connect=function(a,b){b=null!=b?b:!0;var c=a.getTerminal(!0),d=a.getTerminal(!1);null!=c&&(b?this.model.terminalForCellChanged(a,c,!0):this.model.terminalForCellChanged(a,null,!0));null!=d&&(b?this.model.terminalForCellChanged(a,d,!1):this.model.terminalForCellChanged(a,null,!1));a.setTerminal(c,!0);a.setTerminal(d,!1);c=this.model.getChildCount(a);for(d=0;d<c;d++)this.connect(this.model.getChildAt(a,d),b)}; function mxTerminalChange(a,b,c,d){this.model=a;this.cell=b;this.previous=this.terminal=c;this.source=d}mxTerminalChange.prototype.execute=function(){null!=this.cell&&(this.terminal=this.previous,this.previous=this.model.terminalForCellChanged(this.cell,this.previous,this.source))};function mxValueChange(a,b,c){this.model=a;this.cell=b;this.previous=this.value=c} mxValueChange.prototype.execute=function(){null!=this.cell&&(this.value=this.previous,this.previous=this.model.valueForCellChanged(this.cell,this.previous))};function mxStyleChange(a,b,c){this.model=a;this.cell=b;this.previous=this.style=c}mxStyleChange.prototype.execute=function(){null!=this.cell&&(this.style=this.previous,this.previous=this.model.styleForCellChanged(this.cell,this.previous))};function mxGeometryChange(a,b,c){this.model=a;this.cell=b;this.previous=this.geometry=c} mxGeometryChange.prototype.execute=function(){null!=this.cell&&(this.geometry=this.previous,this.previous=this.model.geometryForCellChanged(this.cell,this.previous))};function mxCollapseChange(a,b,c){this.model=a;this.cell=b;this.previous=this.collapsed=c}mxCollapseChange.prototype.execute=function(){null!=this.cell&&(this.collapsed=this.previous,this.previous=this.model.collapsedStateForCellChanged(this.cell,this.previous))}; function mxVisibleChange(a,b,c){this.model=a;this.cell=b;this.previous=this.visible=c}mxVisibleChange.prototype.execute=function(){null!=this.cell&&(this.visible=this.previous,this.previous=this.model.visibleStateForCellChanged(this.cell,this.previous))};function mxCellAttributeChange(a,b,c){this.cell=a;this.attribute=b;this.previous=this.value=c} mxCellAttributeChange.prototype.execute=function(){if(null!=this.cell){var a=this.cell.getAttribute(this.attribute);null==this.previous?this.cell.value.removeAttribute(this.attribute):this.cell.setAttribute(this.attribute,this.previous);this.previous=a}};function mxCell(a,b,c){this.value=a;this.setGeometry(b);this.setStyle(c);if(null!=this.onInit)this.onInit()}mxCell.prototype.id=null;mxCell.prototype.value=null;mxCell.prototype.geometry=null;mxCell.prototype.style=null;mxCell.prototype.vertex=!1; mxCell.prototype.edge=!1;mxCell.prototype.connectable=!0;mxCell.prototype.visible=!0;mxCell.prototype.collapsed=!1;mxCell.prototype.parent=null;mxCell.prototype.source=null;mxCell.prototype.target=null;mxCell.prototype.children=null;mxCell.prototype.edges=null;mxCell.prototype.mxTransient="id value parent source target children edges".split(" ");mxCell.prototype.getId=function(){return this.id};mxCell.prototype.setId=function(a){this.id=a};mxCell.prototype.getValue=function(){return this.value}; mxCell.prototype.setValue=function(a){this.value=a};mxCell.prototype.valueChanged=function(a){var b=this.getValue();this.setValue(a);return b};mxCell.prototype.getGeometry=function(){return this.geometry};mxCell.prototype.setGeometry=function(a){this.geometry=a};mxCell.prototype.getStyle=function(){return this.style};mxCell.prototype.setStyle=function(a){this.style=a};mxCell.prototype.isVertex=function(){return 0!=this.vertex};mxCell.prototype.setVertex=function(a){this.vertex=a}; mxCell.prototype.isEdge=function(){return 0!=this.edge};mxCell.prototype.setEdge=function(a){this.edge=a};mxCell.prototype.isConnectable=function(){return 0!=this.connectable};mxCell.prototype.setConnectable=function(a){this.connectable=a};mxCell.prototype.isVisible=function(){return 0!=this.visible};mxCell.prototype.setVisible=function(a){this.visible=a};mxCell.prototype.isCollapsed=function(){return 0!=this.collapsed};mxCell.prototype.setCollapsed=function(a){this.collapsed=a}; mxCell.prototype.getParent=function(){return this.parent};mxCell.prototype.setParent=function(a){this.parent=a};mxCell.prototype.getTerminal=function(a){return a?this.source:this.target};mxCell.prototype.setTerminal=function(a,b){b?this.source=a:this.target=a;return a};mxCell.prototype.getChildCount=function(){return null==this.children?0:this.children.length};mxCell.prototype.getIndex=function(a){return mxUtils.indexOf(this.children,a)}; mxCell.prototype.getChildAt=function(a){return null==this.children?null:this.children[a]};mxCell.prototype.insert=function(a,b){null!=a&&(null==b&&(b=this.getChildCount(),a.getParent()==this&&b--),a.removeFromParent(),a.setParent(this),null==this.children?(this.children=[],this.children.push(a)):this.children.splice(b,0,a));return a};mxCell.prototype.remove=function(a){var b=null;null!=this.children&&0<=a&&(b=this.getChildAt(a),null!=b&&(this.children.splice(a,1),b.setParent(null)));return b}; mxCell.prototype.removeFromParent=function(){if(null!=this.parent){var a=this.parent.getIndex(this);this.parent.remove(a)}};mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length};mxCell.prototype.getEdgeIndex=function(a){return mxUtils.indexOf(this.edges,a)};mxCell.prototype.getEdgeAt=function(a){return null==this.edges?null:this.edges[a]}; mxCell.prototype.insertEdge=function(a,b){null!=a&&(a.removeFromTerminal(b),a.setTerminal(this,b),null==this.edges||a.getTerminal(!b)!=this||0>mxUtils.indexOf(this.edges,a))&&(null==this.edges&&(this.edges=[]),this.edges.push(a));return a};mxCell.prototype.removeEdge=function(a,b){if(null!=a){if(a.getTerminal(!b)!=this&&null!=this.edges){var c=this.getEdgeIndex(a);0<=c&&this.edges.splice(c,1)}a.setTerminal(null,b)}return a}; mxCell.prototype.removeFromTerminal=function(a){var b=this.getTerminal(a);null!=b&&b.removeEdge(this,a)};mxCell.prototype.hasAttribute=function(a){var b=this.getValue();return null!=b&&b.nodeType==mxConstants.NODETYPE_ELEMENT&&b.hasAttribute?b.hasAttribute(a):null!=b.getAttribute(a)};mxCell.prototype.getAttribute=function(a,b){var c=this.getValue();a=null!=c&&c.nodeType==mxConstants.NODETYPE_ELEMENT?c.getAttribute(a):null;return null!=a?a:b}; mxCell.prototype.setAttribute=function(a,b){var c=this.getValue();null!=c&&c.nodeType==mxConstants.NODETYPE_ELEMENT&&c.setAttribute(a,b)};mxCell.prototype.clone=function(){var a=mxUtils.clone(this,this.mxTransient);a.setValue(this.cloneValue());return a};mxCell.prototype.cloneValue=function(a){a=null!=a?a:this.getValue();null!=a&&("function"==typeof a.clone?a=a.clone():isNaN(a.nodeType)||(a=a.cloneNode(!0)));return a};function mxGeometry(a,b,c,d){mxRectangle.call(this,a,b,c,d)} mxGeometry.prototype=new mxRectangle;mxGeometry.prototype.constructor=mxGeometry;mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0;mxGeometry.prototype.alternateBounds=null;mxGeometry.prototype.sourcePoint=null;mxGeometry.prototype.targetPoint=null;mxGeometry.prototype.points=null;mxGeometry.prototype.offset=null;mxGeometry.prototype.relative=!1; mxGeometry.prototype.swap=function(){if(null!=this.alternateBounds){var a=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x;this.y=this.alternateBounds.y;this.width=this.alternateBounds.width;this.height=this.alternateBounds.height;this.alternateBounds=a}};mxGeometry.prototype.getTerminalPoint=function(a){return a?this.sourcePoint:this.targetPoint};mxGeometry.prototype.setTerminalPoint=function(a,b){b?this.sourcePoint=a:this.targetPoint=a;return a}; mxGeometry.prototype.rotate=function(a,b){var c=mxUtils.toRadians(a);a=Math.cos(c);c=Math.sin(c);if(!this.relative){var d=new mxPoint(this.getCenterX(),this.getCenterY());d=mxUtils.getRotatedPoint(d,a,c,b);this.x=Math.round(d.x-this.width/2);this.y=Math.round(d.y-this.height/2)}null!=this.sourcePoint&&(d=mxUtils.getRotatedPoint(this.sourcePoint,a,c,b),this.sourcePoint.x=Math.round(d.x),this.sourcePoint.y=Math.round(d.y));null!=this.targetPoint&&(d=mxUtils.getRotatedPoint(this.targetPoint,a,c,b),this.targetPoint.x= Math.round(d.x),this.targetPoint.y=Math.round(d.y));if(null!=this.points)for(var e=0;e<this.points.length;e++)null!=this.points[e]&&(d=mxUtils.getRotatedPoint(this.points[e],a,c,b),this.points[e].x=Math.round(d.x),this.points[e].y=Math.round(d.y))}; mxGeometry.prototype.translate=function(a,b,c){a=parseFloat(a);b=parseFloat(b);this.relative||c||(this.x=parseFloat(this.x)+a,this.y=parseFloat(this.y)+b);null!=this.sourcePoint&&(this.sourcePoint.x=parseFloat(this.sourcePoint.x)+a,this.sourcePoint.y=parseFloat(this.sourcePoint.y)+b);null!=this.targetPoint&&(this.targetPoint.x=parseFloat(this.targetPoint.x)+a,this.targetPoint.y=parseFloat(this.targetPoint.y)+b);if(this.TRANSLATE_CONTROL_POINTS&&null!=this.points)for(c=0;c<this.points.length;c++)null!= this.points[c]&&(this.points[c].x=parseFloat(this.points[c].x)+a,this.points[c].y=parseFloat(this.points[c].y)+b)}; mxGeometry.prototype.scale=function(a,b,c){a=parseFloat(a);b=parseFloat(b);null!=this.sourcePoint&&(this.sourcePoint.x=parseFloat(this.sourcePoint.x)*a,this.sourcePoint.y=parseFloat(this.sourcePoint.y)*b);null!=this.targetPoint&&(this.targetPoint.x=parseFloat(this.targetPoint.x)*a,this.targetPoint.y=parseFloat(this.targetPoint.y)*b);if(null!=this.points)for(var d=0;d<this.points.length;d++)null!=this.points[d]&&(this.points[d].x=parseFloat(this.points[d].x)*a,this.points[d].y=parseFloat(this.points[d].y)* b);this.relative||(this.x=parseFloat(this.x)*a,this.y=parseFloat(this.y)*b,c&&(b=a=Math.min(a,b)),this.width=parseFloat(this.width)*a,this.height=parseFloat(this.height)*b)}; mxGeometry.prototype.equals=function(a){return mxRectangle.prototype.equals.apply(this,arguments)&&this.relative==a.relative&&(null==this.sourcePoint&&null==a.sourcePoint||null!=this.sourcePoint&&this.sourcePoint.equals(a.sourcePoint))&&(null==this.targetPoint&&null==a.targetPoint||null!=this.targetPoint&&this.targetPoint.equals(a.targetPoint))&&(null==this.points&&null==a.points||null!=this.points&&mxUtils.equalPoints(this.points,a.points))&&(null==this.alternateBounds&&null==a.alternateBounds|| null!=this.alternateBounds&&this.alternateBounds.equals(a.alternateBounds))&&(null==this.offset&&null==a.offset||null!=this.offset&&null!=a.offset&&("function"===typeof this.offset.equals?this.offset.equals(a.offset):this.offset.x==a.offset.x&&this.offset.y==a.offset.y))}; var mxCellPath={PATH_SEPARATOR:".",create:function(a){var b="";if(null!=a)for(var c=a.getParent();null!=c;)b=c.getIndex(a)+mxCellPath.PATH_SEPARATOR+b,a=c,c=a.getParent();a=b.length;1<a&&(b=b.substring(0,a-1));return b},getParentPath:function(a){if(null!=a){var b=a.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(0<=b)return a.substring(0,b);if(0<a.length)return""}return null},resolve:function(a,b){if(null!=b){b=b.split(mxCellPath.PATH_SEPARATOR);for(var c=0;c<b.length;c++)a=a.getChildAt(parseInt(b[c]))}return a}, compare:function(a,b){for(var c=Math.min(a.length,b.length),d=0,e=0;e<c;e++)if(a[e]!=b[e]){0==a[e].length||0==b[e].length?d=a[e]==b[e]?0:a[e]>b[e]?1:-1:(c=parseInt(a[e]),e=parseInt(b[e]),d=c==e?0:c>e?1:-1);break}0==d&&(c=a.length,e=b.length,c!=e&&(d=c>e?1:-1));return d}},mxPerimeter={RectanglePerimeter:function(a,b,c,d){b=a.getCenterX();var e=a.getCenterY(),f=Math.atan2(c.y-e,c.x-b),g=new mxPoint(0,0),k=Math.PI,l=Math.PI/2-f,m=Math.atan2(a.height,a.width);f<-k+m||f>k-m?(g.x=a.x,g.y=e-a.width*Math.tan(f)/ 2):f<-m?(g.y=a.y,g.x=b-a.height*Math.tan(l)/2):f<m?(g.x=a.x+a.width,g.y=e+a.width*Math.tan(f)/2):(g.y=a.y+a.height,g.x=b+a.height*Math.tan(l)/2);d&&(c.x>=a.x&&c.x<=a.x+a.width?g.x=c.x:c.y>=a.y&&c.y<=a.y+a.height&&(g.y=c.y),c.x<a.x?g.x=a.x:c.x>a.x+a.width&&(g.x=a.x+a.width),c.y<a.y?g.y=a.y:c.y>a.y+a.height&&(g.y=a.y+a.height));return g},EllipsePerimeter:function(a,b,c,d){var e=a.x,f=a.y,g=a.width/2,k=a.height/2,l=e+g,m=f+k;b=c.x;c=c.y;var n=parseInt(b-l),p=parseInt(c-m);if(0==n&&0!=p)return new mxPoint(l, m+k*p/Math.abs(p));if(0==n&&0==p)return new mxPoint(b,c);if(d){if(c>=f&&c<=f+a.height)return a=c-m,a=Math.sqrt(g*g*(1-a*a/(k*k)))||0,b<=e&&(a=-a),new mxPoint(l+a,c);if(b>=e&&b<=e+a.width)return a=b-l,a=Math.sqrt(k*k*(1-a*a/(g*g)))||0,c<=f&&(a=-a),new mxPoint(b,m+a)}e=p/n;m-=e*l;f=g*g*e*e+k*k;a=-2*l*f;k=Math.sqrt(a*a-4*f*(g*g*e*e*l*l+k*k*l*l-g*g*k*k));g=(-a+k)/(2*f);l=(-a-k)/(2*f);k=e*g+m;m=e*l+m;Math.sqrt(Math.pow(g-b,2)+Math.pow(k-c,2))<Math.sqrt(Math.pow(l-b,2)+Math.pow(m-c,2))?(b=g,c=k):(b=l,c= m);return new mxPoint(b,c)},RhombusPerimeter:function(a,b,c,d){b=a.x;var e=a.y,f=a.width;a=a.height;var g=b+f/2,k=e+a/2,l=c.x;c=c.y;if(g==l)return k>c?new mxPoint(g,e):new mxPoint(g,e+a);if(k==c)return g>l?new mxPoint(b,k):new mxPoint(b+f,k);var m=g,n=k;d&&(l>=b&&l<=b+f?m=l:c>=e&&c<=e+a&&(n=c));return l<g?c<k?mxUtils.intersection(l,c,m,n,g,e,b,k):mxUtils.intersection(l,c,m,n,g,e+a,b,k):c<k?mxUtils.intersection(l,c,m,n,g,e,b+f,k):mxUtils.intersection(l,c,m,n,g,e+a,b+f,k)},TrianglePerimeter:function(a, b,c,d){b=null!=b?b.style[mxConstants.STYLE_DIRECTION]:null;var e=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH,f=a.x,g=a.y,k=a.width,l=a.height;a=f+k/2;var m=g+l/2,n=new mxPoint(f,g),p=new mxPoint(f+k,m),q=new mxPoint(f,g+l);b==mxConstants.DIRECTION_NORTH?(n=q,p=new mxPoint(a,g),q=new mxPoint(f+k,g+l)):b==mxConstants.DIRECTION_SOUTH?(p=new mxPoint(a,g+l),q=new mxPoint(f+k,g)):b==mxConstants.DIRECTION_WEST&&(n=new mxPoint(f+k,g),p=new mxPoint(f,m),q=new mxPoint(f+k,g+l));var r=c.x- a,t=c.y-m;r=e?Math.atan2(r,t):Math.atan2(t,r);t=e?Math.atan2(k,l):Math.atan2(l,k);(b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?r>-t&&r<t:r<-Math.PI+t||r>Math.PI-t)?c=d&&(e&&c.x>=n.x&&c.x<=q.x||!e&&c.y>=n.y&&c.y<=q.y)?e?new mxPoint(c.x,n.y):new mxPoint(n.x,c.y):b==mxConstants.DIRECTION_NORTH?new mxPoint(f+k/2+l*Math.tan(r)/2,g+l):b==mxConstants.DIRECTION_SOUTH?new mxPoint(f+k/2-l*Math.tan(r)/2,g):b==mxConstants.DIRECTION_WEST?new mxPoint(f+k,g+l/2+k*Math.tan(r)/2):new mxPoint(f,g+ l/2-k*Math.tan(r)/2):(d&&(d=new mxPoint(a,m),c.y>=g&&c.y<=g+l?(d.x=e?a:b==mxConstants.DIRECTION_WEST?f+k:f,d.y=c.y):c.x>=f&&c.x<=f+k&&(d.x=c.x,d.y=e?b==mxConstants.DIRECTION_NORTH?g+l:g:m),a=d.x,m=d.y),c=e&&c.x<=f+k/2||!e&&c.y<=g+l/2?mxUtils.intersection(c.x,c.y,a,m,n.x,n.y,p.x,p.y):mxUtils.intersection(c.x,c.y,a,m,p.x,p.y,q.x,q.y));null==c&&(c=new mxPoint(a,m));return c},HexagonPerimeter:function(a,b,c,d){var e=a.x,f=a.y,g=a.width,k=a.height,l=a.getCenterX();a=a.getCenterY();var m=c.x,n=c.y,p=-Math.atan2(n- a,m-l),q=Math.PI,r=Math.PI/2;new mxPoint(l,a);b=null!=b?mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;var t=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH;b=new mxPoint;var u=new mxPoint;if(m<e&&n<f||m<e&&n>f+k||m>e+g&&n<f||m>e+g&&n>f+k)d=!1;if(d){if(t){if(m==l){if(n<=f)return new mxPoint(l,f);if(n>=f+k)return new mxPoint(l,f+k)}else if(m<e){if(n==f+k/4)return new mxPoint(e,f+k/4);if(n==f+3*k/4)return new mxPoint(e,f+3* k/4)}else if(m>e+g){if(n==f+k/4)return new mxPoint(e+g,f+k/4);if(n==f+3*k/4)return new mxPoint(e+g,f+3*k/4)}else if(m==e){if(n<a)return new mxPoint(e,f+k/4);if(n>a)return new mxPoint(e,f+3*k/4)}else if(m==e+g){if(n<a)return new mxPoint(e+g,f+k/4);if(n>a)return new mxPoint(e+g,f+3*k/4)}if(n==f)return new mxPoint(l,f);if(n==f+k)return new mxPoint(l,f+k);m<l?n>f+k/4&&n<f+3*k/4?(b=new mxPoint(e,f),u=new mxPoint(e,f+k)):n<f+k/4?(b=new mxPoint(e-Math.floor(.5*g),f+Math.floor(.5*k)),u=new mxPoint(e+g,f- Math.floor(.25*k))):n>f+3*k/4&&(b=new mxPoint(e-Math.floor(.5*g),f+Math.floor(.5*k)),u=new mxPoint(e+g,f+Math.floor(1.25*k))):m>l&&(n>f+k/4&&n<f+3*k/4?(b=new mxPoint(e+g,f),u=new mxPoint(e+g,f+k)):n<f+k/4?(b=new mxPoint(e,f-Math.floor(.25*k)),u=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(.5*k))):n>f+3*k/4&&(b=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(.5*k)),u=new mxPoint(e,f+Math.floor(1.25*k))))}else{if(n==a){if(m<=e)return new mxPoint(e,f+k/2);if(m>=e+g)return new mxPoint(e+g,f+k/2)}else if(n< f){if(m==e+g/4)return new mxPoint(e+g/4,f);if(m==e+3*g/4)return new mxPoint(e+3*g/4,f)}else if(n>f+k){if(m==e+g/4)return new mxPoint(e+g/4,f+k);if(m==e+3*g/4)return new mxPoint(e+3*g/4,f+k)}else if(n==f){if(m<l)return new mxPoint(e+g/4,f);if(m>l)return new mxPoint(e+3*g/4,f)}else if(n==f+k){if(m<l)return new mxPoint(e+g/4,f+k);if(n>a)return new mxPoint(e+3*g/4,f+k)}if(m==e)return new mxPoint(e,a);if(m==e+g)return new mxPoint(e+g,a);n<a?m>e+g/4&&m<e+3*g/4?(b=new mxPoint(e,f),u=new mxPoint(e+g,f)): m<e+g/4?(b=new mxPoint(e-Math.floor(.25*g),f+k),u=new mxPoint(e+Math.floor(.5*g),f-Math.floor(.5*k))):m>e+3*g/4&&(b=new mxPoint(e+Math.floor(.5*g),f-Math.floor(.5*k)),u=new mxPoint(e+Math.floor(1.25*g),f+k)):n>a&&(m>e+g/4&&m<e+3*g/4?(b=new mxPoint(e,f+k),u=new mxPoint(e+g,f+k)):m<e+g/4?(b=new mxPoint(e-Math.floor(.25*g),f),u=new mxPoint(e+Math.floor(.5*g),f+Math.floor(1.5*k))):m>e+3*g/4&&(b=new mxPoint(e+Math.floor(.5*g),f+Math.floor(1.5*k)),u=new mxPoint(e+Math.floor(1.25*g),f)))}d=l;p=a;m>=e&&m<= e+g?(d=m,p=n<a?f+k:f):n>=f&&n<=f+k&&(p=n,d=m<l?e+g:e);c=mxUtils.intersection(d,p,c.x,c.y,b.x,b.y,u.x,u.y)}else{if(t){m=Math.atan2(k/4,g/2);if(p==m)return new mxPoint(e+g,f+Math.floor(.25*k));if(p==r)return new mxPoint(e+Math.floor(.5*g),f);if(p==q-m)return new mxPoint(e,f+Math.floor(.25*k));if(p==-m)return new mxPoint(e+g,f+Math.floor(.75*k));if(p==-r)return new mxPoint(e+Math.floor(.5*g),f+k);if(p==-q+m)return new mxPoint(e,f+Math.floor(.75*k));p<m&&p>-m?(b=new mxPoint(e+g,f),u=new mxPoint(e+g,f+ k)):p>m&&p<r?(b=new mxPoint(e,f-Math.floor(.25*k)),u=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(.5*k))):p>r&&p<q-m?(b=new mxPoint(e-Math.floor(.5*g),f+Math.floor(.5*k)),u=new mxPoint(e+g,f-Math.floor(.25*k))):p>q-m&&p<=q||p<-q+m&&p>=-q?(b=new mxPoint(e,f),u=new mxPoint(e,f+k)):p<-m&&p>-r?(b=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(.5*k)),u=new mxPoint(e,f+Math.floor(1.25*k))):p<-r&&p>-q+m&&(b=new mxPoint(e-Math.floor(.5*g),f+Math.floor(.5*k)),u=new mxPoint(e+g,f+Math.floor(1.25*k)))}else{m= Math.atan2(k/2,g/4);if(p==m)return new mxPoint(e+Math.floor(.75*g),f);if(p==q-m)return new mxPoint(e+Math.floor(.25*g),f);if(p==q||p==-q)return new mxPoint(e,f+Math.floor(.5*k));if(0==p)return new mxPoint(e+g,f+Math.floor(.5*k));if(p==-m)return new mxPoint(e+Math.floor(.75*g),f+k);if(p==-q+m)return new mxPoint(e+Math.floor(.25*g),f+k);0<p&&p<m?(b=new mxPoint(e+Math.floor(.5*g),f-Math.floor(.5*k)),u=new mxPoint(e+Math.floor(1.25*g),f+k)):p>m&&p<q-m?(b=new mxPoint(e,f),u=new mxPoint(e+g,f)):p>q-m&& p<q?(b=new mxPoint(e-Math.floor(.25*g),f+k),u=new mxPoint(e+Math.floor(.5*g),f-Math.floor(.5*k))):0>p&&p>-m?(b=new mxPoint(e+Math.floor(.5*g),f+Math.floor(1.5*k)),u=new mxPoint(e+Math.floor(1.25*g),f)):p<-m&&p>-q+m?(b=new mxPoint(e,f+k),u=new mxPoint(e+g,f+k)):p<-q+m&&p>-q&&(b=new mxPoint(e-Math.floor(.25*g),f),u=new mxPoint(e+Math.floor(.5*g),f+Math.floor(1.5*k)))}c=mxUtils.intersection(l,a,c.x,c.y,b.x,b.y,u.x,u.y)}return null==c?new mxPoint(l,a):c}}; function mxPrintPreview(a,b,c,d,e,f,g,k,l){this.graph=a;this.scale=null!=b?b:1/a.pageScale;this.border=null!=d?d:0;this.pageFormat=mxRectangle.fromRectangle(null!=c?c:a.pageFormat);this.title=null!=k?k:"Printer-friendly version";this.x0=null!=e?e:0;this.y0=null!=f?f:0;this.borderColor=g;this.pageSelector=null!=l?l:!0}mxPrintPreview.prototype.graph=null;mxPrintPreview.prototype.pageFormat=null;mxPrintPreview.prototype.addPageCss=!1;mxPrintPreview.prototype.pixelsPerInch=100; mxPrintPreview.prototype.pageMargin=27;mxPrintPreview.prototype.overflowClipMargin="1px";mxPrintPreview.prototype.gridSize=null;mxPrintPreview.prototype.gridSteps=null;mxPrintPreview.prototype.gridColor=null;mxPrintPreview.prototype.gridStrokeWidth=.5;mxPrintPreview.prototype.defaultCss="@media screen {\n body {\n background: gray;\n zoom: 0.7;\n }\n body > div {\n margin-bottom: 20px;\n box-sizing: border-box;\n }\n a, a * {\n pointer-events: none;\n }\n}\n@media print {\n body {\n margin: 0px;\n }\n * {\n -webkit-print-color-adjust: exact;\n }\n}"; mxPrintPreview.prototype.scale=null;mxPrintPreview.prototype.border=0;mxPrintPreview.prototype.marginTop=0;mxPrintPreview.prototype.marginBottom=0;mxPrintPreview.prototype.x0=0;mxPrintPreview.prototype.y0=0;mxPrintPreview.prototype.autoOrigin=!0;mxPrintPreview.prototype.printOverlays=!1;mxPrintPreview.prototype.printControls=!1;mxPrintPreview.prototype.printBackgroundImage=!1;mxPrintPreview.prototype.backgroundColor="#ffffff";mxPrintPreview.prototype.borderColor=null; mxPrintPreview.prototype.title=null;mxPrintPreview.prototype.pageSelector=null;mxPrintPreview.prototype.wnd=null;mxPrintPreview.prototype.targetWindow=null;mxPrintPreview.prototype.pageCount=0;mxPrintPreview.prototype.clipping=!0;mxPrintPreview.prototype.getWindow=function(){return this.wnd}; mxPrintPreview.prototype.getDoctype=function(){var a="";8==document.documentMode?a='<meta http-equiv="X-UA-Compatible" content="IE=8">':8<document.documentMode&&(a='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]--\x3e');return a};mxPrintPreview.prototype.appendGraph=function(a,b,c,d,e,f,g,k,l){this.graph=a;this.scale=null!=b?b:1/a.pageScale;this.x0=c;this.y0=d;this.open(null,null,e,f,g,k,l)}; mxPrintPreview.prototype.getPageClassCss=function(a,b){var c=this.pageMargin,d=this.pixelsPerInch,e=(b.width/d).toFixed(2)+"in "+(b.height/d).toFixed(2)+"in";b="@page "+a+" {\n margin: 0;\n size: "+mxUtils.htmlEntities(e)+";\n}\n."+a+" {\n page: "+a+";\n"+(mxClient.IS_SF?" padding: "+mxUtils.htmlEntities((c/d).toFixed(2))+"in;\n":"")+" width: "+mxUtils.htmlEntities((b.width/d).toFixed(2))+"in;\n height: "+mxUtils.htmlEntities((b.height/d).toFixed(2))+"in;\n}\n";mxClient.IS_SF||(b+="."+a+" > svg {\n margin: "+ mxUtils.htmlEntities((c/d).toFixed(2))+"in;\n}\n");return b}; mxPrintPreview.prototype.open=function(a,b,c,d,e,f,g){c=null;try{var k=this.graph.cellRenderer.initializeOverlay,l=null!=f;f=mxRectangle.fromRectangle(null!=f?f:this.pageFormat);var m=f.width+1,n=f.height+1;this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(H,F){F.init(H.view.getDrawPane())});this.printControls&&(this.graph.cellRenderer.initControl=function(H,F,J,I){F.dialect=H.view.graph.dialect;F.init(H.view.getDrawPane())});this.wnd=null!=b?b:this.wnd;b=!1;null==this.wnd&& (b=!0,this.wnd=window.open());var p=this.wnd.document;if(b){var q=this.getDoctype();null!=q&&0<q.length&&p.writeln(q);"CSS1Compat"===document.compatMode&&p.writeln("<!DOCTYPE html>");p.writeln("<html>");p.writeln("<head>");this.writeHead(p,a);p.writeln("</head>");p.writeln("<body>")}var r=mxRectangle.fromRectangle(null!=g?this.graph.getBoundingBox(g):this.graph.getGraphBounds()),t=this.graph.getView().getScale(),u=t/this.scale,v=this.graph.getView().getTranslate();this.autoOrigin||(this.x0-=v.x*this.scale, this.y0-=v.y*this.scale,r.width+=r.x,r.height+=r.y,r.x=0,this.border=r.y=0);var y=m-2*this.border,A=n-2*this.border;n+=this.marginTop+this.marginBottom;r.width/=u;r.height/=u;var z=Math.max(1,Math.ceil((r.width+this.x0)/y)),x=Math.max(1,Math.ceil((r.height+this.y0)/A));this.pageCount=z*x;var C=null;l&&(null==this.pendingCss&&(this.pageFormatClass={},this.pendingCss=""),C=mxUtils.htmlEntities("gePageFormat-"+String(f.width).replace(/\./g,"_")+"-"+String(f.height).replace(/\./g,"_")),null==this.pageFormatClass[C]&& (this.pageFormatClass[C]=!0,this.pendingCss+=this.getPageClassCss(C,f)));var D=mxUtils.bind(this,function(H){null!=this.borderColor&&(H.style.borderColor=this.borderColor,H.style.borderStyle="solid",H.style.borderWidth="1px");H.style.background=this.backgroundColor;null!=C?H.classList.add(C):(H.style.width=f.width+"px",H.style.height=f.height+"px");p.body.appendChild(H)}),B=this.getCoverPages(m,n);if(null!=B)for(var E=0;E<B.length;E++)D(B[E],!0);var K=this.getAppendices(m,n);for(E=0;E<x;E++){var G= E*A/this.scale-this.y0/this.scale+(r.y-v.y*t)/t-E;for(a=0;a<z;a++){if(null==this.wnd)return null;var L=a*y/this.scale-this.x0/this.scale+(r.x-v.x*t)/t-a;g=E*z+a+1;c=p.createElement("div");c.style.display="flex";c.style.alignItems="center";c.style.justifyContent="center";var Q=new mxRectangle(L,G,y,A);this.addGraphFragment(-L,-G,this.scale,g,c,Q);null!=e&&0==E&&0==a&&c.setAttribute("id",e);D(c,!0)}}if(null!=K)for(E=0;E<K.length;E++)D(K[E],E<K.length-1);b&&!d&&this.closeDocument();this.wnd.focus()}catch(H){null!= c&&null!=c.parentNode&&c.parentNode.removeChild(c),null!=window.console&&console.error(H)}finally{this.graph.cellRenderer.initializeOverlay=k}return this.wnd};mxPrintPreview.prototype.addPendingCss=function(a){if(null!=this.pendingCss){var b=a.createElement("style");b.setAttribute("type","text/css");b.appendChild(a.createTextNode(this.pendingCss));a.getElementsByTagName("head")[0].appendChild(b);this.pendingCss=null}}; mxPrintPreview.prototype.closeDocument=function(){try{if(null!=this.wnd&&null!=this.wnd.document){var a=this.wnd.document;this.writePostfix(a);a.writeln("</body>");a.writeln("</html>");a.close();this.addPendingCss(a);mxEvent.release(a.body)}}catch(b){}}; mxPrintPreview.prototype.writeHead=function(a,b){null!=this.title&&a.writeln("<title>"+mxUtils.htmlEntities(this.title)+"</title>");var c=mxClient.basePath;"/src"==c.substring(c.length-4)&&(c=c.substring(0,c.length-4));mxClient.link("stylesheet",c+"/css/common.css",a);a.writeln('<style type="text/css">');a.writeln(this.defaultCss);c=this.pageFormat;this.addPageCss&&null!=c&&(c=(c.width/this.pixelsPerInch).toFixed(2)+"in "+(c.height/this.pixelsPerInch).toFixed(2)+"in",a.writeln("@page {"),a.writeln(" margin: "+ mxUtils.htmlEntities((this.pageMargin/this.pixelsPerInch).toFixed(2))+"in;"),a.writeln(" size: "+mxUtils.htmlEntities(c)+";"),a.writeln("}"));null!=b&&a.writeln(mxUtils.htmlEntities(b,!1,!1,!1));a.writeln("</style>")};mxPrintPreview.prototype.writePostfix=function(a){};mxPrintPreview.prototype.getRoot=function(){var a=this.graph.view.currentRoot;null==a&&(a=this.graph.getModel().getRoot());return a};mxPrintPreview.prototype.useCssTransforms=function(){return!mxClient.NO_FO&&!mxClient.IS_SF}; mxPrintPreview.prototype.isCellVisible=function(a){return!0};mxPrintPreview.prototype.drawBackgroundImage=function(a){a.redraw()}; mxPrintPreview.prototype.addGraphFragment=function(a,b,c,d,e,f){var g=this.graph.getView();d=this.graph.container;this.graph.container=e;var k=g.getCanvas(),l=g.getBackgroundPane(),m=g.getDrawPane(),n=g.getOverlayPane(),p=c;if(this.graph.dialect==mxConstants.DIALECT_SVG){if(g.createSvg(),this.useCssTransforms()){var q=g.getDrawPane().parentNode;q.setAttribute("transformOrigin","0 0");q.setAttribute("transform","scale("+c+","+c+")translate("+a+","+b+")");c=1;b=a=0}}else g.createHtml();q=g.isEventsEnabled(); g.setEventsEnabled(!1);var r=this.graph.isEnabled();this.graph.setEnabled(!1);var t=g.getTranslate();g.translate=new mxPoint(a,b);var u=this.graph.selectionCellsHandler.updateHandler;this.graph.selectionCellsHandler.updateHandler=function(){};var v=this.graph.cellRenderer.redraw,y=g.states,A=g.scale,z=null;if(this.printBackgroundImage){var x=this.getBackgroundImage();null!=x&&(z=new mxRectangle(Math.round(a*A+x.x),Math.round(b*A+x.y),x.width-1,x.height-1),z=new mxImageShape(z,x.src),z.dialect=this.graph.dialect)}if(this.clipping){var C= new mxRectangle((f.x+t.x+1.5)*A,(f.y+t.y+1.5)*A,(f.width-1.5)*A/p,(f.height-1.5)*A/p),D=this;this.graph.cellRenderer.redraw=function(E,K,G){if(null!=E){var L=y.get(E.cell);if(null!=L&&(L=g.getBoundingBox(L,!1),null!=L&&0<L.width&&0<L.height&&!mxUtils.intersects(C,L))||!D.isCellVisible(E.cell))return}v.apply(this,arguments)};null!=z&&(a=new mxRectangle(z.bounds.x*A+(t.x-a)*A,z.bounds.y*A+(t.y-b)*A,z.bounds.width*A,z.bounds.height*A),mxUtils.intersects(C,a)||(z=null))}null!=z&&(z.init(g.backgroundPane), this.drawBackgroundImage(z));a=null;try{var B=[this.getRoot()];a=new mxTemporaryCellStates(g,c,B,null,mxUtils.bind(this,function(E){return this.getLinkForCellState(E)}))}finally{for(c=e.firstChild;null!=c;)e=c.nextSibling,"svg"==c.nodeName.toLowerCase()?(c.style.top="",c.style.left="",c.style.width="",c.style.height="",c.style.display="",c.style.maxWidth="100%",c.style.maxHeight="100%",c.style.overflow=mxClient.IS_SF?"hidden":"clip",c.style.overflowClipMargin=this.overflowClipMargin,c.setAttribute("viewBox", "0 0 "+(mxClient.IS_SF?f.width+1+" "+(f.height+1):f.width-1+" "+(f.height-1))),this.addGrid(c,f),mxClient.IS_SF&&(f.width>f.height?c.style.height="100%":c.style.width="100%")):this.isTextLabel(c)||c.parentNode.removeChild(c),c=e;g.overlayPane.parentNode.removeChild(g.overlayPane);this.graph.setEnabled(r);this.graph.container=d;this.graph.cellRenderer.redraw=v;this.graph.selectionCellsHandler.updateHandler=u;g.canvas=k;g.backgroundPane=l;g.drawPane=m;g.overlayPane=n;g.translate=t;a.destroy();g.setEventsEnabled(q)}}; mxPrintPreview.prototype.addGrid=function(a,b){0<this.gridSize&&0<this.gridSteps&&null!=this.gridColor&&(b=this.createSvgGrid(a,b),a=mxUtils.getSvgDefs(a),null!=a.nextSibling?a.parentNode.insertBefore(b,a.nextSibling):a.parentNode.appendChild(b))}; mxPrintPreview.prototype.createSvgGrid=function(a,b){var c=this.gridSize;a=a.ownerDocument;var d=null!=a.createElementNS?a.createElementNS(mxConstants.NS_SVG,"g"):a.createElement("g"),e=mxUtils.mod(Math.ceil(b.x/c),this.gridSteps),f=mxUtils.mod(c-mxUtils.mod(b.x,c),c),g=mxUtils.mod(Math.ceil(b.y/c),this.gridSteps),k=mxUtils.mod(c-mxUtils.mod(b.y,c),c);f*=this.scale;k*=this.scale;c*=this.scale;for(var l=Math.ceil(b.height/c),m=0;m<l;m++){var n=null!=a.createElementNS?a.createElementNS(mxConstants.NS_SVG, "line"):a.createElement("line");n.setAttribute("x1",0);n.setAttribute("y1",m*c+k);n.setAttribute("x2",b.width);n.setAttribute("y2",m*c+k);n.setAttribute("stroke",this.gridColor);n.setAttribute("opacity",0==mxUtils.mod(m+g,this.gridSteps)?"1":"0.2");n.setAttribute("stroke-width","0.5");d.appendChild(n)}g=Math.ceil(b.width/c);for(m=0;m<g;m++)n=null!=a.createElementNS?a.createElementNS(mxConstants.NS_SVG,"line"):a.createElement("line"),n.setAttribute("x1",m*c+f),n.setAttribute("y1",0),n.setAttribute("x2", m*c+f),n.setAttribute("y2",b.height),n.setAttribute("stroke",this.gridColor),n.setAttribute("opacity",0==mxUtils.mod(m+e,this.gridSteps)?"1":"0.2"),n.setAttribute("stroke-width","0.5"),d.appendChild(n);return d};mxPrintPreview.prototype.isTextLabel=function(a){return"default"==tmp.style.cursor||"div"==a.nodeName.toLowerCase()};mxPrintPreview.prototype.getLinkForCellState=function(a){return this.graph.getLinkForCell(a.cell)};mxPrintPreview.prototype.getBackgroundImage=function(){return this.graph.backgroundImage}; mxPrintPreview.prototype.getCoverPages=function(){return null};mxPrintPreview.prototype.getAppendices=function(){return null};mxPrintPreview.prototype.print=function(a){a=this.open(a);null!=a&&a.print()};mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)};function mxStylesheet(){this.styles={};this.putDefaultVertexStyle(this.createDefaultVertexStyle());this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())} mxStylesheet.prototype.createDefaultVertexStyle=function(){var a={};a[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE;a[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter;a[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE;a[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER;a[mxConstants.STYLE_FILLCOLOR]="#C3D9FF";a[mxConstants.STYLE_STROKECOLOR]="#6482B9";a[mxConstants.STYLE_FONTCOLOR]="#774400";return a}; mxStylesheet.prototype.createDefaultEdgeStyle=function(){var a={};a[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR;a[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC;a[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE;a[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER;a[mxConstants.STYLE_STROKECOLOR]="#6482B9";a[mxConstants.STYLE_FONTCOLOR]="#446299";return a};mxStylesheet.prototype.putDefaultVertexStyle=function(a){this.putCellStyle("defaultVertex",a)}; mxStylesheet.prototype.putDefaultEdgeStyle=function(a){this.putCellStyle("defaultEdge",a)};mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex};mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge};mxStylesheet.prototype.putCellStyle=function(a,b){"__proto__"!=a&&"constructor"!=a&&"prototype"!=a&&(this.styles[a]=b)}; mxStylesheet.prototype.getCellStyle=function(a,b,c){c=null!=c?c:!0;if(null!=a&&0<a.length){var d=a.split(";");b=null!=b&&";"!=a.charAt(0)?mxUtils.clone(b):{};for(a=0;a<d.length;a++){var e=d[a],f=e.indexOf("=");if(0<=f){var g=e.substring(0,f);e=e.substring(f+1);e==mxConstants.NONE&&c?delete b[g]:mxUtils.isNumeric(e)?b[g]=parseFloat(e):b[g]=e}else if(e=Object.prototype.hasOwnProperty.call(this.styles,e)?this.styles[e]:null,null!=e)for(g in e)b[g]=e[g]}}return b}; function mxCellState(a,b,c){this.view=a;this.cell=b;this.style=null!=c?c:{};this.origin=new mxPoint;this.absoluteOffset=new mxPoint}mxCellState.prototype=new mxRectangle;mxCellState.prototype.constructor=mxCellState;mxCellState.prototype.view=null;mxCellState.prototype.cell=null;mxCellState.prototype.style=null;mxCellState.prototype.invalidStyle=!1;mxCellState.prototype.invalid=!0;mxCellState.prototype.origin=null;mxCellState.prototype.absolutePoints=null;mxCellState.prototype.absoluteOffset=null; mxCellState.prototype.visibleSourceState=null;mxCellState.prototype.visibleTargetState=null;mxCellState.prototype.terminalDistance=0;mxCellState.prototype.length=0;mxCellState.prototype.segments=null;mxCellState.prototype.shape=null;mxCellState.prototype.text=null;mxCellState.prototype.unscaledWidth=null;mxCellState.prototype.unscaledHeight=null; mxCellState.prototype.getPerimeterBounds=function(a,b){a=a||0;b=null!=b?b:new mxRectangle(this.x,this.y,this.width,this.height);if(null!=this.shape&&null!=this.shape.stencil&&"fixed"==this.shape.stencil.aspect){var c=this.style[mxConstants.STYLE_DIRECTION],d=c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH;c=d?this.shape.stencil.h0:this.shape.stencil.w0;d=d?this.shape.stencil.w0:this.shape.stencil.h0;var e=Math.min(b.width/c,b.height/d);b.x+=(b.width-c*e)/2;b.y+=(b.height-d*e)/2;b.width= c*e;b.height=d*e}0!=a&&b.grow(a);return b};mxCellState.prototype.setAbsoluteTerminalPoint=function(a,b){b?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(a):this.absolutePoints[0]=a):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(a)):1==this.absolutePoints.length?this.absolutePoints.push(a):this.absolutePoints[this.absolutePoints.length-1]=a}; mxCellState.prototype.setCursor=function(a){null!=this.shape&&this.shape.setCursor(a);null!=this.text&&this.text.setCursor(a)};mxCellState.prototype.isFloatingTerminalPoint=function(a){var b=this.getVisibleTerminalState(a);if(null==b)return!1;a=this.view.graph.getConnectionConstraint(this,b,a);return null==a||null==a.point};mxCellState.prototype.getVisibleTerminal=function(a){a=this.getVisibleTerminalState(a);return null!=a?a.cell:null}; mxCellState.prototype.getVisibleTerminalState=function(a){return a?this.visibleSourceState:this.visibleTargetState};mxCellState.prototype.setVisibleTerminalState=function(a,b){b?this.visibleSourceState=a:this.visibleTargetState=a};mxCellState.prototype.getCellBounds=function(){return this.cellBounds};mxCellState.prototype.getPaintBounds=function(){return this.paintBounds}; mxCellState.prototype.updateCachedBounds=function(){var a=this.view.translate,b=this.view.scale;this.cellBounds=new mxRectangle(this.x/b-a.x,this.y/b-a.y,this.width/b,this.height/b);this.paintBounds=mxRectangle.fromRectangle(this.cellBounds);null!=this.shape&&this.shape.isPaintBoundsInverted()&&this.paintBounds.rotate90()}; mxCellState.prototype.setState=function(a){this.view=a.view;this.cell=a.cell;this.style=a.style;this.absolutePoints=a.absolutePoints;this.origin=a.origin;this.absoluteOffset=a.absoluteOffset;this.boundingBox=a.boundingBox;this.terminalDistance=a.terminalDistance;this.segments=a.segments;this.length=a.length;this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;this.unscaledWidth=a.unscaledWidth;this.unscaledHeight=a.unscaledHeight}; mxCellState.prototype.clone=function(){var a=new mxCellState(this.view,this.cell,null!=this.style?mxUtils.clone(this.style):null);if(null!=this.absolutePoints){a.absolutePoints=[];for(var b=0;b<this.absolutePoints.length;b++)a.absolutePoints[b]=null!=this.absolutePoints[b]?this.absolutePoints[b].clone():null}null!=this.origin&&(a.origin=this.origin.clone());null!=this.absoluteOffset&&(a.absoluteOffset=this.absoluteOffset.clone());null!=this.boundingBox&&(a.boundingBox=this.boundingBox.clone());a.terminalDistance= this.terminalDistance;a.segments=this.segments;a.length=this.length;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;a.unscaledWidth=this.unscaledWidth;a.unscaledHeight=this.unscaledHeight;return a};mxCellState.prototype.destroy=function(){this.view.graph.cellRenderer.destroy(this)};function mxGraphSelectionModel(a){this.graph=a;this.cells=[]}mxGraphSelectionModel.prototype=new mxEventSource;mxGraphSelectionModel.prototype.constructor=mxGraphSelectionModel; mxGraphSelectionModel.prototype.doneResource="none"!=mxClient.language?"done":"";mxGraphSelectionModel.prototype.updatingSelectionResource="none"!=mxClient.language?"updatingSelection":"";mxGraphSelectionModel.prototype.graph=null;mxGraphSelectionModel.prototype.singleSelection=!1;mxGraphSelectionModel.prototype.isSingleSelection=function(){return this.singleSelection};mxGraphSelectionModel.prototype.setSingleSelection=function(a){this.singleSelection=a}; mxGraphSelectionModel.prototype.isSelected=function(a){return null!=a?0<=mxUtils.indexOf(this.cells,a):!1};mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length};mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)};mxGraphSelectionModel.prototype.setCell=function(a){null!=a&&this.setCells([a])}; mxGraphSelectionModel.prototype.setCells=function(a){if(null!=a){this.singleSelection&&(a=[this.getFirstSelectableCell(a)]);for(var b=[],c=0;c<a.length;c++)this.graph.isCellSelectable(a[c])&&b.push(a[c]);this.changeSelection(b,this.cells)}};mxGraphSelectionModel.prototype.getFirstSelectableCell=function(a){if(null!=a)for(var b=0;b<a.length;b++)if(this.graph.isCellSelectable(a[b]))return a[b];return null};mxGraphSelectionModel.prototype.addCell=function(a){null!=a&&this.addCells([a])}; mxGraphSelectionModel.prototype.addCells=function(a){if(null!=a){var b=null;this.singleSelection&&(b=this.cells,a=[this.getFirstSelectableCell(a)]);for(var c=[],d=0;d<a.length;d++)!this.isSelected(a[d])&&this.graph.isCellSelectable(a[d])&&c.push(a[d]);this.changeSelection(c,b)}};mxGraphSelectionModel.prototype.removeCell=function(a){null!=a&&this.removeCells([a])}; mxGraphSelectionModel.prototype.removeCells=function(a){if(null!=a){for(var b=[],c=0;c<a.length;c++)this.isSelected(a[c])&&b.push(a[c]);this.changeSelection(null,b)}};mxGraphSelectionModel.prototype.changeSelection=function(a,b){if(null!=a&&0<a.length&&null!=a[0]||null!=b&&0<b.length&&null!=b[0])a=new mxSelectionChange(this,a,b),a.execute(),b=new mxUndoableEdit(this,!1),b.add(a),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",b))}; mxGraphSelectionModel.prototype.cellAdded=function(a){null==a||this.isSelected(a)||this.cells.push(a)};mxGraphSelectionModel.prototype.cellRemoved=function(a){null!=a&&(a=mxUtils.indexOf(this.cells,a),0<=a&&this.cells.splice(a,1))};function mxSelectionChange(a,b,c){this.selectionModel=a;this.added=null!=b?b.slice():null;this.removed=null!=c?c.slice():null} mxSelectionChange.prototype.execute=function(){var a=mxLog.enter("mxSelectionChange.execute");window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource;if(null!=this.removed)for(var b=0;b<this.removed.length;b++)this.selectionModel.cellRemoved(this.removed[b]);if(null!=this.added)for(b=0;b<this.added.length;b++)this.selectionModel.cellAdded(this.added[b]);b=this.added;this.added=this.removed;this.removed=b;window.status=mxResources.get(this.selectionModel.doneResource)|| this.selectionModel.doneResource;mxLog.leave("mxSelectionChange.execute",a);this.selectionModel.fireEvent(new mxEventObject(mxEvent.CHANGE,"added",this.added,"removed",this.removed))}; function mxCellEditor(a){this.graph=a;this.zoomHandler=mxUtils.bind(this,function(){this.graph.isEditing()&&this.resize()});null!=this.graph.container&&mxEvent.addListener(this.graph.container,"scroll",this.zoomHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.zoomHandler);this.graph.view.addListener(mxEvent.SCALE,this.zoomHandler);this.changeHandler=mxUtils.bind(this,function(b){null!=this.editingCell&&(b=this.graph.getView().getState(this.editingCell),null==b?this.stopEditing(!0): this.updateTextAreaStyle(b))});this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)}mxCellEditor.prototype.graph=null;mxCellEditor.prototype.textarea=null;mxCellEditor.prototype.editingCell=null;mxCellEditor.prototype.trigger=null;mxCellEditor.prototype.modified=!1;mxCellEditor.prototype.autoSize=!0;mxCellEditor.prototype.selectText=!0;mxCellEditor.prototype.rotateText=!0;mxCellEditor.prototype.emptyLabelText=mxClient.IS_FF?"<br>":"";mxCellEditor.prototype.escapeCancelsEditing=!0; mxCellEditor.prototype.textNode=null;mxCellEditor.prototype.zIndex=1;mxCellEditor.prototype.minResize=new mxRectangle(0,20);mxCellEditor.prototype.blurEnabled=!1;mxCellEditor.prototype.initialValue=null;mxCellEditor.prototype.align=null;mxCellEditor.prototype.init=function(){this.textarea=document.createElement("div");this.textarea.className="mxCellEditor mxPlainTextEditor";this.textarea.contentEditable=!0;mxClient.IS_GC&&(this.textarea.style.minHeight="1em");this.installListeners(this.textarea)}; mxCellEditor.prototype.applyValue=function(a,b){this.graph.labelChanged(a.cell,b,this.trigger)};mxCellEditor.prototype.setAlign=function(a){var b=this.graph.getView().getState(this.editingCell);null!=this.textarea&&null!=b&&(b=mxUtils.getValue(b.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION),null==b||"vertical-"!=b.substring(0,9))&&(this.textarea.style.textAlign=a);this.align=a;this.resize()}; mxCellEditor.prototype.getInitialValue=function(a,b){a=mxUtils.htmlEntities(this.graph.getEditingValue(a.cell,b),!1);a=mxUtils.replaceTrailingNewlines(a,"<div><br></div>");return a.replace(/\n/g,"<br>")};mxCellEditor.prototype.getCurrentValue=function(a){return mxUtils.extractTextWithWhitespace(this.textarea.childNodes)};mxCellEditor.prototype.isCancelEditingKeyEvent=function(a){return this.escapeCancelsEditing||mxEvent.isShiftDown(a)||mxEvent.isControlDown(a)||mxEvent.isMetaDown(a)}; mxCellEditor.prototype.installListeners=function(a){mxEvent.addListener(a,"dragstart",mxUtils.bind(this,function(e){this.graph.stopEditing(!1);mxEvent.consume(e)}));mxEvent.addListener(a,"blur",mxUtils.bind(this,function(e){this.blurEnabled&&this.focusLost(e)}));var b=this.graph.container.scrollTop,c=this.graph.container.scrollLeft;mxEvent.addListener(a,"keydown",mxUtils.bind(this,function(e){b=this.graph.container.scrollTop;c=this.graph.container.scrollLeft;mxEvent.isConsumed(e)||(this.isStopEditingEvent(e)? (this.graph.stopEditing(!1),mxEvent.consume(e)):27==e.keyCode&&(this.graph.stopEditing(this.isCancelEditingKeyEvent(e)),mxEvent.consume(e)))}));var d=mxUtils.bind(this,function(e){null!=this.editingCell&&this.clearOnChange&&a.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||8!=e.keyCode&&46!=e.keyCode)&&(this.clearOnChange=!1,a.innerText="")});mxEvent.addListener(a,"keypress",d);mxEvent.addListener(a,"paste",d);mxEvent.addListener(a,"compositionstart",mxUtils.bind(this,function(e){null!=this.editingCell&& this.clearOnChange&&a.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,a.innerText="")}));d=mxUtils.bind(this,function(e){null!=this.editingCell&&(this.graph.container.scrollTop=b,this.graph.container.scrollLeft=c,a.scrollIntoView({block:"nearest",inline:"nearest"}),0!=this.textarea.innerHTML.length&&"<br>"!=this.textarea.innerHTML||this.textarea.innerHTML==this.getEmptyLabelText()?this.clearOnChange=!1:(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length))}); mxEvent.addListener(a,"input",d);mxEvent.addListener(a,"cut",d);mxEvent.addListener(a,"paste",d);d=mxUtils.bind(this,function(e){null!=this.editingCell&&this.autoSize&&!mxEvent.isConsumed(e)&&(null!=this.resizeThread&&window.clearTimeout(this.resizeThread),this.resizeThread=window.setTimeout(mxUtils.bind(this,function(){this.resizeThread=null;null!=document.body&&this.resize()}),0))});mxEvent.addListener(a,"input",d);mxEvent.addListener(window,"resize",d);mxEvent.addListener(a,"cut",d);mxEvent.addListener(a, "paste",d)};mxCellEditor.prototype.isStopEditingEvent=function(a){return 113==a.keyCode||this.graph.isEnterStopsCellEditing()&&13==a.keyCode&&!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)};mxCellEditor.prototype.isEventSource=function(a){return mxEvent.getSource(a)==this.textarea}; mxCellEditor.prototype.resize=function(){var a=this.graph.getView().getState(this.editingCell);if(null==a)this.stopEditing(!0);else if(null!=this.textarea){var b=mxUtils.getAlignmentAsPoint(null!=this.align?this.align:this.textShape.align,this.textShape.valign);this.bounds=this.graph.cellRenderer.getLabelBounds(a,this.textShape,b,!this.rotateText);var c=this.rotateText?this.textShape.getTextRotation():0,d=this.graph.getView().scale;this.bounds.x+=-.5==b.x?0:0==b.x?-d:d;this.bounds.y+=-.5==b.y?0:0== b.y?-d:d;this.textarea.style.left=Math.max(0,Math.round(this.bounds.x))+"px";this.textarea.style.top=Math.max(0,Math.round(this.bounds.y))+"px";if(this.autoSize&&"fill"!=a.style[mxConstants.STYLE_OVERFLOW]){var e="1"==mxUtils.getValue(a.style,"convertToSvg","0")&&"wrap"==a.style.svgWhiteSpace;if(this.graph.isWrapping(a.cell)&&(2<=this.bounds.width||2<=this.bounds.height)&&(e||null==a.text||null==a.text.node||0==a.text.node.getElementsByTagName("text").length))if(e=mxUtils.getValue(a.style,mxConstants.STYLE_TEXT_DIRECTION, mxConstants.DEFAULT_TEXT_DIRECTION),e=null!=e&&"vertical-"==e.substring(0,9),this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal","block"==a.style[mxConstants.STYLE_OVERFLOW]||"width"==a.style[mxConstants.STYLE_OVERFLOW]?this.bounds.width-=2*d:a.view.graph.isHtmlLabel(a.cell)&&(this.bounds.width+=mxSvgCanvas2D.prototype.foreignObjectPadding*d),this.textarea.innerHTML!=this.getEmptyLabelText())if("block"==a.style[mxConstants.STYLE_OVERFLOW]||"width"==a.style[mxConstants.STYLE_OVERFLOW]){if(-.5== b.y||"width"==a.style[mxConstants.STYLE_OVERFLOW])this.textarea.style.maxHeight=Math.round(this.bounds.height/d)+"px";this.textarea.style.width=Math.round(this.bounds.width/d)+"px"}else e?this.textarea.style.maxHeight=Math.round(this.bounds.height/d)+"px":this.textarea.style.maxWidth=Math.round(this.bounds.width/d)+"px";else this.textarea.style.maxWidth=Math.round(this.bounds.width/d)+"px";else this.textarea.style.whiteSpace="nowrap",this.textarea.style.width=""}else this.textarea.style.width=Math.round(this.bounds.width/ d)+"px",this.textarea.style.height=Math.round(this.bounds.height/d)+"px",this.graph.isWrapping(a.cell)&&(2<=this.bounds.width||2<=this.bounds.height)&&this.textarea.innerHTML!=this.getEmptyLabelText()?(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal","fill"!=a.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=Math.round(this.bounds.width/d)+"px")):(this.textarea.style.whiteSpace="nowrap","fill"!=a.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width= ""));mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px");mxUtils.setPrefixedStyle(this.textarea.style,"transform",(0!=c?"rotate("+c+"deg) ":"")+"scale("+d+","+d+") translate("+100*b.x+"%,"+100*b.y+"%)")}};mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())};mxCellEditor.prototype.getBackgroundColor=function(a){return null};mxCellEditor.prototype.getBorderColor=function(a){return null}; mxCellEditor.prototype.updateTextAreaStyle=function(a){var b=mxUtils.getValue(a.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),c=mxUtils.getValue(a.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),d=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,e=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,f=[],g=this.graph.getCellStyle(this.graph.model.getParent(a.cell), !0);"inherit"==b&&(b=null!=g?mxUtils.getValue(g,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE):mxConstants.DEFAULT_FONTSIZE);"inherit"==c&&(c=null!=g?mxUtils.getValue(g,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY):mxConstants.DEFAULT_FONTFAMILY);(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&f.push("underline");(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&& f.push("line-through");0<f.length&&(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&f.push("dotted");this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(b*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.textDecoration=f.join(" ");this.textarea.style.fontWeight=d?"bold":"normal";this.textarea.style.fontStyle=e?"italic":"";this.textarea.style.fontSize=Math.round(b)+"px";this.textarea.style.zIndex= this.zIndex;this.textarea.style.fontFamily=mxUtils.parseCssFontFamily(c);this.textarea.style.writingMode="";b=mxUtils.getValue(a.style,mxConstants.STYLE_FONTCOLOR);if(null==b||b==mxConstants.NONE)b=this.graph.shapeForegroundColor;this.textarea.style.color=mxUtils.getLightDarkColor(b).cssText;b=this.getBackgroundColor(a);this.textarea.style.backgroundColor=null!=b?mxUtils.getLightDarkColor(b).cssText:"transparent";b=this.getBorderColor(a);this.textarea.style.border=null!=b?"1px solid "+mxUtils.getLightDarkColor(b).cssText: "1px solid transparent";b=mxUtils.getValue(a.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);c=mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT);this.textarea.removeAttribute("dir");b!=mxConstants.TEXT_DIRECTION_AUTO||null==a||null==a.text||a.text.dialect==mxConstants.DIALECT_STRICTHTML||mxUtils.isNode(a.text.value)||(b=a.text.getAutoDirection());if(b==mxConstants.TEXT_DIRECTION_LTR||b==mxConstants.TEXT_DIRECTION_RTL)this.textarea.setAttribute("dir", b);else if(b==mxConstants.TEXT_DIRECTION_VERTICAL_LR||b==mxConstants.TEXT_DIRECTION_VERTICAL_RL)a=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),c=a==mxConstants.ALIGN_TOP?"left":a==mxConstants.ALIGN_BOTTOM?"right":"center",this.textarea.style.writingMode=b;this.textarea.style.textAlign=c};mxCellEditor.prototype.setEditingValue=function(a,b){this.textarea.innerHTML=b}; mxCellEditor.prototype.startEditing=function(a,b,c){this.stopEditing(!0);this.align=null;null==this.textarea&&this.init();null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.hideTooltip();var d=this.graph.getView().getState(a);null!=d&&(this.updateTextAreaStyle(d),this.setEditingValue(d,this.getInitialValue(d,b)||""),this.initialValue=this.textarea.innerHTML,0==this.textarea.innerHTML.length||"<br>"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange= !0):this.clearOnChange=this.textarea.innerHTML==this.getEmptyLabelText(),this.textShape=d.text,this.editingCell=a,this.trigger=b,null==this.textShape&&(this.textShape=this.graph.cellRenderer.createTextShape(d,"",this.graph.dialect)),a=mxUtils.bind(this,function(){if(null!=this.editingCell)if(null!=this.textShape&&null!=this.textShape.node&&this.isHideLabel(d)&&(this.textNode=this.textShape.node,this.textNode.style.visibility="hidden"),this.resize(),this.graph.container.appendChild(this.textarea), mxClient.IS_IOS&&(this.graph.container.scrollTop=Math.max(this.graph.container.scrollTop,d.y+d.height-this.graph.container.clientHeight/3)),this.textarea.scrollIntoView({block:"nearest",inline:"nearest"}),this.textarea.focus(),null!=c){this.textarea.innerHTML=c;var e=document.createRange();e.selectNodeContents(this.textarea);e.collapse(!1);var f=window.getSelection();f.removeAllRanges();f.addRange(e)}else this.isSelectText()&&0<this.textarea.innerHTML.length&&(this.textarea.innerHTML!=this.getEmptyLabelText()|| !this.clearOnChange)&&document.execCommand("selectAll",!1,null)}),mxClient.IS_IOS||this.editByTyping?(this.editByTyping=!1,a()):window.setTimeout(a,0))};mxCellEditor.prototype.isSelectText=function(){return this.selectText};mxCellEditor.prototype.clearSelection=function(){var a=null;window.getSelection?a=window.getSelection():document.selection&&(a=document.selection);null!=a&&(a.empty?a.empty():a.removeAllRanges&&a.removeAllRanges())}; mxCellEditor.prototype.stopEditing=function(a){if(null!=this.editingCell){null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null);a=a?null:this.graph.view.getState(this.editingCell);var b=this.initialValue;this.bounds=this.trigger=this.textShape=this.editingCell=this.initialValue=null;this.textarea.blur();this.clearSelection();null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea);this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&& (this.textarea.innerText="",this.clearOnChange=!1);if(null!=a&&(this.textarea.innerHTML!=b||null!=this.align)){this.prepareTextarea();b=this.getCurrentValue(a);this.graph.getModel().beginUpdate();try{null!=b&&this.applyValue(a,b),null!=this.align&&this.graph.setCellStyles(mxConstants.STYLE_ALIGN,this.align,[a.cell])}finally{this.graph.getModel().endUpdate()}}mxEvent.release(this.textarea);this.align=this.textarea=null}}; mxCellEditor.prototype.prepareTextarea=function(){null!=this.textarea.lastChild&&"BR"==this.textarea.lastChild.nodeName&&this.textarea.removeChild(this.textarea.lastChild)};mxCellEditor.prototype.isHideLabel=function(a){return!0};mxCellEditor.prototype.getMinimumSize=function(a){var b=this.graph.getView().scale;return new mxRectangle(0,0,null==a.text?30:a.text.size*b+20,"left"==this.textarea.style.textAlign?120:40)};mxCellEditor.prototype.getEmptyLabelText=function(a){return this.emptyLabelText}; mxCellEditor.prototype.getEditingCell=function(){return this.editingCell}; mxCellEditor.prototype.destroy=function(){null!=this.textarea&&(mxEvent.release(this.textarea),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);this.zoomHandler&&(null!=this.graph.container&&mxEvent.removeListener(this.graph.container,"scroll",this.zoomHandler),this.graph.view.removeListener(this.zoomHandler),this.zoomHandler=null)}; function mxCellRenderer(){}mxCellRenderer.defaultShapes=Object.create(null);mxCellRenderer.prototype.defaultEdgeShape=mxConnector;mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape;mxCellRenderer.prototype.defaultTextShape=mxText;mxCellRenderer.prototype.legacyControlPosition=!0;mxCellRenderer.prototype.legacySpacing=!0;mxCellRenderer.prototype.antiAlias=!0;mxCellRenderer.prototype.minSvgStrokeWidth=1;mxCellRenderer.prototype.forceControlClickHandler=!1; mxCellRenderer.registerShape=function(a,b){mxCellRenderer.defaultShapes[a]=b};mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape);mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse);mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus);mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder);mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector);mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor); mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle);mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon);mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud);mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine);mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow);mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW_CONNECTOR,mxArrowConnector);mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse); mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane);mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape);mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel);mxCellRenderer.prototype.initializeShape=function(a){a.shape.dialect=a.view.graph.dialect;this.configureShape(a);a.shape.init(a.view.getDrawPane())}; mxCellRenderer.prototype.createShape=function(a){var b=null;null!=a.style&&(b=a.style[mxConstants.STYLE_SHAPE],b=null==mxCellRenderer.defaultShapes[b]?mxStencilRegistry.getStencil(b):null,b=null!=b?new mxShape(b):new (this.getShapeConstructor(a)));return b};mxCellRenderer.prototype.createIndicatorShape=function(a){a.shape.indicatorShape=this.getShape(a.view.graph.getIndicatorShape(a))};mxCellRenderer.prototype.getShape=function(a){return null!=a?mxCellRenderer.defaultShapes[a]:null}; mxCellRenderer.prototype.getShapeConstructor=function(a){var b=this.getShape(a.style[mxConstants.STYLE_SHAPE]);null==b&&(b=a.view.graph.getModel().isEdge(a.cell)?this.defaultEdgeShape:this.defaultVertexShape);return b}; mxCellRenderer.prototype.configureShape=function(a){a.shape.apply(a);a.shape.image=a.view.graph.getImage(a);a.shape.indicatorColor=a.view.graph.getIndicatorColor(a);a.shape.indicatorStrokeColor=a.style[mxConstants.STYLE_INDICATOR_STROKECOLOR];a.shape.indicatorGradientColor=a.view.graph.getIndicatorGradientColor(a);a.shape.indicatorDirection=a.style[mxConstants.STYLE_INDICATOR_DIRECTION];a.shape.indicatorImage=a.view.graph.getIndicatorImage(a);this.postConfigureShape(a)}; mxCellRenderer.prototype.postConfigureShape=function(a){null!=a.shape&&(this.resolveColor(a,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(a,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(a,"gradient",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(a,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(a,"fill",mxConstants.STYLE_FILLCOLOR))}; mxCellRenderer.prototype.checkPlaceholderStyles=function(a){if(null!=a.style){if("inherit"==a.style[mxConstants.STYLE_FONTSIZE]||"inherit"==a.style[mxConstants.STYLE_FONTFAMILY])return!0;for(var b=[mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_FONTCOLOR],c=a.view.graph,d=0;d<b.length;d++)if(0<=c.isSpecialColor(a.style[b[d]]))return!0}return!1}; mxCellRenderer.prototype.inheritFontStyle=function(a,b,c){if(null!=a.text&&"inherit"==a.text[b]){var d=a.view.graph;d=d.getView().getState(d.model.getParent(a.cell));null!=d&&(a.text[b]=d.style[c])}}; mxCellRenderer.prototype.resolveColor=function(a,b,c){var d=c==mxConstants.STYLE_FONTCOLOR?a.text:a.shape;if(null!=d){var e=a.view.graph,f=d[b],g=null;"inherit"==f||f==mxConstants.STYLE_FILLCOLOR||f==mxConstants.STYLE_STROKECOLOR?(g=e.model.getParent(a.cell),"inherit"!=f&&(c=f)):"swimlane"==f?(d[b]=c==mxConstants.STYLE_STROKECOLOR||c==mxConstants.STYLE_FONTCOLOR?"#000000":"#ffffff",g=null!=e.model.getTerminal(a.cell,!1)?e.model.getTerminal(a.cell,!1):a.cell,g=e.getSwimlane(g),c=e.swimlaneIndicatorColorAttribute): "indicated"==f&&null!=a.shape?d[b]=a.shape.indicatorColor:c!=mxConstants.STYLE_FILLCOLOR&&f==mxConstants.STYLE_FILLCOLOR&&null!=a.shape?d[b]=a.style[mxConstants.STYLE_FILLCOLOR]:c!=mxConstants.STYLE_STROKECOLOR&&f==mxConstants.STYLE_STROKECOLOR&&null!=a.shape&&(d[b]=a.style[mxConstants.STYLE_STROKECOLOR]);null!=g&&(a=e.getView().getState(g),d[b]=null,null!=a&&(e=c==mxConstants.STYLE_FONTCOLOR?a.text:a.shape,d[b]=null!=e&&"indicatorColor"!=b&&f!=mxConstants.STYLE_STROKECOLOR&&f!=mxConstants.STYLE_FILLCOLOR? e[b]:a.style[c]))}};mxCellRenderer.prototype.getLabelValue=function(a){return a.view.graph.getLabel(a.cell)}; mxCellRenderer.prototype.createTextShape=function(a,b,c){var d=a.view.graph;b=new this.defaultTextShape(b,new mxRectangle,a.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,d.getVerticalAlign(a),a.style[mxConstants.STYLE_FONTCOLOR],a.style[mxConstants.STYLE_FONTFAMILY],a.style[mxConstants.STYLE_FONTSIZE],a.style[mxConstants.STYLE_FONTSTYLE],a.style[mxConstants.STYLE_SPACING],a.style[mxConstants.STYLE_SPACING_TOP],a.style[mxConstants.STYLE_SPACING_RIGHT],a.style[mxConstants.STYLE_SPACING_BOTTOM], a.style[mxConstants.STYLE_SPACING_LEFT],a.style[mxConstants.STYLE_HORIZONTAL],a.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],a.style[mxConstants.STYLE_LABEL_BORDERCOLOR],d.isWrapping(a.cell)&&d.isHtmlLabel(a.cell),d.isLabelClipped(a.cell),a.style[mxConstants.STYLE_OVERFLOW],a.style[mxConstants.STYLE_LABEL_PADDING],mxUtils.getValue(a.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION));b.opacity=mxUtils.getValue(a.style,mxConstants.STYLE_TEXT_OPACITY,100);b.convertToSvg="1"== mxUtils.getValue(a.style,"convertToSvg","0");b.dialect=c;b.style=a.style;b.state=a;return b}; mxCellRenderer.prototype.createLabel=function(a,b){var c=a.view.graph;if(0<a.style[mxConstants.STYLE_FONTSIZE]||null==a.style[mxConstants.STYLE_FONTSIZE]||"inherit"==a.style[mxConstants.STYLE_FONTSIZE]){var d=c.isHtmlLabel(a.cell)||null!=b&&mxUtils.isNode(b);a.text=this.createTextShape(a,b,d?mxConstants.DIALECT_STRICTHTML:a.view.graph.dialect);this.initializeLabel(a,a.text);this.configureShape(a);var e=!1,f=function(g){var k=a;if(mxClient.IS_TOUCH||e)k=mxEvent.getClientX(g),g=mxEvent.getClientY(g), g=mxUtils.convertPoint(c.container,k,g),k=c.view.getState(c.getCellAt(g.x,g.y));return k};mxEvent.addGestureListeners(a.text.node,mxUtils.bind(this,function(g){this.isLabelEvent(a,g)&&(c.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(g,a)),e=c.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(g).nodeName)}),mxUtils.bind(this,function(g){this.isLabelEvent(a,g)&&c.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(g,f(g)))}),mxUtils.bind(this,function(g){this.isLabelEvent(a,g)&&(c.fireMouseEvent(mxEvent.MOUSE_UP, new mxMouseEvent(g,f(g))),e=!1)}));c.nativeDblClickEnabled&&mxEvent.addListener(a.text.node,"dblclick",mxUtils.bind(this,function(g){this.isLabelEvent(a,g)&&(c.dblClick(g,a.cell),mxEvent.consume(g))}))}};mxCellRenderer.prototype.initializeLabel=function(a,b){mxClient.IS_SVG&&mxClient.NO_FO&&b.dialect!=mxConstants.DIALECT_SVG?b.init(a.view.graph.container):b.init(a.view.getDrawPane())}; mxCellRenderer.prototype.createCellOverlays=function(a){var b=a.view.graph.getCellOverlays(a.cell),c=null;if(null!=b){c=new mxDictionary;for(var d=0;d<b.length;d++){var e=null!=a.overlays?a.overlays.remove(b[d]):null;null==e?(e=new mxImageShape(new mxRectangle,b[d].image.src),e.dialect=a.view.graph.dialect,e.preserveImageAspect=!1,e.overlay=b[d],this.initializeOverlay(a,e),this.installCellOverlayListeners(a,b[d],e),null!=b[d].cursor&&(e.node.style.cursor=b[d].cursor),c.put(b[d],e)):c.put(b[d],e)}}null!= a.overlays&&a.overlays.visit(function(f,g){g.destroy()});a.overlays=c};mxCellRenderer.prototype.initializeOverlay=function(a,b){b.init(a.view.getOverlayPane())}; mxCellRenderer.prototype.installCellOverlayListeners=function(a,b,c){var d=a.view.graph;mxEvent.addListener(c.node,"click",function(e){d.isEditing()&&d.stopEditing(!d.isInvokesStopCellEditing());b.fireEvent(new mxEventObject(mxEvent.CLICK,"event",e,"cell",a.cell))});mxEvent.addGestureListeners(c.node,function(e){mxEvent.consume(e)},function(e){d.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,a))});mxClient.IS_TOUCH&&mxEvent.addListener(c.node,"touchend",function(e){b.fireEvent(new mxEventObject(mxEvent.CLICK, "event",e,"cell",a.cell))})};mxCellRenderer.prototype.createControl=function(a){var b=a.view.graph,c=b.getFoldingImage(a);if(b.foldingEnabled&&null!=c){if(null==a.control){var d=new mxRectangle(0,0,c.width,c.height);a.control=new mxImageShape(d,c.src);a.control.preserveImageAspect=!1;a.control.dialect=b.dialect;this.initControl(a,a.control,!0,this.createControlClickHandler(a))}}else null!=a.control&&(a.control.destroy(),a.control=null)}; mxCellRenderer.prototype.createControlClickHandler=function(a){var b=a.view.graph;return mxUtils.bind(this,function(c){if(this.forceControlClickHandler||b.isEnabled()){var d=!b.isCellCollapsed(a.cell);b.foldCells(d,!1,[a.cell],null,c);mxEvent.consume(c)}})}; mxCellRenderer.prototype.initControl=function(a,b,c,d){var e=a.view.graph;e.isHtmlLabel(a.cell)&&mxClient.NO_FO&&e.dialect==mxConstants.DIALECT_SVG?(b.dialect=mxConstants.DIALECT_PREFERHTML,b.init(e.container),b.node.style.zIndex=1):b.init(a.view.getOverlayPane());b=b.innerNode||b.node;null==d||mxClient.IS_IOS||(e.isEnabled()&&(b.style.cursor="pointer"),mxEvent.addListener(b,"click",d));if(c){var f=null;mxEvent.addGestureListeners(b,function(g){f=new mxPoint(mxEvent.getClientX(g),mxEvent.getClientY(g)); e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(g,a));mxEvent.consume(g)},function(g){e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(g,a))},function(g){e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(g,a));mxEvent.consume(g)});null!=d&&mxClient.IS_IOS&&b.addEventListener("touchend",function(g){if(null!=f){var k=e.tolerance;Math.abs(f.x-mxEvent.getClientX(g))<k&&Math.abs(f.y-mxEvent.getClientY(g))<k&&(d.call(d,g),mxEvent.consume(g))}},!0)}return b}; mxCellRenderer.prototype.isShapeEvent=function(a,b){return!0};mxCellRenderer.prototype.isLabelEvent=function(a,b){return!0}; mxCellRenderer.prototype.installListeners=function(a){var b=a.view.graph,c=function(d){var e=a;if(b.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(d).nodeName||mxClient.IS_TOUCH)e=mxEvent.getClientX(d),d=mxEvent.getClientY(d),d=mxUtils.convertPoint(b.container,e,d),e=b.view.getState(b.getCellAt(d.x,d.y));return e};mxEvent.addGestureListeners(a.shape.node,mxUtils.bind(this,function(d){this.isShapeEvent(a,d)&&b.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(d,a))}),mxUtils.bind(this, function(d){this.isShapeEvent(a,d)&&b.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(d,c(d)))}),mxUtils.bind(this,function(d){this.isShapeEvent(a,d)&&b.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(d,c(d)))}));b.nativeDblClickEnabled&&mxEvent.addListener(a.shape.node,"dblclick",mxUtils.bind(this,function(d){this.isShapeEvent(a,d)&&(b.dblClick(d,a.cell),mxEvent.consume(d))}))}; mxCellRenderer.prototype.redrawLabel=function(a,b){var c=a.view.graph,d=this.getLabelValue(a),e=c.isWrapping(a.cell),f=c.isLabelClipped(a.cell),g=a.view.graph.isHtmlLabel(a.cell)||null!=d&&mxUtils.isNode(d)?mxConstants.DIALECT_STRICTHTML:a.view.graph.dialect,k=a.style[mxConstants.STYLE_OVERFLOW]||"visible",l="1"==mxUtils.getValue(a.style,"convertToSvg","0");null==a.text||a.text.wrap==e&&a.text.clipped==f&&a.text.overflow==k&&a.text.dialect==g&&a.text.convertToSvg==l||(a.text.destroy(),a.text=null); null==a.text&&null!=d&&(mxUtils.isNode(d)||0<d.length)?this.createLabel(a,d):null==a.text||null!=d&&0!=d.length||(a.text.destroy(),a.text=null);null!=a.text&&(b&&(null!=a.text.lastValue&&this.isTextShapeInvalid(a,a.text)&&(a.text.lastValue=null),a.text.resetStyles(),a.text.apply(a),this.configureShape(a),a.text.valign=c.getVerticalAlign(a)),c=this.getLabelBounds(a),l=this.getTextScale(a),this.resolveColor(a,"color",mxConstants.STYLE_FONTCOLOR),this.inheritFontStyle(a,"size",mxConstants.STYLE_FONTSIZE), this.inheritFontStyle(a,"family",mxConstants.STYLE_FONTFAMILY),b||a.text.value!=d||a.text.isWrapping!=e||a.text.overflow!=k||a.text.isClipping!=f||a.text.scale!=l||a.text.dialect!=g||null==a.text.bounds||!a.text.bounds.equals(c))&&(a.text.dialect=g,a.text.value=d,a.text.bounds=c,a.text.scale=l,a.text.wrap=e,a.text.clipped=f,a.text.overflow=k,b=a.text.node.style.visibility,this.redrawLabelShape(a.text),a.text.node.style.visibility=b)}; mxCellRenderer.prototype.isTextShapeInvalid=function(a,b){function c(d,e,f){return"spacingTop"==e||"spacingRight"==e||"spacingBottom"==e||"spacingLeft"==e?parseFloat(b[d])-parseFloat(b.spacing)!=(a.style[e]||f):b[d]!=(null!=a.style[e]?a.style[e]:f)}return c("fontStyle",mxConstants.STYLE_FONTSTYLE,mxConstants.DEFAULT_FONTSTYLE)||c("family",mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)||c("size",mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)||c("color",mxConstants.STYLE_FONTCOLOR, "black")||c("align",mxConstants.STYLE_ALIGN,"")||c("valign",mxConstants.STYLE_VERTICAL_ALIGN,"")||c("spacing",mxConstants.STYLE_SPACING,2)||c("spacingTop",mxConstants.STYLE_SPACING_TOP,0)||c("spacingRight",mxConstants.STYLE_SPACING_RIGHT,0)||c("spacingBottom",mxConstants.STYLE_SPACING_BOTTOM,0)||c("spacingLeft",mxConstants.STYLE_SPACING_LEFT,0)||c("horizontal",mxConstants.STYLE_HORIZONTAL,!0)||c("background",mxConstants.STYLE_LABEL_BACKGROUNDCOLOR)||c("border",mxConstants.STYLE_LABEL_BORDERCOLOR)|| c("opacity",mxConstants.STYLE_TEXT_OPACITY,100)||c("textDirection",mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)};mxCellRenderer.prototype.redrawLabelShape=function(a){a.redraw()};mxCellRenderer.prototype.getTextScale=function(a){return a.view.scale}; mxCellRenderer.prototype.getLabelBounds=function(a,b,c,d){b=null!=b?b:a.text;var e=new mxRectangle(a.absoluteOffset.x,a.absoluteOffset.y),f=a.view.graph.getModel().isEdge(a.cell),g=a.view.scale;if(f){var k=b.getSpacing(null,c);e.x+=k.x*g;e.y+=k.y*g;k=a.view.graph.getCellGeometry(a.cell);null!=k&&(e.width=Math.max(0,k.width*g),e.height=Math.max(0,k.height*g))}else b.isPaintBoundsInverted()&&!d&&(k=e.x,e.x=e.y,e.y=k),e.x+=a.x,e.y+=a.y,e.width=Math.max(1,a.width),e.height=Math.max(1,a.height);b.isPaintBoundsInverted()&& !d&&(k=(a.width-a.height)/2,e.x+=k,e.y-=k,k=e.width,e.width=e.height,e.height=k);if(null!=a.shape){k=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);var l=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);k==mxConstants.ALIGN_CENTER&&l==mxConstants.ALIGN_MIDDLE&&(e=a.shape.getLabelBounds(e))}k=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null);null!=k&&(e.width=parseFloat(k)*g);f||this.rotateLabelBounds(a,e,b, c,d);return e}; mxCellRenderer.prototype.rotateLabelBounds=function(a,b,c,d,e){var f=null!=d?d:c.margin;b.y-=f.y*b.height;b.x-=f.x*b.width;if(!this.legacySpacing||"fill"!=a.style[mxConstants.STYLE_OVERFLOW]&&"width"!=a.style[mxConstants.STYLE_OVERFLOW]&&("block"!=a.style[mxConstants.STYLE_OVERFLOW]||"1"==a.style[mxConstants.STYLE_BLOCK_SPACING])){d=a.view.scale;f=c.getSpacing("1"==a.style[mxConstants.STYLE_BLOCK_SPACING],f);b.x+=f.x*d;b.y+=f.y*d;f=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER); var 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.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+Math.max(b/2,9)*d,f=a.y+Math.max(c/2,9)*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}; mxCellRenderer.prototype.insertStateAfter=function(a,b,c){for(var d=this.getShapesForState(a),e=0;e<d.length;e++)if(null!=d[e]&&null!=d[e].node){var f=d[e].node.parentNode!=a.view.getDrawPane()&&d[e].node.parentNode!=a.view.getOverlayPane(),g=f?c:b;if(null!=g&&null!=g.parentNode&&g.nextSibling!=d[e].node)null==g.nextSibling?g.parentNode.appendChild(d[e].node):g.parentNode.insertBefore(d[e].node,g.nextSibling);else if(null==g)if(d[e].node.parentNode==a.view.graph.container){for(g=a.view.canvas;null!= g&&g.parentNode!=a.view.graph.container;)g=g.parentNode;null!=g&&null!=g.nextSibling?g.nextSibling!=d[e].node&&d[e].node.parentNode.insertBefore(d[e].node,g.nextSibling):d[e].node.parentNode.appendChild(d[e].node)}else null!=d[e].node.parentNode&&null!=d[e].node.parentNode.firstChild&&d[e].node.parentNode.firstChild!=d[e].node&&d[e].node.parentNode.insertBefore(d[e].node,d[e].node.parentNode.firstChild);f?c=d[e].node:b=d[e].node}return[b,c]}; mxCellRenderer.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,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)); null!=b&&null!=c&&(a=k?b.x:b.x+b.width,b=f.getRoutingCenterY(b),l=n?c.x:c.x+c.width,c=f.getRoutingCenterY(c),f=new mxPoint(a+(k?-d:d),b),g=new mxPoint(l+(n?-d:d),c),k==n?(d=k?Math.min(a,l)-d:Math.max(a,l)+d,e.push(new mxPoint(d,b)),e.push(new mxPoint(d,c))):(f.x<g.x==k?(d=b+(c-b)/2,e.push(f),e.push(new mxPoint(f.x,d)),e.push(new mxPoint(g.x,d))):e.push(f),e.push(g)))},Loop:function(a,b,c,d,e){c=a.absolutePoints;var f=c[c.length-1];if(null!=c[0]&&null!=f){if(null!=d&&0<d.length)for(b=0;b<d.length;b++)c= d[b],c=a.view.transformControlPoint(a,c),e.push(new mxPoint(c.x,c.y))}else if(null!=b){f=a.view;var g=f.graph;c=null!=d&&0<d.length?d[0]:null;null!=c&&(c=f.transformControlPoint(a,c),mxUtils.contains(b,c.x,c.y)&&(c=null));var k=d=0,l=0,m=0;g=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,g.gridSize)*f.scale;a=mxUtils.getValue(a.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);a==mxConstants.DIRECTION_NORTH||a==mxConstants.DIRECTION_SOUTH?(d=f.getRoutingCenterX(b),k=g):(l=f.getRoutingCenterY(b), m=g);null==c||c.x<b.x||c.x>b.x+b.width?null!=c?(d=c.x,m=Math.max(Math.abs(l-c.y),m)):a==mxConstants.DIRECTION_NORTH?l=b.y-2*k:a==mxConstants.DIRECTION_SOUTH?l=b.y+b.height+2*k:d=a==mxConstants.DIRECTION_EAST?b.x-2*m:b.x+b.width+2*m:null!=c&&(d=f.getRoutingCenterX(b),k=Math.max(Math.abs(d-c.x),m),l=c.y,m=0);e.push(new mxPoint(d-k,l-m));e.push(new mxPoint(d+k,l+m))}},ElbowConnector:function(a,b,c,d,e){var f=null!=d&&0<d.length?d[0]:null,g=!1,k=!1;if(null!=b&&null!=c)if(null!=f){var l=Math.min(b.x,c.x), m=Math.max(b.x+b.width,c.x+c.width);k=Math.min(b.y,c.y);var n=Math.max(b.y+b.height,c.y+c.height);f=a.view.transformControlPoint(a,f);g=f.y<k||f.y>n;k=f.x<l||f.x>m}else l=Math.max(b.x,c.x),m=Math.min(b.x+b.width,c.x+c.width),(g=l==m)||(k=Math.max(b.y,c.y),n=Math.min(b.y+b.height,c.y+c.height),k=k==n);k||!g&&a.style[mxConstants.STYLE_ELBOW]!=mxConstants.ELBOW_VERTICAL?mxEdgeStyle.SideToSide(a,b,c,d,e):mxEdgeStyle.TopToBottom(a,b,c,d,e)},SideToSide:function(a,b,c,d,e){var f=a.view;d=null!=d&&0<d.length? d[0]:null;var g=a.absolutePoints,k=g[0];g=g[g.length-1];null!=d&&(d=f.transformControlPoint(a,d));null!=k&&(b=new mxCellState,b.x=k.x,b.y=k.y);null!=g&&(c=new mxCellState,c.x=g.x,c.y=g.y);null!=b&&null!=c&&(a=Math.max(b.x,c.x),k=Math.min(b.x+b.width,c.x+c.width),a=null!=d?d.x:Math.round(k+(a-k)/2),k=f.getRoutingCenterY(b),f=f.getRoutingCenterY(c),null!=d&&(d.y>=b.y&&d.y<=b.y+b.height&&(k=d.y),d.y>=c.y&&d.y<=c.y+c.height&&(f=d.y)),mxUtils.contains(c,a,k)||mxUtils.contains(b,a,k)||e.push(new mxPoint(a, k)),mxUtils.contains(c,a,f)||mxUtils.contains(b,a,f)||e.push(new mxPoint(a,f)),1==e.length&&(null!=d?mxUtils.contains(c,a,d.y)||mxUtils.contains(b,a,d.y)||e.push(new mxPoint(a,d.y)):(f=Math.max(b.y,c.y),e.push(new mxPoint(a,f+(Math.min(b.y+b.height,c.y+c.height)-f)/2)))))},TopToBottom:function(a,b,c,d,e){var f=a.view;d=null!=d&&0<d.length?d[0]:null;var g=a.absolutePoints,k=g[0];g=g[g.length-1];null!=d&&(d=f.transformControlPoint(a,d));null!=k&&(b=new mxCellState,b.x=k.x,b.y=k.y);null!=g&&(c=new mxCellState, c.x=g.x,c.y=g.y);null!=b&&null!=c&&(k=Math.max(b.y,c.y),g=Math.min(b.y+b.height,c.y+c.height),a=f.getRoutingCenterX(b),null!=d&&d.x>=b.x&&d.x<=b.x+b.width&&(a=d.x),k=null!=d?d.y:Math.round(g+(k-g)/2),mxUtils.contains(c,a,k)||mxUtils.contains(b,a,k)||e.push(new mxPoint(a,k)),a=null!=d&&d.x>=c.x&&d.x<=c.x+c.width?d.x:f.getRoutingCenterX(c),mxUtils.contains(c,a,k)||mxUtils.contains(b,a,k)||e.push(new mxPoint(a,k)),1==e.length&&(null!=d&&1==e.length?mxUtils.contains(c,d.x,k)||mxUtils.contains(b,d.x,k)|| e.push(new mxPoint(d.x,k)):(f=Math.max(b.x,c.x),e.push(new mxPoint(f+(Math.min(b.x+b.width,c.x+c.width)-f)/2,k)))))},SegmentConnector:function(a,b,c,d,e){var f=mxEdgeStyle.scalePointArray(a.absolutePoints,a.view.scale),g=mxEdgeStyle.scaleCellState(b,a.view.scale),k=mxEdgeStyle.scaleCellState(c,a.view.scale),l=[],m=0<e.length?e[0]:null,n=!0,p=f[0];null==p&&null!=g?p=new mxPoint(a.view.getRoutingCenterX(g),a.view.getRoutingCenterY(g)):null!=p&&(p=p.clone());var q=f.length-1;if(null!=d&&0<d.length){for(var r= [],t=0;t<d.length;t++){var u=a.view.transformControlPoint(a,d[t],!0);null!=u&&r.push(u)}if(0==r.length)return;null!=p&&null!=r[0]&&(1>Math.abs(r[0].x-p.x)&&(r[0].x=p.x),1>Math.abs(r[0].y-p.y)&&(r[0].y=p.y));u=f[q];null!=u&&null!=r[r.length-1]&&(1>Math.abs(r[r.length-1].x-u.x)&&(r[r.length-1].x=u.x),1>Math.abs(r[r.length-1].y-u.y)&&(r[r.length-1].y=u.y));d=r[0];var v=g,y=f[0],A=d;null!=y&&(v=null);for(t=0;2>t;t++){var z=null!=y&&y.x==A.x,x=null!=y&&y.y==A.y,C=null!=v&&A.y>=v.y&&A.y<=v.y+v.height,D= null!=v&&A.x>=v.x&&A.x<=v.x+v.width;v=x||null==y&&C;A=z||null==y&&D;if(0!=t||!(v&&A||z&&x)){if(null!=y&&!x&&!z&&(C||D)){n=C?!1:!0;break}if(A||v){n=v;1==t&&(n=0==r.length%2?v:A);break}}v=k;y=f[q];null!=y&&(v=null);A=r[r.length-1];z&&x&&(r=r.slice(1))}n&&(null!=f[0]&&f[0].y!=d.y||null==f[0]&&null!=g&&(d.y<g.y||d.y>g.y+g.height))?l.push(new mxPoint(p.x,d.y)):!n&&(null!=f[0]&&f[0].x!=d.x||null==f[0]&&null!=g&&(d.x<g.x||d.x>g.x+g.width))&&l.push(new mxPoint(d.x,p.y));n?p.y=d.y:p.x=d.x;for(t=0;t<r.length;t++)n= !n,d=r[t],n?p.y=d.y:p.x=d.x,l.push(p.clone())}else d=p,n=!0;p=f[q];null==p&&null!=k&&(p=new mxPoint(a.view.getRoutingCenterX(k),a.view.getRoutingCenterY(k)));null!=p&&null!=d&&(n&&(null!=f[q]&&f[q].y!=d.y||null==f[q]&&null!=k&&(d.y<k.y||d.y>k.y+k.height))?l.push(new mxPoint(p.x,d.y)):!n&&(null!=f[q]&&f[q].x!=d.x||null==f[q]&&null!=k&&(d.x<k.x||d.x>k.x+k.width))&&l.push(new mxPoint(d.x,p.y)));if(null==b||b!=c||"1"!=mxUtils.getValue(a.style,"innerLoopWaypoints","0")){if(null==f[0]&&null!=g)for(;0<l.length&& null!=l[0]&&mxUtils.contains(g,l[0].x,l[0].y);)l.splice(0,1);if(null==f[q]&&null!=k)for(;0<l.length&&null!=l[l.length-1]&&mxUtils.contains(k,l[l.length-1].x,l[l.length-1].y);)l.splice(l.length-1,1)}for(t=0;t<l.length;t++)if(b=l[t],b.x=Math.round(b.x*a.view.scale*10)/10,b.y=Math.round(b.y*a.view.scale*10)/10,null==m||1<=Math.abs(m.x-b.x)||Math.abs(m.y-b.y)>=Math.max(1,a.view.scale))e.push(b),m=b;null!=u&&null!=e[e.length-1]&&1>=Math.abs(u.x-e[e.length-1].x)&&1>=Math.abs(u.y-e[e.length-1].y)&&(e.splice(e.length- 1,1),null!=e[e.length-1]&&(1>Math.abs(e[e.length-1].x-u.x)&&(e[e.length-1].x=u.x),1>Math.abs(e[e.length-1].y-u.y)&&(e[e.length-1].y=u.y)))},orthBuffer:10,orthPointsFallback:!0,dirVectors:[[-1,0],[0,-1],[1,0],[0,1],[-1,0],[0,-1],[1,0]],wayPoints1:[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],routePatterns:[[[513,2308,2081,2562],[513,1090,514,2184,2114,2561],[513,1090,514,2564,2184,2562],[513,2308,2561,1090,514,2568,2308]],[[514,1057,513,2308,2081,2562],[514,2184,2114,2561], [514,2184,2562,1057,513,2564,2184],[514,1057,513,2568,2308,2561]],[[1090,514,1057,513,2308,2081,2562],[2114,2561],[1090,2562,1057,513,2564,2184],[1090,514,1057,513,2308,2561,2568]],[[2081,2562],[1057,513,1090,514,2184,2114,2561],[1057,513,1090,514,2184,2562,2564],[1057,2561,1090,514,2568,2308]]],inlineRoutePatterns:[[null,[2114,2568],null,null],[null,[514,2081,2114,2568],null,null],[null,[2114,2561],null,null],[[2081,2562],[1057,2114,2568],[2184,2562],null]],vertexSeperations:[],limits:[[0,0,0,0, 0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],LEFT_MASK:32,TOP_MASK:64,RIGHT_MASK:128,BOTTOM_MASK:256,LEFT:1,TOP:2,RIGHT:4,BOTTOM:8,SIDE_MASK:480,CENTER_MASK:512,SOURCE_MASK:1024,TARGET_MASK:2048,VERTEX_MASK:3072,getJettySize:function(a,b){var c=mxUtils.getValue(a.style,b?mxConstants.STYLE_SOURCE_JETTY_SIZE:mxConstants.STYLE_TARGET_JETTY_SIZE,mxUtils.getValue(a.style,mxConstants.STYLE_JETTY_SIZE,mxEdgeStyle.orthBuffer));"auto"==c&&(mxUtils.getValue(a.style,b?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW, mxConstants.NONE)!=mxConstants.NONE?(a=mxUtils.getNumber(a.style,b?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE),c=Math.max(2,Math.ceil((a+mxEdgeStyle.orthBuffer)/mxEdgeStyle.orthBuffer))*mxEdgeStyle.orthBuffer):c=2*mxEdgeStyle.orthBuffer);return c},scalePointArray:function(a,b){var c=[];if(null!=a)for(var d=0;d<a.length;d++)if(null!=a[d]){var e=new mxPoint(Math.round(a[d].x/b*10)/10,Math.round(a[d].y/b*10)/10);c[d]=e}else c[d]=null;else c=null;return c},scaleCellState:function(a, b){if(null!=a){var c=a.clone();c.setRect(Math.round(a.x/b*10)/10,Math.round(a.y/b*10)/10,Math.round(a.width/b*10)/10,Math.round(a.height/b*10)/10)}else c=null;return c},OrthConnector:function(a,b,c,d,e){var f=mxEdgeStyle.scalePointArray(a.absolutePoints,a.view.scale),g=mxEdgeStyle.scaleCellState(b,a.view.scale),k=mxEdgeStyle.scaleCellState(c,a.view.scale),l=f[0],m=f[f.length-1];f=null!=g?g.x:l.x;var n=null!=g?g.y:l.y,p=null!=g?g.width:1,q=null!=g?g.height:1,r=null!=k?k.x:m.x,t=null!=k?k.y:m.y,u=null!= k?k.width:1,v=null!=k?k.height:1,y=mxEdgeStyle.getJettySize(a,!0),A=mxEdgeStyle.getJettySize(a,!1);null!=g&&k==g&&(y=A=Math.max(y,A));var z=A+y,x=!1;if(null!=l&&null!=m){x=m.x-l.x;var C=m.y-l.y;x=x*x+C*C<z*z}if(x||mxEdgeStyle.orthPointsFallback&&null!=d&&0<d.length)mxEdgeStyle.SegmentConnector(a,b,c,d,e);else if(c=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL],null!=g&&(c[0]=mxUtils.getPortConstraints(g,a,!0,mxConstants.DIRECTION_MASK_ALL),b=mxUtils.getValue(g.style,mxConstants.STYLE_ROTATION, 0),0!=b&&(b=mxUtils.getBoundingBox(new mxRectangle(f,n,p,q),b),f=b.x,n=b.y,p=b.width,q=b.height)),null!=k&&(c[1]=mxUtils.getPortConstraints(k,a,!1,mxConstants.DIRECTION_MASK_ALL),b=mxUtils.getValue(k.style,mxConstants.STYLE_ROTATION,0),0!=b&&(b=mxUtils.getBoundingBox(new mxRectangle(r,t,u,v),b),r=b.x,t=b.y,u=b.width,v=b.height)),0!=p&&0!=q&&0!=u&&0!=v){b=[0,0];f=[[f,n,p,q],[r,t,u,v]];A=[y,A];for(x=0;2>x;x++)mxEdgeStyle.limits[x][1]=f[x][0]-A[x],mxEdgeStyle.limits[x][2]=f[x][1]-A[x],mxEdgeStyle.limits[x][4]= f[x][0]+f[x][2]+A[x],mxEdgeStyle.limits[x][8]=f[x][1]+f[x][3]+A[x];A=f[0][1]+f[0][3]/2;n=f[1][1]+f[1][3]/2;x=f[0][0]+f[0][2]/2-(f[1][0]+f[1][2]/2);C=A-n;A=0;0>x?A=0>C?2:1:0>=C&&(A=3,0==x&&(A=2));n=null;null!=g&&(n=l);l=[[.5,.5],[.5,.5]];g||(l[0]=[0,0]);k||(l[1]=[0,0]);for(x=0;2>x;x++)null!=n&&(l[x][0]=(n.x-f[x][0])/f[x][2],1>=Math.abs(n.x-f[x][0])?b[x]=mxConstants.DIRECTION_MASK_WEST:1>=Math.abs(n.x-f[x][0]-f[x][2])&&(b[x]=mxConstants.DIRECTION_MASK_EAST),l[x][1]=(n.y-f[x][1])/f[x][3],1>=Math.abs(n.y- f[x][1])?b[x]=mxConstants.DIRECTION_MASK_NORTH:1>=Math.abs(n.y-f[x][1]-f[x][3])&&(b[x]=mxConstants.DIRECTION_MASK_SOUTH)),n=null,null!=k&&(n=m);x=f[0][1]-(f[1][1]+f[1][3]);m=f[0][0]-(f[1][0]+f[1][2]);n=f[1][1]-(f[0][1]+f[0][3]);p=f[1][0]-(f[0][0]+f[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(m-z,0);mxEdgeStyle.vertexSeperations[2]=Math.max(x-z,0);mxEdgeStyle.vertexSeperations[4]=Math.max(n-z,0);mxEdgeStyle.vertexSeperations[3]=Math.max(p-z,0);z=[];g=[];k=[];g[0]=m>=p?mxConstants.DIRECTION_MASK_WEST: mxConstants.DIRECTION_MASK_EAST;k[0]=x>=n?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH;g[1]=mxUtils.reversePortConstraints(g[0]);k[1]=mxUtils.reversePortConstraints(k[0]);m=m>=p?m:p;n=x>=n?x:n;p=[[0,0],[0,0]];q=!1;for(x=0;2>x;x++)0==b[x]&&(0==(g[x]&c[x])&&(g[x]=mxUtils.reversePortConstraints(g[x])),0==(k[x]&c[x])&&(k[x]=mxUtils.reversePortConstraints(k[x])),p[x][0]=k[x],p[x][1]=g[x]);0<n&&0<m&&(0<(g[0]&c[0])&&0<(k[1]&c[1])?(p[0][0]=g[0],p[0][1]=k[0],p[1][0]=k[1],p[1][1]=g[1], q=!0):0<(k[0]&c[0])&&0<(g[1]&c[1])&&(p[0][0]=k[0],p[0][1]=g[0],p[1][0]=g[1],p[1][1]=k[1],q=!0));0<n&&!q&&(p[0][0]=k[0],p[0][1]=g[0],p[1][0]=k[1],p[1][1]=g[1],q=!0);0<m&&!q&&(p[0][0]=g[0],p[0][1]=k[0],p[1][0]=g[1],p[1][1]=k[1]);for(x=0;2>x;x++)0==b[x]&&(0==(p[x][0]&c[x])&&(p[x][0]=p[x][1]),z[x]=p[x][0]&c[x],z[x]|=(p[x][1]&c[x])<<8,z[x]|=(p[1-x][x]&c[x])<<16,z[x]|=(p[1-x][1-x]&c[x])<<24,0==(z[x]&15)&&(z[x]<<=8),0==(z[x]&3840)&&(z[x]=z[x]&15|z[x]>>8),0==(z[x]&983040)&&(z[x]=z[x]&65535|(z[x]&251658240)>> 8),b[x]=z[x]&15,c[x]==mxConstants.DIRECTION_MASK_WEST||c[x]==mxConstants.DIRECTION_MASK_NORTH||c[x]==mxConstants.DIRECTION_MASK_EAST||c[x]==mxConstants.DIRECTION_MASK_SOUTH)&&(b[x]=c[x]);c=b[0]==mxConstants.DIRECTION_MASK_EAST?3:b[0];z=b[1]==mxConstants.DIRECTION_MASK_EAST?3:b[1];c-=A;z-=A;1>c&&(c+=4);1>z&&(z+=4);c=mxEdgeStyle.routePatterns[c-1][z-1];mxEdgeStyle.wayPoints1[0][0]=f[0][0];mxEdgeStyle.wayPoints1[0][1]=f[0][1];switch(b[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-= y;mxEdgeStyle.wayPoints1[0][1]+=l[0][1]*f[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=l[0][0]*f[0][2];mxEdgeStyle.wayPoints1[0][1]+=f[0][3]+y;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=f[0][2]+y;mxEdgeStyle.wayPoints1[0][1]+=l[0][1]*f[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=l[0][0]*f[0][2],mxEdgeStyle.wayPoints1[0][1]-=y}y=0;g=z=0<(b[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))? 0:1;for(x=0;x<c.length;x++)k=c[x]&15,q=k==mxConstants.DIRECTION_MASK_EAST?3:k,q+=A,4<q&&(q-=4),m=mxEdgeStyle.dirVectors[q-1],k=0<q%2?0:1,k!=z&&(y++,mxEdgeStyle.wayPoints1[y][0]=mxEdgeStyle.wayPoints1[y-1][0],mxEdgeStyle.wayPoints1[y][1]=mxEdgeStyle.wayPoints1[y-1][1]),r=0<(c[x]&mxEdgeStyle.TARGET_MASK),t=0<(c[x]&mxEdgeStyle.SOURCE_MASK),n=(c[x]&mxEdgeStyle.SIDE_MASK)>>5,n<<=A,15<n&&(n>>=4),p=0<(c[x]&mxEdgeStyle.CENTER_MASK),(t||r)&&9>n?(q=t?0:1,n=p&&0==k?f[q][0]+l[q][0]*f[q][2]:p?f[q][1]+l[q][1]* f[q][3]:mxEdgeStyle.limits[q][n],0==k?(n=(n-mxEdgeStyle.wayPoints1[y][0])*m[0],0<n&&(mxEdgeStyle.wayPoints1[y][0]+=m[0]*n)):(n=(n-mxEdgeStyle.wayPoints1[y][1])*m[1],0<n&&(mxEdgeStyle.wayPoints1[y][1]+=m[1]*n))):p&&(mxEdgeStyle.wayPoints1[y][0]+=m[0]*Math.abs(mxEdgeStyle.vertexSeperations[q]/2),mxEdgeStyle.wayPoints1[y][1]+=m[1]*Math.abs(mxEdgeStyle.vertexSeperations[q]/2)),0<y&&mxEdgeStyle.wayPoints1[y][k]==mxEdgeStyle.wayPoints1[y-1][k]?y--:z=k;for(x=0;x<=y&&(x!=y||((0<(b[1]&(mxConstants.DIRECTION_MASK_EAST| mxConstants.DIRECTION_MASK_WEST))?0:1)==g?0:1)==(y+1)%2);x++)e.push(new mxPoint(Math.round(mxEdgeStyle.wayPoints1[x][0]*a.view.scale*10)/10,Math.round(mxEdgeStyle.wayPoints1[x][1]*a.view.scale*10)/10));for(a=1;a<e.length;)null==e[a-1]||null==e[a]||e[a-1].x!=e[a].x||e[a-1].y!=e[a].y?a++:e.splice(a,1)}},getRoutePattern:function(a,b,c,d){var e=a[0]==mxConstants.DIRECTION_MASK_EAST?3:a[0];a=a[1]==mxConstants.DIRECTION_MASK_EAST?3:a[1];e-=b;a-=b;1>e&&(e+=4);1>a&&(a+=4);b=routePatterns[e-1][a-1];0!=c&& 0!=d||null==inlineRoutePatterns[e-1][a-1]||(b=inlineRoutePatterns[e-1][a-1]);return b}},mxStyleRegistry={values:Object.create(null),putValue:function(a,b){mxStyleRegistry.values[a]=b},getValue:function(a){return mxStyleRegistry.values[a]},getName:function(a){for(var b in mxStyleRegistry.values)if(mxStyleRegistry.values[b]==a)return b;return null}};mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ELBOW,mxEdgeStyle.ElbowConnector);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ENTITY_RELATION,mxEdgeStyle.EntityRelation); mxStyleRegistry.putValue(mxConstants.EDGESTYLE_LOOP,mxEdgeStyle.Loop);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SIDETOSIDE,mxEdgeStyle.SideToSide);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_TOPTOBOTTOM,mxEdgeStyle.TopToBottom);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_ORTHOGONAL,mxEdgeStyle.OrthConnector);mxStyleRegistry.putValue(mxConstants.EDGESTYLE_SEGMENT,mxEdgeStyle.SegmentConnector);mxStyleRegistry.putValue(mxConstants.PERIMETER_ELLIPSE,mxPerimeter.EllipsePerimeter); mxStyleRegistry.putValue(mxConstants.PERIMETER_RECTANGLE,mxPerimeter.RectanglePerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_RHOMBUS,mxPerimeter.RhombusPerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_TRIANGLE,mxPerimeter.TrianglePerimeter);mxStyleRegistry.putValue(mxConstants.PERIMETER_HEXAGON,mxPerimeter.HexagonPerimeter);function mxGraphView(a){this.graph=a;this.translate=new mxPoint;this.graphBounds=new mxRectangle;this.states=new mxDictionary}mxGraphView.prototype=new mxEventSource; mxGraphView.prototype.constructor=mxGraphView;mxGraphView.prototype.EMPTY_POINT=new mxPoint;mxGraphView.prototype.doneResource="none"!=mxClient.language?"done":"";mxGraphView.prototype.updatingDocumentResource="none"!=mxClient.language?"updatingDocument":"";mxGraphView.prototype.allowEval=!1;mxGraphView.prototype.captureDocumentGesture=!0;mxGraphView.prototype.rendering=!0;mxGraphView.prototype.graph=null;mxGraphView.prototype.currentRoot=null;mxGraphView.prototype.graphBounds=null; mxGraphView.prototype.scale=1;mxGraphView.prototype.translate=null;mxGraphView.prototype.states=null;mxGraphView.prototype.updateStyle=!1;mxGraphView.prototype.lastNode=null;mxGraphView.prototype.lastHtmlNode=null;mxGraphView.prototype.lastForegroundNode=null;mxGraphView.prototype.lastForegroundHtmlNode=null;mxGraphView.prototype.getGraphBounds=function(){return this.graphBounds};mxGraphView.prototype.setGraphBounds=function(a){this.graphBounds=a}; mxGraphView.prototype.getBounds=function(a){var b=null;if(null!=a&&0<a.length)for(var c=this.graph.getModel(),d=0;d<a.length;d++)if(c.isVertex(a[d])||c.isEdge(a[d])){var e=this.getState(a[d]);null!=e&&(null==b?b=mxRectangle.fromRectangle(e):b.add(e))}return b};mxGraphView.prototype.setCurrentRoot=function(a){if(this.currentRoot!=a){var b=new mxCurrentRootChange(this,a);b.execute();var c=new mxUndoableEdit(this,!0);c.add(b);this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",c));this.graph.sizeDidChange()}return a}; mxGraphView.prototype.scaleAndTranslate=function(a,b,c){var d=this.scale,e=new mxPoint(this.translate.x,this.translate.y);if(this.scale!=a||this.translate.x!=b||this.translate.y!=c)this.scale=a,this.translate.x=b,this.translate.y=c,this.isEventsEnabled()&&this.viewStateChanged();this.fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE,"scale",a,"previousScale",d,"translate",this.translate,"previousTranslate",e))};mxGraphView.prototype.getScale=function(){return this.scale}; mxGraphView.prototype.setScale=function(a){var b=this.scale;this.scale!=a&&(this.scale=a,this.isEventsEnabled()&&this.viewStateChanged());this.fireEvent(new mxEventObject(mxEvent.SCALE,"scale",a,"previousScale",b))};mxGraphView.prototype.getTranslate=function(){return this.translate}; mxGraphView.prototype.setTranslate=function(a,b){var c=new mxPoint(this.translate.x,this.translate.y);if(this.translate.x!=a||this.translate.y!=b)this.translate.x=a,this.translate.y=b,this.isEventsEnabled()&&this.viewStateChanged();this.fireEvent(new mxEventObject(mxEvent.TRANSLATE,"translate",this.translate,"previousTranslate",c))};mxGraphView.prototype.viewStateChanged=function(){this.revalidate();this.graph.sizeDidChange()}; mxGraphView.prototype.refresh=function(){null!=this.currentRoot&&this.clear();this.revalidate()};mxGraphView.prototype.revalidate=function(){this.invalidate();this.validate()};mxGraphView.prototype.clear=function(a,b,c){var d=this.graph.getModel();a=a||d.getRoot();b=null!=b?b:!1;c=null!=c?c:!0;this.removeState(a);if(c&&(b||a!=this.currentRoot)){c=d.getChildCount(a);for(var e=0;e<c;e++)this.clear(d.getChildAt(a,e),b)}else this.invalidate(a)}; mxGraphView.prototype.invalidate=function(a,b,c){var d=this.graph.getModel();a=a||d.getRoot();if(null!=a){b=null!=b?b:!0;c=null!=c?c:!0;var e=this.getState(a);null!=e&&(e.invalid=!0);if(!a.invalidating){a.invalidating=!0;if(b){var f=d.getChildCount(a);for(e=0;e<f;e++){var g=d.getChildAt(a,e);this.invalidate(g,b,c)}}if(c)for(f=d.getEdgeCount(a),e=0;e<f;e++)this.invalidate(d.getEdgeAt(a,e),b,c);delete a.invalidating}}}; mxGraphView.prototype.validate=function(a){var b=mxLog.enter("mxGraphView.validate");window.status=mxResources.get(this.updatingDocumentResource)||this.updatingDocumentResource;this.resetValidationState();a=null!=a?a:null!=this.currentRoot?this.currentRoot:this.graph.getModel().getRoot();a=this.validateCellState(this.validateCell(a));a=this.getBoundingBox(a,!0,!0);this.setGraphBounds(null!=a?a:this.getEmptyBounds());this.validateBackground();this.resetValidationState();window.status=mxResources.get(this.doneResource)|| this.doneResource;mxLog.leave("mxGraphView.validate",b)};mxGraphView.prototype.getEmptyBounds=function(){return new mxRectangle(this.translate.x*this.scale,this.translate.y*this.scale)};mxGraphView.prototype.updateBoundingBox=function(a){null!=a.shape&&a.shape.updateBoundingBox();null!=a.text&&a.text.updateBoundingBox()}; mxGraphView.prototype.getBoundingBox=function(a,b,c){b=null!=b?b:!0;c=null!=c?c:!1;var d=null;if(null!=a){var e=function(l){null==l||null==l.boundingBox||isNaN(l.boundingBox.x)||isNaN(l.boundingBox.y)||isNaN(l.boundingBox.width)||isNaN(l.boundingBox.height)||(null==d?d=l.boundingBox.clone():d.add(l.boundingBox))};c&&this.updateBoundingBox(a);e(a.shape);e(a.text);if(b){e=this.graph.getModel();for(var f=e.getChildCount(a.cell),g=0;g<f;g++){var k=this.getBoundingBox(this.getState(e.getChildAt(a.cell, g)),b,c);null!=k&&(null==d?d=k:d.add(k))}}}return d};mxGraphView.prototype.createBackgroundPageShape=function(a){return new mxRectangleShape(a,"white","black")};mxGraphView.prototype.validateBackground=function(){this.validateBackgroundImage();this.validateBackgroundPage()}; mxGraphView.prototype.validateBackgroundImage=function(){var a=this.graph.getBackgroundImage();if(null!=a){if(null==this.backgroundImage||this.backgroundImage.image!=a.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var b=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(b,a.src);this.backgroundImage.dialect=this.graph.dialect;this.backgroundImage.init(this.backgroundPane);this.backgroundImage.redraw()}this.redrawBackgroundImage(this.backgroundImage,a)}else null!=this.backgroundImage&& (this.backgroundImage.destroy(),this.backgroundImage=null)}; mxGraphView.prototype.validateBackgroundPage=function(){if(this.graph.pageVisible){var a=this.getBackgroundPageBounds();null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(a),this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=this.graph.dialect,this.backgroundPageShape.init(this.backgroundPane),this.backgroundPageShape.redraw(),this.graph.nativeDblClickEnabled&&mxEvent.addListener(this.backgroundPageShape.node, "dblclick",mxUtils.bind(this,function(b){this.graph.dblClick(b)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(b){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(b))}),mxUtils.bind(this,function(b){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide();this.graph.isMouseDown&&!mxEvent.isConsumed(b)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(b))}),mxUtils.bind(this,function(b){this.graph.fireMouseEvent(mxEvent.MOUSE_UP, new mxMouseEvent(b))}))):(this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.bounds=a,this.backgroundPageShape.redraw())}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)};mxGraphView.prototype.getBackgroundPageBounds=function(){var a=this.graph.pageFormat,b=this.scale*this.graph.pageScale;return new mxRectangle(this.scale*this.translate.x,this.scale*this.translate.y,a.width*b,a.height*b)}; mxGraphView.prototype.redrawBackgroundImage=function(a,b){b=new mxRectangle(this.scale*(this.translate.x+b.x),this.scale*(this.translate.y+b.y),this.scale*b.width,this.scale*b.height);a.scale==this.scale&&b.equals(a.bounds)||(a.scale=this.scale,a.bounds=b,null==a.node||"g"!=a.node.nodeName||"image"!=a.node.firstChild.nodeName&&"svg"!=a.node.firstChild.nodeName?a.redraw():(a.node.firstChild.setAttribute("x",b.x),a.node.firstChild.setAttribute("y",b.y),a.node.firstChild.setAttribute("width",b.width), a.node.firstChild.setAttribute("height",b.height)))};mxGraphView.prototype.validateCell=function(a,b){if(null!=a)if(b=(null!=b?b:!0)&&this.graph.isCellVisible(a),null==this.getState(a,b)||b)for(var c=this.graph.getModel(),d=c.getChildCount(a),e=0;e<d;e++)this.validateCell(c.getChildAt(a,e),b&&(!this.isCellCollapsed(a)||a==this.currentRoot));else this.removeState(a);return a}; mxGraphView.prototype.validateCellState=function(a,b){b=null!=b?b:!0;var c=null;if(null!=a&&(c=this.getState(a),null!=c)){var d=this.graph.getModel();if(c.invalid){c.invalid=!1;if(null==c.style||c.invalidStyle)c.style=this.graph.getCellStyle(c.cell),c.invalidStyle=!1;a!=this.currentRoot&&this.validateCellState(d.getParent(a),!1);c.setVisibleTerminalState(this.validateCellState(this.getVisibleTerminal(a,!0),!1),!0);c.setVisibleTerminalState(this.validateCellState(this.getVisibleTerminal(a,!1),!1), !1);this.updateCellState(c);a==this.currentRoot||c.invalid||(this.graph.cellRenderer.redraw(c,!1,this.isRendering()),c.updateCachedBounds())}if(b&&!c.invalid){null!=c.shape&&this.stateValidated(c);b=d.getChildCount(a);for(var e=0;e<b;e++)this.validateCellState(d.getChildAt(a,e))}}return c}; mxGraphView.prototype.updateCellState=function(a){a.absoluteOffset.x=0;a.absoluteOffset.y=0;a.origin.x=0;a.origin.y=0;a.length=0;if(a.cell!=this.currentRoot){var b=this.graph.getModel(),c=this.getState(b.getParent(a.cell));null!=c&&c.cell!=this.currentRoot&&(a.origin.x+=c.origin.x,a.origin.y+=c.origin.y);var d=this.graph.getChildOffsetForCell(a.cell);null!=d&&(a.origin.x+=d.x,a.origin.y+=d.y);var e=this.graph.getCellGeometry(a.cell);null!=e&&(b.isEdge(a.cell)||(d=null!=e.offset?e.offset:this.EMPTY_POINT, e.relative&&null!=c?b.isEdge(c.cell)?(d=this.getPoint(c,e),null!=d&&(a.origin.x+=d.x/this.scale-c.origin.x-this.translate.x,a.origin.y+=d.y/this.scale-c.origin.y-this.translate.y)):(a.origin.x+=e.x*c.unscaledWidth+d.x,a.origin.y+=e.y*c.unscaledHeight+d.y):(a.absoluteOffset.x=this.scale*d.x,a.absoluteOffset.y=this.scale*d.y,a.origin.x+=e.x,a.origin.y+=e.y)),a.x=this.scale*(this.translate.x+a.origin.x),a.y=this.scale*(this.translate.y+a.origin.y),a.width=this.scale*e.width,a.unscaledWidth=e.width,a.height= this.scale*e.height,a.unscaledHeight=e.height,b.isVertex(a.cell)&&this.updateVertexState(a,e),b.isEdge(a.cell)&&this.updateEdgeState(a,e))}a.updateCachedBounds()};mxGraphView.prototype.isCellCollapsed=function(a){return this.graph.isCellCollapsed(a)}; mxGraphView.prototype.updateVertexState=function(a,b){var c=this.graph.getModel(),d=this.getState(c.getParent(a.cell));if(b.relative&&null!=d&&!c.isEdge(d.cell)&&(c=mxUtils.toRadians(d.style[mxConstants.STYLE_ROTATION]||"0"),0!=c)){b=Math.cos(c);c=Math.sin(c);var e=new mxPoint(a.getCenterX(),a.getCenterY());d=new mxPoint(d.getCenterX(),d.getCenterY());d=mxUtils.getRotatedPoint(e,b,c,d);a.x=d.x-a.width/2;a.y=d.y-a.height/2}this.updateVertexLabelOffset(a)}; mxGraphView.prototype.updateEdgeState=function(a,b){var c=a.getVisibleTerminalState(!0),d=a.getVisibleTerminalState(!1),e="function"===typeof b.getTerminalPoint;null!=this.graph.model.getTerminal(a.cell,!0)&&null==c||null==c&&(!e||null==b.getTerminalPoint(!0))||null!=this.graph.model.getTerminal(a.cell,!1)&&null==d||null==d&&(!e||null==b.getTerminalPoint(!1))?this.clear(a.cell,!0):(this.updateFixedTerminalPoints(a,c,d),this.updatePoints(a,b.points,c,d),this.updateFloatingTerminalPoints(a,c,d),b=a.absolutePoints, a.cell!=this.currentRoot&&(null==b||2>b.length||null==b[0]||null==b[b.length-1])?this.clear(a.cell,!0):(this.updateEdgeBounds(a),this.updateEdgeLabelOffset(a)))}; mxGraphView.prototype.updateVertexLabelOffset=function(a){var b=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);if(b==mxConstants.ALIGN_LEFT)b=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null),b=null!=b?b*this.scale:a.width,a.absoluteOffset.x-=b;else if(b==mxConstants.ALIGN_RIGHT)a.absoluteOffset.x+=a.width;else if(b==mxConstants.ALIGN_CENTER&&(b=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null),null!=b)){var c=mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN, mxConstants.ALIGN_CENTER),d=0;c==mxConstants.ALIGN_CENTER?d=.5:c==mxConstants.ALIGN_RIGHT&&(d=1);0!=d&&(a.absoluteOffset.x-=(b*this.scale-a.width)*d)}b=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);b==mxConstants.ALIGN_TOP?a.absoluteOffset.y-=a.height:b==mxConstants.ALIGN_BOTTOM&&(a.absoluteOffset.y+=a.height)};mxGraphView.prototype.resetValidationState=function(){this.lastForegroundHtmlNode=this.lastForegroundNode=this.lastHtmlNode=this.lastNode=null}; mxGraphView.prototype.stateValidated=function(a){var b=this.graph.getModel().isEdge(a.cell)&&this.graph.keepEdgesInForeground||this.graph.getModel().isVertex(a.cell)&&this.graph.keepEdgesInBackground;a=this.graph.cellRenderer.insertStateAfter(a,b?this.lastForegroundNode||this.lastNode:this.lastNode,b?this.lastForegroundHtmlNode||this.lastHtmlNode:this.lastHtmlNode);b?(this.lastForegroundHtmlNode=a[1],this.lastForegroundNode=a[0]):(this.lastHtmlNode=a[1],this.lastNode=a[0])}; mxGraphView.prototype.updateFixedTerminalPoints=function(a,b,c){this.updateFixedTerminalPoint(a,b,!0,this.graph.getConnectionConstraint(a,b,!0));this.updateFixedTerminalPoint(a,c,!1,this.graph.getConnectionConstraint(a,c,!1))};mxGraphView.prototype.updateFixedTerminalPoint=function(a,b,c,d){a.setAbsoluteTerminalPoint(this.getFixedTerminalPoint(a,b,c,d),c)}; mxGraphView.prototype.getFixedTerminalPoint=function(a,b,c,d){var e=null;null!=d&&(e=this.graph.getConnectionPoint(b,d,!1));if(null==e&&null==b){b=this.scale;d=this.translate;var f=a.origin;e=this.graph.getCellGeometry(a.cell).getTerminalPoint(c);null!=e&&(e=new mxPoint(b*(d.x+e.x+f.x),b*(d.y+e.y+f.y)))}return e}; mxGraphView.prototype.updateBoundsFromStencil=function(a){var b=null;if(null!=a&&null!=a.shape&&null!=a.shape.stencil&&"fixed"==a.shape.stencil.aspect){b=mxRectangle.fromRectangle(a);var c=a.style[mxConstants.STYLE_DIRECTION],d=c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH;c=d?a.shape.stencil.h0:a.shape.stencil.w0;d=d?a.shape.stencil.w0:a.shape.stencil.h0;var e=Math.min(a.width/c,a.height/d);a.setRect(a.x+(a.width-c*e)/2,a.y+(a.height-d*e)/2,c*e,d*e)}return b}; mxGraphView.prototype.updatePoints=function(a,b,c,d){if(null!=a&&null!=a.absolutePoints&&0<a.absolutePoints.length){var e=[];e.push(a.absolutePoints[0]);var f=this.getEdgeStyle(a,b,c,d);if(null!=f){c=this.getTerminalPort(a,c,!0);d=this.getTerminalPort(a,d,!1);var g=this.updateBoundsFromStencil(c),k=c!=d?this.updateBoundsFromStencil(d):null;try{f(a,c,d,b,e)}finally{null!=g&&c.setRect(g.x,g.y,g.width,g.height),null!=k&&d.setRect(k.x,k.y,k.width,k.height)}}else if(null!=b)for(f=0;f<b.length;f++)null!= b[f]&&(c=mxUtils.clone(b[f]),e.push(this.transformControlPoint(a,c)));b=a.absolutePoints;e.push(b[b.length-1]);a.absolutePoints=e}};mxGraphView.prototype.transformControlPoint=function(a,b,c){return null!=a&&null!=b?(a=a.origin,c=c?1:this.scale,new mxPoint(c*(b.x+this.translate.x+a.x),c*(b.y+this.translate.y+a.y))):null}; mxGraphView.prototype.isLoopStyleEnabled=function(a,b,c,d){var e=this.graph.getConnectionConstraint(a,c,!0),f=this.graph.getConnectionConstraint(a,d,!1);return!(null==b||2>b.length)||mxUtils.getValue(a.style,mxConstants.STYLE_ORTHOGONAL_LOOP,!1)&&(null!=e&&null!=e.point||null!=f&&null!=f.point)?!1:null!=c&&c==d}; mxGraphView.prototype.getEdgeStyle=function(a,b,c,d){a=this.isLoopStyleEnabled(a,b,c,d)?mxUtils.getValue(a.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):mxUtils.getValue(a.style,mxConstants.STYLE_NOEDGESTYLE,!1)?null:a.style[mxConstants.STYLE_EDGE];"string"==typeof a&&(b=mxStyleRegistry.getValue(a),null==b&&this.isAllowEval()&&(b=mxUtils.eval(a)),a=b);return"function"==typeof a?a:null}; mxGraphView.prototype.updateFloatingTerminalPoints=function(a,b,c){var d=a.absolutePoints;if(null!=d){var e=d[0];null==d[d.length-1]&&null!=c&&this.updateFloatingTerminalPoint(a,c,b,!1);null==e&&null!=b&&this.updateFloatingTerminalPoint(a,b,c,!0)}};mxGraphView.prototype.updateFloatingTerminalPoint=function(a,b,c,d){a.setAbsoluteTerminalPoint(this.getFloatingTerminalPoint(a,b,c,d),d)}; mxGraphView.prototype.getFloatingTerminalPoint=function(a,b,c,d){b=this.getTerminalPort(a,b,d);var e=this.getNextPoint(a,c,d),f=this.graph.isOrthogonal(a);c=mxUtils.toRadians(Number(b.style[mxConstants.STYLE_ROTATION]||"0"));var g=new mxPoint(b.getCenterX(),b.getCenterY());if(0!=c){var k=Math.cos(-c),l=Math.sin(-c);e=mxUtils.getRotatedPoint(e,k,l,g)}k=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);k+=parseFloat(a.style[d?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]|| 0);a=this.getPerimeterPoint(b,e,0==c&&f,k);0!=c&&(k=Math.cos(c),l=Math.sin(c),a=mxUtils.getRotatedPoint(a,k,l,g));return a};mxGraphView.prototype.getTerminalPort=function(a,b,c){a=mxUtils.getValue(a.style,c?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT);null!=a&&(a=this.getState(this.graph.getModel().getCell(a)),null!=a&&(b=a));return b}; mxGraphView.prototype.getPerimeterPoint=function(a,b,c,d){var e=null;if(null!=a){var f=this.getPerimeterFunction(a);if(null!=f&&null!=b&&(d=this.getPerimeterBounds(a,d),0<d.width||0<d.height)){e=new mxPoint(b.x,b.y);var g=b=!1;this.graph.model.isVertex(a.cell)&&(b=1==mxUtils.getValue(a.style,mxConstants.STYLE_FLIPH,0),g=1==mxUtils.getValue(a.style,mxConstants.STYLE_FLIPV,0),null!=a.shape&&null!=a.shape.stencil&&(b=1==mxUtils.getValue(a.style,"stencilFlipH",0)||b,g=1==mxUtils.getValue(a.style,"stencilFlipV", 0)||g),b&&(e.x=2*d.getCenterX()-e.x),g&&(e.y=2*d.getCenterY()-e.y));e=f(d,a,e,c);null!=e&&(b&&(e.x=2*d.getCenterX()-e.x),g&&(e.y=2*d.getCenterY()-e.y))}null==e&&(e=this.getPoint(a))}return e};mxGraphView.prototype.getRoutingCenterX=function(a){var b=null!=a.style?parseFloat(a.style[mxConstants.STYLE_ROUTING_CENTER_X])||0:0;return a.getCenterX()+b*a.width}; mxGraphView.prototype.getRoutingCenterY=function(a){var b=null!=a.style?parseFloat(a.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0:0;return a.getCenterY()+b*a.height};mxGraphView.prototype.getPerimeterBounds=function(a,b){b=null!=b?b:0;null!=a&&(b+=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0));return a.getPerimeterBounds(b*this.scale)}; mxGraphView.prototype.getPerimeterFunction=function(a){a=a.style[mxConstants.STYLE_PERIMETER];if("string"==typeof a){var b=mxStyleRegistry.getValue(a);null==b&&this.isAllowEval()&&(b=mxUtils.eval(a));a=b}return"function"==typeof a?a:null};mxGraphView.prototype.getNextPoint=function(a,b,c){a=a.absolutePoints;var d=null;null!=a&&2<=a.length&&(d=a.length,d=a[c?Math.min(1,d-1):Math.max(0,d-2)]);null==d&&null!=b&&(d=new mxPoint(b.getCenterX(),b.getCenterY()));return d}; mxGraphView.prototype.getVisibleTerminal=function(a,b){var c=this.graph.getModel();for(b=a=c.getTerminal(a,b);null!=a&&a!=this.currentRoot;){if(!this.graph.isCellVisible(b)||this.isCellCollapsed(a))b=a;a=c.getParent(a)}null==b||c.contains(b)&&c.getParent(b)!=c.getRoot()&&b!=this.currentRoot||(b=null);return b}; mxGraphView.prototype.updateEdgeBounds=function(a){var b=a.absolutePoints,c=b[0],d=b[b.length-1];if(c.x!=d.x||c.y!=d.y){var e=d.x-c.x,f=d.y-c.y;a.terminalDistance=Math.sqrt(e*e+f*f)}else a.terminalDistance=0;d=0;var g=[];f=c;if(null!=f){c=f.x;for(var k=f.y,l=c,m=k,n=1;n<b.length;n++){var p=b[n];null!=p&&(e=f.x-p.x,f=f.y-p.y,e=Math.sqrt(e*e+f*f),g.push(e),d+=e,f=p,c=Math.min(f.x,c),k=Math.min(f.y,k),l=Math.max(f.x,l),m=Math.max(f.y,m))}a.length=d;a.segments=g;a.x=c;a.y=k;a.width=Math.max(1,l-c);a.height= Math.max(1,m-k)}}; mxGraphView.prototype.getPoint=function(a,b){var c=a.getCenterX(),d=a.getCenterY();if(null==a.segments||null!=b&&!b.relative)null!=b&&(b=b.offset,null!=b&&(c+=b.x,d+=b.y));else{for(var e=a.absolutePoints.length,f=Math.round(((null!=b?b.x/2:0)+.5)*a.length),g=a.segments[0],k=0,l=1;f>=Math.round(k+g)&&l<e-1;)k+=g,g=a.segments[l++];e=0==g?0:(f-k)/g;f=a.absolutePoints[l-1];a=a.absolutePoints[l];null!=f&&null!=a&&(l=c=d=0,null!=b&&(d=b.y,b=b.offset,null!=b&&(c=b.x,l=b.y)),b=a.x-f.x,a=a.y-f.y,c=f.x+b*e+ ((0==g?0:a/g)*d+c)*this.scale,d=f.y+a*e-((0==g?0:b/g)*d-l)*this.scale)}return new mxPoint(c,d)}; mxGraphView.prototype.getRelativePoint=function(a,b,c){var d=this.graph.getModel().getGeometry(a.cell);if(null!=d){var e=a.absolutePoints.length;if(d.relative&&1<e){d=a.length;for(var f=a.segments,g=a.absolutePoints[0],k=a.absolutePoints[1],l=mxUtils.ptSegDistSq(g.x,g.y,k.x,k.y,b,c),m=0,n=0,p=0,q=2;q<e;q++)g=k,k=a.absolutePoints[q],g=mxUtils.ptSegDistSq(g.x,g.y,k.x,k.y,b,c),p+=f[q-2],g<=l&&(l=g,n=q-1,m=p);e=f[n];g=a.absolutePoints[n];k=a.absolutePoints[n+1];l=k.x;f=k.y;a=g.x-l;n=g.y-f;f=(a-(b-l))* a+(n-(c-f))*n;a=Math.sqrt(0>=f?0:f*f/(a*a+n*n));a>e&&(a=e);e=Math.sqrt(mxUtils.ptSegDistSq(g.x,g.y,k.x,k.y,b,c));-1==mxUtils.relativeCcw(g.x,g.y,k.x,k.y,b,c)&&(e=-e);return new mxPoint(0<d?(d/2-m-a)/d*-2:0,e/this.scale)}}return new mxPoint}; mxGraphView.prototype.updateEdgeLabelOffset=function(a){var b=a.absolutePoints;a.absoluteOffset.x=a.getCenterX();a.absoluteOffset.y=a.getCenterY();if(null!=b&&0<b.length&&null!=a.segments){var c=this.graph.getCellGeometry(a.cell);if(c.relative){var d=this.getPoint(a,c);null!=d&&(a.absoluteOffset=d)}else{d=b[0];var e=b[b.length-1];if(null!=d&&null!=e){b=e.x-d.x;var f=e.y-d.y,g=e=0;c=c.offset;null!=c&&(e=c.x,g=c.y);c=d.y+f/2+g*this.scale;a.absoluteOffset.x=d.x+b/2+e*this.scale;a.absoluteOffset.y=c}}}}; mxGraphView.prototype.getState=function(a,b){b=b||!1;var c=null;null!=a&&(c=this.states.get(a),b&&(null==c||this.updateStyle)&&this.graph.isCellVisible(a)&&(null==c?(c=this.createState(a),this.states.put(a,c)):c.style=this.graph.getCellStyle(a)));return c};mxGraphView.prototype.isRendering=function(){return this.rendering};mxGraphView.prototype.setRendering=function(a){this.rendering=a};mxGraphView.prototype.isAllowEval=function(){return this.allowEval}; mxGraphView.prototype.setAllowEval=function(a){this.allowEval=a};mxGraphView.prototype.getStates=function(){return this.states};mxGraphView.prototype.setStates=function(a){this.states=a};mxGraphView.prototype.getCellStates=function(a){if(null==a)return this.states;for(var b=[],c=0;c<a.length;c++){var d=this.getState(a[c]);null!=d&&b.push(d)}return b}; mxGraphView.prototype.removeState=function(a){var b=null;null!=a&&(b=this.states.remove(a),null!=b&&(this.graph.cellRenderer.destroy(b),b.invalid=!0,b.destroy()));return b};mxGraphView.prototype.createState=function(a){return new mxCellState(this,a,this.graph.getCellStyle(a))};mxGraphView.prototype.getCanvas=function(){return this.canvas};mxGraphView.prototype.getBackgroundPane=function(){return this.backgroundPane};mxGraphView.prototype.getDrawPane=function(){return this.drawPane}; mxGraphView.prototype.getOverlayPane=function(){return this.overlayPane};mxGraphView.prototype.getDecoratorPane=function(){return this.decoratorPane};mxGraphView.prototype.isContainerEvent=function(a){a=mxEvent.getSource(a);return a==this.graph.container||this.backgroundPane.contains(a)||a==this.canvas.parentNode||a==this.canvas||a==this.drawPane||a==this.overlayPane||a==this.decoratorPane}; mxGraphView.prototype.isScrollEvent=function(a){var b=mxUtils.getOffset(this.graph.container);a=new mxPoint(a.clientX-b.x,a.clientY-b.y);b=this.graph.container.offsetWidth;var c=this.graph.container.clientWidth;if(b>c&&a.x>c+2&&a.x<=b)return!0;b=this.graph.container.offsetHeight;c=this.graph.container.clientHeight;return b>c&&a.y>c+2&&a.y<=b?!0:!1};mxGraphView.prototype.init=function(){this.installListeners();this.graph.dialect==mxConstants.DIALECT_SVG?this.createSvg():this.createHtml()}; mxGraphView.prototype.installListeners=function(){var a=this.graph,b=a.container;null!=b&&(mxClient.IS_TOUCH&&(mxEvent.addListener(b,"gesturestart",mxUtils.bind(this,function(c){a.fireGestureEvent(c);mxEvent.consume(c)})),mxEvent.addListener(b,"gesturechange",mxUtils.bind(this,function(c){a.fireGestureEvent(c);mxEvent.consume(c)})),mxEvent.addListener(b,"gestureend",mxUtils.bind(this,function(c){a.fireGestureEvent(c);mxEvent.consume(c)}))),mxEvent.addGestureListeners(b,mxUtils.bind(this,function(c){!this.isContainerEvent(c)|| (mxClient.IS_GC||mxClient.IS_OP||mxClient.IS_SF)&&this.isScrollEvent(c)||a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(c))}),mxUtils.bind(this,function(c){this.isContainerEvent(c)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(c))}),mxUtils.bind(this,function(c){this.isContainerEvent(c)&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(c))})),mxEvent.addListener(b,"dblclick",mxUtils.bind(this,function(c){this.isContainerEvent(c)&&a.dblClick(c)})),a.addMouseListener({mouseDown:function(c, d){a.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,function(c){null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide();if(this.captureDocumentGesture&&a.isMouseDown&&null!=a.container&&!this.isContainerEvent(c)&&"none"!=a.container.style.display&&"hidden"!=a.container.style.visibility&&!mxEvent.isConsumed(c)){var d=a.fireMouseEvent,e=mxEvent.MOUSE_MOVE,f=null;if(mxClient.IS_TOUCH){f=mxEvent.getClientX(c);var g= mxEvent.getClientY(c);f=mxUtils.convertPoint(b,f,g);f=a.view.getState(a.getCellAt(f.x,f.y))}d.call(a,e,new mxMouseEvent(c,f))}}),this.endHandler=mxUtils.bind(this,function(c){this.captureDocumentGesture&&a.isMouseDown&&null!=a.container&&!this.isContainerEvent(c)&&"none"!=a.container.style.display&&"hidden"!=a.container.style.visibility&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(c))}),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler))}; mxGraphView.prototype.createHtml=function(){var a=this.graph.container;null!=a&&(this.canvas=this.createHtmlPane("100%","100%"),this.canvas.style.overflow="hidden",this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.decoratorPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),this.canvas.appendChild(this.decoratorPane), a.appendChild(this.canvas),this.updateContainerStyle(a))};mxGraphView.prototype.updateHtmlCanvasSize=function(a,b){if(null!=this.graph.container){var c=this.graph.container.offsetHeight;this.canvas.style.width=this.graph.container.offsetWidth<a?a+"px":"100%";this.canvas.style.height=c<b?b+"px":"100%"}}; mxGraphView.prototype.createHtmlPane=function(a,b){var c=document.createElement("DIV");null!=a&&null!=b?(c.style.position="absolute",c.style.left="0px",c.style.top="0px",c.style.width=a,c.style.height=b):c.style.position="relative";return c}; mxGraphView.prototype.createSvg=function(){var a=this.graph.container;this.canvas=document.createElementNS(mxConstants.NS_SVG,"g");this.backgroundPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.backgroundPane);this.drawPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.drawPane);this.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.overlayPane);this.decoratorPane=document.createElementNS(mxConstants.NS_SVG, "g");this.canvas.appendChild(this.decoratorPane);var b=document.createElementNS(mxConstants.NS_SVG,"svg");b.style.left="0px";b.style.top="0px";b.style.width="100%";b.style.height="100%";b.style.display="block";b.appendChild(this.canvas);null!=a&&(a.appendChild(b),this.updateContainerStyle(a))};mxGraphView.prototype.updateContainerStyle=function(a){var b=mxUtils.getCurrentStyle(a);null!=b&&"static"==b.position&&(a.style.position="relative");mxClient.IS_POINTER&&(a.style.touchAction="none")}; mxGraphView.prototype.destroy=function(){var a=null!=this.canvas?this.canvas.ownerSVGElement:null;null==a&&(a=this.canvas);null!=a&&null!=a.parentNode&&(this.clear(this.currentRoot,!0),mxEvent.removeGestureListeners(document,null,this.moveHandler,this.endHandler),mxEvent.release(this.graph.container),a.parentNode.removeChild(a),this.decoratorPane=this.overlayPane=this.drawPane=this.backgroundPane=this.canvas=this.endHandler=this.moveHandler=null)}; function mxCurrentRootChange(a,b){this.view=a;this.previous=this.root=b;this.isUp=null==b;if(!this.isUp){a=this.view.currentRoot;for(var c=this.view.graph.getModel();null!=a;){if(a==b){this.isUp=!0;break}a=c.getParent(a)}}} mxCurrentRootChange.prototype.execute=function(){var a=this.view.currentRoot;this.view.currentRoot=this.previous;this.previous=a;a=this.view.graph.getTranslateForRoot(this.view.currentRoot);null!=a&&(this.view.translate=new mxPoint(-a.x,-a.y));this.isUp?(this.view.clear(this.view.currentRoot,!0),this.view.validate()):this.view.refresh();this.view.fireEvent(new mxEventObject(this.isUp?mxEvent.UP:mxEvent.DOWN,"root",this.view.currentRoot,"previous",this.previous));this.isUp=!this.isUp}; function mxGraph(a,b,c,d,e){this.mouseListeners=null;this.renderHint=c;this.dialect=mxClient.IS_SVG?mxConstants.DIALECT_SVG:c==mxConstants.RENDERING_HINT_FASTEST?mxConstants.DIALECT_STRICTHTML:c==mxConstants.RENDERING_HINT_FASTER?mxConstants.DIALECT_PREFERHTML:mxConstants.DIALECT_MIXEDHTML;this.model=null!=b?b:new mxGraphModel;this.multiplicities=[];this.imageBundles=[];this.cellRenderer=this.createCellRenderer();this.setSelectionModel(this.createSelectionModel());this.setStylesheet(null!=d?d:this.createStylesheet()); this.view=this.createGraphView();this.view.rendering=null!=e?e:this.view.rendering;this.graphModelChangeListener=mxUtils.bind(this,function(f,g){this.graphModelChanged(g.getProperty("edit").changes)});this.model.addListener(mxEvent.CHANGE,this.graphModelChangeListener);this.createHandlers();null!=a&&this.init(a);this.view.rendering&&this.view.revalidate()}mxLoadResources?mxResources.add(mxClient.basePath+"/resources/graph"):mxClient.defaultBundles.push(mxClient.basePath+"/resources/graph"); mxGraph.prototype=new mxEventSource;mxGraph.prototype.constructor=mxGraph;mxGraph.prototype.mouseListeners=null;mxGraph.prototype.isMouseDown=!1;mxGraph.prototype.model=null;mxGraph.prototype.view=null;mxGraph.prototype.stylesheet=null;mxGraph.prototype.selectionModel=null;mxGraph.prototype.cellEditor=null;mxGraph.prototype.cellRenderer=null;mxGraph.prototype.multiplicities=null;mxGraph.prototype.renderHint=null;mxGraph.prototype.dialect=null;mxGraph.prototype.gridSize=10; mxGraph.prototype.gridEnabled=!0;mxGraph.prototype.portsEnabled=!0;mxGraph.prototype.nativeDblClickEnabled=!0;mxGraph.prototype.doubleTapEnabled=!0;mxGraph.prototype.doubleTapTimeout=500;mxGraph.prototype.doubleTapTolerance=25;mxGraph.prototype.lastTouchY=0;mxGraph.prototype.lastTouchY=0;mxGraph.prototype.lastTouchTime=0;mxGraph.prototype.tapAndHoldEnabled=!0;mxGraph.prototype.tapAndHoldDelay=350;mxGraph.prototype.tapAndHoldInProgress=!1;mxGraph.prototype.tapAndHoldValid=!1; mxGraph.prototype.initialTouchX=0;mxGraph.prototype.initialTouchY=0;mxGraph.prototype.tolerance=4;mxGraph.prototype.defaultOverlap=.5;mxGraph.prototype.defaultParent=null;mxGraph.prototype.alternateEdgeStyle=null;mxGraph.prototype.backgroundImage=null;mxGraph.prototype.pageVisible=!1;mxGraph.prototype.pageBreaksVisible=!1;mxGraph.prototype.pageBreakColor="gray";mxGraph.prototype.pageBreakDashed=!0;mxGraph.prototype.minPageBreakDist=20;mxGraph.prototype.maxPageBreaks=1E4; mxGraph.prototype.preferPageSize=!1;mxGraph.prototype.pageFormat=mxConstants.PAGE_FORMAT_A4_PORTRAIT;mxGraph.prototype.pageScale=1.5;mxGraph.prototype.enabled=!0;mxGraph.prototype.escapeEnabled=!0;mxGraph.prototype.invokesStopCellEditing=!0;mxGraph.prototype.enterStopsCellEditing=!1;mxGraph.prototype.useScrollbarsForPanning=!0;mxGraph.prototype.exportEnabled=!0;mxGraph.prototype.importEnabled=!0;mxGraph.prototype.cellsLocked=!1;mxGraph.prototype.cellsCloneable=!0; mxGraph.prototype.foldingEnabled=!0;mxGraph.prototype.cellsEditable=!0;mxGraph.prototype.cellsDeletable=!0;mxGraph.prototype.cellsMovable=!0;mxGraph.prototype.edgeLabelsMovable=!0;mxGraph.prototype.vertexLabelsMovable=!1;mxGraph.prototype.dropEnabled=!1;mxGraph.prototype.splitEnabled=!0;mxGraph.prototype.cellsResizable=!0;mxGraph.prototype.cellsBendable=!0;mxGraph.prototype.cellsSelectable=!0;mxGraph.prototype.cellsDisconnectable=!0;mxGraph.prototype.autoSizeCells=!1; mxGraph.prototype.autoSizeCellsOnAdd=!1;mxGraph.prototype.autoScroll=!0;mxGraph.prototype.ignoreScrollbars=!1;mxGraph.prototype.translateToScrollPosition=!1;mxGraph.prototype.timerAutoScroll=!1;mxGraph.prototype.allowAutoPanning=!1;mxGraph.prototype.autoExtend=!0;mxGraph.prototype.maximumGraphBounds=null;mxGraph.prototype.minimumGraphSize=null;mxGraph.prototype.minimumContainerSize=null;mxGraph.prototype.maximumContainerSize=null;mxGraph.prototype.resizeContainer=!1;mxGraph.prototype.border=0; mxGraph.prototype.keepEdgesInForeground=!1;mxGraph.prototype.keepEdgesInBackground=!1;mxGraph.prototype.allowNegativeCoordinates=!0;mxGraph.prototype.constrainChildren=!0;mxGraph.prototype.constrainRelativeChildren=!1;mxGraph.prototype.extendParents=!0;mxGraph.prototype.extendParentsOnAdd=!0;mxGraph.prototype.extendParentsOnMove=!1;mxGraph.prototype.contractParents=!1;mxGraph.prototype.contractParentsOnRemove=!0;mxGraph.prototype.contractParentsOnMove=!1;mxGraph.prototype.recursiveResize=!1; mxGraph.prototype.collapseToPreferredSize=!0;mxGraph.prototype.zoomFactor=1.2;mxGraph.prototype.keepSelectionVisibleOnZoom=!1;mxGraph.prototype.centerZoom=!0;mxGraph.prototype.resetViewOnRootChange=!0;mxGraph.prototype.resetEdgesOnResize=!1;mxGraph.prototype.resetEdgesOnMove=!1;mxGraph.prototype.resetEdgesOnConnect=!0;mxGraph.prototype.allowLoops=!1;mxGraph.prototype.defaultLoopStyle=mxEdgeStyle.Loop;mxGraph.prototype.multigraph=!0;mxGraph.prototype.connectableEdges=!1; mxGraph.prototype.allowDanglingEdges=!0;mxGraph.prototype.cloneInvalidEdges=!1;mxGraph.prototype.disconnectOnMove=!0;mxGraph.prototype.labelsVisible=!0;mxGraph.prototype.htmlLabels=!1;mxGraph.prototype.swimlaneSelectionEnabled=!0;mxGraph.prototype.swimlaneNesting=!0;mxGraph.prototype.swimlaneIndicatorColorAttribute=mxConstants.STYLE_FILLCOLOR;mxGraph.prototype.imageBundles=null;mxGraph.prototype.minFitScale=.1;mxGraph.prototype.maxFitScale=8;mxGraph.prototype.panDx=0;mxGraph.prototype.panDy=0; mxGraph.prototype.collapsedImage=new mxImage(mxClient.imageBasePath+"/collapsed.gif",9,9);mxGraph.prototype.expandedImage=new mxImage(mxClient.imageBasePath+"/expanded.gif",9,9);mxGraph.prototype.warningImage=new mxImage(mxClient.imageBasePath+"/warning"+(mxClient.IS_MAC?".png":".gif"),16,16);mxGraph.prototype.alreadyConnectedResource="none"!=mxClient.language?"alreadyConnected":"";mxGraph.prototype.containsValidationErrorsResource="none"!=mxClient.language?"containsValidationErrors":""; mxGraph.prototype.collapseExpandResource="none"!=mxClient.language?"collapse-expand":"";mxGraph.prototype.init=function(a){this.container=a;this.cellEditor=this.createCellEditor();this.view.init();this.sizeDidChange();mxEvent.addListener(a,"mouseleave",mxUtils.bind(this,function(b){null!=this.tooltipHandler&&null!=this.tooltipHandler.div&&this.tooltipHandler.div!=b.relatedTarget&&this.tooltipHandler.hide()}))}; mxGraph.prototype.createHandlers=function(){this.tooltipHandler=this.createTooltipHandler();this.tooltipHandler.setEnabled(!1);this.selectionCellsHandler=this.createSelectionCellsHandler();this.connectionHandler=this.createConnectionHandler();this.connectionHandler.setEnabled(!1);this.graphHandler=this.createGraphHandler();this.panningHandler=this.createPanningHandler();this.panningHandler.panningEnabled=!1;this.popupMenuHandler=this.createPopupMenuHandler()}; mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(this)};mxGraph.prototype.createSelectionCellsHandler=function(){return new mxSelectionCellsHandler(this)};mxGraph.prototype.createConnectionHandler=function(){return new mxConnectionHandler(this)};mxGraph.prototype.createGraphHandler=function(){return new mxGraphHandler(this)};mxGraph.prototype.createPanningHandler=function(){return new mxPanningHandler(this)};mxGraph.prototype.createPopupMenuHandler=function(){return new mxPopupMenuHandler(this)}; mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)};mxGraph.prototype.createStylesheet=function(){return new mxStylesheet};mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)};mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer};mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)};mxGraph.prototype.getModel=function(){return this.model};mxGraph.prototype.getView=function(){return this.view}; mxGraph.prototype.getStylesheet=function(){return this.stylesheet};mxGraph.prototype.setStylesheet=function(a){this.stylesheet=a};mxGraph.prototype.getSelectionModel=function(){return this.selectionModel};mxGraph.prototype.setSelectionModel=function(a){this.selectionModel=a}; mxGraph.prototype.getSelectionCellsForChanges=function(a,b){for(var c=new mxDictionary,d=[],e=mxUtils.bind(this,function(k){if(null!=k&&!c.get(k)&&this.model.contains(k)&&!this.model.isLayer(k))if(this.model.isEdge(k)||this.model.isVertex(k))c.put(k,!0),d.push(k);else for(var l=this.model.getChildCount(k),m=0;m<l;m++)e(this.model.getChildAt(k,m))}),f=0;f<a.length;f++){var g=a[f];g.constructor==mxRootChange||null!=b&&b(g)||e(this.getCellForChange(g))}return d}; mxGraph.prototype.getCellForChange=function(a){var b=null;a instanceof mxChildChange?b=a.child:null!=a.cell&&a.cell instanceof mxCell&&(b=a.cell);return b};mxGraph.prototype.graphModelChanged=function(a){for(var b=0;b<a.length;b++)this.processChange(a[b]);this.updateSelection();this.view.validate();this.sizeDidChange()}; mxGraph.prototype.updateSelection=function(){for(var a=this.getSelectionCells(),b=[],c=0;c<a.length;c++)if(this.model.contains(a[c])&&this.isCellVisible(a[c]))for(var d=this.model.getParent(a[c]);null!=d&&d!=this.view.currentRoot;){if(this.isCellCollapsed(d)||!this.isCellVisible(d)){b.push(a[c]);break}d=this.model.getParent(d)}else b.push(a[c]);this.removeSelectionCells(b)}; mxGraph.prototype.processChange=function(a){if(a instanceof mxRootChange)this.clearSelection(),this.setDefaultParent(null),this.removeStateForCell(a.previous),this.resetViewOnRootChange&&(this.view.scale=1,this.view.translate.x=0,this.view.translate.y=0),this.fireEvent(new mxEventObject(mxEvent.ROOT));else if(a instanceof mxChildChange){var b=this.model.getParent(a.child);this.view.invalidate(a.child,!0,!0);if(!this.model.contains(b)||this.isCellCollapsed(b))this.view.invalidate(a.child,!0,!0),this.removeStateForCell(a.child), this.view.currentRoot==a.child&&this.home();b!=a.previous&&(null!=b&&this.view.invalidate(b,!1,!1),null!=a.previous&&this.view.invalidate(a.previous,!1,!1))}else a instanceof mxTerminalChange||a instanceof mxGeometryChange?(a instanceof mxTerminalChange||null==a.previous&&null!=a.geometry||null!=a.previous&&(null==a.previous.equals||!a.previous.equals(a.geometry)))&&this.view.invalidate(a.cell):a instanceof mxValueChange?this.view.invalidate(a.cell,!1,!1):a instanceof mxStyleChange?(this.view.invalidate(a.cell, !0,!0),a=this.view.getState(a.cell),null!=a&&(a.invalidStyle=!0)):null!=a.cell&&a.cell instanceof mxCell&&this.removeStateForCell(a.cell);null==this.getDefaultParent()||this.model.contains(this.getDefaultParent())||this.setDefaultParent(null)};mxGraph.prototype.removeStateForCell=function(a){for(var b=this.model.getChildCount(a),c=0;c<b;c++)this.removeStateForCell(this.model.getChildAt(a,c));this.view.invalidate(a,!1,!0);this.view.removeState(a)}; mxGraph.prototype.addCellOverlay=function(a,b){null==a.overlays&&(a.overlays=[]);a.overlays.push(b);var c=this.view.getState(a);null!=c&&this.cellRenderer.redraw(c);this.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY,"cell",a,"overlay",b));return b};mxGraph.prototype.getCellOverlays=function(a){return a.overlays}; mxGraph.prototype.removeCellOverlay=function(a,b){if(null==b)this.removeCellOverlays(a);else{var c=mxUtils.indexOf(a.overlays,b);0<=c?(a.overlays.splice(c,1),0==a.overlays.length&&(a.overlays=null),c=this.view.getState(a),null!=c&&this.cellRenderer.redraw(c),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",a,"overlay",b))):b=null}return b}; mxGraph.prototype.removeCellOverlays=function(a){var b=a.overlays;if(null!=b){a.overlays=null;var c=this.view.getState(a);null!=c&&this.cellRenderer.redraw(c);for(c=0;c<b.length;c++)this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",a,"overlay",b[c]))}return b};mxGraph.prototype.clearCellOverlays=function(a){a=null!=a?a:this.model.getRoot();this.removeCellOverlays(a);for(var b=this.model.getChildCount(a),c=0;c<b;c++){var d=this.model.getChildAt(a,c);this.clearCellOverlays(d)}}; mxGraph.prototype.setCellWarning=function(a,b,c,d){if(null!=b&&0<b.length)return c=null!=c?c:this.warningImage,b=new mxCellOverlay(c,"<font color=red>"+b+"</font>"),d&&b.addListener(mxEvent.CLICK,mxUtils.bind(this,function(e,f){this.isEnabled()&&this.setSelectionCell(a)})),this.addCellOverlay(a,b);this.removeCellOverlays(a);return null};mxGraph.prototype.startEditing=function(a,b){this.startEditingAtCell(null,a,b)}; mxGraph.prototype.startEditingAtCell=function(a,b,c){null!=b&&mxEvent.isMultiTouchEvent(b)||(null==a&&(a=this.getSelectionCell(),null==a||this.isCellEditable(a)||(a=null)),null!=a&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",a,"event",b)),this.cellEditor.startEditing(a,b,c),this.fireEvent(new mxEventObject(mxEvent.EDITING_STARTED,"cell",a,"event",b))))};mxGraph.prototype.getEditingValue=function(a,b){return this.convertValueToString(a)}; mxGraph.prototype.stopEditing=function(a){this.cellEditor.stopEditing(a);this.fireEvent(new mxEventObject(mxEvent.EDITING_STOPPED,"cancel",a))};mxGraph.prototype.labelChanged=function(a,b,c){this.model.beginUpdate();try{var d=a.value;this.cellLabelChanged(a,b,this.isAutoSizeCell(a));this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",a,"value",b,"old",d,"event",c))}finally{this.model.endUpdate()}return a}; mxGraph.prototype.cellLabelChanged=function(a,b,c){this.model.beginUpdate();try{this.model.setValue(a,b),c&&this.cellSizeUpdated(a,!1)}finally{this.model.endUpdate()}};mxGraph.prototype.escape=function(a){this.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",a))}; mxGraph.prototype.click=function(a){var b=a.getEvent(),c=a.getCell(),d=new mxEventObject(mxEvent.CLICK,"event",b,"cell",c);a.isConsumed()&&d.consume();this.fireEvent(d);if(this.isEnabled()&&!mxEvent.isConsumed(b)&&!d.isConsumed()){if(null!=c){if(this.isTransparentClickEvent(b)){var e=!1;a=this.getCellAt(a.graphX,a.graphY,null,null,null,mxUtils.bind(this,function(g){var k=this.isCellSelected(g.cell);e=e||k;return!e||k||g.cell!=c&&this.model.isAncestor(g.cell,c)}));null!=a&&(c=a)}}else if(this.isSwimlaneSelectionEnabled()&& (c=this.getSwimlaneAt(a.getGraphX(),a.getGraphY()),!(null==c||this.isToggleEvent(b)&&mxEvent.isAltDown(b)))){d=c;for(a=[];null!=d;){d=this.model.getParent(d);var f=this.view.getState(d);this.isSwimlane(d)&&null!=f&&a.push(d)}if(0<a.length)for(a=a.reverse(),a.splice(0,0,c),a.push(c),d=0;d<a.length-1;d++)this.isCellSelected(a[d])&&(c=a[this.isToggleEvent(b)?d:d+1])}null!=c?this.selectCellForEvent(c,b):this.isToggleEvent(b)||this.clearSelection()}}; mxGraph.prototype.isSiblingSelected=function(a){for(var b=this.model,c=b.getParent(a),d=b.getChildCount(c),e=0;e<d;e++){var f=b.getChildAt(c,e);if(a!=f&&this.isCellSelected(f))return!0}return!1};mxGraph.prototype.dblClick=function(a,b){var c=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",a,"cell",b);this.fireEvent(c);!this.isEnabled()||mxEvent.isConsumed(a)||c.isConsumed()||null==b||!this.isCellEditable(b)||this.isEditing(b)||(this.startEditingAtCell(b,a),mxEvent.consume(a))}; mxGraph.prototype.tapAndHold=function(a){var b=a.getEvent(),c=new mxEventObject(mxEvent.TAP_AND_HOLD,"event",b,"cell",a.getCell());this.fireEvent(c);c.isConsumed()&&(this.panningHandler.panningTrigger=!1);this.isEnabled()&&!mxEvent.isConsumed(b)&&!c.isConsumed()&&this.connectionHandler.isEnabled()&&(b=this.view.getState(this.connectionHandler.marker.getCell(a)),null!=b&&(this.connectionHandler.marker.currentColor=this.connectionHandler.marker.validColor,this.connectionHandler.marker.markedState=b, this.connectionHandler.marker.mark(),this.connectionHandler.first=new mxPoint(a.getGraphX(),a.getGraphY()),this.connectionHandler.edgeState=this.connectionHandler.createEdgeState(a),this.connectionHandler.previous=b,this.connectionHandler.fireEvent(new mxEventObject(mxEvent.START,"state",this.connectionHandler.previous))))}; mxGraph.prototype.scrollPointToVisible=function(a,b,c,d){if(this.timerAutoScroll||!this.ignoreScrollbars&&!mxUtils.hasScrollbars(this.container))this.allowAutoPanning&&!this.panningHandler.isActive()&&(null==this.panningManager&&(this.panningManager=this.createPanningManager()),this.panningManager.panTo(a+this.panDx,b+this.panDy));else{var e=this.container;d=null!=d?d:20;if(a>=e.scrollLeft&&b>=e.scrollTop&&a<=e.scrollLeft+e.clientWidth&&b<=e.scrollTop+e.clientHeight){var f=e.scrollLeft+e.clientWidth- a;if(f<d){if(a=e.scrollLeft,e.scrollLeft+=d-f,c&&a==e.scrollLeft){if(this.dialect==mxConstants.DIALECT_SVG){a=this.view.getDrawPane().ownerSVGElement;var g=this.container.scrollWidth+d-f}else g=Math.max(e.clientWidth,e.scrollWidth)+d-f,a=this.view.getCanvas();a.style.width=g+"px";e.scrollLeft+=d-f}}else f=a-e.scrollLeft,f<d&&(e.scrollLeft-=d-f);f=e.scrollTop+e.clientHeight-b;f<d?(a=e.scrollTop,e.scrollTop+=d-f,a==e.scrollTop&&c&&(this.dialect==mxConstants.DIALECT_SVG?(a=this.view.getDrawPane().ownerSVGElement, b=this.container.scrollHeight+d-f,a.style.height=b+"px"):(b=Math.max(e.clientHeight,e.scrollHeight)+d-f,a=this.view.getCanvas(),a.style.height=b+"px"),e.scrollTop+=d-f)):(f=b-e.scrollTop,f<d&&(e.scrollTop-=d-f))}}};mxGraph.prototype.createPanningManager=function(){return new mxPanningManager(this)}; mxGraph.prototype.getBorderSizes=function(){var a=mxUtils.getCurrentStyle(this.container);return new mxRectangle(mxUtils.parseCssNumber(a.paddingLeft)+("none"!=a.borderLeftStyle?mxUtils.parseCssNumber(a.borderLeftWidth):0),mxUtils.parseCssNumber(a.paddingTop)+("none"!=a.borderTopStyle?mxUtils.parseCssNumber(a.borderTopWidth):0),mxUtils.parseCssNumber(a.paddingRight)+("none"!=a.borderRightStyle?mxUtils.parseCssNumber(a.borderRightWidth):0),mxUtils.parseCssNumber(a.paddingBottom)+("none"!=a.borderBottomStyle? mxUtils.parseCssNumber(a.borderBottomWidth):0))};mxGraph.prototype.getPreferredPageSize=function(a,b,c){a=this.view.translate;var d=this.pageFormat,e=this.pageScale;d=new mxRectangle(0,0,Math.ceil(d.width*e),Math.ceil(d.height*e));return new mxRectangle(0,0,(this.pageBreaksVisible?Math.ceil(b/d.width):1)*d.width+2+a.x,(this.pageBreaksVisible?Math.ceil(c/d.height):1)*d.height+2+a.y)}; mxGraph.prototype.fit=function(a,b,c,d,e,f,g){if(null!=this.container){a=null!=a?a:this.getBorder();b=null!=b?b:!1;c=null!=c?c:0;d=null!=d?d:!0;e=null!=e?e:!1;f=null!=f?f:!1;var k=this.getBorderSizes(),l=this.container.offsetWidth-k.x-k.width-1,m=null!=g?g:this.container.offsetHeight-k.y-k.height-1;g=this.getGraphBounds();if(0<g.width&&0<g.height){b&&null!=g.x&&null!=g.y&&(g=g.clone(),g.width+=g.x,g.height+=g.y,g.x=0,g.y=0);k=this.view.scale;var n=g.width/k,p=g.height/k;null!=this.backgroundImage&& null!=this.backgroundImage.width&&null!=this.backgroundImage.height&&(n=Math.max(n,this.backgroundImage.width-g.x/k),p=Math.max(p,this.backgroundImage.height-g.y/k));var q=(b?a:2*a)+c+1;l-=q;m-=q;e=e?m/p:f?l/n:Math.min(l/n,m/p);null!=this.minFitScale&&(e=Math.max(e,this.minFitScale));null!=this.maxFitScale&&(e=Math.min(e,this.maxFitScale));if(d)b?this.view.scale!=e&&this.view.setScale(e):mxUtils.hasScrollbars(this.container)?(this.view.setScale(e),a=this.getGraphBounds(),null!=a.x&&(this.container.scrollLeft= a.x),null!=a.y&&(this.container.scrollTop=a.y)):this.view.scaleAndTranslate(e,null!=g.x?Math.floor(this.view.translate.x-g.x/k+a/e+c/2):a,null!=g.y?Math.floor(this.view.translate.y-g.y/k+a/e+c/2):a);else return e}}return this.view.scale}; mxGraph.prototype.sizeDidChange=function(){var a=this.getGraphBounds();if(null!=this.container){var b=this.getBorder(),c=Math.max(0,a.x)+a.width+2*b;b=Math.max(0,a.y)+a.height+2*b;null!=this.minimumContainerSize&&(c=Math.max(c,this.minimumContainerSize.width),b=Math.max(b,this.minimumContainerSize.height));this.resizeContainer&&this.doResizeContainer(c,b);if(this.preferPageSize||this.pageVisible){var d=this.getPreferredPageSize(a,Math.max(1,c),Math.max(1,b));null!=d&&(c=d.width*this.view.scale,b= d.height*this.view.scale)}null!=this.minimumGraphSize&&(c=Math.max(c,this.minimumGraphSize.width*this.view.scale),b=Math.max(b,this.minimumGraphSize.height*this.view.scale));c=Math.ceil(c);b=Math.ceil(b);this.dialect==mxConstants.DIALECT_SVG?(d=this.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.minWidth=Math.max(1,c)+"px",d.style.minHeight=Math.max(1,b)+"px",d.style.width="100%",d.style.height="100%")):(this.view.canvas.style.minWidth=Math.max(1,c)+"px",this.view.canvas.style.minHeight=Math.max(1, b)+"px");this.updatePageBreaks(this.pageBreaksVisible,c,b)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",a))};mxGraph.prototype.doResizeContainer=function(a,b){null!=this.maximumContainerSize&&(a=Math.min(this.maximumContainerSize.width,a),b=Math.min(this.maximumContainerSize.height,b));this.container.style.width=Math.ceil(a)+"px";this.container.style.height=Math.ceil(b)+"px"}; mxGraph.prototype.updatePageBreaks=function(a,b,c){b=this.view.scale;c=this.view.translate;var d=this.pageFormat,e=b*this.pageScale,f=new mxRectangle(0,0,d.width*e,d.height*e);d=mxRectangle.fromRectangle(this.getGraphBounds());d.width=Math.max(1,d.width);d.height=Math.max(1,d.height);f.x=Math.floor((d.x-c.x*b)/f.width)*f.width+c.x*b;f.y=Math.floor((d.y-c.y*b)/f.height)*f.height+c.y*b;d.width=Math.ceil((d.width+(d.x-f.x))/f.width)*f.width;d.height=Math.ceil((d.height+(d.y-f.y))/f.height)*f.height; var g=(a=a&&Math.min(f.width,f.height)>this.minPageBreakDist)?Math.min(this.maxPageBreaks,Math.ceil(d.height/f.height)+1):0,k=a?Math.min(this.maxPageBreaks,Math.ceil(d.width/f.width)+1):0,l=(k-1)*f.width,m=(g-1)*f.height;null==this.horizontalPageBreaks&&0<g&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<k&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(n){if(null!=n){for(var p=n==this.horizontalPageBreaks?g:k,q=0;q<=p;q++){var r=n==this.horizontalPageBreaks?[new mxPoint(Math.round(f.x), Math.round(f.y+q*f.height)),new mxPoint(Math.round(f.x+l),Math.round(f.y+q*f.height))]:[new mxPoint(Math.round(f.x+q*f.width),Math.round(f.y)),new mxPoint(Math.round(f.x+q*f.width),Math.round(f.y+m))];null!=n[q]&&null!=n[q].node?(n[q].points=r,n[q].redraw()):(null!=n[q]&&n[q].destroy(),r=new mxPolyline(r,this.pageBreakColor),r.dialect=this.dialect,r.pointerEvents=!1,r.isDashed=this.pageBreakDashed,r.init(this.view.backgroundPane),r.redraw(),n[q]=r)}for(q=p;q<n.length;q++)n[q].destroy();n.splice(p, n.length-p)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)};mxGraph.prototype.getCurrentCellStyle=function(a,b){b=b?null:this.view.getState(a);return null!=b?b.style:this.getCellStyle(a)}; mxGraph.prototype.getCellStyle=function(a,b){b=null!=b?b:!0;var c=this.model.getStyle(a),d=this.model.isEdge(a)?this.stylesheet.getDefaultEdgeStyle():this.stylesheet.getDefaultVertexStyle();null!=c&&0<c.length?d=this.stylesheet.getCellStyle(c,d,b):null!=d&&(d=mxUtils.clone(d));null==d?d={}:b&&(d=this.postProcessCellStyle(a,d));return d}; mxGraph.prototype.postProcessCellStyle=function(a,b){if(null!=b){var c=b[mxConstants.STYLE_IMAGE];a=this.getImageFromBundles(c);null!=a?b[mxConstants.STYLE_IMAGE]=a:a=c;null!=a&&"function"===typeof a.substring&&"data:image/"==a.substring(0,11)&&("data:image/svg+xml,<"==a.substring(0,20)?a=a.substring(0,19)+encodeURIComponent(a.substring(19)):"data:image/svg+xml,%3C"!=a.substring(0,22)&&(c=a.indexOf(","),0<c&&";base64,"!=a.substring(c-7,c+1)&&(a=a.substring(0,c)+";base64,"+a.substring(c+1))),b[mxConstants.STYLE_IMAGE]= a)}return b};mxGraph.prototype.setCellStyle=function(a,b){b=b||this.getSelectionCells();if(null!=b){this.model.beginUpdate();try{for(var c=0;c<b.length;c++)this.model.setStyle(b[c],a)}finally{this.model.endUpdate()}}};mxGraph.prototype.toggleCellStyle=function(a,b,c){c=c||this.getSelectionCell();return this.toggleCellStyles(a,b,[c])}; mxGraph.prototype.toggleCellStyles=function(a,b,c){b=null!=b?b:!1;c=c||this.getEditableCells(this.getSelectionCells());var d=null;null!=c&&0<c.length&&(d=this.getCurrentCellStyle(c[0]),d=mxUtils.getValue(d,a,b)?0:1,this.setCellStyles(a,d,c));return d}; mxGraph.prototype.setCellStyles=function(a,b,c){c=c||this.getEditableCells(this.getSelectionCells());this.model.beginUpdate();try{mxUtils.setCellStyles(this.model,c,a,b);for(var d=0;d<c.length;d++){var e=this.view.getState(c[d]);null!=e&&null!=e.shape&&e.shape.styleChanged(a,b,e)}}finally{this.model.endUpdate()}};mxGraph.prototype.toggleCellStyleFlags=function(a,b,c){this.setCellStyleFlags(a,b,null,c)}; mxGraph.prototype.setCellStyleFlags=function(a,b,c,d){d=d||this.getEditableCells(this.getSelectionCells());null!=d&&0<d.length&&(null==c&&(c=this.getCurrentCellStyle(d[0]),c=(parseInt(c[a]||0)&b)!=b),mxUtils.setCellStyleFlags(this.model,d,a,b,c))};mxGraph.prototype.getOriginForCell=function(a){a=this.model.getParent(a);for(var b=new mxPoint;null!=a;){var c=this.getCellGeometry(a);null==c||c.relative||(b.x+=c.x,b.y+=c.y);a=this.model.getParent(a)}return b}; mxGraph.prototype.alignCells=function(a,b,c){null==b&&(b=this.getMovableCells(this.getSelectionCells()));if(null!=b&&1<b.length){if(null==c)for(var d=0;d<b.length;d++){var e=this.getOriginForCell(b[d]),f=this.getCellGeometry(b[d]);if(!this.model.isEdge(b[d])&&null!=f&&!f.relative)if(null==c)if(a==mxConstants.ALIGN_CENTER){c=e.x+f.x+f.width/2;break}else if(a==mxConstants.ALIGN_RIGHT)c=e.x+f.x+f.width;else if(a==mxConstants.ALIGN_TOP)c=e.y+f.y;else if(a==mxConstants.ALIGN_MIDDLE){c=e.y+f.y+f.height/ 2;break}else c=a==mxConstants.ALIGN_BOTTOM?e.y+f.y+f.height:e.x+f.x;else c=a==mxConstants.ALIGN_RIGHT?Math.max(c,e.x+f.x+f.width):a==mxConstants.ALIGN_TOP?Math.min(c,e.y+f.y):a==mxConstants.ALIGN_BOTTOM?Math.max(c,e.y+f.y+f.height):Math.min(c,e.x+f.x)}if(null!=c){b=mxUtils.sortCells(b);this.model.beginUpdate();try{for(d=0;d<b.length;d++)e=this.getOriginForCell(b[d]),f=this.getCellGeometry(b[d]),this.model.isEdge(b[d])||null==f||f.relative||(f=f.clone(),a==mxConstants.ALIGN_CENTER?f.x=c-e.x-f.width/ 2:a==mxConstants.ALIGN_RIGHT?f.x=c-e.x-f.width:a==mxConstants.ALIGN_TOP?f.y=c-e.y:a==mxConstants.ALIGN_MIDDLE?f.y=c-e.y-f.height/2:a==mxConstants.ALIGN_BOTTOM?f.y=c-e.y-f.height:f.x=c-e.x,this.resizeCell(b[d],f));this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",a,"cells",b))}finally{this.model.endUpdate()}}}return b}; mxGraph.prototype.flipEdge=function(a){if(null!=a&&null!=this.alternateEdgeStyle){this.model.beginUpdate();try{var b=this.model.getStyle(a);null==b||0==b.length?this.model.setStyle(a,this.alternateEdgeStyle):this.model.setStyle(a,null);this.resetEdge(a);this.fireEvent(new mxEventObject(mxEvent.FLIP_EDGE,"edge",a))}finally{this.model.endUpdate()}}return a};mxGraph.prototype.addImageBundle=function(a){this.imageBundles.push(a)}; mxGraph.prototype.removeImageBundle=function(a){for(var b=[],c=0;c<this.imageBundles.length;c++)this.imageBundles[c]!=a&&b.push(this.imageBundles[c]);this.imageBundles=b};mxGraph.prototype.getImageFromBundles=function(a){if(null!=a)for(var b=0;b<this.imageBundles.length;b++){var c=this.imageBundles[b].getImage(a);if(null!=c)return c}return null}; mxGraph.prototype.orderCells=function(a,b,c){null==b&&(b=mxUtils.sortCells(this.getEditableCells(this.getSelectionCells()),!0));this.model.beginUpdate();try{this.cellsOrdered(b,a,c),this.fireEvent(new mxEventObject(mxEvent.ORDER_CELLS,"back",a,"cells",b,"increment",c))}finally{this.model.endUpdate()}return b}; mxGraph.prototype.cellsOrdered=function(a,b,c){if(null!=a){this.model.beginUpdate();try{for(var d=0;d<a.length;d++){var e=this.model.getParent(a[d]);b?c?this.model.add(e,a[d],Math.max(0,e.getIndex(a[d])-1)):this.model.add(e,a[d],d):c?this.model.add(e,a[d],Math.min(this.model.getChildCount(e)-1,e.getIndex(a[d])+1)):this.model.add(e,a[d],this.model.getChildCount(e)-1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ORDERED,"back",b,"cells",a,"increment",c))}finally{this.model.endUpdate()}}}; mxGraph.prototype.groupCells=function(a,b,c){null==c&&(c=mxUtils.sortCells(this.getSelectionCells(),!0));c=this.getCellsForGroup(c);null==a&&(a=this.createGroupCell(c));var d=this.getBoundsForGroup(a,c,b);if(1<c.length&&null!=d){var e=this.model.getParent(a);null==e&&(e=this.model.getParent(c[0]));this.model.beginUpdate();try{null==this.getCellGeometry(a)&&this.model.setGeometry(a,new mxGeometry);this.cellsResized([a],[d],!1);var f=this.model.getChildCount(e);this.cellsAdded([a],e,f,null,null,!1, !1,!1);f=this.model.getChildCount(a);this.cellsAdded(c,a,f,null,null,!1,!1,!1);this.cellsMoved(c,-d.x,-d.y,!1,!1,!1);this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",a,"border",b,"cells",c))}finally{this.model.endUpdate()}}return a};mxGraph.prototype.getCellsForGroup=function(a){var b=[];if(null!=a&&0<a.length){var c=this.model.getParent(a[0]);b.push(a[0]);for(var d=1;d<a.length;d++)this.model.getParent(a[d])==c&&b.push(a[d])}return b}; mxGraph.prototype.getBoundsForGroup=function(a,b,c){b=this.getBoundingBoxFromGeometry(b,!0);null!=b&&(this.isSwimlane(a)&&(a=this.getStartSize(a),b.x-=a.width,b.y-=a.height,b.width+=a.width,b.height+=a.height),null!=c&&(b.x-=c,b.y-=c,b.width+=2*c,b.height+=2*c));return b};mxGraph.prototype.createGroupCell=function(a){a=new mxCell("");a.setVertex(!0);a.setConnectable(!1);return a}; mxGraph.prototype.ungroupCells=function(a){var b=[];null==a&&(a=this.getCellsForUngroup());if(null!=a&&0<a.length){this.model.beginUpdate();try{for(var c=0;c<a.length;c++){var d=this.model.getChildren(a[c]);if(null!=d&&0<d.length){d=d.slice();var e=this.model.getParent(a[c]),f=this.model.getChildCount(e);this.cellsAdded(d,e,f,null,null,!0);b=b.concat(d);for(var g=0;g<d.length;g++)if(this.model.isVertex(d[g])){var k=this.view.getState(d[g]),l=this.getCellGeometry(d[g]);null!=k&&null!=l&&l.relative&& (l=l.clone(),l.x=k.origin.x,l.y=k.origin.y,l.relative=!1,this.model.setGeometry(d[g],l))}}}this.removeCellsAfterUngroup(a);this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,"cells",a))}finally{this.model.endUpdate()}}return b};mxGraph.prototype.getCellsForUngroup=function(){for(var a=this.getEditableCells(this.getSelectionCells()),b=[],c=0;c<a.length;c++)this.model.isVertex(a[c])&&0<this.model.getChildCount(a[c])&&b.push(a[c]);return b};mxGraph.prototype.removeCellsAfterUngroup=function(a){this.cellsRemoved(this.addAllEdges(a))}; mxGraph.prototype.removeCellsFromParent=function(a){null==a&&(a=this.getSelectionCells());this.model.beginUpdate();try{var b=this.getDefaultParent(),c=this.model.getChildCount(b);this.cellsAdded(a,b,c,null,null,!0);this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",a))}finally{this.model.endUpdate()}return a}; mxGraph.prototype.updateGroupBounds=function(a,b,c,d,e,f,g){null==a&&(a=this.getSelectionCells());b=null!=b?b:0;c=null!=c?c:!1;d=null!=d?d:0;e=null!=e?e:0;f=null!=f?f:0;g=null!=g?g:0;this.model.beginUpdate();try{for(var k=a.length-1;0<=k;k--){var l=this.getCellGeometry(a[k]);if(null!=l){var m=this.getChildCells(a[k]);if(null!=m&&0<m.length){var n=this.getBoundingBoxFromGeometry(m,!0);if(null!=n&&0<n.width&&0<n.height){var p=this.isSwimlane(a[k])?this.getActualStartSize(a[k],!0):new mxRectangle,q= this.getActualFooterSize(a[k],!0);l=l.clone();c&&(l.x=Math.round(l.x+n.x-b-p.x-g-q.x),l.y=Math.round(l.y+n.y-b-p.y-d-q.y));l.width=Math.round(n.width+2*b+p.x+g+e+p.width+q.x+q.width);l.height=Math.round(n.height+2*b+p.y+d+f+p.height+q.y+q.height);this.model.setGeometry(a[k],l);this.moveCells(m,b+p.x-n.x+g+q.x,b+p.y-n.y+d+q.y)}}}}}finally{this.model.endUpdate()}return a}; mxGraph.prototype.getBoundingBox=function(a){var b=null;if(null!=a&&0<a.length)for(var c=0;c<a.length;c++)if(this.model.isVertex(a[c])||this.model.isEdge(a[c])){var d=this.view.getBoundingBox(this.view.getState(a[c]),!0);null!=d&&(null==b?b=mxRectangle.fromRectangle(d):b.add(d))}return b};mxGraph.prototype.cloneCell=function(a,b,c,d){return this.cloneCells([a],b,c,d)[0]}; mxGraph.prototype.cloneCells=function(a,b,c,d){b=null!=b?b:!0;var e=null;if(null!=a){var f=new mxDictionary;e=[];for(var g=0;g<a.length;g++)f.put(a[g],!0),e.push(a[g]);if(0<e.length){var k=this.view.scale,l=this.view.translate;e=this.model.cloneCells(a,!0,c);for(g=0;g<a.length;g++)if(!b&&this.model.isEdge(e[g])&&null!=this.getEdgeValidationError(e[g],this.model.getTerminal(e[g],!0),this.model.getTerminal(e[g],!1)))e[g]=null;else{var m=this.model.getGeometry(e[g]);if(null!=m){var n=this.view.getState(a[g]), p=this.view.getState(this.model.getParent(a[g]));if(null!=n&&null!=p)if(c=p.origin.x,p=p.origin.y,this.model.isEdge(e[g])){if(n=n.absolutePoints,null!=n){var q=this.model.getTerminal(a[g],!0);if(null!=q){for(;null!=q&&!f.get(q);)q=this.model.getParent(q);null==q&&null!=n[0]&&m.setTerminalPoint(new mxPoint(Math.round(n[0].x/k-l.x-c),Math.round(n[0].y/k-l.y-p)),!0)}d||(q=m.getTerminalPoint(!0),null!=q&&(q.x+=c,q.y+=p));q=this.model.getTerminal(a[g],!1);if(null!=q){for(;null!=q&&!f.get(q);)q=this.model.getParent(q); var r=n.length-1;null==q&&null!=n[r]&&m.setTerminalPoint(new mxPoint(Math.round(n[r].x/k-l.x-c),Math.round(n[r].y/k-l.y-p)),!1)}d||(q=m.getTerminalPoint(!1),null!=q&&(q.x+=c,q.y+=p));m=m.points;if(!d&&null!=m)for(n=0;n<m.length;n++)null!=m[n]&&(m[n].x+=c,m[n].y+=p)}}else d||m.translate(c,p)}}}else e=[]}return e};mxGraph.prototype.insertVertex=function(a,b,c,d,e,f,g,k,l){b=this.createVertex(a,b,c,d,e,f,g,k,l);return this.addCell(b,a)}; mxGraph.prototype.createVertex=function(a,b,c,d,e,f,g,k,l){a=new mxGeometry(d,e,f,g);a.relative=null!=l?l:!1;c=new mxCell(c,a,k);c.setId(b);c.setVertex(!0);c.setConnectable(!0);return c};mxGraph.prototype.insertEdge=function(a,b,c,d,e,f){b=this.createEdge(a,b,c,d,e,f);return this.addEdge(b,a,d,e)};mxGraph.prototype.createEdge=function(a,b,c,d,e,f){a=new mxCell(c,new mxGeometry,f);a.setId(b);a.setEdge(!0);a.geometry.relative=!0;return a}; mxGraph.prototype.addEdge=function(a,b,c,d,e){return this.addCell(a,b,e,c,d)};mxGraph.prototype.addCell=function(a,b,c,d,e){return this.addCells([a],b,c,d,e)[0]};mxGraph.prototype.addCells=function(a,b,c,d,e,f){null==b&&(b=this.getDefaultParent());null==c&&(c=this.model.getChildCount(b));this.model.beginUpdate();try{this.cellsAdded(a,b,c,d,e,null!=f?f:!1,!0),this.fireEvent(new mxEventObject(mxEvent.ADD_CELLS,"cells",a,"parent",b,"index",c,"source",d,"target",e))}finally{this.model.endUpdate()}return a}; mxGraph.prototype.cellsAdded=function(a,b,c,d,e,f,g,k){if(null!=a&&null!=b&&null!=c){this.model.beginUpdate();try{var l=f?this.view.getState(b):null,m=null!=l?l.origin:null,n=new mxPoint(0,0);for(l=0;l<a.length;l++)if(null==a[l])c--;else{var p=this.model.getParent(a[l]);if(null!=m&&a[l]!=b&&b!=p){var q=this.view.getState(p),r=null!=q?q.origin:n,t=this.model.getGeometry(a[l]);if(null!=t){var u=r.x-m.x,v=r.y-m.y;t=t.clone();t.translate(u,v);t.relative||!this.model.isVertex(a[l])||this.isAllowNegativeCoordinates()|| (t.x=Math.max(0,t.x),t.y=Math.max(0,t.y));this.model.setGeometry(a[l],t)}}b==p&&c+l>this.model.getChildCount(b)&&c--;var y=this.model.updateEdgeParent;this.model.updateEdgeParent=function(A,z){0>mxUtils.indexOf(a,A)&&y.apply(this,arguments)};this.model.add(b,a[l],c+l);this.model.updateEdgeParent=y;this.autoSizeCellsOnAdd&&this.autoSizeCell(a[l],!0);(null==k||k)&&this.isExtendParentsOnAdd(a[l])&&this.isExtendParent(a[l])&&this.extendParent(a[l]);(null==g||g)&&this.constrainChild(a[l]);null!=d&&this.cellConnected(a[l], d,!0);null!=e&&this.cellConnected(a[l],e,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",a,"parent",b,"index",c,"source",d,"target",e,"absolute",f))}finally{this.model.endUpdate()}}};mxGraph.prototype.autoSizeCell=function(a,b){if(null!=b?b:1){b=this.model.getChildCount(a);for(var c=0;c<b;c++)this.autoSizeCell(this.model.getChildAt(a,c))}this.getModel().isVertex(a)&&this.isAutoSizeCell(a)&&this.updateCellSize(a)}; mxGraph.prototype.removeCells=function(a,b){b=null!=b?b:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));if(b)a=this.getDeletableCells(this.addAllEdges(a));else{a=a.slice();for(var c=this.getDeletableCells(this.getAllEdges(a)),d=new mxDictionary,e=0;e<a.length;e++)d.put(a[e],!0);for(e=0;e<c.length;e++)null!=this.view.getState(c[e])||d.get(c[e])||(d.put(c[e],!0),a.push(c[e]))}this.model.beginUpdate();try{this.cellsRemoved(a),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS,"cells", a,"includeEdges",b))}finally{this.model.endUpdate()}return a}; mxGraph.prototype.cellsRemoved=function(a){if(null!=a&&0<a.length){var b=this.view.scale,c=this.view.translate;this.model.beginUpdate();try{for(var d=new mxDictionary,e=0;e<a.length;e++)d.put(a[e],!0);var f=null;if(this.isContractParentsOnRemove()){f=[];var g=new mxDictionary;for(e=0;e<a.length;e++){var k=this.model.getParent(a[e]);null==k||d.get(k)||g.get(k)||!this.isContractParent(a[e])||(g.put(k,!0),f.push(k))}}for(e=0;e<a.length;e++){var l=this.getAllEdges([a[e]]),m=mxUtils.bind(this,function(n, p){var q=this.model.getGeometry(n);if(null!=q){for(var r=this.model.getTerminal(n,p),t=!1,u=r;null!=u;){if(a[e]==u){t=!0;break}u=this.model.getParent(u)}t&&(q=q.clone(),null!=q.setTerminalPoint&&(t=this.view.getState(n),null!=t&&null!=t.absolutePoints?(r=t.absolutePoints,u=p?0:r.length-1,q.setTerminalPoint(new mxPoint(r[u].x/b-c.x-t.origin.x,r[u].y/b-c.y-t.origin.y),p)):(r=this.view.getState(r),null!=r&&q.setTerminalPoint(new mxPoint(r.getCenterX()/b-c.x,r.getCenterY()/b-c.y),p))),this.model.setGeometry(n, q),this.model.setTerminal(n,null,p))}});for(g=0;g<l.length;g++)d.get(l[g])||(d.put(l[g],!0),m(l[g],!0),m(l[g],!1));this.model.remove(a[e])}if(null!=f)for(e=0;e<f.length;e++)0<this.model.getChildCount(f[e])&&this.contractParent(this.model.getChildAt(f[e],0));this.fireEvent(new mxEventObject(mxEvent.CELLS_REMOVED,"cells",a))}finally{this.model.endUpdate()}}}; mxGraph.prototype.splitEdge=function(a,b,c,d,e,f,g,k){d=d||0;e=e||0;k=null!=k?k:this.model.getParent(a);f=this.model.getTerminal(a,!0);this.model.beginUpdate();try{if(null==c){c=this.cloneCell(a);var l=this.view.getState(a),m=this.getCellGeometry(c);if(null!=m&&null!=m.points&&null!=l){var n=this.view.translate,p=this.view.scale,q=mxUtils.findNearestSegment(l,(d+n.x)*p,(e+n.y)*p);m.points=m.points.slice(0,q);m=this.getCellGeometry(a);null!=m&&null!=m.points&&(m=m.clone(),m.points=m.points.slice(q), this.model.setGeometry(a,m))}}this.cellsMoved(b,d,e,!1,!1);this.cellsAdded([c],k,this.model.getChildCount(k),f,b[0],!1);this.cellsAdded(b,k,this.model.getChildCount(k),null,null,!0);this.cellConnected(a,b[0],!0);this.fireEvent(new mxEventObject(mxEvent.SPLIT_EDGE,"edge",a,"cells",b,"newEdge",c,"dx",d,"dy",e))}finally{this.model.endUpdate()}return c}; mxGraph.prototype.toggleCells=function(a,b,c){null==b&&(b=this.getSelectionCells());c&&(b=this.addAllEdges(b));this.model.beginUpdate();try{this.cellsToggled(b,a),this.fireEvent(new mxEventObject(mxEvent.TOGGLE_CELLS,"show",a,"cells",b,"includeEdges",c))}finally{this.model.endUpdate()}return b};mxGraph.prototype.cellsToggled=function(a,b){if(null!=a&&0<a.length){this.model.beginUpdate();try{for(var c=0;c<a.length;c++)this.model.setVisible(a[c],b)}finally{this.model.endUpdate()}}}; mxGraph.prototype.foldCells=function(a,b,c,d,e){b=null!=b?b:!1;null==c&&(c=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing(!1);this.model.beginUpdate();try{this.cellsFolded(c,a,b,d),this.fireEvent(new mxEventObject(mxEvent.FOLD_CELLS,"collapse",a,"recurse",b,"cells",c))}finally{this.model.endUpdate()}return c}; mxGraph.prototype.cellsFolded=function(a,b,c,d){if(null!=a&&0<a.length){this.model.beginUpdate();try{for(var e=0;e<a.length;e++)if((!d||this.isCellFoldable(a[e],b))&&b!=this.isCellCollapsed(a[e])){this.model.setCollapsed(a[e],b);this.swapBounds(a[e],b);this.isExtendParent(a[e])&&this.extendParent(a[e]);this.isContractParent(a[e])&&this.contractParent(a[e]);if(c){var f=this.model.getChildren(a[e]);this.cellsFolded(f,b,c)}this.constrainChild(a[e])}this.fireEvent(new mxEventObject(mxEvent.CELLS_FOLDED, "cells",a,"collapse",b,"recurse",c))}finally{this.model.endUpdate()}}};mxGraph.prototype.swapBounds=function(a,b){if(null!=a){var c=this.model.getGeometry(a);null!=c&&(c=c.clone(),this.updateAlternateBounds(a,c,b),c.swap(),this.model.setGeometry(a,c))}}; mxGraph.prototype.updateAlternateBounds=function(a,b,c){if(null!=a&&null!=b){c=this.getCurrentCellStyle(a);if(null==b.alternateBounds){var d=b;if(this.collapseToPreferredSize){var e="1"==mxUtils.getValue(c,mxConstants.STYLE_AUTOSIZE_GRID,this.gridEnabled?"1":"0");a=this.getPreferredSizeForCell(a,null,e);null!=a&&(d=a,a=mxUtils.getValue(c,mxConstants.STYLE_STARTSIZE),0<a&&(d.height=Math.max(d.height,a)))}b.alternateBounds=new mxRectangle(0,0,d.width,d.height)}null!=b.alternateBounds&&(b.alternateBounds.x= b.x,b.alternateBounds.y=b.y,e=mxUtils.toRadians(c[mxConstants.STYLE_ROTATION]||0),0!=e&&(c=b.alternateBounds.getCenterX()-b.getCenterX(),d=b.alternateBounds.getCenterY()-b.getCenterY(),a=Math.cos(e),e=Math.sin(e),b.alternateBounds.x+=a*c-e*d-c,b.alternateBounds.y+=e*c+a*d-d))}};mxGraph.prototype.addAllEdges=function(a){var b=a.slice();return mxUtils.removeDuplicates(b.concat(this.getAllEdges(a)))}; mxGraph.prototype.getAllEdges=function(a){var b=[];if(null!=a)for(var c=0;c<a.length;c++){for(var d=this.model.getEdgeCount(a[c]),e=0;e<d;e++)b.push(this.model.getEdgeAt(a[c],e));d=this.model.getChildren(a[c]);b=b.concat(this.getAllEdges(d))}return b};mxGraph.prototype.updateCellSize=function(a,b){b=null!=b?b:!1;this.model.beginUpdate();try{this.cellSizeUpdated(a,b),this.fireEvent(new mxEventObject(mxEvent.UPDATE_CELL_SIZE,"cell",a,"ignoreChildren",b))}finally{this.model.endUpdate()}return a}; mxGraph.prototype.cellSizeUpdated=function(a,b){if(null!=a){this.model.beginUpdate();try{var c=this.getCellStyle(a),d=this.model.getGeometry(a);if(null!=d){var e=null,f=mxUtils.getValue(c,mxConstants.STYLE_FIXED_WIDTH,!1);f&&(e=d.width-2*parseFloat(mxUtils.getValue(c,mxConstants.STYLE_SPACING,2))-parseFloat(mxUtils.getValue(c,mxConstants.STYLE_SPACING_LEFT,0))-parseFloat(mxUtils.getValue(c,mxConstants.STYLE_SPACING_RIGHT,0)));var g="1"==mxUtils.getValue(c,mxConstants.STYLE_AUTOSIZE_GRID,this.gridEnabled? "1":"0"),k=this.getPreferredSizeForCell(a,e,g);if(null!=k){var l=this.isCellCollapsed(a);d=d.clone();if(this.isSwimlane(a)){var m=this.model.getStyle(a);null==m&&(m="");mxUtils.getValue(c,mxConstants.STYLE_HORIZONTAL,!0)?(m=mxUtils.setStyle(m,mxConstants.STYLE_STARTSIZE,k.height+8),l&&(d.height=k.height+8),f||(d.width=k.width)):(m=mxUtils.setStyle(m,mxConstants.STYLE_STARTSIZE,k.width+8),l&&!f&&(d.width=k.width+8),d.height=k.height);this.model.setStyle(a,m)}else{var n=this.view.createState(a),p=n.style[mxConstants.STYLE_ALIGN]|| mxConstants.ALIGN_CENTER,q=this.getVerticalAlign(n);"fixed"==n.style[mxConstants.STYLE_ASPECT]&&(k.height=Math.round(d.height*k.width*100/d.width)/100);q==mxConstants.ALIGN_BOTTOM?d.y+=d.height-k.height:q==mxConstants.ALIGN_MIDDLE&&(d.y+=Math.round((d.height-k.height)/2));d.height=k.height;f||(p==mxConstants.ALIGN_RIGHT?d.x+=d.width-k.width:p==mxConstants.ALIGN_CENTER&&(d.x+=Math.round((d.width-k.width)/2)),d.width=k.width)}if(!b&&!l){var r=this.view.getBounds(this.model.getChildren(a));if(null!= r){var t=this.view.translate,u=this.view.scale,v=(r.x+r.width)/u-d.x-t.x;d.height=Math.max(d.height,(r.y+r.height)/u-d.y-t.y);f||(d.width=Math.max(d.width,v))}}this.cellsResized([a],[d],!1)}}}finally{this.model.endUpdate()}}}; mxGraph.prototype.getPreferredSizeForCell=function(a,b,c){c=null!=c?c:this.gridEnabled;var d=null;if(null!=a){var e=this.view.createState(a),f=e.style;if(!this.model.isEdge(a)){var g=f[mxConstants.STYLE_FONTSIZE]||mxConstants.DEFAULT_FONTSIZE;a=d=0;null==this.getImage(e)&&null==f[mxConstants.STYLE_IMAGE]||f[mxConstants.STYLE_SHAPE]!=mxConstants.SHAPE_LABEL||(f[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(d+=parseFloat(mxUtils.getValue(f,mxConstants.STYLE_IMAGE_WIDTH,mxLabel.prototype.imageSize))), f[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(a+=parseFloat(mxUtils.getValue(f,mxConstants.STYLE_IMAGE_HEIGHT,mxLabel.prototype.imageSize))));d+=2*parseFloat(mxUtils.getValue(f,mxConstants.STYLE_SPACING,2));d+=parseFloat(mxUtils.getValue(f,mxConstants.STYLE_SPACING_LEFT,2));d+=parseFloat(mxUtils.getValue(f,mxConstants.STYLE_SPACING_RIGHT,2));a+=2*parseFloat(mxUtils.getValue(f,mxConstants.STYLE_SPACING,2));a+=parseFloat(mxUtils.getValue(f,mxConstants.STYLE_SPACING_TOP,2));a+=parseFloat(mxUtils.getValue(f, mxConstants.STYLE_SPACING_BOTTOM,2));var k=this.getFoldingImage(e);null!=k&&(d+=k.width+8);k=this.cellRenderer.getLabelValue(e);null!=k&&0<k.length?(this.isHtmlLabel(e.cell)?null!=b&&(b+=mxSvgCanvas2D.prototype.foreignObjectPadding):k=mxUtils.htmlEntities(k,!1),k=k.replace(/\n/g,"<br>"),e=mxUtils.getSizeForString(k,g,f[mxConstants.STYLE_FONTFAMILY],b,f[mxConstants.STYLE_FONTSTYLE]),b=e.width+d,e=e.height+a,mxUtils.getValue(f,mxConstants.STYLE_HORIZONTAL,!0)||(f=e,e=b,b=f),c&&(b=this.snap(b+this.gridSize/ 2),e=this.snap(e+this.gridSize/2)),d=new mxRectangle(0,0,b,e)):(c=4*this.gridSize,d=new mxRectangle(0,0,c,c))}}return d};mxGraph.prototype.resizeCell=function(a,b,c){return this.resizeCells([a],[b],c)[0]};mxGraph.prototype.resizeCells=function(a,b,c){c=null!=c?c:this.isRecursiveResize();this.model.beginUpdate();try{var d=this.cellsResized(a,b,c);this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",a,"bounds",b,"previous",d))}finally{this.model.endUpdate()}return a}; mxGraph.prototype.cellsResized=function(a,b,c){c=null!=c?c:!1;var d=[];if(null!=a&&null!=b&&a.length==b.length){this.model.beginUpdate();try{for(var e=0;e<a.length;e++)d.push(this.cellResized(a[e],b[e],!1,c)),this.isExtendParent(a[e])&&this.extendParent(a[e]),this.isContractParent(a[e])&&this.contractParent(a[e]),this.constrainChild(a[e]);this.resetEdgesOnResize&&this.resetEdges(a);this.fireEvent(new mxEventObject(mxEvent.CELLS_RESIZED,"cells",a,"bounds",b,"previous",d))}finally{this.model.endUpdate()}}return d}; mxGraph.prototype.cellResized=function(a,b,c,d){var e=this.model.getGeometry(a);if(null!=e&&(e.x!=b.x||e.y!=b.y||e.width!=b.width||e.height!=b.height)){var f=e.clone();!c&&f.relative?(c=f.offset,null!=c&&(c.x+=b.x-f.x,c.y+=b.y-f.y)):(f.x=b.x,f.y=b.y);f.width=b.width;f.height=b.height;f.relative||!this.model.isVertex(a)||this.isAllowNegativeCoordinates()||(f.x=Math.max(0,f.x),f.y=Math.max(0,f.y));this.model.beginUpdate();try{d&&this.resizeChildCells(a,f),this.model.setGeometry(a,f),this.isCellCollapsed(a)|| this.constrainChildCells(a)}finally{this.model.endUpdate()}}return e};mxGraph.prototype.resizeChildCells=function(a,b){var c=this.model.getGeometry(a),d=0!=c.width?b.width/c.width:1;b=0!=c.height?b.height/c.height:1;c=this.model.getChildCount(a);for(var e=0;e<c;e++)this.scaleCell(this.model.getChildAt(a,e),d,b,!0)};mxGraph.prototype.constrainChildCells=function(a){for(var b=this.model.getChildCount(a),c=0;c<b;c++)this.constrainChild(this.model.getChildAt(a,c))}; mxGraph.prototype.scaleCell=function(a,b,c,d){var e=this.model.getGeometry(a);if(null!=e){var f=this.getCurrentCellStyle(a);e=e.clone();var g=e.x,k=e.y,l=e.width,m=e.height;e.scale(b,c,"fixed"==f[mxConstants.STYLE_ASPECT]);"1"==f[mxConstants.STYLE_RESIZE_WIDTH]?e.width=l*b:"0"==f[mxConstants.STYLE_RESIZE_WIDTH]&&(e.width=l);"1"==f[mxConstants.STYLE_RESIZE_HEIGHT]?e.height=m*c:"0"==f[mxConstants.STYLE_RESIZE_HEIGHT]&&(e.height=m);this.isCellMovable(a)||(e.x=g,e.y=k);this.isCellResizable(a)||(e.width= l,e.height=m);this.model.isVertex(a)?this.cellResized(a,e,!0,d):this.model.setGeometry(a,e)}}; mxGraph.prototype.extendParent=function(a){if(null!=a){var b=this.model.getParent(a),c=this.getCellGeometry(b);if(null!=b&&null!=c&&!this.isCellCollapsed(b)&&(a=this.getCellGeometry(a),null!=a&&!a.relative)){var d=this.getCurrentCellStyle(b);d=mxUtils.parsePadding(mxUtils.getValue(d,mxConstants.STYLE_GROUP_PADDING,0));if(c.width<a.x+a.width+d.e||c.height<a.y+a.height+d.s)c=c.clone(),c.width=Math.max(c.width,a.x+a.width+d.e),c.height=Math.max(c.height,a.y+a.height+d.s),this.cellsResized([b],[c],!1)}}}; mxGraph.prototype.contractParent=function(a){if(null!=a){a=this.model.getParent(a);var b=this.getCellGeometry(a);if(null!=a&&null!=b&&!this.isCellCollapsed(a)){var c=this.getCurrentCellStyle(a);c=mxUtils.parsePadding(mxUtils.getValue(c,mxConstants.STYLE_GROUP_PADDING,0));for(var d=0,e=0,f=this.model.getChildCount(a),g=0;g<f;g++){var k=this.model.getChildAt(a,g),l=this.getCellGeometry(k);null!=l&&!l.relative&&this.model.isVertex(k)&&(d=Math.max(d,l.x+l.width),e=Math.max(e,l.y+l.height))}d+=c.e;e+= c.s;0<d&&0<e&&(b.width>d||b.height>e)&&(b=b.clone(),b.width=Math.min(b.width,d),b.height=Math.min(b.height,e),this.model.setGeometry(a,b),this.isContractParent(a)&&this.contractParent(a))}}};mxGraph.prototype.importCells=function(a,b,c,d,e,f){return this.moveCells(a,b,c,!0,d,e,f)}; mxGraph.prototype.moveCells=function(a,b,c,d,e,f,g){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:!1;if(null!=a&&(0!=b||0!=c||d||null!=e)){var k=a=this.model.getTopmostCells(a);this.model.beginUpdate();try{for(var l=new mxDictionary,m=0;m<a.length;m++)l.put(a[m],!0);var n=mxUtils.bind(this,function(v){for(;null!=v;){if(l.get(v))return!0;v=this.model.getParent(v)}return!1}),p=[];for(m=0;m<a.length;m++){var q=this.getCellGeometry(a[m]),r=this.model.getParent(a[m]);null!=q&&q.relative&&this.model.isEdge(r)&& (n(this.model.getTerminal(r,!0))||n(this.model.getTerminal(r,!1)))||p.push(a[m])}a=p;d&&(a=this.cloneCells(a,this.isCloneInvalidEdges(),g),null==e&&(e=this.getDefaultParent()));var t=this.isAllowNegativeCoordinates();null!=e&&this.setAllowNegativeCoordinates(!0);this.cellsMoved(a,b,c,!d&&this.isDisconnectOnMove()&&this.isAllowDanglingEdges(),null==e,this.isExtendParentsOnMove()&&null==e);this.setAllowNegativeCoordinates(t);if(null!=e){var u=this.model.getChildCount(e);this.cellsAdded(a,e,u,null,null, !0);if(d)for(m=0;m<a.length;m++)q=this.getCellGeometry(a[m]),r=this.model.getParent(k[m]),null!=q&&q.relative&&this.model.isEdge(r)&&this.model.contains(r)&&this.model.add(r,a[m])}this.fireEvent(new mxEventObject(mxEvent.MOVE_CELLS,"cells",a,"dx",b,"dy",c,"clone",d,"target",e,"event",f))}finally{this.model.endUpdate()}}return a}; mxGraph.prototype.cellsMoved=function(a,b,c,d,e,f){if(null!=a&&(0!=b||0!=c)){f=null!=f?f:!1;this.model.beginUpdate();try{d&&this.disconnectGraph(a);for(var g=0;g<a.length;g++)this.translateCell(a[g],b,c),f&&this.isExtendParent(a[g])?this.extendParent(a[g]):e&&this.constrainChild(a[g]),this.isContractParentsOnMove()&&this.isContractParent(a[g])&&this.contractParent(a[g]);this.resetEdgesOnMove&&this.resetEdges(a);this.fireEvent(new mxEventObject(mxEvent.CELLS_MOVED,"cells",a,"dx",b,"dy",c,"disconnect", d))}finally{this.model.endUpdate()}}}; mxGraph.prototype.translateCell=function(a,b,c){var d=this.model.getGeometry(a);if(null!=d&&"function"===typeof d.translate){b=parseFloat(b);c=parseFloat(c);d=d.clone();d.translate(b,c,this.model.isEdge(a));d.relative||!this.model.isVertex(a)||this.isAllowNegativeCoordinates()||(d.x=Math.max(0,parseFloat(d.x)),d.y=Math.max(0,parseFloat(d.y)));if(d.relative&&!this.model.isEdge(a)){var e=this.model.getParent(a),f=0;this.model.isVertex(e)&&(e=this.getCurrentCellStyle(e),f=mxUtils.getValue(e,mxConstants.STYLE_ROTATION, 0));0!=f&&(f=mxUtils.toRadians(-f),e=Math.cos(f),f=Math.sin(f),c=mxUtils.getRotatedPoint(new mxPoint(b,c),e,f,new mxPoint(0,0)),b=c.x,c=c.y);null==d.offset?d.offset=new mxPoint(Math.round(b),Math.round(c)):(d.offset.x=Math.round(parseFloat(d.offset.x+b)),d.offset.y=Math.round(parseFloat(d.offset.y+c)))}this.model.setGeometry(a,d)}}; mxGraph.prototype.getCellContainmentArea=function(a){if(null!=a&&!this.model.isEdge(a)){var b=this.model.getParent(a);if(null!=b&&b!=this.getDefaultParent()){var c=this.model.getGeometry(b);if(null!=c){var d=a=0,e=c.width;c=c.height;if(this.isSwimlane(b)){var f=this.getStartSize(b),g=this.getCurrentCellStyle(b);b=mxUtils.getValue(g,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);var k=1==mxUtils.getValue(g,mxConstants.STYLE_FLIPH,0);g=1==mxUtils.getValue(g,mxConstants.STYLE_FLIPV,0);if(b== mxConstants.DIRECTION_SOUTH||b==mxConstants.DIRECTION_NORTH){var l=f.width;f.width=f.height;f.height=l}if(b==mxConstants.DIRECTION_EAST&&!g||b==mxConstants.DIRECTION_NORTH&&!k||b==mxConstants.DIRECTION_WEST&&g||b==mxConstants.DIRECTION_SOUTH&&k)a=f.width,d=f.height;e-=f.width;c-=f.height}return new mxRectangle(a,d,e,c)}}}return null};mxGraph.prototype.getMaximumGraphBounds=function(){return this.maximumGraphBounds}; mxGraph.prototype.constrainChild=function(a,b){if(null!=a&&(b=this.getCellGeometry(a),null!=b&&(this.isConstrainRelativeChildren()||!b.relative))){var c=this.model.getParent(a);this.getCellGeometry(c);var d=this.getMaximumGraphBounds();null!=d&&(c=this.getBoundingBoxFromGeometry([c],!1),null!=c&&(d=mxRectangle.fromRectangle(d),d.x-=c.x,d.y-=c.y));if(this.isConstrainChild(a)&&(c=this.getCellContainmentArea(a),null!=c)){var e=this.getOverlap(a);0<e&&(c=mxRectangle.fromRectangle(c),c.x-=c.width*e,c.y-= c.height*e,c.width+=2*c.width*e,c.height+=2*c.height*e);null==d?d=c:(d=mxRectangle.fromRectangle(d),d.intersect(c))}if(null!=d){c=[a];if(!this.isCellCollapsed(a)){e=this.model.getDescendants(a);for(var f=0;f<e.length;f++)this.isCellVisible(e[f])&&c.push(e[f])}c=this.getBoundingBoxFromGeometry(c,!1);if(null!=c){b=b.clone();e=0;b.width>d.width&&(e=b.width-d.width,b.width-=e);c.x+c.width>d.x+d.width&&(e-=c.x+c.width-d.x-d.width-e);f=0;b.height>d.height&&(f=b.height-d.height,b.height-=f);c.y+c.height> d.y+d.height&&(f-=c.y+c.height-d.y-d.height-f);c.x<d.x&&(e-=c.x-d.x);c.y<d.y&&(f-=c.y-d.y);if(0!=e||0!=f)b.relative?(null==b.offset&&(b.offset=new mxPoint),b.offset.x+=e,b.offset.y+=f):(b.x+=e,b.y+=f);this.model.setGeometry(a,b)}}}}; mxGraph.prototype.resetEdges=function(a){if(null!=a){for(var b=new mxDictionary,c=0;c<a.length;c++)b.put(a[c],!0);this.model.beginUpdate();try{for(c=0;c<a.length;c++){var d=this.model.getEdges(a[c]);if(null!=d)for(var e=0;e<d.length;e++){var f=this.view.getState(d[e]),g=null!=f?f.getVisibleTerminal(!0):this.view.getVisibleTerminal(d[e],!0),k=null!=f?f.getVisibleTerminal(!1):this.view.getVisibleTerminal(d[e],!1);b.get(g)&&b.get(k)||this.resetEdge(d[e])}this.resetEdges(this.model.getChildren(a[c]))}}finally{this.model.endUpdate()}}}; mxGraph.prototype.resetEdge=function(a){var b=this.model.getGeometry(a);null!=b&&null!=b.points&&0<b.points.length&&(b=b.clone(),b.points=[],this.model.setGeometry(a,b));return a}; mxGraph.prototype.getOutlineConstraint=function(a,b,c){if(null!=b.shape){c=this.view.getPerimeterBounds(b);var d=b.style[mxConstants.STYLE_DIRECTION];if(d==mxConstants.DIRECTION_NORTH||d==mxConstants.DIRECTION_SOUTH){c.x+=c.width/2-c.height/2;c.y+=c.height/2-c.width/2;var e=c.width;c.width=c.height;c.height=e}var f=mxUtils.toRadians(b.shape.getShapeRotation());if(0!=f){e=Math.cos(-f);f=Math.sin(-f);var g=new mxPoint(c.getCenterX(),c.getCenterY());a=mxUtils.getRotatedPoint(a,e,f,g)}g=f=1;var k=0,l= 0;if(this.getModel().isVertex(b.cell)){var m=b.style[mxConstants.STYLE_FLIPH],n=b.style[mxConstants.STYLE_FLIPV];null!=b.shape&&null!=b.shape.stencil&&(m=1==mxUtils.getValue(b.style,"stencilFlipH",0)||m,n=1==mxUtils.getValue(b.style,"stencilFlipV",0)||n);if(d==mxConstants.DIRECTION_NORTH||d==mxConstants.DIRECTION_SOUTH)e=m,m=n,n=e;m&&(f=-1,k=-c.width);n&&(g=-1,l=-c.height)}a=new mxPoint((a.x-c.x)*f-k+c.x,(a.y-c.y)*g-l+c.y);return new mxConnectionConstraint(new mxPoint(0==c.width?0:Math.round(1E3* (a.x-c.x)/c.width)/1E3,0==c.height?0:Math.round(1E3*(a.y-c.y)/c.height)/1E3),!1)}return null};mxGraph.prototype.getAllConnectionConstraints=function(a,b){return null!=a&&null!=a.shape&&null!=a.shape.stencil?a.shape.stencil.constraints:null}; mxGraph.prototype.getConnectionConstraint=function(a,b,c){b=null;var d=a.style[c?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(null!=d){var e=a.style[c?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];null!=e&&(b=new mxPoint(parseFloat(d),parseFloat(e)))}d=!1;var f=e=0;null!=b&&(d=mxUtils.getValue(a.style,c?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0),e=parseFloat(a.style[c?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX]),f=parseFloat(a.style[c?mxConstants.STYLE_EXIT_DY: mxConstants.STYLE_ENTRY_DY]),e=isFinite(e)?e:0,f=isFinite(f)?f:0);return new mxConnectionConstraint(b,d,null,e,f)}; mxGraph.prototype.setConnectionConstraint=function(a,b,c,d){if(null!=d){this.model.beginUpdate();try{null==d||null==d.point?(this.setCellStyles(c?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,null,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,null,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_PERIMETER: mxConstants.STYLE_ENTRY_PERIMETER,null,[a])):null!=d.point&&(this.setCellStyles(c?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,d.point.x,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,d.point.y,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,d.dx,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,d.dy,[a]),d.perimeter?this.setCellStyles(c?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER, null,[a]):this.setCellStyles(c?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[a]))}finally{this.model.endUpdate()}}}; mxGraph.prototype.getConnectionPoint=function(a,b,c){c=null!=c?c:!0;var d=null;if(null!=a&&null!=b.point){var e=this.view.getPerimeterBounds(a),f=a.style[mxConstants.STYLE_DIRECTION],g=new mxPoint(e.getCenterX(),e.getCenterY());d=this.view.scale;f!=mxConstants.DIRECTION_NORTH&&f!=mxConstants.DIRECTION_SOUTH||e.rotate90();d=new mxPoint(e.x+b.point.x*e.width+b.dx*d,e.y+b.point.y*e.height+b.dy*d);if(this.getModel().isVertex(a.cell)){var k=1==a.style[mxConstants.STYLE_FLIPH],l=1==a.style[mxConstants.STYLE_FLIPV]; null!=a.shape&&null!=a.shape.stencil&&(k=1==mxUtils.getValue(a.style,"stencilFlipH",0)||k,l=1==mxUtils.getValue(a.style,"stencilFlipV",0)||l);if(f==mxConstants.DIRECTION_NORTH||f==mxConstants.DIRECTION_SOUTH){var m=k;k=l;l=m}k&&(d.x=2*e.getCenterX()-d.x);l&&(d.y=2*e.getCenterY()-d.y)}e=0;null!=f&&1==mxUtils.getValue(a.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(f==mxConstants.DIRECTION_NORTH?e+=270:f==mxConstants.DIRECTION_WEST?e+=180:f==mxConstants.DIRECTION_SOUTH&&(e+=90));0!=e&&(k=f=0, 90==e?k=1:180==e?f=-1:270==e&&(k=-1),d=mxUtils.getRotatedPoint(d,f,k,g));b.perimeter&&(d=this.view.getPerimeterPoint(a,d,!1));a=a.style[mxConstants.STYLE_ROTATION]||0;0!=a&&null!=d&&(a=mxUtils.toRadians(a),f=Math.cos(a),k=Math.sin(a),d=mxUtils.getRotatedPoint(d,f,k,g))}c&&null!=d&&(d.x=Math.round(d.x),d.y=Math.round(d.y));return d}; mxGraph.prototype.connectCell=function(a,b,c,d){this.model.beginUpdate();try{var e=this.model.getTerminal(a,c);this.cellConnected(a,b,c,d);this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",a,"terminal",b,"source",c,"previous",e))}finally{this.model.endUpdate()}return a}; mxGraph.prototype.cellConnected=function(a,b,c,d){if(null!=a){this.model.beginUpdate();try{var e=this.model.getTerminal(a,c);this.setConnectionConstraint(a,b,c,d);this.isPortsEnabled()&&(d=null,this.isPort(b)&&(d=b.getId(),b=this.getTerminalForPort(b,c)),this.setCellStyles(c?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT,d,[a]));this.model.setTerminal(a,b,c);this.resetEdgesOnConnect&&this.resetEdge(a);this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",a,"terminal",b,"source", c,"previous",e))}finally{this.model.endUpdate()}}}; mxGraph.prototype.disconnectGraph=function(a){if(null!=a){this.model.beginUpdate();try{for(var b=this.view.scale,c=this.view.translate,d=new mxDictionary,e=0;e<a.length;e++)d.put(a[e],!0);for(e=0;e<a.length;e++)if(this.model.isEdge(a[e])){var f=this.model.getGeometry(a[e]);if(null!=f){var g=this.view.getState(a[e]),k=this.view.getState(this.model.getParent(a[e]));if(null!=g&&null!=k){f=f.clone();var l=-k.origin.x,m=-k.origin.y,n=g.absolutePoints,p=this.model.getTerminal(a[e],!0);if(null!=p&&this.isCellDisconnectable(a[e], p,!0)){for(;null!=p&&!d.get(p);)p=this.model.getParent(p);null==p&&null!=f.setTerminalPoint&&(f.setTerminalPoint(new mxPoint(n[0].x/b-c.x+l,n[0].y/b-c.y+m),!0),this.model.setTerminal(a[e],null,!0))}var q=this.model.getTerminal(a[e],!1);if(null!=q&&this.isCellDisconnectable(a[e],q,!1)){for(;null!=q&&!d.get(q);)q=this.model.getParent(q);if(null==q&&null!=f.setTerminalPoint){var r=n.length-1;f.setTerminalPoint(new mxPoint(n[r].x/b-c.x+l,n[r].y/b-c.y+m),!1);this.model.setTerminal(a[e],null,!1)}}this.model.setGeometry(a[e], f)}}}}finally{this.model.endUpdate()}}};mxGraph.prototype.getCurrentRoot=function(){return this.view.currentRoot};mxGraph.prototype.getTranslateForRoot=function(a){return null};mxGraph.prototype.isPort=function(a){return!1};mxGraph.prototype.getTerminalForPort=function(a,b){return this.model.getParent(a)};mxGraph.prototype.getChildOffsetForCell=function(a){return null}; mxGraph.prototype.enterGroup=function(a){a=a||this.getSelectionCell();null!=a&&this.isValidRoot(a)&&(this.view.setCurrentRoot(a),this.clearSelection(),a=mxRectangle.fromRectangle(this.getGraphBounds()),a.x-=this.view.translate.x,a.y-=this.view.translate.y,this.scrollRectToVisible(a))}; mxGraph.prototype.exitGroup=function(){var a=this.model.getRoot(),b=this.getCurrentRoot();if(null!=b){for(var c=this.model.getParent(b);c!=a&&!this.isValidRoot(c)&&this.model.getParent(c)!=a;)c=this.model.getParent(c);c==a||this.model.getParent(c)==a?this.view.setCurrentRoot(null):this.view.setCurrentRoot(c);null!=this.view.getState(b)&&(this.setSelectionCell(b),this.scrollCellToVisible(b))}}; mxGraph.prototype.home=function(){var a=this.getCurrentRoot();null!=a&&(this.view.setCurrentRoot(null),null!=this.view.getState(a)&&this.setSelectionCell(a))};mxGraph.prototype.isValidRoot=function(a){return null!=a};mxGraph.prototype.getGraphBounds=function(){return this.view.getGraphBounds()}; mxGraph.prototype.getCellBounds=function(a,b,c){var d=[a];b&&(d=d.concat(this.model.getEdges(a)));d=this.view.getBounds(d);if(c){c=this.model.getChildCount(a);for(var e=0;e<c;e++){var f=this.getCellBounds(this.model.getChildAt(a,e),b,!0);null!=d?d.add(f):d=f}}return d}; mxGraph.prototype.getBoundingBoxFromGeometry=function(a,b,c,d){b=null!=b?b:!1;var e=null;if(null!=a)for(var f=0;f<a.length;f++)if(b||this.model.isVertex(a[f])){var g=this.getCellGeometry(a[f]);if(null!=g){var k=this.model.getParent(a[f]),l=null;if(this.model.isEdge(a[f])){var m=function(p){null!=p&&(null==l?l=new mxRectangle(p.x,p.y,0,0):l.add(new mxRectangle(p.x,p.y,0,0)))};null==this.model.getTerminal(a[f],!0)&&m(g.getTerminalPoint(!0));null==this.model.getTerminal(a[f],!1)&&m(g.getTerminalPoint(!1)); g=g.points;if(null!=g)for(var n=0;n<g.length;n++)m(g[n]);null!=l&&this.model.isVertex(k)&&0<=mxUtils.indexOf(null!=c?c:a,k)&&(m=this.getBoundingBoxFromGeometry([k],!1,null!=c?c:a,d),null!=m&&(l.x+=m.x,l.y+=m.y))}else g.relative?this.model.isVertex(k)&&k!=this.view.currentRoot&&(m=this.getBoundingBoxFromGeometry([k],!1,null!=c?c:a,d),null!=m&&(l=new mxRectangle(g.x*m.width,g.y*m.height,g.width,g.height),0<=mxUtils.indexOf(null!=c?c:a,k)&&(l.x+=m.x,l.y+=m.y))):(l=mxRectangle.fromRectangle(g),this.model.isVertex(k)&& 0<=mxUtils.indexOf(null!=c?c:a,k)&&(m=this.getBoundingBoxFromGeometry([k],!1,null!=c?c:a,d),null!=m&&(l.x+=m.x,l.y+=m.y))),null!=l&&null!=g.offset&&(l.x+=g.offset.x,l.y+=g.offset.y),k=this.getCurrentCellStyle(a[f]),null!=l&&(k=mxUtils.getValue(k,mxConstants.STYLE_ROTATION,0),0!=k&&(l=mxUtils.getBoundingBox(l,k)));null!=l&&(d&&(k=this.getCurrentCellStyle(a[f],!0),null!=k&&(k=mxUtils.getNumber(k,mxConstants.STYLE_STROKEWIDTH,1),l.grow(k/2))),null==e?e=mxRectangle.fromRectangle(l):e.add(l))}}return e}; mxGraph.prototype.refresh=function(a){this.view.clear(a,null==a);this.view.validate();this.sizeDidChange();this.fireEvent(new mxEventObject(mxEvent.REFRESH))};mxGraph.prototype.snap=function(a){this.gridEnabled&&(a=Math.round(a/this.gridSize)*this.gridSize);return a}; mxGraph.prototype.snapDelta=function(a,b,c,d,e){var f=this.view.translate,g=this.view.scale;!c&&this.gridEnabled?(c=this.gridSize*g*.5,d||(d=b.x-(this.snap(b.x/g-f.x)+f.x)*g,a.x=Math.abs(a.x-d)<c?0:this.snap(a.x/g)*g-d),e||(b=b.y-(this.snap(b.y/g-f.y)+f.y)*g,a.y=Math.abs(a.y-b)<c?0:this.snap(a.y/g)*g-b)):(c=.5*g,d||(d=b.x-(Math.round(b.x/g-f.x)+f.x)*g,a.x=Math.abs(a.x-d)<c?0:Math.round(a.x/g)*g-d),e||(b=b.y-(Math.round(b.y/g-f.y)+f.y)*g,a.y=Math.abs(a.y-b)<c?0:Math.round(a.y/g)*g-b));return a}; mxGraph.prototype.panGraph=function(a,b){if(this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container))this.container.scrollLeft=-a,this.container.scrollTop=-b;else{var c=this.view.getCanvas();if(this.dialect==mxConstants.DIALECT_SVG)if(0==a&&0==b){if(c.removeAttribute("transform"),null!=this.shiftPreview1){for(var d=this.shiftPreview1.firstChild;null!=d;){var e=d.nextSibling;this.container.appendChild(d);d=e}null!=this.shiftPreview1.parentNode&&this.shiftPreview1.parentNode.removeChild(this.shiftPreview1); this.shiftPreview1=null;this.container.appendChild(c.parentNode);for(d=this.shiftPreview2.firstChild;null!=d;)e=d.nextSibling,this.container.appendChild(d),d=e;null!=this.shiftPreview2.parentNode&&this.shiftPreview2.parentNode.removeChild(this.shiftPreview2);this.shiftPreview2=null}}else{c.setAttribute("transform","translate("+a+","+b+")");if(null==this.shiftPreview1){this.shiftPreview1=document.createElement("div");this.shiftPreview1.style.position="absolute";this.shiftPreview1.style.overflow="visible"; this.shiftPreview2=document.createElement("div");this.shiftPreview2.style.position="absolute";this.shiftPreview2.style.overflow="visible";var f=this.shiftPreview1;for(d=this.container.firstChild;null!=d;)e=d.nextSibling,d!=c.parentNode?f.appendChild(d):f=this.shiftPreview2,d=e;null!=this.shiftPreview1.firstChild&&(null!=c.parentNode&&c.parentNode.parentNode==this.container?this.container.insertBefore(this.shiftPreview1,c.parentNode):this.container.appendChild(this.shiftPreview1));null!=this.shiftPreview2.firstChild&& this.container.appendChild(this.shiftPreview2)}this.shiftPreview1.style.left=a+"px";this.shiftPreview1.style.top=b+"px";this.shiftPreview2.style.left=a+"px";this.shiftPreview2.style.top=b+"px"}else c.style.left=a+"px",c.style.top=b+"px";this.panDx=a;this.panDy=b;this.fireEvent(new mxEventObject(mxEvent.PAN))}};mxGraph.prototype.zoomIn=function(){this.zoom(this.zoomFactor)};mxGraph.prototype.zoomOut=function(){this.zoom(1/this.zoomFactor)}; mxGraph.prototype.zoomActual=function(){1==this.view.scale?this.view.setTranslate(0,0):(this.view.translate.x=0,this.view.translate.y=0,this.view.setScale(1))};mxGraph.prototype.zoomTo=function(a,b,c){this.zoom(a/this.view.scale,b,null,c)}; mxGraph.prototype.center=function(a,b,c,d){a=null!=a?a:!0;b=null!=b?b:!0;c=null!=c?c:.5;d=null!=d?d:.5;var e=mxUtils.hasScrollbars(this.container),f=2*this.getBorder(),g=this.container.clientWidth-f;f=this.container.clientHeight-f;var k=this.getGraphBounds(),l=this.view.translate,m=this.view.scale,n=a?g-k.width:0,p=b?f-k.height:0;e?(k.x-=l.x,k.y-=l.y,a=this.container.scrollWidth,b=this.container.scrollHeight,a>g&&(n=0),b>f&&(p=0),this.view.setTranslate(Math.floor(n/2-k.x),Math.floor(p/2-k.y)),this.container.scrollLeft= (a-g)/2,this.container.scrollTop=(b-f)/2):this.view.setTranslate(a?Math.floor(l.x-k.x/m+n*c/m):l.x,b?Math.floor(l.y-k.y/m+p*d/m):l.y)}; mxGraph.prototype.zoom=function(a,b,c,d){b=null!=b?b:this.centerZoom;var e=Math.round(this.view.scale*a*100)/100;null!=c&&(e=Math.round(e*c)/c);c=this.view.getState(this.getSelectionCell());a=e/this.view.scale;if(this.keepSelectionVisibleOnZoom&&null!=c)a=new mxRectangle(c.x*a,c.y*a,c.width*a,c.height*a),this.view.scale=e,this.scrollRectToVisible(a)||(this.view.revalidate(),this.view.setScale(e));else{var f=mxUtils.hasScrollbars(this.container);if(b&&!f)d=this.container.offsetWidth,f=this.container.offsetHeight, 1<a?(a=(a-1)/(2*e),d*=-a,f*=-a):(a=(1/a-1)/(2*this.view.scale),d*=a,f*=a),this.view.scaleAndTranslate(e,this.view.translate.x+d,this.view.translate.y+f);else{c=this.view.translate.x;var g=this.view.translate.y,k=this.container.scrollLeft,l=this.container.scrollTop;this.view.setScale(e);f&&!d&&(f=d=0,b&&(d=this.container.offsetWidth*(a-1)/2,f=this.container.offsetHeight*(a-1)/2),this.container.scrollLeft=(this.view.translate.x-c)*this.view.scale+Math.round(k*a+d),this.container.scrollTop=(this.view.translate.y- g)*this.view.scale+Math.round(l*a+f))}}}; mxGraph.prototype.zoomToRect=function(a){var b=this.container.clientWidth/a.width/(this.container.clientHeight/a.height);a.x=Math.max(0,a.x);a.y=Math.max(0,a.y);var c=Math.min(this.container.scrollWidth,a.x+a.width),d=Math.min(this.container.scrollHeight,a.y+a.height);a.width=c-a.x;a.height=d-a.y;1>b?(b=a.height/b,c=(b-a.height)/2,a.height=b,a.y-=Math.min(a.y,c),d=Math.min(this.container.scrollHeight,a.y+a.height),a.height=d-a.y):(b*=a.width,c=(b-a.width)/2,a.width=b,a.x-=Math.min(a.x,c),c=Math.min(this.container.scrollWidth, a.x+a.width),a.width=c-a.x);b=this.container.clientWidth/a.width;c=this.view.scale*b;mxUtils.hasScrollbars(this.container)?(this.view.setScale(c),this.container.scrollLeft=Math.round(a.x*b),this.container.scrollTop=Math.round(a.y*b)):this.view.scaleAndTranslate(c,this.view.translate.x-a.x/this.view.scale,this.view.translate.y-a.y/this.view.scale)}; mxGraph.prototype.scrollCellToVisible=function(a,b){var c=-this.view.translate.x,d=-this.view.translate.y;a=this.view.getState(a);null!=a&&(c=new mxRectangle(c+a.x,d+a.y,a.width,a.height),b&&null!=this.container&&(b=this.container.clientWidth,d=this.container.clientHeight,c.x=c.getCenterX()-b/2,c.width=b,c.y=c.getCenterY()-d/2,c.height=d),b=new mxPoint(this.view.translate.x,this.view.translate.y),this.scrollRectToVisible(c)&&(c=new mxPoint(this.view.translate.x,this.view.translate.y),this.view.translate.x= b.x,this.view.translate.y=b.y,this.view.setTranslate(c.x,c.y)))}; mxGraph.prototype.scrollRectToVisible=function(a){var b=!1;if(null!=a){var c=this.container.offsetWidth,d=this.container.offsetHeight,e=Math.min(c,a.width),f=Math.min(d,a.height);if(mxUtils.hasScrollbars(this.container)){c=this.container;a.x+=this.view.translate.x;a.y+=this.view.translate.y;var g=c.scrollLeft-a.x;d=Math.max(g-c.scrollLeft,0);0<g?c.scrollLeft-=g+2:(g=a.x+e-c.scrollLeft-c.clientWidth,0<g&&(c.scrollLeft+=g+2));e=c.scrollTop-a.y;g=Math.max(0,e-c.scrollTop);0<e?c.scrollTop-=e+2:(e=a.y+ f-c.scrollTop-c.clientHeight,0<e&&(c.scrollTop+=e+2));this.useScrollbarsForPanning||0==d&&0==g||this.view.setTranslate(d,g)}else{g=-this.view.translate.x;var k=-this.view.translate.y,l=this.view.scale;a.x+e>g+c&&(this.view.translate.x-=(a.x+e-c-g)/l,b=!0);a.y+f>k+d&&(this.view.translate.y-=(a.y+f-d-k)/l,b=!0);a.x<g&&(this.view.translate.x+=(g-a.x)/l,b=!0);a.y<k&&(this.view.translate.y+=(k-a.y)/l,b=!0);b&&(this.view.refresh(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.refresh())}}return b}; mxGraph.prototype.getCellGeometry=function(a){return this.model.getGeometry(a)};mxGraph.prototype.isCellVisible=function(a){return this.model.isVisible(a)};mxGraph.prototype.isCellCollapsed=function(a){return this.model.isCollapsed(a)};mxGraph.prototype.isCellConnectable=function(a){return this.model.isConnectable(a)}; mxGraph.prototype.isOrthogonal=function(a){var b=a.style[mxConstants.STYLE_ORTHOGONAL];if(null!=b)return b;a=this.view.getEdgeStyle(a);return a==mxEdgeStyle.SegmentConnector||a==mxEdgeStyle.ElbowConnector||a==mxEdgeStyle.SideToSide||a==mxEdgeStyle.TopToBottom||a==mxEdgeStyle.EntityRelation||a==mxEdgeStyle.OrthConnector};mxGraph.prototype.isLoop=function(a){var b=a.getVisibleTerminalState(!0);a=a.getVisibleTerminalState(!1);return null!=b&&b==a};mxGraph.prototype.isCloneEvent=function(a){return mxEvent.isControlDown(a)}; mxGraph.prototype.isTransparentClickEvent=function(a){return!1};mxGraph.prototype.isToggleEvent=function(a){return mxClient.IS_MAC?mxEvent.isMetaDown(a):mxEvent.isControlDown(a)};mxGraph.prototype.isGridEnabledEvent=function(a){return null!=a&&!mxEvent.isAltDown(a)};mxGraph.prototype.isConstrainedEvent=function(a){return mxEvent.isShiftDown(a)&&!mxEvent.isAltDown(a)};mxGraph.prototype.isIgnoreTerminalEvent=function(a){return!1};mxGraph.prototype.validationAlert=function(a){mxUtils.alert(a)}; mxGraph.prototype.isEdgeValid=function(a,b,c){return null==this.getEdgeValidationError(a,b,c)}; mxGraph.prototype.getEdgeValidationError=function(a,b,c){if(null!=a&&!this.isAllowDanglingEdges()&&(null==b||null==c))return"";if(null!=a&&null==this.model.getTerminal(a,!0)&&null==this.model.getTerminal(a,!1))return null;if(!this.allowLoops&&b==c&&null!=b||!this.isValidConnection(b,c))return"";if(null!=b&&null!=c){var d="";if(!this.multigraph){var e=this.model.getEdgesBetween(b,c,!0);if(1<e.length||1==e.length&&e[0]!=a)d+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+ "\n"}e=this.model.getDirectedEdgeCount(b,!0,a);var f=this.model.getDirectedEdgeCount(c,!1,a);if(null!=this.multiplicities)for(var g=0;g<this.multiplicities.length;g++){var k=this.multiplicities[g].check(this,a,b,c,e,f);null!=k&&(d+=k)}k=this.validateEdge(a,b,c);null!=k&&(d+=k);return 0<d.length?d:null}return this.allowDanglingEdges?null:""};mxGraph.prototype.validateEdge=function(a,b,c){return null}; mxGraph.prototype.validateGraph=function(a,b){a=null!=a?a:this.model.getRoot();b=null!=b?b:{};for(var c=!0,d=this.model.getChildCount(a),e=0;e<d;e++){var f=this.model.getChildAt(a,e),g=b;this.isValidRoot(f)&&(g={});g=this.validateGraph(f,g);null!=g?this.setCellWarning(f,g.replace(/\n/g,"<br>")):this.setCellWarning(f,null);c=c&&null==g}d="";this.isCellCollapsed(a)&&!c&&(d+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n");d=this.model.isEdge(a)?d+ (this.getEdgeValidationError(a,this.model.getTerminal(a,!0),this.model.getTerminal(a,!1))||""):d+(this.getCellValidationError(a)||"");b=this.validateCell(a,b);null!=b&&(d+=b);null==this.model.getParent(a)&&this.view.validate();return 0<d.length||!c?d:null}; mxGraph.prototype.getCellValidationError=function(a){var b=this.model.getDirectedEdgeCount(a,!0),c=this.model.getDirectedEdgeCount(a,!1);a=this.model.getValue(a);var d="";if(null!=this.multiplicities)for(var e=0;e<this.multiplicities.length;e++){var f=this.multiplicities[e];f.source&&mxUtils.isNode(a,f.type,f.attr,f.value)&&(b>f.max||b<f.min)?d+=f.countError+"\n":!f.source&&mxUtils.isNode(a,f.type,f.attr,f.value)&&(c>f.max||c<f.min)&&(d+=f.countError+"\n")}return 0<d.length?d:null}; mxGraph.prototype.validateCell=function(a,b){return null};mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage};mxGraph.prototype.setBackgroundImage=function(a){this.backgroundImage=a};mxGraph.prototype.getFoldingImage=function(a){if(null!=a&&this.foldingEnabled&&!this.getModel().isEdge(a.cell)){var b=this.isCellCollapsed(a.cell);if(this.isCellFoldable(a.cell,!b))return b?this.collapsedImage:this.expandedImage}return null}; mxGraph.prototype.convertValueToString=function(a){a=this.model.getValue(a);if(null!=a){if(mxUtils.isNode(a))return a.nodeName;if("function"==typeof a.toString)return a.toString()}return""};mxGraph.prototype.getLabel=function(a){var b="";if(this.labelsVisible&&null!=a){var c=this.getCurrentCellStyle(a);mxUtils.getValue(c,mxConstants.STYLE_NOLABEL,!1)||(b=this.convertValueToString(a))}return b};mxGraph.prototype.isHtmlLabel=function(a){return this.isHtmlLabels()};mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels}; mxGraph.prototype.setHtmlLabels=function(a){this.htmlLabels=a};mxGraph.prototype.isWrapping=function(a){var b=this.getCurrentCellStyle(a);a=this.view.getState(a);var c=b[mxConstants.STYLE_TEXT_DIRECTION];a="1"==mxUtils.getValue(b,"convertToSvg","0")&&!mxUtils.isVerticalTextDirection(c)&&(null==a||null==a.text||null==a.text.node||0==a.text.node.getElementsByTagName("foreignObject").length);return"wrap"==b[a?"svgWhiteSpace":mxConstants.STYLE_WHITE_SPACE]}; mxGraph.prototype.isLabelClipped=function(a){return"hidden"==this.getCurrentCellStyle(a)[mxConstants.STYLE_OVERFLOW]}; mxGraph.prototype.getTooltip=function(a,b,c,d){var e=null;null!=a&&(null==a.control||b!=a.control.node&&b.parentNode!=a.control.node||(e=this.collapseExpandResource,e=mxUtils.htmlEntities(mxResources.get(e)||e).replace(/\\n/g,"<br>")),null==e&&null!=a.overlays&&a.overlays.visit(function(f,g){null!=e||b!=g.node&&b.parentNode!=g.node||(e=mxUtils.htmlEntities(g.overlay.toString()).replace(/\\n/g,"<br>"))}),null==e&&(c=this.selectionCellsHandler.getHandler(a.cell),null!=c&&"function"==typeof c.getTooltipForNode&& (e=c.getTooltipForNode(b))),null==e&&(e=this.getTooltipForCell(a.cell)));return e};mxGraph.prototype.getTooltipForCell=function(a){return null!=a&&null!=a.getTooltip?a.getTooltip():this.convertValueToString(a)};mxGraph.prototype.getLinkForCell=function(a){return null};mxGraph.prototype.getLinkTargetForCell=function(a){return null};mxGraph.prototype.getCursorForMouseEvent=function(a){return this.getCursorForCell(a.getCell())};mxGraph.prototype.getCursorForCell=function(a){return null}; mxGraph.prototype.getStartSize=function(a,b){var c=new mxRectangle;a=this.getCurrentCellStyle(a,b);b=parseInt(mxUtils.getValue(a,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)?c.height=b:c.width=b;return c}; mxGraph.prototype.getSwimlaneDirection=function(a){var b=mxUtils.getValue(a,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),c=1==mxUtils.getValue(a,mxConstants.STYLE_FLIPH,0),d=1==mxUtils.getValue(a,mxConstants.STYLE_FLIPV,0);a=mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)?0:3;b==mxConstants.DIRECTION_NORTH?a--:b==mxConstants.DIRECTION_WEST?a+=2:b==mxConstants.DIRECTION_SOUTH&&(a+=1);b=mxUtils.mod(a,2);c&&1==b&&(a+=2);d&&0==b&&(a+=2);return[mxConstants.DIRECTION_NORTH,mxConstants.DIRECTION_EAST, mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST][mxUtils.mod(a,4)]};mxGraph.prototype.getActualStartSize=function(a,b){var c=new mxRectangle;this.isSwimlane(a,b)&&(b=this.getCurrentCellStyle(a,b),a=parseInt(mxUtils.getValue(b,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),b=this.getSwimlaneDirection(b),b==mxConstants.DIRECTION_NORTH?c.y=a:b==mxConstants.DIRECTION_WEST?c.x=a:b==mxConstants.DIRECTION_SOUTH?c.height=a:c.width=a);return c}; mxGraph.prototype.getActualFooterSize=function(a,b){var c=new mxRectangle,d=this.getCurrentCellStyle(a,b),e=Math.max(0,parseInt(mxUtils.getValue(d,mxConstants.STYLE_FOOTER_SIZE,0)));0<e&&(this.isSwimlane(a,b)?(a=this.getSwimlaneDirection(d),a==mxConstants.DIRECTION_NORTH?c.height=e:a==mxConstants.DIRECTION_WEST?c.width=e:a==mxConstants.DIRECTION_SOUTH?c.y=e:c.x=e):c.height=e);return c};mxGraph.prototype.getImage=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_IMAGE]:null}; mxGraph.prototype.isTransparentState=function(a){var b=!1;if(null!=a){b=mxUtils.getValue(a.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE);var c=mxUtils.getValue(a.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);b=b==mxConstants.NONE&&c==mxConstants.NONE&&null==this.getImage(a)}return b};mxGraph.prototype.getVerticalAlign=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null}; mxGraph.prototype.getIndicatorColor=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_INDICATOR_COLOR]:null};mxGraph.prototype.getIndicatorGradientColor=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null};mxGraph.prototype.getIndicatorShape=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_INDICATOR_SHAPE]:null}; mxGraph.prototype.getIndicatorImage=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_INDICATOR_IMAGE]:null};mxGraph.prototype.getBorder=function(){return this.border};mxGraph.prototype.setBorder=function(a){this.border=a};mxGraph.prototype.isSwimlane=function(a,b){return null==a||this.model.getParent(a)==this.model.getRoot()||this.model.isEdge(a)?!1:this.getCurrentCellStyle(a,b)[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE};mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer}; mxGraph.prototype.setResizeContainer=function(a){this.resizeContainer=a};mxGraph.prototype.isEnabled=function(){return this.enabled};mxGraph.prototype.setEnabled=function(a){this.enabled=a;this.fireEvent(new mxEventObject("enabledChanged","enabled",a))};mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled};mxGraph.prototype.setEscapeEnabled=function(a){this.escapeEnabled=a};mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing}; mxGraph.prototype.setInvokesStopCellEditing=function(a){this.invokesStopCellEditing=a};mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing};mxGraph.prototype.setEnterStopsCellEditing=function(a){this.enterStopsCellEditing=a};mxGraph.prototype.isCellLocked=function(a){var b=this.model.getGeometry(a);return this.isCellsLocked()||null!=b&&this.model.isVertex(a)&&b.relative};mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked}; mxGraph.prototype.setCellsLocked=function(a){this.cellsLocked=a};mxGraph.prototype.getCloneableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellCloneable(b)}))};mxGraph.prototype.isCellCloneable=function(a){a=this.getCurrentCellStyle(a);return this.isCellsCloneable()&&0!=a[mxConstants.STYLE_CLONEABLE]};mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable};mxGraph.prototype.setCellsCloneable=function(a){this.cellsCloneable=a}; mxGraph.prototype.getExportableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.canExportCell(b)}))};mxGraph.prototype.canExportCell=function(a){return this.exportEnabled};mxGraph.prototype.getImportableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.canImportCell(b)}))};mxGraph.prototype.canImportCell=function(a){return this.importEnabled};mxGraph.prototype.isCellSelectable=function(a){return this.isCellsSelectable()}; mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable};mxGraph.prototype.setCellsSelectable=function(a){this.cellsSelectable=a};mxGraph.prototype.getDeletableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellDeletable(b)}))};mxGraph.prototype.isCellDeletable=function(a){a=this.getCurrentCellStyle(a);return this.isCellsDeletable()&&0!=a[mxConstants.STYLE_DELETABLE]};mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable}; mxGraph.prototype.setCellsDeletable=function(a){this.cellsDeletable=a};mxGraph.prototype.isLabelMovable=function(a){return!this.isCellLocked(a)&&(this.model.isEdge(a)&&this.edgeLabelsMovable||this.model.isVertex(a)&&this.vertexLabelsMovable)};mxGraph.prototype.getRotatableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellRotatable(b)}))};mxGraph.prototype.isCellRotatable=function(a){return 0!=this.getCurrentCellStyle(a)[mxConstants.STYLE_ROTATABLE]}; mxGraph.prototype.getMovableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellMovable(b)}))};mxGraph.prototype.isCellMovable=function(a){var b=this.getCurrentCellStyle(a);return this.isCellsMovable()&&!this.isCellLocked(a)&&0!=b[mxConstants.STYLE_MOVABLE]};mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable};mxGraph.prototype.setCellsMovable=function(a){this.cellsMovable=a};mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled}; mxGraph.prototype.setGridEnabled=function(a){this.gridEnabled=a};mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled};mxGraph.prototype.setPortsEnabled=function(a){this.portsEnabled=a};mxGraph.prototype.getGridSize=function(){return this.gridSize};mxGraph.prototype.setGridSize=function(a){this.gridSize=a};mxGraph.prototype.getTolerance=function(){return this.tolerance};mxGraph.prototype.setTolerance=function(a){this.tolerance=a};mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable}; mxGraph.prototype.setVertexLabelsMovable=function(a){this.vertexLabelsMovable=a};mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable};mxGraph.prototype.setEdgeLabelsMovable=function(a){this.edgeLabelsMovable=a};mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting};mxGraph.prototype.setSwimlaneNesting=function(a){this.swimlaneNesting=a};mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled}; mxGraph.prototype.setSwimlaneSelectionEnabled=function(a){this.swimlaneSelectionEnabled=a};mxGraph.prototype.isMultigraph=function(){return this.multigraph};mxGraph.prototype.setMultigraph=function(a){this.multigraph=a};mxGraph.prototype.isAllowLoops=function(){return this.allowLoops};mxGraph.prototype.setAllowDanglingEdges=function(a){this.allowDanglingEdges=a};mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges}; mxGraph.prototype.setConnectableEdges=function(a){this.connectableEdges=a};mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges};mxGraph.prototype.setCloneInvalidEdges=function(a){this.cloneInvalidEdges=a};mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges};mxGraph.prototype.setAllowLoops=function(a){this.allowLoops=a};mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove}; mxGraph.prototype.setDisconnectOnMove=function(a){this.disconnectOnMove=a};mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled};mxGraph.prototype.setDropEnabled=function(a){this.dropEnabled=a};mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled};mxGraph.prototype.setSplitEnabled=function(a){this.splitEnabled=a};mxGraph.prototype.getResizableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellResizable(b)}))}; mxGraph.prototype.isCellResizable=function(a){var b=this.getCurrentCellStyle(a);return this.isCellsResizable()&&!this.isCellLocked(a)&&"0"!=mxUtils.getValue(b,mxConstants.STYLE_RESIZABLE,"1")};mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable};mxGraph.prototype.setCellsResizable=function(a){this.cellsResizable=a};mxGraph.prototype.isTerminalPointMovable=function(a,b){return!0}; mxGraph.prototype.isCellBendable=function(a){var b=this.getCurrentCellStyle(a);return this.isCellsBendable()&&!this.isCellLocked(a)&&0!=b[mxConstants.STYLE_BENDABLE]};mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable};mxGraph.prototype.setCellsBendable=function(a){this.cellsBendable=a};mxGraph.prototype.getEditableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(b){return this.isCellEditable(b)}))}; mxGraph.prototype.isCellEditable=function(a){var b=this.getCurrentCellStyle(a);return this.isCellsEditable()&&!this.isCellLocked(a)&&0!=b[mxConstants.STYLE_EDITABLE]};mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable};mxGraph.prototype.setCellsEditable=function(a){this.cellsEditable=a};mxGraph.prototype.isCellDisconnectable=function(a,b,c){return this.isCellsDisconnectable()&&!this.isCellLocked(a)};mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable}; mxGraph.prototype.setCellsDisconnectable=function(a){this.cellsDisconnectable=a};mxGraph.prototype.isValidSource=function(a){return null==a&&this.allowDanglingEdges||null!=a&&(!this.model.isEdge(a)||this.connectableEdges)&&this.isCellConnectable(a)};mxGraph.prototype.isValidTarget=function(a){return this.isValidSource(a)};mxGraph.prototype.isValidConnection=function(a,b){return this.isValidSource(a)&&this.isValidTarget(b)};mxGraph.prototype.setConnectable=function(a){this.connectionHandler.setEnabled(a)}; mxGraph.prototype.isConnectable=function(){return this.connectionHandler.isEnabled()};mxGraph.prototype.setTooltips=function(a){this.tooltipHandler.setEnabled(a)};mxGraph.prototype.setPanning=function(a){this.panningHandler.panningEnabled=a};mxGraph.prototype.isEditing=function(a){if(null!=this.cellEditor){var b=this.cellEditor.getEditingCell();return null==a?null!=b:a==b}return!1};mxGraph.prototype.isAutoSizeCell=function(a){a=this.getCurrentCellStyle(a);return this.isAutoSizeCells()||1==a[mxConstants.STYLE_AUTOSIZE]}; mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells};mxGraph.prototype.setAutoSizeCells=function(a){this.autoSizeCells=a};mxGraph.prototype.isExtendParent=function(a){return!this.getModel().isEdge(a)&&this.isExtendParents()};mxGraph.prototype.isExtendParents=function(){return this.extendParents};mxGraph.prototype.setExtendParents=function(a){this.extendParents=a};mxGraph.prototype.isExtendParentsOnAdd=function(a){return this.extendParentsOnAdd}; mxGraph.prototype.setExtendParentsOnAdd=function(a){this.extendParentsOnAdd=a};mxGraph.prototype.isExtendParentsOnMove=function(){return this.extendParentsOnMove};mxGraph.prototype.setExtendParentsOnMove=function(a){this.extendParentsOnMove=a};mxGraph.prototype.isContractParent=function(a){return!this.getModel().isEdge(a)&&this.isContractParents()};mxGraph.prototype.isContractParents=function(){return this.contractParents};mxGraph.prototype.setContractParents=function(a){this.contractParents=a}; mxGraph.prototype.isContractParentsOnRemove=function(){return this.contractParentsOnRemove};mxGraph.prototype.setContractParentsOnRemove=function(a){this.contractParentsOnRemove=a};mxGraph.prototype.isContractParentsOnMove=function(){return this.contractParentsOnMove};mxGraph.prototype.setContractParentsOnMove=function(a){this.contractParentsOnMove=a};mxGraph.prototype.isRecursiveResize=function(a){return this.recursiveResize}; mxGraph.prototype.setRecursiveResize=function(a){this.recursiveResize=a};mxGraph.prototype.isConstrainChild=function(a){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(a))};mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren};mxGraph.prototype.setConstrainChildren=function(a){this.constrainChildren=a};mxGraph.prototype.isConstrainRelativeChildren=function(){return this.constrainRelativeChildren}; mxGraph.prototype.setConstrainRelativeChildren=function(a){this.constrainRelativeChildren=a};mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates};mxGraph.prototype.setAllowNegativeCoordinates=function(a){this.allowNegativeCoordinates=a};mxGraph.prototype.getOverlap=function(a){return this.isAllowOverlapParent(a)?this.defaultOverlap:0};mxGraph.prototype.isAllowOverlapParent=function(a){return!1}; mxGraph.prototype.getFoldableCells=function(a,b){return this.model.filterCells(a,mxUtils.bind(this,function(c){return this.isCellFoldable(c,b)}))};mxGraph.prototype.isCellFoldable=function(a,b){b=this.getCurrentCellStyle(a);return 0<this.model.getChildCount(a)&&0!=b[mxConstants.STYLE_FOLDABLE]}; mxGraph.prototype.isValidDropTarget=function(a,b,c){return null!=a&&!this.isCellLocked(a)&&(this.isSplitEnabled()&&this.isSplitTarget(a,b,c)||!this.model.isEdge(a)&&(this.isSwimlane(a)||0<this.model.getChildCount(a)&&!this.isCellCollapsed(a)))}; mxGraph.prototype.isSplitTarget=function(a,b,c){return this.model.isEdge(a)&&null!=b&&1==b.length&&this.isCellConnectable(b[0])&&null==this.getEdgeValidationError(a,this.model.getTerminal(a,!0),b[0])?(c=this.model.getTerminal(a,!0),a=this.model.getTerminal(a,!1),!this.model.isAncestor(b[0],c)&&!this.model.isAncestor(b[0],a)):!1}; mxGraph.prototype.getDropTarget=function(a,b,c,d){if(!this.isSwimlaneNesting())for(var e=0;e<a.length;e++)if(this.isSwimlane(a[e]))return null;e=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b));e.x-=this.panDx;e.y-=this.panDy;e=this.getSwimlaneAt(e.x,e.y);if(null==c)c=e;else if(null!=e){for(var f=this.model.getParent(e);null!=f&&this.isSwimlane(f)&&f!=c;)f=this.model.getParent(f);f==c&&(c=e)}for(;null!=c&&!this.isValidDropTarget(c,a,b)&&!this.model.isLayer(c);)c=this.model.getParent(c); if(null==d||!d)for(var g=c;null!=g&&0>mxUtils.indexOf(a,g);)g=this.model.getParent(g);return this.model.isLayer(c)||null!=g?null:c};mxGraph.prototype.getDefaultParent=function(){var a=this.getCurrentRoot();null==a&&(a=this.defaultParent,null==a&&(a=this.model.getRoot(),a=this.model.getChildAt(a,0)));return a};mxGraph.prototype.setDefaultParent=function(a){this.defaultParent=a};mxGraph.prototype.getSwimlane=function(a){for(;null!=a&&!this.isSwimlane(a);)a=this.model.getParent(a);return a}; mxGraph.prototype.getSwimlaneAt=function(a,b,c){null==c&&(c=this.getCurrentRoot(),null==c&&(c=this.model.getRoot()));if(null!=c)for(var d=this.model.getChildCount(c),e=0;e<d;e++){var f=this.model.getChildAt(c,e);if(null!=f){var g=this.getSwimlaneAt(a,b,f);if(null!=g)return g;if(this.isCellVisible(f)&&this.isSwimlane(f)&&(g=this.view.getState(f),this.intersects(g,a,b)))return f}}return null}; mxGraph.prototype.getCellAt=function(a,b,c,d,e,f){d=null!=d?d:!0;e=null!=e?e:!0;null==c&&(c=this.getCurrentRoot(),null==c&&(c=this.getModel().getRoot()));if(null!=c)for(var g=this.model.getChildCount(c)-1;0<=g;g--){var k=this.model.getChildAt(c,g),l=this.getCellAt(a,b,k,d,e,f);if(null!=l)return l;if(this.isCellVisible(k)&&(e&&this.model.isEdge(k)||d&&this.model.isVertex(k))&&(l=this.view.getState(k),null!=l&&(null==f||!f(l,a,b))&&this.intersects(l,a,b)))return k}return null}; mxGraph.prototype.intersects=function(a,b,c){if(null!=a){var d=a.absolutePoints;if(null!=d){a=this.tolerance*this.tolerance;for(var e=d[0],f=1;f<d.length;f++){var g=d[f];if(null!=g){if(null!=e&&mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,b,c)<=a)return!0;e=g}}}else if(e=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0),0!=e&&(d=Math.cos(-e),e=Math.sin(-e),f=new mxPoint(a.getCenterX(),a.getCenterY()),e=mxUtils.getRotatedPoint(new mxPoint(b,c),d,e,f),b=e.x,c=e.y),mxUtils.contains(a, b,c))return!0}return!1};mxGraph.prototype.hitsSwimlaneContent=function(a,b,c){var d=this.getView().getState(a);a=this.getStartSize(a);if(null!=d){var e=this.getView().getScale();b-=d.x;c-=d.y;if(0<a.width&&0<b&&b>a.width*e||0<a.height&&0<c&&c>a.height*e)return!0}return!1};mxGraph.prototype.getChildVertices=function(a){return this.getChildCells(a,!0,!1)};mxGraph.prototype.getChildEdges=function(a){return this.getChildCells(a,!1,!0)}; mxGraph.prototype.getChildCells=function(a,b,c){a=null!=a?a:this.getDefaultParent();a=this.model.getChildCells(a,null!=b?b:!1,null!=c?c:!1);b=[];for(c=0;c<a.length;c++)this.isCellVisible(a[c])&&b.push(a[c]);return b};mxGraph.prototype.getConnections=function(a,b){return this.getEdges(a,b,!0,!0,!1)};mxGraph.prototype.getIncomingEdges=function(a,b){return this.getEdges(a,b,!0,!1,!1)};mxGraph.prototype.getOutgoingEdges=function(a,b){return this.getEdges(a,b,!1,!0,!1)}; mxGraph.prototype.getEdges=function(a,b,c,d,e,f){c=null!=c?c:!0;d=null!=d?d:!0;e=null!=e?e:!0;f=null!=f?f:!1;for(var g=[],k=this.isCellCollapsed(a),l=this.model.getChildCount(a),m=0;m<l;m++){var n=this.model.getChildAt(a,m);if(k||!this.isCellVisible(n))g=g.concat(this.model.getEdges(n,c,d))}g=g.concat(this.model.getEdges(a,c,d));k=[];for(m=0;m<g.length;m++)n=this.view.getState(g[m]),l=null!=n?n.getVisibleTerminal(!0):this.view.getVisibleTerminal(g[m],!0),n=null!=n?n.getVisibleTerminal(!1):this.view.getVisibleTerminal(g[m], !1),(e&&l==n||l!=n&&(c&&n==a&&(null==b||this.isValidAncestor(l,b,f))||d&&l==a&&(null==b||this.isValidAncestor(n,b,f))))&&k.push(g[m]);return k};mxGraph.prototype.isValidAncestor=function(a,b,c){return c?this.model.isAncestor(b,a):this.model.getParent(a)==b}; mxGraph.prototype.getOpposites=function(a,b,c,d){c=null!=c?c:!0;d=null!=d?d:!0;var e=[],f=new mxDictionary;if(null!=a)for(var g=0;g<a.length;g++){var k=this.view.getState(a[g]),l=null!=k?k.getVisibleTerminal(!0):this.view.getVisibleTerminal(a[g],!0);k=null!=k?k.getVisibleTerminal(!1):this.view.getVisibleTerminal(a[g],!1);l==b&&null!=k&&k!=b&&d?f.get(k)||(f.put(k,!0),e.push(k)):k==b&&null!=l&&l!=b&&c&&!f.get(l)&&(f.put(l,!0),e.push(l))}return e}; mxGraph.prototype.getEdgesBetween=function(a,b,c){c=null!=c?c:!1;for(var d=this.getEdges(a),e=[],f=0;f<d.length;f++){var g=this.view.getState(d[f]),k=null!=g?g.getVisibleTerminal(!0):this.view.getVisibleTerminal(d[f],!0);g=null!=g?g.getVisibleTerminal(!1):this.view.getVisibleTerminal(d[f],!1);(k==a&&g==b||!c&&k==b&&g==a)&&e.push(d[f])}return e}; mxGraph.prototype.getPointForEvent=function(a,b){a=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),mxEvent.getClientY(a));var c=this.view.scale,d=this.view.translate;b=0!=b?this.gridSize/2:0;a.x=this.snap(a.x/c-d.x-b);a.y=this.snap(a.y/c-d.y-b);return a}; mxGraph.prototype.getCells=function(a,b,c,d,e,f,g,k,l){f=null!=f?f:[];if(0<c||0<d||null!=g){var m=this.getModel(),n=a+c,p=b+d;null==e&&(e=this.getCurrentRoot(),null==e&&(e=m.getRoot()));if(null!=e)for(var q=m.getChildCount(e),r=0;r<q;r++){var t=m.getChildAt(e,r),u=this.view.getState(t);if(null!=u&&this.isCellVisible(t)&&(null==k||!k(u))){var v=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION)||0;0!=v&&(u=mxUtils.getBoundingBox(u,v));(v=null!=g&&m.isVertex(t)&&mxUtils.intersects(g,u)||null!=g&& m.isEdge(t)&&mxUtils.intersects(g,u)||null==g&&(m.isEdge(t)||m.isVertex(t))&&u.x>=a&&u.y+u.height<=p&&u.y>=b&&u.x+u.width<=n)&&f.push(t);v&&!l||this.getCells(a,b,c,d,t,f,g,k,l)}}}return f};mxGraph.prototype.getCellsBeyond=function(a,b,c,d,e){var f=[];if(d||e)if(null==c&&(c=this.getDefaultParent()),null!=c)for(var g=this.model.getChildCount(c),k=0;k<g;k++){var l=this.model.getChildAt(c,k),m=this.view.getState(l);this.isCellVisible(l)&&null!=m&&(!d||m.x>=a)&&(!e||m.y>=b)&&f.push(l)}return f}; mxGraph.prototype.findTreeRoots=function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!1;var d=[];if(null!=a){for(var e=this.getModel(),f=e.getChildCount(a),g=null,k=0,l=0;l<f;l++){var m=e.getChildAt(a,l);if(this.model.isVertex(m)&&this.isCellVisible(m)){for(var n=this.getConnections(m,b?a:null),p=0,q=0,r=0;r<n.length;r++)this.view.getVisibleTerminal(n[r],!0)==m?p++:q++;(c&&0==p&&0<q||!c&&0==q&&0<p)&&d.push(m);n=c?q-p:p-q;n>k&&(k=n,g=m)}}0==d.length&&null!=g&&d.push(g)}return d}; mxGraph.prototype.traverse=function(a,b,c,d,e,f){if(null!=c&&null!=a&&(b=null!=b?b:!0,f=null!=f?f:!1,e=e||new mxDictionary,null==d||!e.get(d))&&(e.put(d,!0),d=c(a,d),null==d||d)&&(d=this.model.getEdgeCount(a),0<d))for(var g=0;g<d;g++){var k=this.model.getEdgeAt(a,g),l=this.model.getTerminal(k,!0)==a;b&&!f!=l||(l=this.model.getTerminal(k,!l),this.traverse(l,b,c,k,e,f))}};mxGraph.prototype.isCellSelected=function(a){return this.getSelectionModel().isSelected(a)}; mxGraph.prototype.isAncestorSelected=function(a){for(a=this.model.getParent(a);null!=a&&a!=this.getCurrentRoot();){if(this.isCellSelected(a))return!0;a=this.model.getParent(a)}return!1};mxGraph.prototype.isSelectionEmpty=function(){return this.getSelectionModel().isEmpty()};mxGraph.prototype.clearSelection=function(){return this.getSelectionModel().clear()};mxGraph.prototype.getSelectionCount=function(){return this.getSelectionModel().cells.length};mxGraph.prototype.getSelectionCell=function(){return this.getSelectionModel().cells[0]}; mxGraph.prototype.getSelectionCells=function(){return this.getSelectionModel().cells.slice()};mxGraph.prototype.setSelectionCell=function(a){this.getSelectionModel().setCell(a)};mxGraph.prototype.setSelectionCells=function(a){this.getSelectionModel().setCells(a)};mxGraph.prototype.addSelectionCell=function(a){this.getSelectionModel().addCell(a)};mxGraph.prototype.addSelectionCells=function(a){this.getSelectionModel().addCells(a)};mxGraph.prototype.removeSelectionCell=function(a){this.getSelectionModel().removeCell(a)}; mxGraph.prototype.removeSelectionCells=function(a){this.getSelectionModel().removeCells(a)};mxGraph.prototype.selectRegion=function(a,b){a=this.getCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(a,b);return a};mxGraph.prototype.selectNextCell=function(){this.selectCell(!0)};mxGraph.prototype.selectPreviousCell=function(){this.selectCell()};mxGraph.prototype.selectParentCell=function(){this.selectCell(!1,!0)};mxGraph.prototype.selectChildCell=function(){this.selectCell(!1,!1,!0)}; mxGraph.prototype.selectCell=function(a,b,c){var d=this.selectionModel,e=0<d.cells.length?d.cells[0]:null;1<d.cells.length&&d.clear();d=null!=e?this.model.getParent(e):this.getDefaultParent();var f=this.model.getChildCount(d);null==e&&0<f?(a=this.model.getChildAt(d,0),this.setSelectionCell(a)):null!=e&&!b||null==this.view.getState(d)||null==this.model.getGeometry(d)?null!=e&&c?0<this.model.getChildCount(e)&&(a=this.model.getChildAt(e,0),this.setSelectionCell(a)):0<f&&(b=d.getIndex(e),a?(b++,a=this.model.getChildAt(d, b%f)):(b--,a=this.model.getChildAt(d,0>b?f-1:b)),this.setSelectionCell(a)):this.getCurrentRoot()!=d&&this.setSelectionCell(d)};mxGraph.prototype.selectAll=function(a,b){a=a||this.getDefaultParent();b=b?this.model.filterDescendants(mxUtils.bind(this,function(c){return c!=a&&null!=this.view.getState(c)}),a):this.model.getChildren(a);null!=b&&this.setSelectionCells(b)};mxGraph.prototype.selectVertices=function(a,b){this.selectCells(!0,!1,a,b)}; mxGraph.prototype.selectEdges=function(a){this.selectCells(!1,!0,a)};mxGraph.prototype.selectCells=function(a,b,c,d){c=c||this.getDefaultParent();var e=mxUtils.bind(this,function(f){return null!=this.view.getState(f)&&((d||0==this.model.getChildCount(f))&&this.model.isVertex(f)&&a&&!this.model.isEdge(this.model.getParent(f))||this.model.isEdge(f)&&b)});c=this.model.filterDescendants(e,c);null!=c&&this.setSelectionCells(c)}; mxGraph.prototype.selectCellForEvent=function(a,b){var c=this.isCellSelected(a);this.isToggleEvent(b)?c?this.removeSelectionCell(a):this.addSelectionCell(a):c&&1==this.getSelectionCount()||this.setSelectionCell(a)};mxGraph.prototype.selectCellsForEvent=function(a,b){this.isToggleEvent(b)?this.addSelectionCells(a):this.setSelectionCells(a)}; mxGraph.prototype.createHandler=function(a){var b=null;if(null!=a)if(this.model.isEdge(a.cell)){b=a.getVisibleTerminalState(!0);var c=a.getVisibleTerminalState(!1),d=this.getCellGeometry(a.cell);b=this.view.getEdgeStyle(a,null!=d?d.points:null,b,c);b=this.createEdgeHandler(a,b)}else b=this.createVertexHandler(a);return b};mxGraph.prototype.createVertexHandler=function(a){return new mxVertexHandler(a)}; mxGraph.prototype.createEdgeHandler=function(a,b){return b==mxEdgeStyle.Loop||b==mxEdgeStyle.ElbowConnector||b==mxEdgeStyle.SideToSide||b==mxEdgeStyle.TopToBottom?this.createElbowEdgeHandler(a):b==mxEdgeStyle.SegmentConnector||b==mxEdgeStyle.OrthConnector?this.createEdgeSegmentHandler(a):new mxEdgeHandler(a)};mxGraph.prototype.createEdgeSegmentHandler=function(a){return new mxEdgeSegmentHandler(a)};mxGraph.prototype.createElbowEdgeHandler=function(a){return new mxElbowEdgeHandler(a)}; mxGraph.prototype.addMouseListener=function(a){null==this.mouseListeners&&(this.mouseListeners=[]);this.mouseListeners.push(a)};mxGraph.prototype.removeMouseListener=function(a){if(null!=this.mouseListeners)for(var b=0;b<this.mouseListeners.length;b++)if(this.mouseListeners[b]==a){this.mouseListeners.splice(b,1);break}}; mxGraph.prototype.updateMouseEvent=function(a,b){if(null==a.graphX||null==a.graphY){var c=mxUtils.convertPoint(this.container,a.getX(),a.getY());a.graphX=c.x-this.panDx;a.graphY=c.y-this.panDy;null==a.getCell()&&this.isMouseDown&&b==mxEvent.MOUSE_MOVE&&(a.state=this.view.getState(this.getCellAt(c.x,c.y,null,null,null,function(d){return null==d.shape||d.shape.paintBackground!=mxRectangleShape.prototype.paintBackground||"1"==mxUtils.getValue(d.style,mxConstants.STYLE_POINTER_EVENTS,"1")||null!=d.shape.fill&& d.shape.fill!=mxConstants.NONE})))}return a};mxGraph.prototype.getStateForTouchEvent=function(a){var b=mxEvent.getClientX(a);a=mxEvent.getClientY(a);b=mxUtils.convertPoint(this.container,b,a);return this.view.getState(this.getCellAt(b.x,b.y))}; mxGraph.prototype.isEventIgnored=function(a,b,c){var d=mxEvent.isMouseEvent(b.getEvent()),e=!1;b.getEvent()==this.lastEvent?e=!0:this.lastEvent=b.getEvent();if(null!=this.eventSource&&a!=mxEvent.MOUSE_MOVE)mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveRedirect,this.mouseUpRedirect),this.eventSource=this.mouseUpRedirect=this.mouseMoveRedirect=null;else if(!mxClient.IS_GC&&null!=this.eventSource&&b.getSource()!=this.eventSource)e=!0;else if(mxClient.IS_TOUCH&&a==mxEvent.MOUSE_DOWN&& !d&&!mxEvent.isPenEvent(b.getEvent())){this.eventSource=b.getSource();var f=null;!mxClient.IS_ANDROID&&mxClient.IS_LINUX&&mxClient.IS_GC||(f=b.getEvent().pointerId);this.mouseMoveRedirect=mxUtils.bind(this,function(g){null!=f&&g.pointerId!=f||this.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(g,this.getStateForTouchEvent(g)))});this.mouseUpRedirect=mxUtils.bind(this,function(g){this.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(g,this.getStateForTouchEvent(g)));f=null});mxEvent.addGestureListeners(this.eventSource, null,this.mouseMoveRedirect,this.mouseUpRedirect)}this.isSyntheticEventIgnored(a,b,c)&&(e=!0);if(!mxEvent.isPopupTrigger(this.lastEvent)&&a!=mxEvent.MOUSE_MOVE&&2==this.lastEvent.detail)return!0;a==mxEvent.MOUSE_UP&&this.isMouseDown?this.isMouseDown=!1:a!=mxEvent.MOUSE_DOWN||this.isMouseDown?!e&&((!mxClient.IS_FF||a!=mxEvent.MOUSE_MOVE)&&this.isMouseDown&&this.isMouseTrigger!=d||a==mxEvent.MOUSE_DOWN&&this.isMouseDown||a==mxEvent.MOUSE_UP&&!this.isMouseDown)&&(e=!0):(this.isMouseDown=!0,this.isMouseTrigger= d);e||a!=mxEvent.MOUSE_DOWN||(this.lastMouseX=b.getX(),this.lastMouseY=b.getY());return e};mxGraph.prototype.isSyntheticEventIgnored=function(a,b,c){c=!1;b=mxEvent.isMouseEvent(b.getEvent());this.ignoreMouseEvents&&b&&a!=mxEvent.MOUSE_MOVE?(this.ignoreMouseEvents=a!=mxEvent.MOUSE_UP,c=!0):mxClient.IS_FF&&!b&&a==mxEvent.MOUSE_UP&&(this.ignoreMouseEvents=!0);return c}; mxGraph.prototype.isEventSourceIgnored=function(a,b){var c=b.getSource(),d=null!=c.nodeName?c.nodeName.toLowerCase():"";b=!mxEvent.isMouseEvent(b.getEvent())||mxEvent.isLeftMouseButton(b.getEvent());return a==mxEvent.MOUSE_DOWN&&b&&("select"==d||"option"==d||"input"==d&&"checkbox"!=c.type&&"radio"!=c.type&&"button"!=c.type&&"submit"!=c.type&&"file"!=c.type)};mxGraph.prototype.getEventState=function(a){return a}; mxGraph.prototype.isPointerEventIgnored=function(a,b){var c=!1;if(mxClient.IS_ANDROID||!mxClient.IS_LINUX||!mxClient.IS_GC){var d=b.getEvent().pointerId;a==mxEvent.MOUSE_DOWN?null!=this.currentPointerId&&this.currentPointerId!=d?c=!0:null==this.currentPointerId&&(this.currentPointerId=b.getEvent().pointerId):a==mxEvent.MOUSE_MOVE?null!=this.currentPointerId&&this.currentPointerId!=d&&(c=!0):a==mxEvent.MOUSE_UP&&(this.currentPointerId=null)}return c}; mxGraph.prototype.fireMouseEvent=function(a,b,c){if(this.isEventSourceIgnored(a,b))null!=this.tooltipHandler&&this.tooltipHandler.hide();else if(this.isPointerEventIgnored(a,b))this.tapAndHoldValid=!1;else{null==c&&(c=this);b=this.updateMouseEvent(b,a);if(!this.nativeDblClickEnabled&&!mxEvent.isPopupTrigger(b.getEvent())||this.doubleTapEnabled&&mxClient.IS_TOUCH&&(mxEvent.isTouchEvent(b.getEvent())||mxEvent.isPenEvent(b.getEvent()))){var d=(new Date).getTime();if(a==mxEvent.MOUSE_DOWN)if(null!=this.lastTouchEvent&& this.lastTouchEvent!=b.getEvent()&&d-this.lastTouchTime<this.doubleTapTimeout&&Math.abs(this.lastTouchX-b.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-b.getY())<this.doubleTapTolerance&&2>this.doubleClickCounter){if(this.doubleClickCounter++,d=!1,a==mxEvent.MOUSE_UP?b.getCell()==this.lastTouchCell&&null!=this.lastTouchCell&&(this.lastTouchTime=0,d=this.lastTouchCell,this.lastTouchCell=null,this.dblClick(b.getEvent(),d),d=!0):(this.fireDoubleClick=!0,this.lastTouchTime=0),d){mxEvent.consume(b.getEvent()); return}}else{if(null==this.lastTouchEvent||this.lastTouchEvent!=b.getEvent())this.lastTouchCell=b.getCell(),this.lastTouchX=b.getX(),this.lastTouchY=b.getY(),this.lastTouchTime=d,this.lastTouchEvent=b.getEvent(),this.doubleClickCounter=0}else if((this.isMouseDown||a==mxEvent.MOUSE_UP)&&this.fireDoubleClick){this.fireDoubleClick=!1;d=this.lastTouchCell;this.lastTouchCell=null;this.isMouseDown=!1;(null!=d||(mxEvent.isTouchEvent(b.getEvent())||mxEvent.isPenEvent(b.getEvent()))&&(mxClient.IS_GC||mxClient.IS_SF))&& Math.abs(this.lastTouchX-b.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-b.getY())<this.doubleTapTolerance?this.dblClick(b.getEvent(),d):mxEvent.consume(b.getEvent());return}}if(!this.isEventIgnored(a,b,c)){b.state=this.getEventState(b.getState());this.fireEvent(new mxEventObject(mxEvent.FIRE_MOUSE_EVENT,"eventName",a,"event",b));if(mxClient.IS_OP||mxClient.IS_SF||mxClient.IS_GC||b.getEvent().target!=this.container){if(a==mxEvent.MOUSE_MOVE&&this.isMouseDown&&this.autoScroll&&!mxEvent.isMultiTouchEvent(b.getEvent))this.scrollPointToVisible(b.getGraphX(), b.getGraphY(),this.autoExtend);else if(a==mxEvent.MOUSE_UP&&this.ignoreScrollbars&&this.translateToScrollPosition&&(0!=this.container.scrollLeft||0!=this.container.scrollTop)){d=this.view.scale;var e=this.view.translate;this.view.setTranslate(e.x-this.container.scrollLeft/d,e.y-this.container.scrollTop/d);this.container.scrollLeft=0;this.container.scrollTop=0}if(null!=this.mouseListeners)for(d=[c,b],b.getEvent().preventDefault||(b.getEvent().returnValue=!0),e=0;e<this.mouseListeners.length;e++){var f= this.mouseListeners[e];a==mxEvent.MOUSE_DOWN?f.mouseDown.apply(f,d):a==mxEvent.MOUSE_MOVE?f.mouseMove.apply(f,d):a==mxEvent.MOUSE_UP&&f.mouseUp.apply(f,d)}a==mxEvent.MOUSE_UP&&this.click(b)}(mxEvent.isTouchEvent(b.getEvent())||mxEvent.isPenEvent(b.getEvent()))&&a==mxEvent.MOUSE_DOWN&&this.tapAndHoldEnabled&&!this.tapAndHoldInProgress?(this.tapAndHoldInProgress=!0,this.initialTouchX=b.getGraphX(),this.initialTouchY=b.getGraphY(),this.tapAndHoldThread&&window.clearTimeout(this.tapAndHoldThread),this.tapAndHoldThread= window.setTimeout(mxUtils.bind(this,function(){this.tapAndHoldValid&&this.tapAndHold(b);this.tapAndHoldValid=this.tapAndHoldInProgress=!1}),this.tapAndHoldDelay),this.tapAndHoldValid=!0):a==mxEvent.MOUSE_UP?this.tapAndHoldValid=this.tapAndHoldInProgress=!1:this.tapAndHoldValid&&(this.tapAndHoldValid=Math.abs(this.initialTouchX-b.getGraphX())<this.tolerance&&Math.abs(this.initialTouchY-b.getGraphY())<this.tolerance);a==mxEvent.MOUSE_DOWN&&this.isEditing()&&!this.cellEditor.isEventSource(b.getEvent())&& this.stopEditing(!this.isInvokesStopCellEditing());this.consumeMouseEvent(a,b,c)}}};mxGraph.prototype.consumeMouseEvent=function(a,b,c){this.fireEvent(new mxEventObject(mxEvent.CONSUME_MOUSE_EVENT,"eventName",a,"event",b));a==mxEvent.MOUSE_DOWN&&mxEvent.isTouchEvent(b.getEvent())&&b.consume(!1)};mxGraph.prototype.fireGestureEvent=function(a,b){this.lastTouchTime=0;this.fireEvent(new mxEventObject(mxEvent.GESTURE,"event",a,"cell",b))}; mxGraph.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tooltipHandler&&this.tooltipHandler.destroy(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.destroy(),null!=this.panningHandler&&this.panningHandler.destroy(),null!=this.popupMenuHandler&&this.popupMenuHandler.destroy(),null!=this.connectionHandler&&this.connectionHandler.destroy(),null!=this.graphHandler&&this.graphHandler.destroy(),null!=this.cellEditor&&this.cellEditor.destroy(),null!=this.view&&this.view.destroy(), null!=this.model&&null!=this.graphModelChangeListener&&(this.model.removeListener(this.graphModelChangeListener),this.graphModelChangeListener=null),this.container=null)};function mxCellOverlay(a,b,c,d,e,f){this.image=a;this.tooltip=b;this.align=null!=c?c:this.align;this.verticalAlign=null!=d?d:this.verticalAlign;this.offset=null!=e?e:new mxPoint;this.cursor=null!=f?f:"help"}mxCellOverlay.prototype=new mxEventSource;mxCellOverlay.prototype.constructor=mxCellOverlay;mxCellOverlay.prototype.image=null; mxCellOverlay.prototype.tooltip=null;mxCellOverlay.prototype.align=mxConstants.ALIGN_RIGHT;mxCellOverlay.prototype.verticalAlign=mxConstants.ALIGN_BOTTOM;mxCellOverlay.prototype.offset=null;mxCellOverlay.prototype.cursor=null;mxCellOverlay.prototype.defaultOverlap=.5; mxCellOverlay.prototype.getBounds=function(a){var b=a.view.graph.getModel().isEdge(a.cell),c=a.view.scale,d=this.image.width,e=this.image.height;if(b)if(b=a.absolutePoints,1==b.length%2)b=b[Math.floor(b.length/2)];else{var f=b.length/2;a=b[f-1];b=b[f];b=new mxPoint(a.x+(b.x-a.x)/2,a.y+(b.y-a.y)/2)}else b=new mxPoint,b.x=this.align==mxConstants.ALIGN_LEFT?a.x:this.align==mxConstants.ALIGN_CENTER?a.x+a.width/2:a.x+a.width,b.y=this.verticalAlign==mxConstants.ALIGN_TOP?a.y:this.verticalAlign==mxConstants.ALIGN_MIDDLE? a.y+a.height/2:a.y+a.height;return new mxRectangle(Math.round(b.x-(d*this.defaultOverlap-this.offset.x)*c),Math.round(b.y-(e*this.defaultOverlap-this.offset.y)*c),d*c,e*c)};mxCellOverlay.prototype.toString=function(){return this.tooltip};function mxOutline(a,b){this.source=a;null!=b&&this.init(b)}mxOutline.prototype.source=null;mxOutline.prototype.container=null;mxOutline.prototype.enabled=!0;mxOutline.prototype.suspended=!1;mxOutline.prototype.border=14;mxOutline.prototype.opacity=.7; mxOutline.prototype.init=function(a){this.container=a;this.updateHandler=mxUtils.bind(this,function(b,c){this.update(!0)});this.source.getModel().addListener(mxEvent.CHANGE,this.updateHandler);this.source.addListener(mxEvent.REFRESH,this.updateHandler);a=this.source.getView();a.addListener(mxEvent.UP,this.updateHandler);a.addListener(mxEvent.DOWN,this.updateHandler);a.addListener(mxEvent.SCALE,this.updateHandler);a.addListener(mxEvent.TRANSLATE,this.updateHandler);a.addListener(mxEvent.SCALE_AND_TRANSLATE, this.updateHandler);this.scrollHandler=mxUtils.bind(this,function(b,c){this.update(!1)});mxEvent.addListener(this.source.container,"scroll",this.scrollHandler);this.source.addListener(mxEvent.PAN,this.scrollHandler);this.update(!0)};mxOutline.prototype.isEnabled=function(){return this.enabled};mxOutline.prototype.setEnabled=function(a){this.enabled=a};mxOutline.prototype.isSuspended=function(){return this.suspended};mxOutline.prototype.setSuspended=function(a){this.suspended=a;this.update(!0)}; mxOutline.prototype.isScrolling=function(){return this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)}; mxOutline.prototype.createSvg=function(){var a=document.createElementNS(mxConstants.NS_SVG,"svg");a.style.position="absolute";a.style.left="0px";a.style.top="0px";a.style.width="100%";a.style.height="100%";a.style.display="block";a.style.padding=this.border+"px";a.style.boxSizing="border-box";a.style.overflow="visible";a.style.cursor="default";a.setAttribute("shape-rendering","optimizeSpeed");a.setAttribute("image-rendering","optimizeSpeed");return a}; mxOutline.prototype.addGestureListeners=function(a){var b=null,c=0,d=0,e=1,f=mxUtils.bind(this,function(l){if(this.isEnabled()){b=new mxPoint(mxEvent.getClientX(l),mxEvent.getClientY(l));var m=a.clientWidth-2*this.border,n=a.clientHeight-2*this.border,p=this.getViewBox();e=Math.max(p.width/m,p.height/n);if(mxEvent.getSource(l)!=this.viewport)if(this.isScrolling()){m-=p.width/e;n-=p.height/e;var q=this.svg.getBoundingClientRect();this.source.container.scrollLeft=p.x-m*e/2+(b.x-this.border-q.left)* e;this.source.container.scrollTop=p.y-n*e/2+(b.y-this.border-q.top)*e}else p=this.source.view.translate,n=this.viewport.getBoundingClientRect(),m=(mxEvent.getClientX(l)-n.left)*e/this.source.view.scale,n=(mxEvent.getClientY(l)-n.top)*e/this.source.view.scale,this.source.getView().setTranslate(p.x-m,p.y-n),this.source.panGraph(0,0);mxEvent.addGestureListeners(document,null,g,k);c=this.source.container.scrollLeft;d=this.source.container.scrollTop;mxEvent.consume(l)}}),g=mxUtils.bind(this,function(l){this.isEnabled()&& null!=b&&(this.isScrolling()?(this.source.container.scrollLeft=c+(mxEvent.getClientX(l)-b.x)*e,this.source.container.scrollTop=d+(mxEvent.getClientY(l)-b.y)*e):this.source.panGraph((b.x-mxEvent.getClientX(l))*e,(b.y-mxEvent.getClientY(l))*e),mxEvent.consume(l))}),k=mxUtils.bind(this,function(l){if(this.isEnabled()&&null!=b){if(!this.isScrolling()){var m=(mxEvent.getClientX(l)-b.x)*e/this.source.view.scale,n=(mxEvent.getClientY(l)-b.y)*e/this.source.view.scale,p=this.source.view.translate;this.source.getView().setTranslate(p.x- m,p.y-n);this.source.panGraph(0,0)}mxEvent.removeGestureListeners(document,null,g,k);mxEvent.consume(l);b=null}});mxEvent.addGestureListeners(a,f,g,k)};mxOutline.prototype.getViewBox=function(){return this.source.getGraphBounds()}; mxOutline.prototype.updateSvg=function(){null==this.svg&&(this.svg=this.createSvg(),this.addGestureListeners(this.svg),this.container.appendChild(this.svg));var a=this.getViewBox();this.svg.setAttribute("viewBox",Math.round(a.x)+" "+Math.round(a.y)+" "+Math.round(a.width)+" "+Math.round(a.height));a=mxUtils.getLightDarkColor(null==this.source.background||this.source.background==mxConstants.NONE?this.source.defaultPageBackgroundColor:this.source.background).cssText;this.svg.style.backgroundColor=a; this.updateDrawPane()};mxOutline.prototype.updateDrawPane=function(){null!=this.drawPane&&this.drawPane.parentNode.removeChild(this.drawPane);this.drawPane=this.source.view.getDrawPane().cloneNode(!0);this.drawPane.style.opacity=this.opacity;this.processSvg(this.drawPane);null!=this.viewport?this.svg.insertBefore(this.drawPane,this.viewport):this.svg.appendChild(this.drawPane)}; mxOutline.prototype.processSvg=function(a){var b=this.source.view.scale;Array.prototype.slice.call(a.getElementsByTagName("*")).forEach(mxUtils.bind(this,function(c){if("text"!=c.nodeName&&"foreignObject"!=c.nodeName&&"hidden"!=c.getAttribute("visibility")&&c instanceof SVGElement){var d=parseInt(c.getAttribute("stroke-width")||1);isNaN(d)||c.setAttribute("stroke-width",Math.max(1,d/(5*b)));c.setAttribute("vector-effect","non-scaling-stroke");c.style.cursor=""}else c.parentNode.removeChild(c)}))}; mxOutline.prototype.updateViewport=function(){if(null!=this.svg){null==this.viewport&&(this.viewport=this.createViewport(),this.svg.appendChild(this.viewport));var a=this.source.container;a=new mxRectangle(a.scrollLeft,a.scrollTop,a.clientWidth,a.clientHeight);this.isScrolling()||(a.x=-this.source.panDx,a.y=-this.source.panDy);this.viewport.setAttribute("x",a.x);this.viewport.setAttribute("y",a.y);this.viewport.setAttribute("width",a.width);this.viewport.setAttribute("height",a.height)}}; mxOutline.prototype.createViewport=function(){var a=this.svg.ownerDocument.createElementNS(mxConstants.NS_SVG,"rect");a.setAttribute("stroke-width","3");a.setAttribute("stroke",HoverIcons.prototype.arrowFill);a.setAttribute("fill",HoverIcons.prototype.arrowFill);a.setAttribute("vector-effect","non-scaling-stroke");a.setAttribute("fill-opacity",.2);a.style.cursor="move";return a}; mxOutline.prototype.update=function(a){null!=this.source&&null!=this.source.container&&(null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null),this.fullUpdate=this.fullUpdate||a,this.thread=window.setTimeout(mxUtils.bind(this,function(){this.isSuspended()||(this.fullUpdate&&this.updateSvg(),this.updateViewport());this.thread=this.fullUpdate=null}),this.isScrolling()?10:0))}; mxOutline.prototype.destroy=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null);null!=this.svg&&(this.svg.parentNode.removeChild(this.svg),this.svg=null);null!=this.source&&(this.source.removeListener(this.scrollHandler),this.source.removeListener(this.updateHandler),this.source.getView().removeListener(this.updateHandler),this.source.getModel().removeListener(this.updateHandler),mxEvent.removeListener(this.source.container,"scroll",this.scrollHandler),this.source=null)}; function mxMultiplicity(a,b,c,d,e,f,g,k,l,m){this.source=a;this.type=b;this.attr=c;this.value=d;this.min=null!=e?e:0;this.max=null!=f?f:"n";this.validNeighbors=g;this.countError=mxResources.get(k)||k;this.typeError=mxResources.get(l)||l;this.validNeighborsAllowed=null!=m?m:!0}mxMultiplicity.prototype.type=null;mxMultiplicity.prototype.attr=null;mxMultiplicity.prototype.value=null;mxMultiplicity.prototype.source=null;mxMultiplicity.prototype.min=null;mxMultiplicity.prototype.max=null; mxMultiplicity.prototype.validNeighbors=null;mxMultiplicity.prototype.validNeighborsAllowed=!0;mxMultiplicity.prototype.countError=null;mxMultiplicity.prototype.typeError=null; mxMultiplicity.prototype.check=function(a,b,c,d,e,f){var g="";if(this.source&&this.checkTerminal(a,c,b)||!this.source&&this.checkTerminal(a,d,b))null!=this.countError&&(this.source&&(0==this.max||e>=this.max)||!this.source&&(0==this.max||f>=this.max))&&(g+=this.countError+"\n"),null!=this.validNeighbors&&null!=this.typeError&&0<this.validNeighbors.length&&(this.checkNeighbors(a,b,c,d)||(g+=this.typeError+"\n"));return 0<g.length?g:null}; mxMultiplicity.prototype.checkNeighbors=function(a,b,c,d){b=a.model.getValue(c);d=a.model.getValue(d);c=!this.validNeighborsAllowed;for(var e=this.validNeighbors,f=0;f<e.length;f++)if(this.source&&this.checkType(a,d,e[f])){c=this.validNeighborsAllowed;break}else if(!this.source&&this.checkType(a,b,e[f])){c=this.validNeighborsAllowed;break}return c};mxMultiplicity.prototype.checkTerminal=function(a,b,c){b=a.model.getValue(b);return this.checkType(a,b,this.type,this.attr,this.value)}; mxMultiplicity.prototype.checkType=function(a,b,c,d,e){return null!=b?isNaN(b.nodeType)?b==c:mxUtils.isNode(b,c,d,e):!1}; function mxLayoutManager(a){this.undoHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.beforeUndo(c.getProperty("edit"))});this.moveHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.cellsMoved(c.getProperty("cells"),c.getProperty("event"))});this.resizeHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.cellsResized(c.getProperty("cells"),c.getProperty("bounds"),c.getProperty("previous"))});this.setGraph(a)}mxLayoutManager.prototype=new mxEventSource; mxLayoutManager.prototype.constructor=mxLayoutManager;mxLayoutManager.prototype.graph=null;mxLayoutManager.prototype.bubbling=!0;mxLayoutManager.prototype.enabled=!0;mxLayoutManager.prototype.undoHandler=null;mxLayoutManager.prototype.moveHandler=null;mxLayoutManager.prototype.resizeHandler=null;mxLayoutManager.prototype.isEnabled=function(){return this.enabled};mxLayoutManager.prototype.setEnabled=function(a){this.enabled=a};mxLayoutManager.prototype.isBubbling=function(){return this.bubbling}; mxLayoutManager.prototype.setBubbling=function(a){this.bubbling=a};mxLayoutManager.prototype.getGraph=function(){return this.graph}; mxLayoutManager.prototype.setGraph=function(a){if(null!=this.graph){var b=this.graph.getModel();b.removeListener(this.undoHandler);this.graph.removeListener(this.moveHandler);this.graph.removeListener(this.resizeHandler)}this.graph=a;null!=this.graph&&(b=this.graph.getModel(),b.addListener(mxEvent.BEFORE_UNDO,this.undoHandler),this.graph.addListener(mxEvent.MOVE_CELLS,this.moveHandler),this.graph.addListener(mxEvent.RESIZE_CELLS,this.resizeHandler))}; mxLayoutManager.prototype.hasLayout=function(a){return null!=this.getLayout(a,mxEvent.LAYOUT_CELLS)};mxLayoutManager.prototype.getLayout=function(a,b){return null};mxLayoutManager.prototype.beforeUndo=function(a){this.executeLayoutForCells(this.getCellsForChanges(a.changes))}; mxLayoutManager.prototype.cellsMoved=function(a,b){if(null!=a&&null!=b){b=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(b),mxEvent.getClientY(b));for(var c=this.getGraph().getModel(),d=0;d<a.length;d++){var e=this.getLayout(c.getParent(a[d]),mxEvent.MOVE_CELLS);null!=e&&e.moveCell(a[d],b.x,b.y)}}}; mxLayoutManager.prototype.cellsResized=function(a,b,c){if(null!=a&&null!=b&&null!=c)for(var d=this.getGraph().getModel(),e=0;e<a.length;e++){var f=this.getLayout(d.getParent(a[e]),mxEvent.RESIZE_CELLS);null!=f&&f.resizeCell(a[e],b[e],c[e])}};mxLayoutManager.prototype.getCellsForChanges=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];if(d instanceof mxRootChange)return[];b=b.concat(this.getCellsForChange(d))}return b}; mxLayoutManager.prototype.getCellsForChange=function(a){return a instanceof mxChildChange?this.addCellsWithLayout(a.child,this.addCellsWithLayout(a.previous)):a instanceof mxValueChange||a instanceof mxTerminalChange||a instanceof mxGeometryChange||a instanceof mxVisibleChange||a instanceof mxStyleChange?this.addCellsWithLayout(a.cell):[]};mxLayoutManager.prototype.addCellsWithLayout=function(a,b){return this.addDescendantsWithLayout(a,this.addAncestorsWithLayout(a,b))}; mxLayoutManager.prototype.addAncestorsWithLayout=function(a,b){b=null!=b?b:[];if(null!=a&&(this.hasLayout(a)&&b.push(a),this.isBubbling())){var c=this.getGraph().getModel();this.addAncestorsWithLayout(c.getParent(a),b)}return b};mxLayoutManager.prototype.addDescendantsWithLayout=function(a,b){b=null!=b?b:[];if(null!=a&&this.hasLayout(a))for(var c=this.getGraph().getModel(),d=0;d<c.getChildCount(a);d++){var e=c.getChildAt(a,d);this.hasLayout(e)&&(b.push(e),this.addDescendantsWithLayout(e,b))}return b}; mxLayoutManager.prototype.executeLayoutForCells=function(a){var b=this.getGraph().getModel();b.beginUpdate();try{var c=mxUtils.sortCells(a,!1);this.layoutCells(c,!0);this.layoutCells(c.reverse(),!1)}finally{b.endUpdate()}}; mxLayoutManager.prototype.layoutCells=function(a,b){if(0<a.length){var c=this.getGraph().getModel();c.beginUpdate();try{for(var d=null,e=0;e<a.length;e++)a[e]!=c.getRoot()&&a[e]!=d&&(this.executeLayout(a[e],b),d=a[e]);this.fireEvent(new mxEventObject(mxEvent.LAYOUT_CELLS,"cells",a))}finally{c.endUpdate()}}};mxLayoutManager.prototype.executeLayout=function(a,b){b=this.getLayout(a,b?mxEvent.BEGIN_UPDATE:mxEvent.END_UPDATE);null!=b&&b.execute(a)};mxLayoutManager.prototype.destroy=function(){this.setGraph(null)}; function mxSwimlaneManager(a,b,c,d){this.horizontal=null!=b?b:!0;this.addEnabled=null!=c?c:!0;this.resizeEnabled=null!=d?d:!0;this.addHandler=mxUtils.bind(this,function(e,f){this.isEnabled()&&this.isAddEnabled()&&this.cellsAdded(f.getProperty("cells"))});this.resizeHandler=mxUtils.bind(this,function(e,f){this.isEnabled()&&this.isResizeEnabled()&&this.cellsResized(f.getProperty("cells"))});this.setGraph(a)}mxSwimlaneManager.prototype=new mxEventSource;mxSwimlaneManager.prototype.constructor=mxSwimlaneManager; mxSwimlaneManager.prototype.graph=null;mxSwimlaneManager.prototype.enabled=!0;mxSwimlaneManager.prototype.horizontal=!0;mxSwimlaneManager.prototype.addEnabled=!0;mxSwimlaneManager.prototype.resizeEnabled=!0;mxSwimlaneManager.prototype.addHandler=null;mxSwimlaneManager.prototype.resizeHandler=null;mxSwimlaneManager.prototype.isEnabled=function(){return this.enabled};mxSwimlaneManager.prototype.setEnabled=function(a){this.enabled=a};mxSwimlaneManager.prototype.isHorizontal=function(){return this.horizontal}; mxSwimlaneManager.prototype.setHorizontal=function(a){this.horizontal=a};mxSwimlaneManager.prototype.isAddEnabled=function(){return this.addEnabled};mxSwimlaneManager.prototype.setAddEnabled=function(a){this.addEnabled=a};mxSwimlaneManager.prototype.isResizeEnabled=function(){return this.resizeEnabled};mxSwimlaneManager.prototype.setResizeEnabled=function(a){this.resizeEnabled=a};mxSwimlaneManager.prototype.getGraph=function(){return this.graph}; mxSwimlaneManager.prototype.setGraph=function(a){null!=this.graph&&(this.graph.removeListener(this.addHandler),this.graph.removeListener(this.resizeHandler));this.graph=a;null!=this.graph&&(this.graph.addListener(mxEvent.ADD_CELLS,this.addHandler),this.graph.addListener(mxEvent.CELLS_RESIZED,this.resizeHandler))};mxSwimlaneManager.prototype.isSwimlaneIgnored=function(a){return!this.getGraph().isSwimlane(a)}; mxSwimlaneManager.prototype.isCellHorizontal=function(a){return this.graph.isSwimlane(a)?(a=this.graph.getCellStyle(a),1==mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,1)):!this.isHorizontal()};mxSwimlaneManager.prototype.cellsAdded=function(a){if(null!=a){var b=this.getGraph().getModel();b.beginUpdate();try{for(var c=0;c<a.length;c++)this.isSwimlaneIgnored(a[c])||this.swimlaneAdded(a[c])}finally{b.endUpdate()}}}; mxSwimlaneManager.prototype.swimlaneAdded=function(a){for(var b=this.getGraph().getModel(),c=b.getParent(a),d=b.getChildCount(c),e=null,f=0;f<d;f++){var g=b.getChildAt(c,f);if(g!=a&&!this.isSwimlaneIgnored(g)&&(e=b.getGeometry(g),null!=e))break}null!=e&&(b=null!=c?this.isCellHorizontal(c):this.horizontal,this.resizeSwimlane(a,e.width,e.height,b))}; mxSwimlaneManager.prototype.cellsResized=function(a){if(null!=a){var b=this.getGraph().getModel();b.beginUpdate();try{for(var c=0;c<a.length;c++)if(!this.isSwimlaneIgnored(a[c])){var d=b.getGeometry(a[c]);if(null!=d){for(var e=new mxRectangle(0,0,d.width,d.height),f=a[c],g=f;null!=g;){f=g;g=b.getParent(g);var k=this.graph.isSwimlane(g)?this.graph.getStartSize(g):new mxRectangle;e.width+=k.width;e.height+=k.height}var l=null!=g?this.isCellHorizontal(g):this.horizontal;this.resizeSwimlane(f,e.width, e.height,l)}}}finally{b.endUpdate()}}}; mxSwimlaneManager.prototype.resizeSwimlane=function(a,b,c,d){var e=this.getGraph().getModel();e.beginUpdate();try{var f=this.isCellHorizontal(a);if(!this.isSwimlaneIgnored(a)){var g=e.getGeometry(a);null!=g&&(d&&g.height!=c||!d&&g.width!=b)&&(g=g.clone(),d?g.height=c:g.width=b,e.setGeometry(a,g))}var k=this.graph.isSwimlane(a)?this.graph.getStartSize(a):new mxRectangle;b-=k.width;c-=k.height;var l=e.getChildCount(a);for(d=0;d<l;d++){var m=e.getChildAt(a,d);this.resizeSwimlane(m,b,c,f)}}finally{e.endUpdate()}}; mxSwimlaneManager.prototype.destroy=function(){this.setGraph(null)}; function mxTemporaryCellStates(a,b,c,d,e,f){b=null!=b?b:1;this.view=a;this.oldValidateCellState=a.validateCellState;this.oldBounds=a.getGraphBounds();this.oldStates=a.getStates();this.oldScale=a.getScale();this.oldDoRedrawShape=a.graph.cellRenderer.doRedrawShape;var g=this;null!=e&&(a.graph.cellRenderer.doRedrawShape=function(m){var n=m.shape.paint;m.shape.paint=function(p){var q=e(m);null!=q&&p.setLink(q,null!=f?f(m):null);n.apply(this,arguments);null!=q&&p.setLink(null)};g.oldDoRedrawShape.apply(a.graph.cellRenderer, arguments);m.shape.paint=n});a.validateCellState=function(m,n){return null==m||null==d||d(m)?g.oldValidateCellState.apply(a,arguments):null};a.setStates(new mxDictionary);a.setScale(b);if(null!=c){a.resetValidationState();b=null;for(var k=0;k<c.length;k++){var l=a.getBoundingBox(a.validateCellState(a.validateCell(c[k])));null==b?b=l:b.add(l)}a.setGraphBounds(b||new mxRectangle)}}mxTemporaryCellStates.prototype.view=null;mxTemporaryCellStates.prototype.oldStates=null; mxTemporaryCellStates.prototype.oldBounds=null;mxTemporaryCellStates.prototype.oldScale=null;mxTemporaryCellStates.prototype.destroy=function(){this.view.setScale(this.oldScale);this.view.setStates(this.oldStates);this.view.setGraphBounds(this.oldBounds);this.view.validateCellState=this.oldValidateCellState;this.view.graph.cellRenderer.doRedrawShape=this.oldDoRedrawShape};function mxCellStatePreview(a){this.deltas=new mxDictionary;this.graph=a}mxCellStatePreview.prototype.graph=null; mxCellStatePreview.prototype.deltas=null;mxCellStatePreview.prototype.count=0;mxCellStatePreview.prototype.isEmpty=function(){return 0==this.count};mxCellStatePreview.prototype.moveState=function(a,b,c,d,e){d=null!=d?d:!0;e=null!=e?e:!0;var f=this.deltas.get(a.cell);null==f?(f={point:new mxPoint(b,c),state:a},this.deltas.put(a.cell,f),this.count++):d?(f.point.x+=b,f.point.y+=c):(f.point.x=b,f.point.y=c);e&&this.addEdges(a);return f.point}; mxCellStatePreview.prototype.show=function(a){this.deltas.visit(mxUtils.bind(this,function(b,c){this.translateState(c.state,c.point.x,c.point.y)}));this.deltas.visit(mxUtils.bind(this,function(b,c){this.revalidateState(c.state,c.point.x,c.point.y,a)}))}; mxCellStatePreview.prototype.translateState=function(a,b,c){if(null!=a){var d=this.graph.getModel();if(d.isVertex(a.cell)){a.view.updateCellState(a);var e=d.getGeometry(a.cell);0==b&&0==c||null==e||e.relative&&null==this.deltas.get(a.cell)||(a.x+=b,a.y+=c)}e=d.getChildCount(a.cell);for(var f=0;f<e;f++)this.translateState(a.view.getState(d.getChildAt(a.cell,f)),b,c)}}; mxCellStatePreview.prototype.revalidateState=function(a,b,c,d){if(null!=a){var e=this.graph.getModel();e.isEdge(a.cell)&&a.view.updateCellState(a);var f=this.graph.getCellGeometry(a.cell),g=a.view.getState(e.getParent(a.cell));0==b&&0==c||null==f||!f.relative||!e.isVertex(a.cell)||null!=g&&!e.isVertex(g.cell)&&null==this.deltas.get(a.cell)||(a.x+=b,a.y+=c);this.graph.cellRenderer.redraw(a);null!=d&&d(a);f=e.getChildCount(a.cell);for(g=0;g<f;g++)this.revalidateState(this.graph.view.getState(e.getChildAt(a.cell, g)),b,c,d)}};mxCellStatePreview.prototype.addEdges=function(a){for(var b=this.graph.getModel(),c=b.getEdgeCount(a.cell),d=0;d<c;d++){var e=a.view.getState(b.getEdgeAt(a.cell,d));null!=e&&this.moveState(e,0,0)}};function mxConnectionConstraint(a,b,c,d,e){this.point=a;this.perimeter=null!=b?b:!0;this.name=c;this.dx=d?d:0;this.dy=e?e:0}mxConnectionConstraint.prototype.point=null;mxConnectionConstraint.prototype.perimeter=null;mxConnectionConstraint.prototype.name=null; mxConnectionConstraint.prototype.dx=null;mxConnectionConstraint.prototype.dy=null; function mxGraphHandler(a){this.graph=a;this.graph.addMouseListener(this);this.panHandler=mxUtils.bind(this,function(){this.suspended||(this.updatePreview(),this.updateHint())});this.graph.addListener(mxEvent.PAN,this.panHandler);this.escapeHandler=mxUtils.bind(this,function(b,c){this.reset()});this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler);this.refreshHandler=mxUtils.bind(this,function(b,c){this.refreshThread&&window.clearTimeout(this.refreshThread);this.refreshThread=window.setTimeout(mxUtils.bind(this, function(){this.refreshThread=null;if(null!=this.first&&!this.suspended){var d=this.currentDx,e=this.currentDy;this.currentDy=this.currentDx=0;this.updatePreview();this.bounds=this.getStateBounds(this.cells);this.pBounds=this.getPreviewBounds(this.cells);null!=this.pBounds||this.livePreviewUsed?(this.currentDx=d,this.currentDy=e,this.updatePreview(),this.updateHint(),this.livePreviewUsed&&(this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1,!0),this.updatePreview())): this.reset()}}),0)});this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler);this.graph.addListener(mxEvent.REFRESH,this.refreshHandler);this.keyHandler=mxUtils.bind(this,function(b){null==this.graph.container||"hidden"==this.graph.container.style.visibility||null==this.first||this.suspended||(b=this.graph.isCloneEvent(b)&&this.graph.isCellsCloneable()&&this.isCloneEnabled(),b!=this.cloning&&(this.cloning=b,this.checkPreview(),this.updatePreview()))});mxEvent.addListener(document,"keydown", this.keyHandler);mxEvent.addListener(document,"keyup",this.keyHandler)}mxGraphHandler.prototype.graph=null;mxGraphHandler.prototype.maxCells=50;mxGraphHandler.prototype.enabled=!0;mxGraphHandler.prototype.highlightEnabled=!0;mxGraphHandler.prototype.cloneEnabled=!0;mxGraphHandler.prototype.moveEnabled=!0;mxGraphHandler.prototype.guidesEnabled=!1;mxGraphHandler.prototype.handlesVisible=!0;mxGraphHandler.prototype.guide=null;mxGraphHandler.prototype.currentDx=null; mxGraphHandler.prototype.currentDy=null;mxGraphHandler.prototype.updateCursor=!0;mxGraphHandler.prototype.selectEnabled=!0;mxGraphHandler.prototype.removeCellsFromParent=!0;mxGraphHandler.prototype.removeEmptyParents=!1;mxGraphHandler.prototype.connectOnDrop=!1;mxGraphHandler.prototype.scrollOnMove=!0;mxGraphHandler.prototype.minimumSize=6;mxGraphHandler.prototype.previewColor="black";mxGraphHandler.prototype.htmlPreview=!1;mxGraphHandler.prototype.shape=null;mxGraphHandler.prototype.scaleGrid=!1; mxGraphHandler.prototype.rotationEnabled=!0;mxGraphHandler.prototype.maxLivePreview=0;mxGraphHandler.prototype.allowLivePreview=mxClient.IS_SVG;mxGraphHandler.prototype.isEnabled=function(){return this.enabled};mxGraphHandler.prototype.setEnabled=function(a){this.enabled=a};mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled};mxGraphHandler.prototype.setCloneEnabled=function(a){this.cloneEnabled=a};mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled}; mxGraphHandler.prototype.setMoveEnabled=function(a){this.moveEnabled=a};mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled};mxGraphHandler.prototype.setSelectEnabled=function(a){this.selectEnabled=a};mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent};mxGraphHandler.prototype.setRemoveCellsFromParent=function(a){this.removeCellsFromParent=a}; mxGraphHandler.prototype.isPropagateSelectionCell=function(a,b,c){var d=this.graph.model.getParent(a);return b?(b=this.graph.model.isEdge(a)?null:this.graph.getCellGeometry(a),!this.graph.isSiblingSelected(a)&&(null!=b&&b.relative||!this.graph.isSwimlane(d))):(!this.graph.isToggleEvent(c.getEvent())||!this.graph.isSiblingSelected(a)&&!this.graph.isCellSelected(a)&&!this.graph.isSwimlane(d)||this.graph.isCellSelected(d))&&(this.graph.isToggleEvent(c.getEvent())||!this.graph.isCellSelected(d))}; mxGraphHandler.prototype.getInitialCellForEvent=function(a){var b=a.getState();if(!(this.graph.isToggleEvent(a.getEvent())&&mxEvent.isAltDown(a.getEvent())||null==b||this.graph.isCellSelected(b.cell)))for(var c=this.graph.model,d=this.graph.view.getState(c.getParent(b.cell));null!=d&&!this.graph.isCellSelected(d.cell)&&(c.isVertex(d.cell)||c.isEdge(d.cell))&&this.isPropagateSelectionCell(b.cell,!0,a)&&d.cell!=this.graph.getCurrentRoot();)b=d,d=this.graph.view.getState(this.graph.getModel().getParent(b.cell)); return null!=b?b.cell:null};mxGraphHandler.prototype.isDelayedSelection=function(a,b){if(!this.graph.isToggleEvent(b.getEvent())||!mxEvent.isAltDown(b.getEvent()))for(;null!=a;){if(this.graph.selectionCellsHandler.isHandled(a))return this.graph.cellEditor.getEditingCell()!=a;a=this.graph.model.getParent(a)}return this.graph.isToggleEvent(b.getEvent())}; mxGraphHandler.prototype.selectDelayed=function(a){if(!this.graph.popupMenuHandler.isPopupTrigger(a)){var b=a.getCell();null==b&&(b=this.cell);this.selectCellForEvent(b,a)}}; mxGraphHandler.prototype.selectCellForEvent=function(a,b){var c=this.graph.view.getState(a);if(null!=c){if(!(b.isSource(c.control)||this.graph.isToggleEvent(b.getEvent())&&mxEvent.isAltDown(b.getEvent()))){c=this.graph.getModel();for(var d=c.getParent(a);null!=this.graph.view.getState(d)&&(c.isVertex(d)||c.isEdge(d)&&!this.graph.isToggleEvent(b.getEvent()))&&this.isPropagateSelectionCell(a,!1,b)&&d!=this.graph.getCurrentRoot();)a=d,d=c.getParent(a)}this.graph.selectCellForEvent(a,b.getEvent())}return a}; mxGraphHandler.prototype.consumeMouseEvent=function(a,b){b.consume()}; mxGraphHandler.prototype.mouseDown=function(a,b){this.mouseDownX=b.getX();this.mouseDownY=b.getY();a=b.getEvent();if(!mxEvent.isMouseEvent(a)||mxEvent.isLeftMouseButton(a)){var c=mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)&&!this.graph.isSelectionEmpty();if(!b.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&(null!=b.getState()||c)&&!mxEvent.isMultiTouchEvent(a)){var d=this.getInitialCellForEvent(b);this.delayedSelection=this.isDelayedSelection(d,b);this.cell=null;null==d&&c&&(d=this.graph.getSelectionCell()); c=this.graph.getSelectionCount();this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(d,a);mxEvent.isTouchEvent(b.getEvent())&&this.graph.isCellSelected(d)&&0<c&&(this.delayedSelection=this.blockDelayedSelection=!0);this.isMoveEnabled()&&(this.delayedSelection?this.cell=d:this.start(d,b.getX(),b.getY()),this.cellWasClicked=!0,this.graph.isCellLocked(d)||this.consumeMouseEvent(mxEvent.MOUSE_DOWN,b))}}}; mxGraphHandler.prototype.getGuideStates=function(){var a=this.graph.getDefaultParent(),b=this.graph.getModel(),c=mxUtils.bind(this,function(d){return null!=this.graph.view.getState(d)&&b.isVertex(d)&&null!=b.getGeometry(d)&&!b.getGeometry(d).relative});a=this.graph.view.getCellStates(b.filterDescendants(c,a));for(c=0;c<a.length;c++)a[c]=this.getGuideState(a[c]);return a}; mxGraphHandler.prototype.getGuideState=function(a){if(null!=a&&this.graph.getModel().isVertex(a.cell)&&90==mxUtils.mod(mxUtils.getNumber(a.style,mxConstants.STYLE_ROTATION,0),360)%180){var b=new mxCellState(a.view,a.cell,a.style);b.x=a.getCenterX()-a.height/2;b.y=a.getCenterY()-a.width/2;b.width=a.height;b.height=a.width;return b}return a}; mxGraphHandler.prototype.getCells=function(a,b){if(null==b&&!this.delayedSelection&&this.graph.isCellMovable(a))return[this.graph.getCompositeParent(a)];b=null!=b?b:this.graph.getSelectionCells();a=new mxDictionary;for(var c=[],d=0;d<b.length;d++){var e=this.graph.getCompositeParent(b[d]);null==a.get(e)&&(a.put(e,!0),c.push(e))}b=[];for(d=0;d<c.length;d++){for(e=this.graph.model.getParent(c[d]);null==a.get(e)&&null!=e;)e=this.graph.model.getParent(e);null==e&&b.push(c[d])}return this.graph.getMovableCells(b)}; mxGraphHandler.prototype.getPreviewBounds=function(a){a=this.getBoundingBox(a);null!=a&&(a.width=Math.max(0,a.width-1),a.height=Math.max(0,a.height-1),a.width<this.minimumSize?(a.x-=(this.minimumSize-a.width)/2,a.width=this.minimumSize):(a.x=Math.round(a.x),a.width=Math.ceil(a.width)),a.height<this.minimumSize?(a.y-=(this.minimumSize-a.height)/2,a.height=this.minimumSize):(a.y=Math.round(a.y),a.height=Math.ceil(a.height)));return a}; mxGraphHandler.prototype.getStateBounds=function(a){var b=null;if(null!=a&&0<a.length)for(var c=this.graph.getModel(),d=0;d<a.length;d++)if(c.isVertex(a[d])||c.isEdge(a[d])){var e=this.graph.view.getState(a[d]);if(null!=e){var f=mxRectangle.fromRectangle(e);c.isVertex(a[d])&&90==mxUtils.mod(mxUtils.getNumber(e.style,mxConstants.STYLE_ROTATION,0),360)%180&&(f=new mxRectangle(e.getCenterX()-e.height/2,e.getCenterY()-e.width/2,e.height,e.width));null==b?b=f:b.add(f)}}return b}; mxGraphHandler.prototype.getBoundingBox=function(a){var b=null;if(null!=a&&0<a.length)for(var c=this.graph.getModel(),d=0;d<a.length;d++)if(c.isVertex(a[d])||c.isEdge(a[d])){var e=this.graph.view.getState(a[d]);if(null!=e){var f=e;c.isVertex(a[d])&&null!=e.shape&&null!=e.shape.boundingBox&&(f=e.shape.boundingBox);null==b?b=mxRectangle.fromRectangle(f):b.add(f)}}return b}; mxGraphHandler.prototype.createPreviewShape=function(a){a=new mxRectangleShape(a,null,this.previewColor);a.isDashed=!0;this.htmlPreview?(a.dialect=mxConstants.DIALECT_STRICTHTML,a.init(this.graph.container)):(a.dialect=mxConstants.DIALECT_SVG,a.init(this.graph.getView().getOverlayPane()),a.pointerEvents=!1,mxClient.IS_IOS&&(a.getSvgScreenOffset=function(){return 0}));return a}; mxGraphHandler.prototype.start=function(a,b,c,d){var e=this.graph.model,f=e.getGeometry(a);if(null==this.first&&this.graph.isCellMovable(a)&&(!e.isEdge(a)||1<this.graph.getSelectionCount()||null!=f&&null!=f.points&&0<f.points.length||null==e.getTerminal(a,!0)||null==e.getTerminal(a,!1)||this.graph.allowDanglingEdges)){this.cell=a;this.first=mxUtils.convertPoint(this.graph.container,b,c);this.cells=null!=d?d:this.getCells(this.cell);this.bounds=this.getStateBounds(this.cells);this.pBounds=this.getPreviewBounds(this.cells); this.allCells=new mxDictionary;this.cloning=!1;for(b=this.cellCount=0;b<this.cells.length;b++)this.cellCount+=this.addStates(this.cells[b],this.allCells);if(this.guidesEnabled){this.guide=new mxGuide(this.graph,this.getGuideStates());var g=this.graph.model.getParent(a),k=2>this.graph.model.getChildCount(g),l=new mxDictionary;a=this.graph.getOpposites(this.graph.getEdges(this.cell),this.cell);for(b=0;b<a.length;b++)null==this.graph.view.getState(a[b])||l.get(a[b])||l.put(a[b],!0);this.guide.isStateIgnored= mxUtils.bind(this,function(m){var n=this.graph.model.getParent(m.cell);return null!=m.cell&&(!this.cloning&&this.isCellMoving(m.cell)||m.cell!=(this.target||g)&&!k&&!l.get(m.cell)&&(null==this.target||2<=this.graph.model.getChildCount(this.target))&&n!=(this.target||g))})}}}; mxGraphHandler.prototype.addStates=function(a,b){var c=this.graph.view.getState(a),d=0;if(null!=c&&null==b.get(a)){b.put(a,c);d++;c=this.graph.model.getChildCount(a);for(var e=0;e<c;e++)d+=this.addStates(this.graph.model.getChildAt(a,e),b)}return d};mxGraphHandler.prototype.isCellMoving=function(a){return null!=this.allCells.get(a)};mxGraphHandler.prototype.useGuidesForEvent=function(a){return null!=this.guide?this.guide.isEnabledForEvent(a.getEvent())&&!this.isConstrainedEvent(a):!0}; mxGraphHandler.prototype.snap=function(a){var b=this.scaleGrid?this.graph.view.scale:1;a.x=this.graph.snap(a.x/b)*b;a.y=this.graph.snap(a.y/b)*b;return a};mxGraphHandler.prototype.getDelta=function(a){a=mxUtils.convertPoint(this.graph.container,a.getX(),a.getY());return new mxPoint(a.x-this.first.x-this.graph.panDx,a.y-this.first.y-this.graph.panDy)};mxGraphHandler.prototype.updateHint=function(a){};mxGraphHandler.prototype.removeHint=function(){}; mxGraphHandler.prototype.roundLength=function(a){return Math.round(100*a)/100};mxGraphHandler.prototype.isValidDropTarget=function(a,b){for(b=0;b<this.cells.length;b++)if(this.graph.model.getParent(this.cells[b])!=a)return!0;return!1}; mxGraphHandler.prototype.checkPreview=function(){this.livePreviewActive&&this.cloning?(this.resetLivePreview(),this.livePreviewActive=!1,this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1,!0)):this.maxLivePreview>=this.cellCount&&this.allowLivePreview?this.cloning?this.livePreviewUsed=!0:this.livePreviewActive||(this.livePreviewUsed=this.livePreviewActive=!0):this.livePreviewUsed||null!=this.shape||(this.shape=this.createPreviewShape(this.bounds))}; mxGraphHandler.prototype.mouseMove=function(a,b){a=this.graph;var c=a.tolerance;if(null==this.first&&this.delayedSelection&&null!=this.cell&&null!=this.mouseDownX&&null!=this.mouseDownY&&(Math.abs(this.mouseDownX-b.getX())>c||Math.abs(this.mouseDownY-b.getY())>c)){this.delayedSelection=!1;this.cellWasClicked=!0;this.graph.isCellSelected(this.cell)||mxEvent.isAltDown(b.getEvent())||(this.graph.isToggleEvent(b.getEvent())?a.addSelectionCell(this.cell):this.graph.isAncestorSelected(this.cell)||a.setSelectionCell(this.cell)); var d=a.getSelectionCells();this.graph.isToggleEvent(b.getEvent())&&mxEvent.isAltDown(b.getEvent())&&!a.isSelectionEmpty()||(d=d.concat(this.cell));this.start(this.cell,this.mouseDownX,this.mouseDownY,this.getCells(null,d))}d=null!=this.first?this.getDelta(b):null;if(b.isConsumed()||!a.isMouseDown||null==this.cell||null==d||null==this.bounds||this.suspended)!this.isMoveEnabled()&&!this.isCloneEnabled()||!this.updateCursor||b.isConsumed()||null==b.getState()&&null==b.sourceState||a.isMouseDown||(d= a.getCursorForMouseEvent(b),null==d&&a.isEnabled()&&a.isCellMovable(b.getCell())&&(d=a.getModel().isEdge(b.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),null!=d&&null!=b.sourceState&&b.sourceState.setCursor(d));else if(mxEvent.isMultiTouchEvent(b.getEvent()))this.reset();else{if(null!=this.shape||this.livePreviewActive||this.cloning||Math.abs(d.x)>c||Math.abs(d.y)>c){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR, 3));c=a.isCloneEvent(b.getEvent())&&a.isCellsCloneable()&&this.isCloneEnabled();var e=a.isGridEnabledEvent(b.getEvent()),f=b.getCell();f=null!=f&&0>mxUtils.indexOf(this.cells,f)?f:a.getCellAt(b.getGraphX(),b.getGraphY(),null,null,null,mxUtils.bind(this,function(n,p,q){return 0<=mxUtils.indexOf(this.cells,n.cell)}));var g=!0,k=null;this.cloning=c;a.isDropEnabled()&&this.highlightEnabled&&(k=a.getDropTarget(this.cells,b.getEvent(),f,c));var l=a.getView().getState(k),m=!1;null!=l&&(c||this.isValidDropTarget(k, b))?(this.target!=k&&(this.target=k,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),m=!0):(this.target=null,this.connectOnDrop&&null!=f&&1==this.cells.length&&a.getModel().isVertex(f)&&a.isCellConnectable(f)&&(l=a.getView().getState(f),null!=l&&(f=null==a.getEdgeValidationError(null,this.cell,f)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,this.setHighlightColor(f),m=!0)));null!=l&&m?this.highlight.highlight(l):this.highlight.hide();null!=this.guide&&this.useGuidesForEvent(b)? (d=this.guide.move(this.bounds,d,e,c),g=!1):d=a.snapDelta(d,this.bounds,!e,!1,!1);null!=this.guide&&g&&this.guide.hide();this.isConstrainedEvent(b)&&(Math.abs(d.x)>Math.abs(d.y)?d.y=0:d.x=0);this.checkPreview();if(this.currentDx!=d.x||this.currentDy!=d.y)this.currentDx=d.x,this.currentDy=d.y,this.updatePreview()}this.updateHint(b);this.consumeMouseEvent(mxEvent.MOUSE_MOVE,b);mxEvent.consume(b.getEvent())}}; mxGraphHandler.prototype.isConstrainedEvent=function(a){return(null==this.target||this.graph.isCloneEvent(a.getEvent()))&&this.graph.isConstrainedEvent(a.getEvent())};mxGraphHandler.prototype.updatePreview=function(a){this.livePreviewUsed&&!a?null!=this.cells&&(this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1),this.updateLivePreview(this.currentDx,this.currentDy)):this.updatePreviewShape()}; mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&null!=this.pBounds&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx),Math.round(this.pBounds.y+this.currentDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())}; mxGraphHandler.prototype.updateLivePreview=function(a,b){if(!this.suspended){var c=[];null!=this.allCells&&this.allCells.visit(mxUtils.bind(this,function(n,p){n=this.graph.view.getState(p.cell);n!=p&&(p.destroy(),null!=n?this.allCells.put(p.cell,n):this.allCells.remove(p.cell),p=n);if(null!=p&&(n=p.clone(),c.push([p,n]),null!=p.shape&&(null==p.shape.originalPointerEvents&&(p.shape.originalPointerEvents=p.shape.pointerEvents),p.shape.pointerEvents=!1,null!=p.text&&(null==p.text.originalPointerEvents&& (p.text.originalPointerEvents=p.text.pointerEvents),p.text.pointerEvents=!1)),this.graph.model.isVertex(p.cell))){if(!this.cloning||this.graph.isCellCloneable(p.cell))p.x+=a,p.y+=b;this.cloning?null!=p.text&&(p.text.updateBoundingBox(),null!=p.text.boundingBox&&(p.text.boundingBox.x+=a,p.text.boundingBox.y+=b),null!=p.text.unrotatedBoundingBox&&(p.text.unrotatedBoundingBox.x+=a,p.text.unrotatedBoundingBox.y+=b)):(p.view.graph.cellRenderer.redraw(p,!0),p.view.invalidate(p.cell),p.invalid=!1,null!= p.control&&null!=p.control.node&&(p.control.node.style.visibility="hidden"))}}));if(0==c.length)this.reset();else{for(var d=this.graph.view.scale,e=0;e<c.length;e++){var f=c[e][0];if(this.graph.model.isEdge(f.cell)&&(!this.cloning||this.graph.isCellCloneable(f.cell))){var g=this.graph.getCellGeometry(f.cell),k=[];if(null!=g&&null!=g.points)for(var l=0;l<g.points.length;l++)null!=g.points[l]&&k.push(new mxPoint(g.points[l].x+a/d,g.points[l].y+b/d));l=f.visibleSourceState;var m=f.visibleTargetState; g=c[e][1].absolutePoints;null!=g&&(null!=l&&this.isCellMoving(l.cell)?f.view.updateFixedTerminalPoint(f,l,!0,this.graph.getConnectionConstraint(f,l,!0)):(l=null==l?f.view.getFixedTerminalPoint(f,null,!0,null):null,l=null!=l?l:g[0],f.setAbsoluteTerminalPoint(new mxPoint(l.x+a,l.y+b),!0),l=null),null!=m&&this.isCellMoving(m.cell)?f.view.updateFixedTerminalPoint(f,m,!1,this.graph.getConnectionConstraint(f,m,!1)):(m=null==m?f.view.getFixedTerminalPoint(f,null,!1,null):null,m=null!=m?m:g[g.length-1],f.setAbsoluteTerminalPoint(new mxPoint(m.x+ a,m.y+b),!1),m=null));f.view.updatePoints(f,k,l,m);f.view.updateFloatingTerminalPoints(f,l,m);f.view.updateEdgeLabelOffset(f);f.invalid=!1;this.cloning||f.view.graph.cellRenderer.redraw(f,!0)}}this.graph.view.validate();this.redrawHandles(c);this.resetPreviewStates(c)}}};mxGraphHandler.prototype.redrawHandles=function(a){for(var b=0;b<a.length;b++){var c=this.graph.selectionCellsHandler.getHandler(a[b][0].cell);null!=c&&c.redraw(!0)}}; mxGraphHandler.prototype.resetPreviewStates=function(a){for(var b=0;b<a.length;b++)a[b][0].setState(a[b][1])};mxGraphHandler.prototype.suspend=function(){this.suspended||(this.livePreviewUsed&&this.updateLivePreview(0,0),null!=this.shape&&(this.shape.node.style.visibility="hidden"),null!=this.guide&&this.guide.setVisible(!1),this.suspended=!0)}; mxGraphHandler.prototype.resume=function(){this.suspended&&(this.suspended=null,this.livePreviewUsed&&(this.livePreviewActive=!0),null!=this.shape&&(this.shape.node.style.visibility="visible"),null!=this.guide&&this.guide.setVisible(!0))}; mxGraphHandler.prototype.resetLivePreview=function(){null!=this.allCells&&(this.allCells.visit(mxUtils.bind(this,function(a,b){null!=b.shape&&null!=b.shape.originalPointerEvents&&(b.shape.pointerEvents=b.shape.originalPointerEvents,b.shape.originalPointerEvents=null,b.shape.bounds=null,null!=b.text&&(b.text.pointerEvents=b.text.originalPointerEvents,b.text.originalPointerEvents=null));null!=b.control&&null!=b.control.node&&"hidden"==b.control.node.style.visibility&&(b.control.node.style.visibility= "");this.cloning||null!=b.text&&b.text.updateBoundingBox();b.view.invalidate(b.cell)})),this.graph.view.validate())};mxGraphHandler.prototype.setHandlesVisibleForCells=function(a,b,c){if(c||this.handlesVisible!=b)for(this.handlesVisible=b,c=0;c<a.length;c++){var d=this.graph.selectionCellsHandler.getHandler(a[c]);null!=d&&(d.setHandlesVisible(b),b&&d.redraw())}};mxGraphHandler.prototype.setHighlightColor=function(a){null!=this.highlight&&this.highlight.setHighlightColor(a)}; mxGraphHandler.prototype.mouseUp=function(a,b){if(!b.isConsumed())if(this.livePreviewUsed&&this.resetLivePreview(),null!=this.cell&&null!=this.first&&null!=this.currentDx&&null!=this.currentDy&&(null!=this.shape||this.livePreviewUsed||this.cloning)){a=this.graph;var c=b.getCell();if(this.connectOnDrop&&null==this.target&&null!=c&&a.getModel().isVertex(c)&&a.isCellConnectable(c)&&a.isEdgeValid(null,this.cell,c))a.connectionHandler.connect(this.cell,c,b.getEvent());else{var d=a.getView().scale;c=this.roundLength(this.currentDx/ d);d=this.roundLength(this.currentDy/d);var e=this.target;a.isSplitEnabled()&&a.isSplitTarget(e,this.cells,b.getEvent())?a.splitEdge(e,this.cells,null,c,d,b.getGraphX(),b.getGraphY()):this.moveCells(this.cells,c,d,this.cloning,this.target,b.getEvent())}}else this.isSelectEnabled()&&this.delayedSelection&&!this.blockDelayedSelection&&null!=this.cell&&this.selectDelayed(b);this.cellWasClicked&&this.consumeMouseEvent(mxEvent.MOUSE_UP,b);this.reset()}; mxGraphHandler.prototype.reset=function(){this.livePreviewUsed&&(this.resetLivePreview(),this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!0));this.destroyShapes();this.removeHint();this.delayedSelection=this.blockDelayedSelection=!1;this.livePreviewUsed=this.livePreviewActive=null;this.cellWasClicked=!1;this.cellCount=this.currentDy=this.currentDx=this.suspended=null;this.cloning=!1;this.cell=this.cells=this.first=this.target=this.guides=this.pBounds=this.allCells= null};mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,b,c){if(this.graph.getModel().isVertex(a)&&(a=this.graph.getView().getState(a),null!=a)){c=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(c),mxEvent.getClientY(c));var d=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);if(0!=d){b=Math.cos(-d);d=Math.sin(-d);var e=new mxPoint(a.getCenterX(),a.getCenterY());c=mxUtils.getRotatedPoint(c,b,d,e)}return!mxUtils.contains(a,c.x,c.y)}return!1}; mxGraphHandler.prototype.moveCells=function(a,b,c,d,e,f){d&&(a=this.graph.getCloneableCells(a));var g=this.graph.getModel().getParent(this.cell);!this.graph.isCellSelected(this.cell)&&this.graph.isCellSelected(g)&&(g=this.graph.getModel().getParent(g));null==e&&null!=f&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(g,a,f)&&(e=this.graph.getDefaultParent());d=d&&!this.graph.isCellLocked(e||this.graph.getDefaultParent());this.graph.getModel().beginUpdate();try{g=[];if(!d&&null!=e&& this.removeEmptyParents){for(var k=new mxDictionary,l=0;l<a.length;l++)k.put(a[l],!0);for(l=0;l<a.length;l++){var m=this.graph.model.getParent(a[l]);null==m||k.get(m)||(k.put(m,!0),g.push(m))}}a=this.graph.moveCells(a,b,c,d,e,f);b=[];for(l=0;l<g.length;l++)this.shouldRemoveParent(g[l])&&b.push(g[l]);this.graph.removeCells(b,!1)}finally{this.graph.getModel().endUpdate()}d&&this.graph.setSelectionCells(a);this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(a[0])}; mxGraphHandler.prototype.shouldRemoveParent=function(a){a=this.graph.view.getState(a);return null!=a&&(this.graph.model.isEdge(a.cell)||this.graph.model.isVertex(a.cell))&&this.graph.isCellDeletable(a.cell)&&0==this.graph.model.getChildCount(a.cell)&&this.graph.isTransparentState(a)}; mxGraphHandler.prototype.destroyShapes=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.guide&&(this.guide.destroy(),this.guide=null);null!=this.highlight&&(this.highlight.destroy(),this.highlight=null)}; mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.panHandler);null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null);null!=this.refreshHandler&&(this.graph.getModel().removeListener(this.refreshHandler),this.graph.removeListener(this.refreshHandler),this.refreshHandler=null);mxEvent.removeListener(document,"keydown",this.keyHandler);mxEvent.removeListener(document,"keyup",this.keyHandler);this.destroyShapes(); this.removeHint()}; function mxPanningHandler(a){null!=a&&(this.graph=a,this.graph.addMouseListener(this),this.forcePanningHandler=mxUtils.bind(this,function(b,c){b=c.getProperty("eventName");c=c.getProperty("event");b==mxEvent.MOUSE_DOWN&&this.isForcePanningEvent(c)&&(this.start(c),this.active=!0,this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",c)),c.consume())}),this.graph.addListener(mxEvent.FIRE_MOUSE_EVENT,this.forcePanningHandler),this.gestureHandler=mxUtils.bind(this,function(b,c){this.isPinchEnabled()&&(b= c.getProperty("event"),mxEvent.isConsumed(b)||"gesturestart"!=b.type?"gestureend"==b.type&&null!=this.initialScale&&(this.initialScale=null):(this.initialScale=this.graph.view.scale,this.active||null==this.mouseDownEvent||(this.start(this.mouseDownEvent),this.mouseDownEvent=null)),null!=this.initialScale&&this.zoomGraph(b))}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.mouseUpListener=mxUtils.bind(this,function(){this.active&&this.reset()}),mxEvent.addGestureListeners(document, null,null,this.mouseUpListener),mxEvent.addListener(document,"mouseleave",this.mouseUpListener))}mxPanningHandler.prototype=new mxEventSource;mxPanningHandler.prototype.constructor=mxPanningHandler;mxPanningHandler.prototype.graph=null;mxPanningHandler.prototype.useLeftButtonForPanning=!1;mxPanningHandler.prototype.usePopupTrigger=!0;mxPanningHandler.prototype.ignoreCell=!1;mxPanningHandler.prototype.previewEnabled=!0;mxPanningHandler.prototype.useGrid=!1; mxPanningHandler.prototype.panningEnabled=!0;mxPanningHandler.prototype.pinchEnabled=!0;mxPanningHandler.prototype.maxScale=8;mxPanningHandler.prototype.minScale=.01;mxPanningHandler.prototype.dx=null;mxPanningHandler.prototype.dy=null;mxPanningHandler.prototype.startX=0;mxPanningHandler.prototype.startY=0;mxPanningHandler.prototype.isActive=function(){return this.active||null!=this.initialScale};mxPanningHandler.prototype.isPanningEnabled=function(){return this.panningEnabled}; mxPanningHandler.prototype.setPanningEnabled=function(a){this.panningEnabled=a};mxPanningHandler.prototype.isPinchEnabled=function(){return this.pinchEnabled};mxPanningHandler.prototype.setPinchEnabled=function(a){this.pinchEnabled=a};mxPanningHandler.prototype.isPanningTrigger=function(a){var b=a.getEvent();return this.useLeftButtonForPanning&&null==a.getState()&&mxEvent.isLeftMouseButton(b)||mxEvent.isControlDown(b)&&mxEvent.isShiftDown(b)||this.usePopupTrigger&&mxEvent.isPopupTrigger(b)}; mxPanningHandler.prototype.isForcePanningEvent=function(a){return this.ignoreCell||mxEvent.isMultiTouchEvent(a.getEvent())};mxPanningHandler.prototype.mouseDown=function(a,b){this.mouseDownEvent=b;!b.isConsumed()&&this.isPanningEnabled()&&!this.active&&this.isPanningTrigger(b)&&(this.start(b),this.consumePanningTrigger(b))}; mxPanningHandler.prototype.start=function(a){this.dx0=-this.graph.container.scrollLeft;this.dy0=-this.graph.container.scrollTop;this.startX=a.getX();this.startY=a.getY();this.dy=this.dx=null;this.panningTrigger=!0};mxPanningHandler.prototype.consumePanningTrigger=function(a){a.consume()}; mxPanningHandler.prototype.mouseMove=function(a,b){this.dx=b.getX()-this.startX;this.dy=b.getY()-this.startY;this.active?(this.previewEnabled&&(this.useGrid&&(this.dx=this.graph.snap(this.dx),this.dy=this.graph.snap(this.dy)),this.graph.panGraph(this.dx+this.dx0,this.dy+this.dy0)),this.fireEvent(new mxEventObject(mxEvent.PAN,"event",b))):this.panningTrigger&&(a=this.active,this.active=Math.abs(this.dx)>this.graph.tolerance||Math.abs(this.dy)>this.graph.tolerance,!a&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START, "event",b)));(this.active||this.panningTrigger)&&b.consume()};mxPanningHandler.prototype.mouseUp=function(a,b){if(this.active){if(null!=this.dx&&null!=this.dy){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){a=this.graph.getView().scale;var c=this.graph.getView().translate;this.graph.panGraph(0,0);this.panGraph(c.x+this.dx/a,c.y+this.dy/a)}b.consume()}this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",b))}this.reset()}; mxPanningHandler.prototype.zoomGraph=function(a){var b=Math.round(this.initialScale*a.scale*100)/100;null!=this.minScale&&(b=Math.max(this.minScale,b));null!=this.maxScale&&(b=Math.min(this.maxScale,b));this.graph.view.scale!=b&&(this.graph.zoomTo(b),mxEvent.consume(a))};mxPanningHandler.prototype.reset=function(){this.panningTrigger=this.graph.isMouseDown=!1;this.mouseDownEvent=null;this.active=!1;this.dy=this.dx=null}; mxPanningHandler.prototype.panGraph=function(a,b){this.graph.getView().setTranslate(a,b)};mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.forcePanningHandler);this.graph.removeListener(this.gestureHandler);mxEvent.removeGestureListeners(document,null,null,this.mouseUpListener);mxEvent.removeListener(document,"mouseleave",this.mouseUpListener)}; function mxPopupMenuHandler(a,b){null!=a&&(this.graph=a,this.factoryMethod=b,this.graph.addMouseListener(this),this.gestureHandler=mxUtils.bind(this,function(c,d){this.inTolerance=!1}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.init())}mxPopupMenuHandler.prototype=new mxPopupMenu;mxPopupMenuHandler.prototype.constructor=mxPopupMenuHandler;mxPopupMenuHandler.prototype.graph=null;mxPopupMenuHandler.prototype.selectOnPopup=!0; mxPopupMenuHandler.prototype.clearSelectionOnBackground=!0;mxPopupMenuHandler.prototype.triggerX=null;mxPopupMenuHandler.prototype.triggerY=null;mxPopupMenuHandler.prototype.screenX=null;mxPopupMenuHandler.prototype.screenY=null;mxPopupMenuHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this);mxEvent.addGestureListeners(this.div,mxUtils.bind(this,function(a){this.graph.tooltipHandler.hide()}))}; mxPopupMenuHandler.prototype.getTriggerPoint=function(){var a=this.graph.view.scale,b=this.graph.view.translate;return new mxPoint(this.triggerX/a-b.x,this.triggerY/a-b.y)};mxPopupMenuHandler.prototype.isSelectOnPopup=function(a){return this.selectOnPopup}; mxPopupMenuHandler.prototype.mouseDown=function(a,b){this.isEnabled()&&!mxEvent.isMultiTouchEvent(b.getEvent())&&(this.hideMenu(),this.triggerX=b.getGraphX(),this.triggerY=b.getGraphY(),this.screenX=mxEvent.getMainEvent(b.getEvent()).screenX,this.screenY=mxEvent.getMainEvent(b.getEvent()).screenY,this.popupTrigger=this.isPopupTrigger(b),this.inTolerance=!0)}; mxPopupMenuHandler.prototype.mouseMove=function(a,b){this.inTolerance&&null!=this.screenX&&null!=this.screenY&&(Math.abs(mxEvent.getMainEvent(b.getEvent()).screenX-this.screenX)>this.graph.tolerance||Math.abs(mxEvent.getMainEvent(b.getEvent()).screenY-this.screenY)>this.graph.tolerance)&&(this.inTolerance=!1)}; mxPopupMenuHandler.prototype.mouseUp=function(a,b,c){a=null==c;c=null!=c?c:mxUtils.bind(this,function(e){var f=mxUtils.getScrollOrigin();this.popup(b.getX()+f.x+1,b.getY()+f.y+1,e,b.getEvent())});if(this.popupTrigger&&this.inTolerance&&null!=this.triggerX&&null!=this.triggerY){var d=this.getCellForPopupEvent(b);this.graph.isEnabled()&&this.isSelectOnPopup(b)&&null!=d&&!this.graph.isCellSelected(d)?this.graph.setSelectionCell(d):this.clearSelectionOnBackground&&null==d&&this.graph.clearSelection(); this.graph.tooltipHandler.hide();c(d);a&&b.consume()}this.inTolerance=this.popupTrigger=!1};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(a){return a.getCell()};mxPopupMenuHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.gestureHandler);mxPopupMenu.prototype.destroy.apply(this)}; function mxCellMarker(a,b,c,d){mxEventSource.call(this);null!=a&&(this.graph=a,this.validColor=null!=b?b:mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=null!=c?c:mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=null!=d?d:mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(a))}mxUtils.extend(mxCellMarker,mxEventSource);mxCellMarker.prototype.graph=null;mxCellMarker.prototype.enabled=!0;mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT;mxCellMarker.prototype.hotspotEnabled=!1; mxCellMarker.prototype.validColor=null;mxCellMarker.prototype.invalidColor=null;mxCellMarker.prototype.currentColor=null;mxCellMarker.prototype.validState=null;mxCellMarker.prototype.markedState=null;mxCellMarker.prototype.setEnabled=function(a){this.enabled=a};mxCellMarker.prototype.isEnabled=function(){return this.enabled};mxCellMarker.prototype.setHotspot=function(a){this.hotspot=a};mxCellMarker.prototype.getHotspot=function(){return this.hotspot}; mxCellMarker.prototype.setHotspotEnabled=function(a){this.hotspotEnabled=a};mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled};mxCellMarker.prototype.hasValidState=function(){return null!=this.validState};mxCellMarker.prototype.getValidState=function(){return this.validState};mxCellMarker.prototype.getMarkedState=function(){return this.markedState};mxCellMarker.prototype.reset=function(){this.validState=null;null!=this.markedState&&(this.markedState=null,this.unmark())}; mxCellMarker.prototype.process=function(a){var b=null;this.isEnabled()&&(b=this.getState(a),this.setCurrentState(b,a));return b};mxCellMarker.prototype.setCurrentState=function(a,b,c){var d=null!=a?this.isValidState(a):!1;c=null!=c?c:this.getMarkerColor(b.getEvent(),a,d);this.validState=d?a:null;if(a!=this.markedState||c!=this.currentColor)this.currentColor=c,null!=a&&null!=this.currentColor?(this.markedState=a,this.mark()):null!=this.markedState&&(this.markedState=null,this.unmark())}; mxCellMarker.prototype.markCell=function(a,b){a=this.graph.getView().getState(a);null!=a&&(this.currentColor=null!=b?b:this.validColor,this.markedState=a,this.mark())};mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor);this.highlight.highlight(this.markedState);this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))};mxCellMarker.prototype.unmark=function(){this.mark()};mxCellMarker.prototype.isValidState=function(a){return!0}; mxCellMarker.prototype.getMarkerColor=function(a,b,c){return c?this.validColor:this.invalidColor};mxCellMarker.prototype.getState=function(a){var b=this.graph.getView(),c=this.getCell(a);b=this.getStateToMark(b.getState(c));return null!=b&&this.intersects(b,a)?b:null};mxCellMarker.prototype.getCell=function(a){return a.getCell()};mxCellMarker.prototype.getStateToMark=function(a){return a}; mxCellMarker.prototype.intersects=function(a,b){return this.hotspotEnabled?mxUtils.intersectsHotspot(a,b.getGraphX(),b.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE):!0};mxCellMarker.prototype.destroy=function(){this.highlight.destroy()}; function mxSelectionCellsHandler(a){mxEventSource.call(this);this.graph=a;this.handlers=new mxDictionary;this.graph.addMouseListener(this);this.redrawHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.refresh(!1)});this.refreshHandler=mxUtils.bind(this,function(b,c){this.isEnabled()&&this.refresh(!0)});this.graph.addListener(mxEvent.EDITING_STOPPED,this.redrawHandler);this.graph.addListener(mxEvent.EDITING_STARTED,this.redrawHandler);this.graph.getSelectionModel().addListener(mxEvent.CHANGE, this.redrawHandler);this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler);this.graph.getView().addListener(mxEvent.SCALE,this.refreshHandler);this.graph.getView().addListener(mxEvent.TRANSLATE,this.refreshHandler);this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.refreshHandler);this.graph.getView().addListener(mxEvent.DOWN,this.refreshHandler);this.graph.getView().addListener(mxEvent.UP,this.refreshHandler)}mxUtils.extend(mxSelectionCellsHandler,mxEventSource); mxSelectionCellsHandler.prototype.graph=null;mxSelectionCellsHandler.prototype.enabled=!0;mxSelectionCellsHandler.prototype.refreshHandler=null;mxSelectionCellsHandler.prototype.maxHandlers=100;mxSelectionCellsHandler.prototype.handlers=null;mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled};mxSelectionCellsHandler.prototype.setEnabled=function(a){this.enabled=a};mxSelectionCellsHandler.prototype.getHandler=function(a){return this.handlers.get(a)}; mxSelectionCellsHandler.prototype.isHandled=function(a){return null!=this.getHandler(a)};mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit(function(a,b){b.reset.apply(b)})};mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){return this.graph.getSelectionCells()}; mxSelectionCellsHandler.prototype.refresh=function(a){var b=this.handlers;this.handlers=new mxDictionary;var c=mxUtils.sortCells(this.getHandledSelectionCells(),!1);if(!a&&0<this.graph.graphHandler.maxCells&&0<this.graph.getSelectionCount()){var d=b.getCount();0<d&&(a=d<=this.graph.graphHandler.maxCells!=this.graph.getSelectionCount()<=this.graph.graphHandler.maxCells)}for(d=0;d<c.length;d++){var e=this.graph.view.getState(c[d]);if(null!=e){var f=b.remove(c[d]);null!=f&&(f.state!=e?(f.destroy(),f= null):this.isHandlerActive(f)||(a&&f.refresh(),f.redraw()));null!=f&&this.handlers.put(c[d],f)}}b.visit(mxUtils.bind(this,function(g,k){this.fireEvent(new mxEventObject(mxEvent.REMOVE,"state",k.state));k.destroy()}));for(d=0;d<c.length;d++)e=this.graph.view.getState(c[d]),null!=e&&(f=this.handlers.get(c[d]),null==f?(f=this.graph.createHandler(e),this.fireEvent(new mxEventObject(mxEvent.ADD,"state",e)),this.handlers.put(c[d],f)):f.updateParentHighlight())}; mxSelectionCellsHandler.prototype.isHandlerActive=function(a){return null!=a.index};mxSelectionCellsHandler.prototype.updateHandler=function(a){var b=this.handlers.remove(a.cell);if(null!=b){var c=b.index,d=b.startX,e=b.startY;b.destroy();b=this.graph.createHandler(a);null!=b&&(this.handlers.put(a.cell,b),null!=c&&null!=d&&null!=e&&b.start(d,e,c))}}; mxSelectionCellsHandler.prototype.mouseDown=function(a,b){if(this.graph.isEnabled()&&this.isEnabled()){var c=[a,b];this.handlers.visit(function(d,e){e.mouseDown.apply(e,c)})}};mxSelectionCellsHandler.prototype.mouseMove=function(a,b){if(this.graph.isEnabled()&&this.isEnabled()){var c=[a,b];this.handlers.visit(function(d,e){e.mouseMove.apply(e,c)})}}; mxSelectionCellsHandler.prototype.mouseUp=function(a,b){if(this.graph.isEnabled()&&this.isEnabled()){var c=[a,b];this.handlers.visit(function(d,e){e.mouseUp.apply(e,c)})}}; mxSelectionCellsHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);null!=this.refreshHandler&&(this.graph.getSelectionModel().removeListener(this.redrawHandler),this.graph.getModel().removeListener(this.refreshHandler),this.graph.getView().removeListener(this.refreshHandler),this.graph.removeListener(this.redrawHandler),this.refreshHandler=this.redrawHandler=null)}; function mxConnectionHandler(a,b){mxEventSource.call(this);null!=a&&(this.graph=a,this.factoryMethod=b,this.init(),this.escapeHandler=mxUtils.bind(this,function(c,d){this.reset()}),this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}mxUtils.extend(mxConnectionHandler,mxEventSource);mxConnectionHandler.prototype.graph=null;mxConnectionHandler.prototype.factoryMethod=!0;mxConnectionHandler.prototype.moveIconFront=!1;mxConnectionHandler.prototype.moveIconBack=!1; mxConnectionHandler.prototype.connectImage=null;mxConnectionHandler.prototype.targetConnectImage=!1;mxConnectionHandler.prototype.enabled=!0;mxConnectionHandler.prototype.select=!0;mxConnectionHandler.prototype.createTarget=!1;mxConnectionHandler.prototype.marker=null;mxConnectionHandler.prototype.constraintHandler=null;mxConnectionHandler.prototype.error=null;mxConnectionHandler.prototype.waypointsEnabled=!1;mxConnectionHandler.prototype.ignoreMouseDown=!1;mxConnectionHandler.prototype.first=null; mxConnectionHandler.prototype.connectIconOffset=new mxPoint(0,mxConstants.TOOLTIP_VERTICAL_OFFSET);mxConnectionHandler.prototype.edgeState=null;mxConnectionHandler.prototype.changeHandler=null;mxConnectionHandler.prototype.drillHandler=null;mxConnectionHandler.prototype.mouseDownCounter=0;mxConnectionHandler.prototype.movePreviewAway=!1;mxConnectionHandler.prototype.outlineConnect=!1;mxConnectionHandler.prototype.livePreview=!1;mxConnectionHandler.prototype.cursor=null; mxConnectionHandler.prototype.insertBeforeSource=!1;mxConnectionHandler.prototype.isEnabled=function(){return this.enabled};mxConnectionHandler.prototype.setEnabled=function(a){this.enabled=a};mxConnectionHandler.prototype.isInsertBefore=function(a,b,c,d,e){return this.insertBeforeSource&&b!=c&&this.graph.model.getParent(a)==this.graph.model.getParent(b)};mxConnectionHandler.prototype.isCreateTarget=function(a){return this.createTarget}; mxConnectionHandler.prototype.setCreateTarget=function(a){this.createTarget=a};mxConnectionHandler.prototype.createShape=function(){var a=this.livePreview&&null!=this.edgeState?this.graph.cellRenderer.createShape(this.edgeState):new mxPolyline([],mxConstants.INVALID_COLOR);a.dialect=mxConstants.DIALECT_SVG;a.scale=this.graph.view.scale;a.svgStrokeTolerance=0;a.pointerEvents=!1;a.isDashed=!0;a.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(a.node,this.graph,null);return a}; mxConnectionHandler.prototype.init=function(){this.graph.addMouseListener(this);this.marker=this.createMarker();this.constraintHandler=new mxConstraintHandler(this.graph);this.changeHandler=mxUtils.bind(this,function(a){null!=this.iconState&&(this.iconState=this.graph.getView().getState(this.iconState.cell));null!=this.iconState?(this.redrawIcons(this.icons,this.iconState),this.constraintHandler.reset()):null!=this.previous&&null==this.graph.view.getState(this.previous.cell)&&this.reset()});this.graph.getModel().addListener(mxEvent.CHANGE, this.changeHandler);this.graph.getView().addListener(mxEvent.SCALE,this.changeHandler);this.graph.getView().addListener(mxEvent.TRANSLATE,this.changeHandler);this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.changeHandler);this.drillHandler=mxUtils.bind(this,function(a){this.reset()});this.graph.addListener(mxEvent.START_EDITING,this.drillHandler);this.graph.getView().addListener(mxEvent.DOWN,this.drillHandler);this.graph.getView().addListener(mxEvent.UP,this.drillHandler)}; mxConnectionHandler.prototype.isConnectableCell=function(a){return!0}; mxConnectionHandler.prototype.createMarker=function(){var a=new mxCellMarker(this.graph);a.hotspotEnabled=!0;a.getCell=mxUtils.bind(this,function(b){var c=mxCellMarker.prototype.getCell.apply(a,arguments);this.error=null;null==c&&null!=this.currentPoint&&(c=this.graph.getCellAt(this.currentPoint.x,this.currentPoint.y));if(null!=c&&!this.graph.isCellConnectable(c)){var d=this.graph.getModel().getParent(c);this.graph.getModel().isVertex(d)&&this.graph.isCellConnectable(d)&&(c=d)}if(this.graph.isSwimlane(c)&& null!=this.currentPoint&&this.graph.hitsSwimlaneContent(c,this.currentPoint.x,this.currentPoint.y)||!this.isConnectableCell(c))c=null;null!=c?this.isConnecting()?null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,c),null!=this.error&&0==this.error.length&&(c=null,this.isCreateTarget(b.getEvent())&&(this.error=null))):this.isValidSource(c,b)||(c=null):!this.isConnecting()||this.isCreateTarget(b.getEvent())||this.graph.allowDanglingEdges||(this.error="");return c});a.isValidState= mxUtils.bind(this,function(b){return this.isConnecting()?null==this.error:mxCellMarker.prototype.isValidState.apply(a,arguments)});a.getMarkerColor=mxUtils.bind(this,function(b,c,d){return null==this.connectImage||this.isConnecting()?mxCellMarker.prototype.getMarkerColor.apply(a,arguments):null});a.intersects=mxUtils.bind(this,function(b,c){return null!=this.connectImage||this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(a,arguments)});return a}; mxConnectionHandler.prototype.start=function(a,b,c,d){this.previous=a;this.first=new mxPoint(b,c);this.edgeState=null!=d?d:this.createEdgeState(null);this.marker.currentColor=this.marker.validColor;this.marker.markedState=a;this.marker.mark();this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous))};mxConnectionHandler.prototype.isConnecting=function(){return null!=this.first&&null!=this.shape};mxConnectionHandler.prototype.isValidSource=function(a,b){return this.graph.isValidSource(a)}; mxConnectionHandler.prototype.isValidTarget=function(a){return!0};mxConnectionHandler.prototype.validateConnection=function(a,b){return this.isValidTarget(b)?this.graph.getEdgeValidationError(null,a,b):""};mxConnectionHandler.prototype.getConnectImage=function(a){return this.connectImage};mxConnectionHandler.prototype.isMoveIconToFrontForState=function(a){return null!=a.text&&a.text.node.parentNode==this.graph.container?!0:this.moveIconFront}; mxConnectionHandler.prototype.createIcons=function(a){var b=this.getConnectImage(a);if(null!=b&&null!=a){this.iconState=a;var c=[],d=new mxRectangle(0,0,b.width,b.height),e=new mxImageShape(d,b.src,null,null,0);e.preserveImageAspect=!1;this.isMoveIconToFrontForState(a)?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),this.moveIconBack&&null!=e.node.previousSibling&&e.node.parentNode.insertBefore(e.node, e.node.parentNode.firstChild));e.node.style.cursor=mxConstants.CURSOR_CONNECT;var f=mxUtils.bind(this,function(){return null!=this.currentState?this.currentState:a});b=mxUtils.bind(this,function(g){mxEvent.isConsumed(g)||(this.icon=e,this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(g,f())))});mxEvent.redirectMouseEvents(e.node,this.graph,f,b);c.push(e);this.redrawIcons(c,this.iconState);return c}return null}; mxConnectionHandler.prototype.redrawIcons=function(a,b){null!=a&&null!=a[0]&&null!=b&&(b=this.getIconPosition(a[0],b),a[0].bounds.x=b.x,a[0].bounds.y=b.y,a[0].redraw())}; mxConnectionHandler.prototype.getIconPosition=function(a,b){var c=this.graph.getView().scale,d=b.getCenterX(),e=b.getCenterY();if(this.graph.isSwimlane(b.cell)){var f=this.graph.getStartSize(b.cell);d=0!=f.width?b.x+f.width*c/2:d;e=0!=f.height?b.y+f.height*c/2:e;f=mxUtils.toRadians(mxUtils.getValue(b.style,mxConstants.STYLE_ROTATION)||0);0!=f&&(c=Math.cos(f),f=Math.sin(f),b=new mxPoint(b.getCenterX(),b.getCenterY()),e=mxUtils.getRotatedPoint(new mxPoint(d,e),c,f,b),d=e.x,e=e.y)}return new mxPoint(d- a.bounds.width/2,e-a.bounds.height/2)};mxConnectionHandler.prototype.destroyIcons=function(){if(null!=this.icons){for(var a=0;a<this.icons.length;a++)this.icons[a].destroy();this.iconState=this.selectedIcon=this.icon=this.icons=null}};mxConnectionHandler.prototype.isStartEvent=function(a){return null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint||null!=this.previous&&null==this.error&&(null==this.icons||null!=this.icons&&null!=this.icon)}; mxConnectionHandler.prototype.mouseDown=function(a,b){this.mouseDownCounter++;this.isEnabled()&&this.graph.isEnabled()&&!b.isConsumed()&&!this.isConnecting()&&this.isStartEvent(b)&&(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(this.sourceConstraint=this.constraintHandler.currentConstraint,this.previous=this.constraintHandler.currentFocus,this.first=this.constraintHandler.currentPoint.clone()):this.first=new mxPoint(b.getGraphX(), b.getGraphY()),this.edgeState=this.createEdgeState(b),this.mouseDownCounter=1,this.waypointsEnabled&&null==this.shape&&(this.waypoints=null,this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState)),null==this.previous&&null!=this.edgeState&&(a=this.graph.getPointForEvent(b.getEvent()),this.edgeState.cell.geometry.setTerminalPoint(a,!0)),this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)),b.consume());this.selectedIcon=this.icon;this.icon=null}; mxConnectionHandler.prototype.isImmediateConnectSource=function(a){return!this.graph.isCellMovable(a.cell)};mxConnectionHandler.prototype.createEdgeState=function(a){return null}; mxConnectionHandler.prototype.isOutlineConnectEvent=function(a){if(mxEvent.isShiftDown(a.getEvent())&&mxEvent.isAltDown(a.getEvent()))return!1;var b=mxUtils.getOffset(this.graph.container),c=a.getEvent(),d=mxEvent.getClientX(c);c=mxEvent.getClientY(c);var e=document.documentElement,f=this.currentPoint.x-this.graph.container.scrollLeft+b.x-((window.pageXOffset||e.scrollLeft)-(e.clientLeft||0));b=this.currentPoint.y-this.graph.container.scrollTop+b.y-((window.pageYOffset||e.scrollTop)-(e.clientTop|| 0));return this.outlineConnect&&(mxEvent.isShiftDown(a.getEvent())&&!mxEvent.isAltDown(a.getEvent())||a.isSource(this.marker.highlight.shape)||!mxEvent.isShiftDown(a.getEvent())&&mxEvent.isAltDown(a.getEvent())&&null!=a.getState()||this.marker.highlight.isHighlightAt(d,c)||(f!=d||b!=c)&&null==a.getState()&&this.marker.highlight.isHighlightAt(f,b))}; mxConnectionHandler.prototype.updateCurrentState=function(a,b){this.constraintHandler.update(a,null==this.first,!1,null==this.first||a.isSource(this.marker.highlight.shape)?null:b);if(null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint)null!=this.marker.highlight&&null!=this.marker.highlight.state&&this.marker.highlight.state.cell==this.constraintHandler.currentFocus.cell?"transparent"!=this.marker.highlight.shape.stroke&&(this.marker.highlight.shape.stroke="transparent", this.marker.highlight.repaint()):this.marker.markCell(this.constraintHandler.currentFocus.cell,"transparent"),null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,this.constraintHandler.currentFocus.cell),null==this.error&&(this.currentState=this.constraintHandler.currentFocus),(null!=this.error||null!=this.currentState&&!this.isCellEnabled(this.currentState.cell))&&this.constraintHandler.reset());else{this.graph.isIgnoreTerminalEvent(a.getEvent())?(this.marker.reset(),this.currentState= null):(this.marker.process(a),this.currentState=this.marker.getValidState());null==this.currentState||this.isCellEnabled(this.currentState.cell)||(this.constraintHandler.reset(),this.marker.reset(),this.currentState=null);var c=this.isOutlineConnectEvent(a);null!=this.currentState&&c&&(a.isSource(this.marker.highlight.shape)&&(b=new mxPoint(a.getGraphX(),a.getGraphY())),c=this.graph.getOutlineConstraint(b,this.currentState,a),this.constraintHandler.setFocus(a,this.currentState,!1),this.constraintHandler.currentConstraint= c,this.constraintHandler.currentPoint=b);this.outlineConnect&&null!=this.marker.highlight&&null!=this.marker.highlight.shape&&(b=this.graph.view.scale,null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(this.marker.highlight.shape.stroke=mxConstants.OUTLINE_HIGHLIGHT_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/b/b,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.graph.isCellConnectable(a.getCell())&& this.marker.getValidState()!=a.getState()?(this.marker.highlight.shape.stroke="transparent",this.currentState=null):this.marker.highlight.shape.stroke=mxConstants.DEFAULT_VALID_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/b/b,this.marker.highlight.repaint()))}};mxConnectionHandler.prototype.isCellEnabled=function(a){return!0}; mxConnectionHandler.prototype.convertWaypoint=function(a){var b=this.graph.getView().getScale(),c=this.graph.getView().getTranslate();a.x=a.x/b-c.x;a.y=a.y/b-c.y}; mxConnectionHandler.prototype.snapToPreview=function(a,b){if(!mxEvent.isAltDown(a.getEvent())&&null!=this.previous){var c=this.graph.gridSize*this.graph.view.scale/2,d=null!=this.sourceConstraint?this.first:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());Math.abs(d.x-a.getGraphX())<c&&(b.x=d.x);Math.abs(d.y-a.getGraphY())<c&&(b.y=d.y)}}; mxConnectionHandler.prototype.mouseMove=function(a,b){if(b.isConsumed()||!this.ignoreMouseDown&&null==this.first&&this.graph.isMouseDown)this.constraintHandler.reset();else{this.isEnabled()||null==this.currentState||(this.destroyIcons(),this.currentState=null);a=this.graph.getView();var c=a.scale,d=a.translate;a=new mxPoint(b.getGraphX(),b.getGraphY());this.error=null;this.graph.isGridEnabledEvent(b.getEvent())&&(a=new mxPoint((this.graph.snap(a.x/c-d.x)+d.x)*c,(this.graph.snap(a.y/c-d.y)+d.y)*c)); this.snapToPreview(b,a);this.currentPoint=a;(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&(null!=this.shape||null==this.first||Math.abs(b.getGraphX()-this.first.x)>this.graph.tolerance||Math.abs(b.getGraphY()-this.first.y)>this.graph.tolerance)&&this.updateCurrentState(b,a);if(null!=this.first){var e=null;c=a;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(e=this.constraintHandler.currentConstraint, c=this.constraintHandler.currentPoint.clone()):null!=this.previous&&mxEvent.isShiftDown(b.getEvent())&&!this.graph.isIgnoreTerminalEvent(b.getEvent())&&(d=new mxPoint(this.previous.getCenterX(),this.previous.getCenterY()),null!=this.sourceConstraint&&(d=this.first),Math.abs(d.x-a.x)<Math.abs(d.y-a.y)?a.x=d.x:a.y=d.y);d=this.first;if(null!=this.selectedIcon){var f=this.selectedIcon.bounds.width,g=this.selectedIcon.bounds.height;null!=this.currentState&&this.targetConnectImage?(f=this.getIconPosition(this.selectedIcon, this.currentState),this.selectedIcon.bounds.x=f.x,this.selectedIcon.bounds.y=f.y):(f=new mxRectangle(b.getGraphX()+this.connectIconOffset.x,b.getGraphY()+this.connectIconOffset.y,f,g),this.selectedIcon.bounds=f);this.selectedIcon.redraw()}null!=this.edgeState?(this.updateEdgeState(c,e),c=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],d=this.edgeState.absolutePoints[0]):(null!=this.currentState&&null==this.constraintHandler.currentConstraint&&(f=this.getTargetPerimeterPoint(this.currentState, b),null!=f&&(c=f)),null==this.sourceConstraint&&null!=this.previous&&(f=this.getSourcePerimeterPoint(this.previous,null!=this.waypoints&&0<this.waypoints.length?this.waypoints[0]:c,b),null!=f&&(d=f)));if(null==this.currentState&&this.movePreviewAway){f=d;null!=this.edgeState&&2<=this.edgeState.absolutePoints.length&&(e=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2],null!=e&&(f=e));e=c.x-f.x;f=c.y-f.y;g=Math.sqrt(e*e+f*f);if(0==g)return;this.originalPoint=c.clone();c.x-=4*e/ g;c.y-=4*f/g}else this.originalPoint=null;null==this.shape&&(e=Math.abs(b.getGraphX()-this.first.x),f=Math.abs(b.getGraphY()-this.first.y),e>this.graph.tolerance||f>this.graph.tolerance)&&(this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState),this.updateCurrentState(b,a));null!=this.shape&&(null!=this.edgeState?this.shape.points=this.edgeState.absolutePoints:(a=[d],null!=this.waypoints&&(a=a.concat(this.waypoints)),a.push(c),this.shape.points=a),this.drawPreview()); null!=this.cursor&&(this.graph.container.style.cursor=this.cursor);mxEvent.consume(b.getEvent());b.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(),null!=this.currentState&&null==this.error&&null==this.constraintHandler.currentConstraint&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),b.consume())),this.previous=this.currentState):this.previous!= this.currentState||null==this.currentState||null!=this.icons||this.graph.isMouseDown||b.consume():this.constraintHandler.reset();if(!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){a=!1;c=b.getSource();for(d=0;d<this.icons.length&&!a;d++)a=c==this.icons[d].node||c.parentNode==this.icons[d].node;a||this.updateIcons(this.currentState,this.icons,b)}}}; mxConnectionHandler.prototype.updateEdgeState=function(a,b){null!=this.sourceConstraint&&null!=this.sourceConstraint.point&&(this.edgeState.style[mxConstants.STYLE_EXIT_X]=this.sourceConstraint.point.x,this.edgeState.style[mxConstants.STYLE_EXIT_Y]=this.sourceConstraint.point.y);null!=b&&null!=b.point?(this.edgeState.style[mxConstants.STYLE_ENTRY_X]=b.point.x,this.edgeState.style[mxConstants.STYLE_ENTRY_Y]=b.point.y):(delete this.edgeState.style[mxConstants.STYLE_ENTRY_X],delete this.edgeState.style[mxConstants.STYLE_ENTRY_Y]); this.edgeState.absolutePoints=[null,null!=this.currentState?null:a];this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,!0,this.sourceConstraint);null!=this.currentState&&(null==b&&(b=this.graph.getConnectionConstraint(this.edgeState,this.previous,!1)),this.edgeState.setAbsoluteTerminalPoint(null,!1),this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,!1,b));a=null;if(null!=this.waypoints)for(a=[],b=0;b<this.waypoints.length;b++){var c=this.waypoints[b].clone(); this.convertWaypoint(c);a[b]=c}this.graph.view.updatePoints(this.edgeState,a,this.previous,this.currentState);this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState)}; mxConnectionHandler.prototype.getTargetPerimeterPoint=function(a,b){b=null;var c=a.view,d=c.getPerimeterFunction(a);if(null!=d){var e=null!=this.waypoints&&0<this.waypoints.length?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());a=d(c.getPerimeterBounds(a),this.edgeState,e,!1);null!=a&&(b=a)}else b=new mxPoint(a.getCenterX(),a.getCenterY());return b}; mxConnectionHandler.prototype.getSourcePerimeterPoint=function(a,b,c){c=null;var d=a.view,e=d.getPerimeterFunction(a),f=new mxPoint(a.getCenterX(),a.getCenterY());if(null!=e){var g=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0),k=Math.PI/180*-g;0!=g&&(b=mxUtils.getRotatedPoint(new mxPoint(b.x,b.y),Math.cos(k),Math.sin(k),f));a=e(d.getPerimeterBounds(a),a,b,!1);null!=a&&(0!=g&&(a=mxUtils.getRotatedPoint(new mxPoint(a.x,a.y),Math.cos(-k),Math.sin(-k),f)),c=a)}else c=f;return c}; mxConnectionHandler.prototype.updateIcons=function(a,b,c){};mxConnectionHandler.prototype.isStopEvent=function(a){return null!=a.getState()}; mxConnectionHandler.prototype.addWaypointForEvent=function(a){var b=mxUtils.convertPoint(this.graph.container,a.getX(),a.getY()),c=Math.abs(b.x-this.first.x);b=Math.abs(b.y-this.first.y);if(null!=this.waypoints||1<this.mouseDownCounter&&(c>this.graph.tolerance||b>this.graph.tolerance))null==this.waypoints&&(this.waypoints=[]),c=this.graph.view.scale,b=new mxPoint(this.graph.snap(a.getGraphX()/c)*c,this.graph.snap(a.getGraphY()/c)*c),this.waypoints.push(b)}; mxConnectionHandler.prototype.checkConstraints=function(a,b){return null==a||null==b||null==a.point||null==b.point||!a.point.equals(b.point)||a.dx!=b.dx||a.dy!=b.dy||a.perimeter!=b.perimeter}; mxConnectionHandler.prototype.mouseUp=function(a,b){if(!b.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(b)){this.addWaypointForEvent(b);b.consume();return}a=this.sourceConstraint;var c=this.constraintHandler.currentConstraint,d=null!=this.previous?this.previous.cell:null,e=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(e=this.constraintHandler.currentFocus.cell);null==e&&null!=this.currentState&&(e=this.currentState.cell); null!=this.error||null!=d&&null!=e&&d==e&&!this.checkConstraints(a,c)?(null!=this.previous&&null!=this.marker.validState&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,b.getEvent()),null!=this.error&&0<this.error.length&&this.graph.validationAlert(this.error)):this.connect(d,e,b.getEvent(),b.getCell());this.destroyIcons();b.consume()}null!=this.first&&this.reset()}; mxConnectionHandler.prototype.reset=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.cursor&&null!=this.graph.container&&(this.graph.container.style.cursor="");this.destroyIcons();this.marker.reset();this.constraintHandler.reset();this.sourceConstraint=this.error=this.previous=this.edgeState=this.currentPoint=this.originalPoint=null;this.mouseDownCounter=0;this.first=null;this.fireEvent(new mxEventObject(mxEvent.RESET))}; mxConnectionHandler.prototype.drawPreview=function(){this.updatePreview(null==this.error);null!=this.edgeState&&(this.edgeState.shape=this.shape,this.graph.cellRenderer.postConfigureShape(this.edgeState),this.edgeState.shape=null);this.shape.redraw()};mxConnectionHandler.prototype.updatePreview=function(a){this.shape.strokewidth=this.getEdgeWidth(a);this.shape.stroke=this.getEdgeColor(a)};mxConnectionHandler.prototype.getEdgeColor=function(a){return a?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR}; mxConnectionHandler.prototype.getEdgeWidth=function(a){return a?3:1}; mxConnectionHandler.prototype.connect=function(a,b,c,d){if(null!=b||this.isCreateTarget(c)||this.graph.allowDanglingEdges){var e=this.graph.getModel(),f=!1,g=null;e.beginUpdate();try{if(null!=a&&null==b&&!this.graph.isIgnoreTerminalEvent(c)&&this.isCreateTarget(c)&&(b=this.createTargetVertex(c,a),null!=b)){d=this.graph.getDropTarget([b],c,d);f=!0;if(null!=d&&this.graph.getModel().isEdge(d))d=this.graph.getDefaultParent();else{var k=this.graph.getView().getState(d);if(null!=k){var l=e.getGeometry(b); l.x-=k.origin.x;l.y-=k.origin.y}}this.graph.addCell(b,d)}var m=this.graph.getDefaultParent(),n=this.graph.getReferenceTerminal(a),p=this.graph.getReferenceTerminal(b),q=m;null!=n&&null!=p?q=e.getNearestCommonAncestor(n,p):null!=n&&(q=e.getParent(n));null==q||e.isEdge(q)||q==e.getRoot()||(m=q);p=n=null;null!=this.edgeState&&(n=this.edgeState.cell.value,p=this.edgeState.cell.style);g=this.insertEdge(m,null,n,a,b,p);if(null!=g){this.graph.setConnectionConstraint(g,a,!0,this.sourceConstraint);this.graph.setConnectionConstraint(g, b,!1,this.constraintHandler.currentConstraint);null!=this.edgeState&&e.setGeometry(g,this.edgeState.cell.geometry);if(this.isInsertBefore(g,a,b,c,d)&&(null==this.constraintHandler.currentConstraint||this.constraintHandler.currentConstraint.perimeter)){for(l=a;null!=l.parent&&null!=l.geometry&&l.geometry.relative&&l.parent!=g.parent;)l=this.graph.model.getParent(l);null!=l&&null!=l.parent&&l.parent==g.parent&&e.add(m,g,l.parent.getIndex(l))}var r=e.getGeometry(g);null==r&&(r=new mxGeometry,r.relative= !0,e.setGeometry(g,r));if(null!=this.waypoints&&0<this.waypoints.length){var t=this.graph.view.scale,u=this.graph.view.translate;r.points=[];for(a=0;a<this.waypoints.length;a++){var v=this.waypoints[a];r.points.push(new mxPoint(v.x/t-u.x,v.y/t-u.y))}}if(null==b){var y=this.graph.view.translate;t=this.graph.view.scale;v=null!=this.originalPoint?new mxPoint(this.originalPoint.x/t-y.x,this.originalPoint.y/t-y.y):new mxPoint(this.currentPoint.x/t-y.x,this.currentPoint.y/t-y.y);v.x-=this.graph.panDx/this.graph.view.scale; v.y-=this.graph.panDy/this.graph.view.scale;k=this.graph.getView().getState(e.getParent(g));null!=k&&(v.x-=k.origin.x,v.y-=k.origin.y);r.setTerminalPoint(v,!1)}this.fireEvent(new mxEventObject(mxEvent.CONNECT,"cell",g,"terminal",b,"event",c,"target",d,"terminalInserted",f))}}catch(A){mxLog.show(),mxLog.debug(A.message)}finally{e.endUpdate()}this.select&&this.selectCells(g,f?b:null)}};mxConnectionHandler.prototype.selectCells=function(a,b){this.graph.setSelectionCell(a)}; mxConnectionHandler.prototype.insertEdge=function(a,b,c,d,e,f){if(null==this.factoryMethod)return this.graph.insertEdge(a,b,c,d,e,f);b=this.createEdge(c,d,e,f);return this.graph.addEdge(b,a,d,e)}; mxConnectionHandler.prototype.createTargetVertex=function(a,b){for(a=this.graph.getCellGeometry(b);null!=a&&a.relative;)b=this.graph.getModel().getParent(b),a=this.graph.getCellGeometry(b);var c=this.graph.cloneCell(b);a=this.graph.getModel().getGeometry(c);if(null!=a){var d=this.graph.view.translate,e=this.graph.view.scale,f=new mxPoint(this.currentPoint.x/e-d.x,this.currentPoint.y/e-d.y);a.x=Math.round(f.x-a.width/2-this.graph.panDx/e);a.y=Math.round(f.y-a.height/2-this.graph.panDy/e);f=this.getAlignmentTolerance(); if(0<f){var g=this.graph.view.getState(b);null!=g&&(b=g.x/e-d.x,d=g.y/e-d.y,Math.abs(b-a.x)<=f&&(a.x=Math.round(b)),Math.abs(d-a.y)<=f&&(a.y=Math.round(d)))}}return c};mxConnectionHandler.prototype.getAlignmentTolerance=function(a){return this.graph.isGridEnabled()?this.graph.gridSize/2:this.graph.tolerance}; mxConnectionHandler.prototype.createEdge=function(a,b,c,d){var e=null;null!=this.factoryMethod&&(e=this.factoryMethod(b,c,d));null==e&&(e=new mxCell(a||""),e.setEdge(!0),e.setStyle(d),a=new mxGeometry,a.relative=!0,e.setGeometry(a));return e}; mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.marker&&(this.marker.destroy(),this.marker=null);null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null);null!=this.drillHandler&&(this.graph.removeListener(this.drillHandler), this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null);null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null)}; function mxConstraintHandler(a){this.graph=a;this.resetHandler=mxUtils.bind(this,function(b,c){null!=this.currentFocus&&null==this.graph.view.getState(this.currentFocus.cell)?this.reset():this.redraw()});this.graph.model.addListener(mxEvent.CHANGE,this.resetHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.resetHandler);this.graph.view.addListener(mxEvent.TRANSLATE,this.resetHandler);this.graph.view.addListener(mxEvent.SCALE,this.resetHandler);this.graph.addListener(mxEvent.ROOT, this.resetHandler)}mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5);mxConstraintHandler.prototype.graph=null;mxConstraintHandler.prototype.enabled=!0;mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR;mxConstraintHandler.prototype.isEnabled=function(){return this.enabled};mxConstraintHandler.prototype.setEnabled=function(a){this.enabled=a}; mxConstraintHandler.prototype.reset=function(){if(null!=this.focusIcons){for(var a=0;a<this.focusIcons.length;a++)this.focusIcons[a].destroy();this.focusIcons=null}null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null);this.focusPoints=this.currentFocus=this.currentPoint=this.currentFocusArea=this.currentConstraint=null};mxConstraintHandler.prototype.getTolerance=function(a){return this.graph.getTolerance()}; mxConstraintHandler.prototype.getImageForConstraint=function(a,b,c){return this.pointImage};mxConstraintHandler.prototype.isEventIgnored=function(a,b){return!1};mxConstraintHandler.prototype.isStateIgnored=function(a,b){return!1};mxConstraintHandler.prototype.destroyIcons=function(){if(null!=this.focusIcons){for(var a=0;a<this.focusIcons.length;a++)this.focusIcons[a].destroy();this.focusPoints=this.focusIcons=null}}; mxConstraintHandler.prototype.destroyFocusHighlight=function(){null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null)};mxConstraintHandler.prototype.isKeepFocusEvent=function(a){return mxEvent.isShiftDown(a.getEvent())&&!mxEvent.isAltDown(a.getEvent())}; mxConstraintHandler.prototype.getCellForEvent=function(a,b){var c=a.getCell();null!=c||null==b||a.getGraphX()==b.x&&a.getGraphY()==b.y||(c=this.graph.getCellAt(b.x,b.y));null==c||this.graph.isCellConnectable(c)||(a=this.graph.getModel().getParent(c),this.graph.getModel().isVertex(a)&&this.graph.isCellConnectable(a)&&(c=a));return this.graph.isCellLocked(c)?null:c}; mxConstraintHandler.prototype.update=function(a,b,c,d){if(this.isEnabled()&&!this.isEventIgnored(a)){null==this.mouseleaveHandler&&null!=this.graph.container&&(this.mouseleaveHandler=mxUtils.bind(this,function(){this.reset()}),mxEvent.addListener(this.graph.container,"mouseleave",this.resetHandler));var e=this.getTolerance(a),f=null!=d?d.x:a.getGraphX(),g=null!=d?d.y:a.getGraphY();f=new mxRectangle(f-e,g-e,2*e,2*e);e=new mxRectangle(a.getGraphX()-e,a.getGraphY()-e,2*e,2*e);var k=this.graph.view.getState(this.getCellForEvent(a, d));this.isKeepFocusEvent(a)||null!=this.currentFocusArea&&null!=this.currentFocus&&null==k&&this.graph.getModel().isVertex(this.currentFocus.cell)&&mxUtils.intersects(this.currentFocusArea,e)||k==this.currentFocus||(this.currentFocus=this.currentFocusArea=null,this.setFocus(a,k,b));a=this.currentPoint=this.currentConstraint=null;if(null!=this.focusIcons&&null!=this.constraints&&(null==k||this.currentFocus==k)){g=e.getCenterX();for(var l=e.getCenterY(),m=0;m<this.focusIcons.length;m++){var n=g-this.focusIcons[m].bounds.getCenterX(), p=l-this.focusIcons[m].bounds.getCenterY();n=n*n+p*p;if((this.intersects(this.focusIcons[m],e,b,c)||null!=d&&this.intersects(this.focusIcons[m],f,b,c))&&(null==a||n<a)){this.currentConstraint=this.constraints[m];this.currentPoint=this.focusPoints[m];a=n;n=this.focusIcons[m].bounds.clone();n.grow(mxConstants.HIGHLIGHT_SIZE+1);--n.width;--n.height;if(null==this.focusHighlight){p=this.createHighlightShape();p.dialect=mxConstants.DIALECT_SVG;p.pointerEvents=!1;p.init(this.graph.getView().getOverlayPane()); this.focusHighlight=p;var q=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:k});mxEvent.redirectMouseEvents(p.node,this.graph,q)}this.focusHighlight.bounds=n;this.focusHighlight.redraw()}}}null==this.currentConstraint&&this.destroyFocusHighlight()}else this.currentPoint=this.currentFocus=this.currentConstraint=null}; mxConstraintHandler.prototype.redraw=function(){if(null!=this.currentFocus&&null!=this.constraints&&null!=this.focusIcons){var a=this.graph.view.getState(this.currentFocus.cell);if(null!=a){this.currentFocus=a;this.currentFocusArea=new mxRectangle(a.x,a.y,a.width,a.height);for(var b=0;b<this.constraints.length;b++)if(null!=this.focusIcons[b]){var c=this.graph.getConnectionPoint(a,this.constraints[b]),d=this.getImageForConstraint(a,this.constraints[b],c);d=new mxRectangle(Math.round(c.x-d.width/2), Math.round(c.y-d.height/2),d.width,d.height);this.focusIcons[b].bounds=d;this.focusIcons[b].redraw();this.currentFocusArea.add(this.focusIcons[b].bounds);this.focusPoints[b]=c}}}}; mxConstraintHandler.prototype.setFocus=function(a,b,c){this.constraints=null!=b&&!this.isStateIgnored(b,c)&&this.graph.isCellConnectable(b.cell)?this.isEnabled()?this.graph.getAllConnectionConstraints(b,c)||[]:[]:null;if(null!=this.constraints){this.currentFocus=b;this.currentFocusArea=new mxRectangle(b.x,b.y,b.width,b.height);if(null!=this.focusIcons){for(c=0;c<this.focusIcons.length;c++)this.focusIcons[c].destroy();this.focusPoints=this.focusIcons=null}this.focusPoints=[];this.focusIcons=[];for(c= 0;c<this.constraints.length;c++){var d=this.graph.getConnectionPoint(b,this.constraints[c]),e=this.getImageForConstraint(b,this.constraints[c],d),f=e.src;e=new mxRectangle(Math.round(d.x-e.width/2),Math.round(d.y-e.height/2),e.width,e.height);f=new mxImageShape(e,f);f.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;f.preserveImageAspect=!1;f.init(this.graph.getView().getDecoratorPane());null!=f.node.previousSibling&&f.node.parentNode.insertBefore(f.node, f.node.parentNode.firstChild);e=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:b});f.redraw();mxEvent.redirectMouseEvents(f.node,this.graph,e);this.currentFocusArea.add(f.bounds);this.focusIcons.push(f);this.focusPoints.push(d)}this.currentFocusArea.grow(this.getTolerance(a))}else this.destroyIcons(),this.destroyFocusHighlight()}; mxConstraintHandler.prototype.createHighlightShape=function(){var a=new mxRectangleShape(null,this.highlightColor,this.highlightColor,mxConstants.HIGHLIGHT_STROKEWIDTH);a.opacity=mxConstants.HIGHLIGHT_OPACITY;return a};mxConstraintHandler.prototype.intersects=function(a,b,c,d){return mxUtils.intersects(a.bounds,b)}; mxConstraintHandler.prototype.destroy=function(){this.reset();null!=this.resetHandler&&(this.graph.model.removeListener(this.resetHandler),this.graph.view.removeListener(this.resetHandler),this.graph.removeListener(this.resetHandler),this.resetHandler=null);null!=this.mouseleaveHandler&&null!=this.graph.container&&(mxEvent.removeListener(this.graph.container,"mouseleave",this.mouseleaveHandler),this.mouseleaveHandler=null)}; function mxRubberband(a){null!=a&&(this.graph=a,this.graph.addMouseListener(this),this.forceRubberbandHandler=mxUtils.bind(this,function(b,c){b=c.getProperty("eventName");c=c.getProperty("event");if(b==mxEvent.MOUSE_DOWN&&this.isForceRubberbandEvent(c)){b=mxUtils.getOffset(this.graph.container);var d=mxUtils.getScrollOrigin(this.graph.container);d.x-=b.x;d.y-=b.y;this.start(c.getX()+d.x,c.getY()+d.y);c.consume(!1)}}),this.graph.addListener(mxEvent.FIRE_MOUSE_EVENT,this.forceRubberbandHandler),this.panHandler= mxUtils.bind(this,function(){this.repaint()}),this.graph.addListener(mxEvent.PAN,this.panHandler),this.gestureHandler=mxUtils.bind(this,function(b,c){null!=this.first&&this.reset()}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler))}mxUtils.extend(mxRubberband,mxEventSource);mxRubberband.prototype.defaultOpacity=20;mxRubberband.prototype.enabled=!0;mxRubberband.prototype.div=null;mxRubberband.prototype.sharedDiv=null;mxRubberband.prototype.currentX=0;mxRubberband.prototype.currentY=0; mxRubberband.prototype.fadeOut=!1;mxRubberband.prototype.isEnabled=function(){return this.enabled};mxRubberband.prototype.setEnabled=function(a){this.enabled=a};mxRubberband.prototype.isForceRubberbandEvent=function(a){return mxEvent.isAltDown(a.getEvent())&&!mxEvent.isShiftDown(a.getEvent())}; mxRubberband.prototype.mouseDown=function(a,b){if(!b.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&(null==b.getState()||this.graph.isCellLocked(b.getCell()))&&!mxEvent.isMultiTouchEvent(b.getEvent())){a=mxUtils.getOffset(this.graph.container);var c=mxUtils.getScrollOrigin(this.graph.container);c.x-=a.x;c.y-=a.y;this.start(b.getX()+c.x,b.getY()+c.y);b.consume(!1)}}; mxRubberband.prototype.start=function(a,b){function c(e){e=new mxMouseEvent(e);var f=mxUtils.convertPoint(d,e.getX(),e.getY());e.graphX=f.x;e.graphY=f.y;return e}this.first=new mxPoint(a,b);var d=this.graph.container;this.dragHandler=mxUtils.bind(this,function(e){this.mouseMove(this.graph,c(e))});this.dropHandler=mxUtils.bind(this,function(e){this.mouseUp(this.graph,c(e))});mxClient.IS_FF&&mxEvent.addGestureListeners(document,null,this.dragHandler,this.dropHandler)}; mxRubberband.prototype.mouseMove=function(a,b){if(!b.isConsumed()&&null!=this.first){var c=mxUtils.getScrollOrigin(this.graph.container);a=mxUtils.getOffset(this.graph.container);c.x-=a.x;c.y-=a.y;a=b.getX()+c.x;c=b.getY()+c.y;var d=this.first.x-a,e=this.first.y-c,f=this.graph.tolerance;if(null!=this.div||Math.abs(d)>f||Math.abs(e)>f)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(a,c),b.consume()}}; mxRubberband.prototype.createShape=function(){null==this.sharedDiv&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity));this.graph.container.appendChild(this.sharedDiv);var a=this.sharedDiv;mxClient.IS_SVG&&this.fadeOut&&(this.sharedDiv=null);return a};mxRubberband.prototype.isActive=function(a,b){return null!=this.div&&"none"!=this.div.style.display}; mxRubberband.prototype.mouseUp=function(a,b){a=this.isActive();this.reset();a&&(this.execute(b.getEvent()),b.consume())};mxRubberband.prototype.execute=function(a){var b=new mxRectangle(this.x,this.y,this.width,this.height);this.graph.selectRegion(b,a)}; mxRubberband.prototype.reset=function(){if(null!=this.div)if(mxClient.IS_SVG&&this.fadeOut){var a=this.div;mxUtils.setPrefixedStyle(a.style,"transition","all 0.2s linear");a.style.pointerEvents="none";a.style.opacity=0;window.setTimeout(function(){a.parentNode.removeChild(a)},200)}else this.div.parentNode.removeChild(this.div);mxEvent.removeGestureListeners(document,null,this.dragHandler,this.dropHandler);this.dropHandler=this.dragHandler=null;this.currentY=this.currentX=0;this.div=this.first=null; this.fireEvent(new mxEventObject(mxEvent.RESET))};mxRubberband.prototype.update=function(a,b){this.currentX=a;this.currentY=b;this.repaint();this.fireEvent(new mxEventObject(mxEvent.UPDATE,"x",this.x,"y",this.y,"width",this.width,"height",this.height))}; mxRubberband.prototype.repaint=function(){if(null!=this.div){var a=this.currentX-this.graph.panDx,b=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,a);this.y=Math.min(this.first.y,b);this.width=Math.max(this.first.x,a)-this.x;this.height=Math.max(this.first.y,b)-this.y;this.div.style.left=this.x+0+"px";this.div.style.top=this.y+0+"px";this.div.style.width=Math.max(1,this.width)+"px";this.div.style.height=Math.max(1,this.height)+"px"}}; mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.forceRubberbandHandler),this.graph.removeListener(this.panHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))};function mxHandle(a,b,c,d){this.graph=a.view.graph;this.state=a;this.cursor=null!=b?b:this.cursor;this.image=null!=c?c:this.image;this.shape=null!=d?d:null;this.init()}mxHandle.prototype.cursor="default";mxHandle.prototype.image=null; mxHandle.prototype.ignoreGrid=!1;mxHandle.prototype.getPosition=function(a){};mxHandle.prototype.setPosition=function(a,b,c){};mxHandle.prototype.execute=function(a){};mxHandle.prototype.copyStyle=function(a){this.graph.setCellStyles(a,this.state.style[a],[this.state.cell])}; mxHandle.prototype.processEvent=function(a){var b=this.graph.view.scale,c=this.graph.view.translate;c=new mxPoint(a.getGraphX()/b-c.x,a.getGraphY()/b-c.y);null!=this.shape&&null!=this.shape.bounds&&(c.x-=this.shape.bounds.width/b/4,c.y-=this.shape.bounds.height/b/4);b=-mxUtils.toRadians(this.getRotation());var d=-mxUtils.toRadians(this.getTotalRotation())-b;c=this.flipPoint(this.rotatePoint(this.snapPoint(this.rotatePoint(c,b),this.ignoreGrid||!this.graph.isGridEnabledEvent(a.getEvent())),d));this.setPosition(this.state.getPaintBounds(), c,a);this.redraw()};mxHandle.prototype.positionChanged=function(){null!=this.state.text&&this.state.text.apply(this.state);null!=this.state.shape&&this.graph.cellRenderer.configureShape(this.state);this.graph.cellRenderer.redraw(this.state,!0)};mxHandle.prototype.getRotation=function(){return null!=this.state.shape?this.state.shape.getRotation():0};mxHandle.prototype.getTotalRotation=function(){return null!=this.state.shape?this.state.shape.getShapeRotation():0}; mxHandle.prototype.init=function(){var a=this.isHtmlRequired();null!=this.image?(this.shape=new mxImageShape(new mxRectangle(0,0,this.image.width,this.image.height),this.image.src),this.shape.preserveImageAspect=!1):null==this.shape&&(this.shape=this.createShape(a));this.initShape(a)};mxHandle.prototype.createShape=function(a){a=new mxRectangle(0,0,mxConstants.HANDLE_SIZE,mxConstants.HANDLE_SIZE);return new mxRectangleShape(a,mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)}; mxHandle.prototype.initShape=function(a){a&&this.shape.isHtmlAllowed()?(this.shape.dialect=mxConstants.DIALECT_STRICTHTML,this.shape.init(this.graph.container)):(this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,null!=this.cursor&&this.shape.init(this.graph.getView().getOverlayPane()));mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state);this.shape.node.style.cursor=this.cursor}; mxHandle.prototype.redraw=function(){if(null!=this.shape&&null!=this.state.shape){var a=this.getPosition(this.state.getPaintBounds());if(null!=a){var b=mxUtils.toRadians(this.getTotalRotation());a=this.rotatePoint(this.flipPoint(a),b);b=this.graph.view.scale;var c=this.graph.view.translate;this.shape.bounds.x=Math.floor((a.x+c.x)*b-this.shape.bounds.width/2);this.shape.bounds.y=Math.floor((a.y+c.y)*b-this.shape.bounds.height/2);this.shape.redraw()}}}; mxHandle.prototype.isHtmlRequired=function(){return null!=this.state.text&&this.state.text.node.parentNode==this.graph.container};mxHandle.prototype.rotatePoint=function(a,b){var c=this.state.getCellBounds();c=new mxPoint(c.getCenterX(),c.getCenterY());return mxUtils.getRotatedPoint(a,Math.cos(b),Math.sin(b),c)}; mxHandle.prototype.flipPoint=function(a){if(null!=this.state.shape){var b=this.state.getCellBounds();this.state.shape.flipH&&(a.x=2*b.x+b.width-a.x);this.state.shape.flipV&&(a.y=2*b.y+b.height-a.y)}return a};mxHandle.prototype.snapPoint=function(a,b){b||(a.x=this.graph.snap(a.x),a.y=this.graph.snap(a.y));return a};mxHandle.prototype.setVisible=function(a){null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display=a?"":"none")}; mxHandle.prototype.reset=function(){this.setVisible(!0);this.state.style=this.graph.getCellStyle(this.state.cell);this.positionChanged()};mxHandle.prototype.destroy=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null)}; function mxVertexHandler(a){null!=a&&(this.state=a,this.init(),this.escapeHandler=mxUtils.bind(this,function(b,c){this.livePreview&&null!=this.index&&(this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate());this.reset()}),this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}mxVertexHandler.prototype.graph=null;mxVertexHandler.prototype.state=null;mxVertexHandler.prototype.singleSizer=!1; mxVertexHandler.prototype.index=null;mxVertexHandler.prototype.allowHandleBoundsCheck=!0;mxVertexHandler.prototype.handleImage=null;mxVertexHandler.prototype.handlesVisible=!0;mxVertexHandler.prototype.tolerance=0;mxVertexHandler.prototype.rotationEnabled=!1;mxVertexHandler.prototype.parentHighlightEnabled=!1;mxVertexHandler.prototype.rotationRaster=!0;mxVertexHandler.prototype.rotationCursor="crosshair";mxVertexHandler.prototype.livePreview=!1;mxVertexHandler.prototype.movePreviewToFront=!1; mxVertexHandler.prototype.manageSizers=!1;mxVertexHandler.prototype.constrainGroupByChildren=!1;mxVertexHandler.prototype.rotationHandleVSpacing=-16;mxVertexHandler.prototype.horizontalOffset=0;mxVertexHandler.prototype.verticalOffset=0; mxVertexHandler.prototype.init=function(){this.graph=this.state.view.graph;this.selectionBounds=this.getSelectionBounds(this.state);this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height);this.selectionBorder=this.createSelectionShape(this.bounds);this.selectionBorder.dialect=mxConstants.DIALECT_SVG;this.selectionBorder.svgStrokeTolerance=0;this.selectionBorder.pointerEvents=!1;this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]|| "0");this.selectionBorder.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state);this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellLocked(this.state.cell)&&this.selectionBorder.setCursor(mxConstants.CURSOR_MOVABLE_VERTEX);this.refresh();this.redraw();this.constrainGroupByChildren&&this.updateMinBounds()}; mxVertexHandler.prototype.isHandlesVisible=function(){return!this.graph.isCellLocked(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||this.graph.getSelectionCount()<=mxGraphHandler.prototype.maxCells)}; mxVertexHandler.prototype.refresh=function(){null!=this.selectionBorder&&(this.selectionBorder.strokewidth=this.getSelectionStrokeWidth(),this.selectionBorder.isDashed=this.isSelectionDashed(),this.selectionBorder.stroke=this.getSelectionColor(),this.selectionBorder.redraw());null!=this.sizers&&this.destroySizers();this.isHandlesVisible()&&(this.sizers=this.createSizers());null!=this.customHandles&&this.destroyCustomHandles();this.isHandlesVisible()&&(this.customHandles=this.createCustomHandles())}; mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)};mxVertexHandler.prototype.isConstrainedEvent=function(a){return mxEvent.isShiftDown(a.getEvent())||"fixed"==this.state.style[mxConstants.STYLE_ASPECT]};mxVertexHandler.prototype.isCenteredEvent=function(a,b){return!1};mxVertexHandler.prototype.createCustomHandles=function(){return null}; mxVertexHandler.prototype.updateMinBounds=function(){var a=this.graph.getChildCells(this.state.cell);if(0<a.length&&(this.minBounds=this.graph.view.getBounds(a),null!=this.minBounds)){a=this.state.view.scale;var b=this.state.view.translate;this.minBounds.x-=this.state.x;this.minBounds.y-=this.state.y;this.minBounds.x/=a;this.minBounds.y/=a;this.minBounds.width/=a;this.minBounds.height/=a;this.x0=this.state.x/a-b.x;this.y0=this.state.y/a-b.y}}; mxVertexHandler.prototype.getSelectionBounds=function(a){return new mxRectangle(Math.round(a.x),Math.round(a.y),Math.round(a.width),Math.round(a.height))};mxVertexHandler.prototype.createParentHighlightShape=function(a){return this.createSelectionShape(a)};mxVertexHandler.prototype.createSelectionShape=function(a){a=new mxRectangleShape(mxRectangle.fromRectangle(a),null,this.getSelectionColor());a.strokewidth=this.getSelectionStrokeWidth();a.isDashed=this.isSelectionDashed();return a}; mxVertexHandler.prototype.getSelectionColor=function(){return this.graph.isCellEditable(this.state.cell)?mxConstants.VERTEX_SELECTION_COLOR:mxConstants.LOCKED_HANDLE_FILLCOLOR};mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH};mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED}; mxVertexHandler.prototype.createSizer=function(a,b,c,d){c=c||mxConstants.HANDLE_SIZE;c=new mxRectangle(0,0,c,c);d=this.createSizerShape(c,b,d,this.handleImage);d.isHtmlAllowed()&&null!=this.state.text&&this.state.text.node.parentNode==this.graph.container?(--d.bounds.height,--d.bounds.width,d.dialect=mxConstants.DIALECT_STRICTHTML,d.init(this.graph.container)):(d.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,d.init(this.graph.getView().getOverlayPane())); mxEvent.redirectMouseEvents(d.node,this.graph,this.state);this.graph.isEnabled()&&d.setCursor(a);this.isSizerVisible(b)||(d.visible=!1);return d};mxVertexHandler.prototype.isSizerVisible=function(a){return!0}; mxVertexHandler.prototype.createSizerShape=function(a,b,c,d){return null!=d?(a=new mxRectangle(a.x,a.y,d.width,d.height),a=new mxImageShape(a,d.src),a.preserveImageAspect=!1,a):b==mxEvent.ROTATION_HANDLE?new mxEllipse(a,c||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(a,c||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)}; mxVertexHandler.prototype.moveSizerTo=function(a,b,c){null!=a&&(a.bounds.x=Math.floor(b-a.bounds.width/2),a.bounds.y=Math.floor(c-a.bounds.height/2),null!=a.node&&"none"!=a.node.style.display&&a.redraw())}; mxVertexHandler.prototype.getHandleForEvent=function(a){var b=mxEvent.isMouseEvent(a.getEvent())?1:this.tolerance,c=this.allowHandleBoundsCheck&&0<b?new mxRectangle(a.getGraphX()-b,a.getGraphY()-b,2*b,2*b):null;b=mxUtils.bind(this,function(e){var f=null!=e&&e.constructor!=mxImageShape&&this.allowHandleBoundsCheck?e.strokewidth+e.svgStrokeTolerance:null;f=null!=f?new mxRectangle(a.getGraphX()-Math.floor(f/2),a.getGraphY()-Math.floor(f/2),f,f):c;return null!=e&&(a.isSource(e)||e.intersectsRectangle(f))}); if(b(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(b(this.labelShape))return mxEvent.LABEL_HANDLE;if(null!=this.sizers)for(var d=0;d<this.sizers.length;d++)if(b(this.sizers[d]))return d;if(null!=this.customHandles&&this.isCustomHandleEvent(a))for(d=this.customHandles.length-1;0<=d;d--)if(null!=this.customHandles[d]&&b(this.customHandles[d].shape))return mxEvent.CUSTOM_HANDLE-d;return null};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!0}; mxVertexHandler.prototype.mouseDown=function(a,b){b.isConsumed()||!this.graph.isEnabled()||mxEvent.isAltDown(b.getEvent())&&mxEvent.isShiftDown(b.getEvent())||mxEvent.isMouseEvent(b.getEvent())&&!mxEvent.isLeftMouseButton(b.getEvent())||(a=this.getHandleForEvent(b),null!=a&&(this.start(b.getGraphX(),b.getGraphY(),a),b.consume()))};mxVertexHandler.prototype.isLivePreviewBorder=function(){return null!=this.state.shape&&null==this.state.shape.fill&&null==this.state.shape.stroke}; mxVertexHandler.prototype.start=function(a,b,c){if(null!=this.selectionBorder)if(this.livePreviewActive=this.livePreview&&0==this.graph.model.getChildCount(this.state.cell),this.inTolerance=!0,this.childOffsetY=this.childOffsetX=0,this.index=c,this.startX=a,this.startY=b,this.index<=mxEvent.CUSTOM_HANDLE&&this.isGhostPreview())this.ghostPreview=this.createGhostPreview();else{a=this.state.view.graph.model;b=a.getParent(this.state.cell);this.state.view.currentRoot!=b&&(a.isVertex(b)||a.isEdge(b))&& (this.parentState=this.state.view.graph.view.getState(b));this.selectionBorder.node.style.display=c==mxEvent.ROTATION_HANDLE?"inline":"none";if(!this.livePreviewActive||this.isLivePreviewBorder())this.preview=this.createSelectionShape(this.bounds),mxClient.IS_SVG&&0!=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")||null==this.state.text||this.state.text.node.parentNode!=this.graph.container?(this.preview.dialect=mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane())): (this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container));c==mxEvent.ROTATION_HANDLE&&(b=this.getRotationHandlePosition(),a=b.x-this.state.getCenterX(),b=b.y-this.state.getCenterY(),this.startAngle=0!=a?180*Math.atan(b/a)/Math.PI+90:0,this.startDist=Math.sqrt(a*a+b*b));if(this.livePreviewActive)for(this.hideSizers(),c==mxEvent.ROTATION_HANDLE?null!=this.rotationShape&&(this.rotationShape.node.style.display=""):c==mxEvent.LABEL_HANDLE?null!=this.labelShape&&(this.labelShape.node.style.display= ""):null!=this.sizers&&null!=this.sizers[c]?this.sizers[c].node.style.display="":c<=mxEvent.CUSTOM_HANDLE&&null!=this.customHandles&&null!=this.customHandles[mxEvent.CUSTOM_HANDLE-c]&&this.customHandles[mxEvent.CUSTOM_HANDLE-c].setVisible(!0),c=this.graph.getEdges(this.state.cell),this.edgeHandlers=[],a=0;a<c.length;a++)b=this.graph.selectionCellsHandler.getHandler(c[a]),null!=b&&this.edgeHandlers.push(b)}}; mxVertexHandler.prototype.createGhostPreview=function(){var a=this.graph.cellRenderer.createShape(this.state);a.init(this.graph.view.getOverlayPane());a.scale=this.state.view.scale;a.bounds=this.bounds;a.outline=!0;return a}; mxVertexHandler.prototype.setHandlesVisible=function(a){this.handlesVisible=a;if(null!=this.sizers)for(var b=0;b<this.sizers.length;b++)this.sizers[b].node.style.display=a?"":"none";if(null!=this.customHandles)for(b=0;b<this.customHandles.length;b++)null!=this.customHandles[b]&&this.customHandles[b].setVisible(a)};mxVertexHandler.prototype.hideSizers=function(){this.setHandlesVisible(!1)}; mxVertexHandler.prototype.checkTolerance=function(a){this.inTolerance&&null!=this.startX&&null!=this.startY&&(mxEvent.isMouseEvent(a.getEvent())||Math.abs(a.getGraphX()-this.startX)>this.graph.tolerance||Math.abs(a.getGraphY()-this.startY)>this.graph.tolerance)&&(this.inTolerance=!1)};mxVertexHandler.prototype.updateHint=function(a){};mxVertexHandler.prototype.removeHint=function(){};mxVertexHandler.prototype.roundAngle=function(a){return Math.round(10*a)/10}; mxVertexHandler.prototype.roundLength=function(a){return Math.round(100*a)/100}; mxVertexHandler.prototype.mouseMove=function(a,b){b.isConsumed()||null==this.index?this.graph.isMouseDown||null==this.getHandleForEvent(b)||b.consume(!1):(this.checkTolerance(b),this.inTolerance||(this.index<=mxEvent.CUSTOM_HANDLE?null!=this.customHandles&&null!=this.customHandles[mxEvent.CUSTOM_HANDLE-this.index]&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(b),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].active=!0,null!=this.ghostPreview?(this.ghostPreview.apply(this.state), this.ghostPreview.strokewidth=this.getSelectionStrokeWidth()/this.ghostPreview.scale/this.ghostPreview.scale,this.ghostPreview.isDashed=this.isSelectionDashed(),this.ghostPreview.stroke=this.getSelectionColor(),this.ghostPreview.redraw(),null!=this.selectionBounds&&(this.selectionBorder.node.style.display="none")):(this.movePreviewToFront&&this.moveToFront(),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged())):this.index==mxEvent.LABEL_HANDLE?this.moveLabel(b):(this.index==mxEvent.ROTATION_HANDLE? this.rotateVertex(b):this.resizeVertex(b),this.updateHint(b))),b.consume())};mxVertexHandler.prototype.isGhostPreview=function(){return 0<this.state.view.graph.model.getChildCount(this.state.cell)}; mxVertexHandler.prototype.moveLabel=function(a){var b=new mxPoint(a.getGraphX(),a.getGraphY()),c=this.graph.view.translate,d=this.graph.view.scale;this.graph.isGridEnabledEvent(a.getEvent())&&(b.x=(this.graph.snap(b.x/d-c.x)+c.x)*d,b.y=(this.graph.snap(b.y/d-c.y)+c.y)*d);this.moveSizerTo(this.sizers[null!=this.rotationShape?this.sizers.length-2:this.sizers.length-1],b.x,b.y)}; mxVertexHandler.prototype.rotateVertex=function(a){var b=new mxPoint(a.getGraphX(),a.getGraphY()),c=this.state.x+this.state.width/2-b.x,d=this.state.y+this.state.height/2-b.y;this.currentAlpha=0!=c?180*Math.atan(d/c)/Math.PI+90:0>d?180:0;0<c&&(this.currentAlpha-=180);this.currentAlpha-=this.startAngle;this.rotationRaster&&this.graph.isGridEnabledEvent(a.getEvent())?(c=b.x-this.state.getCenterX(),d=b.y-this.state.getCenterY(),a=Math.sqrt(c*c+d*d),raster=2>a-this.startDist?15:25>a-this.startDist?5: 1,this.currentAlpha=Math.round(this.currentAlpha/raster)*raster):this.currentAlpha=this.roundAngle(this.currentAlpha);this.selectionBorder.rotation=this.currentAlpha;this.selectionBorder.redraw();this.livePreviewActive&&this.redrawHandles()}; mxVertexHandler.prototype.resizeVertex=function(a){var b=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),c=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),d=new mxPoint(a.getGraphX(),a.getGraphY()),e=this.graph.view.translate,f=this.graph.view.scale,g=Math.cos(-c),k=Math.sin(-c),l=d.x-this.startX,m=d.y-this.startY;d=k*l+g*m;l=g*l-k*m;m=d;g=this.graph.getCellGeometry(this.state.cell);this.unscaledBounds=this.union(g,l/f,m/f,this.index,this.graph.isGridEnabledEvent(a.getEvent()), 1,new mxPoint(0,0),this.isConstrainedEvent(a),this.isCenteredEvent(this.state,a));g.relative||(k=this.graph.getMaximumGraphBounds(),null!=k&&null!=this.parentState&&(k=mxRectangle.fromRectangle(k),k.x-=(this.parentState.x-e.x*f)/f,k.y-=(this.parentState.y-e.y*f)/f),this.graph.isConstrainChild(this.state.cell)&&(d=this.graph.getCellContainmentArea(this.state.cell),null!=d&&(l=this.graph.getOverlap(this.state.cell),0<l&&(d=mxRectangle.fromRectangle(d),d.x-=d.width*l,d.y-=d.height*l,d.width+=2*d.width* l,d.height+=2*d.height*l),null==k?k=d:(k=mxRectangle.fromRectangle(k),k.intersect(d)))),null!=k&&(this.unscaledBounds.x<k.x&&(this.unscaledBounds.width-=k.x-this.unscaledBounds.x,this.unscaledBounds.x=k.x),this.unscaledBounds.y<k.y&&(this.unscaledBounds.height-=k.y-this.unscaledBounds.y,this.unscaledBounds.y=k.y),this.unscaledBounds.x+this.unscaledBounds.width>k.x+k.width&&(this.unscaledBounds.width-=this.unscaledBounds.x+this.unscaledBounds.width-k.x-k.width),this.unscaledBounds.y+this.unscaledBounds.height> k.y+k.height&&(this.unscaledBounds.height-=this.unscaledBounds.y+this.unscaledBounds.height-k.y-k.height)));d=this.bounds;this.bounds=new mxRectangle((null!=this.parentState?this.parentState.x:e.x*f)+this.unscaledBounds.x*f,(null!=this.parentState?this.parentState.y:e.y*f)+this.unscaledBounds.y*f,this.unscaledBounds.width*f,this.unscaledBounds.height*f);g.relative&&null!=this.parentState&&(this.bounds.x+=this.state.x-this.parentState.x,this.bounds.y+=this.state.y-this.parentState.y);g=Math.cos(c); k=Math.sin(c);c=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY());l=c.x-b.x;m=c.y-b.y;b=g*l-k*m-l;c=k*l+g*m-m;l=this.bounds.x-this.state.x;m=this.bounds.y-this.state.y;e=g*l-k*m;g=k*l+g*m;this.bounds.x+=b;this.bounds.y+=c;this.unscaledBounds.x=this.roundLength(this.unscaledBounds.x+b/f);this.unscaledBounds.y=this.roundLength(this.unscaledBounds.y+c/f);this.unscaledBounds.width=this.roundLength(this.unscaledBounds.width);this.unscaledBounds.height=this.roundLength(this.unscaledBounds.height); this.graph.isCellCollapsed(this.state.cell)||0==b&&0==c?this.childOffsetY=this.childOffsetX=0:(this.childOffsetX=this.state.x-this.bounds.x+e,this.childOffsetY=this.state.y-this.bounds.y+g);d.equals(this.bounds)||(this.livePreviewActive&&this.updateLivePreview(a),null!=this.preview?this.drawPreview():this.updateParentHighlight())}; mxVertexHandler.prototype.updateLivePreview=function(a){a=this.graph.view.scale;var b=this.graph.view.translate,c=this.state.clone();this.state.x=this.bounds.x;this.state.y=this.bounds.y;this.state.origin=new mxPoint(this.state.x/a-b.x,this.state.y/a-b.y);this.state.width=this.bounds.width;this.state.height=this.bounds.height;b=this.state.absoluteOffset;new mxPoint(b.x,b.y);this.state.absoluteOffset.x=0;this.state.absoluteOffset.y=0;b=this.graph.getCellGeometry(this.state.cell);if(null!=b){var d= b.offset||this.EMPTY_POINT;null==d||b.relative||(this.state.absoluteOffset.x=this.state.view.scale*d.x,this.state.absoluteOffset.y=this.state.view.scale*d.y);this.state.view.updateVertexLabelOffset(this.state)}b=this.state.cell.geometry.width;d=this.state.cell.geometry.height;this.state.cell.geometry.width=this.roundLength(this.bounds.width/a);this.state.cell.geometry.height=this.roundLength(this.bounds.height/a);this.state.view.graph.cellRenderer.redraw(this.state,!0);this.state.cell.geometry.width= b;this.state.cell.geometry.height=d;this.state.view.invalidate(this.state.cell);this.state.invalid=!1;this.state.view.validate();this.redrawHandles();this.movePreviewToFront&&this.moveToFront();null!=this.state.control&&null!=this.state.control.node&&(this.state.control.node.style.visibility="hidden");this.state.setState(c)}; mxVertexHandler.prototype.moveToFront=function(){if(null!=this.state.text&&null!=this.state.text.node&&null!=this.state.text.node.nextSibling||null!=this.state.shape&&null!=this.state.shape.node&&null!=this.state.shape.node.nextSibling&&(null==this.state.text||this.state.shape.node.nextSibling!=this.state.text.node))null!=this.state.shape&&null!=this.state.shape.node&&this.state.shape.node.parentNode.appendChild(this.state.shape.node),null!=this.state.text&&null!=this.state.text.node&&this.state.text.node.parentNode.appendChild(this.state.text.node)}; mxVertexHandler.prototype.mouseUp=function(a,b){if(null!=this.index&&null!=this.state){var c=new mxPoint(b.getGraphX(),b.getGraphY());a=this.index;this.index=null;null==this.ghostPreview&&this.state.view.invalidate(this.state.cell,!1,!1);this.graph.getModel().beginUpdate();try{if(a<=mxEvent.CUSTOM_HANDLE){if(null!=this.customHandles&&null!=this.customHandles[mxEvent.CUSTOM_HANDLE-a]){var d=this.state.view.graph.getCellStyle(this.state.cell);this.customHandles[mxEvent.CUSTOM_HANDLE-a].active=!1;this.customHandles[mxEvent.CUSTOM_HANDLE- a].execute(b);null!=this.customHandles&&null!=this.customHandles[mxEvent.CUSTOM_HANDLE-a]&&(this.state.style=d,this.customHandles[mxEvent.CUSTOM_HANDLE-a].positionChanged())}}else if(a==mxEvent.ROTATION_HANDLE)if(null!=this.currentAlpha){var e=this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0);0!=e&&this.rotateCell(this.state.cell,e)}else this.rotateClick();else{var f=this.graph.isGridEnabledEvent(b.getEvent()),g=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"), k=Math.cos(-g),l=Math.sin(-g),m=c.x-this.startX,n=c.y-this.startY;d=l*m+k*n;m=k*m-l*n;n=d;var p=this.graph.view.scale,q=this.isRecursiveResize(this.state,b);this.resizeCell(this.state.cell,this.roundLength(m/p),this.roundLength(n/p),a,f,this.isConstrainedEvent(b),q)}}finally{this.graph.getModel().endUpdate()}this.state.invalid&&this.state.view.validate();b.consume();this.reset();this.redrawHandles()}};mxVertexHandler.prototype.isRecursiveResize=function(a,b){return this.graph.isRecursiveResize(this.state)}; mxVertexHandler.prototype.rotateClick=function(){}; mxVertexHandler.prototype.rotateCell=function(a,b,c){if(0!=b){var d=this.graph.getModel();if(d.isVertex(a)||d.isEdge(a)){if(!d.isEdge(a)){var e=(this.graph.getCurrentCellStyle(a)[mxConstants.STYLE_ROTATION]||0)+b;this.graph.setCellStyles(mxConstants.STYLE_ROTATION,e,[a])}e=this.graph.getCellGeometry(a);if(null!=e){var f=this.graph.getCellGeometry(c);null==f||d.isEdge(c)||(e=e.clone(),e.rotate(b,new mxPoint(f.width/2,f.height/2)),d.setGeometry(a,e));if(d.isVertex(a)&&!e.relative||d.isEdge(a))for(c= d.getChildCount(a),e=0;e<c;e++)this.rotateCell(d.getChildAt(a,e),b,a)}}}}; mxVertexHandler.prototype.reset=function(){null!=this.sizers&&null!=this.index&&null!=this.sizers[this.index]&&"none"==this.sizers[this.index].node.style.display&&(this.sizers[this.index].node.style.display="");this.index=this.inTolerance=this.currentAlpha=null;null!=this.preview&&(this.preview.destroy(),this.preview=null);null!=this.ghostPreview&&(this.ghostPreview.destroy(),this.ghostPreview=null);if(this.livePreviewActive&&null!=this.sizers){for(var a=0;a<this.sizers.length;a++)null!=this.sizers[a]&& (this.sizers[a].node.style.display="");null!=this.state.control&&null!=this.state.control.node&&(this.state.control.node.style.visibility="")}if(null!=this.customHandles)for(a=0;a<this.customHandles.length;a++)null!=this.customHandles[a]&&(this.customHandles[a].active?(this.customHandles[a].active=!1,this.customHandles[a].reset()):this.customHandles[a].setVisible(!0));null!=this.selectionBorder&&(this.selectionBorder.node.style.display="inline",this.selectionBounds=this.getSelectionBounds(this.state), this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview());this.removeHint();this.redrawHandles();this.edgeHandlers=null;this.handlesVisible=!0;this.livePreviewActive=this.unscaledBounds=null}; mxVertexHandler.prototype.resizeCell=function(a,b,c,d,e,f,g){b=this.graph.model.getGeometry(a);null!=b&&(d==mxEvent.LABEL_HANDLE?(c=-mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),g=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0),d=Math.cos(c),e=Math.sin(c),c=this.graph.view.scale,d=mxUtils.getRotatedPoint(new mxPoint(Math.round((this.labelShape.bounds.getCenterX()-this.startX)/c),Math.round((this.labelShape.bounds.getCenterY()-this.startY)/c)),d,e),g|| (d.y=-d.y),b=b.clone(),null==b.offset?b.offset=d:(b.offset.x+=d.x,b.offset.y+=d.y),this.graph.model.setGeometry(a,b)):null!=this.unscaledBounds&&(c=this.graph.view.scale,0==this.childOffsetX&&0==this.childOffsetY||this.moveChildren(a,Math.round(this.childOffsetX/c),Math.round(this.childOffsetY/c)),this.graph.resizeCell(a,this.unscaledBounds,g)))}; mxVertexHandler.prototype.moveChildren=function(a,b,c){for(var d=this.graph.getModel(),e=d.getChildCount(a),f=0;f<e;f++){var g=d.getChildAt(a,f),k=this.graph.getCellGeometry(g);null!=k&&(k=k.clone(),k.translate(b,c),d.setGeometry(g,k))}}; mxVertexHandler.prototype.union=function(a,b,c,d,e,f,g,k,l){e=null!=e?e&&this.graph.gridEnabled:this.graph.gridEnabled;if(this.singleSizer)return d=a.x+a.width+b,g=a.y+a.height+c,e&&(d=this.graph.snap(d/f)*f,g=this.graph.snap(g/f)*f),f=new mxRectangle(a.x,a.y,0,0),f.add(new mxRectangle(d,g,0,0)),f;var m=a.width,n=a.height,p=a.x-g.x*f,q=p+m;a=a.y-g.y*f;var r=a+n,t=p+m/2,u=a+n/2,v=e&&null!=this.state?mxUtils.mod(mxUtils.getNumber(this.state.style,mxConstants.STYLE_ROTATION,0),360):0;v=0!=v&&!isNaN(v); 4<d?(r+=c,r=e?v?a+this.graph.snap((r-a)/f)*f:this.graph.snap(r/f)*f:Math.round(r/f)*f):3>d&&(a+=c,a=e?v?r-this.graph.snap((r-a)/f)*f:this.graph.snap(a/f)*f:Math.round(a/f)*f);if(0==d||3==d||5==d)p+=b,p=e?v?q-this.graph.snap((q-p)/f)*f:this.graph.snap(p/f)*f:Math.round(p/f)*f;else if(2==d||4==d||7==d)q+=b,q=e?v?p+this.graph.snap((q-p)/f)*f:this.graph.snap(q/f)*f:Math.round(q/f)*f;e=q-p;c=r-a;k&&(k=this.graph.getCellGeometry(this.state.cell),null!=k&&(k=k.width/k.height,1==d||2==d||7==d||6==d?e=c*k: c=e/k,0==d&&(p=q-e,a=r-c)));if(l){e+=e-m;c+=c-n;if(v){if(0==d||3==d||5==d||2==d||4==d||7==d)e=this.graph.snap(e/f)*f;if(3>d||4<d)c=this.graph.snap(c/f)*f}p+=t-(p+e/2);a+=u-(a+c/2)}0>e&&(p+=e,e=Math.abs(e));0>c&&(a+=c,c=Math.abs(c));d=new mxRectangle(p+g.x*f,a+g.y*f,e,c);null!=this.minBounds&&(d.width=Math.max(d.width,this.minBounds.x*f+this.minBounds.width*f+Math.max(0,this.x0*f-d.x)),d.height=Math.max(d.height,this.minBounds.y*f+this.minBounds.height*f+Math.max(0,this.y0*f-d.y)));return d}; mxVertexHandler.prototype.redraw=function(a){this.selectionBounds=this.getSelectionBounds(this.state);this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height);this.drawPreview();a||this.redrawHandles()}; mxVertexHandler.prototype.getHandlePadding=function(){var a=new mxPoint(0,0),b=this.tolerance;null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]&&(this.bounds.width<2*this.sizers[0].bounds.width+2*b||this.bounds.height<2*this.sizers[0].bounds.height+2*b)&&(b/=2,a.x=this.sizers[0].bounds.width+b,a.y=this.sizers[0].bounds.height+b);return a};mxVertexHandler.prototype.getSizerBounds=function(){return this.bounds}; mxVertexHandler.prototype.redrawHandles=function(){var a=this.getSizerBounds(),b=this.tolerance;this.verticalOffset=this.horizontalOffset=0;if(null!=this.customHandles)for(var c=0;c<this.customHandles.length;c++)if(null!=this.customHandles[c]){var d=this.customHandles[c].shape.node.style.display;this.customHandles[c].redraw();this.customHandles[c].shape.node.style.display=d;this.customHandles[c].shape.node.style.visibility=this.handlesVisible&&this.isHandlesVisible()&&this.isCustomHandleVisible(this.customHandles[c])&& !this.graph.isEditing()?"":"hidden"}if(null!=a&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]){if(null==this.index&&this.manageSizers&&8<=this.sizers.length){c=this.getHandlePadding();this.horizontalOffset=c.x;this.verticalOffset=c.y;if(0!=this.horizontalOffset||0!=this.verticalOffset)a=new mxRectangle(a.x,a.y,a.width,a.height),a.x-=this.horizontalOffset/2,a.width+=this.horizontalOffset,a.y-=this.verticalOffset/2,a.height+=this.verticalOffset;8<=this.sizers.length&&(a.width<2*this.sizers[0].bounds.width+ 2*b||a.height<2*this.sizers[0].bounds.height+2*b?(this.sizers[0].node.style.display="none",this.sizers[2].node.style.display="none",this.sizers[5].node.style.display="none",this.sizers[7].node.style.display="none"):this.handlesVisible&&(this.sizers[0].node.style.display="",this.sizers[2].node.style.display="",this.sizers[5].node.style.display="",this.sizers[7].node.style.display=""))}var e=a.x+a.width,f=a.y+a.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],e,f);else if(b=a.x+a.width/2, c=a.y+a.height/2,8<=this.sizers.length){var g="nw-resize n-resize ne-resize e-resize se-resize s-resize sw-resize w-resize".split(" "),k=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0");d=Math.cos(k);var l=Math.sin(k),m=Math.round(4*k/Math.PI);k=new mxPoint(a.getCenterX(),a.getCenterY());var n=mxUtils.getRotatedPoint(new mxPoint(a.x,a.y),d,l,k);this.moveSizerTo(this.sizers[0],n.x,n.y);this.sizers[0].setCursor(g[mxUtils.mod(0+m,g.length)]);n.x=b;n.y=a.y;n=mxUtils.getRotatedPoint(n, d,l,k);this.moveSizerTo(this.sizers[1],n.x,n.y);this.sizers[1].setCursor(g[mxUtils.mod(1+m,g.length)]);n.x=e;n.y=a.y;n=mxUtils.getRotatedPoint(n,d,l,k);this.moveSizerTo(this.sizers[2],n.x,n.y);this.sizers[2].setCursor(g[mxUtils.mod(2+m,g.length)]);n.x=a.x;n.y=c;n=mxUtils.getRotatedPoint(n,d,l,k);this.moveSizerTo(this.sizers[3],n.x,n.y);this.sizers[3].setCursor(g[mxUtils.mod(7+m,g.length)]);n.x=e;n.y=c;n=mxUtils.getRotatedPoint(n,d,l,k);this.moveSizerTo(this.sizers[4],n.x,n.y);this.sizers[4].setCursor(g[mxUtils.mod(3+ m,g.length)]);n.x=a.x;n.y=f;n=mxUtils.getRotatedPoint(n,d,l,k);this.moveSizerTo(this.sizers[5],n.x,n.y);this.sizers[5].setCursor(g[mxUtils.mod(6+m,g.length)]);n.x=b;n.y=f;n=mxUtils.getRotatedPoint(n,d,l,k);this.moveSizerTo(this.sizers[6],n.x,n.y);this.sizers[6].setCursor(g[mxUtils.mod(5+m,g.length)]);n.x=e;n.y=f;n=mxUtils.getRotatedPoint(n,d,l,k);this.moveSizerTo(this.sizers[7],n.x,n.y);this.sizers[7].setCursor(g[mxUtils.mod(4+m,g.length)]);a=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL, !0);n.x=b+this.state.absoluteOffset.x;n.y=c+(a?1:-1)*this.state.absoluteOffset.y;n=mxUtils.getRotatedPoint(n,d,l,k);this.moveSizerTo(this.sizers[8],n.x,n.y)}else 2<=this.state.width&&2<=this.state.height&&null!=this.state.absoluteOffset?this.moveSizerTo(this.sizers[0],b+this.state.absoluteOffset.x,c+this.state.absoluteOffset.y):this.moveSizerTo(this.sizers[0],this.state.x,this.state.y)}if(null!=this.sizers)for(c=0;c<this.sizers.length;c++)this.sizers[c].node.style.visibility=this.isHandlesVisible()? "":"hidden";null!=this.rotationShape&&(k=mxUtils.toRadians(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),d=Math.cos(k),l=Math.sin(k),k=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),n=mxUtils.getRotatedPoint(this.getRotationHandlePosition(),d,l,k),null!=this.rotationShape.node&&(this.moveSizerTo(this.rotationShape,n.x,n.y),this.rotationShape.node.style.visibility=!this.state.view.graph.isEditing()&&this.handlesVisible&&this.isHandlesVisible()&& this.isRotationHandleVisible()?"":"hidden"));null!=this.selectionBorder&&(this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"));if(null!=this.edgeHandlers)for(c=0;c<this.edgeHandlers.length;c++)this.edgeHandlers[c].redraw()};mxVertexHandler.prototype.isCustomHandleVisible=function(a){return 1==this.state.view.graph.getSelectionCount()}; mxVertexHandler.prototype.getRotationHandlePosition=function(){return new mxPoint(this.bounds.x+this.bounds.width/2,this.bounds.y+this.rotationHandleVSpacing)};mxVertexHandler.prototype.isParentHighlightVisible=function(){return!this.graph.isCellSelected(this.graph.model.getParent(this.state.cell))}; mxVertexHandler.prototype.destroyParentHighlight=function(){null!=this.parentHighlight.state&&(delete this.parentHighlight.state.parentHighlight,delete this.parentHighlight.state);this.parentHighlight.destroy();this.parentHighlight=null}; mxVertexHandler.prototype.updateParentHighlight=function(){if(!this.isDestroyed()){var a=this.isParentHighlightVisible(),b=this.graph.model.getParent(this.state.cell),c=this.graph.view.getState(b);null!=this.parentHighlight?this.graph.model.isVertex(b)&&a?(a=this.parentHighlight.bounds,null==c||a.x==c.x&&a.y==c.y&&a.width==c.width&&a.height==c.height||(this.parentHighlight.bounds=mxRectangle.fromRectangle(c),this.parentHighlight.redraw())):this.destroyParentHighlight():this.parentHighlightEnabled&& a&&this.graph.model.isVertex(b)&&null!=c&&null==c.parentHighlight&&(this.parentHighlight=this.createParentHighlightShape(c),this.parentHighlight.dialect=mxConstants.DIALECT_SVG,this.parentHighlight.svgStrokeTolerance=0,this.parentHighlight.pointerEvents=!1,this.parentHighlight.rotation=Number(c.style[mxConstants.STYLE_ROTATION]||"0"),this.parentHighlight.init(this.graph.getView().getOverlayPane()),this.parentHighlight.redraw(),c.parentHighlight=this.parentHighlight,this.parentHighlight.state=c)}}; mxVertexHandler.prototype.drawPreview=function(){null!=this.preview&&(this.preview.bounds=this.bounds,this.preview.node.parentNode==this.graph.container&&(this.preview.bounds.width=Math.max(0,this.preview.bounds.width-1),this.preview.bounds.height=Math.max(0,this.preview.bounds.height-1)),this.preview.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.preview.redraw());this.selectionBorder.bounds=this.getSelectionBorderBounds();this.selectionBorder.redraw();this.updateParentHighlight()}; mxVertexHandler.prototype.getSelectionBorderBounds=function(){return this.bounds}; mxVertexHandler.prototype.createSizers=function(){var a=this.graph.isCellResizable(this.state.cell)&&!this.graph.isCellLocked(this.state.cell),b=[];if(a||this.graph.isLabelMovable(this.state.cell)&&2<=this.state.width&&2<=this.state.height){var c=0;a&&(this.singleSizer||(b.push(this.createSizer("nw-resize",c++)),b.push(this.createSizer("n-resize",c++)),b.push(this.createSizer("ne-resize",c++)),b.push(this.createSizer("w-resize",c++)),b.push(this.createSizer("e-resize",c++)),b.push(this.createSizer("sw-resize", c++)),b.push(this.createSizer("s-resize",c++))),b.push(this.createSizer("se-resize",c++)));a=this.graph.model.getGeometry(this.state.cell);null==a||a.relative||this.graph.isSwimlane(this.state.cell)||!this.graph.isLabelMovable(this.state.cell)||(this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR),b.push(this.labelShape))}else this.graph.isCellMovable(this.state.cell)&&!a&&2>this.state.width&&2>this.state.height&& (this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,mxEvent.LABEL_HANDLE,null,mxConstants.LABEL_HANDLE_FILLCOLOR),b.push(this.labelShape));null==this.rotationShape&&(this.rotationShape=this.createSizer(this.rotationCursor,mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),b.push(this.rotationShape));return b}; mxVertexHandler.prototype.destroyCustomHandles=function(){if(null!=this.customHandles){for(var a=0;a<this.customHandles.length;a++)null!=this.customHandles[a]&&this.customHandles[a].destroy();this.customHandles=null}};mxVertexHandler.prototype.destroySizers=function(){if(null!=this.sizers){for(var a=0;a<this.sizers.length;a++)this.sizers[a].destroy();this.rotationShape=this.sizers=null}};mxVertexHandler.prototype.isDestroyed=function(){return null==this.selectionBorder}; mxVertexHandler.prototype.destroy=function(){null!=this.escapeHandler&&(this.state.view.graph.removeListener(this.escapeHandler),this.escapeHandler=null);null!=this.preview&&(this.preview.destroy(),this.preview=null);null!=this.ghostPreview&&(this.ghostPreview.destroy(),this.ghostPreview=null);null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null);null!=this.parentHighlight&&this.destroyParentHighlight();this.labelShape=null;this.removeHint();this.destroySizers();this.destroyCustomHandles()}; function mxEdgeHandler(a){null!=a&&null!=a.shape&&(this.state=a,this.init(),this.escapeHandler=mxUtils.bind(this,function(b,c){b=null!=this.index;this.reset();b&&this.graph.cellRenderer.redraw(this.state,!1,a.view.isRendering())}),this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}mxEdgeHandler.prototype.graph=null;mxEdgeHandler.prototype.state=null;mxEdgeHandler.prototype.marker=null;mxEdgeHandler.prototype.constraintHandler=null;mxEdgeHandler.prototype.error=null; mxEdgeHandler.prototype.shape=null;mxEdgeHandler.prototype.bends=null;mxEdgeHandler.prototype.labelShape=null;mxEdgeHandler.prototype.cloneEnabled=!0;mxEdgeHandler.prototype.addEnabled=!1;mxEdgeHandler.prototype.removeEnabled=!1;mxEdgeHandler.prototype.dblClickRemoveEnabled=!1;mxEdgeHandler.prototype.mergeRemoveEnabled=!1;mxEdgeHandler.prototype.straightRemoveEnabled=!1;mxEdgeHandler.prototype.virtualBendsEnabled=!1;mxEdgeHandler.prototype.virtualBendOpacity=40; mxEdgeHandler.prototype.parentHighlightEnabled=!1;mxEdgeHandler.prototype.preferHtml=!1;mxEdgeHandler.prototype.allowHandleBoundsCheck=!0;mxEdgeHandler.prototype.snapToTerminals=!1;mxEdgeHandler.prototype.handleImage=null;mxEdgeHandler.prototype.tolerance=0;mxEdgeHandler.prototype.outlineConnect=!1;mxEdgeHandler.prototype.manageLabelHandle=!1; mxEdgeHandler.prototype.init=function(){this.graph=this.state.view.graph;this.marker=this.createMarker();this.points=[];this.abspoints=this.getSelectionPoints(this.state);this.shape=this.createSelectionShape(this.abspoints);this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;this.shape.init(this.graph.getView().getOverlayPane());this.shape.svgStrokeTolerance=0;this.shape.pointerEvents=!1;mxEvent.redirectMouseEvents(this.shape.node,this.graph, this.state);this.graph.isCellMovable(this.state.cell)&&this.shape.setCursor(mxConstants.CURSOR_MOVABLE_EDGE);this.preferHtml=null!=this.state.text&&this.state.text.node.parentNode==this.graph.container;if(!this.preferHtml){var a=this.state.getVisibleTerminalState(!0);null!=a&&(this.preferHtml=null!=a.text&&a.text.node.parentNode==this.graph.container);this.preferHtml||(a=this.state.getVisibleTerminalState(!1),null!=a&&(this.preferHtml=null!=a.text&&a.text.node.parentNode==this.graph.container))}this.updateParentHighlight(); this.refresh();this.redraw()};mxEdgeHandler.prototype.createLabelShape=function(){var a=this.createLabelHandleShape();this.initBend(a);return a};mxEdgeHandler.prototype.getConstraintHandler=function(){null==this.constraintHandler&&(this.constraintHandler=this.createConstraintHandler());return this.constraintHandler};mxEdgeHandler.prototype.createConstraintHandler=function(){return new mxConstraintHandler(this.graph)};mxEdgeHandler.prototype.isParentHighlightVisible=mxVertexHandler.prototype.isParentHighlightVisible; mxEdgeHandler.prototype.destroyParentHighlight=mxVertexHandler.prototype.destroyParentHighlight;mxEdgeHandler.prototype.updateParentHighlight=mxVertexHandler.prototype.updateParentHighlight;mxEdgeHandler.prototype.createCustomHandles=function(){return null}; mxEdgeHandler.prototype.isVirtualBendsEnabled=function(a){return this.virtualBendsEnabled&&(null==this.state.style[mxConstants.STYLE_EDGE]||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.NONE||1==this.state.style[mxConstants.STYLE_NOEDGESTYLE])&&"arrow"!=mxUtils.getValue(this.state.style,mxConstants.STYLE_SHAPE,null)};mxEdgeHandler.prototype.isCellEnabled=function(a){return!0};mxEdgeHandler.prototype.isAddPointEvent=function(a){return mxEvent.isShiftDown(a)}; mxEdgeHandler.prototype.isRemovePointEvent=function(a){return mxEvent.isShiftDown(a)};mxEdgeHandler.prototype.getSelectionPoints=function(a){return a.absolutePoints};mxEdgeHandler.prototype.createParentHighlightShape=function(a){a=new mxRectangleShape(mxRectangle.fromRectangle(a),null,this.getSelectionColor());a.strokewidth=this.getSelectionStrokeWidth();a.isDashed=this.isSelectionDashed();return a}; mxEdgeHandler.prototype.createSelectionShape=function(a){a=new this.state.shape.constructor;a.outline=!0;a.apply(this.state);a.isDashed=this.isSelectionDashed();a.stroke=this.getSelectionColor();a.isShadow=!1;return a};mxEdgeHandler.prototype.getSelectionColor=function(){return this.graph.isCellEditable(this.state.cell)?mxConstants.EDGE_SELECTION_COLOR:mxConstants.LOCKED_HANDLE_FILLCOLOR};mxEdgeHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.EDGE_SELECTION_STROKEWIDTH}; mxEdgeHandler.prototype.isSelectionDashed=function(){return mxConstants.EDGE_SELECTION_DASHED};mxEdgeHandler.prototype.isConnectableCell=function(a){return!0};mxEdgeHandler.prototype.getCellAt=function(a,b){return this.outlineConnect?null:this.graph.getCellAt(a,b)}; mxEdgeHandler.prototype.createMarker=function(){var a=new mxCellMarker(this.graph),b=this;a.getCell=function(c){var d=mxCellMarker.prototype.getCell.apply(this,arguments);d!=b.state.cell&&null!=d||null==b.currentPoint||(d=b.graph.getCellAt(b.currentPoint.x,b.currentPoint.y));if(null!=d&&!this.graph.isCellConnectable(d)){var e=this.graph.getModel().getParent(d);this.graph.getModel().isVertex(e)&&this.graph.isCellConnectable(e)&&(d=e)}e=b.graph.getModel();if(this.graph.isSwimlane(d)&&null!=b.currentPoint&& this.graph.hitsSwimlaneContent(d,b.currentPoint.x,b.currentPoint.y)||!b.isConnectableCell(d)||d==b.state.cell||null!=d&&!b.graph.connectableEdges&&e.isEdge(d)||e.isAncestor(b.state.cell,d))d=null;this.graph.isCellConnectable(d)||(d=null);return d};a.isValidState=function(c){var d=b.graph.getModel();d=b.graph.view.getTerminalPort(c,b.graph.view.getState(d.getTerminal(b.state.cell,!b.isSource)),!b.isSource);d=null!=d?d.cell:null;b.error=b.validateConnection(b.isSource?c.cell:d,b.isSource?d:c.cell); return null==b.error};return a};mxEdgeHandler.prototype.validateConnection=function(a,b){return this.graph.getEdgeValidationError(this.state.cell,a,b)}; mxEdgeHandler.prototype.createBends=function(){var a=this.state.cell,b=[];if(null!=this.abspoints)for(var c=0;c<this.abspoints.length;c++)if(this.isHandleVisible(c)){var d=c==this.abspoints.length-1,e=0==c||d;(e||this.graph.isCellBendable(a))&&mxUtils.bind(this,function(f){var g=this.createHandleShape(f,null,f==this.abspoints.length-1);this.initBend(g,mxUtils.bind(this,mxUtils.bind(this,function(){this.dblClickRemoveEnabled&&this.removePoint(this.state,f)})));this.isHandleEnabled(c)&&g.setCursor(e? mxConstants.CURSOR_TERMINAL_HANDLE:mxConstants.CURSOR_BEND_HANDLE);b.push(g);e||(this.points.push(new mxPoint(0,0)),g.node.style.visibility="hidden")})(c)}return b};mxEdgeHandler.prototype.createVirtualBends=function(){var a=[];if(null!=this.abspoints&&0<this.abspoints.length&&this.graph.isCellBendable(this.state.cell))for(var b=1;b<this.abspoints.length;b++)mxUtils.bind(this,function(c){this.initBend(c);c.setCursor(mxConstants.CURSOR_VIRTUAL_BEND_HANDLE);a.push(c)})(this.createHandleShape());return a}; mxEdgeHandler.prototype.isHandleEnabled=function(a){return!0};mxEdgeHandler.prototype.isHandleVisible=function(a){return this.edgeStyle!=mxEdgeStyle.EntityRelation||0==a||a==this.abspoints.length-1}; mxEdgeHandler.prototype.createHandleShape=function(a){if(null!=this.handleImage)return a=new mxImageShape(new mxRectangle(0,0,this.handleImage.width,this.handleImage.height),this.handleImage.src),a.preserveImageAspect=!1,a;a=mxConstants.HANDLE_SIZE;this.preferHtml&&--a;return new mxRectangleShape(new mxRectangle(0,0,a,a),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)}; mxEdgeHandler.prototype.createLabelHandleShape=function(){if(null!=this.labelHandleImage){var a=new mxImageShape(new mxRectangle(0,0,this.labelHandleImage.width,this.labelHandleImage.height),this.labelHandleImage.src);a.preserveImageAspect=!1;return a}a=mxConstants.LABEL_HANDLE_SIZE;return new mxRectangleShape(new mxRectangle(0,0,a,a),mxConstants.LABEL_HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)}; mxEdgeHandler.prototype.initBend=function(a,b){this.preferHtml?(a.dialect=mxConstants.DIALECT_STRICTHTML,a.init(this.graph.container)):(a.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,a.init(this.graph.getView().getOverlayPane()));mxEvent.redirectMouseEvents(a.node,this.graph,this.state,null,null,null,b);mxClient.IS_TOUCH&&a.node.setAttribute("pointer-events","none")}; mxEdgeHandler.prototype.getHandleForEvent=function(a){var b=null;if(null!=this.state){var c=function(g){if(null!=g&&(a.isSource(g)||g.intersectsRectangle(e))){var k=a.getGraphX()-g.bounds.getCenterX();g=a.getGraphY()-g.bounds.getCenterY();k=k*k+g*g;if(null==f||k<=f)return f=k,!0}return!1},d=mxEvent.isMouseEvent(a.getEvent())?0:2*this.tolerance,e=this.allowHandleBoundsCheck?new mxRectangle(a.getGraphX()-d,a.getGraphY()-d,d,d):null,f=null;if(null!=this.customHandles&&this.isCustomHandleEvent(a))for(d= this.customHandles.length-1;0<=d;d--)if(c(this.customHandles[d].shape))return mxEvent.CUSTOM_HANDLE-d;null!=this.state.text&&(a.isSource(this.state.text)||c(this.labelShape))&&(b=mxEvent.LABEL_HANDLE);if(null!=this.bends)for(d=0;d<this.bends.length;d++)c(this.bends[d])&&(b=d);if(null!=this.virtualBends&&this.isAddVirtualBendEvent(a))for(d=0;d<this.virtualBends.length;d++)c(this.virtualBends[d])&&(b=mxEvent.VIRTUAL_HANDLE-d)}return b};mxEdgeHandler.prototype.isAddVirtualBendEvent=function(a){return!0}; mxEdgeHandler.prototype.isCustomHandleEvent=function(a){return!0}; mxEdgeHandler.prototype.mouseDown=function(a,b){if((!mxEvent.isMouseEvent(b.getEvent())||mxEvent.isLeftMouseButton(b.getEvent()))&&this.graph.isCellEditable(this.state.cell)){a=this.getHandleForEvent(b);if(null!=this.bends&&null!=this.bends[a]){var c=this.bends[a].bounds;this.snapPoint=new mxPoint(c.getCenterX(),c.getCenterY())}if(this.addEnabled&&null==a&&this.isAddPointEvent(b.getEvent()))this.addPoint(this.state,b.getEvent()),b.consume();else if(null!=a&&!b.isConsumed()&&this.graph.isEnabled()){if(this.removeEnabled&& this.isRemovePointEvent(b.getEvent()))this.removePoint(this.state,a);else if(a!=mxEvent.LABEL_HANDLE||this.graph.isLabelMovable(b.getCell()))a<=mxEvent.VIRTUAL_HANDLE&&mxUtils.setOpacity(this.virtualBends[mxEvent.VIRTUAL_HANDLE-a].node,100),this.mouseDownX=b.getX(),this.mouseDownY=b.getY(),this.handle=a;mxEvent.isShiftDown(b.getEvent())||b.consume()}}}; mxEdgeHandler.prototype.start=function(a,b,c){this.startX=a;this.startY=b;this.isSource=null==this.bends?!1:0==c;this.isTarget=null==this.bends?!1:c==this.bends.length-1;this.isLabel=c==mxEvent.LABEL_HANDLE;if(this.isSource||this.isTarget){if(a=this.state.cell,b=this.graph.model.getTerminal(a,this.isSource),null==b&&this.graph.isTerminalPointMovable(a,this.isSource)||null!=b&&this.graph.isCellDisconnectable(a,b,this.isSource))this.index=c}else this.index=c;if(this.index<=mxEvent.CUSTOM_HANDLE&&this.index> mxEvent.VIRTUAL_HANDLE&&null!=this.customHandles)for(c=0;c<this.customHandles.length;c++)c!=mxEvent.CUSTOM_HANDLE-this.index&&this.customHandles[c].setVisible(!1)};mxEdgeHandler.prototype.clonePreviewState=function(a,b){return this.state.clone()};mxEdgeHandler.prototype.getSnapToTerminalTolerance=function(){return 2};mxEdgeHandler.prototype.updateHint=function(a,b){};mxEdgeHandler.prototype.removeHint=function(){};mxEdgeHandler.prototype.roundLength=function(a){return Math.round(100*a)/100}; mxEdgeHandler.prototype.isSnapToTerminalsEvent=function(a){return this.snapToTerminals&&!mxEvent.isAltDown(a.getEvent())}; mxEdgeHandler.prototype.getPointForEvent=function(a){var b=this.graph.getView(),c=b.scale,d=new mxPoint(this.roundLength(a.getGraphX()/c)*c,this.roundLength(a.getGraphY()/c)*c),e=this.getSnapToTerminalTolerance(),f=!1,g=!1;if(0<e&&this.isSnapToTerminalsEvent(a)){var k=function(n){null!=n&&l.call(this,new mxPoint(b.getRoutingCenterX(n),b.getRoutingCenterY(n)))},l=function(n){if(null!=n){var p=n.x;Math.abs(d.x-p)<e&&(d.x=p,f=!0);n=n.y;Math.abs(d.y-n)<e&&(d.y=n,g=!0)}};k.call(this,this.state.getVisibleTerminalState(!0)); k.call(this,this.state.getVisibleTerminalState(!1));k=this.state.absolutePoints;if(null!=k)for(var m=0;m<k.length;m++)(0<m||!this.state.isFloatingTerminalPoint(!0))&&(m<k.length-1||!this.state.isFloatingTerminalPoint(!1))&&l.call(this,this.state.absolutePoints[m])}this.graph.isGridEnabledEvent(a.getEvent())&&(a=b.translate,f||(d.x=(this.graph.snap(d.x/c-a.x)+a.x)*c),g||(d.y=(this.graph.snap(d.y/c-a.y)+a.y)*c));return d}; mxEdgeHandler.prototype.getPreviewTerminalState=function(a){var b=this.getConstraintHandler();b.update(a,this.isSource,!0,a.isSource(this.marker.highlight.shape)?null:this.currentPoint);if(null!=b.currentFocus&&null!=b.currentConstraint)return null!=this.marker.highlight&&null!=this.marker.highlight.state&&this.marker.highlight.state.cell==b.currentFocus.cell?"transparent"!=this.marker.highlight.shape.stroke&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint()):this.marker.markCell(b.currentFocus.cell, "transparent"),a=this.graph.getModel(),a=this.graph.view.getTerminalPort(this.state,this.graph.view.getState(a.getTerminal(this.state.cell,!this.isSource)),!this.isSource),a=null!=a?a.cell:null,this.error=this.validateConnection(this.isSource?b.currentFocus.cell:a,this.isSource?a:b.currentFocus.cell),a=null,null==this.error&&(a=b.currentFocus),(null!=this.error||null!=a&&!this.isCellEnabled(a.cell))&&b.reset(),a;if(this.graph.isIgnoreTerminalEvent(a.getEvent()))return this.marker.reset(),null;this.marker.process(a); a=this.marker.getValidState();null==a||this.isCellEnabled(a.cell)||(b.reset(),this.marker.reset());return this.marker.getValidState()}; mxEdgeHandler.prototype.getPreviewPoints=function(a,b){var c=this.graph.getCellGeometry(this.state.cell);c=null!=c.points?c.points.slice():null;var d=new mxPoint(a.x,a.y),e=null;if(this.isSource||this.isTarget)this.graph.resetEdgesOnConnect&&(c=null);else if(this.convertPoint(d,!1),null==c)c=[d];else{this.index<=mxEvent.VIRTUAL_HANDLE&&c.splice(mxEvent.VIRTUAL_HANDLE-this.index,0,d);if(!this.isSource&&!this.isTarget){for(var f=0;f<this.bends.length;f++)if(f!=this.index){var g=this.bends[f];null!= g&&mxUtils.contains(g.bounds,a.x,a.y)&&(this.index<=mxEvent.VIRTUAL_HANDLE?c.splice(mxEvent.VIRTUAL_HANDLE-this.index,1):c.splice(this.index-1,1),e=c)}if(null==e&&this.straightRemoveEnabled&&(null==b||!mxEvent.isAltDown(b.getEvent()))){b=this.graph.tolerance*this.graph.tolerance;f=this.state.absolutePoints.slice();f[this.index]=a;var k=this.state.getVisibleTerminalState(!0);null!=k&&(g=this.graph.getConnectionConstraint(this.state,k,!0),null==g||null==this.graph.getConnectionPoint(k,g))&&(f[0]=new mxPoint(k.view.getRoutingCenterX(k), k.view.getRoutingCenterY(k)));k=this.state.getVisibleTerminalState(!1);null!=k&&(g=this.graph.getConnectionConstraint(this.state,k,!1),null==g||null==this.graph.getConnectionPoint(k,g))&&(f[f.length-1]=new mxPoint(k.view.getRoutingCenterX(k),k.view.getRoutingCenterY(k)));g=this.index;0<g&&g<f.length-1&&mxUtils.ptSegDistSq(f[g-1].x,f[g-1].y,f[g+1].x,f[g+1].y,a.x,a.y)<b&&(c.splice(g-1,1),e=c)}}null==e&&this.index>mxEvent.VIRTUAL_HANDLE&&(c[this.index-1]=d)}return null!=e?e:c}; mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){if(mxEvent.isShiftDown(a.getEvent())&&mxEvent.isAltDown(a.getEvent()))return!1;var b=mxUtils.getOffset(this.graph.container),c=a.getEvent(),d=mxEvent.getClientX(c);c=mxEvent.getClientY(c);var e=document.documentElement,f=this.currentPoint.x-this.graph.container.scrollLeft+b.x-((window.pageXOffset||e.scrollLeft)-(e.clientLeft||0));b=this.currentPoint.y-this.graph.container.scrollTop+b.y-((window.pageYOffset||e.scrollTop)-(e.clientTop||0));return this.outlineConnect&& (mxEvent.isShiftDown(a.getEvent())&&!mxEvent.isAltDown(a.getEvent())||a.isSource(this.marker.highlight.shape)||!mxEvent.isShiftDown(a.getEvent())&&mxEvent.isAltDown(a.getEvent())&&null!=a.getState()||this.marker.highlight.isHighlightAt(d,c)||(f!=d||b!=c)&&null==a.getState()&&this.marker.highlight.isHighlightAt(f,b))}; mxEdgeHandler.prototype.updatePreviewState=function(a,b,c,d,e){var f=this.isSource?c:this.state.getVisibleTerminalState(!0),g=this.isTarget?c:this.state.getVisibleTerminalState(!1),k=this.graph.getConnectionConstraint(a,f,!0),l=this.graph.getConnectionConstraint(a,g,!1),m=this.getConstraintHandler(),n=m.currentConstraint;null==n&&e&&(null!=c?(d.isSource(this.marker.highlight.shape)&&(b=new mxPoint(d.getGraphX(),d.getGraphY())),n=this.graph.getOutlineConstraint(b,c,d),m.setFocus(d,c,this.isSource), m.currentConstraint=n,m.currentPoint=b):n=new mxConnectionConstraint);if(this.outlineConnect&&null!=this.marker.highlight&&null!=this.marker.highlight.shape){var p=this.graph.view.scale;null!=m.currentConstraint&&null!=m.currentFocus?(this.marker.highlight.shape.stroke=e?mxConstants.OUTLINE_HIGHLIGHT_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/p/p,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.marker.highlight.shape.stroke= this.graph.isCellConnectable(d.getCell())&&this.marker.getValidState()!=d.getState()?"transparent":mxConstants.DEFAULT_VALID_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/p/p,this.marker.highlight.repaint())}this.isSource?k=n:this.isTarget&&(l=n);if(this.isSource||this.isTarget)null!=n&&null!=n.point?(a.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X]=n.point.x,a.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]=n.point.y): (delete a.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X],delete a.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]);a.setVisibleTerminalState(f,!0);a.setVisibleTerminalState(g,!1);this.isSource&&null==f||a.view.updateFixedTerminalPoint(a,f,!0,k);this.isTarget&&null==g||a.view.updateFixedTerminalPoint(a,g,!1,l);(this.isSource||this.isTarget)&&null==c&&(a.setAbsoluteTerminalPoint(b,this.isSource),null==this.marker.getMarkedState()&&(this.error=this.graph.allowDanglingEdges? null:""));a.view.updatePoints(a,this.points,f,g);a.view.updateFloatingTerminalPoints(a,f,g)}; mxEdgeHandler.prototype.mouseMove=function(a,b){if(null!=this.index&&null!=this.marker){var c=this.getConstraintHandler();this.currentPoint=this.getPointForEvent(b);this.error=null;null!=this.snapPoint&&mxEvent.isShiftDown(b.getEvent())&&!this.graph.isIgnoreTerminalEvent(b.getEvent())&&null==c.currentFocus&&c.currentFocus!=this.state&&(Math.abs(this.snapPoint.x-this.currentPoint.x)<Math.abs(this.snapPoint.y-this.currentPoint.y)?this.currentPoint.x=this.snapPoint.x:this.currentPoint.y=this.snapPoint.y); if(this.index<=mxEvent.CUSTOM_HANDLE&&this.index>mxEvent.VIRTUAL_HANDLE)null!=this.customHandles&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(b),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged(),null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display="none"));else if(this.isLabel)this.label.x=this.currentPoint.x,this.label.y=this.currentPoint.y;else{this.points=this.getPreviewPoints(this.currentPoint,b);a=this.isSource||this.isTarget?this.getPreviewTerminalState(b): null;if(null!=c.currentConstraint&&null!=c.currentFocus&&null!=c.currentPoint)this.currentPoint=c.currentPoint.clone();else if(this.outlineConnect){var d=this.isSource||this.isTarget?this.isOutlineConnectEvent(b):!1;d?a=this.marker.highlight.state:null!=a&&a!=b.getState()&&this.graph.isCellConnectable(b.getCell())&&null!=this.marker.highlight.shape&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint(),a=null)}null==a||this.isCellEnabled(a.cell)||(a=null,this.marker.reset()); c=this.clonePreviewState(this.currentPoint,null!=a?a.cell:null);this.updatePreviewState(c,this.currentPoint,a,b,d);this.setPreviewColor(null==this.error?this.marker.validColor:this.marker.invalidColor);this.abspoints=c.absolutePoints;this.active=!0;this.updateHint(b,this.currentPoint,c)}this.drawPreview();mxEvent.consume(b.getEvent());b.consume()}else mxEvent.isShiftDown(b.getEvent())||null==this.handle||null==this.mouseDownX||null==this.mouseDownY||(d=this.graph.tolerance,(Math.abs(this.mouseDownX- b.getX())>d||Math.abs(this.mouseDownY-b.getY())>d)&&this.start(this.mouseDownX,this.mouseDownY,this.handle))}; mxEdgeHandler.prototype.mouseUp=function(a,b){if(null!=this.index&&null!=this.marker){null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display="");a=this.state.cell;var c=this.index;this.index=null;if(b.getX()!=this.startX||b.getY()!=this.startY){var d=!this.graph.isIgnoreTerminalEvent(b.getEvent())&&this.cloneEnabled&&this.graph.isCloneEvent(b.getEvent())&&this.graph.isCellsCloneable();if(null!=this.error)0<this.error.length&&this.graph.validationAlert(this.error);else if(c<=mxEvent.CUSTOM_HANDLE&& c>mxEvent.VIRTUAL_HANDLE){if(null!=this.customHandles){var e=this.graph.getModel();e.beginUpdate();try{this.customHandles[mxEvent.CUSTOM_HANDLE-c].execute(b),null!=this.shape&&null!=this.shape.node&&(this.shape.apply(this.state),this.shape.redraw())}finally{e.endUpdate()}}}else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget)if(c=null,null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&& (c=this.constraintHandler.currentFocus.cell),null==c&&this.marker.hasValidState()&&null!=this.marker.highlight&&null!=this.marker.highlight.shape&&"transparent"!=this.marker.highlight.shape.stroke&&"white"!=this.marker.highlight.shape.stroke&&(c=this.marker.validState.cell),null!=c){e=this.graph.getModel();var f=e.getParent(a);e.beginUpdate();try{if(d){var g=e.getGeometry(a),k=this.graph.cloneCell(a);e.add(f,k,e.getChildCount(f));null!=g&&(g=g.clone(),e.setGeometry(k,g));var l=e.getTerminal(a,!this.isSource); this.graph.connectCell(k,l,!this.isSource);a=k}a=this.connect(a,c,this.isSource,d,b)}finally{e.endUpdate()}}else this.graph.isAllowDanglingEdges()&&(g=this.abspoints[this.isSource?0:this.abspoints.length-1],g.x=this.roundLength(g.x/this.graph.view.scale-this.graph.view.translate.x),g.y=this.roundLength(g.y/this.graph.view.scale-this.graph.view.translate.y),k=this.graph.getView().getState(this.graph.getModel().getParent(a)),null!=k&&(g.x-=k.origin.x,g.y-=k.origin.y),g.x-=this.graph.panDx/this.graph.view.scale, g.y-=this.graph.panDy/this.graph.view.scale,a=this.changeTerminalPoint(a,g,this.isSource,d));else this.active?a=this.changePoints(a,this.points,d):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().validate(this.state.cell))}else this.graph.isToggleEvent(b.getEvent())&&this.graph.selectCellForEvent(this.state.cell,b.getEvent());null!=this.marker&&(this.reset(),a!=this.state.cell&&this.graph.setSelectionCell(a));b.consume()}else null==this.handle||null==this.bends||mxEvent.isAltDown(b.getEvent())|| 0!=this.handle&&this.handle!=this.bends.length-1||(c=this.state.getVisibleTerminal(0==this.handle),null!=c&&(this.graph.selectCellForEvent(c,b.getEvent()),b.consume()));this.mouseDownY=this.mouseDownX=this.handle=null}; mxEdgeHandler.prototype.reset=function(){this.active&&this.refresh();this.snapPoint=this.mouseDownY=this.mouseDownX=this.startY=this.startX=this.handle=this.points=this.label=this.index=this.error=null;this.active=this.isTarget=this.isSource=this.isLabel=!1;if(this.livePreview&&null!=this.sizers)for(var a=0;a<this.sizers.length;a++)null!=this.sizers[a]&&(this.sizers[a].node.style.display="");null!=this.marker&&this.marker.reset();null!=this.constraintHandler&&this.constraintHandler.reset();if(null!= this.customHandles){var b=this.customHandles;for(a=0;a<b.length;a++)null!=b[a]&&b[a].reset()}this.setPreviewColor(mxConstants.EDGE_SELECTION_COLOR);this.removeHint();this.redraw()};mxEdgeHandler.prototype.setPreviewColor=function(a){null!=this.shape&&(this.shape.stroke=a)}; mxEdgeHandler.prototype.convertPoint=function(a,b){var c=this.graph.getView().getScale(),d=this.graph.getView().getTranslate();b&&(a.x=this.graph.snap(a.x),a.y=this.graph.snap(a.y));a.x=this.roundLength(a.x/c-d.x);a.y=this.roundLength(a.y/c-d.y);b=this.graph.getView().getState(this.graph.getModel().getParent(this.state.cell));null!=b&&(a.x-=b.origin.x,a.y-=b.origin.y);return a}; mxEdgeHandler.prototype.moveLabel=function(a,b,c){var d=this.graph.getModel(),e=d.getGeometry(a.cell);if(null!=e){var f=this.graph.getView().scale;e=e.clone();if(e.relative){var g=this.graph.getView().getRelativePoint(a,b,c);e.x=Math.round(1E4*g.x)/1E4;e.y=Math.round(g.y);e.offset=new mxPoint(0,0);g=this.graph.view.getPoint(a,e);e.offset=new mxPoint(Math.round((b-g.x)/f),Math.round((c-g.y)/f))}else{var k=a.absolutePoints;g=k[0];k=k[k.length-1];null!=g&&null!=k&&(e.offset=new mxPoint(Math.round((b- (g.x+(k.x-g.x)/2))/f),Math.round((c-(g.y+(k.y-g.y)/2))/f)),e.x=0,e.y=0)}d.setGeometry(a.cell,e)}};mxEdgeHandler.prototype.connect=function(a,b,c,d,e){d=this.graph.getModel();d.beginUpdate();try{var f=null!=this.constraintHandler?this.constraintHandler.currentConstraint:null;null==f&&(f=new mxConnectionConstraint);this.graph.connectCell(a,b,c,f)}finally{d.endUpdate()}return a}; mxEdgeHandler.prototype.changeTerminalPoint=function(a,b,c,d){var e=this.graph.getModel();e.beginUpdate();try{if(d){var f=e.getParent(a),g=e.getTerminal(a,!c);a=this.graph.cloneCell(a);e.add(f,a,e.getChildCount(f));e.setTerminal(a,g,!c)}var k=e.getGeometry(a);null!=k&&(k=k.clone(),k.setTerminalPoint(b,c),e.setGeometry(a,k),this.graph.connectCell(a,null,c,new mxConnectionConstraint))}finally{e.endUpdate()}return a}; mxEdgeHandler.prototype.changePoints=function(a,b,c){var d=this.graph.getModel();d.beginUpdate();try{if(c){var e=d.getParent(a),f=d.getTerminal(a,!0),g=d.getTerminal(a,!1);a=this.graph.cloneCell(a);d.add(e,a,d.getChildCount(e));d.setTerminal(a,f,!0);d.setTerminal(a,g,!1)}var k=d.getGeometry(a);null!=k&&(k=k.clone(),k.points=b,d.setGeometry(a,k))}finally{d.endUpdate()}return a}; mxEdgeHandler.prototype.addPoint=function(a,b){var c=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),d=this.graph.isGridEnabledEvent(b);this.convertPoint(c,d);this.addPointAt(a,c.x,c.y);mxEvent.consume(b)}; mxEdgeHandler.prototype.addPointAt=function(a,b,c){var d=this.graph.getCellGeometry(a.cell);b=new mxPoint(b,c);if(null!=d){d=d.clone();var e=this.graph.view.translate;c=this.graph.view.scale;e=new mxPoint(e.x*c,e.y*c);var f=this.graph.model.getParent(this.state.cell);this.graph.model.isVertex(f)&&(e=this.graph.view.getState(f),e=new mxPoint(e.x,e.y));c=mxUtils.findNearestSegment(a,b.x*c+e.x,b.y*c+e.y);null==d.points?d.points=[b]:d.points.splice(c,0,b);this.graph.getModel().setGeometry(a.cell,d);this.refresh(); this.redraw()}};mxEdgeHandler.prototype.removePoint=function(a,b){if(0<b&&b<this.abspoints.length-1){var c=this.graph.getCellGeometry(this.state.cell);null!=c&&null!=c.points&&(c=c.clone(),c.points.splice(b-1,1),this.graph.getModel().setGeometry(a.cell,c),this.refresh(),this.redraw())}}; mxEdgeHandler.prototype.getHandleFillColor=function(a){a=0==a;var b=this.state.cell,c=this.graph.getModel().getTerminal(b,a),d=mxConstants.HANDLE_FILLCOLOR;null!=c&&!this.graph.isCellDisconnectable(b,c,a)||null==c&&!this.graph.isTerminalPointMovable(b,a)?d=mxConstants.LOCKED_HANDLE_FILLCOLOR:null!=c&&this.graph.isCellDisconnectable(b,c,a)&&(d=mxConstants.CONNECT_HANDLE_FILLCOLOR);return d}; mxEdgeHandler.prototype.redraw=function(a){if(null!=this.state&&null!=this.state.absolutePoints){this.abspoints=this.state.absolutePoints.slice();var b=this.graph.getModel().getGeometry(this.state.cell);if(null!=b&&(b=b.points,null!=this.bends&&0<this.bends.length&&null!=b)){null==this.points&&(this.points=[]);for(var c=1;c<this.bends.length-1;c++)null!=this.bends[c]&&null!=this.abspoints[c]&&(this.points[c-1]=b[c-1])}this.drawPreview();a||this.redrawHandles()}}; mxEdgeHandler.prototype.isTerminalHandleVisible=function(a){return!0}; mxEdgeHandler.prototype.redrawHandles=function(){var a=this.state.cell;if(null!=this.labelShape){var b=this.labelShape.bounds;this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y);this.labelShape.bounds=new mxRectangle(Math.round(this.label.x-b.width/2),Math.round(this.label.y-b.height/2),b.width,b.height);b=this.graph.getLabel(a);this.labelShape.visible=null!=b&&0<b.length&&this.graph.isCellEditable(this.state.cell)&&this.graph.isLabelMovable(a)&&this.isHandlesVisible()}if(null!= this.abspoints&&null!=this.bends&&0<this.bends.length){var c=this.abspoints.length-1;a=this.abspoints[0];var d=a.x,e=a.y;b=this.bends[0].bounds;this.bends[0].bounds=new mxRectangle(Math.floor(d-b.width/2),Math.floor(e-b.height/2),b.width,b.height);this.bends[0].fill=this.getHandleFillColor(0);this.bends[0].redraw();this.manageLabelHandle&&this.checkLabelHandle(this.bends[0].bounds);this.bends[0].node.style.visibility=this.isHandlesVisible()&&this.isTerminalHandleVisible(!0)?"":"hidden";c=this.abspoints[c]; d=c.x;e=c.y;var f=this.bends.length-1;b=this.bends[f].bounds;this.bends[f].bounds=new mxRectangle(Math.floor(d-b.width/2),Math.floor(e-b.height/2),b.width,b.height);this.bends[f].fill=this.getHandleFillColor(f);this.bends[f].redraw();this.manageLabelHandle&&this.checkLabelHandle(this.bends[f].bounds);this.bends[f].node.style.visibility=this.isHandlesVisible()&&this.isTerminalHandleVisible(!1)?"":"hidden";this.redrawInnerBends(a,c)}if(null!=this.abspoints&&null!=this.virtualBends&&0<this.virtualBends.length)for(c= this.abspoints[0],a=0;a<this.virtualBends.length;a++)null!=this.virtualBends[a]&&null!=this.abspoints[a+1]&&(d=this.abspoints[a+1],b=this.virtualBends[a],b.bounds=new mxRectangle(Math.floor(c.x+(d.x-c.x)/2-b.bounds.width/2),Math.floor(c.y+(d.y-c.y)/2-b.bounds.height/2),b.bounds.width,b.bounds.height),b.redraw(),mxUtils.setOpacity(b.node,this.virtualBendOpacity),c=d,this.manageLabelHandle&&this.checkLabelHandle(b.bounds),b.node.style.visibility=this.isHandlesVisible()?"":"hidden");null!=this.labelShape&& this.labelShape.redraw();if(null!=this.customHandles)for(a=0;a<this.customHandles.length;a++)b=this.customHandles[a].shape.node.style.display,this.customHandles[a].redraw(),this.customHandles[a].shape.node.style.display=b,this.customHandles[a].shape.node.style.visibility=!this.graph.isEditing()&&this.isHandlesVisible()&&this.isCustomHandleVisible(this.customHandles[a])?"":"hidden"};mxEdgeHandler.prototype.isCustomHandleVisible=function(a){return 1==this.state.view.graph.getSelectionCount()}; mxEdgeHandler.prototype.setHandlesVisible=function(a){if(null!=this.bends)for(var b=0;b<this.bends.length;b++)null!=this.bends[b]&&(this.bends[b].node.style.display=a?"":"none");if(null!=this.virtualBends)for(b=0;b<this.virtualBends.length;b++)null!=this.virtualBends[b]&&(this.virtualBends[b].node.style.display=a?"":"none");null!=this.labelShape&&(this.labelShape.node.style.display=a?"":"none");if(null!=this.customHandles)for(b=0;b<this.customHandles.length;b++)this.customHandles[b].setVisible(a)}; mxEdgeHandler.prototype.setInnerBendsOpacity=function(a,b,c){var d=this.graph.getCellGeometry(this.state.cell);if(null!=d&&(null==d.points||0==d.points.length))for(;b<c;b++)null!=a[b]&&mxUtils.setOpacity(a[b].node,this.virtualBendOpacity)}; mxEdgeHandler.prototype.redrawInnerBends=function(a,b){for(a=1;a<this.bends.length-1;a++)if(null!=this.bends[a])if(null!=this.abspoints[a]){b=this.abspoints[a].x;var c=this.abspoints[a].y,d=this.bends[a].bounds;this.bends[a].bounds=new mxRectangle(Math.round(b-d.width/2),Math.round(c-d.height/2),d.width,d.height);this.manageLabelHandle?this.checkLabelHandle(this.bends[a].bounds):null==this.handleImage&&this.labelShape.visible&&mxUtils.intersects(this.bends[a].bounds,this.labelShape.bounds)&&(w=mxConstants.HANDLE_SIZE+ 3,h=mxConstants.HANDLE_SIZE+3,this.bends[a].bounds=new mxRectangle(Math.round(b-w/2),Math.round(c-h/2),w,h));this.bends[a].redraw();this.bends[a].node.style.visibility=this.isHandlesVisible()?"":"hidden"}else this.bends[a].destroy(),this.bends[a]=null};mxEdgeHandler.prototype.checkLabelHandle=function(a){if(null!=this.labelShape){var b=this.labelShape.bounds;mxUtils.intersects(a,b)&&(a.getCenterY()<b.getCenterY()?b.y=a.y+a.height:b.y=a.y-b.height)}}; mxEdgeHandler.prototype.drawPreview=function(){try{if(this.isLabel){var a=this.labelShape.bounds,b=new mxRectangle(Math.round(this.label.x-a.width/2),Math.round(this.label.y-a.height/2),a.width,a.height);this.labelShape.bounds.equals(b)||(this.labelShape.bounds=b,this.labelShape.redraw())}null==this.shape||mxUtils.equalPoints(this.shape.points,this.abspoints)||(this.shape.apply(this.state),this.shape.points=this.abspoints.slice(),this.shape.scale=this.state.view.scale,this.shape.isDashed=this.isSelectionDashed(), this.shape.stroke=this.getSelectionColor(),this.shape.strokewidth=this.getSelectionStrokeWidth()/this.shape.scale/this.shape.scale,this.shape.isShadow=!1,this.shape.redraw());this.updateParentHighlight()}catch(c){}};mxEdgeHandler.prototype.isHandlesVisible=function(){return!this.graph.isCellLocked(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||this.graph.getSelectionCount()<=mxGraphHandler.prototype.maxCells)}; mxEdgeHandler.prototype.refresh=function(){if(null!=this.state){var a=this.state.getVisibleTerminalState(!0),b=this.state.getVisibleTerminalState(!1),c=this.graph.getCellGeometry(this.state.cell);this.edgeStyle=null!=c?this.graph.view.getEdgeStyle(this.state,c.points,a,b):null;this.abspoints=this.getSelectionPoints(this.state);this.points=[];null!=this.shape&&(this.shape.isDashed=this.isSelectionDashed(),this.shape.stroke=this.getSelectionColor(),this.shape.isShadow=!1,this.shape.redraw());null!= this.bends&&(this.destroyBends(this.bends),this.bends=null);this.isHandlesVisible()&&(this.bends=this.createBends());null!=this.virtualBends&&(this.destroyBends(this.virtualBends),this.virtualBends=null);this.isHandlesVisible()&&this.edgeStyle!=mxEdgeStyle.EntityRelation&&(this.virtualBends=this.createVirtualBends());null!=this.customHandles&&(this.destroyBends(this.customHandles),this.customHandles=null);this.isHandlesVisible()&&(this.customHandles=this.createCustomHandles());null!=this.labelShape&& (this.labelShape.destroy(),this.labelShape=null);this.isHandlesVisible()&&(this.labelShape=this.createLabelShape(),null!=this.labelShape&&null!=this.labelShape.node&&null!=this.labelShape.node.parentNode&&this.labelShape.node.parentNode.appendChild(this.labelShape.node))}};mxEdgeHandler.prototype.isDestroyed=function(){return null==this.shape};mxEdgeHandler.prototype.destroyBends=function(a){if(null!=a)for(var b=0;b<a.length;b++)null!=a[b]&&a[b].destroy()}; mxEdgeHandler.prototype.destroy=function(){null!=this.escapeHandler&&(this.state.view.graph.removeListener(this.escapeHandler),this.escapeHandler=null);null!=this.marker&&(this.marker.destroy(),this.marker=null);null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.labelShape&&(this.labelShape.destroy(),this.labelShape=null);null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null);null!=this.parentHighlight&&this.destroyParentHighlight();this.destroyBends(this.virtualBends); this.virtualBends=null;this.destroyBends(this.customHandles);this.customHandles=null;this.destroyBends(this.bends);this.bends=null;this.removeHint()};function mxElbowEdgeHandler(a){mxEdgeHandler.call(this,a)}mxUtils.extend(mxElbowEdgeHandler,mxEdgeHandler);mxElbowEdgeHandler.prototype.flipEnabled=!0;mxElbowEdgeHandler.prototype.doubleClickOrientationResource="none"!=mxClient.language?"doubleClickOrientation":""; mxElbowEdgeHandler.prototype.createBends=function(){var a=[],b=this.createHandleShape(0);this.initBend(b);b.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);a.push(b);a.push(this.createVirtualBend(mxUtils.bind(this,function(c){!mxEvent.isConsumed(c)&&this.flipEnabled&&(this.graph.flipEdge(this.state.cell,c),mxEvent.consume(c))})));this.points.push(new mxPoint(0,0));b=this.createHandleShape(2,null,!0);this.initBend(b);b.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);a.push(b);return a}; mxElbowEdgeHandler.prototype.createVirtualBends=function(){return null};mxElbowEdgeHandler.prototype.createVirtualBend=function(a){var b=this.createHandleShape();this.initBend(b,a);b.setCursor(this.getCursorForBend());this.graph.isCellBendable(this.state.cell)||(b.node.style.display="none");return b}; mxElbowEdgeHandler.prototype.getCursorForBend=function(){return this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.TopToBottom||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_TOPTOBOTTOM||(this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.ElbowConnector||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_ELBOW)&&this.state.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL?"row-resize":"col-resize"}; mxElbowEdgeHandler.prototype.getTooltipForNode=function(a){var b=null;null==this.bends||null==this.bends[1]||a!=this.bends[1].node&&a.parentNode!=this.bends[1].node||(b=this.doubleClickOrientationResource,b=mxResources.get(b)||b);return b}; mxElbowEdgeHandler.prototype.convertPoint=function(a,b){var c=this.graph.getView().getScale(),d=this.graph.getView().getTranslate(),e=this.state.origin;b&&(a.x=this.graph.snap(a.x),a.y=this.graph.snap(a.y));a.x=this.roundLength(a.x/c-d.x-e.x);a.y=this.roundLength(a.y/c-d.y-e.y);return a}; mxElbowEdgeHandler.prototype.redrawInnerBends=function(a,b){var c=this.graph.getModel().getGeometry(this.state.cell),d=this.state.absolutePoints,e=null;1<d.length?(a=d[1],b=d[d.length-2]):null!=c.points&&0<c.points.length&&(e=d[0]);e=null==e?new mxPoint(a.x+(b.x-a.x)/2,a.y+(b.y-a.y)/2):new mxPoint(this.graph.getView().scale*(e.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(e.y+this.graph.getView().translate.y+this.state.origin.y));b=this.bends[1].bounds;a=b.width; b=b.height;a=new mxRectangle(Math.round(e.x-a/2),Math.round(e.y-b/2),a,b);this.manageLabelHandle?this.checkLabelHandle(a):null==this.handleImage&&this.labelShape.visible&&mxUtils.intersects(a,this.labelShape.bounds)&&(a=mxConstants.HANDLE_SIZE+3,b=mxConstants.HANDLE_SIZE+3,a=new mxRectangle(Math.floor(e.x-a/2),Math.floor(e.y-b/2),a,b));this.bends[1].bounds=a;this.bends[1].redraw();this.setInnerBendsOpacity(this.bends,1,2);this.manageLabelHandle&&this.checkLabelHandle(this.bends[1].bounds)}; function mxEdgeSegmentHandler(a){mxEdgeHandler.call(this,a)}mxUtils.extend(mxEdgeSegmentHandler,mxElbowEdgeHandler); mxEdgeSegmentHandler.prototype.getCurrentPoints=function(){var a=this.state.absolutePoints;if(null!=a){var b=Math.max(1,this.graph.view.scale);if(2==a.length||3==a.length&&(Math.abs(a[0].x-a[1].x)<b&&Math.abs(a[1].x-a[2].x)<b||Math.abs(a[0].y-a[1].y)<b&&Math.abs(a[1].y-a[2].y)<b)){b=a[0].x+(a[a.length-1].x-a[0].x)/2;var c=a[0].y+(a[a.length-1].y-a[0].y)/2;a=[a[0],new mxPoint(b,c),new mxPoint(b,c),a[a.length-1]]}}return a}; mxEdgeSegmentHandler.prototype.getPreviewPoints=function(a){if(this.isSource||this.isTarget)return mxElbowEdgeHandler.prototype.getPreviewPoints.apply(this,arguments);var b=this.getCurrentPoints(),c=this.convertPoint(b[0].clone(),!1);a=this.convertPoint(a.clone(),!1);for(var d=[],e=1;e<b.length;e++){var f=this.convertPoint(b[e].clone(),!1);e==this.index&&(1>Math.abs(c.x-f.x)&&(c.x=a.x,f.x=a.x),1>Math.abs(c.y-f.y)&&(c.y=a.y,f.y=a.y));e<b.length-1&&d.push(f);c=f}if(1==d.length){b=this.state.getVisibleTerminalState(!0); c=this.state.getVisibleTerminalState(!1);f=this.state.view.getScale();var g=this.state.view.getTranslate();e=d[0].x*f+g.x;f=d[0].y*f+g.y;if(null!=b&&mxUtils.contains(b,e,f)||null!=c&&mxUtils.contains(c,e,f))d=[a,a]}return d}; mxEdgeSegmentHandler.prototype.updatePreviewState=function(a,b,c,d){mxEdgeHandler.prototype.updatePreviewState.apply(this,arguments);if(!this.isSource&&!this.isTarget){b=this.convertPoint(b.clone(),!1);for(var e=a.absolutePoints,f=e[0],g=e[1],k=[],l=2;l<e.length;l++){var m=e[l];0==Math.round(f.x-g.x)&&0==Math.round(g.x-m.x)||0==Math.round(f.y-g.y)&&0==Math.round(g.y-m.y)||k.push(this.convertPoint(g.clone(),!1));f=g;g=m}f=this.state.getVisibleTerminalState(!0);g=this.state.getVisibleTerminalState(!1); l=this.state.absolutePoints;if(0==k.length&&(0==Math.round(e[0].x-e[e.length-1].x)||0==Math.round(e[0].y-e[e.length-1].y)))k=[b,b];else if(5==e.length&&2==k.length&&null!=f&&null!=g&&null!=l&&0==Math.round(l[0].x-l[l.length-1].x)){k=this.graph.getView();l=k.getScale();m=k.getTranslate();e=k.getRoutingCenterY(f)/l-m.y;var n=this.graph.getConnectionConstraint(a,f,!0);null!=n&&(n=this.graph.getConnectionPoint(f,n),null!=n&&(this.convertPoint(n,!1),e=n.y));k=k.getRoutingCenterY(g)/l-m.y;if(l=this.graph.getConnectionConstraint(a, g,!1))n=this.graph.getConnectionPoint(g,l),null!=n&&(this.convertPoint(n,!1),k=n.y);k=[new mxPoint(b.x,e),new mxPoint(b.x,k)]}this.points=k;a.view.updateFixedTerminalPoints(a,f,g);a.view.updatePoints(a,this.points,f,g);a.view.updateFloatingTerminalPoints(a,f,g)}}; mxEdgeSegmentHandler.prototype.connect=function(a,b,c,d,e){var f=this.graph.getModel(),g=f.getGeometry(a),k=null;if(null!=g&&null!=g.points&&0<g.points.length){var l=this.abspoints,m=l[0],n=l[1];k=[];for(var p=2;p<l.length;p++){var q=l[p];0==Math.round(m.x-n.x)&&0==Math.round(n.x-q.x)||0==Math.round(m.y-n.y)&&0==Math.round(n.y-q.y)||k.push(this.convertPoint(n.clone(),!1));m=n;n=q}}f.beginUpdate();try{null!=k&&(g=f.getGeometry(a),null!=g&&(g=g.clone(),g.points=k,f.setGeometry(a,g))),a=mxEdgeHandler.prototype.connect.apply(this, arguments)}finally{f.endUpdate()}return a};mxEdgeSegmentHandler.prototype.getTooltipForNode=function(a){return null};mxEdgeSegmentHandler.prototype.start=function(a,b,c){mxEdgeHandler.prototype.start.apply(this,arguments);null==this.bends||null==this.bends[c]||this.isSource||this.isTarget||mxUtils.setOpacity(this.bends[c].node,100)}; mxEdgeSegmentHandler.prototype.createBends=function(){var a=[],b=this.getCurrentPoints();if(null!=b){var c=this.createHandleShape(0);this.initBend(c);c.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);a.push(c);if(this.graph.isCellBendable(this.state.cell)){null==this.points&&(this.points=[]);for(var d=0;d<b.length-1;d++){c=this.createVirtualBend();a.push(c);var e=0==Math.round(b[d].x-b[d+1].x);0==Math.round(b[d].y-b[d+1].y)&&d<b.length-2&&(e=0==Math.round(b[d].x-b[d+2].x));c.setCursor(e?"col-resize": "row-resize");this.points.push(new mxPoint(0,0))}}c=this.createHandleShape(b.length,null,!0);this.initBend(c);c.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE);a.push(c)}return a};mxEdgeSegmentHandler.prototype.createVirtualBends=function(){return null}; mxEdgeSegmentHandler.prototype.redrawInnerBends=function(a,b){if(this.graph.isCellBendable(this.state.cell)){var c=this.getCurrentPoints();if(null!=c&&1<c.length){var d=!1;if(4==c.length&&0==Math.round(c[1].x-c[2].x)&&0==Math.round(c[1].y-c[2].y))if(d=!0,0==Math.round(c[0].y-c[c.length-1].y)){var e=c[0].x+(c[c.length-1].x-c[0].x)/2;c[1]=new mxPoint(e,c[1].y);c[2]=new mxPoint(e,c[2].y)}else e=c[0].y+(c[c.length-1].y-c[0].y)/2,c[1]=new mxPoint(c[1].x,e),c[2]=new mxPoint(c[2].x,e);for(e=0;e<c.length- 1;e++)null!=this.bends[e+1]&&(a=c[e],b=c[e+1],a=new mxPoint(a.x+(b.x-a.x)/2,a.y+(b.y-a.y)/2),b=this.bends[e+1].bounds,this.bends[e+1].bounds=new mxRectangle(Math.floor(a.x-b.width/2),Math.floor(a.y-b.height/2),b.width,b.height),this.bends[e+1].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[e+1].bounds));d?(mxUtils.setOpacity(this.bends[1].node,this.virtualBendOpacity),mxUtils.setOpacity(this.bends[3].node,this.virtualBendOpacity)):this.setInnerBendsOpacity(this.bends,1,c.length)}}}; function mxKeyHandler(a,b){null!=a&&(this.graph=a,this.target=b||document.documentElement,this.normalKeys=[],this.shiftKeys=[],this.controlKeys=[],this.controlShiftKeys=[],this.keydownHandler=mxUtils.bind(this,function(c){this.keyDown(c)}),mxEvent.addListener(this.target,"keydown",this.keydownHandler))}mxKeyHandler.prototype.graph=null;mxKeyHandler.prototype.target=null;mxKeyHandler.prototype.normalKeys=null;mxKeyHandler.prototype.shiftKeys=null;mxKeyHandler.prototype.controlKeys=null; mxKeyHandler.prototype.controlShiftKeys=null;mxKeyHandler.prototype.enabled=!0;mxKeyHandler.prototype.isEnabled=function(){return this.enabled};mxKeyHandler.prototype.setEnabled=function(a){this.enabled=a};mxKeyHandler.prototype.bindKey=function(a,b){this.normalKeys[a]=b};mxKeyHandler.prototype.bindShiftKey=function(a,b){this.shiftKeys[a]=b};mxKeyHandler.prototype.bindControlKey=function(a,b){this.controlKeys[a]=b}; mxKeyHandler.prototype.bindControlShiftKey=function(a,b){this.controlShiftKeys[a]=b};mxKeyHandler.prototype.isControlDown=function(a){return mxEvent.isControlDown(a)};mxKeyHandler.prototype.getFunction=function(a){return null==a||mxEvent.isAltDown(a)?null:this.isControlDown(a)?mxEvent.isShiftDown(a)?this.controlShiftKeys[a.keyCode]:this.controlKeys[a.keyCode]:mxEvent.isShiftDown(a)?this.shiftKeys[a.keyCode]:this.normalKeys[a.keyCode]}; mxKeyHandler.prototype.isGraphEvent=function(a){var b=mxEvent.getSource(a);return b==this.target||b.parentNode==this.target||null!=this.graph.cellEditor&&this.graph.cellEditor.isEventSource(a)?!0:mxUtils.isAncestorNode(this.graph.container,b)};mxKeyHandler.prototype.keyDown=function(a){if(this.isEnabledForEvent(a))if(27==a.keyCode)this.escape(a);else if(!this.isEventIgnored(a)){var b=this.getFunction(a);null!=b&&(b(a),mxEvent.consume(a))}}; mxKeyHandler.prototype.isEnabledForEvent=function(a){return this.graph.isEnabled()&&!mxEvent.isConsumed(a)&&this.isGraphEvent(a)&&this.isEnabled()};mxKeyHandler.prototype.isEventIgnored=function(a){return this.graph.isEditing()};mxKeyHandler.prototype.escape=function(a){this.graph.isEscapeEnabled()&&this.graph.escape(a)}; mxKeyHandler.prototype.destroy=function(){null!=this.target&&null!=this.keydownHandler&&(mxEvent.removeListener(this.target,"keydown",this.keydownHandler),this.keydownHandler=null);this.target=null};function mxTooltipHandler(a,b){null!=a&&(this.graph=a,this.delay=b||500,this.graph.addMouseListener(this))}mxTooltipHandler.prototype.zIndex=10005;mxTooltipHandler.prototype.graph=null;mxTooltipHandler.prototype.delay=null;mxTooltipHandler.prototype.ignoreTouchEvents=!0; mxTooltipHandler.prototype.hideOnHover=!1;mxTooltipHandler.prototype.destroyed=!1;mxTooltipHandler.prototype.enabled=!1;mxTooltipHandler.prototype.isEnabled=function(){return this.enabled};mxTooltipHandler.prototype.setEnabled=function(a){this.enabled=a};mxTooltipHandler.prototype.isHideOnHover=function(){return this.hideOnHover};mxTooltipHandler.prototype.setHideOnHover=function(a){this.hideOnHover=a}; mxTooltipHandler.prototype.init=function(){null!=document.body&&(this.div=document.createElement("div"),this.div.className="mxTooltip",this.div.style.visibility="hidden",document.body.appendChild(this.div),mxEvent.addGestureListeners(this.div,mxUtils.bind(this,function(a){"A"!=mxEvent.getSource(a).nodeName&&this.hideTooltip()})))};mxTooltipHandler.prototype.getStateForEvent=function(a){return a.getState()};mxTooltipHandler.prototype.mouseDown=function(a,b){this.reset(b,!1);this.hideTooltip()}; mxTooltipHandler.prototype.mouseMove=function(a,b){if(b.getX()!=this.lastX||b.getY()!=this.lastY)this.reset(b,!0),a=this.getStateForEvent(b),(this.isHideOnHover()||a!=this.state||b.getSource()!=this.node&&(!this.stateSource||null!=a&&this.stateSource==(b.isSource(a.shape)||!b.isSource(a.text))))&&this.hideTooltip();this.lastX=b.getX();this.lastY=b.getY()};mxTooltipHandler.prototype.mouseUp=function(a,b){this.reset(b,!0);this.hideTooltip()}; mxTooltipHandler.prototype.resetTimer=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null)}; mxTooltipHandler.prototype.reset=function(a,b,c){if(!this.ignoreTouchEvents||mxEvent.isMouseEvent(a.getEvent()))if(this.resetTimer(),c=null!=c?c:this.getStateForEvent(a),b&&this.isEnabled()&&null!=c&&(null==this.div||"hidden"==this.div.style.visibility)){var d=a.getSource(),e=a.getX(),f=a.getY(),g=a.isSource(c.shape)||a.isSource(c.text);this.thread=window.setTimeout(mxUtils.bind(this,function(){if(!this.graph.isEditing()&&!this.graph.popupMenuHandler.isMenuShowing()&&!this.graph.isMouseDown){var k= this.graph.getTooltip(c,d,e,f);this.show(k,e,f);this.state=c;this.node=d;this.stateSource=g}}),this.delay)}};mxTooltipHandler.prototype.hide=function(){this.resetTimer();this.hideTooltip()};mxTooltipHandler.prototype.hideTooltip=function(){null!=this.div&&(this.div.style.visibility="hidden",this.div.innerText="")}; mxTooltipHandler.prototype.show=function(a,b,c){if(!this.destroyed&&null!=a&&0<a.length){null==this.div&&this.init();var d=mxUtils.getScrollOrigin();this.div.style.zIndex=this.zIndex;this.div.style.left=b+d.x+"px";this.div.style.top=c+mxConstants.TOOLTIP_VERTICAL_OFFSET+d.y+"px";mxUtils.isNode(a)?(this.div.style.whiteSpace="",this.div.innerText="",this.div.appendChild(a)):(this.div.style.whiteSpace="pre-line",this.div.innerHTML=a);this.div.style.visibility="";mxUtils.fit(this.div)}}; mxTooltipHandler.prototype.destroy=function(){this.destroyed||(this.graph.removeMouseListener(this),mxEvent.release(this.div),null!=this.div&&null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.destroyed=!0,this.div=null)};function mxCellTracker(a,b,c){mxCellMarker.call(this,a,b);this.graph.addMouseListener(this);null!=c&&(this.getCell=c)}mxUtils.extend(mxCellTracker,mxCellMarker);mxCellTracker.prototype.mouseDown=function(a,b){}; mxCellTracker.prototype.mouseMove=function(a,b){this.isEnabled()&&this.process(b)};mxCellTracker.prototype.mouseUp=function(a,b){};mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))}; function mxCellHighlight(a,b,c,d){null!=a&&(this.graph=a,this.highlightColor=null!=b?b:mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=null!=c?c:mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=null!=d?d:!1,this.opacity=mxConstants.HIGHLIGHT_OPACITY,this.repaintHandler=mxUtils.bind(this,function(){if(null!=this.state){var e=this.graph.view.getState(this.state.cell);null==e?this.hide():(this.state=e,this.repaint())}}),this.graph.getView().addListener(mxEvent.SCALE,this.repaintHandler),this.graph.getView().addListener(mxEvent.TRANSLATE, this.repaintHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.repaintHandler),this.resetHandler=mxUtils.bind(this,function(){this.hide()}),this.graph.getView().addListener(mxEvent.DOWN,this.resetHandler),this.graph.getView().addListener(mxEvent.UP,this.resetHandler))}mxCellHighlight.prototype.keepOnTop=!1;mxCellHighlight.prototype.graph=null;mxCellHighlight.prototype.state=null; mxCellHighlight.prototype.spacing=0;mxCellHighlight.prototype.resetHandler=null;mxCellHighlight.prototype.setHighlightColor=function(a){this.highlightColor=a;null!=this.shape&&(this.shape.stroke=a)};mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape();this.repaint();this.keepOnTop||this.shape.node.parentNode.firstChild==this.shape.node||this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)}; mxCellHighlight.prototype.createShape=function(){var a=this.graph.cellRenderer.createShape(this.state);a.svgStrokeTolerance=this.graph.tolerance;a.points=this.state.absolutePoints;a.apply(this.state);a.stroke=this.highlightColor;a.opacity=this.opacity;a.isDashed=this.dashed;a.isShadow=!1;a.dialect=mxConstants.DIALECT_SVG;a.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(a.node,this.graph,this.state);this.graph.dialect!=mxConstants.DIALECT_SVG?a.pointerEvents=!1:a.svgPointerEvents= "stroke";return a};mxCellHighlight.prototype.getStrokeWidth=function(a){return this.strokeWidth}; mxCellHighlight.prototype.repaint=function(){null!=this.state&&null!=this.shape&&(this.shape.scale=this.state.view.scale,this.graph.model.isEdge(this.state.cell)?(this.shape.strokewidth=this.getStrokeWidth(),this.shape.points=this.state.absolutePoints,this.shape.outline=!1):(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),this.shape.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]|| "0"),this.shape.strokewidth=this.getStrokeWidth()/this.state.view.scale,this.shape.outline=!0),null!=this.state.shape&&this.shape.setCursor(this.state.shape.getCursor()),this.shape.redraw())};mxCellHighlight.prototype.hide=function(){this.highlight(null)};mxCellHighlight.prototype.highlight=function(a){this.state!=a&&(null!=this.shape&&(this.shape.destroy(),this.shape=null),this.state=a,null!=this.state&&this.drawHighlight())}; mxCellHighlight.prototype.isHighlightAt=function(a,b){var c=!1;if(null!=this.shape&&null!=document.elementFromPoint)for(a=document.elementFromPoint(a,b);null!=a;){if(a==this.shape.node){c=!0;break}a=a.parentNode}return c};mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler);this.graph.getView().removeListener(this.repaintHandler);this.graph.getModel().removeListener(this.repaintHandler);null!=this.shape&&(this.shape.destroy(),this.shape=null)}; var mxCodecRegistry={codecs:Object.create(null),aliases:Object.create(null),register:function(a){if(null!=a){var b=a.getName();mxCodecRegistry.codecs[b]=a;var c=mxUtils.getFunctionName(a.template.constructor);c!=b&&mxCodecRegistry.addAlias(c,b)}return a},addAlias:function(a,b){mxCodecRegistry.aliases[a]=b},getCodec:function(a){var b=null;if(null!=a){b=mxUtils.getFunctionName(a);var c=mxCodecRegistry.aliases[b];null!=c&&(b=c);b=mxCodecRegistry.codecs[b];if(null==b)try{b=new mxObjectCodec(new a),mxCodecRegistry.register(b)}catch(d){}}return b}}; function mxCodec(a){this.document=a||mxUtils.createXmlDocument();this.duplicates=Object.create(null);this.objects=Object.create(null)}mxCodec.allowlist=null;mxCodec.prototype.document=null;mxCodec.prototype.objects=null;mxCodec.prototype.elements=null;mxCodec.prototype.duplicates=null;mxCodec.prototype.encodeDefaults=!1;mxCodec.prototype.putObject=function(a,b){return null!=this.duplicates[a]?(null!=window.console&&console.error(this.duplicates[a]),b):this.objects[a]=b}; mxCodec.prototype.getObject=function(a){var b=null;null!=a&&(b=this.objects[a],null==b&&(b=this.lookup(a),null==b&&(a=this.getElementById(a),null!=a&&(b=this.decode(a)))));return b};mxCodec.prototype.lookup=function(a){return null};mxCodec.prototype.getElementById=function(a){this.updateElements();return this.elements[a]};mxCodec.prototype.updateElements=function(){null==this.elements&&(this.elements=Object.create(null),null!=this.document.documentElement&&this.addElement(this.document.documentElement))}; mxCodec.prototype.addElement=function(a){if(a.nodeType==mxConstants.NODETYPE_ELEMENT){var b=a.getAttribute("id");null!=b&&(null==this.elements[b]?this.elements[b]=a:this.elements[b]!=a&&(this.duplicates[b]="Duplicate ID '"+b+"'",null!=window.console&&console.error("mxCodec.addElement: "+this.duplicates[b])))}for(a=a.firstChild;null!=a;)this.addElement(a),a=a.nextSibling};mxCodec.prototype.isObjectIgnored=function(a){return null==a}; mxCodec.prototype.getId=function(a){var b=null;null==a||this.isObjectIgnored(a)||(b=this.reference(a),null==b&&a instanceof mxCell&&(b=a.getId(),null==b&&(b=mxCellPath.create(a),0==b.length&&(b="root"))));return b};mxCodec.prototype.reference=function(a){return null}; mxCodec.prototype.encode=function(a){var b=null;if(null!=a&&null!=a.constructor&&!this.isObjectIgnored(a)){var c=mxCodecRegistry.getCodec(a.constructor);null!=c?b=c.encode(this,a):mxUtils.isNode(a)?b=mxUtils.importNode(this.document,a,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(a.constructor))}return b}; mxCodec.prototype.decode=function(a,b){this.updateElements();var c=null;null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT&&(c=this.getConstructor(a.nodeName),c=mxCodecRegistry.getCodec(c),null!=c?c=c.decode(this,a,b):(c=a.cloneNode(!0),c.removeAttribute("as")));return c};mxCodec.prototype.isConstructorAllowed=function(a){return null==mxCodec.allowlist||0<=mxUtils.indexOf(mxCodec.allowlist,a)};mxCodec.prototype.getConstructor=function(a){var b=null;try{this.isConstructorAllowed(a)&&(b=window[a])}catch(c){}return b}; mxCodec.prototype.encodeCell=function(a,b,c){if(!this.isObjectIgnored(a)){var d=this.encode(a);null!=d&&b.appendChild(d);if(null==c||c)for(c=a.getChildCount(),d=0;d<c;d++)this.encodeCell(a.getChildAt(d),b)}};mxCodec.prototype.isCellCodec=function(a){return null!=a&&"function"==typeof a.isCellCodec?a.isCellCodec():!1}; mxCodec.prototype.decodeCell=function(a,b){b=null!=b?b:!0;var c=null;if(null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT){c=mxCodecRegistry.getCodec(a.nodeName);if(!this.isCellCodec(c))for(var d=a.firstChild;null!=d&&!this.isCellCodec(c);)c=mxCodecRegistry.getCodec(d.nodeName),d=d.nextSibling;this.isCellCodec(c)||(c=mxCodecRegistry.getCodec(mxCell));c=c.decode(this,a);b&&this.insertIntoGraph(c)}return c}; mxCodec.prototype.insertIntoGraph=function(a){var b=a.parent,c=a.getTerminal(!0),d=a.getTerminal(!1);a.setTerminal(null,!1);a.setTerminal(null,!0);a.parent=null;if(null!=b){if(b==a)throw Error(b.id+": Self Reference");b.insert(a)}null!=c&&c.insertEdge(a,!0);null!=d&&d.insertEdge(a,!1)};mxCodec.prototype.setAttribute=function(a,b,c){null!=b&&null!=c&&a.setAttribute(b,c)}; function mxObjectCodec(a,b,c,d){this.template=a;this.exclude=null!=b?b:[];this.idrefs=null!=c?c:[];this.mapping=null!=d?d:{};this.reverse={};for(var e in this.mapping)this.reverse[this.mapping[e]]=e}mxObjectCodec.allowEval=!1;mxObjectCodec.isPollutionKey=function(a){return"__proto__"==a||"constructor"==a||"prototype"==a};mxObjectCodec.prototype.template=null;mxObjectCodec.prototype.exclude=null;mxObjectCodec.prototype.idrefs=null;mxObjectCodec.prototype.mapping=null; mxObjectCodec.prototype.reverse=null;mxObjectCodec.prototype.getName=function(){return mxUtils.getFunctionName(this.template.constructor)};mxObjectCodec.prototype.cloneTemplate=function(){return new this.template.constructor};mxObjectCodec.prototype.getFieldName=function(a){if(null!=a){var b=this.reverse[a];null!=b&&(a=b)}return a};mxObjectCodec.prototype.getAttributeName=function(a){if(null!=a){var b=this.mapping[a];null!=b&&(a=b)}return a}; mxObjectCodec.prototype.isExcluded=function(a,b,c,d){return b==mxObjectIdentity.FIELD_NAME||0<=mxUtils.indexOf(this.exclude,b)};mxObjectCodec.prototype.isReference=function(a,b,c,d){return 0<=mxUtils.indexOf(this.idrefs,b)};mxObjectCodec.prototype.encode=function(a,b){var c=a.document.createElement(this.getName());b=this.beforeEncode(a,b,c);this.encodeObject(a,b,c);return this.afterEncode(a,b,c)}; mxObjectCodec.prototype.encodeObject=function(a,b,c){a.setAttribute(c,"id",a.getId(b));var d=[],e;for(e in b){var f=e,g=b[f];null==g||this.isExcluded(b,f,g,!0)||(mxUtils.isInteger(f)?this.encodeValue(a,b,null,g,c):d.push({name:f,value:g}))}d.sort(function(k,l){return k.name<l.name?-1:k.name>l.name?1:0});for(e=0;e<d.length;e++)this.encodeValue(a,b,d[e].name,d[e].value,c)}; mxObjectCodec.prototype.encodeValue=function(a,b,c,d,e){if(null!=d){if(this.isReference(b,c,d,!0)){var f=a.getId(d);if(null==f){mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+c+"="+d);return}d=f}f=this.template[c];if(null==c||a.encodeDefaults||f!=d)c=this.getAttributeName(c),this.writeAttribute(a,b,c,d,e)}};mxObjectCodec.prototype.writeAttribute=function(a,b,c,d,e){"object"!=typeof d?this.writePrimitiveAttribute(a,b,c,d,e):this.writeComplexAttribute(a,b,c,d,e)}; mxObjectCodec.prototype.writePrimitiveAttribute=function(a,b,c,d,e){d=this.convertAttributeToXml(a,b,c,d,e);null==c?(b=a.document.createElement("add"),"function"==typeof d?b.appendChild(a.document.createTextNode(d)):a.setAttribute(b,"value",d),e.appendChild(b)):"function"!=typeof d&&a.setAttribute(e,c,d)}; mxObjectCodec.prototype.writeComplexAttribute=function(a,b,c,d,e){a=a.encode(d);null!=a?(null!=c&&a.setAttribute("as",c),e.appendChild(a)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+c+": "+d)};mxObjectCodec.prototype.convertAttributeToXml=function(a,b,c,d){this.isBooleanAttribute(a,b,c,d)&&(d=1==d?"1":"0");return d};mxObjectCodec.prototype.isBooleanAttribute=function(a,b,c,d){return"undefined"==typeof d.length&&(1==d||0==d)}; mxObjectCodec.prototype.convertAttributeFromXml=function(a,b,c){var d=b.value;this.isNumericAttribute(a,b,c)&&(d=parseFloat(d),isNaN(d)||!isFinite(d))&&(d=0);return d};mxObjectCodec.prototype.isNumericAttribute=function(a,b,c){return c.constructor==mxGeometry&&("x"==b.name||"y"==b.name||"width"==b.name||"height"==b.name)||c.constructor==mxPoint&&("x"==b.name||"y"==b.name)||mxUtils.isNumeric(b.value)};mxObjectCodec.prototype.beforeEncode=function(a,b,c){return b}; mxObjectCodec.prototype.afterEncode=function(a,b,c){return c};mxObjectCodec.prototype.decode=function(a,b,c){var d=b.getAttribute("id"),e=a.objects[d];null==e&&(e=c||this.cloneTemplate(),null!=d&&a.putObject(d,e));b=this.beforeDecode(a,b,e);this.decodeNode(a,b,e);return this.afterDecode(a,b,e)};mxObjectCodec.prototype.decodeNode=function(a,b,c){null!=b&&(this.decodeAttributes(a,b,c),this.decodeChildren(a,b,c))}; mxObjectCodec.prototype.decodeAttributes=function(a,b,c){b=b.attributes;if(null!=b)for(var d=0;d<b.length;d++)this.decodeAttribute(a,b[d],c)};mxObjectCodec.prototype.isIgnoredAttribute=function(a,b,c){return"as"==b.nodeName||"id"==b.nodeName||"function"===typeof c[b.nodeName]}; mxObjectCodec.prototype.decodeAttribute=function(a,b,c){if(!this.isIgnoredAttribute(a,b,c)){var d=b.nodeName;b=this.convertAttributeFromXml(a,b,c);var e=this.getFieldName(d);if(this.isReference(c,e,b,!1)){a=a.getObject(b);if(null==a){mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+d+"="+b);return}b=a}this.isExcluded(c,d,b,!1)||(c[d]=b)}}; mxObjectCodec.prototype.decodeChildren=function(a,b,c){for(b=b.firstChild;null!=b;){var d=b.nextSibling;b.nodeType!=mxConstants.NODETYPE_ELEMENT||this.processInclude(a,b,c)||this.decodeChild(a,b,c);b=d}}; mxObjectCodec.prototype.decodeChild=function(a,b,c){var d=this.getFieldName(b.getAttribute("as"));if(null==d||!this.isExcluded(c,d,b,!1)){var e=this.getFieldTemplate(c,d,b);"add"==b.nodeName?(a=b.getAttribute("value"),null==a&&mxObjectCodec.allowEval&&(a=mxUtils.eval(mxUtils.getTextContent(b)))):a=a.decode(b,e);try{this.addObjectValue(c,d,a,e)}catch(f){null!=window.console&&console.error(f.message+" "+b.nodeName+(null!=d?" as "+d:""))}}}; mxObjectCodec.prototype.getFieldTemplate=function(a,b,c){if(mxObjectCodec.isPollutionKey(b))return null;a=a[b];a instanceof Array&&0<a.length&&(a=null);return a};mxObjectCodec.prototype.addObjectValue=function(a,b,c,d){if(null!=c&&c!=d&&!mxObjectCodec.isPollutionKey(b))if(null!=b&&0<b.length)a[b]=c;else if(a.constructor===Array)a.push(c);else throw Error("Could not add object");}; mxObjectCodec.prototype.processInclude=function(a,b,c){if("include"==b.nodeName){b=b.getAttribute("name");if(null!=b)try{var d=mxUtils.load(b).getDocumentElement();null!=d&&a.decode(d,c)}catch(e){}return!0}return!1};mxObjectCodec.prototype.beforeDecode=function(a,b,c){return b};mxObjectCodec.prototype.afterDecode=function(a,b,c){return c}; mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);a.isCellCodec=function(){return!0};a.isNumericAttribute=function(b,c,d){return"value"!==c.nodeName&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)};a.isExcluded=function(b,c,d,e){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||e&&"value"==c&&mxUtils.isNode(d)};a.afterEncode=function(b,c,d){if(null!=c.value&&mxUtils.isNode(c.value)){var e= d;d=mxUtils.importNode(b.document,c.value,!0);d.appendChild(e);b=e.getAttribute("id");d.setAttribute("id",b);e.removeAttribute("id")}return d};a.beforeDecode=function(b,c,d){var e=c.cloneNode(!0),f=this.getName();c.nodeName!=f?(e=c.getElementsByTagName(f)[0],null!=e&&e.parentNode==c?(mxUtils.removeWhitespace(e,!0),mxUtils.removeWhitespace(e,!1),e.parentNode.removeChild(e)):e=null,d.value=c.cloneNode(!0),c=d.value.getAttribute("id"),null!=c&&(d.setId(c),d.value.removeAttribute("id"))):d.setId(c.getAttribute("id")); if(null!=e)for(c=0;c<this.idrefs.length;c++){f=this.idrefs[c];var g=e.getAttribute(f);if(null!=g){e.removeAttribute(f);var k=b.objects[g]||b.lookup(g);if(null==k){var l=b.getElementById(g);null!=l?k=(mxCodecRegistry.codecs[l.nodeName]||this).decode(b,l):null!=window.console&&console.error("mxCellCodec.beforeDecode: "+this.idrefs[c]+" "+g+" not found for cell "+d.getId())}d[f]=k}}return e};return a}()); mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxGraphModel);a.enableStyleCompression=!1;a.encodeObject=function(b,c,d){var e=b.document.createElement("root");b.encodeCell(c.getRoot(),e);d.appendChild(e);this.enableStyleCompression&&(b=this.encodeResources(b,e,b.document.createElement("defs")),0<b.childNodes.length&&e.parentNode.insertBefore(b,e))};a.encodeResources=function(b,c,d){c=c.getElementsByTagName("mxCell");for(var e={},f=0;f<c.length;f++)this.compressCellStyle(b,d,e,c[f]); return d};a.compressCellStyle=function(b,c,d,e){var f=e.getAttribute("style");if(null!=f&&(-1!==f.indexOf("=data:")||-1!==f.indexOf("=stencil("))){var g=f.split(";");for(f=0;f<g.length;f++){var k=g[f].split("=");1<k.length&&("image"===k[0]&&k[1].startsWith("data:image/")||"shape"===k[0]&&k[1].startsWith("stencil("))&&mxUtils.bind(this,function(l,m){this.addResource(b,c,k[1],d,function(n){e.setAttribute("style",g.slice(0,m).join(";")+(0<m?";":"")+l+"=def("+n+");"+g.slice(m+1).join(";"))})})(k[0],f)}}}; a.addResource=function(b,c,d,e,f){var g=e[d];null!=g?(null==g.id&&(g.id=c.getElementsByTagName("*").length,c.appendChild(g.elt),g.fn(g.id),delete g.elt,delete g.fn),f(g.id)):(b=b.document.createElement("def"),e[d]={elt:b,fn:f,id:null},b.setAttribute("data",d))};a.decodeChild=function(b,c,d){"defs"==c.nodeName?this.decodeResources(b,c,d):"root"==c.nodeName?this.decodeRoot(b,c,d):mxObjectCodec.prototype.decodeChild.apply(this,arguments)};a.decodeResources=function(b,c,d){d=c.parentNode.getElementsByTagName("mxCell"); c=c.getElementsByTagName("def");for(var e=0;e<d.length;e++)this.decompressCellStyle(b,c,d[e])};a.decompressCellStyle=function(b,c,d){b=d.getAttribute("style");if(null!=b&&-1!==b.indexOf("=def(")){b=b.split(";");for(var e=[],f=0;f<b.length;f++){var g=b[f].split("=");if(1<g.length&&g[1].startsWith("def(")&&("image"===g[0]||"shape"===g[0])){var k=g[1].substring(g[1].indexOf("(")+1,g[1].length-1);null!=c[k]?e.push(g[0]+"="+c[k].getAttribute("data")):null!=window.console&&console.error("mxModelCodec.decodeChild: Invalid reference "+ k+" in cell "+d.getAttribute("id"))}else e.push(b[f])}d.setAttribute("style",e.join(";"))}};a.decodeRoot=function(b,c,d){var e=null;for(c=c.firstChild;null!=c;){var f=b.decodeCell(c);null!=f&&null==f.getParent()&&(e=f);c=c.nextSibling}null!=e&&d.setRoot(e)};return a}()); mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxRootChange,["model","previous","root"]);a.afterEncode=function(b,c,d){b.encodeCell(c.root,d);return d};a.beforeDecode=function(b,c,d){if(null!=c.firstChild&&c.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){c=c.cloneNode(!0);var e=c.firstChild;d.root=b.decodeCell(e,!1);d=e.nextSibling;e.parentNode.removeChild(e);for(e=d;null!=e;)d=e.nextSibling,b.decodeCell(e),e.parentNode.removeChild(e),e=d}return c};a.afterDecode=function(b,c, d){d.previous=d.root;return d};return a}()); mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxChildChange,["model","child","previousIndex"],["parent","previous"]);a.isReference=function(b,c,d,e){return"child"!=c||e&&!b.model.contains(b.previous)?0<=mxUtils.indexOf(this.idrefs,c):!0};a.isExcluded=function(b,c,d,e){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||e&&null!=d&&("previous"==c||"parent"==c)&&!b.model.contains(d)};a.afterEncode=function(b,c,d){this.isReference(c,"child",c.child,!0)?d.setAttribute("child", b.getId(c.child)):b.encodeCell(c.child,d);return d};a.beforeDecode=function(b,c,d){if(null!=c.firstChild&&c.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){c=c.cloneNode(!0);var e=c.firstChild;d.child=b.decodeCell(e,!1);d=e.nextSibling;e.parentNode.removeChild(e);for(e=d;null!=e;){d=e.nextSibling;if(e.nodeType==mxConstants.NODETYPE_ELEMENT){var f=e.getAttribute("id");null==b.lookup(f)&&b.decodeCell(e)}e.parentNode.removeChild(e);e=d}}else e=c.getAttribute("child"),d.child=b.getObject(e);return c}; a.afterDecode=function(b,c,d){null!=d.child&&(null!=d.child.parent&&null!=d.previous&&d.child.parent!=d.previous&&(d.previous=d.child.parent),d.child.parent=d.previous,d.previous=d.parent,d.previousIndex=d.index);return d};return a}());mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);a.afterDecode=function(b,c,d){d.previous=d.terminal;return d};return a}()); var mxGenericChangeCodec=function(a,b){a=new mxObjectCodec(a,["model","previous"],["cell"]);a.afterDecode=function(c,d,e){mxUtils.isNode(e.cell)&&(e.cell=c.decodeCell(e.cell,!1));e.previous=e[b];return e};return a};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value"));mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style"));mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry")); mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed"));mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible"));mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value"));mxCodecRegistry.register(function(){return new mxObjectCodec(new mxGraph,"graphListeners eventListeners view container cellRenderer editor selection".split(" "))}()); mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxGraphView);a.encode=function(b,c){return this.encodeCell(b,c,c.graph.getModel().getRoot())};a.encodeCell=function(b,c,d){var e=c.graph.getModel(),f=c.getState(d),g=e.getParent(d);if(null==g||null!=f){var k=e.getChildCount(d),l=c.graph.getCellGeometry(d),m=null;g==e.getRoot()?m="layer":null==g?m="graph":e.isEdge(d)?m="edge":0<k&&null!=l?m="group":e.isVertex(d)&&(m="vertex");if(null!=m){var n=b.document.createElement(m);null!=c.graph.getLabel(d)&& (n.setAttribute("label",c.graph.getLabel(d)),c.graph.isHtmlLabel(d)&&n.setAttribute("html",!0));if(null==g){var p=c.getGraphBounds();null!=p&&(n.setAttribute("x",Math.round(p.x)),n.setAttribute("y",Math.round(p.y)),n.setAttribute("width",Math.round(p.width)),n.setAttribute("height",Math.round(p.height)));n.setAttribute("scale",c.scale)}else if(null!=f&&null!=l){for(p in f.style)g=f.style[p],"function"==typeof g&&"object"==typeof g&&(g=mxStyleRegistry.getName(g)),null!=g&&"function"!=typeof g&&"object"!= typeof g&&n.setAttribute(p,g);g=f.absolutePoints;if(null!=g&&0<g.length){l=Math.round(g[0].x)+","+Math.round(g[0].y);for(p=1;p<g.length;p++)l+=" "+Math.round(g[p].x)+","+Math.round(g[p].y);n.setAttribute("points",l)}else n.setAttribute("x",Math.round(f.x)),n.setAttribute("y",Math.round(f.y)),n.setAttribute("width",Math.round(f.width)),n.setAttribute("height",Math.round(f.height));p=f.absoluteOffset;null!=p&&(0!=p.x&&n.setAttribute("dx",Math.round(p.x)),0!=p.y&&n.setAttribute("dy",Math.round(p.y)))}for(p= 0;p<k;p++)f=this.encodeCell(b,c,e.getChildAt(d,p)),null!=f&&n.appendChild(f)}}return n};return a}()); var mxStylesheetCodec=mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxStylesheet);a.encode=function(b,c){var d=b.document.createElement(this.getName()),e;for(e in c.styles){var f=c.styles[e],g=b.document.createElement("add");if(null!=e){g.setAttribute("as",e);for(var k in f){var l=this.getStringValue(k,f[k]);if(null!=l){var m=b.document.createElement("add");m.setAttribute("value",l);m.setAttribute("as",k);g.appendChild(m)}}0<g.childNodes.length&&d.appendChild(g)}}return d};a.getStringValue= function(b,c){b=typeof c;"function"==b?c=mxStyleRegistry.getName(c):"object"==b&&(c=null);return c};a.decode=function(b,c,d){d=d||new this.template.constructor;var e=c.getAttribute("id");null!=e&&(b.objects[e]=d);for(c=c.firstChild;null!=c;){if(!this.processInclude(b,c,d)&&"add"==c.nodeName&&(e=c.getAttribute("as"),null!=e)){var f=c.getAttribute("extend"),g=null!=f?mxUtils.clone(d.styles[f]):null;null==g&&(null!=f&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+f+" not found to extend"),g={}); for(f=c.firstChild;null!=f;){if(f.nodeType==mxConstants.NODETYPE_ELEMENT){var k=f.getAttribute("as");if("add"==f.nodeName){var l=mxUtils.getTextContent(f);null!=l&&0<l.length&&mxStylesheetCodec.allowEval?l=mxUtils.eval(l):(l=f.getAttribute("value"),mxUtils.isNumeric(l)&&(l=parseFloat(l)));null!=l&&(g[k]=l)}else"remove"==f.nodeName&&delete g[k]}f=f.nextSibling}d.putCellStyle(e,g)}c=c.nextSibling}return d};return a}());mxStylesheetCodec.allowEval=!1; var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(b){return b.raw=b};$jscomp.createTemplateTagFirstArgWithRaw=function(b,d){b.raw=d;return b};$jscomp.arrayIteratorImpl=function(b){var d=0;return function(){return d<b.length?{done:!1,value:b[d++]}:{done:!0}}};$jscomp.arrayIterator=function(b){return{next:$jscomp.arrayIteratorImpl(b)}};$jscomp.makeIterator=function(b){var d="undefined"!=typeof Symbol&&Symbol.iterator&&b[Symbol.iterator];return d?d.call(b):$jscomp.arrayIterator(b)}; Editor=function(b,d,m,p,t){mxEventSource.call(this);this.chromeless=null!=b?b:this.chromeless;this.initStencilRegistry();this.graph=p||this.createGraph(d,m);this.editable=null!=t?t:!b;this.undoManager=this.createUndoManager();this.status="";this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[Editor.pageCounter])+".xml"};this.getFilename=function(){return this.filename};this.setStatus=function(n,z){this.status=n;this.statusFunction=z;this.fireEvent(new mxEventObject("statusChanged"))}; this.getStatus=function(){return this.status};this.graphChangeListener=function(n,z){n=null!=z?z.getProperty("edit"):null;null!=n&&n.ignoreEdit||this.setModified(!0)};this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)}));this.graph.resetViewOnRootChange=!1;this.init()};mxConstants.POINTS=1;mxConstants.MILLIMETERS=2;mxConstants.INCHES=3;mxConstants.METERS=4;mxConstants.PIXELS_PER_MM=3.937;mxConstants.PIXELS_PER_INCH=100; Editor.pageCounter=0;(function(){try{for(var b=window;null!=b.opener&&"undefined"!==typeof b.opener.Editor&&!isNaN(b.opener.Editor.pageCounter)&&b.opener!=b;)b=b.opener;null!=b&&(b.Editor.pageCounter++,Editor.pageCounter=b.Editor.pageCounter)}catch(d){}})();Editor.defaultHtmlFont='-apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, ui-sans-serif, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"';Editor.useLocalStorage="undefined"!=typeof Storage&&mxClient.IS_IOS; Editor.smallScreenWidth=1024;Editor.helpImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDc4LTI0MHEyMSAwIDM1LjUtMTQuNVQ1MjgtMjkwcTAtMjEtMTQuNS0zNS41VDQ3OC0zNDBxLTIxIDAtMzUuNSAxNC41VDQyOC0yOTBxMCAyMSAxNC41IDM1LjVUNDc4LTI0MFptLTM2LTE1NGg3NHEwLTMzIDcuNS01MnQ0Mi41LTUycTI2LTI2IDQxLTQ5LjV0MTUtNTYuNXEwLTU2LTQxLTg2dC05Ny0zMHEtNTcgMC05Mi41IDMwVDM0Mi02MThsNjYgMjZxNS0xOCAyMi41LTM5dDUzLjUtMjFxMzIgMCA0OCAxNy41dDE2IDM4LjVxMCAyMC0xMiAzNy41VDUwNi01MjZxLTQ0IDM5LTU0IDU5dC0xMCA3M1ptMzggMzE0cS04MyAwLTE1Ni0zMS41VDE5Ny0xOTdxLTU0LTU0LTg1LjUtMTI3VDgwLTQ4MHEwLTgzIDMxLjUtMTU2VDE5Ny03NjNxNTQtNTQgMTI3LTg1LjVUNDgwLTg4MHE4MyAwIDE1NiAzMS41VDc2My03NjNxNTQgNTQgODUuNSAxMjdUODgwLTQ4MHEwIDgzLTMxLjUgMTU2VDc2My0xOTdxLTU0IDU0LTEyNyA4NS41VDQ4MC04MFptMC04MHExMzQgMCAyMjctOTN0OTMtMjI3cTAtMTM0LTkzLTIyN3QtMjI3LTkzcS0xMzQgMC0yMjcgOTN0LTkzIDIyN3EwIDEzNCA5MyAyMjd0MjI3IDkzWm0wLTMyMFoiLz48L3N2Zz4="; Editor.menuImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTI0MHYtODBoNzIwdjgwSDEyMFptMC0yMDB2LTgwaDcyMHY4MEgxMjBabTAtMjAwdi04MGg3MjB2ODBIMTIwWiIvPjwvc3ZnPg==";Editor.moveImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI4cHgiIGhlaWdodD0iMjhweCI+PGc+PC9nPjxnPjxnPjxnPjxwYXRoIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIuNCwyLjQpc2NhbGUoMC44KXJvdGF0ZSg0NSwxMiwxMikiIHN0cm9rZT0iIzI5YjZmMiIgZmlsbD0iIzI5YjZmMiIgZD0iTTE1LDNsMi4zLDIuM2wtMi44OSwyLjg3bDEuNDIsMS40MkwxOC43LDYuN0wyMSw5VjNIMTV6IE0zLDlsMi4zLTIuM2wyLjg3LDIuODlsMS40Mi0xLjQyTDYuNyw1LjNMOSwzSDNWOXogTTksMjEgbC0yLjMtMi4zbDIuODktMi44N2wtMS40Mi0xLjQyTDUuMywxNy4zTDMsMTV2Nkg5eiBNMjEsMTVsLTIuMywyLjNsLTIuODctMi44OWwtMS40MiwxLjQybDIuODksMi44N0wxNSwyMWg2VjE1eiIvPjwvZz48L2c+PC9nPjwvc3ZnPgo="; Editor.zoomInImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNzg0LTEyMCA1MzItMzcycS0zMCAyNC02OSAzOHQtODMgMTRxLTEwOSAwLTE4NC41LTc1LjVUMTIwLTU4MHEwLTEwOSA3NS41LTE4NC41VDM4MC04NDBxMTA5IDAgMTg0LjUgNzUuNVQ2NDAtNTgwcTAgNDQtMTQgODN0LTM4IDY5bDI1MiAyNTItNTYgNTZaTTM4MC00MDBxNzUgMCAxMjcuNS01Mi41VDU2MC01ODBxMC03NS01Mi41LTEyNy41VDM4MC03NjBxLTc1IDAtMTI3LjUgNTIuNVQyMDAtNTgwcTAgNzUgNTIuNSAxMjcuNVQzODAtNDAwWm0tNDAtNjB2LTgwaC04MHYtODBoODB2LTgwaDgwdjgwaDgwdjgwaC04MHY4MGgtODBaIi8+PC9zdmc+"; Editor.zoomOutImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNzg0LTEyMCA1MzItMzcycS0zMCAyNC02OSAzOHQtODMgMTRxLTEwOSAwLTE4NC41LTc1LjVUMTIwLTU4MHEwLTEwOSA3NS41LTE4NC41VDM4MC04NDBxMTA5IDAgMTg0LjUgNzUuNVQ2NDAtNTgwcTAgNDQtMTQgODN0LTM4IDY5bDI1MiAyNTItNTYgNTZaTTM4MC00MDBxNzUgMCAxMjcuNS01Mi41VDU2MC01ODBxMC03NS01Mi41LTEyNy41VDM4MC03NjBxLTc1IDAtMTI3LjUgNTIuNVQyMDAtNTgwcTAgNzUgNTIuNSAxMjcuNVQzODAtNDAwWk0yODAtNTQwdi04MGgyMDB2ODBIMjgwWiIvPjwvc3ZnPg=="; Editor.fullscreenImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTEyMHYtMjAwaDgwdjEyMGgxMjB2ODBIMTIwWm01MjAgMHYtODBoMTIwdi0xMjBoODB2MjAwSDY0MFpNMTIwLTY0MHYtMjAwaDIwMHY4MEgyMDB2MTIwaC04MFptNjQwIDB2LTEyMEg2NDB2LTgwaDIwMHYyMDBoLTgwWiIvPjwvc3ZnPg==";Editor.fullscreenExitImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjQwLTEyMHYtMTIwSDEyMHYtODBoMjAwdjIwMGgtODBabTQwMCAwdi0yMDBoMjAwdjgwSDcyMHYxMjBoLTgwWk0xMjAtNjQwdi04MGgxMjB2LTEyMGg4MHYyMDBIMTIwWm01MjAgMHYtMjAwaDgwdjEyMGgxMjB2ODBINjQwWiIvPjwvc3ZnPg=="; Editor.zoomFitImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTMyMHEtNjYgMC0xMTMtNDd0LTQ3LTExM3EwLTY2IDQ3LTExM3QxMTMtNDdxNjYgMCAxMTMgNDd0NDcgMTEzcTAgNjYtNDcgMTEzdC0xMTMgNDdabTAtODBxMzMgMCA1Ni41LTIzLjVUNTYwLTQ4MHEwLTMzLTIzLjUtNTYuNVQ0ODAtNTYwcS0zMyAwLTU2LjUgMjMuNVQ0MDAtNDgwcTAgMzMgMjMuNSA1Ni41VDQ4MC00MDBabTAtODBaTTIwMC0xMjBxLTMzIDAtNTYuNS0yMy41VDEyMC0yMDB2LTE2MGg4MHYxNjBoMTYwdjgwSDIwMFptNDAwIDB2LTgwaDE2MHYtMTYwaDgwdjE2MHEwIDMzLTIzLjUgNTYuNVQ3NjAtMTIwSDYwMFpNMTIwLTYwMHYtMTYwcTAtMzMgMjMuNS01Ni41VDIwMC04NDBoMTYwdjgwSDIwMHYxNjBoLTgwWm02NDAgMHYtMTYwSDYwMHYtODBoMTYwcTMzIDAgNTYuNSAyMy41VDg0MC03NjB2MTYwaC04MFoiLz48L3N2Zz4="; Editor.layersImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTExOCAxMjAtMzk4bDY2LTUwIDI5NCAyMjggMjk0LTIyOCA2NiA1MC0zNjAgMjgwWm0wLTIwMkwxMjAtNjAwbDM2MC0yODAgMzYwIDI4MC0zNjAgMjgwWm0wLTI4MFptMCAxNzggMjMwLTE3OC0yMzAtMTc4LTIzMCAxNzggMjMwIDE3OFoiLz48L3N2Zz4=";Editor.editImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTIwMGg1N2wzOTEtMzkxLTU3LTU3LTM5MSAzOTF2NTdabS04MCA4MHYtMTcwbDUyOC01MjdxMTItMTEgMjYuNS0xN3QzMC41LTZxMTYgMCAzMSA2dDI2IDE4bDU1IDU2cTEyIDExIDE3LjUgMjZ0NS41IDMwcTAgMTYtNS41IDMwLjVUODE3LTY0N0wyOTAtMTIwSDEyMFptNjQwLTU4NC01Ni01NiA1NiA1NlptLTE0MSA4NS0yOC0yOSA1NyA1Ny0yOS0yOFoiLz48L3N2Zz4="; Editor.duplicateImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzYwLTI0MHEtMzMgMC01Ni41LTIzLjVUMjgwLTMyMHYtNDgwcTAtMzMgMjMuNS01Ni41VDM2MC04ODBoMzYwcTMzIDAgNTYuNSAyMy41VDgwMC04MDB2NDgwcTAgMzMtMjMuNSA1Ni41VDcyMC0yNDBIMzYwWm0wLTgwaDM2MHYtNDgwSDM2MHY0ODBaTTIwMC04MHEtMzMgMC01Ni41LTIzLjVUMTIwLTE2MHYtNTYwaDgwdjU2MGg0NDB2ODBIMjAwWm0xNjAtMjQwdi00ODAgNDgwWiIvPjwvc3ZnPg=="; Editor.crossImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE5IDYuNDFMMTcuNTkgNSAxMiAxMC41OSA2LjQxIDUgNSA2LjQxIDEwLjU5IDEyIDUgMTcuNTkgNi40MSAxOSAxMiAxMy40MSAxNy41OSAxOSAxOSAxNy41OSAxMy40MSAxMiAxOSA2LjQxeiIvPjwvc3ZnPg==";Editor.trashImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjgwLTEyMHEtMzMgMC01Ni41LTIzLjVUMjAwLTIwMHYtNTIwaC00MHYtODBoMjAwdi00MGgyNDB2NDBoMjAwdjgwaC00MHY1MjBxMCAzMy0yMy41IDU2LjVUNjgwLTEyMEgyODBabTQwMC02MDBIMjgwdjUyMGg0MDB2LTUyMFpNMzYwLTI4MGg4MHYtMzYwaC04MHYzNjBabTE2MCAwaDgwdi0zNjBoLTgwdjM2MFpNMjgwLTcyMHY1MjAtNTIwWiIvPjwvc3ZnPg=="; Editor.hiddenImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6bTAgMGgyNHYyNEgwVjB6bTAgMGgyNHYyNEgwVjB6bTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTEyIDZjMy43OSAwIDcuMTcgMi4xMyA4LjgyIDUuNS0uNTkgMS4yMi0xLjQyIDIuMjctMi40MSAzLjEybDEuNDEgMS40MWMxLjM5LTEuMjMgMi40OS0yLjc3IDMuMTgtNC41M0MyMS4yNyA3LjExIDE3IDQgMTIgNGMtMS4yNyAwLTIuNDkuMi0zLjY0LjU3bDEuNjUgMS42NUMxMC42NiA2LjA5IDExLjMyIDYgMTIgNnptLTEuMDcgMS4xNEwxMyA5LjIxYy41Ny4yNSAxLjAzLjcxIDEuMjggMS4yOGwyLjA3IDIuMDdjLjA4LS4zNC4xNC0uNy4xNC0xLjA3QzE2LjUgOS4wMSAxNC40OCA3IDEyIDdjLS4zNyAwLS43Mi4wNS0xLjA3LjE0ek0yLjAxIDMuODdsMi42OCAyLjY4QzMuMDYgNy44MyAxLjc3IDkuNTMgMSAxMS41IDIuNzMgMTUuODkgNyAxOSAxMiAxOWMxLjUyIDAgMi45OC0uMjkgNC4zMi0uODJsMy40MiAzLjQyIDEuNDEtMS40MUwzLjQyIDIuNDUgMi4wMSAzLjg3em03LjUgNy41bDIuNjEgMi42MWMtLjA0LjAxLS4wOC4wMi0uMTIuMDItMS4zOCAwLTIuNS0xLjEyLTIuNS0yLjUgMC0uMDUuMDEtLjA4LjAxLS4xM3ptLTMuNC0zLjRsMS43NSAxLjc1Yy0uMjMuNTUtLjM2IDEuMTUtLjM2IDEuNzggMCAyLjQ4IDIuMDIgNC41IDQuNSA0LjUuNjMgMCAxLjIzLS4xMyAxLjc3LS4zNmwuOTguOThjLS44OC4yNC0xLjguMzgtMi43NS4zOC0zLjc5IDAtNy4xNy0yLjEzLTguODItNS41LjctMS40MyAxLjcyLTIuNjEgMi45My0zLjUzeiIvPjwvc3ZnPg=="; Editor.visibleImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTEyIDZjMy43OSAwIDcuMTcgMi4xMyA4LjgyIDUuNUMxOS4xNyAxNC44NyAxNS43OSAxNyAxMiAxN3MtNy4xNy0yLjEzLTguODItNS41QzQuODMgOC4xMyA4LjIxIDYgMTIgNm0wLTJDNyA0IDIuNzMgNy4xMSAxIDExLjUgMi43MyAxNS44OSA3IDE5IDEyIDE5czkuMjctMy4xMSAxMS03LjVDMjEuMjcgNy4xMSAxNyA0IDEyIDR6bTAgNWMxLjM4IDAgMi41IDEuMTIgMi41IDIuNVMxMy4zOCAxNCAxMiAxNHMtMi41LTEuMTItMi41LTIuNVMxMC42MiA5IDEyIDltMC0yYy0yLjQ4IDAtNC41IDIuMDItNC41IDQuNVM5LjUyIDE2IDEyIDE2czQuNS0yLjAyIDQuNS00LjVTMTQuNDggNyAxMiA3eiIvPjwvc3ZnPg=="; Editor.lockedImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PGcgZmlsbD0ibm9uZSI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6Ii8+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBvcGFjaXR5PSIuODciLz48L2c+PHBhdGggZD0iTTE4IDhoLTFWNmMwLTIuNzYtMi4yNC01LTUtNVM3IDMuMjQgNyA2djJINmMtMS4xIDAtMiAuOS0yIDJ2MTBjMCAxLjEuOSAyIDIgMmgxMmMxLjEgMCAyLS45IDItMlYxMGMwLTEuMS0uOS0yLTItMnpNOSA2YzAtMS42NiAxLjM0LTMgMy0zczMgMS4zNCAzIDN2Mkg5VjZ6bTkgMTRINlYxMGgxMnYxMHptLTYtM2MxLjEgMCAyLS45IDItMnMtLjktMi0yLTItMiAuOS0yIDIgLjkgMiAyIDJ6Ii8+PC9zdmc+"; Editor.unlockedImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE4IDhoLTFWNmMwLTIuNzYtMi4yNC01LTUtNVM3IDMuMjQgNyA2aDJjMC0xLjY2IDEuMzQtMyAzLTNzMyAxLjM0IDMgM3YySDZjLTEuMSAwLTIgLjktMiAydjEwYzAgMS4xLjkgMiAyIDJoMTJjMS4xIDAgMi0uOSAyLTJWMTBjMC0xLjEtLjktMi0yLTJ6bTAgMTJINlYxMGgxMnYxMHptLTYtM2MxLjEgMCAyLS45IDItMnMtLjktMi0yLTItMiAuOS0yIDIgLjkgMiAyIDJ6Ii8+PC9zdmc+"; Editor.printImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNjQwLTY0MHYtMTIwSDMyMHYxMjBoLTgwdi0yMDBoNDgwdjIwMGgtODBabS00ODAgODBoNjQwLTY0MFptNTYwIDEwMHExNyAwIDI4LjUtMTEuNVQ3NjAtNTAwcTAtMTctMTEuNS0yOC41VDcyMC01NDBxLTE3IDAtMjguNSAxMS41VDY4MC01MDBxMCAxNyAxMS41IDI4LjVUNzIwLTQ2MFptLTgwIDI2MHYtMTYwSDMyMHYxNjBoMzIwWm04MCA4MEgyNDB2LTE2MEg4MHYtMjQwcTAtNTEgMzUtODUuNXQ4NS0zNC41aDU2MHE1MSAwIDg1LjUgMzQuNVQ4ODAtNTIwdjI0MEg3MjB2MTYwWm04MC0yNDB2LTE2MHEwLTE3LTExLjUtMjguNVQ3NjAtNTYwSDIwMHEtMTcgMC0yOC41IDExLjVUMTYwLTUyMHYxNjBoODB2LTgwaDQ4MHY4MGg4MFoiLz48L3N2Zz4="; Editor.refreshImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE3LjY1IDYuMzVDMTYuMiA0LjkgMTQuMjEgNCAxMiA0Yy00LjQyIDAtNy45OSAzLjU4LTcuOTkgOHMzLjU3IDggNy45OSA4YzMuNzMgMCA2Ljg0LTIuNTUgNy43My02aC0yLjA4Yy0uODIgMi4zMy0zLjA0IDQtNS42NSA0LTMuMzEgMC02LTIuNjktNi02czIuNjktNiA2LTZjMS42NiAwIDMuMTQuNjkgNC4yMiAxLjc4TDEzIDExaDdWNGwtMi4zNSAyLjM1eiIvPjwvc3ZnPg=="; Editor.backImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIiBvcGFjaXR5PSIuODciLz48cGF0aCBkPSJNMTcuNTEgMy44N0wxNS43MyAyLjEgNS44NCAxMmw5LjkgOS45IDEuNzctMS43N0w5LjM4IDEybDguMTMtOC4xM3oiLz48L3N2Zz4=";Editor.closeImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIiBvcGFjaXR5PSIuODciLz48cGF0aCBkPSJNMTIgMkM2LjQ3IDIgMiA2LjQ3IDIgMTJzNC40NyAxMCAxMCAxMCAxMC00LjQ3IDEwLTEwUzE3LjUzIDIgMTIgMnptMCAxOGMtNC40MSAwLTgtMy41OS04LThzMy41OS04IDgtOCA4IDMuNTkgOCA4LTMuNTkgOC04IDh6bTMuNTktMTNMMTIgMTAuNTkgOC40MSA3IDcgOC40MSAxMC41OSAxMiA3IDE1LjU5IDguNDEgMTcgMTIgMTMuNDEgMTUuNTkgMTcgMTcgMTUuNTkgMTMuNDEgMTIgMTcgOC40MXoiLz48L3N2Zz4="; Editor.closeBlackImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjZweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjZweCI+PGVsbGlwc2UgY3g9IjEyIiBjeT0iMTIiIHJ4PSI5IiByeT0iOSIgc3Ryb2tlPSJub25lIiBmaWxsPSIjMDAwIi8+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE0LjU5IDhMMTIgMTAuNTkgOS40MSA4IDggOS40MSAxMC41OSAxMiA4IDE0LjU5IDkuNDEgMTYgMTIgMTMuNDEgMTQuNTkgMTYgMTYgMTQuNTkgMTMuNDEgMTIgMTYgOS40MSAxNC41OSA4ek0xMiAyQzYuNDcgMiAyIDYuNDcgMiAxMnM0LjQ3IDEwIDEwIDEwIDEwLTQuNDcgMTAtMTBTMTcuNTMgMiAxMiAyem0wIDE4Yy00LjQxIDAtOC0zLjU5LTgtOHMzLjU5LTggOC04IDggMy41OSA4IDgtMy41OSA4LTggOHoiLz48L3N2Zz4="; Editor.minusImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTEwIDI1LjV2LTNoMjh2M1oiLz48L3N2Zz4=";Editor.plusImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTkgMTNoLTZ2NmgtMnYtNkg1di0yaDZWNWgydjZoNnYyeiIvPjwvc3ZnPg==";Editor.addBoxImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDQwLTI4MGg4MHYtMTYwaDE2MHYtODBINTIwdi0xNjBoLTgwdjE2MEgyODB2ODBoMTYwdjE2MFpNMjAwLTEyMHEtMzMgMC01Ni41LTIzLjVUMTIwLTIwMHYtNTYwcTAtMzMgMjMuNS01Ni41VDIwMC04NDBoNTYwcTMzIDAgNTYuNSAyMy41VDg0MC03NjB2NTYwcTAgMzMtMjMuNSA1Ni41VDc2MC0xMjBIMjAwWm0wLTgwaDU2MHYtNTYwSDIwMHY1NjBabTAtNTYwdjU2MC01NjBaIi8+PC9zdmc+"; Editor.shapesImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNjAwLTM2MFpNMzIwLTI0MnExMCAxIDE5LjUgMS41dDIwLjUuNXExMSAwIDIwLjUtLjVUNDAwLTI0MnY4Mmg0MDB2LTQwMGgtODJxMS0xMCAxLjUtMTkuNXQuNS0yMC41cTAtMTEtLjUtMjAuNVQ3MTgtNjQwaDgycTMzIDAgNTYuNSAyMy41VDg4MC01NjB2NDAwcTAgMzMtMjMuNSA1Ni41VDgwMC04MEg0MDBxLTMzIDAtNTYuNS0yMy41VDMyMC0xNjB2LTgyWm00MC03OHEtMTE3IDAtMTk4LjUtODEuNVQ4MC02MDBxMC0xMTcgODEuNS0xOTguNVQzNjAtODgwcTExNyAwIDE5OC41IDgxLjVUNjQwLTYwMHEwIDExNy04MS41IDE5OC41VDM2MC0zMjBabTAtODBxODMgMCAxNDEuNS01OC41VDU2MC02MDBxMC04My01OC41LTE0MS41VDM2MC04MDBxLTgzIDAtMTQxLjUgNTguNVQxNjAtNjAwcTAgODMgNTguNSAxNDEuNVQzNjAtNDAwWm0wLTIwMFoiLz48L3N2Zz4="; Editor.formatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJtMzUyLTUyMiA4Ni04Ny01Ni01Ny00NCA0NC01Ni01NiA0My00NC00NS00NS04NyA4NyAxNTkgMTU4Wm0zMjggMzI5IDg3LTg3LTQ1LTQ1LTQ0IDQzLTU2LTU2IDQzLTQ0LTU3LTU2LTg2IDg2IDE1OCAxNTlabTI0LTU2NyA1NyA1Ny01Ny01N1pNMjkwLTEyMEgxMjB2LTE3MGwxNzUtMTc1TDgwLTY4MGwyMDAtMjAwIDIxNiAyMTYgMTUxLTE1MnExMi0xMiAyNy0xOHQzMS02cTE2IDAgMzEgNnQyNyAxOGw1MyA1NHExMiAxMiAxOCAyN3Q2IDMxcTAgMTYtNiAzMC41VDgxNi02NDdMNjY1LTQ5NWwyMTUgMjE1TDY4MC04MCA0NjUtMjk1IDI5MC0xMjBabS05MC04MGg1NmwzOTItMzkxLTU3LTU3LTM5MSAzOTJ2NTZabTQyMC00MTktMjktMjkgNTcgNTctMjgtMjhaIi8+PC9zdmc+"; Editor.freehandImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZmlsbD0iIzAwMDAwMCI+PHJlY3QgZmlsbD0ibm9uZSIgaGVpZ2h0PSIyNCIgd2lkdGg9IjI0Ii8+PHBhdGggZD0iTTQuNSw4YzEuMDQsMCwyLjM0LTEuNSw0LjI1LTEuNWMxLjUyLDAsMi43NSwxLjIzLDIuNzUsMi43NWMwLDIuMDQtMS45OSwzLjE1LTMuOTEsNC4yMkM1LjQyLDE0LjY3LDQsMTUuNTcsNCwxNyBjMCwxLjEsMC45LDIsMiwydjJjLTIuMjEsMC00LTEuNzktNC00YzAtMi43MSwyLjU2LTQuMTQsNC42Mi01LjI4YzEuNDItMC43OSwyLjg4LTEuNiwyLjg4LTIuNDdjMC0wLjQxLTAuMzQtMC43NS0wLjc1LTAuNzUgQzcuNSw4LjUsNi4yNSwxMCw0LjUsMTBDMy4xMiwxMCwyLDguODgsMiw3LjVDMiw1LjQ1LDQuMTcsMi44Myw1LDJsMS40MSwxLjQxQzUuNDEsNC40Miw0LDYuNDMsNCw3LjVDNCw3Ljc4LDQuMjIsOCw0LjUsOHogTTgsMjEgbDMuNzUsMGw4LjA2LTguMDZsLTMuNzUtMy43NUw4LDE3LjI1TDgsMjF6IE0xMCwxOC4wOGw2LjA2LTYuMDZsMC45MiwwLjkyTDEwLjkyLDE5TDEwLDE5TDEwLDE4LjA4eiBNMjAuMzcsNi4yOSBjLTAuMzktMC4zOS0xLjAyLTAuMzktMS40MSwwbC0xLjgzLDEuODNsMy43NSwzLjc1bDEuODMtMS44M2MwLjM5LTAuMzksMC4zOS0xLjAyLDAtMS40MUwyMC4zNyw2LjI5eiIvPjwvc3ZnPg=="; Editor.undoImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjgwLTIwMHYtODBoMjg0cTYzIDAgMTA5LjUtNDBUNzIwLTQyMHEwLTYwLTQ2LjUtMTAwVDU2NC01NjBIMzEybDEwNCAxMDQtNTYgNTYtMjAwLTIwMCAyMDAtMjAwIDU2IDU2LTEwNCAxMDRoMjUycTk3IDAgMTY2LjUgNjNUODAwLTQyMHEwIDk0LTY5LjUgMTU3VDU2NC0yMDBIMjgwWiIvPjwvc3ZnPg==";Editor.redoImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzk2LTIwMHEtOTcgMC0xNjYuNS02M1QxNjAtNDIwcTAtOTQgNjkuNS0xNTdUMzk2LTY0MGgyNTJMNTQ0LTc0NGw1Ni01NiAyMDAgMjAwLTIwMCAyMDAtNTYtNTYgMTA0LTEwNEgzOTZxLTYzIDAtMTA5LjUgNDBUMjQwLTQyMHEwIDYwIDQ2LjUgMTAwVDM5Ni0yODBoMjg0djgwSDM5NloiLz48L3N2Zz4="; Editor.outlineImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHdpZHRoPSIyNCI+PHBhdGggZD0ibTE1IDIxLTYtMi4xLTQuNjUgMS44cS0uNS4yLS45MjUtLjExM1EzIDIwLjI3NSAzIDE5Ljc1di0xNHEwLS4zMjUuMTg4LS41NzUuMTg3LS4yNS41MTItLjM3NUw5IDNsNiAyLjEgNC42NS0xLjhxLjUtLjIuOTI1LjExMi40MjUuMzEzLjQyNS44Mzh2MTRxMCAuMzI1LS4xODguNTc1LS4xODcuMjUtLjUxMi4zNzVabS0xLTIuNDVWNi44NWwtNC0xLjR2MTEuN1ptMiAwIDMtMVY1LjdsLTMgMS4xNVpNNSAxOC4zbDMtMS4xNVY1LjQ1bC0zIDFaTTE2IDYuODV2MTEuN1ptLTgtMS40djExLjdaIi8+PC9zdmc+"; Editor.saveImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE5IDEydjdINXYtN0gzdjdjMCAxLjEuOSAyIDIgMmgxNGMxLjEgMCAyLS45IDItMnYtN2gtMnptLTYgLjY3bDIuNTktMi41OEwxNyAxMS41bC01IDUtNS01IDEuNDEtMS40MUwxMSAxMi42N1YzaDJ2OS42N3oiLz48L3N2Zz4=";Editor.compareImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTE1Ljg1IDQwLTIuMS0yLjEgNi4wNS02LjA1SDR2LTNoMTUuOGwtNi4wNS02LjA1IDIuMS0yLjEgOS42NSA5LjY1Wm0xNi4zLTEyLjctOS42NS05LjY1TDMyLjE1IDhsMi4xIDIuMS02LjA1IDYuMDVINDR2M0gyOC4ybDYuMDUgNi4wNVoiLz48L3N2Zz4="; Editor.expandMoreImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHdpZHRoPSIyNCI+PHBhdGggZD0ibTEyIDE1LjM3NS02LTYgMS40LTEuNCA0LjYgNC42IDQuNi00LjYgMS40IDEuNFoiLz48L3N2Zz4=";Editor.expandLessImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHdpZHRoPSIyNCI+PHBhdGggZD0ibTcuNCAxNS4zNzUtMS40LTEuNCA2LTYgNiA2LTEuNCAxLjQtNC42LTQuNloiLz48L3N2Zz4=";Editor.gearImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHdpZHRoPSIyNCI+PHBhdGggZD0ibTkuMjUgMjItLjQtMy4ycS0uMzI1LS4xMjUtLjYxMi0uMy0uMjg4LS4xNzUtLjU2My0uMzc1TDQuNyAxOS4zNzVsLTIuNzUtNC43NSAyLjU3NS0xLjk1UTQuNSAxMi41IDQuNSAxMi4zMzd2LS42NzVxMC0uMTYyLjAyNS0uMzM3TDEuOTUgOS4zNzVsMi43NS00Ljc1IDIuOTc1IDEuMjVxLjI3NS0uMi41NzUtLjM3NS4zLS4xNzUuNi0uM2wuNC0zLjJoNS41bC40IDMuMnEuMzI1LjEyNS42MTMuMy4yODcuMTc1LjU2Mi4zNzVsMi45NzUtMS4yNSAyLjc1IDQuNzUtMi41NzUgMS45NXEuMDI1LjE3NS4wMjUuMzM3di42NzVxMCAuMTYzLS4wNS4zMzhsMi41NzUgMS45NS0yLjc1IDQuNzUtMi45NS0xLjI1cS0uMjc1LjItLjU3NS4zNzUtLjMuMTc1LS42LjNsLS40IDMuMlptMi44LTYuNXExLjQ1IDAgMi40NzUtMS4wMjVRMTUuNTUgMTMuNDUgMTUuNTUgMTJxMC0xLjQ1LTEuMDI1LTIuNDc1UTEzLjUgOC41IDEyLjA1IDguNXEtMS40NzUgMC0yLjQ4OCAxLjAyNVE4LjU1IDEwLjU1IDguNTUgMTJxMCAxLjQ1IDEuMDEyIDIuNDc1UTEwLjU3NSAxNS41IDEyLjA1IDE1LjVabTAtMnEtLjYyNSAwLTEuMDYyLS40MzgtLjQzOC0uNDM3LS40MzgtMS4wNjJ0LjQzOC0xLjA2MnEuNDM3LS40MzggMS4wNjItLjQzOHQxLjA2My40MzhxLjQzNy40MzcuNDM3IDEuMDYydC0uNDM3IDEuMDYycS0uNDM4LjQzOC0xLjA2My40MzhaTTEyIDEyWm0tMSA4aDEuOTc1bC4zNS0yLjY1cS43NzUtLjIgMS40MzgtLjU4OC42NjItLjM4NyAxLjIxMi0uOTM3bDIuNDc1IDEuMDI1Ljk3NS0xLjctMi4xNS0xLjYyNXEuMTI1LS4zNS4xNzUtLjczOC4wNS0uMzg3LjA1LS43ODd0LS4wNS0uNzg4cS0uMDUtLjM4Ny0uMTc1LS43MzdsMi4xNS0xLjYyNS0uOTc1LTEuNy0yLjQ3NSAxLjA1cS0uNTUtLjU3NS0xLjIxMi0uOTYzLS42NjMtLjM4Ny0xLjQzOC0uNTg3TDEzIDRoLTEuOTc1bC0uMzUgMi42NXEtLjc3NS4yLTEuNDM3LjU4Ny0uNjYzLjM4OC0xLjIxMy45MzhMNS41NSA3LjE1bC0uOTc1IDEuNyAyLjE1IDEuNnEtLjEyNS4zNzUtLjE3NS43NS0uMDUuMzc1LS4wNS44IDAgLjQuMDUuNzc1dC4xNzUuNzVsLTIuMTUgMS42MjUuOTc1IDEuNyAyLjQ3NS0xLjA1cS41NS41NzUgMS4yMTMuOTYyLjY2Mi4zODggMS40MzcuNTg4WiIvPjwvc3ZnPg=="; Editor.extensionImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHdpZHRoPSIyNCI+PHBhdGggZD0iTTguOCAyMUg1cS0uODI1IDAtMS40MTMtLjU4N1EzIDE5LjgyNSAzIDE5di0zLjhxMS4yIDAgMi4xLS43NjIuOS0uNzYzLjktMS45MzggMC0xLjE3NS0uOS0xLjkzOFE0LjIgOS44IDMgOS44VjZxMC0uODI1LjU4Ny0xLjQxMlE0LjE3NSA0IDUgNGg0cTAtMS4wNS43MjUtMS43NzVRMTAuNDUgMS41IDExLjUgMS41cTEuMDUgMCAxLjc3NS43MjVRMTQgMi45NSAxNCA0aDRxLjgyNSAwIDEuNDEzLjU4OFEyMCA1LjE3NSAyMCA2djRxMS4wNSAwIDEuNzc1LjcyNS43MjUuNzI1LjcyNSAxLjc3NSAwIDEuMDUtLjcyNSAxLjc3NVEyMS4wNSAxNSAyMCAxNXY0cTAgLjgyNS0uNTg3IDEuNDEzUTE4LjgyNSAyMSAxOCAyMWgtMy44cTAtMS4yNS0uNzg3LTIuMTI1UTEyLjYyNSAxOCAxMS41IDE4dC0xLjkxMi44NzVROC44IDE5Ljc1IDguOCAyMVpNNSAxOWgyLjEyNXEuNi0xLjY1IDEuOTI1LTIuMzI1UTEwLjM3NSAxNiAxMS41IDE2cTEuMTI1IDAgMi40NS42NzUgMS4zMjUuNjc1IDEuOTI1IDIuMzI1SDE4di02aDJxLjIgMCAuMzUtLjE1LjE1LS4xNS4xNS0uMzUgMC0uMi0uMTUtLjM1UTIwLjIgMTIgMjAgMTJoLTJWNmgtNlY0cTAtLjItLjE1LS4zNS0uMTUtLjE1LS4zNS0uMTUtLjIgMC0uMzUuMTVRMTEgMy44IDExIDR2Mkg1djIuMnExLjM1LjUgMi4xNzUgMS42NzVROCAxMS4wNSA4IDEyLjVxMCAxLjQyNS0uODI1IDIuNlQ1IDE2LjhabTcuNzUtNy43NVoiLz48L3N2Zz4="; Editor.colorDropperImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTYgNDJ2LTguNGwxOC44NS0xOC44NS0zLjYtMy42TDIzLjMgOS4xbDQuNiA0LjZMMzUgNi42cS41NS0uNTUgMS4xNzUtLjU1dDEuMTc1LjU1bDQuMDUgNC4wNXEuNTUuNTUuNTUgMS4xNzVUNDEuNCAxM2wtNy4xIDcuMSA0LjYgNC42LTIuMDUgMi4wNS0zLjYtMy42TDE0LjQgNDJabTMtM2g0LjM1TDMxLjEgMjEuMjVsLTQuMzUtNC4zNUw5IDM0LjY1Wm0yMy4xNS0yMSA2LjItNi4yLTIuMTUtMi4xNS02LjIgNi4yWm0wIDBMMzAgMTUuODUgMzIuMTUgMThaIi8+PC9zdmc+"; Editor.magnifyImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjQiPjxwYXRoIGQ9Ik03ODQtMTIwIDUzMi0zNzJxLTMwIDI0LTY5IDM4dC04MyAxNHEtMTA5IDAtMTg0LjUtNzUuNVQxMjAtNTgwcTAtMTA5IDc1LjUtMTg0LjVUMzgwLTg0MHExMDkgMCAxODQuNSA3NS41VDY0MC01ODBxMCA0NC0xNCA4M3QtMzggNjlsMjUyIDI1Mi01NiA1NlpNMzgwLTQwMHE3NSAwIDEyNy41LTUyLjVUNTYwLTU4MHEwLTc1LTUyLjUtMTI3LjVUMzgwLTc2MHEtNzUgMC0xMjcuNSA1Mi41VDIwMC01ODBxMCA3NSA1Mi41IDEyNy41VDM4MC00MDBaIi8+PC9zdmc+"; Editor.sendImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjQiPjxwYXRoIGQ9Ik0xMjAtMTYwdi02NDBsNzYwIDMyMC03NjAgMzIwWm04MC0xMjAgNDc0LTIwMC00NzQtMjAwdjE0MGwyNDAgNjAtMjQwIDYwdjE0MFptMCAwdi00MDAgNDAwWiIvPjwvc3ZnPg==";Editor.micImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTQwMHEtNTAgMC04NS0zNXQtMzUtODV2LTI0MHEwLTUwIDM1LTg1dDg1LTM1cTUwIDAgODUgMzV0MzUgODV2MjQwcTAgNTAtMzUgODV0LTg1IDM1Wm0tNDAgMzIwdi0xMjNxLTEwNC0xNC0xNzItOTN0LTY4LTE4NGg4MHEwIDgzIDU4LjUgMTQxLjVUNDgwLTI4MHE4MyAwIDE0MS41LTU4LjVUNjgwLTQ4MGg4MHEwIDEwNS02OCAxODR0LTE3MiA5M3YxMjNoLTgwWiIvPjwvc3ZnPg=="; Editor.sparklesImage="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjU5LjkyLDI2Mi45MSwyMTYuNCwxNDkuNzdhOSw5LDAsMCwwLTE2LjgsMEwxNTYuMDgsMjYyLjkxYTksOSwwLDAsMS01LjE3LDUuMTdMMzcuNzcsMzExLjZhOSw5LDAsMCwwLDAsMTYuOGwxMTMuMTQsNDMuNTJhOSw5LDAsMCwxLDUuMTcsNS4xN0wxOTkuNiw0OTAuMjNhOSw5LDAsMCwwLDE2LjgsMGw0My41Mi0xMTMuMTRhOSw5LDAsMCwxLDUuMTctNS4xN0wzNzguMjMsMzI4LjRhOSw5LDAsMCwwLDAtMTYuOEwyNjUuMDksMjY4LjA4QTksOSwwLDAsMSwyNTkuOTIsMjYyLjkxWiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iNDAiIGRhdGEtZGFya3JlYWRlci1pbmxpbmUtc3Ryb2tlPSIiIHN0eWxlPSItLWRhcmtyZWFkZXItaW5saW5lLXN0cm9rZTogIzE4MWExYjsiLz4KPHBvbHlnb24gcG9pbnRzPSIxMDggNjggODggMTYgNjggNjggMTYgODggNjggMTA4IDg4IDE2MCAxMDggMTA4IDE2MCA4OCAxMDggNjgiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjMwIi8+Cjxwb2x5Z29uIHBvaW50cz0iNDI2LjY3IDExNy4zMyA0MDAgNDggMzczLjMzIDExNy4zMyAzMDQgMTQ0IDM3My4zMyAxNzAuNjcgNDAwIDI0MCA0MjYuNjcgMTcwLjY3IDQ5NiAxNDQgNDI2LjY3IDExNy4zMyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMzAiLz4KPC9zdmc+"; Editor.thinSparklesImage="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIgogICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0yNTkuOTIsMjYyLjkxLDIxNi40LDE0OS43N2E5LDksMCwwLDAtMTYuOCwwTDE1Ni4wOCwyNjIuOTFhOSw5LDAsMCwxLTUuMTcsNS4xN0wzNy43NywzMTEuNmE5LDksMCwwLDAsMCwxNi44bDExMy4xNCw0My41MmE5LDksMCwwLDEsNS4xNyw1LjE3TDE5OS42LDQ5MC4yM2E5LDksMCwwLDAsMTYuOCwwbDQzLjUyLTExMy4xNGE5LDksMCwwLDEsNS4xNy01LjE3TDM3OC4yMywzMjguNGE5LDksMCwwLDAsMC0xNi44TDI2NS4wOSwyNjguMDhBOSw5LDAsMCwxLDI1OS45MiwyNjIuOTFaIiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyNCIgZGF0YS1kYXJrcmVhZGVyLWlubGluZS1zdHJva2U9IiIgc3R5bGU9Ii0tZGFya3JlYWRlci1pbmxpbmUtc3Ryb2tlOiAjMTgxYTFiOyIvPgogICAgPHBvbHlnb24gcG9pbnRzPSIxMDggNjggODggMTYgNjggNjggMTYgODggNjggMTA4IDg4IDE2MCAxMDggMTA4IDE2MCA4OCAxMDggNjgiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjI0Ii8+CiAgICA8cG9seWdvbiBwb2ludHM9IjQyNi42NyAxMTcuMzMgNDAwIDQ4IDM3My4zMyAxMTcuMzMgMzA0IDE0NCAzNzMuMzMgMTcwLjY3IDQwMCAyNDAgNDI2LjY3IDE3MC42NyA0OTYgMTQ0IDQyNi42NyAxMTcuMzMiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjI0Ii8+Cjwvc3ZnPg=="; Editor.layoutImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMWYxZjFmIj48cGF0aCBkPSJNNjAwLTE2MHYtODBINDQwdi0yMDBoLTgwdjgwSDgwdi0yNDBoMjgwdjgwaDgwdi0yMDBoMTYwdi04MGgyODB2MjQwSDYwMHYtODBoLTgwdjMyMGg4MHYtODBoMjgwdjI0MEg2MDBabTgwLTgwaDEyMHYtODBINjgwdjgwWk0xNjAtNDQwaDEyMHYtODBIMTYwdjgwWm01MjAtMjAwaDEyMHYtODBINjgwdjgwWm0wIDQwMHYtODAgODBaTTI4MC00NDB2LTgwIDgwWm00MDAtMjAwdi04MCA4MFoiLz48L3N2Zz4="; Editor.arrowRightImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDAwLTI4MHYtNDAwbDIwMCAyMDAtMjAwIDIwMFoiLz48L3N2Zz4=";Editor.arrowDownImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTM2MCAyODAtNTYwaDQwMEw0ODAtMzYwWiIvPjwvc3ZnPg=="; Editor.arrowUpImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJtMjgwLTQwMCAyMDAtMjAwIDIwMCAyMDBIMjgwWiIvPjwvc3ZnPg==";Editor.refreshImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTE2MHEtMTM0IDAtMjI3LTkzdC05My0yMjdxMC0xMzQgOTMtMjI3dDIyNy05M3E2OSAwIDEzMiAyOC41VDcyMC02OTB2LTExMGg4MHYyODBINTIwdi04MGgxNjhxLTMyLTU2LTg3LjUtODhUNDgwLTcyMHEtMTAwIDAtMTcwIDcwdC03MCAxNzBxMCAxMDAgNzAgMTcwdDE3MCA3MHE3NyAwIDEzOS00NHQ4Ny0xMTZoODRxLTI4IDEwNi0xMTQgMTczdC0xOTYgNjdaIi8+PC9zdmc+"; Editor.checkImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzgyLTI0MCAxNTQtNDY4bDU3LTU3IDE3MSAxNzEgMzY3LTM2NyA1NyA1Ny00MjQgNDI0WiIvPjwvc3ZnPg==";Editor.dockRightImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTEyMHEtMzMgMC01Ni41LTIzLjVUMTIwLTIwMHYtNTYwcTAtMzMgMjMuNS01Ni41VDIwMC04NDBoNTYwcTMzIDAgNTYuNSAyMy41VDg0MC03NjB2NTYwcTAgMzMtMjMuNSA1Ni41VDc2MC0xMjBIMjAwWm0xMjAtODB2LTU2MEgyMDB2NTYwaDEyMFptODAgMGgzNjB2LTU2MEg0MDB2NTYwWm0tODAgMEgyMDBoMTIwWiIvPjwvc3ZnPg=="; Editor.toFrontImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzYwLTI4MHEtMzMgMC01Ni41LTIzLjVUMjgwLTM2MHYtNDAwcTAtMzMgMjMuNS01Ni41VDM2MC04NDBoNDAwcTMzIDAgNTYuNSAyMy41VDg0MC03NjB2NDAwcTAgMzMtMjMuNSA1Ni41VDc2MC0yODBIMzYwWm0wLTgwaDQwMHYtNDAwSDM2MHY0MDBaTTIwMC0yMDB2ODBxLTMzIDAtNTYuNS0yMy41VDEyMC0yMDBoODBabS04MC04MHYtODBoODB2ODBoLTgwWm0wLTE2MHYtODBoODB2ODBoLTgwWm0wLTE2MHYtODBoODB2ODBoLTgwWm0xNjAgNDgwdi04MGg4MHY4MGgtODBabTE2MCAwdi04MGg4MHY4MGgtODBabTE2MCAwdi04MGg4MHY4MGgtODBaIi8+PC9zdmc+"; Editor.toBackImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTEyMHEtMzMgMC01Ni41LTIzLjVUMTIwLTIwMHYtNDgwaDgwdjQ4MGg0ODB2ODBIMjAwWm0xNjAtMjQwdjgwcS0zMyAwLTU2LjUtMjMuNVQyODAtMzYwaDgwWm0tODAtODB2LTgwaDgwdjgwaC04MFptMC0xNjB2LTgwaDgwdjgwaC04MFptODAtMTYwaC04MHEwLTMzIDIzLjUtNTYuNVQzNjAtODQwdjgwWm04MCA0ODB2LTgwaDgwdjgwaC04MFptMC00ODB2LTgwaDgwdjgwaC04MFptMTYwIDB2LTgwaDgwdjgwaC04MFptMCA0ODB2LTgwaDgwdjgwaC04MFptMTYwLTQ4MHYtODBxMzMgMCA1Ni41IDIzLjVUODQwLTc2MGgtODBabTAgNDAwaDgwcTAgMzMtMjMuNSA1Ni41VDc2MC0yODB2LTgwWm0wLTgwdi04MGg4MHY4MGgtODBabTAtMTYwdi04MGg4MHY4MGgtODBaIi8+PC9zdmc+"; Editor.fillColorImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJtMjQ3LTkwNCA1Ny01NiAzNDMgMzQzcTIzIDIzIDIzIDU3dC0yMyA1N0w0NTctMzEzcS0yMyAyMy01NyAyM3QtNTctMjNMMTUzLTUwM3EtMjMtMjMtMjMtNTd0MjMtNTdsMTkwLTE5MS05Ni05NlptMTUzIDE1M0wyMDktNTYwaDM4Mkw0MDAtNzUxWm0zNjAgNDcxcS0zMyAwLTU2LjUtMjMuNVQ2ODAtMzYwcTAtMjEgMTIuNS00NXQyNy41LTQ1cTktMTIgMTktMjV0MjEtMjVxMTEgMTIgMjEgMjV0MTkgMjVxMTUgMjEgMjcuNSA0NXQxMi41IDQ1cTAgMzMtMjMuNSA1Ni41VDc2MC0yODBaTTgwIDB2LTE2MGg4MDBWMEg4MFoiLz48L3N2Zz4="; Editor.strokeColorImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAgMHYtMTYwaDgwMFYwSDgwWm0xNjAtMzIwaDU2bDMxMi0zMTEtMjktMjktMjgtMjgtMzExIDMxMnY1NlptLTgwIDgwdi0xNzBsNDQ4LTQ0N3ExMS0xMSAyNS41LTE3dDMwLjUtNnExNiAwIDMxIDZ0MjcgMThsNTUgNTZxMTIgMTEgMTcuNSAyNnQ1LjUgMzFxMCAxNS01LjUgMjkuNVQ3NzctNjg3TDMzMC0yNDBIMTYwWm01NjAtNTA0LTU2LTU2IDU2IDU2Wk02MDgtNjMxbC0yOS0yOS0yOC0yOCA1NyA1N1oiLz48L3N2Zz4="; Editor.fontColorImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAgMHYtMTYwaDgwMFYwSDgwWm0xNDAtMjgwIDIxMC01NjBoMTAwbDIxMCA1NjBoLTk2bC01MC0xNDRIMzY4bC01MiAxNDRoLTk2Wm0xNzYtMjI0aDE2OGwtODItMjMyaC00bC04MiAyMzJaIi8+PC9zdmc+";Editor.backgroundColorImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAgMHYtMTYwaDgwMFYwSDgwWm01MDQtNDgwTDQ4MC01ODQgMzIwLTQyNGwxMDMgMTA0IDE2MS0xNjBabS00Ny0xNjAgMTAzIDEwMyAxNjAtMTU5LTEwNC0xMDQtMTU5IDE2MFptLTg0LTI5IDIxNiAyMTYtMTg5IDE5MHEtMjQgMjQtNTYuNSAyNFQzNjctMjYzbC0yNyAyM0gxNDBsMTI2LTEyNXEtMjQtMjQtMjUtNTcuNXQyMy01Ny41bDE4OS0xODlabTAgMCAxODctMTg3cTI0LTI0IDU2LjUtMjR0NTYuNSAyNGwxMDQgMTAzcTI0IDI0IDI0IDU2LjVUODU3LTY0MEw2NjktNDUzIDQ1My02NjlaIi8+PC9zdmc+"; Editor.shadowImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTYwLTgwcS0zMyAwLTU2LjUtMjMuNVQ4MC0xNjB2LTQ4MHEwLTMzIDIzLjUtNTYuNVQxNjAtNzIwaDgwdi04MHEwLTMzIDIzLjUtNTYuNVQzMjAtODgwaDQ4MHEzMyAwIDU2LjUgMjMuNVQ4ODAtODAwdjQ4MHEwIDMzLTIzLjUgNTYuNVQ4MDAtMjQwaC04MHY4MHEwIDMzLTIzLjUgNTYuNVQ2NDAtODBIMTYwWm0xNjAtMjQwaDQ4MHYtNDgwSDMyMHY0ODBaIi8+PC9zdmc+"; Editor.boldImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjcyLTIwMHYtNTYwaDIyMXE2NSAwIDEyMCA0MHQ1NSAxMTFxMCA1MS0yMyA3OC41VDYwMi00OTFxMjUgMTEgNTUuNSA0MXQzMC41IDkwcTAgODktNjUgMTI0LjVUNTAxLTIwMEgyNzJabTEyMS0xMTJoMTA0cTQ4IDAgNTguNS0yNC41VDU2Ni0zNzJxMC0xMS0xMC41LTM1LjVUNDk0LTQzMkgzOTN2MTIwWm0wLTIyOGg5M3EzMyAwIDQ4LTE3dDE1LTM4cTAtMjQtMTctMzl0LTQ0LTE1aC05NXYxMDlaIi8+PC9zdmc+"; Editor.italicImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTIwMHYtMTAwaDE2MGwxMjAtMzYwSDMyMHYtMTAwaDQwMHYxMDBINTgwTDQ2MC0zMDBoMTQwdjEwMEgyMDBaIi8+PC9zdmc+";Editor.underlineImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTEyMHYtODBoNTYwdjgwSDIwMFptMjgwLTE2MHEtMTAxIDAtMTU3LTYzdC01Ni0xNjd2LTMzMGgxMDN2MzM2cTAgNTYgMjggOTF0ODIgMzVxNTQgMCA4Mi0zNXQyOC05MXYtMzM2aDEwM3YzMzBxMCAxMDQtNTYgMTY3dC0xNTcgNjNaIi8+PC9zdmc+"; Editor.strikethroughImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDg2LTE2MHEtNzYgMC0xMzUtNDV0LTg1LTEyM2w4OC0zOHExNCA0OCA0OC41IDc5dDg1LjUgMzFxNDIgMCA3Ni0yMHQzNC02NHEwLTE4LTctMzN0LTE5LTI3aDExMnE1IDE0IDcuNSAyOC41VDY5NC0zNDBxMCA4Ni02MS41IDEzM1Q0ODYtMTYwWk04MC00ODB2LTgwaDgwMHY4MEg4MFptNDAyLTMyNnE2NiAwIDExNS41IDMyLjVUNjc0LTY3NGwtODggMzlxLTktMjktMzMuNS01MlQ0ODQtNzEwcS00MSAwLTY4IDE4LjVUMzg2LTY0MGgtOTZxMi02OSA1NC41LTExNy41VDQ4Mi04MDZaIi8+PC9zdmc+"; Editor.verticalTextImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNzYwLTE2MGgtODB2LTUyOGwtNDIgNDItNTYtNTYgMTM4LTEzOCAxNDAgMTM4LTU4IDU2LTQyLTQydjUyOFpNNTYwLTI3NiAxMjAtNDQwdi04MGw0NDAtMTY0djc2bC0xMTIgMzh2MTc4bDExMiA0MHY3NlpNMzg0LTQxNHYtMTMybC0xODIgNjR2NGwxODIgNjRaIi8+PC9zdmc+";Editor.alignLeftImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTEyMHYtODBoNzIwdjgwSDEyMFptMC0xNjB2LTgwaDQ4MHY4MEgxMjBabTAtMTYwdi04MGg3MjB2ODBIMTIwWm0wLTE2MHYtODBoNDgwdjgwSDEyMFptMC0xNjB2LTgwaDcyMHY4MEgxMjBaIi8+PC9zdmc+"; Editor.alignCenterImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTEyMHYtODBoNzIwdjgwSDEyMFptMTYwLTE2MHYtODBoNDAwdjgwSDI4MFpNMTIwLTQ0MHYtODBoNzIwdjgwSDEyMFptMTYwLTE2MHYtODBoNDAwdjgwSDI4MFpNMTIwLTc2MHYtODBoNzIwdjgwSDEyMFoiLz48L3N2Zz4=";Editor.alignRightImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTc2MHYtODBoNzIwdjgwSDEyMFptMjQwIDE2MHYtODBoNDgwdjgwSDM2MFpNMTIwLTQ0MHYtODBoNzIwdjgwSDEyMFptMjQwIDE2MHYtODBoNDgwdjgwSDM2MFpNMTIwLTEyMHYtODBoNzIwdjgwSDEyMFoiLz48L3N2Zz4="; Editor.alignJustifyImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTEyMHYtODBoNzIwdjgwSDEyMFptMC0xNjB2LTgwaDcyMHY4MEgxMjBabTAtMTYwdi04MGg3MjB2ODBIMTIwWm0wLTE2MHYtODBoNzIwdjgwSDEyMFptMC0xNjB2LTgwaDcyMHY4MEgxMjBaIi8+PC9zdmc+";Editor.alignTopImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTYwLTc2MHYtODBoNjQwdjgwSDE2MFptMjgwIDY0MHYtNDA4TDMzNi00MjRsLTU2LTU2IDIwMC0yMDAgMjAwIDIwMC01NiA1Ni0xMDQtMTA0djQwOGgtODBaIi8+PC9zdmc+"; Editor.alignMiddleImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDQwLTgwdi0xNjhsLTY0IDY0LTU2LTU2IDE2MC0xNjAgMTYwIDE2MC01NiA1Ni02NC02NHYxNjhoLTgwWk0xNjAtNDQwdi04MGg2NDB2ODBIMTYwWm0zMjAtMTIwTDMyMC03MjBsNTYtNTYgNjQgNjR2LTE2OGg4MHYxNjhsNjQtNjQgNTYgNTYtMTYwIDE2MFoiLz48L3N2Zz4=";Editor.alignBottomImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTYwLTEyMHYtODBoNjQwdjgwSDE2MFptMzIwLTE2MEwyODAtNDgwbDU2LTU2IDEwNCAxMDR2LTQwOGg4MHY0MDhsMTA0LTEwNCA1NiA1Ni0yMDAgMjAwWiIvPjwvc3ZnPg=="; Editor.alignHorizontalLeftImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAtODB2LTgwMGg4MHY4MDBIODBabTE2MC0yMDB2LTEyMGg0MDB2MTIwSDI0MFptMC0yODB2LTEyMGg2NDB2MTIwSDI0MFoiLz48L3N2Zz4=";Editor.alignHorizontalCenterImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDQwLTgwdi0yMDBIMjQwdi0xMjBoMjAwdi0xNjBIMTIwdi0xMjBoMzIwdi0yMDBoODB2MjAwaDMyMHYxMjBINTIwdjE2MGgyMDB2MTIwSDUyMHYyMDBoLTgwWiIvPjwvc3ZnPg=="; Editor.alignHorizontalRightImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAwLTgwdi04MDBoODB2ODAwaC04MFpNMzIwLTI4MHYtMTIwaDQwMHYxMjBIMzIwWk04MC01NjB2LTEyMGg2NDB2MTIwSDgwWiIvPjwvc3ZnPg==";Editor.alignVerticalTopImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjgwLTgwdi02NDBoMTIwdjY0MEgyODBabTI4MC0yNDB2LTQwMGgxMjB2NDAwSDU2MFpNODAtODAwdi04MGg4MDB2ODBIODBaIi8+PC9zdmc+"; Editor.alignVerticalMiddleImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjgwLTEyMHYtMzIwSDgwdi04MGgyMDB2LTMyMGgxMjB2MzIwaDE2MHYtMjAwaDEyMHYyMDBoMjAwdjgwSDY4MHYyMDBINTYwdi0yMDBINDAwdjMyMEgyODBaIi8+PC9zdmc+";Editor.alignVerticalBottomImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAtODB2LTgwaDgwMHY4MEg4MFptMjAwLTE2MHYtNjQwaDEyMHY2NDBIMjgwWm0yODAgMHYtNDAwaDEyMHY0MDBINTYwWiIvPjwvc3ZnPg=="; Editor.subscriptImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNzYwLTE2MHYtODBxMC0xNyAxMS41LTI4LjVUODAwLTI4MGg4MHYtNDBINzYwdi00MGgxMjBxMTcgMCAyOC41IDExLjVUOTIwLTMyMHY0MHEwIDE3LTExLjUgMjguNVQ4ODAtMjQwaC04MHY0MGgxMjB2NDBINzYwWm0tNTI1LTgwIDE4NS0yOTEtMTcyLTI2OWgxMDZsMTI0IDIwMGg0bDEyMy0yMDBoMTA3TDUzOS01MzFsMTg2IDI5MUg2MThMNDgyLTQ1N2gtNEwzNDItMjQwSDIzNVoiLz48L3N2Zz4="; Editor.superscriptImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNzYwLTYwMHYtODBxMC0xNyAxMS41LTI4LjVUODAwLTcyMGg4MHYtNDBINzYwdi00MGgxMjBxMTcgMCAyOC41IDExLjVUOTIwLTc2MHY0MHEwIDE3LTExLjUgMjguNVQ4ODAtNjgwaC04MHY0MGgxMjB2NDBINzYwWk0yMzUtMTYwbDE4NS0yOTEtMTcyLTI2OWgxMDZsMTI0IDIwMGg0bDEyMy0yMDBoMTA3TDUzOS00NTFsMTg2IDI5MUg2MThMNDgyLTM3N2gtNEwzNDItMTYwSDIzNVoiLz48L3N2Zz4="; Editor.orderedListImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTgwdi02MGgxMDB2LTMwaC02MHYtNjBoNjB2LTMwSDEyMHYtNjBoMTIwcTE3IDAgMjguNSAxMS41VDI4MC0yODB2NDBxMCAxNy0xMS41IDI4LjVUMjQwLTIwMHExNyAwIDI4LjUgMTEuNVQyODAtMTYwdjQwcTAgMTctMTEuNSAyOC41VDI0MC04MEgxMjBabTAtMjgwdi0xMTBxMC0xNyAxMS41LTI4LjVUMTYwLTUxMGg2MHYtMzBIMTIwdi02MGgxMjBxMTcgMCAyOC41IDExLjVUMjgwLTU2MHY3MHEwIDE3LTExLjUgMjguNVQyNDAtNDUwaC02MHYzMGgxMDB2NjBIMTIwWm02MC0yODB2LTE4MGgtNjB2LTYwaDEyMHYyNDBoLTYwWm0xODAgNDQwdi04MGg0ODB2ODBIMzYwWm0wLTI0MHYtODBoNDgwdjgwSDM2MFptMC0yNDB2LTgwaDQ4MHY4MEgzNjBaIi8+PC9zdmc+"; Editor.unorderedListImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzYwLTIwMHYtODBoNDgwdjgwSDM2MFptMC0yNDB2LTgwaDQ4MHY4MEgzNjBabTAtMjQwdi04MGg0ODB2ODBIMzYwWk0yMDAtMTYwcS0zMyAwLTU2LjUtMjMuNVQxMjAtMjQwcTAtMzMgMjMuNS01Ni41VDIwMC0zMjBxMzMgMCA1Ni41IDIzLjVUMjgwLTI0MHEwIDMzLTIzLjUgNTYuNVQyMDAtMTYwWm0wLTI0MHEtMzMgMC01Ni41LTIzLjVUMTIwLTQ4MHEwLTMzIDIzLjUtNTYuNVQyMDAtNTYwcTMzIDAgNTYuNSAyMy41VDI4MC00ODBxMCAzMy0yMy41IDU2LjVUMjAwLTQwMFptMC0yNDBxLTMzIDAtNTYuNS0yMy41VDEyMC03MjBxMC0zMyAyMy41LTU2LjVUMjAwLTgwMHEzMyAwIDU2LjUgMjMuNVQyODAtNzIwcTAgMzMtMjMuNSA1Ni41VDIwMC02NDBaIi8+PC9zdmc+"; Editor.indentImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTEyMHYtODBoNzIwdjgwSDEyMFptMzIwLTE2MHYtODBoNDAwdjgwSDQ0MFptMC0xNjB2LTgwaDQwMHY4MEg0NDBabTAtMTYwdi04MGg0MDB2ODBINDQwWk0xMjAtNzYwdi04MGg3MjB2ODBIMTIwWm0wIDQ0MHYtMzIwbDE2MCAxNjAtMTYwIDE2MFoiLz48L3N2Zz4=";Editor.outdentImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTIwLTEyMHYtODBoNzIwdjgwSDEyMFptMzIwLTE2MHYtODBoNDAwdjgwSDQ0MFptMC0xNjB2LTgwaDQwMHY4MEg0NDBabTAtMTYwdi04MGg0MDB2ODBINDQwWk0xMjAtNzYwdi04MGg3MjB2ODBIMTIwWm0xNjAgNDQwTDEyMC00ODBsMTYwLTE2MHYzMjBaIi8+PC9zdmc+"; Editor.removeFormatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJtNTI4LTU0Ni05My05My0xMjEtMTIxaDQ4NnYxMjBINTY4bC00MCA5NFpNNzkyLTU2IDQ2MC0zODhsLTgwIDE4OEgyNDlsMTE5LTI4MEw1Ni03OTJsNTYtNTYgNzM2IDczNi01NiA1NloiLz48L3N2Zz4=";Editor.textFormatImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTIwMHYtODBoNTYwdjgwSDIwMFptNzYtMTYwIDE2NC00NDBoODBsMTY0IDQ0MGgtNzZsLTM4LTExMkgzOTJsLTQwIDExMmgtNzZabTEzOC0xNzZoMTMybC02NC0xODJoLTRsLTY0IDE4MloiLz48L3N2Zz4="; Editor.codeImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzIwLTI0MCA4MC00ODBsMjQwLTI0MCA1NyA1Ny0xODQgMTg0IDE4MyAxODMtNTYgNTZabTMyMCAwLTU3LTU3IDE4NC0xODQtMTgzLTE4MyA1Ni01NiAyNDAgMjQwLTI0MCAyNDBaIi8+PC9zdmc+";Editor.linkImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDQwLTI4MEgyODBxLTgzIDAtMTQxLjUtNTguNVQ4MC00ODBxMC04MyA1OC41LTE0MS41VDI4MC02ODBoMTYwdjgwSDI4MHEtNTAgMC04NSAzNXQtMzUgODVxMCA1MCAzNSA4NXQ4NSAzNWgxNjB2ODBaTTMyMC00NDB2LTgwaDMyMHY4MEgzMjBabTIwMCAxNjB2LTgwaDE2MHE1MCAwIDg1LTM1dDM1LTg1cTAtNTAtMzUtODV0LTg1LTM1SDUyMHYtODBoMTYwcTgzIDAgMTQxLjUgNTguNVQ4ODAtNDgwcTAgODMtNTguNSAxNDEuNVQ2ODAtMjgwSDUyMFoiLz48L3N2Zz4="; Editor.lightDarkLinkImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBzdHlsZT0iY29sb3Itc2NoZW1lOmxpZ2h0IGRhcms7IiBmaWxsPSJsaWdodC1kYXJrKCMwMDAwMDAsI2ZmZmZmZikiPjxwYXRoIGQ9Ik00NDAtMjgwSDI4MHEtODMgMC0xNDEuNS01OC41VDgwLTQ4MHEwLTgzIDU4LjUtMTQxLjVUMjgwLTY4MGgxNjB2ODBIMjgwcS01MCAwLTg1IDM1dC0zNSA4NXEwIDUwIDM1IDg1dDg1IDM1aDE2MHY4MFpNMzIwLTQ0MHYtODBoMzIwdjgwSDMyMFptMjAwIDE2MHYtODBoMTYwcTUwIDAgODUtMzV0MzUtODVxMC01MC0zNS04NXQtODUtMzVINTIwdi04MGgxNjBxODMgMCAxNDEuNSA1OC41VDg4MC00ODBxMCA4My01OC41IDE0MS41VDY4MC0yODBINTIwWiIvPjwvc3ZnPg=="; Editor.tooltipImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMWYxZjFmIj48cGF0aCBkPSJNNDQwLTI4MGg4MHYtMjQwaC04MHYyNDBabTY4LjUtMzMxLjVRNTIwLTYyMyA1MjAtNjQwdC0xMS41LTI4LjVRNDk3LTY4MCA0ODAtNjgwdC0yOC41IDExLjVRNDQwLTY1NyA0NDAtNjQwdDExLjUgMjguNVE0NjMtNjAwIDQ4MC02MDB0MjguNS0xMS41Wk00ODAtODBxLTgzIDAtMTU2LTMxLjVUMTk3LTE5N3EtNTQtNTQtODUuNS0xMjdUODAtNDgwcTAtODMgMzEuNS0xNTZUMTk3LTc2M3E1NC01NCAxMjctODUuNVQ0ODAtODgwcTgzIDAgMTU2IDMxLjVUNzYzLTc2M3E1NCA1NCA4NS41IDEyN1Q4ODAtNDgwcTAgODMtMzEuNSAxNTZUNzYzLTE5N3EtNTQgNTQtMTI3IDg1LjVUNDgwLTgwWm0wLTgwcTEzNCAwIDIyNy05M3Q5My0yMjdxMC0xMzQtOTMtMjI3dC0yMjctOTNxLTEzNCAwLTIyNyA5M3QtOTMgMjI3cTAgMTM0IDkzIDIyN3QyMjcgOTNabTAtMzIwWiIvPjwvc3ZnPg=="; Editor.lightDarkTooltipImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBzdHlsZT0iY29sb3Itc2NoZW1lOmxpZ2h0IGRhcms7IiBmaWxsPSJsaWdodC1kYXJrKCMwMDAwMDAsI2ZmZmZmZikiPjxwYXRoIGQ9Ik00NDAtMjgwaDgwdi0yNDBoLTgwdjI0MFptNjguNS0zMzEuNVE1MjAtNjIzIDUyMC02NDB0LTExLjUtMjguNVE0OTctNjgwIDQ4MC02ODB0LTI4LjUgMTEuNVE0NDAtNjU3IDQ0MC02NDB0MTEuNSAyOC41UTQ2My02MDAgNDgwLTYwMHQyOC41LTExLjVaTTQ4MC04MHEtODMgMC0xNTYtMzEuNVQxOTctMTk3cS01NC01NC04NS41LTEyN1Q4MC00ODBxMC04MyAzMS41LTE1NlQxOTctNzYzcTU0LTU0IDEyNy04NS41VDQ4MC04ODBxODMgMCAxNTYgMzEuNVQ3NjMtNzYzcTU0IDU0IDg1LjUgMTI3VDg4MC00ODBxMCA4My0zMS41IDE1NlQ3NjMtMTk3cS01NCA1NC0xMjcgODUuNVQ0ODAtODBabTAtODBxMTM0IDAgMjI3LTkzdDkzLTIyN3EwLTEzNC05My0yMjd0LTIyNy05M3EtMTM0IDAtMjI3IDkzdC05MyAyMjdxMCAxMzQgOTMgMjI3dDIyNyA5M1ptMC0zMjBaIi8+PC9zdmc+"; Editor.lightDarkNoteImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBzdHlsZT0iY29sb3Itc2NoZW1lOmxpZ2h0IGRhcms7IiBmaWxsPSJsaWdodC1kYXJrKCMwMDAwMDAsI2ZmZmZmZikiPjxwYXRoIGQ9Ik0yNDAtMTIwcS0zMyAwLTU2LjUtMjMuNVQxNjAtMjAwdi01NjBxMC0zMyAyMy41LTU2LjVUMjQwLTg0MGg0ODBxMzMgMCA1Ni41IDIzLjVUODAwLTc2MHYzNjBMNTIwLTEyMEgyNDBabTAtODBoMjA3di0yMzNoMjUzdi0zMjdIMjQwdjU2MFptODAtMzYwdi04MGgzMjB2ODBIMzIwWm0wIDE2MHYtODBoMTIwdjgwSDMyMFoiLz48L3N2Zz4="; Editor.imageImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTEyMHEtMzMgMC01Ni41LTIzLjVUMTIwLTIwMHYtNTYwcTAtMzMgMjMuNS01Ni41VDIwMC04NDBoNTYwcTMzIDAgNTYuNSAyMy41VDg0MC03NjB2NTYwcTAgMzMtMjMuNSA1Ni41VDc2MC0xMjBIMjAwWm0wLTgwaDU2MHYtNTYwSDIwMHY1NjBabTQwLTgwaDQ4MEw1NzAtNDgwIDQ1MC0zMjBsLTkwLTEyMC0xMjAgMTYwWm0tNDAgODB2LTU2MCA1NjBaIi8+PC9zdmc+"; Editor.horizontalRuleImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTYwLTQ0MHYtODBoNjQwdjgwSDE2MFoiLz48L3N2Zz4=";Editor.tableImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTEyMHEtMzMgMC01Ni41LTIzLjVUMTIwLTIwMHYtNTYwcTAtMzMgMjMuNS01Ni41VDIwMC04NDBoNTYwcTMzIDAgNTYuNSAyMy41VDg0MC03NjB2NTYwcTAgMzMtMjMuNSA1Ni41VDc2MC0xMjBIMjAwWm0yNDAtMjQwSDIwMHYxNjBoMjQwdi0xNjBabTgwIDB2MTYwaDI0MHYtMTYwSDUyMFptLTgwLTgwdi0xNjBIMjAwdjE2MGgyNDBabTgwIDBoMjQwdi0xNjBINTIwdjE2MFpNMjAwLTY4MGg1NjB2LTgwSDIwMHY4MFoiLz48L3N2Zz4="; Editor.spacingImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjQwLTgwIDgwLTI0MGwxNjAtMTYwIDU3IDU2LTY0IDY0aDQ5NGwtNjMtNjQgNTYtNTYgMTYwIDE2MEw3MjAtODBsLTU3LTU2IDY0LTY0SDIzM2w2MyA2NC01NiA1NlptMzYtMzYwIDE2NC00NDBoODBsMTY0IDQ0MGgtNzZsLTM4LTExMkgzOTJsLTQwIDExMmgtNzZabTEzOC0xNzZoMTMybC02NC0xODJoLTRsLTY0IDE4MloiLz48L3N2Zz4=";Editor.addColumnLeftImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODAwLTIwMHYtNTYwSDU2MHY1NjBoMjQwWm0tNjQwIDgwdi0xNjBoODB2ODBoMjQwdi01NjBIMjQwdjgwaC04MHYtMTYwaDcyMHY3MjBIMTYwWm0zMjAtMzYwWm04MCAwaC04MCA4MFptMCAwWk0xNjAtMzYwdi04MEg4MHYtODBoODB2LTgwaDgwdjgwaDgwdjgwaC04MHY4MGgtODBaIi8+PC9zdmc+"; Editor.addColumnRightImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMTYwLTc2MHY1NjBoMjQwdi01NjBIMTYwWk04MC0xMjB2LTcyMGg3MjB2MTYwaC04MHYtODBINDgwdjU2MGgyNDB2LTgwaDgwdjE2MEg4MFptNDAwLTM2MFptLTgwIDBoODAtODBabTAgMFptMzIwIDEyMHYtODBoLTgwdi04MGg4MHYtODBoODB2ODBoODB2ODBoLTgwdjgwaC04MFoiLz48L3N2Zz4=";Editor.removeColumnImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIiB0cmFuc2Zvcm09InJvdGF0ZSg5MCkgc2NhbGUoMSwtMSkiPjxwYXRoIGQ9Ik01NjAtMjgwSDEyMHYtNDAwaDcyMHYxMjBoLTgwdi00MEgyMDB2MjQwaDM2MHY4MFptLTM2MC04MHYtMjQwIDI0MFptNDQwIDEwNCA4NC04NC04NC04NCA1Ni01NiA4NCA4NCA4NC04NCA1NiA1Ni04MyA4NCA4MyA4NC01NiA1Ni04NC04My04NCA4My01Ni01NloiLz48L3N2Zz4="; Editor.addRowAboveImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTE2MGg1NjB2LTI0MEgyMDB2MjQwWm02NDAgODBIMTIwdi03MjBoMTYwdjgwaC04MHYyNDBoNTYwdi0yNDBoLTgwdi04MGgxNjB2NzIwWk00ODAtNDgwWm0wIDgwdi04MCA4MFptMCAwWm0tNDAtMjQwdi04MGgtODB2LTgwaDgwdi04MGg4MHY4MGg4MHY4MGgtODB2ODBoLTgwWiIvPjwvc3ZnPg==";Editor.addRowBelowImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTU2MGg1NjB2LTI0MEgyMDB2MjQwWm0tODAgNDAwdi03MjBoNzIwdjcyMEg2ODB2LTgwaDgwdi0yNDBIMjAwdjI0MGg4MHY4MEgxMjBabTM2MC0zMjBabTAtODB2ODAtODBabTAgMFpNNDQwLTgwdi04MGgtODB2LTgwaDgwdi04MGg4MHY4MGg4MHY4MGgtODB2ODBoLTgwWiIvPjwvc3ZnPg=="; Editor.removeRowImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNTYwLTI4MEgxMjB2LTQwMGg3MjB2MTIwaC04MHYtNDBIMjAwdjI0MGgzNjB2ODBabS0zNjAtODB2LTI0MCAyNDBabTQ0MCAxMDQgODQtODQtODQtODQgNTYtNTYgODQgODQgODQtODQgNTYgNTYtODMgODQgODMgODQtNTYgNTYtODQtODMtODQgODMtNTYtNTZaIi8+PC9zdmc+";Editor.autosizeImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDAtNDB2LTI0MGg4MHYtNDAwSDQwdi0yNDBoMjQwdjgwaDQwMHYtODBoMjQwdjI0MGgtODB2NDAwaDgwdjI0MEg2ODB2LTgwSDI4MHY4MEg0MFptMjQwLTE2MGg0MDB2LTgwaDgwdi00MDBoLTgwdi04MEgyODB2ODBoLTgwdjQwMGg4MHY4MFptMzItMTIwIDEzNi0zNjBoNjRsMTM2IDM2MGgtNjJsLTMyLTkySDQwOGwtMzIgOTJoLTY0Wm0xMTQtMTQ0aDEwOGwtNTItMTUwaC00bC01MiAxNTBaTTEyMC03NjBoODB2LTgwaC04MHY4MFptNjQwIDBoODB2LTgwaC04MHY4MFptMCA2NDBoODB2LTgwaC04MHY4MFptLTY0MCAwaDgwdi04MGgtODB2ODBabTgwLTY0MFptNTYwIDBabTAgNTYwWm0tNTYwIDBaIi8+PC9zdmc+"; Editor.checkmarkImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjJweCIgaGVpZ2h0PSIxOHB4IiB2ZXJzaW9uPSIxLjEiPjxwYXRoIHRyYW5zZm9ybT0idHJhbnNsYXRlKDQgMCkiIGQ9Ik03LjE4MSwxNS4wMDdhMSwxLDAsMCwxLS43OTMtMC4zOTFMMy4yMjIsMTAuNUExLDEsMCwxLDEsNC44MDgsOS4yNzRMNy4xMzIsMTIuM2w2LjA0NC04Ljg2QTEsMSwwLDEsMSwxNC44Myw0LjU2OWwtNi44MjMsMTBhMSwxLDAsMCwxLS44LjQzN0g3LjE4MVoiIGZpbGw9IiMwMDAwMDAiLz48L3N2Zz4="; Editor.swapImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzIwLTQ0MHYtMjg3TDIxNy02MjRsLTU3LTU2IDIwMC0yMDAgMjAwIDIwMC01NyA1Ni0xMDMtMTAzdjI4N2gtODBaTTYwMC04MCA0MDAtMjgwbDU3LTU2IDEwMyAxMDN2LTI4N2g4MHYyODdsMTAzLTEwMyA1NyA1Nkw2MDAtODBaIi8+PC9zdmc+";Editor.copyImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNzYwLTIwMEgzMjBxLTMzIDAtNTYuNS0yMy41VDI0MC0yODB2LTU2MHEwLTMzIDIzLjUtNTYuNVQzMjAtOTIwaDI4MGwyNDAgMjQwdjQwMHEwIDMzLTIzLjUgNTYuNVQ3NjAtMjAwWk01NjAtNjQwdi0yMDBIMzIwdjU2MGg0NDB2LTM2MEg1NjBaTTE2MC00MHEtMzMgMC01Ni41LTIzLjVUODAtMTIwdi01NjBoODB2NTYwaDQ0MHY4MEgxNjBabTE2MC04MDB2MjAwLTIwMCA1NjAtNTYwWiIvPjwvc3ZnPg=="; Editor.pasteImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTEyMHEtMzMgMC01Ni41LTIzLjVUMTIwLTIwMHYtNTYwcTAtMzMgMjMuNS01Ni41VDIwMC04NDBoMTY4cTEzLTM2IDQzLjUtNTh0NjguNS0yMnEzOCAwIDY4LjUgMjJ0NDMuNSA1OGgxNjhxMzMgMCA1Ni41IDIzLjVUODQwLTc2MHY1NjBxMCAzMy0yMy41IDU2LjVUNzYwLTEyMEgyMDBabTAtODBoNTYwdi01NjBoLTgwdjEyMEgyODB2LTEyMGgtODB2NTYwWm0yODAtNTYwcTE3IDAgMjguNS0xMS41VDUyMC04MDBxMC0xNy0xMS41LTI4LjVUNDgwLTg0MHEtMTcgMC0yOC41IDExLjVUNDQwLTgwMHEwIDE3IDExLjUgMjguNVQ0ODAtNzYwWiIvPjwvc3ZnPg=="; Editor.doubleArrowUpImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJtMjk2LTIyNC01Ni01NiAyNDAtMjQwIDI0MCAyNDAtNTYgNTYtMTg0LTE4My0xODQgMTgzWm0wLTI0MC01Ni01NiAyNDAtMjQwIDI0MCAyNDAtNTYgNTYtMTg0LTE4My0xODQgMTgzWiIvPjwvc3ZnPg==";Editor.doubleArrowDownImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTIwMCAyNDAtNDQwbDU2LTU2IDE4NCAxODMgMTg0LTE4MyA1NiA1Ni0yNDAgMjQwWm0wLTI0MEwyNDAtNjgwbDU2LTU2IDE4NCAxODMgMTg0LTE4MyA1NiA1Ni0yNDAgMjQwWiIvPjwvc3ZnPg=="; Editor.opacityImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMWYxZjFmIj48cGF0aCBkPSJNNDgwLTEyMHEtMTMzIDAtMjI2LjUtOTJUMTYwLTQzNnEwLTY1IDI1LTEyMS41VDI1NC02NThsMjI2LTIyMiAyMjYgMjIycTQ0IDQ0IDY5IDEwMC41VDgwMC00MzZxMCAxMzItOTMuNSAyMjRUNDgwLTEyMFpNMjQyLTQwMGg0NzRxMTItNzItMTMuNS0xMjNUNjUwLTYwMEw0ODAtNzY4IDMxMC02MDBxLTI3IDI2LTUzIDc3dC0xNSAxMjNaIi8+PC9zdmc+";Editor.shareImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMWYxZjFmIj48cGF0aCBkPSJNMjQwLTgwcS0zMyAwLTU2LjUtMjMuNVQxNjAtMTYwdi00MDBxMC0zMyAyMy41LTU2LjVUMjQwLTY0MGgxMjB2ODBIMjQwdjQwMGg0ODB2LTQwMEg2MDB2LTgwaDEyMHEzMyAwIDU2LjUgMjMuNVQ4MDAtNTYwdjQwMHEwIDMzLTIzLjUgNTYuNVQ3MjAtODBIMjQwWm0yMDAtMjQwdi00NDdsLTY0IDY0LTU2LTU3IDE2MC0xNjAgMTYwIDE2MC01NiA1Ny02NC02NHY0NDdoLTgwWiIvPjwvc3ZnPg=="; Editor.roughFillStyles=[{val:"auto",dispName:"Auto",res:"automatic"},{val:"hachure",dispName:"Hachure",res:"hachure"},{val:"solid",dispName:"Solid",res:"solid"},{val:"zigzag",dispName:"ZigZag",res:"zigzag"},{val:"cross-hatch",dispName:"Cross Hatch",res:"crossHatch"},{val:"dashed",dispName:"Dashed",res:"dashed"},{val:"zigzag-line",dispName:"ZigZag Line",res:"zigzagLine"}]; Editor.fillStyles=[{val:"auto",dispName:"Auto",res:"automatic"},{val:"hatch",dispName:"Hatch",res:"hatch"},{val:"solid",dispName:"Solid",res:"solid"},{val:"dots",dispName:"Dots",res:"dots"},{val:"cross-hatch",dispName:"Cross Hatch",res:"crossHatch"},{val:"dashed",dispName:"Dashed",res:"dashed"},{val:"zigzag-line",dispName:"ZigZag Line",res:"zigzagLine"}];Editor.themes=[];Editor.ctrlKey=mxClient.IS_MAC?"⌘":"Ctrl";Editor.altKey=mxClient.IS_MAC?"⌥":"Alt";Editor.shiftKey=mxClient.IS_MAC?"⇧":"Shift"; Editor.hintOffset=20;Editor.shapePickerHoverDelay=300;Editor.fitWindowBorders=null;Editor.suppressNewWindows=null!=window.urlParams&&"1"==urlParams.suppressNewWindows;Editor.popupsAllowed=(null!=window.urlParams?"1"!=urlParams.noDevice:!0)&&!Editor.suppressNewWindows;Editor.simpleLabels=!1;Editor.optimizeHtmlLabels=!1;Editor.enableNativeClipboard=window==window.top&&null!=navigator.clipboard&&null!=navigator.clipboard.read;Editor.sketchMode=!1;Editor.darkMode=!1;Editor.currentTheme=uiTheme; Editor.darkColor="#121212";Editor.darkColorVar="--ge-dark-color";Editor.pageBackgroundColor="#ffffff";Editor.darkPageBackgroundColor=null;Editor.getDefaultPageBackgroundColor=function(){return"light-dark("+Editor.pageBackgroundColor+", "+(null!=Editor.darkPageBackgroundColor?Editor.darkPageBackgroundColor:Editor.darkColor)+")"};Editor.fontSizeUnit="px";Editor.transitionDelay=.1;Editor.pageSizeUnit=mxConstants.INCHES;Editor.removeImageMetadata=!0;Editor.showConnectHandle=!1; Editor.enableInlineToolbar=!0;Editor.defaultTransparentGroups=!1;Editor.enableAutoRotateLabels=!0;Editor.isDarkMode=function(){return Editor.darkMode};Editor.isPngDataUrl=function(b){return null!=b&&"data:image/png;"==b.substring(0,15)};Editor.isJpgDataUrl=function(b){return null!=b&&("data:image/jpg;"==b.substring(0,15)||"data:image/jpeg;"==b.substring(0,16))}; Editor.isPngData=function(b){return 8<b.length&&137==b.charCodeAt(0)&&80==b.charCodeAt(1)&&78==b.charCodeAt(2)&&71==b.charCodeAt(3)&&13==b.charCodeAt(4)&&10==b.charCodeAt(5)&&26==b.charCodeAt(6)&&10==b.charCodeAt(7)};Editor.isJpgData=function(b){return 2<b.length&&255==b.charCodeAt(0)&&216==b.charCodeAt(1)}; Editor.stripImageMetadata=function(b,d){if(null!=b&&d&&(Editor.isJpgDataUrl(b)||Editor.isPngDataUrl(b))){d=b.indexOf(",")+1;var m=b.substring(d),p=window.atob&&!mxClient.IS_SF?atob(m):Base64.decode(m,!0),t=new ArrayBuffer(p.length),n=new Uint8Array(t);for(m=0;m<p.length;m++)n[m]=p.charCodeAt(m);n=null;try{Editor.isJpgData(p)?n=Editor.stripJpgMetadata(t):Editor.isPngData(p)&&(n=Editor.stripPngMetadata(t))}catch(z){}if(null!=n){p="";for(m=0;m<n.length;m++)p+=String.fromCharCode(n[m]);b=b.substring(0, d)+btoa(p)}}return b}; Editor.stripJpgMetadata=function(b){var d=new DataView(b),m=[];m.push(new Uint8Array(b,0,2));for(var p=2;p<b.byteLength-1;){var t=d.getUint16(p);if(65498===t){m.push(new Uint8Array(b,p));break}if(65488<=t&&65497>=t)m.push(new Uint8Array(b,p,2)),p+=2;else{var n=d.getUint16(p+2),z=65506===t;65505===t||z||m.push(new Uint8Array(b,p,2+n));p+=2+n}}b=m.reduce(function(D,N){return D+N.length},0);b=new Uint8Array(b);d=0;m=$jscomp.makeIterator(m);for(p=m.next();!p.done;p=m.next())p=p.value,b.set(p,d),d+=p.length; return b}; Editor.stripPngMetadata=function(b){var d=new DataView(b),m=new Set("eXIf tEXt iTXt zTXt iCCP tIME".split(" ")),p=[];p.push(new Uint8Array(b,0,8));for(var t=8;t<b.byteLength;){var n=d.getUint32(t),z=String.fromCharCode(d.getUint8(t+4),d.getUint8(t+5),d.getUint8(t+6),d.getUint8(t+7));n=8+n+4;m.has(z)||p.push(new Uint8Array(b,t,n));t+=n;if("IEND"===z)break}b=p.reduce(function(D,N){return D+N.length},0);b=new Uint8Array(b);d=0;p=$jscomp.makeIterator(p);for(m=p.next();!m.done;m=p.next())m=m.value,b.set(m, d),d+=m.length;return b};Editor.convertHtmlToText=function(b){if(null!=b){var d=document.createElement("div");d.innerHTML=Graph.sanitizeHtml(b);return mxUtils.extractTextWithWhitespace(d.childNodes)}return null}; Editor.extractGraphModelFromText=function(b){function d(n){var z=n.indexOf("```");0<=z&&(n=n.substring(n,0,z+6));return n}function m(n){var z=n.lastIndexOf("```");0<=z&&(n=n.substring(z+3));return n}var p=b.indexOf("<mxGraphModel "),t=b.indexOf("</mxGraphModel>");0>p&&(p=b.indexOf("<mxGraphModel>"));return 0<=p&&t>p?[mxUtils.trim(d(b.substring(0,p))),b.substring(p,t+15),mxUtils.trim(m(b.substring(t+15)))]:[b,"",""]}; Editor.repairTruncatedXml=function(b){var d=b.indexOf("<mxfile");0>d&&(d=b.indexOf("<mxGraphModel"));0>d&&(d=0);for(var m=[],p=d,t=!1,n=d;n<b.length;){var z=b.indexOf("<",n);if(0>z){t=0<m.length;break}if("\x3c!--"==b.substring(z,z+4)){n=b.indexOf("--\x3e",z+4);if(0>n){t=!0;break}n+=3}else if("<![CDATA["==b.substring(z,z+9)){n=b.indexOf("]]\x3e",z+9);if(0>n){t=!0;break}n+=3}else{var D=null;n=-1;for(var N=z+1;N<b.length;N++){var F=b.charAt(N);if(null!=D)F==D&&(D=null);else if('"'==F||"'"==F)D=F;else if(">"== F){n=N;break}}if(0>n){t=!0;break}p=b.charAt(z+1);if("/"==p){if(p=/^<\/\s*([^\s>]+)/.exec(b.substring(z,n)),null!=p)for(z=m.length-1;0<=z;z--)if(m[z]==p[1]){m.splice(z);break}}else"?"!=p&&"!"!=p&&"/"!=b.charAt(n-1)&&(p=/^<\s*([^\s\/>]+)/.exec(b.substring(z,n)),null!=p&&m.push(p[1]));n+=1}p=n}if(!t&&0==m.length||p<=d)return null;b=b.substring(0,p);for(d=m.length-1;0<=d;d--)b+="</"+m[d]+">";return b}; Editor.extractGraphModelFromPng=function(b){var d=null;try{var m=b.substring(b.indexOf(",")+1),p=window.atob&&!mxClient.IS_SF?atob(m):Base64.decode(m,!0);EditorUi.parsePng(p,mxUtils.bind(this,function(t,n,z){t=p.substring(t+8,t+8+z);if("zTXt"==n){z=t.indexOf(String.fromCharCode(0));var D=t.substring(0,z);if("mxGraphModel"==D||"mxfile"==D){t=Graph.stringToArrayBuffer(t.substring(z+2));z=null;try{z=pako.inflate(t,{to:"string"})}catch(N){z=pako.inflateRaw(t,{to:"string"})}z=null!=z?z.replace(/\+/g," "): null;null!=z&&0<z.length&&(d=z)}}else"tEXt"==n&&(t=t.split(String.fromCharCode(0)),1<t.length&&("mxGraphModel"==t[0]||"mxfile"==t[0])&&(d=t[1]));if(null!=d||"IDAT"==n)return!0}))}catch(t){}null!=d&&"%"==d.charAt(0)&&(d=decodeURIComponent(d));null!=d&&"%"==d.charAt(0)&&(d=decodeURIComponent(d));return d}; Editor.getLabelForStylename=function(b){var d=b.match(/^([A-Za-z]*)(\d*)$/);null!=d&&1<d.length&&(b=mxUtils.trim(d[1].replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,function(m){return m.toUpperCase()}).replace(/Color[s]?/g,"")),b=mxUtils.trim(b+(0<d[2].length?" ("+d[2]+")":"")));return b}; Editor.soundex=function(b){if(null==b||0==b.length)return"";var d=[],m=1;d[0]=b[0].toUpperCase();for(var p=1,t=b.length;p<t;p++){var n=b[p].toUpperCase().charCodeAt(0)-65;if(0<=n&&25>=n&&"0"!="01230120022455012603010202"[n]&&("01230120022455012603010202"[n]!=d[m-1]&&(d[m]="01230120022455012603010202"[n],m++),3<m))break}if(3>=m)for(;3>=m;)d[m]="0",m++;return d.join("")}; Editor.selectFilename=function(b){var d=b.value.lastIndexOf(".");if(0<d){var m=b.value.substring(d+1);"drawio"!=m&&0<=mxUtils.indexOf(["png","svg","html","xml","pdf"],m)&&(m=b.value.lastIndexOf(".drawio.",d),0<m&&(d=m))}d=0<d?d:b.value.length;Editor.selectSubstring(b,0,d)}; Editor.selectSubstring=function(b,d,m){b.focus();"undefined"!=typeof b.selectionStart?(b.selectionStart=d,b.selectionEnd=m):document.selection&&document.selection.createRange&&(b.select(),b=document.selection.createRange(),b.collapse(!0),b.moveEnd("character",m),b.moveStart("character",d),b.select())}; Editor.toUnit=function(b,d){return d==mxConstants.INCHES?Math.round(1E3*b/mxConstants.PIXELS_PER_INCH)/1E3:d==mxConstants.MILLIMETERS?Math.round(1E3*b/mxConstants.PIXELS_PER_MM)/1E3:d==mxConstants.METERS?Math.round(1E5*b/(1E3*mxConstants.PIXELS_PER_MM))/1E5:Math.round(10*b)/10}; Editor.fromUnit=function(b,d){d==mxConstants.INCHES?b*=mxConstants.PIXELS_PER_INCH:d==mxConstants.MILLIMETERS?b*=mxConstants.PIXELS_PER_MM:d==mxConstants.METERS&&(b=b*mxConstants.PIXELS_PER_MM*1E3);return Math.round(10*b)/10};Editor.getCursorMoveStep=function(b){return b==mxConstants.MILLIMETERS?.1*mxConstants.PIXELS_PER_MM:b==mxConstants.INCHES?.01*mxConstants.PIXELS_PER_INCH:b==mxConstants.METERS?.1*mxConstants.PIXELS_PER_MM:1};mxUtils.extend(Editor,mxEventSource); Editor.prototype.originalNoForeignObject=mxClient.NO_FO;Editor.prototype.transparentImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhMAAwAIAAAP///wAAACH5BAEAAAAALAAAAAAwADAAAAIxhI+py+0Po5y02ouz3rz7D4biSJbmiabqyrbuC8fyTNf2jef6zvf+DwwKh8Si8egpAAA7":IMAGE_PATH+"/transparent.gif";Editor.prototype.extendCanvas=!0;Editor.prototype.chromeless=!1;Editor.prototype.cancelFirst=!0;Editor.prototype.enabled=!0;Editor.prototype.filename=null;Editor.prototype.modified=!1;Editor.prototype.autosave=!0; Editor.prototype.appName=document.title;Editor.prototype.editBlankUrl=window.location.origin+window.location.pathname;Editor.prototype.defaultGraphOverflow="hidden";Editor.prototype.init=function(){};Editor.prototype.isChromelessView=function(){return this.chromeless};Editor.prototype.setAutosave=function(b){this.autosave=b;this.fireEvent(new mxEventObject("autosaveChanged"))};Editor.prototype.getEditBlankUrl=function(b){return this.editBlankUrl+b}; Editor.prototype.editAsNew=function(b,d,m,p){d=null!=d?"?title="+encodeURIComponent(d):"";m?d+=(0<d.length?"&":"?")+"lightbox=1":null!=urlParams.ui&&(d+=(0<d.length?"&":"?")+"ui="+urlParams.ui);null!=p&&(d+=(0<d.length?"&":"?")+"page-id="+p);if(navigator.standalone||"undefined"===typeof window.postMessage)this.graph.openLink(this.getEditBlankUrl(d)+"#R"+encodeURIComponent(b));else{var t=null,n=mxUtils.bind(this,function(D){"ready"==D.data&&D.source==t&&(mxEvent.removeListener(window,"message",n), t.postMessage(b,"*"))});m=d.substring(1).split("&");p={client:1};for(d=0;d<m.length;d++){var z=m[d].split("=");p[z[0]]=z[1]||""}mxEvent.addListener(window,"message",n);t=this.graph.openLink(this.getEditBlankUrl("")+"#P"+encodeURIComponent(JSON.stringify(p)),null,!0)}}; Editor.prototype.createGraph=function(b,d){b=new Graph(null,d,null,null,b);b.transparentBackground=!1;var m=b.isCssTransformsSupported,p=this;b.isCssTransformsSupported=function(){return m.apply(this,arguments)&&(!p.chromeless||!mxClient.IS_SF)};this.chromeless||(b.isBlankLink=function(t){return!this.isExternalProtocol(t)});return b}; Editor.prototype.resetGraph=function(){this.graph.gridEnabled=this.graph.defaultGridEnabled&&(!this.isChromelessView()||"1"==urlParams.grid);this.graph.graphHandler.guidesEnabled=!0;this.graph.setTooltips(null==window.urlParams||"0"!=urlParams.tooltips);this.graph.setConnectable(this.graph.defaultConnectable);this.graph.connectionArrowsEnabled=this.graph.defaultConnectionArrowsEnabled;this.graph.foldingEnabled=this.graph.defaultFoldingEnabled;this.graph.scrollbars=this.graph.defaultScrollbars;this.graph.pageVisible= this.graph.defaultPageVisible;this.graph.pageBreaksVisible=this.graph.pageVisible;this.graph.preferPageSize=this.graph.pageBreaksVisible;this.graph.background=null;this.graph.pageScale=mxGraph.prototype.pageScale;this.graph.pageFormat=mxGraph.prototype.pageFormat;this.graph.currentScale=1;this.graph.currentTranslate.x=0;this.graph.currentTranslate.y=0;this.updateGraphComponents();this.graph.view.setScale(1)}; Editor.prototype.readGraphState=function(b){this.savedGraphState={};if(Editor.preserveViewState){var d=b.getAttribute("dx"),m=b.getAttribute("dy");null!=d&&(this.savedGraphState.dx=d);null!=m&&(this.savedGraphState.dy=m)}d=b.getAttribute("grid");if(null==d||""==d)d=this.graph.defaultGridEnabled?"1":"0";null!=urlParams.grid&&(this.savedGraphState.grid=d);this.graph.gridEnabled=(null!=urlParams.grid?"0"!=urlParams.grid:"0"!=d)&&(!this.isChromelessView()||"1"==urlParams.grid);this.graph.gridSize=parseFloat(b.getAttribute("gridSize"))|| mxGraph.prototype.gridSize;this.graph.graphHandler.guidesEnabled="0"!=b.getAttribute("guides");this.graph.setTooltips("0"!=b.getAttribute("tooltips")&&(null==window.urlParams||"0"!=urlParams.tooltips));d=b.getAttribute("connect");null!=d&&null!=Editor.config&&null!=Editor.config.defaultConnectable&&(this.savedGraphState.connect=d);this.graph.setConnectable(null==d||null!=Editor.config&&null!=Editor.config.defaultConnectable?this.graph.defaultConnectable:"0"!=d);d=b.getAttribute("arrows");null!=d&& null!=Editor.config&&null!=Editor.config.defaultConnectionArrowsEnabled&&(this.savedGraphState.arrows=d);this.graph.connectionArrowsEnabled=null==d||null!=Editor.config&&null!=Editor.config.defaultConnectionArrowsEnabled?this.graph.defaultConnectionArrowsEnabled:"0"!=d;d=b.getAttribute("fold");null!=d&&null!=Editor.config&&null!=Editor.config.defaultFoldingEnabled&&(this.savedGraphState.fold=d);this.graph.foldingEnabled=null==d||null!=Editor.config&&null!=Editor.config.defaultFoldingEnabled?this.graph.defaultFoldingEnabled: "0"!=d;this.isChromelessView()&&this.graph.foldingEnabled&&(this.graph.foldingEnabled="1"==urlParams.nav,this.graph.cellRenderer.forceControlClickHandler=this.graph.foldingEnabled);d=parseFloat(b.getAttribute("pageScale"));!isNaN(d)&&0<d?this.graph.pageScale=d:this.graph.pageScale=mxGraph.prototype.pageScale;this.graph.isLightboxView()||this.graph.isViewer()?this.graph.pageVisible=!1:null!=urlParams.pv?(d=b.getAttribute("page"),this.savedGraphState.page=d,this.graph.pageVisible="0"!=urlParams.pv): (d=b.getAttribute("page"),this.graph.pageVisible=null!=d?"0"!=d:this.graph.defaultPageVisible);this.graph.pageBreaksVisible=this.graph.pageVisible;this.graph.preferPageSize=this.graph.pageBreaksVisible;d=parseFloat(b.getAttribute("pageWidth"));m=parseFloat(b.getAttribute("pageHeight"));isNaN(d)||isNaN(m)||(this.graph.pageFormat=new mxRectangle(0,0,d,m));b=b.getAttribute("background");this.graph.background=null!=b&&0<b.length?b:null}; Editor.prototype.setGraphXml=function(b){if(null!=b){var d=new mxCodec(b.ownerDocument);if("mxGraphModel"==b.nodeName){this.graph.model.beginUpdate();try{this.graph.model.clear(),this.graph.view.scale=1,this.readGraphState(b),this.updateGraphComponents(),d.decode(b,this.graph.getModel())}finally{this.graph.model.endUpdate()}}else if("root"==b.nodeName){this.resetGraph();var m=d.document.createElement("mxGraphModel");m.appendChild(b);d.decode(m,this.graph.getModel());this.updateGraphComponents()}else throw{message:mxResources.get("cannotOpenFile"), node:b,toString:function(){return this.message}};}else this.resetGraph(),this.graph.model.clear();this.fireEvent(new mxEventObject("resetGraphView"))}; Editor.prototype.getGraphXml=function(b){if(null!=b?b:1){var d=new mxCodec(mxUtils.createXmlDocument());b=d.encode(this.graph.getModel());d.document.appendChild(b)}else b=this.graph.encodeCells(mxUtils.sortCells(this.graph.model.getTopmostCells(this.graph.getSelectionCells())));d=this.savedGraphState||{};if(null!=d.dx||null!=d.dy)null!=d.dx&&b.setAttribute("dx",d.dx),null!=d.dy&&b.setAttribute("dy",d.dy);else if(0!=this.graph.view.translate.x||0!=this.graph.view.translate.y)b.setAttribute("dx",Math.round(100* this.graph.view.translate.x)/100),b.setAttribute("dy",Math.round(100*this.graph.view.translate.y)/100);b.setAttribute("grid",null!=d.grid?d.grid:this.graph.isGridEnabled()?"1":"0");b.setAttribute("gridSize",this.graph.gridSize);b.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0");b.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0");b.setAttribute("connect",null!=d.connect?d.connect:this.graph.connectionHandler.isEnabled()?"1":"0");b.setAttribute("arrows",null!= d.arrows?d.arrows:this.graph.connectionArrowsEnabled?"1":"0");b.setAttribute("fold",null!=d.fold?d.fold:this.graph.foldingEnabled?"1":"0");b.setAttribute("page",null!=d.page?d.page:this.graph.pageVisible?"1":"0");b.setAttribute("pageScale",this.graph.pageScale);b.setAttribute("pageWidth",this.graph.pageFormat.width);b.setAttribute("pageHeight",this.graph.pageFormat.height);null!=this.graph.background&&b.setAttribute("background",this.graph.background);return b}; Editor.prototype.updateGraphComponents=function(){var b=this.graph;null!=b.container&&(b.view.validateBackground(),b.container.style.overflow=b.scrollbars?"auto":this.defaultGraphOverflow,this.fireEvent(new mxEventObject("updateGraphComponents")))};Editor.prototype.setModified=function(b){this.modified=b};Editor.prototype.setFilename=function(b){this.filename=b}; Editor.prototype.createUndoManager=function(){var b=this.graph,d=new mxUndoManager;this.undoListener=function(p,t){d.undoableEditHappened(t.getProperty("edit"))};var m=mxUtils.bind(this,function(p,t){this.undoListener.apply(this,arguments)});b.getModel().addListener(mxEvent.UNDO,m);b.getView().addListener(mxEvent.UNDO,m);m=function(p,t){p=t.getProperty("edit").changes;p=b.getSelectionCellsForChanges(p);t=!1;if(0<p.length){for(var n=[],z=0;z<p.length;z++)null!=b.view.getState(p[z])&&(n.push(p[z]), t||(b.scrollCellToVisible(p[z]),t=!0));b.setSelectionCells(n)}};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,p,t,n,z,D,N,F,P){this.editorUi=b;null==this.bg&&(this.bg=b.createDiv("geBackground"));t&&null!=document.body&&document.body.appendChild(this.bg);t=b.createDiv(N?"geTransDialog":"geDialog");t.style.width=m+48+"px";null!=p&&(t.style.height=p+48+"px");"1"!=urlParams.embedInline||Editor.inlineFullscreen||null==b.embedViewport||(t.style.left=b.embedViewport.x+b.embedViewport.width/2+"px",t.style.top=b.embedViewport.y+b.embedViewport.height/2+"px");t.appendChild(d);null!=document.body&& document.body.appendChild(t);null==p&&(t.style.height=d.scrollHeight+48+"px");if(n&&(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)})),t.appendChild(d),!P)){var T=!1;mxEvent.addGestureListeners(this.bg,mxUtils.bind(this,function(c){T=!0}),null,mxUtils.bind(this, function(c){T&&(b.hideDialog(!0),T=!1)}))}this.onDialogClose=z;this.container=t;null!=F&&this.addResizeHandler(F);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=this,p=function(t,n){var z=null,D=null,N=null,F=null,P=function(c){if(null!=z){var f=mxEvent.getClientX(c)-z,k=mxEvent.getClientY(c)-D,q=N,y=F;0<=n.indexOf("r")&&(q+=2*f);0<=n.indexOf("l")&&(q-=2*f);0<=n.indexOf("b")&&(y+=2*k);0<=n.indexOf("t")&& (y-=2*k);m.container.style.width=Math.max(b.width,q)+"px";m.container.style.height=Math.max(b.height,y)+"px";mxEvent.consume(c)}},T=function(c){if(null!=z&&(D=z=null,mxEvent.removeGestureListeners(document,null,P,T),mxEvent.consume(c),"function"===typeof m.onResize))m.onResize(parseInt(m.container.style.width),parseInt(m.container.style.height))};mxEvent.addGestureListeners(t,function(c){z=mxEvent.getClientX(c);D=mxEvent.getClientY(c);N=parseInt(m.container.style.width);F=parseInt(m.container.style.height); mxEvent.addGestureListeners(document,null,P,T);mxEvent.consume(c)},P,T)};p(d,"br");this.container.appendChild(d);installDialogEdgeResizeHandles(this.container,p)}; function installDialogEdgeResizeHandles(b,d){var m=[];[{styles:"top:0;left:0;width:8px;height:8px;",cursor:"nw-resize",edges:"tl"},{styles:"top:0;left:8px;right:8px;height:4px;",cursor:"n-resize",edges:"t"},{styles:"top:0;right:0;width:8px;height:8px;",cursor:"ne-resize",edges:"tr"},{styles:"top:8px;right:0;bottom:14px;width:4px;",cursor:"e-resize",edges:"r"},{styles:"bottom:0;left:0;width:8px;height:8px;",cursor:"sw-resize",edges:"bl"},{styles:"bottom:0;left:8px;right:14px;height:4px;",cursor:"s-resize", edges:"b"},{styles:"top:8px;left:0;bottom:8px;width:4px;",cursor:"w-resize",edges:"l"}].forEach(function(p){var t=document.createElement("div");t.style.cssText="position:absolute;z-index:2;"+p.styles+"cursor:"+p.cursor;d(t,p.edges);b.appendChild(t);m.push(t)});return m} (function(){var b=mxWindow.prototype.setResizable;mxWindow.prototype.setResizable=function(d){b.apply(this,arguments);d?null==this._edgeResizeHandles?this._edgeResizeHandles=installMxWindowEdgeResizeHandles(this):this._edgeResizeHandles.forEach(function(m){m.style.display=""}):null!=this._edgeResizeHandles&&this._edgeResizeHandles.forEach(function(m){m.style.display="none"})}})(); function installMxWindowEdgeResizeHandles(b){var d=b.minimumSize||new mxRectangle(0,0,50,40);return installDialogEdgeResizeHandles(b.div,function(m,p){var t=null,n=null,z,D,N,F,P=function(c){if(null!=t){var f=mxEvent.getClientX(c)-t,k=mxEvent.getClientY(c)-n,q=z,y=D,A=N,E=F;0<=p.indexOf("t")&&(y=D+k,E=F-k);0<=p.indexOf("b")&&(E=F+k);0<=p.indexOf("l")&&(q=z+f,A=N-f);0<=p.indexOf("r")&&(A=N+f);A<d.width&&(0<=p.indexOf("l")&&(q=z+N-d.width),A=d.width);E<d.height&&(0<=p.indexOf("t")&&(y=D+F-d.height), E=d.height);q===z&&y===D||b.setLocation(q,y);b.setSize(A,E);b.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",c));mxEvent.consume(c)}},T=function(c){null!=t&&(n=t=null,mxEvent.removeGestureListeners(document,null,P,T),b.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",c)),mxEvent.consume(c))};mxEvent.addGestureListeners(m,function(c){b.activate();null!=b.dockState&&(b.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",c)),b.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",c)));t= mxEvent.getClientX(c);n=mxEvent.getClientY(c);z=b.getX();D=b.getY();N=parseInt(b.div.style.width)||b.div.offsetWidth;F=parseInt(b.div.style.height)||b.div.offsetHeight;mxEvent.addGestureListeners(document,null,P,T);b.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",c));mxEvent.consume(c)},P,T)})} 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,p,t,n,z,D,N,F,P){N=null!=N?N:!0;var T=document.createElement("div");T.style.textAlign="center";T.style.flexDirection="column";T.style.maxHeight="100%";T.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);T.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);T.appendChild(d);m=document.createElement("div");m.style.marginTop="12px";m.style.textAlign="center";null!=n&&(d=mxUtils.button(mxResources.get("tryAgain"), function(){b.hideDialog();n()}),d.className="geBtn",m.appendChild(d),m.style.textAlign="center");null!=F&&(F=mxUtils.button(F,function(){null!=P&&P()}),F.className="geBtn",m.appendChild(F));var f=mxUtils.button(p,function(){N&&b.hideDialog();null!=t&&t()});f.className="geBtn";m.appendChild(f);null!=z&&(p=mxUtils.button(z,function(){N&&b.hideDialog();null!=D&&D()}),p.className="geBtn gePrimaryBtn",m.appendChild(p));this.init=function(){f.focus()};T.appendChild(m);this.container=T},PrintDialog=function(b, d,m,p){this.create(b,d,m,p)}; PrintDialog.prototype.create=function(b){function d(f){var k=z.checked||F.checked,q=parseInt(T.value)/100;isNaN(q)&&(q=1,T.value="100%");mxClient.IS_SF&&(q*=.75);var y=m.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,A=1/m.pageScale;if(k){var E=z.checked?1:parseInt(P.value);isNaN(E)||(A=mxUtils.getScaleForPageCount(E,m,y))}var K=E=0;y=mxRectangle.fromRectangle(y);y.width*=q;y.height*=q;A*=q;!k&&m.pageVisible?(q=m.getPageLayout(),E-=q.x*y.width,K-=q.y*y.height):k=!0;k=PrintDialog.createPrintPreview(m, A,y,0,E,K,k);k.open();f&&PrintDialog.printPreview(k)}var m=b.editor.graph,p=document.createElement("table");p.style.width="100%";p.style.height="100%";var t=document.createElement("tbody");var n=document.createElement("tr");var z=document.createElement("input");z.setAttribute("type","checkbox");var D=document.createElement("td");D.setAttribute("colspan","2");D.style.fontSize="10pt";D.appendChild(z);var N=document.createElement("span");mxUtils.write(N," "+mxResources.get("fitPage"));D.appendChild(N); mxEvent.addListener(N,"click",function(f){z.checked=!z.checked;F.checked=!z.checked;mxEvent.consume(f)});mxEvent.addListener(z,"change",function(){F.checked=!z.checked});n.appendChild(D);t.appendChild(n);n=n.cloneNode(!1);var F=document.createElement("input");F.setAttribute("type","checkbox");D=document.createElement("td");D.style.fontSize="10pt";D.appendChild(F);N=document.createElement("span");mxUtils.write(N," "+mxResources.get("posterPrint")+":");D.appendChild(N);mxEvent.addListener(N,"click", function(f){F.checked=!F.checked;z.checked=!F.checked;mxEvent.consume(f)});n.appendChild(D);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";D=document.createElement("td");D.style.fontSize="10pt";D.appendChild(P);mxUtils.write(D," "+mxResources.get("pages")+" (max)");n.appendChild(D);t.appendChild(n);mxEvent.addListener(F,"change",function(){F.checked? P.removeAttribute("disabled"):P.setAttribute("disabled","disabled");z.checked=!F.checked});n=n.cloneNode(!1);D=document.createElement("td");mxUtils.write(D,mxResources.get("pageScale")+":");n.appendChild(D);D=document.createElement("td");var T=document.createElement("input");T.setAttribute("value","100 %");T.setAttribute("size","5");T.style.width="50px";D.appendChild(T);n.appendChild(D);t.appendChild(n);n=document.createElement("tr");D=document.createElement("td");D.colSpan=2;D.style.paddingTop="30px"; D.setAttribute("align","right");N=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});N.className="geBtn";b.editor.cancelFirst&&D.appendChild(N);if(PrintDialog.previewEnabled){var c=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();d(!1)});c.className="geBtn";D.appendChild(c)}c=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();d(!0)});c.className="geBtn gePrimaryBtn";D.appendChild(c);b.editor.cancelFirst||D.appendChild(N); n.appendChild(D);t.appendChild(n);p.appendChild(t);n=document.createElement("div");n.style.paddingBottom="20px";n.appendChild(p);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,p,t,n,z){d=new mxPrintPreview(b,d,m,p,t,n);d.title=mxResources.get("preview");d.addPageCss=!mxClient.IS_SF;d.printBackgroundImage=!0;d.autoOrigin=z;z=b.background;if(null==z||""==z||z==mxConstants.NONE)z="#ffffff";d.backgroundColor=z;var D=d.isTextLabel;d.isTextLabel=function(F){return"geHint"==!F.className&&D.apply(this,arguments)};var N=d.getLinkForCellState;d.getLinkForCellState=function(F){return b.getAbsoluteUrl(N.apply(this,arguments))};return d}; PrintDialog.previewEnabled=!0; var PageSetupDialog=function(b){var d=b.editor.graph,m=document.createElement("div"),p=function(E){E.style.minWidth="140px";return E},t=function(E){E.style.marginLeft="8px";return E},n=document.createElement("h3");mxUtils.write(n,mxResources.get("pageSetup"));m.appendChild(n);n=document.createElement("div");n.className="geDialogSection";var z=document.createElement("div");z.className="geDialogFormRow geDialogFormRowTop";var D=document.createElement("span");D.className="geDialogFormLabel";mxUtils.write(D, mxResources.get("paperSize")+":");z.appendChild(p(D));D=document.createElement("div");D.style.flex="1";D.style.minWidth="0";var N=PageSetupDialog.addPageFormatPanel(D,"pagesetupdialog",d.pageFormat);z.appendChild(t(D));n.appendChild(z);m.appendChild(n);n=document.createElement("div");n.className="geDialogSection";z=document.createElement("div");z.className="geDialogFormRow";D=document.createElement("span");D.className="geDialogFormLabel";mxUtils.write(D,mxResources.get("gridSize")+":");z.appendChild(p(D)); var F=document.createElement("input");F.setAttribute("type","number");F.setAttribute("min","0");F.setAttribute("step","any");F.style.width="60px";F.style.flex="0 0 auto";F.value=d.getGridSize();z.appendChild(t(F));mxEvent.addListener(F,"change",function(){var E=parseFloat(F.value);F.value=Math.max(1,isNaN(E)?d.getGridSize():E)});n.appendChild(z);m.appendChild(n);n=document.createElement("div");n.className="geDialogSection";z=document.createElement("div");z.className="geDialogFormRow";D=document.createElement("span"); D.className="geDialogFormLabel";mxUtils.write(D,mxResources.get("background")+":");z.appendChild(p(D));var P=d.backgroundImage,T=d.background;D=document.createElement("button");D.className="geBtn";D.style.margin="0px";mxUtils.write(D,mxResources.get("change")+"...");mxEvent.addListener(D,"click",function(E){b.showBackgroundImageDialog(function(K,Q,W){Q||(null!=K&&null!=K.src&&Graph.isPageLink(K.src)&&(K={originalSrc:K.src}),P=K);T=W},P,T,!0);mxEvent.consume(E)});z.appendChild(t(D));n.appendChild(z); m.appendChild(n);n=b.addAdvancedSection(m);z=document.createElement("div");z.className="geDialogFormRow";D=document.createElement("span");D.className="geDialogFormLabel";mxUtils.write(D,mxResources.get("adaptiveColors")+":");z.appendChild(p(D));var c=document.createElement("select");t(c);D=function(E,K){var Q=document.createElement("option");Q.setAttribute("value",E);mxUtils.write(Q,K);c.appendChild(Q)};D("default",mxResources.get("default")+" ("+mxResources.get(Graph.getDefaultAdaptiveColorsKey())+ ")");D("auto",mxResources.get("automatic"));D("simple",mxResources.get("simple"));D("none",mxResources.get("none"));c.value=null==d.adaptiveColors?"default":d.adaptiveColors;z.appendChild(c);null==b.menus||null==b.menus.createHelpLink||b.isOffline()&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp||(D=b.menus.createHelpLink("https://www.drawio.com/docs/manual/editor/appearance/adaptive-colours/"),D.style.marginLeft="8px",z.appendChild(D));n.content.appendChild(z);if(null!=b.currentPage){var f=b.currentPage.getViewBox(); var k=!1;z=document.createElement("div");z.className="geDialogSection";D=document.createElement("div");D.className="geDialogFormRow";var q=document.createElement("span");q.className="geDialogFormLabel";mxUtils.write(q,mxResources.get("initialView")+":");D.appendChild(p(q));p=document.createElement("div");p.style.flex="1";p.style.minWidth="0";p.style.display="flex";p.style.alignItems="center";var y=document.createElement("span");y.style.flex="1 1 auto";y.style.minWidth="0";y.style.overflow="hidden"; y.style.textOverflow="ellipsis";y.style.whiteSpace="nowrap";y.style.lineHeight="normal";var A=function(){if(null!=f){var E=f.x+", "+f.y;null!=f.scale&&(E+=" · "+Math.round(100*f.scale)+"%")}else E=mxResources.get("default");y.textContent=E};A();p.appendChild(y);D.appendChild(t(p));z.appendChild(D);p=document.createElement("div");p.className="geDialogFormRow";p.style.justifyContent="flex-end";p.style.flexWrap="wrap";p.style.gap="8px";D=mxUtils.button(mxResources.get("useCurrent"),function(){f=d.getCurrentViewBox(); k=!0;A()});D.className="geBtn";D.style.margin="0px";D.style.flexShrink="0";p.appendChild(D);D=mxUtils.button(mxResources.get("reset"),function(){f=null;k=!0;A()});D.className="geBtn";D.style.margin="0px";D.style.flexShrink="0";p.appendChild(D);z.appendChild(p);n.wrapper.appendChild(z)}"undefined"!==typeof AnimationDialog&&(p=document.createElement("div"),p.className="geDialogSection",z=document.createElement("div"),z.className="geDialogFormRow geDialogFormRowTop",D=document.createElement("span"), D.className="geDialogFormLabel",D.style.minWidth="0",mxUtils.write(D,mxResources.get("animation")+":"),z.appendChild(D),D=document.createElement("div"),D.style.flex="1",D.style.minWidth="0",D.style.display="flex",D.style.alignItems="center",D.style.gap="8px",q=document.createElement("span"),q.className="geDialogHint",q.style.flex="1 1 auto",q.style.minWidth="0",mxUtils.write(q,mxResources.get("lightboxAnimationHint",null,"Plays automatically when the page is shown in lightbox mode.")),D.appendChild(q), q=mxUtils.button(mxResources.get("edit"),function(){b.hideDialog();var E=b.menus;null!=E&&null!=E.animationWindow?(E.animationWindow.window.setVisible(!0),E.animationWindow.window.activate()):null!=b.actions.get("animation")&&b.actions.get("animation").funct()}),q.className="geBtn",q.style.minWidth="90px",D.appendChild(q),z.appendChild(t(D)),p.appendChild(z),n.wrapper.appendChild(p));t=m.querySelectorAll(".geBtn");for(p=0;p<t.length;p++)n=mxUtils.trim(t[p].textContent),null==t[p].getAttribute("title")&& ""!=n&&t[p].setAttribute("title",n);this.container=(new CustomDialog(b,m,function(){var E=parseFloat(F.value);isNaN(E)||d.gridSize===E||d.setGridSize(E);E=new ChangePageSetup(b,T,P,N.get());E.ignoreColor=d.background==T;E.ignoreImage=(null!=d.backgroundImage?d.backgroundImage.src:null)===(null!=P?P.src:null);var K=c.value,Q=K!=(null==d.adaptiveColors?"default":d.adaptiveColors);Q&&(E.adaptiveColors=K);d.pageFormat.width==E.previousFormat.width&&d.pageFormat.height==E.previousFormat.height&&E.ignoreColor&& E.ignoreImage&&!Q||d.model.execute(E);k&&null!=b.currentPage&&d.model.execute(new ChangePageView(b,b.currentPage,f))},null,mxResources.get("apply"))).container}; PageSetupDialog.addPageFormatPanel=function(b,d,m,p){d="format-"+d;var t=document.createElement("input");t.setAttribute("name",d);t.setAttribute("type","radio");t.setAttribute("value","portrait");var n=document.createElement("input");n.setAttribute("name",d);n.setAttribute("type","radio");n.setAttribute("value","landscape");var z=document.createElement("select");z.style.position="relative";z.style.marginBottom="4px";z.style.borderRadius="4px";z.style.borderWidth="1px";z.style.borderStyle="solid"; z.style.boxSizing="border-box";z.style.padding="2px";z.style.width="210px";var D=document.createElement("div");D.style.alignItems="center";D.style.whiteSpace="nowrap";D.style.marginLeft="4px";D.style.width="210px";D.style.height="24px";t.style.margin="0 6px 0 0";D.appendChild(t);d=document.createElement("span");d.style.maxWidth="100px";mxUtils.write(d,mxResources.get("portrait"));D.appendChild(d);n.style.margin="0 6px 0 10px";D.appendChild(n);var N=document.createElement("span");N.style.width="100px"; mxUtils.write(N,mxResources.get("landscape"));D.appendChild(N);var F=document.createElement("div");F.style.whiteSpace="nowrap";F.style.fontSize="12px";F.style.width="210px";F.style.height="24px";var P=document.createElement("input");P.setAttribute("size","6");P.setAttribute("title",mxResources.get("width"));P.style.textAlign="right";F.appendChild(P);mxUtils.write(F," x ");var T=document.createElement("input");T.setAttribute("size","6");T.setAttribute("title",mxResources.get("height"));T.style.textAlign= "right";F.appendChild(T);var c=document.createElement("select");c.style.marginLeft="4px";c.style.boxSizing="border-box";for(var f=[{label:mxResources.get("points"),unit:mxConstants.POINTS},{label:mxResources.get("inches"),unit:mxConstants.INCHES},{label:mxResources.get("millimeters"),unit:mxConstants.MILLIMETERS},{label:mxResources.get("meters"),unit:mxConstants.METERS}],k=0;k<f.length;k++){var q=document.createElement("option");q.setAttribute("value",f[k].unit);mxUtils.write(q,f[k].label);c.appendChild(q)}c.value= Editor.pageSizeUnit;F.appendChild(c);D.style.display="none";F.style.display="none";var y={},A=PageSetupDialog.getFormats();for(k=0;k<A.length;k++)f=A[k],y[f.key]=f,q=document.createElement("option"),q.setAttribute("value",f.key),mxUtils.write(q,f.title),z.appendChild(q);var E=function(){z.value="custom";for(var Q=0;Q<A.length;Q++){var W=A[Q];null!=W.format&&("a4"==W.key?826==m.width?(m=mxRectangle.fromRectangle(m),m.width=827):826==m.height&&(m=mxRectangle.fromRectangle(m),m.height=827):"a5"==W.key&& (584==m.width?(m=mxRectangle.fromRectangle(m),m.width=583):584==m.height&&(m=mxRectangle.fromRectangle(m),m.height=583)),m.width==W.format.width&&m.height==W.format.height?(z.value=W.key,t.setAttribute("checked","checked"),t.defaultChecked=!0,t.checked=!0,n.removeAttribute("checked"),n.defaultChecked=!1,n.checked=!1,detected=!0):m.width==W.format.height&&m.height==W.format.width&&(z.value=W.key,t.removeAttribute("checked"),t.defaultChecked=!1,t.checked=!1,n.setAttribute("checked","checked"),n.defaultChecked= !0,detected=n.checked=!0))}"custom"==z.value?(P.value=Editor.toUnit(m.width,c.value),T.value=Editor.toUnit(m.height,c.value),t.setAttribute("checked","checked"),z.value="custom",D.style.display="none",F.style.display=""):(D.style.display="flex",F.style.display="none")};E();b.appendChild(z);mxUtils.br(b);b.appendChild(D);b.appendChild(F);var K=function(Q,W){Q=y[z.value];null!=Q.format?(P.value=Editor.toUnit(n.checked?Q.format.height:Q.format.width,c.value),T.value=Editor.toUnit(n.checked?Q.format.width: Q.format.height,c.value),F.style.display="none",D.style.display="flex"):(D.style.display="none",F.style.display="");var J=parseFloat(P.value);if(isNaN(J)||0>=J)P.value=Editor.toUnit(m.width,c.value);J=parseFloat(T.value);if(isNaN(J)||0>=J)T.value=Editor.toUnit(m.height,c.value);Q=null!=Q.format?new mxRectangle(0,0,n.checked?Q.format.height:Q.format.width,n.checked?Q.format.width:Q.format.height):new mxRectangle(0,0,Editor.fromUnit(parseFloat(P.value),c.value),Editor.fromUnit(parseFloat(T.value),c.value)); W||Q.width==m.width&&Q.height==m.height||(m=Q,null!=p&&p(m))};mxEvent.addListener(d,"click",function(Q){t.checked=!0;K(Q);mxEvent.consume(Q)});mxEvent.addListener(N,"click",function(Q){n.checked=!0;K(Q);mxEvent.consume(Q)});mxEvent.addListener(P,"blur",K);mxEvent.addListener(P,"click",K);mxEvent.addListener(T,"blur",K);mxEvent.addListener(T,"click",K);mxEvent.addListener(n,"change",K);mxEvent.addListener(t,"change",K);mxEvent.addListener(z,"change",function(Q){K(Q,"custom"==z.value);mxEvent.consume(Q)}); mxEvent.addListener(c,"change",function(Q){P.value=Editor.toUnit(Editor.fromUnit(P.value,Editor.pageSizeUnit),c.value);T.value=Editor.toUnit(Editor.fromUnit(T.value,Editor.pageSizeUnit),c.value);Editor.pageSizeUnit=c.value;K(Q,!0);mxEvent.consume(Q)});K(null,!0);return{set:function(Q){m=Q;E(null,null,!0)},get:function(){return m},widthInput:P,heightInput:T}}; 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,p,t,n,z,D,N,F,P){N=null!=N?N:!0;var T=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 f=document.createElement("div");f.style.display="inline-flex";f.style.alignItems="center";f.style.justifyContent="flex-end";f.style.minWidth="0";var k=document.createElement("div");k.style.display="inline-block"; k.style.textOverflow="ellipsis";k.style.whiteSpace="nowrap";k.style.overflow="hidden";k.style.fontSize="10pt";k.style.padding="2px 0";k.setAttribute("title",t||mxResources.get("filename"));mxUtils.write(k,(t||mxResources.get("filename"))+":");f.appendChild(k);c.appendChild(f);var q=document.createElement("input");q.setAttribute("value",d||"");q.style.flexGrow="1";var y=mxUtils.button(m,function(){if(null==n||n(q.value))N&&b.hideDialog(),p(q.value)});y.className="geBtn gePrimaryBtn";this.init=function(){if(null!= t||null==z)if(null!=P?Editor.selectFilename(q):(q.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?q.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var A=c.parentNode;if(null!=A){var E=null;mxEvent.addListener(A,"dragleave",function(K){null!=E&&(E.style.backgroundColor="",E=null);K.stopPropagation();K.preventDefault()});mxEvent.addListener(A,"dragover",mxUtils.bind(this,function(K){null==E&&(E=q,E.style.backgroundColor="#ebf2f9");K.stopPropagation();K.preventDefault()})); mxEvent.addListener(A,"drop",mxUtils.bind(this,function(K){null!=E&&(E.style.backgroundColor="",E=null);0<=mxUtils.indexOf(K.dataTransfer.types,"text/uri-list")&&(q.value=decodeURIComponent(K.dataTransfer.getData("text/uri-list")),y.click());K.stopPropagation();K.preventDefault()}))}}};f=document.createElement("div");f.style.display="inline-flex";f.style.alignItems="center";f.style.gap="4px";f.style.whiteSpace="nowrap";f.appendChild(q);c.appendChild(f);null==t&&null!=z||null==P||null==b.editor.diagramFileTypes|| (f=document.createElement("div"),f.style.display="inline-flex",f.style.alignItems="center",f.style.textOverflow="ellipsis",f.style.justifyContent="flex-end",f.style.fontSize="10pt",mxUtils.write(f,mxResources.get("type")+":"),c.appendChild(f),f=document.createElement("div"),f.style.display="inline-flex",f.style.alignItems="center",f.style.whiteSpace="nowrap",c.appendChild(f),d=FilenameDialog.createFileTypes(b,q,b.editor.diagramFileTypes),d.style.width="100%",f.appendChild(d));null!=z&&c.appendChild(z); 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");f=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=F&&F()});f.className="geBtn";null==D||b.isOffline()||row.appendChild(b.createHelpIcon(D));b.editor.cancelFirst&&row.appendChild(f);mxEvent.addListener(q,"keypress", function(A){13==A.keyCode&&y.click()});row.appendChild(y);b.editor.cancelFirst||row.appendChild(f);c.appendChild(row);T.appendChild(c);this.container=T};FilenameDialog.filenameHelpLink=null; FilenameDialog.createFileTypes=function(b,d,m){var p=document.createElement("select");for(b=0;b<m.length;b++){var t=document.createElement("option");t.setAttribute("value",b);mxUtils.write(t,mxResources.get(m[b].description)+" (."+m[b].extension+")");p.appendChild(t)}mxEvent.addListener(p,"change",function(n){n=m[p.value].extension;var z=d.value.lastIndexOf(".drawio.");z=0<z?z:d.value.lastIndexOf(".");"drawio"!=n&&(n="drawio."+n);d.value=0<z?d.value.substring(0,z+1)+n:d.value+"."+n;"createEvent"in document?(n=document.createEvent("HTMLEvents"),n.initEvent("change",!1,!0),d.dispatchEvent(n)):d.fireEvent("onchange")});b=function(n){n=d.value.toLowerCase();for(var z=0,D=0;D<m.length;D++){var N=m[D].extension,F=null;"drawio"!=N&&(F=N,N=".drawio."+N);if(n.substring(n.length-N.length-1)=="."+N||null!=F&&n.substring(n.length-F.length-1)=="."+F){z=D;break}}p.value=z};mxEvent.addListener(d,"change",b);mxEvent.addListener(d,"keyup",b);b();if(null!=Editor.defaultFileType&&"0"==p.value)for(b=0;b<m.length;b++)if(m[b].extension== Editor.defaultFileType){p.value=b;b=m[b].extension;t=d.value.lastIndexOf(".drawio.");t=0<t?t:d.value.lastIndexOf(".");"drawio"!=b&&(b="drawio."+b);d.value=0<t?d.value.substring(0,t+1)+b:d.value+"."+b;break}return p}; var WrapperWindow=function(b,d,m,p,t,n,z,D){D=null!=D?D:document.createElement("div");this.window=new mxWindow(d,D,m,p,t,n,!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);z(D)}; (function(){mxGraphView.prototype.validateBackgroundPage=function(){var z=this.graph;if(null!=z.container&&!z.transparentBackground){if(z.pageVisible){var D=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var N=z.container.firstChild;null!=N&&N.nodeType!=mxConstants.NODETYPE_ELEMENT;)N=N.nextSibling;null!=N&&(this.backgroundPageShape=this.createBackgroundPageShape(D),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML, this.backgroundPageShape.init(z.container),N.style.position="absolute",z.container.insertBefore(this.backgroundPageShape.node,N),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(F){z.dblClick(F)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(F){z.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(F))}),mxUtils.bind(this,function(F){null!= z.tooltipHandler&&z.tooltipHandler.isHideOnHover()&&z.tooltipHandler.hide();z.isMouseDown&&!mxEvent.isConsumed(F)&&z.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(F))}),mxUtils.bind(this,function(F){z.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(F))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=D,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null);this.validateBackgroundStyles()}}; mxGraphView.prototype.validateBackgroundStyles=function(z,D,N){var F=this.graph;z=null!=z?z:1;var P=mxUtils.getLightDarkColor(null==F.background||F.background==mxConstants.NONE?F.defaultPageBackgroundColor:F.background).cssText,T=mxUtils.getLightDarkColor(F.defaultPageBorderColor).cssText,c=null!=P&&this.gridColor!=P.toLowerCase()?this.gridColor:"#ffffff",f="none",k="";"simple"==F.getAdaptiveColors()&&F.background!=mxConstants.NONE&&null!=F.background&&(P=F.background);if(F.isGridEnabled()||F.gridVisible){k= 10;mxClient.IS_SVG?(f=unescape(encodeURIComponent(this.createSvgGrid(c,z))),f=window.btoa?btoa(f):Base64.encode(f,!0),f="url(data:image/svg+xml;base64,"+f+")",k=F.gridSize*this.scale*this.gridSteps*z):f="url("+this.gridImage+")";var q=c=0;D=null!=D?D-this.translate.x*this.scale:0;N=null!=N?N-this.translate.y*this.scale:0;var y=F.gridSize*this.scale*this.gridSteps,A=D%y;y=N%y;null!=F.view.backgroundPageShape&&(q=this.getBackgroundPageBounds(),c=1+q.x,q=1+q.y);k=-Math.round(k-mxUtils.mod(this.translate.x* this.scale-c+D,k)+A*z)+"px "+-Math.round(k-mxUtils.mod(this.translate.y*this.scale-q+N,k)+y*z)+"px"}z=F.view.canvas;null!=z.ownerSVGElement&&(z=z.ownerSVGElement);c=!Editor.isDarkMode()&&F.enableDiagramBackground;null!=F.view.backgroundPageShape?(F.view.backgroundPageShape.node.style.backgroundPosition=k,F.view.backgroundPageShape.node.style.backgroundImage=f,F.view.backgroundPageShape.node.style.backgroundColor=P,F.view.backgroundPageShape.node.style.borderColor=T,F.view.backgroundPageShape.node.style.colorScheme= "none"==F.getAdaptiveColors()?"light":"",z.style.backgroundImage="none",z.style.backgroundColor="",F.container.style.backgroundColor=c?F.diagramBackgroundColor:""):(z.style.backgroundPosition=k,z.style.backgroundImage=f,"1"==urlParams.transparent?F.container.style.background="transparent":!c||null!=F.background&&F.background!=mxConstants.NONE?z.style.backgroundColor=P:(z.style.backgroundColor=F.diagramBackgroundColor,F.container.style.backgroundColor=""))};mxGraphView.prototype.createSvgGrid=function(z, D){for(var N=this.graph.gridSize*this.scale*(null!=D?D:1);N<this.minGridSize;)N*=2;D=this.gridSteps*N;for(var F=[],P=1;P<this.gridSteps;P++){var T=P*N;F.push("M 0 "+T+" L "+D+" "+T+" M "+T+" 0 L "+T+" "+D)}N="M "+D+" 0 L 0 0 0 "+D+" M "+D+" 0 L "+D+" "+D+" L 0 "+D;z=mxUtils.getLightDarkColor(z);P="color-scheme: light dark;";mxClient.IS_SF&&(P="color-scheme: "+("none"!=this.graph.getAdaptiveColors()&&Editor.isDarkMode()?"dark":"light"));return'<svg style="'+P+'" width="'+D+'" height="'+D+'" xmlns="'+ mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+D+'" height="'+D+'" patternUnits="userSpaceOnUse"><path d="'+F.join(" ")+'" fill="none" style="stroke:'+mxUtils.htmlEntities(z.cssText)+';" stroke="'+z.light+'" opacity="0.2" stroke-width="1"/><path d="'+N+'" fill="none" style="stroke:'+mxUtils.htmlEntities(z.cssText)+';" stroke="'+z.light+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var b=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph= function(z,D){b.apply(this,arguments);if(null!=this.shiftPreview1){var N=this.view.canvas;null!=N.ownerSVGElement&&(N=N.ownerSVGElement);var F=this.gridSize*this.view.scale*this.view.gridSteps;F=-Math.round(F-mxUtils.mod(this.view.translate.x*this.view.scale+z,F))+"px "+-Math.round(F-mxUtils.mod(this.view.translate.y*this.view.scale+D,F))+"px";N.style.backgroundPosition=F}};mxGraph.prototype.updatePageBreaks=function(z,D,N){var F=this.view.scale,P=this.view.translate,T=this.pageFormat,c=F*this.pageScale, f=this.view.getBackgroundPageBounds();D=f.width;N=f.height;var k=new mxRectangle(F*P.x,F*P.y,T.width*c,T.height*c);P=null!=this.view.canvas&&null!=this.view.canvas.getCTM?this.view.canvas.getCTM():null;F=null!=P?P.a:1;c=null!=P?P.e:0;var q=null!=P?P.f:0;P=(z=z&&Math.min(k.width,k.height)*F>this.minPageBreakDist)?Math.ceil(N/k.height)-1:0;T=z?Math.ceil(D/k.width)-1:0;var y=f.x+D,A=f.y+N,E=0,K=P-1,Q=0,W=T-1;this.pageBreakCoverage=null;z&&null!=this.container&&(D=this.container.clientWidth,N=this.container.clientHeight, c=(this.container.scrollLeft-D-c)/F-f.x,q=(this.container.scrollTop-N-q)/F-f.y,Q=Math.max(0,Math.floor(c/k.width)-1),W=Math.min(T-1,Math.ceil((c+3*D/F)/k.width)),E=Math.max(0,Math.floor(q/k.height)-1),K=Math.min(P-1,Math.ceil((q+3*N/F)/k.height)),0<E||K<P-1||0<Q||W<T-1)&&(this.pageBreakCoverage=new mxRectangle(this.container.scrollLeft-D/2,this.container.scrollTop-N/2,2*D,2*N));null==this.horizontalPageBreaks&&0<P&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<T&&(this.verticalPageBreaks= []);D=mxUtils.bind(this,function(J){if(null!=J){var ea=J==this.horizontalPageBreaks,X=ea?E:Q,aa=ea?K:W;aa=z&&isFinite(X)&&isFinite(aa)?Math.max(0,Math.min(this.maxPageBreaks,aa-X+1)):0;for(var ka=0;ka<aa;ka++){var ja=X+ka+1;ja=ea?[new mxPoint(Math.round(f.x),Math.round(f.y+ja*k.height)),new mxPoint(Math.round(y),Math.round(f.y+ja*k.height))]:[new mxPoint(Math.round(f.x+ja*k.width),Math.round(f.y)),new mxPoint(Math.round(f.x+ja*k.width),Math.round(A))];null!=J[ka]&&null!=J[ka].node?(J[ka].points=ja, J[ka].redraw()):(null!=J[ka]&&J[ka].destroy(),ja=new mxPolyline(ja,this.pageBreakColor),ja.dialect=this.dialect,ja.isDashed=this.pageBreakDashed,ja.pointerEvents=!1,ja.init(this.view.backgroundPane),ja.redraw(),J[ka]=ja)}for(ka=aa;ka<J.length;ka++)null!=J[ka]&&J[ka].destroy();J.splice(aa,J.length-aa)}});D(this.horizontalPageBreaks);D(this.verticalPageBreaks)};var d=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(z,D,N){for(var F=0;F< D.length;F++){if(this.graph.isTableCell(D[F])||this.graph.isTableRow(D[F]))return!1;if(this.graph.getModel().isVertex(D[F])){var P=this.graph.getCellGeometry(D[F]);if(null!=P&&P.relative)return!1}}return d.apply(this,arguments)};var m=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var z=m.apply(this,arguments);z.intersects=mxUtils.bind(this,function(D,N){return this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(z,arguments)});return z}; mxGraphView.prototype.createBackgroundPageShape=function(z){return new mxRectangleShape(z,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var z=this.getGraphBounds(),D=0<z.width?z.x/this.scale-this.translate.x:0,N=0<z.height?z.y/this.scale-this.translate.y:0,F=this.graph.pageFormat,P=this.graph.pageScale,T=F.width*P;F=F.height*P;P=Math.floor(Math.min(0,D)/T);var c=Math.floor(Math.min(0,N)/F);return new mxRectangle(this.scale*(this.translate.x+ P*T),this.scale*(this.translate.y+c*F),this.scale*(Math.ceil(Math.max(1,D+z.width/this.scale)/T)-P)*T,this.scale*(Math.ceil(Math.max(1,N+z.height/this.scale)/F)-c)*F)};var p=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(z,D){p.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=z+"px",this.view.backgroundPageShape.node.style.marginTop= D+"px")};var t=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(z,D,N,F,P,T){var c=t.apply(this,arguments);null==T||T||mxEvent.addListener(c,"mousedown",function(f){mxEvent.consume(f)});return c};var n=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=function(z,D,N){var F=this.graph.model.getParent(z);if(D){var P=this.graph.model.isEdge(z)?null:this.graph.getCellGeometry(z);P=!this.graph.model.isEdge(F)&&!this.graph.isSiblingSelected(z)&& (null!=P&&P.relative||!this.graph.isContainer(F)||this.graph.isPart(z))}else if(P=n.apply(this,arguments),this.graph.isTableCell(z)||this.graph.isTableRow(z))P=F,this.graph.isTable(P)||(P=this.graph.model.getParent(P)),P=!this.graph.selectionCellsHandler.isHandled(P)||this.graph.isCellSelected(P)&&this.graph.isToggleEvent(N.getEvent())||this.graph.isCellSelected(z)&&!this.graph.isToggleEvent(N.getEvent())||this.graph.isTableCell(z)&&this.graph.isCellSelected(F);return P};mxPopupMenuHandler.prototype.getCellForPopupEvent= function(z){z=z.getCell();for(var D=this.graph.getModel(),N=D.getParent(z),F=this.graph.view.getState(N),P=this.graph.isCellSelected(z);null!=F&&(D.isVertex(N)||D.isEdge(N));){var T=this.graph.isCellSelected(N);P=P||T;if(T||!P&&(this.graph.isTableCell(z)||this.graph.isTableRow(z)))z=N;N=D.getParent(N)}return z}})();EditorUi=function(b,d,m){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=d||document.body;var p=this,t=this.editor.graph;t.lightbox=m;var n=t.getGraphBounds;t.getGraphBounds=function(){var H=n.apply(this,arguments),O=this.backgroundImage;if(null!=O&&null!=O.width&&null!=O.height){var S=this.view.translate,V=this.view.scale;H=mxRectangle.fromRectangle(H);H.add(new mxRectangle((S.x+O.x)*V,(S.y+O.y)*V,O.width*V,O.height*V))}return H};t.useCssTransforms&&(this.lazyZoomDelay= 0);this.selectionStateListener=mxUtils.bind(this,function(H,O){this.clearSelectionState()});t.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionStateListener);t.getModel().addListener(mxEvent.CHANGE,this.selectionStateListener);t.addListener(mxEvent.EDITING_STARTED,this.selectionStateListener);t.addListener(mxEvent.EDITING_STOPPED,this.selectionStateListener);t.getView().addListener("unitChanged",this.selectionStateListener);if(this.editor.chromeless&&!this.editor.editable){t.isEnabled= function(){return!1};t.panningHandler.isForcePanningEvent=function(H){for(var O=H.getSource();null!=O&&O!=t.container;){if("foreignObject"===O.nodeName||"text"===O.nodeName)return!1;O=O.parentNode}return!mxEvent.isPopupTrigger(H.getEvent())};var z=t.panningHandler.start;t.panningHandler.start=function(){z.apply(this,arguments);mxUtils.clearSelection()}}this.actions=new Actions(this);this.menus=this.createMenus();if(!t.standalone){var D=!1,N=!1;this.setDefaultStyle=function(H){try{var O=t.getModel(), S=O.isVertex(H)&&O.isEdge(O.getParent(H));O.isEdge(H)||S?(N=!1,O.isEdge(H)&&(t.pasteEdgeStyle=!1)):(D=!1,t.pasteStylesToText=!1);var V=t.getCellStyle(H,!1),Z=[],ba=[],ha;for(ha in V)Z.push(V[ha]),ba.push(ha);O.isEdge(H)?t.currentEdgeStyle={}:S||(t.currentVertexStyle={});this.fireEvent(new mxEventObject("styleChanged","keys",ba,"values",Z,"cells",[H],"force",!0,"edgeLabel",S));if(O.isEdge(H)||S)N=!0,O.isEdge(H)&&(t.pasteEdgeStyle=!0);else{D=!0;var na=O.getStyle(H);t.pasteStylesToText="string"===typeof na&& 0<=mxUtils.indexOf(na.split(";"),"text")}}catch(oa){this.handleError(oa)}};this.clearDefaultStyle=function(){t.currentEdgeStyle=mxUtils.clone(t.defaultEdgeStyle);t.currentVertexStyle=mxUtils.clone(t.defaultVertexStyle);t.pasteEdgeStyle=!1;D=N=t.pasteStylesToText=!1;this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};t.addListener("cellsInserted",function(H,O){t.pasteCellStyles(t.includeDescendants(O.getProperty("cells")))});t.addListener("textInserted",function(H,O){t.pasteCellStyles(O.getProperty("cells"))}); this.createDivs();this.createUi();this.refresh();var F=mxUtils.bind(this,function(H){null==H&&(H=window.event);return t.isEditing()||null!=H&&this.isSelectionAllowed(H)});document.addEventListener("selectstart",function(H){var O=mxEvent.getSource(H);O!=document.body&&O!=document.documentElement||H.preventDefault()},!0);this.container!=document.body||this.editor.chromeless&&!this.editor.editable||(this.menubarContainer.onselectstart=F,this.menubarContainer.onmousedown=F,this.toolbarContainer.onselectstart= F,this.toolbarContainer.onmousedown=F,this.diagramContainer.onselectstart=F,this.diagramContainer.onmousedown=F,this.sidebarContainer.onselectstart=F,this.sidebarContainer.onmousedown=F,this.formatContainer.onselectstart=F,this.formatContainer.onmousedown=F,null!=this.tabContainer&&(this.tabContainer.onselectstart=F),mxClient.IS_IOS&&(d=function(){var H=null;if(/iP(hone|od|ad)/.test(navigator.platform)){var O=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);try{H=[parseInt(O[1],10),parseInt(O[2], 10),parseInt(O[3]||0,10)]}catch(S){}}return H}(),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? this.diagramContainer.oncontextmenu=function(H){if(null!=H){var O=mxEvent.getSource(H);if("A"==O.nodeName)for(;null!=O;){if("geHint"==O.className)return!0;O=O.parentNode}}return F(H)}:t.panningHandler.usePopupTrigger=!1;t.init(this.diagramContainer);mxClient.IS_SVG&&null!=t.view.getDrawPane()&&(d=t.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(H,O){null!=this.hoverIcons&&this.hoverIcons.reset();null!=this.inlineToolbar&&this.inlineToolbar.hide()}));this.editor.graph.addListener("zoomPreviewComplete",mxUtils.bind(this,function(H,O){null!=this.inlineToolbar&&this.inlineToolbar.updateSelection()}));if(null!=t.graphHandler){var P=t.graphHandler.start;t.graphHandler.start=function(H){null!=p.hoverIcons&&p.hoverIcons.reset();null!=p.inlineToolbar&&null!=H&&p.inlineToolbar.hide();P.apply(this,arguments)};var T=t.graphHandler.mouseUp; t.graphHandler.mouseUp=function(){T.apply(this,arguments);null!=p.inlineToolbar&&p.inlineToolbar.updateSelection()}}var c=mxVertexHandler.prototype.start;mxVertexHandler.prototype.start=function(){null!=p.inlineToolbar&&p.inlineToolbar.hide();c.apply(this,arguments)};var f=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(){f.apply(this,arguments);null!=p.inlineToolbar&&p.inlineToolbar.updateSelection()};var k=mxEdgeHandler.prototype.start;mxEdgeHandler.prototype.start= function(){null!=p.inlineToolbar&&p.inlineToolbar.hide();k.apply(this,arguments)};var q=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(){q.apply(this,arguments);null!=p.inlineToolbar&&p.inlineToolbar.updateSelection()};mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(H){var O=mxUtils.getOffset(this.diagramContainer);0<mxEvent.getClientX(H)-O.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(H)-O.y-this.diagramContainer.clientHeight? this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var y=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(H,O){return p.isSpaceDown()||y.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(H){if(Editor.passiveScroll){var O=mxEvent.getSource(H);if(null==t.container||O!=t.container&&!t.container.contains(O)&&!t.isEditing())return}16==H.which?this.shiftDown=!0:32!=H.which||t.isEditing()?mxEvent.isConsumed(H)|| 27!=H.keyCode||(null!=this.sidebar&&null!=this.sidebar.tooltip&&"none"!=this.sidebar.tooltip.style.display&&null!=this.sidebar.tooltipCloseImage&&"none"!=this.sidebar.tooltipCloseImage.style.display?(this.sidebar.hideTooltip(),mxEvent.consume(H)):this.hideDialog(null,!0)):(O=mxEvent.getSource(H),"INPUT"==O.nodeName||"TEXTAREA"==O.nodeName||"SELECT"==O.nodeName||O.isContentEditable||(this.spaceDown=!0,this.hoverIcons.reset(),null!=t.container&&(t.container.style.cursor="move"),mxEvent.consume(H)))}); mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(H){null!=t.container&&(t.container.style.cursor="");this.shiftDown=this.spaceDown=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var A=t.panningHandler.isForcePanningEvent;t.panningHandler.isForcePanningEvent=function(H){return null!=t.freehand&&t.freehand.isActive()?!1:A.apply(this,arguments)||p.isSpaceDown()||mxEvent.isMouseEvent(H.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(H.getEvent()))&& (!mxEvent.isControlDown(H.getEvent())&&mxEvent.isRightMouseButton(H.getEvent())||mxEvent.isMiddleMouseButton(H.getEvent()))};var E=t.cellEditor.isStopEditingEvent;t.cellEditor.isStopEditingEvent=function(H){return E.apply(this,arguments)||13==H.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(H)||mxClient.IS_MAC&&mxEvent.isMetaDown(H)||mxClient.IS_SF&&mxEvent.isShiftDown(H))};var K=t.isZoomWheelEvent;t.isZoomWheelEvent=function(){return p.isSpaceDown()||K.apply(this,arguments)};var Q=mxUtils.bind(this, function(){if(null!=this.toolbar)for(var H=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,O=this.toolbar.container.firstChild;null!=O;){var S=O.getAttribute("data-min-width");null!=S&&parseInt(S)>H?O.style.display="none":O.style.display="";O=O.nextSibling}}),W=!1,J=null,ea=null,X=null,aa=mxUtils.bind(this,function(){if(null!=this.toolbar&&W!=t.cellEditor.isContentEditing()){for(var H=this.toolbar.container.firstChild,O=[];null!=H;){var S=H.nextSibling;H.parentNode.removeChild(H); O.push(H);H=S}H=this.toolbar.fontMenu;S=this.toolbar.sizeMenu;if(null==X)this.toolbar.createTextToolbar();else{for(var V=0;V<X.length;V++)this.toolbar.container.appendChild(X[V]);this.toolbar.fontMenu=J;this.toolbar.sizeMenu=ea}W=t.cellEditor.isContentEditing();J=H;ea=S;X=O;Q()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);this.descriptorChanged();this.updateStatusAgain();aa()}));this.addListener("currentThemeChanged",Q);mxEvent.addListener(window,"resize", Q);Q();t.isTouchPopupMenuEnabled=function(){return null==p.dialog};var ka=t.cellEditor.startEditing;t.cellEditor.startEditing=function(){ka.apply(this,arguments);aa();if(t.cellEditor.isContentEditing()){var H=!1,O=function(){H||(H=!0,window.setTimeout(function(){var S=t.getSelectedEditingElement();null!=S&&(S=mxUtils.getCurrentStyle(S),null!=S&&null!=p.toolbar&&(p.toolbar.setFontName(mxUtils.getCssFontFamily(S.fontFamily)),p.toolbar.setFontSize(parseInt(S.fontSize))));H=!1},0))};mxEvent.addListener(t.cellEditor.textarea, "input",O);mxEvent.addListener(t.cellEditor.textarea,"touchend",O);mxEvent.addListener(t.cellEditor.textarea,"mouseup",O);mxEvent.addListener(t.cellEditor.textarea,"keyup",O);O()}};var ja=t.cellEditor.stopEditing;t.cellEditor.stopEditing=function(H,O){try{ja.apply(this,arguments),aa()}catch(S){p.handleError(S)}};t.container.setAttribute("tabindex","0");t.container.style.cursor="default";if(window.self===window.top&&null!=t.container.parentNode)try{t.container.focus()}catch(H){}var ua=t.fireMouseEvent; t.fireMouseEvent=function(H,O,S){try{H==mxEvent.MOUSE_DOWN&&this.container.focus(),ua.apply(this,arguments)}catch(V){p.handleError(V)}};var Ba=t.foldCells;t.foldCells=function(H,O,S,V,Z){try{Ba.apply(this,arguments)}catch(ba){p.handleError(ba)}};t.popupMenuHandler.autoExpand=!0;null!=this.menus&&(t.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(H,O,S){this.menus.createPopupMenu(H,O,S)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(H){t.popupMenuHandler.hideMenu()})); this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};t.connectionHandler.addListener(mxEvent.CONNECT,function(H,O){var S=[O.getProperty("cell")];O.getProperty("terminalInserted")&&(S.push(O.getProperty("terminal")),window.setTimeout(function(){null!=p.hoverIcons&&p.hoverIcons.update(t.view.getState(S[S.length-1]))},0));t.pasteCellStyles(S)});var ia=null,l=null;b=mxUtils.bind(this,function(){if(null!=this.toolbar){var H=this.getSelectionState();if(t.isEnabled()&& 0<H.edges.length){if(null!=this.toolbar.edgeStyleMenu){var O=this.getImageForEdgeStyle(H.style);1==H.edges.length&&"arrow"==H.style[mxConstants.STYLE_SHAPE]&&(O=Format.straightImage.src);this.toolbar.edgeStyleMenu.style.backgroundImage="url("+O+")"}null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+this.getImageForEdgeShape(H.style)+")")}else null!=this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+ia+")"),null!=this.toolbar.edgeShapeMenu&& (this.toolbar.edgeShapeMenu.style.backgroundImage="url("+l+")")}});t.selectionModel.addListener(mxEvent.CHANGE,b);t.getModel().addListener(mxEvent.CHANGE,b);this.addListener("styleChanged",mxUtils.bind(this,function(H,O){H=O.getProperty("force");(this.updateDefaultStyle||H)&&t.copyCellStyles(O.getProperty("cells"),O.getProperty("keys"),O.getProperty("values"),t.currentVertexStyle,t.currentEdgeStyle,D,N,O.getProperty("edgeLabel"));null!=this.toolbar&&(this.toolbar.setFontName(t.currentVertexStyle.fontFamily|| Menus.prototype.defaultFont),this.toolbar.setFontSize(t.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),O=this.getSelectionState(),null!=this.toolbar.edgeStyleMenu&&(ia=this.getImageForEdgeStyle(t.currentEdgeStyle),0==O.edges.length&&(this.toolbar.edgeStyleMenu.style.backgroundImage="url("+ia+")")),null!=this.toolbar.edgeShapeMenu&&(l=this.getImageForEdgeShape(t.currentEdgeStyle),0==O.edges.length&&(this.toolbar.edgeShapeMenu.style.backgroundImage="url("+l+")")))}));null!=this.toolbar&& (b=mxUtils.bind(this,function(){var H=t.currentVertexStyle.fontFamily||"Helvetica",O=String(t.currentVertexStyle.fontSize||"12"),S=t.getView().getState(t.getSelectionCell());null!=S&&(H=S.style[mxConstants.STYLE_FONTFAMILY]||H,O=S.style[mxConstants.STYLE_FONTSIZE]||O,10<H.length&&(H=H.substring(0,8)+"..."));this.toolbar.setFontName(H);this.toolbar.setFontSize(O)}),t.getSelectionModel().addListener(mxEvent.CHANGE,b),t.getModel().addListener(mxEvent.CHANGE,b));t.addListener(mxEvent.CELLS_ADDED,function(H, O){H=O.getProperty("cells");O=O.getProperty("parent");null!=O&&t.getModel().isLayer(O)&&!t.isCellVisible(O)&&null!=H&&0<H.length&&t.getModel().setVisible(O,!0)});Graph.selectParentLayer&&t.selectionModel.addListener(mxEvent.CHANGE,function(){if(t.isEnabled()&&!t.isSelectionEmpty()){var H=t.getLayerForCells(t.getSelectionCells());null!=H&&t.setDefaultParent(H)}});this.gestureHandler=mxUtils.bind(this,function(H){this.isHideCurrentMenuEvent(H)&&this.hideCurrentMenu()});mxEvent.addGestureListeners(document, this.gestureHandler);var v=null;this.resizeHandler=mxUtils.bind(this,function(){null!=v&&window.clearTimeout(v);v=window.setTimeout(mxUtils.bind(this,function(){v=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(){t.view.validateBackground()}));this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){t.view.validateBackground()}));t.addListener("gridSizeChanged",mxUtils.bind(this,function(){t.isGridEnabled()&&t.view.validateBackground()})); this.editor.resetGraph()}this.init();t.standalone||this.open()};EditorUi.compactUi=!0; EditorUi.parsePng=function(b,d,m){function p(D,N){var F=n;n+=N;return D.substring(F,n)}function t(D){D=p(D,4);return D.charCodeAt(3)+(D.charCodeAt(2)<<8)+(D.charCodeAt(1)<<16)+(D.charCodeAt(0)<<24)}var n=0;if(p(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=m&&m();else if(p(b,4),"IHDR"!=p(b,4))null!=m&&m();else{p(b,17);do{m=t(b);var z=p(b,4);if(null!=d&&d(n-8,z,m))break;value=p(b,m);p(b,4);if("IEND"==z)break}while(m)}};mxUtils.extend(EditorUi,mxEventSource); EditorUi.prototype.splitSize=mxClient.IS_TOUCH||mxClient.IS_POINTER?12:8;EditorUi.prototype.formatEnabled=!0;EditorUi.prototype.formatWidth=240;EditorUi.prototype.defaultSidebarWidth=Math.min(screen.width/2,"large"!=urlParams["sidebar-entries"]?232:242);EditorUi.prototype.hsplitPosition=screen.width<=Editor.smallScreenWidth?0:EditorUi.prototype.defaultSidebarWidth;EditorUi.prototype.allowAnimation=!0;EditorUi.prototype.lightboxMaxFitScale=2;EditorUi.prototype.lightboxVerticalDivider=4; EditorUi.prototype.hsplitClickEnabled=!1;EditorUi.prototype.updateDefaultStyle=!1;EditorUi.prototype.spaceDown=!1;EditorUi.prototype.shiftDown=!1; EditorUi.prototype.init=function(){var b=this.editor.graph;if(!b.standalone){"0"!=urlParams["shape-picker"]&&this.installShapePicker();var d=null;mxEvent.addListener(b.container,"scroll",mxUtils.bind(this,function(){b.tooltipHandler.hide();null!=b.connectionHandler&&null!=b.connectionHandler.constraintHandler&&b.connectionHandler.constraintHandler.reset();if(null!=b.pageBreakCoverage&&null==d){var t=b.pageBreakCoverage,n=b.container;if(n.scrollLeft<t.x||n.scrollTop<t.y||n.scrollLeft+n.clientWidth> t.x+t.width||n.scrollTop+n.clientHeight>t.y+t.height)d=window.requestAnimationFrame(function(){d=null;b.updatePageBreaks(b.pageBreaksVisible,0,0)})}}));b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){b.tooltipHandler.hide();var t=b.getRubberband();null!=t&&t.cancel()}));mxEvent.addListener(b.container,"keydown",mxUtils.bind(this,function(t){this.onKeyDown(t);this.onKeyPress(t)}));this.installTypingShim();this.addUndoListener();this.addBeforeUnloadListener();b.getSelectionModel().addListener(mxEvent.CHANGE, mxUtils.bind(this,function(){this.updateActionStates()}));b.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));var m=b.setDefaultParent,p=this;this.editor.graph.setDefaultParent=function(){m.apply(this,arguments);p.updateActionStates()};b.showLinkDialog=mxUtils.bind(p,p.showLinkDialog);b.editLink=p.actions.get("editLink").funct;this.updateActionStates();this.editor.chromeless&&!this.editor.editable||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(),p=!0,t=0;t<d.length;t++){var n=b.getCurrentCellStyle(d[t]);"0"!=mxUtils.getValue(n,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(m,d[t],d,p),p=!1)}this.updateSelectionStateForTableCells(m);if(Editor.enableCustomProperties){m.customProperties=Object.create(null);b=m.vertices;d=m.edges;for(t=0;t<b.length;t++)this.findCommonProperties(b[t],m.customProperties, 0==t,m);for(t=0;t<d.length;t++)this.findCommonProperties(d[t],m.customProperties,0==b.length&&0==t,m)}return m}; EditorUi.prototype.findCommonProperties=function(b,d,m,p){p=mxUtils.bind(this,function(T){if(null!=T)if(m)for(var c=0;c<T.length;c++)d[T[c].name]=T[c];else for(var f in d)if(null!=f){var k=!1;for(c=0;c<T.length;c++)if(T[c].name==f&&T[c].type==d[f].type){k=!0;break}k||delete d[f]}});var t=this.editor.graph,n=t.view.getState(b);if(null!=n&&null!=n.shape){if(!n.shape.commonCustomPropAdded){n.shape.commonCustomPropAdded=!0;n.shape.customProperties=n.shape.customProperties||[];if(null!=n.shape&&null!= n.shape.stencil&&null!=n.shape.stencil.desc){var z=n.shape.stencil,D=[],N=mxUtils.bind(this,function(T){T=z.desc.getElementsByTagName(T);for(var c=[],f=0;f<T.length;f++){var k=T[f].getAttribute("color");if(!mxUtils.isValidColor(k)&&!D[k]&&"fill"!=k&&"stroke"!=k&&"font"!=k){D[k]=!0;var q=T[f].getAttribute("name");q=null!=q?q:Editor.getLabelForStylename(k);var y=T[f].getAttribute("default"),A=z.getDefaultColorValue(T[f],t),E=y;y==mxConstants.NONE&&(y="default");c.push({name:k,type:"color",primary:"false"!= T[f].getAttribute("primary"),defVal:y,defaultColor:A,undefinedColor:E,dispName:q})}}return c});Array.prototype.push.apply(n.shape.customProperties,N("fillcolor"));Array.prototype.push.apply(n.shape.customProperties,N("strokecolor"));Array.prototype.push.apply(n.shape.customProperties,N("fontcolor"));N=z.desc.getElementsByTagName("labelBounds");for(var F=0;F<N.length;F++){var P=N[F].getAttribute("if");null==P||D[P]||(D[P]=!0,n.shape.customProperties.push({name:P,dispName:"boundedLbl"==P?"Bounded Label": Editor.getLabelForStylename(P),type:"bool",defVal:!1}))}}n.cell.vertex?Array.prototype.push.apply(n.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(n.shape.customProperties,Editor.commonEdgeProperties)}p(n.shape.customProperties)}b=b.getAttribute("customProperties");if(null!=b)try{p(JSON.parse(b))}catch(T){}}; 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,transparentBounds:!1,unlocked:this.editor.graph.isEnabled(),connections:!1,connectedEdges:!1}}; EditorUi.prototype.updateSelectionStateForTableCells=function(b){if(1<b.cells.length&&b.cell){var d=mxUtils.sortCells(b.cells),m=this.editor.graph.model,p=m.getParent(d[0]),t=m.getParent(p);if(null!=p&&null!=t){for(var n=p.getIndex(d[0]),z=t.getIndex(p),D=null,N=1,F=1,P=0,T=z<t.getChildCount()-1?m.getChildAt(m.getChildAt(t,z+1),n):null;P<d.length-1;){var c=d[++P];null==T||T!=c||null!=D&&N!=D||(D=N,N=0,F++,p=m.getParent(T),T=z+F<t.getChildCount()?m.getChildAt(m.getChildAt(t,z+F),n):null);var f=this.editor.graph.view.getState(c); if(c==m.getChildAt(p,n+N)&&null!=f&&1==mxUtils.getValue(f.style,"colspan",1)&&1==mxUtils.getValue(f.style,"rowspan",1))N++;else break}P==F*N-1&&(b.mergeCell=d[0],b.colspan=N,b.rowspan=F)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor&&null!=this.editor.graph&&this.editor.graph.sizeDidChange()}),0)}; EditorUi.prototype.createTimeout=function(b,d,m){var p=!0,t=null,n=mxUtils.bind(this,function(D){t.clear()&&(p=!1,D=null!=D?D:{code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.createTimeout(b,d,m)})},null!=m?m(D):this.handleError(D))}),z=window.setTimeout(n,null!=b?b:this.timeout);t={clear:function(){window.clearTimeout(z);return p},isAlive:function(){return p}};null!=d&&this.tryAndHandle(mxUtils.bind(this,function(){d(t)}),n);return t}; 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 p=this.editor.graph;b=null!=b?b:p.getSelectionCells();var t=Graph.colorStyles;d||(t=t.filter(function(c){return c!=mxConstants.STYLE_FONTCOLOR&&c!=mxConstants.STYLE_LABEL_BORDERCOLOR&&c!=mxConstants.STYLE_LABEL_BACKGROUNDCOLOR}));var n=document.createElement("div");p.model.beginUpdate();try{for(var z=0;z<b.length;z++)if(p.model.isEdge(b[z])||p.model.isVertex(b[z])){var D=p.getCellStyle(b[z],!1);if(null!=D)for(var N=0;N<t.length;N++)try{var F= D[t[N]];if(mxUtils.isLightDarkColor(F)){var P=mxUtils.getLightDarkColor(F);p.setCellStyles(t[N],P.light,[b[z]])}}catch(c){}d&&p.isHtmlLabel(b[z])&&"0"!=mxUtils.getValue(D,"html","0")&&(n.innerHTML=Graph.sanitizeHtml(p.getLabel(b[z])),Graph.addLightDarkColors(n,null,null,function(c,f,k){return mxUtils.isLightDarkColor(k)?(k=mxUtils.getLightDarkColor(k),c.style.setProperty(f,k.light),!0):!1})&&p.cellLabelChanged(b[z],n.innerHTML))}if(m&&mxUtils.isLightDarkColor(p.background)){P=mxUtils.getLightDarkColor(p.background); var T=new ChangePageSetup(this,P.light);T.ignoreImage=!0;p.model.execute(T)}}finally{p.model.endUpdate()}return b}; EditorUi.prototype.updateSelectionStateForCell=function(b,d,m,p){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.transparentBounds=b.transparentBounds||m.isTransparentBounds(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 t=m.getCellGeometry(d);if(null!=t&&(0<t.width?null==b.width?b.width=t.width:b.width!=t.width&&(b.width=""):b.containsLabel=!0,0<t.height?null==b.height?b.height=t.height:b.height!=t.height&&(b.height=""):b.containsLabel=!0,!t.relative||null!=t.offset)){var n=t.relative?t.offset.x:t.x;t=t.relative?t.offset.y:t.y;null==b.x?b.x=n:b.x!=n&&(b.x="");null==b.y?b.y=t:b.y!=t&&(b.y="")}}else m.getModel().isEdge(d)&& (b.edges.push(d),b.connections=!0,b.resizable=!1,b.rotatable=!1,b.movable=!1,b.connectedEdges=b.connectedEdges||null!=m.model.getTerminal(d,!0)||null!=m.model.getTerminal(d,!1));n=m.view.getState(d);null!=n&&(b.html=b.html&&m.isHtmlLabel(d),b.autoSize=b.autoSize||m.isAutoSizeState(n),b.glass=b.glass&&m.isGlassState(n),b.rounded=b.rounded&&m.isRoundedState(n),b.lineJumps=b.lineJumps&&m.isLineJumpState(n),b.image=b.image||m.isImageState(n),b.shadow=b.shadow&&m.isShadowState(n),b.fill=b.fill&&m.isFillState(n), b.gradient=b.fill&&m.isGradientState(n),b.stroke=b.stroke&&m.isStrokeState(n),d=mxUtils.getValue(n.style,mxConstants.STYLE_SHAPE,null),b.containsImage=b.containsImage||"image"==d,m.mergeStyle(n.style,b.style,p))}; EditorUi.prototype.installShapePicker=function(){var b=this.editor.graph,d=this;b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(F,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 p=b.popupMenuHandler.isMenuShowing; b.popupMenuHandler.isMenuShowing=function(){return p.apply(this,arguments)||null!=d.shapePicker||null!=d.currentMenu};var t=b.dblClick;b.dblClick=function(F,P){if(this.isEnabled()){var T=null==P||null==d.sidebar||mxEvent.isShiftDown(F)||b.isCellLocked(P)||null!=b.getLockedGroupAncestor(b.model.getParent(P))?null:d.getDoubleClickTerminalForEvent(F,P);if(null!=P||null==d.sidebar||mxEvent.isShiftDown(F)||b.isCellLocked(b.getDefaultParent()))null!=T?(mxEvent.consume(F),window.setTimeout(mxUtils.bind(this, function(){d.showShapePickerForEdgeTerminal(P,T.source,T.point)}),30)):t.apply(this,arguments);else{var c=mxUtils.convertPoint(this.container,mxEvent.getClientX(F),mxEvent.getClientY(F));mxEvent.consume(F);window.setTimeout(mxUtils.bind(this,function(){d.showShapePicker(c.x,c.y)}),30)}}};b.addListener("doubleClickEdgeTerminal",mxUtils.bind(this,function(F,P){var T=P.getProperty("cell"),c=P.getProperty("point");if(null!=T&&null!=c&&!b.isCellLocked(T)&&null==b.getLockedGroupAncestor(b.model.getParent(T))){var f= P.getProperty("source");window.setTimeout(mxUtils.bind(this,function(){d.showShapePickerForEdgeTerminal(T,f,c)}),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 n=this.hoverIcons.drag;this.hoverIcons.drag=function(){d.hideShapePicker();n.apply(this,arguments)};var z=this.hoverIcons.execute;this.hoverIcons.execute=function(F,P,T){var c= T.getEvent();this.graph.isCloneEvent(c)||mxEvent.isShiftDown(c)?z.apply(this,arguments):this.graph.connectVertex(F.cell,P,this.graph.defaultEdgeLength,c,null,null,mxUtils.bind(this,function(f,k,q){var y=b.getCompositeParent(F.cell);f=b.getCellGeometry(y);for(T.consume();null!=y&&b.model.isVertex(y)&&null!=f&&f.relative;)cell=y,y=b.model.getParent(cell),f=b.getCellGeometry(y);window.setTimeout(mxUtils.bind(this,function(){this.shapePickerHoverDiv=d.showShapePicker(T.getGraphX(),T.getGraphY(),y,mxUtils.bind(this, function(A){q(A);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(A))}),P)}),30)}),mxUtils.bind(this,function(f){this.graph.selectCellsForConnectVertex(f,c,this)}))};var D=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(F,P){null!=D&&window.clearTimeout(D);D=window.setTimeout(mxUtils.bind(this,function(){var T=P.getProperty("arrow"),c=P.getProperty("direction"),f=P.getProperty("event");T=T.getBoundingClientRect();var k=mxUtils.getOffset(b.container),q=b.container.scrollLeft+ T.x-k.x;k=b.container.scrollTop+T.y-k.y;var y=b.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),A=d.showShapePicker(q,k,y,mxUtils.bind(this,function(E){null!=E&&b.connectVertex(y,c,b.defaultEdgeLength,f,!0,!1,null,function(K){b.selectCellsForConnectVertex(K);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(E))},E)}),c,!0);null!=A&&(this.centerShapePicker(A,T,q,k,c),this.hoverIcons.shapePickerHoverDiv=A,mxUtils.setOpacity(A,30),mxEvent.addListener(A, "mouseenter",function(){mxUtils.setOpacity(A,100)}),mxEvent.addListener(A,"mouseleave",function(){d.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));this.hoverIcons.addListener("blur",mxUtils.bind(this,function(F,P){null!=D&&window.clearTimeout(D)}))}var N=!1;b.addMouseListener({mouseDown:mxUtils.bind(this,function(F,P){N=!1}),mouseMove:mxUtils.bind(this,function(F,P){null!=b.connectHandleClickState&&null!=b.connectionHandler&&null!=b.connectionHandler.shape&&(N=!0)}),mouseUp:mxUtils.bind(this, function(F,P){F=b.connectHandleClickState;b.connectHandleClickState=null;if(null!=F&&!N){var T=P.getEvent();if(!b.isCloneEvent(T)&&!mxEvent.isShiftDown(T)){for(var c=mxConstants.DIRECTION_EAST,f=b.getCompositeParent(F.cell),k=b.getCellGeometry(f);null!=f&&b.model.isVertex(f)&&null!=k&&k.relative;)f=b.model.getParent(f),k=b.getCellGeometry(f);b.connectVertex(F.cell,c,b.defaultEdgeLength,T,null,!0,mxUtils.bind(this,function(q,y,A){P.consume();window.setTimeout(mxUtils.bind(this,function(){d.showShapePicker(P.getGraphX(), P.getGraphY(),f,mxUtils.bind(this,function(E){A(E);null!=d.hoverIcons&&d.hoverIcons.update(b.view.getState(E))}),c)}),30)}),mxUtils.bind(this,function(q){b.selectCellsForConnectVertex(q,T)}))}}N=!1})})}; EditorUi.prototype.getDoubleClickTerminalForEvent=function(b,d){var m=this.editor.graph;if(null!=b&&null!=d&&m.model.isEdge(d)){var p=m.view.getState(d);if(null!=p&&null!=p.absolutePoints&&2<=p.absolutePoints.length){b=mxUtils.convertPoint(m.container,mxEvent.getClientX(b),mxEvent.getClientY(b));for(var t=m.tolerance+mxConstants.HANDLE_SIZE,n=0;2>n;n++){var z=0==n;if(null==m.model.getTerminal(d,z)){var D=p.absolutePoints[z?0:p.absolutePoints.length-1];if(null!=D&&Math.abs(D.x-b.x)<=t&&Math.abs(D.y- b.y)<=t)return{point:D.clone(),source:z}}}}}return null}; EditorUi.prototype.showShapePickerForEdgeTerminal=function(b,d,m){var p=this,t=this.editor.graph;this.showShapePicker(m.x,m.y,null,mxUtils.bind(this,function(n){if(null!=n){var z=n.geometry;null!=z&&(z.x=t.snap(Math.round(m.x/t.view.scale)-t.view.translate.x-z.width/2),z.y=t.snap(Math.round(m.y/t.view.scale)-t.view.translate.y-z.height/2));t.model.beginUpdate();try{t.addCell(n);t.model.isVertex(n)&&t.isAutoSizeCell(n)&&t.updateCellSize(n);t.model.setTerminal(b,n,d);var D=t.getCellGeometry(b);null!= D&&null!=D.getTerminalPoint(d)&&(D=D.clone(),D.setTerminalPoint(null,d),t.model.setGeometry(b,D))}finally{t.model.endUpdate()}t.setSelectionCell(n);t.scrollCellToVisible(n);t.startEditing(n);null!=p.hoverIcons&&p.hoverIcons.update(t.view.getState(n))}}),null,!1,null,!1,!1,this.getCellsForShapePicker(null,!1,!1),{cell:b,source:d})}; EditorUi.prototype.centerShapePicker=function(b,d,m,p,t){if(t==mxConstants.DIRECTION_EAST||t==mxConstants.DIRECTION_WEST)b.style.width="40px";var n=b.getBoundingClientRect();t==mxConstants.DIRECTION_NORTH?(m-=n.width/2-10,p-=n.height+6):t==mxConstants.DIRECTION_SOUTH?(m-=n.width/2-10,p+=d.height+6):t==mxConstants.DIRECTION_WEST?(m-=n.width+6,p-=n.height/2-10):t==mxConstants.DIRECTION_EAST&&(m+=d.width+6,p-=n.height/2-10);b.style.left=m+"px";b.style.top=p+"px"}; EditorUi.prototype.showShapePicker=function(b,d,m,p,t,n,z,D,N,F,P){var T=null;this.editor.graph.freehand.isDrawing()||(D=D||null==m,F=null!=F?F:this.getCellsForShapePicker(m,n,D),T=this.createShapePicker(b,d,m,p,t,mxUtils.bind(this,function(){this.hideShapePicker()}),F,n,z,D,N,P),null!=T&&(null==this.hoverIcons||n||this.hoverIcons.reset(),b=this.editor.graph,b.popupMenuHandler.hideMenu(),b.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=p,this.shapePicker= T));return T}; EditorUi.prototype.createShapePicker=function(b,d,m,p,t,n,z,D,N,F,P,T){P=null!=P?P:!0;var c=this.editor.graph,f=null;N=null!=N?N:function(y){y=y[0];var A=0,E=0,K=y.geometry;null!=K&&(c.model.isEdge(y)&&(y=K.getTerminalPoint(!1),K=new mxRectangle(0,0,y.x,y.y)),A=K.width/2,E=K.height/2);return new mxPoint(c.snap(Math.round(b/c.view.scale)-c.view.translate.x-A),c.snap(Math.round(d/c.view.scale)-c.view.translate.y-E))};if(null!=z&&0<z.length){var k=this;c=this.editor.graph;f=document.createElement("div");t= c.view.getState(m);var q=null==m||null!=t&&c.isTransparentState(t)?null:c.copyStyle(m);f.className="geShapePicker";f.setAttribute("title",mxResources.get("sidebarTooltip"));f.style.left=Math.round(b)+"px";f.style.top=Math.round(d)+"px";mxClient.IS_POINTER&&(f.style.touchAction="none");D||mxUtils.setPrefixedStyle(f.style,"transform","translate(-22px,-22px)");c.container.appendChild(f);t=mxUtils.bind(this,function(y){var A=document.createElement("a");f.appendChild(A);var E=y.shapePickerKeepStyle;delete y.shapePickerKeepStyle; E||(null!=q&&"1"!=urlParams.sketch?this.sidebar.graph.pasteStyle(q,[y]):this.sidebar.graph.pasteCellStyles([y],c.currentVertexStyle,c.currentEdgeStyle,null,null,c.pasteStylesToText));E=y.geometry;c.model.isEdge(y)&&(E=E.getTerminalPoint(!1),E=new mxRectangle(0,0,E.x,E.y));null!=E&&(E=this.sidebar.createVertexTemplateFromCells([y],E.width,E.height,"",!0,!1,null,!0,mxUtils.bind(this,function(K){if(!mxEvent.isAltDown(K)||1!=c.getSelectionCount()){if(!mxEvent.isShiftDown(K)||null==m&&c.isSelectionEmpty()){var Q= c.cloneCell(y);if(null!=p)p(Q);else{var W=N([Q]);c.model.isEdge(Q)?Q.geometry.translate(W.x,W.y):(Q.geometry.x=W.x,Q.geometry.y=W.y);c.model.beginUpdate();try{c.addCell(Q),c.model.isVertex(Q)&&c.isAutoSizeCell(Q)&&c.updateCellSize(Q)}finally{c.model.endUpdate()}c.setSelectionCell(Q);c.scrollCellToVisible(Q);P&&c.startEditing(Q);null!=k.hoverIcons&&k.hoverIcons.update(c.view.getState(Q))}}else Q=c.getEditableCells(null!=m?[m]:c.getSelectionCells()),c.updateShapes(y,Q);null!=n&&n(K);mxEvent.consume(K)}}), 25,25,null,null,m,T),E.style.display="flex",E.style.alignItems="center",E.style.justifyContent="center",A.appendChild(E))});for(F=0;F<(D?Math.min(z.length,4):z.length);F++)t(z[F]);z=f.offsetTop+f.clientHeight-(c.container.scrollTop+c.container.offsetHeight);0<z&&(f.style.top=Math.max(c.container.scrollTop+22,d-z)+"px");z=f.offsetLeft+f.clientWidth-(c.container.scrollLeft+c.container.offsetWidth);0<z&&(f.style.left=Math.max(c.container.scrollLeft+22,b-z)+"px")}return f}; EditorUi.prototype.defaultShapePickerEntries=null; EditorUi.prototype.getCellsForShapePicker=function(b,d,m){var p=this.editor.graph,t=mxUtils.bind(this,function(T,c,f,k){return p.createVertex(null,null,k||"",0,0,c||120,f||60,T,!1)});d=mxUtils.bind(this,function(T,c,f){T=new mxCell(f||"",new mxGeometry(0,0,p.defaultEdgeLength+20,0),T);T.geometry.setTerminalPoint(new mxPoint(0,0),!0);T.geometry.setTerminalPoint(new mxPoint(T.geometry.width,null!=c?c:0),!1);T.geometry.points=null!=c?[new mxPoint(T.geometry.width/2,c)]:[];T.geometry.relative=!0;T.edge= !0;return T});if(null!=b)try{b=p.cloneCell(b),p.model.isVertex(b)&&null!=b.geometry&&(b.geometry.x=0,b.geometry.y=0)}catch(T){b=null}if(null!=this.defaultShapePickerEntries){for(var n=[],z=[],D=function(T){if(null!=T&&"object"===typeof T){var c=mxUtils.createXmlDocument().createElement("UserObject"),f;for(f in T)T.hasOwnProperty(f)&&c.setAttribute(f,T[f]);null==c.getAttribute("label")&&c.setAttribute("label","");return c}return T},N=0;N<this.defaultShapePickerEntries.length;N++){var F=this.defaultShapePickerEntries[N]; if(null!=F&&null!=F.style){var P=D(F.value);F.edge?z.push(d(F.style,F.y,P)):(P=t(F.style,F.width,F.height,P),F.keepStyle&&(P.shapePickerKeepStyle=!0),n.push(P))}}null!=b&&(n[0]=b);b=n;m&&(b=b.concat(z));return b}null==b&&(b=t(p.appendFontSize(Editor.defaultTextStyle,p.vertexFontSize),60,30,"Text"));b=[b,t("whiteSpace=wrap;html=1;"),t("ellipse;whiteSpace=wrap;html=1;shapeInside=1;",80,80),t("rhombus;whiteSpace=wrap;html=1;shapeInside=1;",80,80),t("rounded=1;whiteSpace=wrap;html=1;"),t("shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;shapeInside=1;fixedSize=1;"), t("shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;shapeInside=1;fixedSize=1;",120,60),t("shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;shapeInside=1;fixedSize=1;",120,80),t("shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;shapeInside=1;fixedSize=1;",120,80),t("shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;"),t("triangle;whiteSpace=wrap;html=1;shapeInside=1;",60,80),t("shape=document;whiteSpace=wrap;html=1;boundedLbl=1;",120,80),t("shape=tape;whiteSpace=wrap;html=1;", 120,100),t("ellipse;shape=cloud;whiteSpace=wrap;html=1;",120,80),t("shape=singleArrow;whiteSpace=wrap;html=1;arrowWidth=0.4;arrowSize=0.4;",80,60),t("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){var p=window.getSelection(),t=0<p.rangeCount?p.getRangeAt(0).commonAncestorContainer:null;m=null!=t&&("LI"==t.nodeName||null!=t.parentNode&&"LI"==t.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(n){}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");(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,p=mxUtils.bind(this,function(){if(!m&&0<d.value.length){var n=d.value;d.value="";this.hideTypingShim();b.escape();b.cellEditor.editByTyping=!0;b.startEditing(null,n)}});mxEvent.addListener(d,"compositionstart",function(){m=!0});mxEvent.addListener(d,"compositionend",function(){m=!1;p()});mxEvent.addListener(d,"input",function(){p()});mxEvent.addListener(d,"keydown",mxUtils.bind(this,function(n){229!==n.keyCode&&(mxEvent.isControlDown(n)||mxEvent.isMetaDown(n)||(null==n.key|| 1!==n.key.length||mxEvent.isAltDown(n)?n.preventDefault():null!=this.keyHandler&&null!=this.keyHandler.getFunction(n)&&n.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 t=b.cellEditor.focusContainer;b.cellEditor.focusContainer=mxUtils.bind(this,function(){b.isSelectionEmpty()||b.isEditing()?t.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);if(null!=m){var p=document.activeElement;if(null==p||p===document.body||p===b.container||b.container.contains(p))if(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="",null!=this.clipboardElt&&null!=this.clipboardElt.parentNode){d=b.container.scrollLeft; m=b.container.scrollTop;this.clipboardElt.focus({preventScroll:!0});try{var t=document.createRange();t.selectNodeContents(this.clipboardElt);var n=window.getSelection();null!=n&&(n.removeAllRanges(),n.addRange(t))}catch(z){}b.container.scrollLeft=d;b.container.scrollTop=m}else null!=p&&"true"===p.contentEditable||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,p,t){m=this.getImageForMarker(p,t,m);b.innerHTML="";null==m?b.innerHTML=mxUtils.htmlEntities(mxResources.get("none")):(p=document.createElement("img"),p.setAttribute("src",m),"end"==d&&mxUtils.setPrefixedStyle(p.style,"transform","scaleX(-1)"),b.appendChild(p))}; EditorUi.prototype.getImageForMarker=function(b,d,m){return"flexArrow"==m?null!=b&&b!=mxConstants.NONE?Format.blockMarkerImage.src:null:b==mxConstants.ARROW_CLASSIC?"1"!=d?Format.classicMarkerImage.src:Format.classicFilledMarkerImage.src:b==mxConstants.ARROW_CLASSIC_THIN?"1"!=d?Format.classicThinMarkerImage.src:Format.openThinFilledMarkerImage.src:b==mxConstants.ARROW_OPEN?Format.openFilledMarkerImage.src:b==mxConstants.ARROW_OPEN_THIN?Format.openThinFilledMarkerImage.src:b==mxConstants.ARROW_BLOCK? "1"!=d?Format.blockMarkerImage.src:Format.blockFilledMarkerImage.src:b==mxConstants.ARROW_BLOCK_THIN?"1"!=d?Format.blockThinMarkerImage.src:Format.blockThinFilledMarkerImage.src:b==mxConstants.ARROW_OVAL?"1"!=d?Format.ovalMarkerImage.src:Format.ovalFilledMarkerImage.src:b==mxConstants.ARROW_DIAMOND?"1"!=d?Format.diamondMarkerImage.src:Format.diamondFilledMarkerImage.src:b==mxConstants.ARROW_DIAMOND_THIN?"1"!=d?Format.diamondThinMarkerImage.src:Format.diamondThinFilledMarkerImage.src:"doubleBlock"== b?"1"!=d?Format.doubleBlockMarkerImage.src:Format.doubleBlockFilledMarkerImage.src:"box"==b?Format.boxMarkerImage.src:"halfCircle"==b?Format.halfCircleMarkerImage.src:"openAsync"==b?Format.openAsyncFilledMarkerImage.src:"async"==b?"1"!=d?Format.asyncMarkerImage.src:Format.asyncFilledMarkerImage.src:"dash"==b?Format.dashMarkerImage.src:"baseDash"==b?Format.baseDashMarkerImage.src:"cross"==b?Format.crossMarkerImage.src:"circle"==b?Format.circleMarkerImage.src:"circlePlus"==b?Format.circlePlusMarkerImage.src: "ERone"==b?Format.EROneMarkerImage.src:"ERmandOne"==b?Format.ERmandOneMarkerImage.src:"ERmany"==b?Format.ERmanyMarkerImage.src:"ERoneToMany"==b?Format.ERoneToManyMarkerImage.src:"ERzeroToOne"==b?Format.ERzeroToOneMarkerImage.src:"ERzeroToMany"==b?Format.ERzeroToManyMarkerImage.src:null}; EditorUi.prototype.getImageForEdgeShape=function(b){var d=Format.connectionImage.src;"link"==b.shape?d=Format.linkEdgeImage.src:"flexArrow"==b.shape?d=Format.arrowImage.src:"arrow"==b.shape?d=Format.simpleArrowImage.src:"filledEdge"==b.shape?d=Format.filledEdgeImage.src:"pipe"==b.shape?d=Format.pipeEdgeImage.src:"wire"==b.shape&&(d=Format.wireEdgeImage.src);return d}; EditorUi.prototype.getImageForEdgeStyle=function(b){if("1"==mxUtils.getValue(b,"libavoidRouting",null))return Format.libavoidImage.src;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(n){n.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):d.apply(this,arguments);b.updatePasteActionStates()};mxClipboard.copy=function(n){var z=null;if(n.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{z=z||n.getSelectionCells();z=n.getExportableCells(n.model.getTopmostCells(z));for(var D={},N=n.createCellLookup(z),F=n.cloneCells(z,null,D),P=new mxGraphModel,T=P.getChildAt(P.getRoot(), 0),c=0;c<F.length;c++){P.add(T,F[c]);var f=n.view.getState(z[c]);if(null!=f){var k=n.getCellGeometry(F[c]);null!=k&&k.relative&&!P.isEdge(z[c])&&null==N[mxObjectIdentity.get(P.getParent(z[c]))]&&(k.offset=null,k.relative=!1,k.x=f.x/f.view.scale-f.view.translate.x,k.y=f.y/f.view.scale-f.view.translate.y)}}n.updateCustomLinks(n.createCellMapping(D,N),F);mxClipboard.insertCount=1;mxClipboard.setCells(F)}b.updatePasteActionStates();return z};var m=mxClipboard.paste;mxClipboard.paste=function(n){var z= null;n.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):z=m.apply(this,arguments);b.updatePasteActionStates();return z};var p=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){p.apply(this,arguments);b.updatePasteActionStates()};var t=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(n,z){t.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 V=this.graph.getPageLayout(),Z=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+V.x*Z.width),this.scale*(this.translate.y+V.y*Z.height),this.scale*V.width*Z.width, this.scale*V.height*Z.height)};b.getPreferredPageSize=function(V,Z,ba){V=this.getPageLayout();Z=this.getPageSize();return new mxRectangle(0,0,V.width*Z.width,V.height*Z.height)};var d=null,m=this;if(this.editor.isChromelessView()){this.chromelessResize=d=mxUtils.bind(this,function(V,Z,ba,ha){if(null!=b.container&&!b.isViewer()){ba=null!=ba?ba:0;ha=null!=ha?ha:0;var na=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),oa=mxUtils.hasScrollbars(b.container),fa=b.view.translate,qa=b.view.scale, ya=mxRectangle.fromRectangle(na);ya.x=ya.x/qa-fa.x;ya.y=ya.y/qa-fa.y;ya.width/=qa;ya.height/=qa;fa=b.container.scrollTop;var ta=b.container.scrollLeft,Ca=8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)Ca+=3;var la=b.container.offsetWidth-Ca;Ca=b.container.offsetHeight-Ca;V=V?Math.max(.3,Math.min(Z||1,la/ya.width)):qa;Z=(la-V*ya.width)/2/V;var ra=0==this.lightboxVerticalDivider?0:(Ca-V*ya.height)/this.lightboxVerticalDivider/V;oa&&(Z=Math.max(Z,0),ra=Math.max(ra, 0));if(oa||na.width<la||na.height<Ca)b.view.scaleAndTranslate(V,Math.floor(Z-ya.x),Math.floor(ra-ya.y)),b.container.scrollTop=fa*V/qa,b.container.scrollLeft=ta*V/qa;else if(0!=ba||0!=ha)na=b.view.translate,b.view.setTranslate(Math.floor(na.x+ba/qa),Math.floor(na.y+ha/qa))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var p=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",p);this.destroyFunctions.push(function(){mxEvent.removeListener(window, "resize",p)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(V){b.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(V){b.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){var t=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%";this.chromelessToolbar.style.backgroundColor="#000000";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","16px");mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out");var n= mxUtils.bind(this,function(){var V=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=V?parseInt(V["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",n);n();var z=0;n=mxUtils.bind(this,function(V,Z,ba){z++;var ha=document.createElement("span");ha.style.paddingLeft="8px";ha.style.paddingRight="8px";ha.style.cursor="pointer";mxEvent.addListener(ha, "click",V);null!=ba&&ha.setAttribute("title",ba);V=document.createElement("img");V.setAttribute("border","0");V.setAttribute("src",Z);V.style.width="36px";V.style.filter="invert(100%)";ha.appendChild(V);this.chromelessToolbar.appendChild(ha);return ha});if(null!=t.backBtn){var D=Graph.sanitizeLink(t.backBtn.url);null!=D&&n(mxUtils.bind(this,function(V){window.location.href=D;mxEvent.consume(V)}),Editor.backImage,mxResources.get("back"))}if(this.isPagesEnabled()){var N=n(mxUtils.bind(this,function(V){this.actions.get("previousPage").funct(); mxEvent.consume(V)}),Editor.chevronLeftImage,mxResources.get("previousPage")),F=document.createElement("div");F.style.fontFamily=Editor.defaultHtmlFont;F.style.display="inline-block";F.style.verticalAlign="top";F.style.fontWeight="bold";F.style.marginTop="8px";F.style.fontSize="14px";F.style.cursor="default";F.style.color="#ffffff";this.chromelessToolbar.appendChild(F);var P=n(mxUtils.bind(this,function(V){this.actions.get("nextPage").funct();mxEvent.consume(V)}),Editor.chevronRightImage,mxResources.get("nextPage")), T=mxUtils.bind(this,function(){if(null!=this.pages&&1<this.pages.length&&null!=this.currentPage){F.innerText="";var V=mxUtils.indexOf(this.pages,this.currentPage);mxUtils.write(F,V+1+" / "+this.pages.length);F.setAttribute("title",mxResources.get("currentPage")+": "+this.currentPage.getName());N.setAttribute("title",mxResources.get("previousPage")+": "+this.pages[mxUtils.mod(V-1,this.pages.length)].getName());P.setAttribute("title",mxResources.get("nextPage")+": "+this.pages[mxUtils.mod(V+1,this.pages.length)].getName())}}); N.style.paddingLeft="0px";N.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="",N.style.display="",F.style.display="inline-block"):(P.style.display="none",N.style.display="none",F.style.display="none");T()});if(null!=this.menus){var f=this.menus.get("pages");null!=f&&mxEvent.addListener(F,"click",mxUtils.bind(this,function(V){var Z=new mxPopupMenu(f.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 ba=mxUtils.getOffset(F);Z.popup(ba.x,ba.y+F.offsetHeight,null,V);mxEvent.addListener(Z.div,"mouseleave",mxUtils.bind(this,function(){Z.hideMenu()}))}))}this.editor.addListener("resetGraphView",c);this.editor.addListener("pageSelected",T)}n(mxUtils.bind(this,function(V){this.actions.get("zoomOut").funct();mxEvent.consume(V)}),Editor.zoomOutImage, mxResources.get("zoomOut")+" (Alt+Mousewheel)");n(mxUtils.bind(this,function(V){this.actions.get("zoomIn").funct();mxEvent.consume(V)}),Editor.zoomInImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");n(mxUtils.bind(this,function(V){this.actions.get("smartFit").funct();mxEvent.consume(V)}),Editor.zoomFitImage,mxResources.get("fit"));var k=null,q=null,y=mxUtils.bind(this,function(V){null!=k&&(window.clearTimeout(k),k=null);null!=q&&(window.clearTimeout(q),q=null);k=window.setTimeout(mxUtils.bind(this, function(){mxUtils.setOpacity(this.chromelessToolbar,0);k=null;q=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";q=null}),600)}),V||200)}),A=mxUtils.bind(this,function(V){null!=k&&(window.clearTimeout(k),k=null);null!=q&&(window.clearTimeout(q),q=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,V||30)});if("1"==urlParams.layers){this.layersDialog=null;var E=n(mxUtils.bind(this,function(V){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 Z=E.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=Z.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";this.layersDialog.style.backgroundColor="#000000";this.layersDialog.style.color="#ffffff";mxUtils.setOpacity(this.layersDialog,80);Z=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=Z.zIndex;document.body.appendChild(this.layersDialog); this.editor.fireEvent(new mxEventObject("layersDialogShown"))}mxEvent.consume(V)}),Editor.layersImage,mxResources.get("layers")),K=b.getModel();K.addListener(mxEvent.CHANGE,function(){E.style.display=1<K.getChildCount(K.root)?"":"none"})}("1"!=urlParams.openInSameWin||navigator.standalone)&&this.addChromelessToolbarItems(n);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||n(mxUtils.bind(this,function(V){if(null!=this.editor.editButtonFunc)this.editor.editButtonFunc();else if("_blank"== this.editor.editButtonLink){var Z=null!=this.currentPage?this.currentPage.getId():null;this.editor.editAsNew(this.getEditBlankXml(),null,null,Z)}else b.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(V)}),Editor.editImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(c=0;c<this.lightboxToolbarActions.length;c++){var Q=this.lightboxToolbarActions[c];Q.elem=n(Q.fn,Q.icon,Q.tooltip)}if(null!=t.refreshBtn){var W=null==t.refreshBtn.url?null:Graph.sanitizeLink(t.refreshBtn.url); n(mxUtils.bind(this,function(V){null!=W?window.location.href=W:window.location.reload();mxEvent.consume(V)}),Editor.refreshImage,mxResources.get("refresh"))}null!=t.fullscreenBtn&&window.self!==window.top&&n(mxUtils.bind(this,function(V){t.fullscreenBtn.url?b.openLink(t.fullscreenBtn.url):b.openLink(window.location.href);mxEvent.consume(V)}),Editor.fullscreenImage,mxResources.get("openInNewWindow"));!t.noCloseBtn&&(t.closeBtn&&window.self===window.top||b.lightbox&&("1"==urlParams.close||this.container!= document.body))&&n(mxUtils.bind(this,function(V){"1"==urlParams.close||t.closeBtn?window.close():(this.destroy(),mxEvent.consume(V))}),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(V){mxEvent.isTouchEvent(V)|| (mxEvent.isShiftDown(V)||A(30),y())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(V){mxEvent.consume(V)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(V){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(V)?y():A(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(V){mxEvent.isShiftDown(V)?y():A(100);mxEvent.consume(V)}));mxEvent.addListener(this.chromelessToolbar, "mouseleave",mxUtils.bind(this,function(V){mxEvent.isTouchEvent(V)||A(30)}));var J=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(V,Z){this.startX=Z.getGraphX();this.startY=Z.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(V,Z){},mouseUp:function(V,Z){mxEvent.isTouchEvent(Z.getEvent())&&Math.abs(this.scrollLeft-b.container.scrollLeft)<J&&Math.abs(this.scrollTop-b.container.scrollTop)<J&& Math.abs(this.startX-Z.getGraphX())<J&&Math.abs(this.startY-Z.getGraphY())<J&&(0<parseFloat(m.chromelessToolbar.style.opacity||0)?y():A(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var ea=b.view.validate,X=new mxPoint,aa=!1,ka=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=m.currentPage&&ka!=m.currentPage){ka=m.currentPage;aa=!0;var V=b.getBoundingBoxFromGeometry(b.model.getCells(),!0,null,!0); null==V&&(V=new mxRectangle(b.view.translate.x*b.view.scale,b.view.translate.y*b.view.scale));V=b.getPageLayout(V,X,1);var Z=b.getDefaultTranslate(V);this.x0=V.x;this.y0=V.y;if(Z.x!=this.translate.x||Z.y!=this.translate.y)this.invalidate(),this.translate.x=Z.x,this.translate.y=Z.y}Z=b.getPagePadding();var ba=b.getPageSize();V=Z.x-(this.x0||0)*ba.width;Z=Z.y-(this.y0||0)*ba.height;if(this.translate.x!=V||this.translate.y!=Z)this.invalidate(),this.translate.x=V,this.translate.y=Z}ea.apply(this,arguments)}; if(!b.isViewer()){var ja=b.sizeDidChange;b.sizeDidChange=function(){var V=aa;aa=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var Z=this.getPageLayout(),ba=this.getDefaultTranslate(Z),ha=this.view.translate.x,na=this.view.translate.y;if(ba.x!=ha||ba.y!=na){this.view.x0=Z.x;this.view.y0=Z.y;this.autoTranslate=!0;this.view.setTranslate(ba.x,ba.y);this.autoTranslate=!1;V||(this.container.scrollLeft+=Math.round((ba.x-ha)*this.view.scale), this.container.scrollTop+=Math.round((ba.y-na)*this.view.scale));return}}ja.apply(this,arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var ua=b.view.getBackgroundPane(),Ba=b.view.getDrawPane();b.cumulativeZoomFactor=1;var ia=null,l=null,v=null,H=null,O=null,S=function(V){null!=ia&&window.clearTimeout(ia);0<=V&&window.setTimeout(function(){if(!b.isMouseDown||H)ia=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));Ba.style.transformOrigin="";ua.style.transformOrigin="";mxClient.IS_SF?(Ba.style.transform="scale(1)",ua.style.transform="scale(1)",window.setTimeout(function(){Ba.style.transform="";ua.style.transform=""},0)):(Ba.style.transform="",ua.style.transform="");b.view.getDecoratorPane().style.opacity= "";b.view.getOverlayPane().style.opacity="";for(var Z=b.container.querySelectorAll(".geHint"),ba=0;ba<Z.length;ba++)Z[ba].style.opacity=""}Z=new mxPoint(b.container.scrollLeft,b.container.scrollTop);var ha=mxUtils.getOffset(b.container),na=b.view.scale;ba=b.view.translate.x;var oa=b.view.translate.y,fa=0,qa=0;null!=l&&(fa=b.container.offsetWidth/2-l.x+ha.x,qa=b.container.offsetHeight/2-l.y+ha.y);var ya=null==d&&mxUtils.hasScrollbars(b.container);b.zoom(b.cumulativeZoomFactor,ya?!1:null,b.isFastZoomEnabled()? 20:null,ya);var ta=b.view.scale;ta!=na&&(ya?(na=ta/na,fa=null!=l?l.x-ha.x:b.container.clientWidth/2,ha=null!=l?l.y-ha.y:b.container.clientHeight/2,null!=v&&(fa-=Z.x-v.x,ha-=Z.y-v.y),b.container.scrollLeft=Math.round(Z.x*na+fa*(na-1)+(b.view.translate.x-ba)*ta),b.container.scrollTop=Math.round(Z.y*na+ha*(na-1)+(b.view.translate.y-oa)*ta)):(null!=v&&(fa+=Z.x-v.x,qa+=Z.y-v.y),null!=d&&m.chromelessResize(!1,null,fa*(b.cumulativeZoomFactor-1),qa*(b.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(b.container)|| 0==fa&&0==qa||(b.container.scrollLeft-=fa*(b.cumulativeZoomFactor-1),b.container.scrollTop-=qa*(b.cumulativeZoomFactor-1))));null!=O&&Ba.setAttribute("filter",O);b.fireEvent(new mxEventObject("zoomPreviewComplete"));b.cumulativeZoomFactor=1;O=H=l=v=ia=null}),null!=V?V:b.isFastZoomEnabled()?m.wheelZoomDelay:m.lazyZoomDelay)},0)};b.lazyZoom=function(V,Z,ba,ha,na){ha=null!=ha?ha:this.zoomFactor;(Z=Z||!b.scrollbars)&&(l=new mxPoint(b.container.offsetLeft+b.container.clientWidth/2,b.container.offsetTop+ b.container.clientHeight/2));na?1!=ha&&(V?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=ha,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/=ha,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor* 100)/100/this.view.scale)):this.cumulativeZoomFactor=this.getZoomStep(this.view.scale*this.cumulativeZoomFactor,V)/this.view.scale;this.cumulativeZoomFactor=Math.max(.05,Math.min(this.view.scale*this.cumulativeZoomFactor,160))/this.view.scale;if(b.isFastZoomEnabled()){null==O&&""!=Ba.getAttribute("filter")&&(O=Ba.getAttribute("filter"),Ba.removeAttribute("filter"));v=new mxPoint(b.container.scrollLeft,b.container.scrollTop);V=Math.round(Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100* 20)/(20*this.view.scale);ha=Z||null==l?b.container.scrollLeft+b.container.clientWidth/2:l.x+b.container.scrollLeft-b.container.offsetLeft;na=Z||null==l?b.container.scrollTop+b.container.clientHeight/2:l.y+b.container.scrollTop-b.container.offsetTop;Ba.style.transformOrigin=ha+"px "+na+"px";Ba.style.transform="scale("+V+")";ua.style.transformOrigin=ha+"px "+na+"px";ua.style.transform="scale("+V+")";null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(ha=b.view.backgroundPageShape.node, mxUtils.setPrefixedStyle(ha.style,"transform-origin",(Z||null==l?b.container.clientWidth/2+b.container.scrollLeft-ha.offsetLeft+"px":l.x+b.container.scrollLeft-ha.offsetLeft-b.container.offsetLeft+"px")+" "+(Z||null==l?b.container.clientHeight/2+b.container.scrollTop-ha.offsetTop+"px":l.y+b.container.scrollTop-ha.offsetTop-b.container.offsetTop+"px")),mxUtils.setPrefixedStyle(ha.style,"transform","scale("+V+")")):b.view.validateBackgroundStyles(V,ha,na);b.view.getDecoratorPane().style.opacity="0"; b.view.getOverlayPane().style.opacity="0";Z=b.container.querySelectorAll(".geHint");for(ha=0;ha<Z.length;ha++)Z[ha].style.opacity="0";b.fireEvent(new mxEventObject("zoomPreview","factor",V))}S(b.isFastZoomEnabled()?ba:0)};mxEvent.addGestureListeners(b.container,function(V){null!=ia&&window.clearTimeout(ia)},null,function(V){1!=b.cumulativeZoomFactor&&S(0)});mxEvent.addListener(b.container,"scroll",function(V){null==ia||b.isMouseDown||1==b.cumulativeZoomFactor||S(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this, function(V,Z,ba,ha,na){b.fireEvent(new mxEventObject("wheel"));if(null==b.freehand||!b.freehand.isDrawing())if(Editor.passiveScroll&&!ba&&b.isScrollWheelEvent(V))null!=window.parent&&window.parent!=window&&window.parent.postMessage(JSON.stringify({event:"scrollWheel",deltaX:null!=V.deltaX?V.deltaX:0,deltaY:null!=V.deltaY?V.deltaY:Z?-60:60}),"*");else if(null==this.dialogs||0==this.dialogs.length)if(!b.scrollbars&&!ba&&b.isScrollWheelEvent(V))ha=b.view.getTranslate(),na=40/b.view.scale,mxEvent.isShiftDown(V)? b.view.setTranslate(ha.x+(Z?-na:na),ha.y):b.view.setTranslate(ha.x,ha.y+(Z?na:-na));else if(ba||b.isZoomWheelEvent(V))for(var oa=mxEvent.getSource(V);null!=oa;){if(oa==b.container){b.tooltipHandler.hideTooltip();ha=null!=ha&&null!=na?new mxPoint(ha,na):new mxPoint(mxEvent.getClientX(V),mxEvent.getClientY(V));na=null!=l?new mxPoint(l.x,l.y):null;oa=b.cumulativeZoomFactor;l=ha;H=ba;ba=b.zoomFactor;var fa=!1,qa=null;V.ctrlKey&&null!=V.deltaY&&40>Math.abs(V.deltaY)&&Math.round(V.deltaY)!=V.deltaY?(ba= 1+Math.abs(V.deltaY)/20*(ba-1),fa=!0):null!=V.movementY&&"pointermove"==V.type&&(ba=1+Math.max(1,Math.abs(V.movementY))/20*(ba-1),fa=!0,qa=-1);b.lazyZoom(Z,null,qa,ba,fa);null!=na&&1!=oa&&b.isFastZoomEnabled()&&b.scrollbars&&(Z=b.cumulativeZoomFactor,ba=Z/oa,fa=1-Z,.001<Math.abs(fa)&&(l=new mxPoint((ha.x*(1-ba)+ba*na.x*(1-oa))/fa,(ha.y*(1-ba)+ba*na.y*(1-oa))/fa),ha=l.x+b.container.scrollLeft-b.container.offsetLeft,na=l.y+b.container.scrollTop-b.container.offsetTop,Ba.style.transformOrigin=ha+"px "+ na+"px",ua.style.transformOrigin=ha+"px "+na+"px",null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(Z=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(Z.style,"transform-origin",l.x+b.container.scrollLeft-Z.offsetLeft-b.container.offsetLeft+"px "+(l.y+b.container.scrollTop-Z.offsetTop-b.container.offsetTop)+"px")):b.view.validateBackgroundStyles(Math.round(Math.round(b.view.scale*Z*100)/100*20)/(20*b.view.scale),ha,na)));mxEvent.consume(V);return!1}oa=oa.parentNode}}), b.container);b.panningHandler.zoomGraph=function(V){b.cumulativeZoomFactor=V.scale;b.lazyZoom(1<V.scale,!0,null,1,!0);mxEvent.consume(V)}};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, "transition",null);this.refresh(!0);this.fireEvent(new mxEventObject("formatWidthChanged"))}),1E3*d)},0))}};EditorUi.prototype.isFormatPanelVisible=function(){return 0<this.formatWidth};EditorUi.prototype.lightboxFit=function(b){if(this.isDiagramEmpty())this.editor.graph.view.setScale(1);else{var d=urlParams.border,m=60;null!=d&&(m=parseInt(d));this.editor.graph.maxFitScale=this.lightboxMaxFitScale;this.editor.graph.fit(m,null,null,null,null,null,b);this.editor.graph.maxFitScale=null}}; EditorUi.prototype.isDiagramEmpty=function(){var b=this.editor.graph.getModel();return 1==b.getChildCount(b.root)&&0==b.getChildCount(b.getChildAt(b.root,0))};EditorUi.prototype.isSelectionAllowed=function(b){return"SELECT"==mxEvent.getSource(b).nodeName||"INPUT"==mxEvent.getSource(b).nodeName};EditorUi.prototype.addBeforeUnloadListener=function(){window.onbeforeunload=mxUtils.bind(this,function(){if(!this.editor.isChromelessView())return this.onBeforeUnload()})}; EditorUi.prototype.onBeforeUnload=function(){if(this.editor.modified)return mxResources.get("allChangesLost")}; EditorUi.prototype.open=function(){try{null!=window.opener&&null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(b,d){try{var m=mxUtils.parseXml(b);this.editor.setGraphXml(m.documentElement);this.editor.setModified(!1);this.editor.undoManager.clear();null!=d&&(this.editor.setFilename(d),this.updateDocumentTitle())}catch(p){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+p.message)}}))}catch(b){}this.editor.graph.view.validate();this.editor.graph.sizeDidChange(); this.editor.fireEvent(new mxEventObject("resetGraphView"))};EditorUi.prototype.showPrintDialog=function(b,d){this.showDialog((new PrintDialog(this,b,d)).container,300,180,!0,!0)};EditorUi.prototype.showPopupMenu=function(b,d,m,p){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);t.destroy()});t.popup(d,m,null,p);this.setCurrentMenu(t)}; EditorUi.prototype.isHideCurrentMenuEvent=function(b){b=mxEvent.getSource(b);if(null!=this.currentMenu){if(b==this.currentMenu.div)return!1;for(var d=this.currentMenu.activeRow;null!=d;){if(b==d.div)return!1;d=d.activeRow}return!0}return!1};EditorUi.prototype.setCurrentMenu=function(b,d){this.currentMenuElt=d;this.currentMenu=b;this.hideShapePicker()};EditorUi.prototype.resetCurrentMenu=function(){this.currentMenu=this.currentMenuElt=null}; EditorUi.prototype.hideCurrentMenu=function(){null!=this.currentMenu&&(this.currentMenu.hideMenu(),this.resetCurrentMenu())};EditorUi.prototype.updateDocumentTitle=function(){var b=this.editor.getOrCreateFilename();null!=this.editor.appName&&(b+=" - "+this.editor.appName);document.title=b};EditorUi.prototype.createHoverIcons=function(){return new HoverIcons(this.editor.graph)};EditorUi.prototype.createInlineToolbar=function(){return null}; EditorUi.prototype.redo=function(){try{this.editor.graph.isEditing()?document.execCommand("redo",!1,null):this.editor.undoManager.redo()}catch(b){}};EditorUi.prototype.undo=function(){try{var b=this.editor.graph;if(b.isEditing()){var d=b.cellEditor.textarea.innerHTML;document.execCommand("undo",!1,null);d==b.cellEditor.textarea.innerHTML&&(b.stopEditing(!0),this.editor.undoManager.undo())}else this.editor.undoManager.undo()}catch(m){}}; EditorUi.prototype.canRedo=function(){return this.editor.graph.isEditing()||this.editor.undoManager.canRedo()};EditorUi.prototype.canUndo=function(){return this.editor.graph.isEditing()||this.editor.undoManager.canUndo()};EditorUi.prototype.getDiagramSnapshot=function(){return{node:this.editor.getGraphXml()}};EditorUi.prototype.updateDiagramData=function(b,d){this.replaceDiagramData(xUtils.getXml(d))};EditorUi.prototype.replaceDiagramData=function(b){this.editor.graph.model.beginUpdate();try{this.editor.setGraphXml(mxUtils.parseXml(b).documentElement)}finally{this.editor.graph.model.endUpdate()}}; EditorUi.prototype.getEditBlankXml=function(){return mxUtils.getXml(this.editor.getGraphXml())};EditorUi.prototype.getUrl=function(b){b=null!=b?b:window.location.pathname;var d=0<b.indexOf("?")?1:0,m;for(m in urlParams)b=0==d?b+"?":b+"&",b+=m+"="+urlParams[m],d++;return b}; EditorUi.prototype.setScrollbars=function(b){var d=this.editor.graph,m=d.container.style.overflow;d.scrollbars=b;this.editor.updateGraphComponents();m!=d.container.style.overflow&&(d.container.scrollTop=0,d.container.scrollLeft=0,d.view.scaleAndTranslate(1,0,0),this.resetScrollbars());this.fireEvent(new mxEventObject("scrollbarsChanged"))}; EditorUi.prototype.initialFitDiagram=function(b){var d=null!=urlParams.border?parseInt(urlParams.border):10;d=new mxRectangle(d,d,d,d);this.fitDiagramOrPages(null!=b?b:1,d,!0)};EditorUi.prototype.fitDiagramOrPages=function(b,d,m){var p=this.editor.graph;p.pageVisible&&p.isSelectionEmpty()&&!m?p.fitPages(b):this.fitDiagramToWindow(b,d,m)}; EditorUi.prototype.fitDiagramToWindow=function(b,d,m){var p=this.editor.graph,t=p.isSelectionEmpty()?mxRectangle.fromRectangle(p.getGraphBounds()):p.getBoundingBox(p.getSelectionCells());if(null!=t){var n=p.view.translate,z=p.view.scale;t.x=t.x/z-n.x;t.y=t.y/z-n.y;t.width/=z;t.height/=z;null!=p.backgroundImage&&t.add(new mxRectangle(0,0,p.backgroundImage.width,p.backgroundImage.height));0==t.width||0==t.height?(p.zoomTo(1),this.resetScrollbars()):(d=null!=d?d:Editor.fitWindowBorders,null!=d&&(t.x-= d.x,t.y-=d.y,t.width+=d.width+d.x,t.height+=d.height+d.y),p.fitWindow(t,null,b,m,m))}};EditorUi.prototype.hasScrollbars=function(){return this.editor.graph.scrollbars}; EditorUi.prototype.resetScrollbars=function(){var b=this.editor.graph,d=b.container;if(!this.editor.extendCanvas)d.scrollTop=0,d.scrollLeft=0,mxUtils.hasScrollbars(d)||b.view.setTranslate(0,0);else if(!this.editor.isChromelessView())if(mxUtils.hasScrollbars(d))if(b.pageVisible){var m=b.getPagePadding();d.scrollTop=Math.floor(m.y);d.scrollLeft=Math.floor(Math.min(m.x,(d.scrollWidth-d.clientWidth)/2));m=b.getGraphBounds();0<m.width&&0<m.height&&(m.x>d.scrollLeft+.9*d.clientWidth&&(d.scrollLeft=Math.min(m.x+ m.width-d.clientWidth,m.x-10)),m.y>d.scrollTop+.9*d.clientHeight&&(d.scrollTop=Math.min(m.y+m.height-d.clientHeight,m.y-10)))}else if(m=b.getGraphBounds(),0==m.width&&0==m.height)d.scrollLeft=(d.scrollWidth-d.clientWidth)/2,d.scrollTop=(d.scrollHeight-d.clientHeight)/2;else{var p=Math.max(m.height,b.scrollTileSize.height*b.view.scale);d.scrollLeft=Math.floor(Math.max(0,m.x-Math.max(0,(d.clientWidth-Math.max(m.width,b.scrollTileSize.width*b.view.scale))/2)));d.scrollTop=Math.floor(Math.max(0,m.y-Math.max(20, (d.clientHeight-p)/4)))}else{m=mxRectangle.fromRectangle(b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds());p=b.view.translate;var t=b.view.scale;m.x=m.x/t-p.x;m.y=m.y/t-p.y;m.width/=t;m.height/=t;p=b.pageVisible?0:Math.max(0,(d.clientHeight-m.height)/4);"1"==urlParams.embedInline?b.view.setTranslate(Math.floor(-m.x+2),Math.floor(p-m.y+1)):b.view.setTranslate(Math.floor(Math.max(0,(d.clientWidth-m.width)/2)-m.x+2),Math.floor(p-m.y+1))}}; EditorUi.prototype.setPageVisible=function(b){var d=this.editor.graph,m=mxUtils.hasScrollbars(d.container),p=0,t=0;m&&(p=d.view.translate.x*d.view.scale-d.container.scrollLeft,t=d.view.translate.y*d.view.scale-d.container.scrollTop);d.pageVisible=b;d.pageBreaksVisible=b;d.preferPageSize=b;d.view.validateBackground();if(m){var n=d.getSelectionCells();d.clearSelection();d.setSelectionCells(n)}d.sizeDidChange();m&&(d.container.scrollLeft=d.view.translate.x*d.view.scale-p,d.container.scrollTop=d.view.translate.y* d.view.scale-t);d.defaultPageVisible=b;this.fireEvent(new mxEventObject("pageViewChanged"))}; EditorUi.prototype.installResizeHandler=function(b,d,m){d&&(b.window.setSize=function(t,n){if(!this.minimized){var z=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,D=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,N=this.getX(),F=this.getY(),P=N+t>z?Math.max(0,z-t):N,T=F+n>D?Math.max(0,D-n):F;P==N&&T==F||mxWindow.prototype.setLocation.call(this,P,T);t=Math.min(t,z);n=Math.min(n,D)}mxWindow.prototype.setSize.apply(this,arguments)}); b.window.setLocation=function(t,n){if(null!=this.div){var z=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,D=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,N=parseInt(this.div.style.width),F=parseInt(this.div.style.height);t=Math.max(0,Math.min(t,Math.max(0,z-N)));n=Math.max(0,Math.min(n,Math.max(0,D-F)));this.getX()==t&&this.getY()==n||mxWindow.prototype.setLocation.apply(this,arguments);d&&!this.minimized&&(z=Math.min(N, z),D=Math.min(F,D),z==N&&D==F||this.setSize(z,D))}};var p=mxUtils.bind(this,function(){var t=b.window.getX(),n=b.window.getY();b.window.setLocation(t,n)});mxEvent.addListener(window,"resize",p);b.destroy=function(){mxEvent.removeListener(window,"resize",p);b.window.destroy();null!=m&&m()}};function ChangeGridColor(b,d){this.ui=b;this.color=d}ChangeGridColor.prototype.execute=function(){var b=this.ui.editor.graph.view.gridColor;this.ui.setGridColor(this.color);this.color=b}; function ChangePageSetup(b,d,m,p,t){this.ui=b;this.previousColor=this.color=d;this.previousImage=this.image=m;this.previousFormat=this.format=p;this.previousPageScale=this.pageScale=t;this.ignoreImage=this.ignoreColor=!1} ChangePageSetup.prototype.execute=function(){var b=this.ui.editor.graph;if(!this.ignoreColor){this.color=this.previousColor;var d=b.background;this.ui.setBackgroundColor(this.previousColor);this.previousColor=d}if(!this.ignoreImage){this.image=this.previousImage;d=b.backgroundImage;var m=this.previousImage;null!=m&&Graph.isPageLink(m.src)&&(m=this.ui.createImageForPageLink(m.src,this.ui.currentPage));this.ui.setBackgroundImage(m);this.previousImage=d}null!=this.previousFormat&&(this.format=this.previousFormat, d=b.pageFormat,this.previousFormat.width!=d.width||this.previousFormat.height!=d.height)&&(this.ui.setPageFormat(this.previousFormat),this.previousFormat=d);null!=this.foldingEnabled&&this.foldingEnabled!=this.ui.editor.graph.foldingEnabled&&(this.ui.setFoldingEnabled(this.foldingEnabled),this.foldingEnabled=!this.foldingEnabled);null!=this.previousPageScale&&(b=this.ui.editor.graph.pageScale,this.previousPageScale!=b&&(this.ui.setPageScale(this.previousPageScale),this.previousPageScale=b))}; EditorUi.prototype.setBackgroundColor=function(b){this.editor.graph.background=b;this.editor.graph.view.validateBackground();this.fireEvent(new mxEventObject("backgroundColorChanged"))};EditorUi.prototype.setFoldingEnabled=function(b){this.editor.graph.foldingEnabled=b;this.editor.graph.view.revalidate();this.fireEvent(new mxEventObject("foldingEnabledChanged"))}; EditorUi.prototype.setPageFormat=function(b,d){d=null!=d?d:"1"==urlParams.sketch;this.editor.graph.pageFormat=b;d||(this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct());this.fireEvent(new mxEventObject("pageFormatChanged"))}; EditorUi.prototype.setPageScale=function(b){this.editor.graph.pageScale=b;this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct();this.fireEvent(new mxEventObject("pageScaleChanged"))}; EditorUi.prototype.setGridColor=function(b,d){d=null!=d?d:Editor.isDarkMode();var m=this.editor.graph;d?m.view.defaultDarkGridColor=b:m.view.defaultGridColor=b;m.view.gridColor="light-dark("+m.view.defaultGridColor+", "+m.view.defaultDarkGridColor+")";m.view.validateBackground();this.fireEvent(new mxEventObject("gridColorChanged"))}; EditorUi.prototype.addUndoListener=function(){var b=this.editor.undoManager,d=mxUtils.bind(this,function(){this.updateActionStates()});b.addListener(mxEvent.ADD,d);b.addListener(mxEvent.UNDO,d);b.addListener(mxEvent.REDO,d);b.addListener(mxEvent.CLEAR,d);var m=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){m.apply(this,arguments);d()};var p=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(t,n){p.apply(this,arguments); d()};d()}; EditorUi.prototype.updateActionStates=function(){for(var b=this.editor.graph,d=this.getSelectionState(),m=b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()),p=!this.editor.chromeless||this.editor.editable,t="cut copy bold italic underline delete duplicate editStyle editTooltip editLink backgroundColor borderColor edit toFront toBack solid dashed pasteSize dotted fillColor gradientColor shadow fontColor formattedText rounded toggleRounded strokeColor sharp snapToGrid".split(" "),n=0;n<t.length;n++)this.actions.get(t[n]).setEnabled(0< d.cells.length);this.actions.get("grid").setEnabled(p);this.actions.get("undo").setEnabled(this.canUndo()&&p);this.actions.get("redo").setEnabled(this.canRedo()&&p);this.actions.get("swap").setEnabled(2==d.cells.length&&2==d.vertices.length);this.actions.get("pasteSize").setEnabled(null!=this.copiedSize&&0<d.vertices.length);this.actions.get("pasteData").setEnabled(null!=this.copiedValue&&0<d.cells.length);this.actions.get("setAsDefaultStyle").setEnabled(1==b.getSelectionCount());this.actions.get("lockUnlock").setEnabled(!b.isSelectionEmpty()); this.actions.get("bringForward").setEnabled(1==d.cells.length);this.actions.get("sendBackward").setEnabled(1==d.cells.length);n="alignCellsLeft alignCellsCenter alignCellsRight alignCellsTop alignCellsMiddle alignCellsBottom distributeHorizontal distributeVertical".split(" ");for(p=0;p<n.length;p++)this.actions.get(n[p]).setEnabled(d.unlocked&&1<d.vertices.length);this.actions.get("rotation").setEnabled(1==d.vertices.length);this.actions.get("wordWrap").setEnabled(1==d.vertices.length);this.actions.get("autosize").setEnabled(0< d.vertices.length);this.actions.get("copySize").setEnabled(1==d.vertices.length);this.actions.get("clearWaypoints").setEnabled(d.connections);this.actions.get("clearAnchors").setEnabled(d.connections);this.actions.get("curved").setEnabled(0<d.edges.length);this.actions.get("turn").setEnabled(0<d.cells.length);this.actions.get("group").setEnabled(1<d.cells.length||1==d.vertices.length&&0==b.model.getChildCount(d.cells[0])&&!b.isContainer(d.vertices[0]));this.actions.get("ungroup").setEnabled(!d.row&& !d.cell&&!d.table&&0<d.vertices.length&&(b.isContainer(d.vertices[0])||0<b.getModel().getChildCount(d.vertices[0])));this.actions.get("removeFromGroup").setEnabled(1==d.cells.length&&b.getModel().isVertex(b.getModel().getParent(d.cells[0])));this.actions.get("collapsible").setEnabled(1==d.vertices.length&&(0<b.model.getChildCount(d.vertices[0])||b.isContainer(d.vertices[0])));this.actions.get("exitGroup").setEnabled(null!=b.view.currentRoot);this.actions.get("home").setEnabled(null!=b.view.currentRoot); this.actions.get("enterGroup").setEnabled(1==d.cells.length&&b.isValidRoot(d.cells[0]));this.actions.get("copyData").setEnabled(1==d.cells.length);this.actions.get("copyAsText").setEnabled(1==d.cells.length);this.actions.get("editLink").setEnabled(1==d.cells.length);this.actions.get("editStyle").setEnabled(0<d.cells.length);this.actions.get("editTooltip").setEnabled(1==d.cells.length);this.actions.get("editNote").setEnabled(1==d.cells.length);this.actions.get("openLink").setEnabled(1==d.cells.length&& null!=b.getLinkForCell(d.cells[0]));this.actions.get("guides").setEnabled(b.isEnabled());this.actions.get("selectVertices").setEnabled(m);this.actions.get("selectEdges").setEnabled(m);this.actions.get("selectAll").setEnabled(m);this.actions.get("selectNone").setEnabled(m);p=!1;for(n=0;n<d.vertices.length;n++)if(b.isCellFoldable(d.vertices[n])){p=!0;break}this.actions.get("expand").setEnabled(p);this.actions.get("collapse").setEnabled(p);this.menus.get("navigation").setEnabled(0<d.cells.length||null!= b.view.currentRoot);this.menus.get("layout").setEnabled(m);this.menus.get("insert").setEnabled(m);this.menus.get("direction").setEnabled(d.unlocked&&1==d.vertices.length);this.menus.get("distribute").setEnabled(d.unlocked&&1<d.vertices.length);this.menus.get("align").setEnabled(d.unlocked&&0<d.cells.length);this.updatePasteActionStates()};EditorUi.prototype.zeroOffset=new mxPoint(0,0);EditorUi.prototype.getDiagramContainerOffset=function(){return this.zeroOffset}; EditorUi.prototype.refresh=function(b){var d=this.sidebarContainer.style.width,m=this.formatContainer.style.width;this.sidebarContainer.style.width=this.hsplitPosition+"px";this.formatContainer.style.width=null!=this.format&&0<this.formatWidth?"":"0";(b||d!=this.sidebarContainer.style.width||m!=this.formatContainer.style.width)&&this.editor.graph.sizeDidChange()};EditorUi.prototype.createTabContainer=function(){return null}; EditorUi.prototype.createDivs=function(){this.menubarContainer=this.createDiv("geMenubarContainer");this.toolbarContainer=this.createDiv("geToolbarContainer");this.sidebarContainer=this.createDiv("geSidebarContainer");this.formatContainer=this.createDiv("geSidebarContainer geFormatContainer");this.diagramContainer=this.createDiv("geDiagramContainer");this.hsplit=this.createDiv("geHsplit");this.editor.chromeless||(this.tabContainer=this.createTabContainer())}; EditorUi.prototype.createSidebarContainer=function(){var b=document.createElement("div");b.className="geSidebarContainer";return b}; EditorUi.prototype.createUi=function(){this.statusContainer=this.createStatusContainer();this.menubar=this.editor.chromeless?null:this.menus.createMenubar(this.createDiv("geMenubar"));null!=this.menubar&&this.menubarContainer.appendChild(this.menubar.container);null!=this.menubar&&(this.editor.addListener("statusChanged",mxUtils.bind(this,function(){this.setStatusText(this.editor.getStatus())})),this.setStatusText(this.editor.getStatus()),this.menubar.container.appendChild(this.statusContainer),this.container.appendChild(this.menubarContainer)); this.sidebar=this.editor.chromeless?null:this.createSidebar(this.sidebarContainer);null!=this.sidebar&&this.container.appendChild(this.sidebarContainer);this.format=this.editor.chromeless?null:this.createFormat(this.formatContainer);null!=this.format&&this.container.appendChild(this.formatContainer);this.container.appendChild(this.diagramContainer);null!=this.container&&null!=this.tabContainer&&this.container.appendChild(this.tabContainer);this.toolbar=this.editor.chromeless?null:this.createToolbar(this.createDiv("geToolbar")); null!=this.toolbar&&(this.toolbarContainer.appendChild(this.toolbar.container),this.container.appendChild(this.toolbarContainer));null!=this.sidebar&&(this.container.appendChild(this.hsplit),this.addSplitHandler(this.hsplit,!0,0,mxUtils.bind(this,function(b){this.hsplitPosition=b;this.refresh();this.fireEvent(new mxEventObject("sidebarWidthChanged"))})))}; EditorUi.prototype.createStatusContainer=function(){var b=document.createElement("a");b.className="geStatus";mxEvent.addListener(b,"click",mxUtils.bind(this,function(d){var m=mxEvent.getSource(d);if(m!=b)for(;m.parentNode!=b;)m=m.parentNode;if("A"!=m.nodeName){var p=m.getAttribute("data-action");if("statusFunction"==p&&null!=this.editor.statusFunction)this.editor.statusFunction();else if(null!=p)m=this.actions.get(p),null!=m&&m.funct();else{p=m.getAttribute("data-title");var t=m.getAttribute("data-message"); null!=p&&null!=t?this.showError(p,t):(m=m.getAttribute("data-link"),null!=m&&this.editor.graph.openLink(m))}mxEvent.consume(d)}}));return b}; EditorUi.prototype.setStatusText=function(b){this.statusContainer.innerHTML=Graph.sanitizeHtml(b);0==this.statusContainer.getElementsByTagName("div").length&&null!=b&&0<b.length&&(this.statusContainer.innerText="",b=this.createStatusDiv(b),this.statusContainer.appendChild(b));b=this.statusContainer.querySelectorAll('[data-effect="fade"]');if(null!=b)for(var d=0;d<b.length;d++)(function(m){mxUtils.setOpacity(m,0);mxUtils.setPrefixedStyle(m.style,"transform","scaleX(0)");mxUtils.setPrefixedStyle(m.style, "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.getCollapsedSections=function(){return{}};EditorUi.prototype.createDiv=function(b){var d=document.createElement("div");d.className=b;return d}; EditorUi.prototype.addSplitHandler=function(b,d,m,p){function t(T){if(null!=z){var c=new mxPoint(mxEvent.getClientX(T),mxEvent.getClientY(T));p(Math.max(0,D+(d?c.x-z.x:z.y-c.y)-m));mxEvent.consume(T);D!=P()&&(N=!0,F=null)}}function n(T){t(T);z=D=null}var z=null,D=null,N=!0,F=null;mxClient.IS_POINTER&&(b.style.touchAction="none");var P=mxUtils.bind(this,function(){var T=parseInt(d?b.offsetLeft:b.offsetTop);d||(T+=m);return T});mxEvent.addGestureListeners(b,function(T){z=new mxPoint(mxEvent.getClientX(T), mxEvent.getClientY(T));D=P();N=!1;mxEvent.consume(T)});mxEvent.addListener(b,"click",mxUtils.bind(this,function(T){if(!N&&this.hsplitClickEnabled){var c=null!=F?F-m:0;F=P();p(c);mxEvent.consume(T)}}));mxEvent.addGestureListeners(document,null,t,n);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,t,n)})}; EditorUi.prototype.prompt=function(b,d,m,p){b=new FilenameDialog(this,d,mxResources.get("apply"),function(t){m(p?t:parseFloat(t))},b);this.showDialog(b.container,300,80,!0,!0);b.init()}; EditorUi.prototype.handleError=function(b,d,m,p,t){b=null!=b&&null!=b.error?b.error:b;if(null!=b||null!=d){t=mxUtils.htmlEntities(mxResources.get("unknownError"));var n=mxResources.get("ok");d=null!=d?d:mxResources.get("error");null!=b&&null!=b.message&&(t=mxUtils.htmlEntities(b.message));this.showError(d,t,n,m,null,null,null,null,null,null,null,null,p?m:null)}else null!=m&&m()}; EditorUi.prototype.showError=function(b,d,m,p,t,n,z,D,N,F,P,T,c){b=new ErrorDialog(this,b,d,m||mxResources.get("ok"),p,t,n,z,T,D,N);this.showDialog(b.container,F||340,P,!0,!1,c);null==P&&null!=this.dialog&&null!=this.dialog.container&&(this.dialog.container.style.height=this.dialog.container.offsetHeight+16+"px");b.init()}; EditorUi.prototype.showDialog=function(b,d,m,p,t,n,z,D,N,F,P){this.editor.graph.tooltipHandler.resetTimer();this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,b,d,m,p,t,n,z,D,N,F);this.dialogs.push(this.dialog);null!=P&&null!=N&&"undefined"!==typeof mxSettings&&null!=mxSettings.getWindowState&&(b=mxSettings.getWindowState(P),null!=b&&null!=b.w&&null!=b.h&&(this.dialog.container.style.width=Math.max(N.width,b.w)+"px",this.dialog.container.style.height= Math.max(N.height,b.h)+"px"),this.dialog.onResize=function(T,c){mxSettings.setWindowState(P,{w:T,h:c});mxSettings.save()})}; EditorUi.prototype.hideDialog=function(b,d,m){var p=null;if(null!=this.dialogs&&0<this.dialogs.length)for(var t=this.dialogs.length-1;0<=t;t--)if(!this.dialogs[t].closing){p=this.dialogs[t];break}null==p||null!=m&&m!=this.dialog.container.firstChild||(p.closing=!0,0==p.close(b,d)?delete p.closing:(delete p.closing,b=mxUtils.lastIndexOf(this.dialogs,p),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",p)),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,p=[],t=0;t<d.length;t++){var n=b.isTableCell(d[t])?b.model.getParent(d[t]):d[t];null==n||m.get(n)||(m.put(n,!0),p.push(n))}b.setSelectionCells(b.duplicateCells(p,!1))}catch(z){this.handleError(z)}}; EditorUi.prototype.pickColor=function(b,d,m,p,t,n,z,D){if(null!=this.dialog&&null!=this.dialog.bg&&null!=this.dialog.bg.parentNode)this.pickColorModal(b,d,m,p,t,n,null,D);else{var N=this.editor.graph,F=N.cellEditor.saveSelection(),P=this;if(null==this.colorWindow){var T=null!=this.installWindowPersistence?mxSettings.getWindowState("colorPicker"):null;this.colorWindow=new ColorWindow(this,null!=T&&null!=T.x?T.x:document.body.offsetWidth-280,null!=T&&null!=T.y?T.y:100,null!=T&&null!=T.w?T.w:260);null!= this.installWindowPersistence&&(this.installWindowPersistence("colorPicker",this.colorWindow),null!=T&&this.restoreWindowState("colorPicker",this.colorWindow))}this.colorWindow.update(b,function(c){N.cellEditor.restoreSelection(F);null!=P.colorWindow&&(P.colorWindow.applying=!0);d(c);null!=P.colorWindow&&(P.colorWindow.applying=!1)},n||mxResources.get("fillColor"),m,p,t,z,D)}}; EditorUi.prototype.pickColorModal=function(b,d,m,p,t,n,z,D){var N=this.editor.graph,F=N.cellEditor.saveSelection(),P=new ColorDialog(this,b,function(c){N.cellEditor.restoreSelection(F);null!=d&&d(c)},function(){N.cellEditor.restoreSelection(F);null!=z&&z()},m,p,t,null,D);null!=n&&(b=document.createElement("div"),b.style.cssText="width:100%;text-align:center;font-weight:bold;margin-bottom:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis",mxUtils.write(b,n),P.container.insertBefore(b, P.container.firstChild));this.showDialog(P.container,250,null,!0,!1);var T=this.dialog.container;P.resizeFn=function(){T.style.height=P.container.scrollHeight+48+"px"};P.init()};EditorUi.prototype.openFile=function(){window.openFile=new OpenFile(mxUtils.bind(this,function(b){this.hideDialog(b)}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:320,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null})}; EditorUi.prototype.base64ToBlob=function(b,d){d=d||"";b=atob(b);for(var m=b.length,p=Math.ceil(m/1024),t=Array(p),n=0;n<p;++n){for(var z=1024*n,D=Math.min(z+1024,m),N=Array(D-z),F=0;z<D;++F,++z)N[F]=b[z].charCodeAt(0);t[n]=new Uint8Array(N)}return new Blob(t,{type:d})}; EditorUi.prototype.extractGraphModelFromHtml=function(b){var d=null;try{var m=b.indexOf("<mxGraphModel ");if(0<=m){var p=b.lastIndexOf("</mxGraphModel>");p>m&&(d=b.substring(m,p+21).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}}catch(t){}return d}; EditorUi.prototype.extractGraphModelFromEvent=function(b){var d=null,m=null;null!=b&&(b=null!=b.dataTransfer?b.dataTransfer:b.clipboardData,null!=b&&(m=0<=mxUtils.indexOf(b.types,"text/html")?b.getData("text/html"):null,0<=mxUtils.indexOf(b.types,"text/plain")&&(null==m||0==m.length)&&(m=b.getData("text/plain")),null!=m&&(m=Graph.zapGremlins(mxUtils.trim(m)),b=this.extractGraphModelFromHtml(m),null!=b&&(m=b))));null!=m&&this.isCompatibleString(m)&&(d=m);return d}; EditorUi.prototype.isCompatibleString=function(b){return!1};EditorUi.prototype.saveFile=function(b){b||null==this.editor.filename?(b=new FilenameDialog(this,this.editor.getOrCreateFilename(),mxResources.get("save"),mxUtils.bind(this,function(d){this.save(d)}),null,mxUtils.bind(this,function(d){if(null!=d&&0<d.length)return!0;mxUtils.confirm(mxResources.get("invalidName"));return!1})),this.showDialog(b.container,340,96,!0,!0),b.init()):this.save(this.editor.getOrCreateFilename())}; EditorUi.prototype.save=function(b){if(null!=b){this.editor.graph.isEditing()&&this.editor.graph.stopEditing();var d=mxUtils.getXml(this.editor.getGraphXml());try{if(Editor.useLocalStorage){if(null!=localStorage.getItem(b)&&!mxUtils.confirm(mxResources.get("replaceIt",[b])))return;localStorage.setItem(b,d);this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("saved"))+" "+new Date)}))}else if(d.length<MAX_REQUEST_SIZE)(new mxXmlRequest(SAVE_URL, "filename="+encodeURIComponent(b)+"&xml="+encodeURIComponent(d))).simulate(document,"_blank");else{mxUtils.alert(mxResources.get("drawingTooLarge"));mxUtils.popup(d);return}this.editor.setModified(!1);this.editor.setFilename(b);this.updateDocumentTitle()}catch(m){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("errorSavingFile")))}))}}}; EditorUi.prototype.executeLayouts=function(b,d){for(var m=!1,p=0;p<b.length;p++)if("function"===typeof b[p].prepare){m=!0;break}if(m){var t=this,n=this.editor.graph.getDefaultParent(),z=0,D=function(){if(z>=b.length)null!=d&&d();else{var N=b[z++];"function"===typeof N.prepare?N.prepare(n,function(F,P){null!=F?t.handleError(F):t.executeLayout(P,!0,D)}):t.executeLayout(function(){N.execute(n)},!0,D)}};D()}else this.executeLayout(mxUtils.bind(this,function(){var N=new mxCompositeLayout(this.editor.graph, b),F=this.editor.graph.getSelectionCells();N.execute(this.editor.graph.getDefaultParent(),0==F.length?null:F)}),!0,d)};EditorUi.prototype.executeLayout=function(b,d,m){var p=this.editor.graph;p.getModel().beginUpdate();try{b()}catch(t){throw t;}finally{this.allowAnimation&&d&&p.isEnabled()?(b=new mxMorphing(p),b.addListener(mxEvent.DONE,mxUtils.bind(this,function(){p.getModel().endUpdate();null!=m&&m()})),b.startAnimation()):(p.getModel().endUpdate(),null!=m&&m())}}; EditorUi.prototype.showImageDialog=function(b,d,m,p){p=this.editor.graph.cellEditor;var t=p.saveSelection(),n=mxUtils.prompt(b,d);p.restoreSelection(t);if(null!=n&&0<n.length){var z=new Image;z.onload=function(){m(n,z.width,z.height)};z.onerror=function(){m(null);mxUtils.alert(mxResources.get("fileNotFound"))};z.src=n}else m(null)};EditorUi.prototype.showLinkDialog=function(b,d,m){b=new LinkDialog(this,b,d,m);this.showDialog(b.container,420,null,!0,!0);b.init()}; EditorUi.prototype.showDataDialog=function(b){b instanceof Array&&(b=1<b.length?b:b[0]);null!=b&&"undefined"!==typeof window.EditDataDialog&&(b=new EditDataDialog(this,b),this.showDialog(b.container,480,420,!0,!1,null,!1,null,new mxRectangle(0,0,440,340),null,"editData"),b.init())}; EditorUi.prototype.showBackgroundImageDialog=function(b,d){b=null!=b?b:mxUtils.bind(this,function(p){p=new ChangePageSetup(this,null,p);p.ignoreColor=!0;this.editor.graph.model.execute(p)});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",78:"editNote",86:"pasteSize",70:"copySize",66:"copyData",69:"pasteData"};EditorUi.prototype.ctrlAltShiftActions={70:"bringForward",66:"sendBackward",88:"copyAsSvg"};EditorUi.prototype.ctrlAltActions={88:"copyAsImage"};EditorUi.prototype.altActions={}; EditorUi.prototype.createKeyHandler=function(b){function d(){null!=D&&(window.clearTimeout(D),D=null);var f=t.graphHandler;if(null!=f&&null!=f.first){var k=t.getView().scale,q=f.roundLength(f.currentDx/k);k=f.roundLength(f.currentDy/k);f.moveCells(f.cells,q,k);f.reset()}}function m(f,k,q){if(!t.isSelectionEmpty()&&t.isEnabled()){k=null!=k?k:Editor.getCursorMoveStep(t.view.unit);var y=t.getCompositeParents(t.getSelectionCells()),A=0<y.length?y[0]:null;if(null!=A){if(q){t.getModel().beginUpdate();try{for(A= 0;A<y.length;A++)if(t.getModel().isVertex(y[A])&&t.isCellResizable(y[A])){var E=t.getCellGeometry(y[A]);null!=E&&(E=E.clone(),37==f?E.width=Math.max(0,E.width-k):38==f?E.height=Math.max(0,E.height-k):39==f?E.width+=k:40==f&&(E.height+=k),t.getModel().setGeometry(y[A],E))}}finally{t.getModel().endUpdate()}}else{q=t.model.getParent(A);E=t.getView().scale;var K=null;1==t.getSelectionCount()&&t.model.isVertex(A)&&null!=t.layoutManager&&!t.isCellLocked(A)&&(K=t.layoutManager.getLayout(q));null!=K&&K.constructor== mxStackLayout?(k=q.getIndex(A),37==f||38==f?t.model.add(q,A,Math.max(0,k-1)):(39==f||40==f)&&t.model.add(q,A,Math.min(t.model.getChildCount(q),k+1))):(q=t.graphHandler,null!=q&&(null==q.first&&q.start(A,0,0,t.getMovableCells(y)),null!=q.first&&(K=A=0,37==f?A=-k:38==f?K=-k:39==f?A=k:40==f&&(K=k),q.currentDx+=A*E,q.currentDy+=K*E,q.checkPreview(),q.updatePreview()),null!=D&&window.clearTimeout(D),D=window.setTimeout(d,400)))}A=t.graphHandler;f=t.container;k=null;null!=A&&null!=A.first?null!=A.bounds&& (k=mxRectangle.fromRectangle(A.bounds),k.x+=A.currentDx,k.y+=A.currentDy):k=t.view.getBounds(y);null!=k&&null!=f&&(k.x<f.scrollLeft||k.y<f.scrollTop||k.x+k.width>f.scrollLeft+f.clientWidth||k.y+k.height>f.scrollTop+f.clientHeight)&&(A=t.view.translate,y=new mxPoint(A.x,A.y),t.scrollRectToVisible(new mxRectangle(k.getCenterX()-A.x-f.clientWidth/2,k.getCenterY()-A.y-f.clientHeight/2,f.clientWidth,f.clientHeight))&&(f=new mxPoint(A.x,A.y),t.view.translate.x=y.x,t.view.translate.y=y.y,t.view.setTranslate(f.x, f.y)))}}}var p=this,t=this.editor.graph,n=new mxKeyHandler(t),z=n.isEventIgnored;n.isEventIgnored=function(f){return 188==f.keyCode&&this.isControlDown(f)&&!this.graph.cellEditor.isContentEditing()?!0:!(mxEvent.isShiftDown(f)&&9==f.keyCode)&&(!this.isControlDown(f)||mxEvent.isShiftDown(f)||90!=f.keyCode&&89!=f.keyCode&&188!=f.keyCode&&190!=f.keyCode&&85!=f.keyCode&&83!=f.keyCode)&&(66!=f.keyCode&&73!=f.keyCode||!this.isControlDown(f)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&& (109!=f.keyCode&&107!=f.keyCode||!this.isControlDown(f)&&!mxEvent.isShiftDown(f)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&z.apply(this,arguments)};n.isEnabledForEvent=function(f){return!mxEvent.isConsumed(f)&&this.isGraphEvent(f)&&this.isEnabled()&&(null==p.dialogs||0==p.dialogs.length)};n.isControlDown=function(f){return mxEvent.isControlDown(f)||mxClient.IS_MAC&&f.metaKey};var D=null,N=t.fireMouseEvent;t.fireMouseEvent=function(f,k,q){f==mxEvent.MOUSE_DOWN&& d();N.apply(this,arguments)};var F={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},P=n.getFunction;mxKeyHandler.prototype.getFunction=function(f){if(t.isEnabled()){var k=null;mxEvent.isShiftDown(f)&&this.isControlDown(f)&&mxEvent.isAltDown(f)?k=p.actions.get(p.ctrlAltShiftActions[f.keyCode]):mxEvent.isShiftDown(f)&&mxEvent.isAltDown(f)?k=p.actions.get(p.altShiftActions[f.keyCode]):this.isControlDown(f)&&mxEvent.isAltDown(f)? k=p.actions.get(p.ctrlAltActions[f.keyCode]):mxEvent.isAltDown(f)&&(k=p.actions.get(p.altActions[f.keyCode]));if(null!=k)return k.funct;if("/"==f.key&&!this.isControlDown(f)&&!mxEvent.isAltDown(f))return function(){var q=document.getElementById("geOmniSearch");null!=q&&30<q.clientWidth&&q.focus()};if(null!=F[f.keyCode]&&!t.isSelectionEmpty())if(!this.isControlDown(f)&&mxEvent.isShiftDown(f)&&mxEvent.isAltDown(f)){if(t.model.isVertex(t.getSelectionCell()))return function(){var q=t.connectVertex(t.getSelectionCell(), F[f.keyCode],t.defaultEdgeLength,f,!0);null!=q&&0<q.length&&(1==q.length&&t.model.isEdge(q[0])?t.setSelectionCell(t.model.getTerminal(q[0],!1)):t.setSelectionCell(q[q.length-1]),t.scrollCellToVisible(t.getSelectionCell()),null!=p.hoverIcons&&p.hoverIcons.update(t.view.getState(t.getSelectionCell())))}}else return this.isControlDown(f)?function(){m(f.keyCode,mxEvent.isShiftDown(f)?t.gridSize:null,!0)}:function(){m(f.keyCode,mxEvent.isShiftDown(f)?t.gridSize:null)}}return P.apply(this,arguments)};n.bindAction= mxUtils.bind(this,function(f,k,q,y){var A=this.actions.get(q);null!=A&&(q=function(){A.isEnabled()&&A.funct.apply(this,arguments)},k?y?n.bindControlShiftKey(f,q):n.bindControlKey(f,q):y?n.bindShiftKey(f,q):n.bindKey(f,q))});var T=this,c=n.escape;n.escape=function(f){c.apply(this,arguments)};n.enter=function(){};n.bindControlShiftKey(36,function(){t.exitGroup()});n.bindControlShiftKey(35,function(){t.enterGroup()});n.bindShiftKey(36,function(){t.home()});n.bindKey(35,function(){t.refresh()});n.bindAction(80, !0,"print");n.bindAction(107,!0,"zoomIn");n.bindAction(109,!0,"zoomOut");n.bindAction(61,!0,"zoomIn");n.bindAction(187,!0,"zoomIn");n.bindAction(222,!0,"zoomIn");n.bindAction(173,!0,"zoomOut");n.bindAction(189,!0,"zoomOut");if(!this.editor.chromeless||this.editor.editable)n.bindAction(79,!0,"outline",!0),n.bindControlKey(36,function(){t.isEnabled()&&t.foldCells(!0)}),n.bindControlKey(35,function(){t.isEnabled()&&t.foldCells(!1)}),n.bindControlKey(13,function(){T.ctrlEnter()}),n.bindAction(8,!1,"delete"), n.bindAction(8,!0,"deleteAll"),n.bindAction(8,!1,"deleteLabels",!0),n.bindAction(46,!1,"delete"),n.bindAction(46,!0,"deleteAll"),n.bindAction(46,!1,"deleteLabels",!0),n.bindAction(36,!1,"resetView"),n.bindAction(72,!0,"fitWindow",!0),n.bindAction(74,!0,"fitPage"),n.bindAction(74,!0,"fitTwoPages",!0),n.bindAction(48,!0,"customZoom"),n.bindAction(82,!0,"turn"),n.bindAction(82,!0,"clearDefaultStyle",!0),n.bindAction(83,!0,"save"),n.bindAction(83,!0,"saveAs",!0),n.bindAction(65,!0,"selectAll"),n.bindAction(65, !0,"selectNone",!0),"1"!=urlParams.dev&&n.bindAction(73,!0,"selectVertices",!0),n.bindAction(69,!0,"selectEdges",!0),n.bindAction(69,!0,"editStyle"),n.bindAction(66,!0,"bold"),n.bindAction(66,!0,"toBack",!0),n.bindAction(70,!0,"toFront",!0),n.bindAction(68,!0,"duplicate"),n.bindAction(68,!0,"setAsDefaultStyle",!0),n.bindAction(90,!0,"undo"),n.bindAction(90,!0,"redo",!0),n.bindAction(89,!0,"redo"),n.bindAction(89,!0,"autosize",!0),n.bindAction(88,!0,"cut"),n.bindAction(67,!0,"copy"),n.bindAction(86, !0,"paste"),n.bindAction(71,!0,"group"),n.bindAction(77,!0,"editData"),n.bindAction(71,!0,"grid",!0),n.bindAction(73,!0,"italic"),n.bindAction(76,!0,"lockUnlock"),n.bindAction(76,!0,"layers",!0),n.bindAction(80,!0,"format",!0),n.bindAction(85,!0,"underline"),n.bindAction(85,!0,"ungroup",!0),n.bindAction(109,!0,"decreaseFontSize",!0),n.bindAction(107,!0,"increaseFontSize",!0),n.bindAction(219,!0,"decreaseFontSize",!0),n.bindAction(221,!0,"increaseFontSize",!0),n.bindAction(190,!0,"superscript"),n.bindAction(188, !0,"subscript"),n.bindAction(13,!1,"keyPressEnter"),n.bindKey(113,function(){t.isEnabled()&&t.startEditingAtCell()});return n};EditorUi.prototype.createMenuElement=function(b,d,m){var p=document.createElement("a");this.addMenuHandler(p,d,m);mxUtils.write(p,b);p.className="geItem";return p}; EditorUi.prototype.addMenuHandler=function(b,d,m,p){if(null!=d){var t=null,n=!0,z=mxUtils.bind(this,function(D){null!=m&&m(D);if(!mxEvent.isConsumed(D)&&n&&(null==b.enabled||b.enabled)){this.editor.graph.popupMenuHandler.hideMenu();var N=new mxPopupMenu(d);N.smartSeparators=!0;N.showDisabled=!0;N.autoExpand=!0;N.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(N,arguments);this.resetCurrentMenu();t=null;N.destroy()});this.menus.autoPopup||null==this.currentMenu||this.hideCurrentMenu(); var F=mxUtils.getOffset(b);N.popup(F.x,F.y+b.offsetHeight,null,D);this.setCurrentMenu(N,b);t=N}p||mxEvent.consume(D)});mxEvent.addListener(b,"mousemove",mxUtils.bind(this,function(D){if(this.menus.autoPopup&&null!=this.currentMenu&&this.currentMenuElt!=b&&null!=this.currentMenuElt){var N=this.currentMenuElt;this.hideCurrentMenu();N.parentNode==b.parentNode&&"INPUT"!=b.nodeName&&z(D)}}));mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(D){!this.menus.autoPopup&& null!=this.currentMenu&&this.currentMenuElt!=b&&mxEvent.isMouseEvent(D)&&this.hideCurrentMenu();n=null==this.currentMenu;"INPUT"!=mxEvent.getSource(D).nodeName?D.preventDefault():D.stopPropagation()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(D){z(D);n=!0}));p&&(mxEvent.addListener(b,"focus",mxUtils.bind(this,function(D){z(D);n=!0})),mxEvent.addListener(b,"blur",mxUtils.bind(this,function(D){this.currentMenu==t&&this.hideCurrentMenu()})),mxEvent.addListener(b,"keyup",mxUtils.bind(this, function(D){38!=D.keyCode&&40!=D.keyCode&&(this.hideCurrentMenu(),13!=D.keyCode&&27!=D.keyCode&&(z(D),n=!0))})))}}; EditorUi.prototype.addShapePicker=function(b,d){var m=this.editor.graph;mxEvent.addListener(b,"click",mxUtils.bind(this,function(p){if(this.isShapePickerVisible())this.hideShapePicker();else{var t=mxUtils.getOffset(b);Editor.inlineFullscreen||null==this.embedViewport?d?(t.x-=this.diagramContainer.offsetLeft+30,t.y=b.offsetHeight-2):(t.x+=16+b.offsetHeight+this.sketchPickerMenuElt.offsetWidth/2,t.y+=20):(t.x=0,t.y=b.offsetTop);this.showShapePicker(Math.max(this.diagramContainer.scrollLeft+Math.max(24, t.x)),this.diagramContainer.scrollTop+t.y,null,null,null,null,mxUtils.bind(this,function(n){return m.getCenterInsertPoint(m.getBoundingBoxFromGeometry(n,!0))}),d,!1)}mxEvent.consume(p)}))}; EditorUi.prototype.createZoomInput=function(b){var d=document.createElement("input");d.className="geButton geZoomInput";d.style.backgroundImage="url("+Editor.thinExpandImage+")";d.setAttribute("type","text");d.setAttribute("value","100%");var m=this.menus.get("viewZoom");this.dependsOnLanguage(mxUtils.bind(this,function(){d.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)")}));(b||mxClient.IS_TOUCH)&&d.setAttribute("readonly","true");var p=!1;mxEvent.addGestureListeners(d,mxUtils.bind(this, function(t){p=!1;mxClient.IS_TOUCH||mxEvent.getSource(t)!=d||document.activeElement==d||(d.focus(),mxClient.IS_GC||mxClient.IS_FF?d.select():document.execCommand("selectAll",!1,null),p=!0)}),mxUtils.bind(this,function(t){mxEvent.getSource(t)==d&&p&&mxEvent.consume(t)}),mxUtils.bind(this,function(t){p&&(mxEvent.consume(t),p=!1)}));this.addMenuHandler(d,m.funct);mxUtils.bind(this,function(t){mxEvent.addListener(t,"click",mxUtils.bind(this,function(z){mxEvent.isAltDown(z)?(this.hideCurrentMenu(),this.actions.get("customZoom").funct(), mxEvent.consume(z)):mxEvent.isShiftDown(z)&&(this.hideCurrentMenu(),this.actions.get("smartFit").funct(),mxEvent.consume(z))}));var n=mxUtils.bind(this,function(z,D,N){d.value=Math.round(100*this.editor.graph.view.scale*(null!=N?N:1))+"%";document.activeElement==d&&this.editor.graph.container.focus()});mxEvent.addListener(d,"keydown",mxUtils.bind(this,function(z){if(27==z.keyCode||13==z.keyCode||9==z.keyCode)27==z.keyCode||isNaN(parseInt(d.value))?n():this.editor.graph.zoomTo(parseInt(d.value)/100), this.hideCurrentMenu(),mxEvent.consume(z)}));this.editor.graph.view.addListener(mxEvent.EVENT_SCALE,n);this.editor.addListener("resetGraphView",n);this.editor.addListener("pageSelected",n);mxEvent.addListener(d,"blur",n);this.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(z,D){n(z,D,D.getProperty("factor"))}))})(d);return d}; EditorUi.prototype.createHelpIcon=function(b,d){d=document.createElement("img");d.setAttribute("src",Editor.helpImage);d.setAttribute("title",mxResources.get("help")+" ("+b+")");d.className="geHelpIcon";mxEvent.addGestureListeners(d,mxUtils.bind(this,function(m){this.hideCurrentMenu();this.openLink(b);mxEvent.consume(m)}));return d}; EditorUi.prototype.destroy=function(){var b=this.editor.graph;null!=b&&null!=this.selectionStateListener&&(b.getSelectionModel().removeListener(this.selectionStateListener),b.getModel().removeListener(this.selectionStateListener),b.getView().removeListener(this.selectionStateListener),b.removeListener(this.selectionStateListener),this.selectionStateListener=null);null!=this.inlineToolbar&&(this.inlineToolbar.destroy(),this.inlineToolbar=null);null!=this.sidebar&&(this.sidebar.destroy(),this.sidebar= null);null!=this.editor&&(this.editor.destroy(),this.editor=null);null!=this.menubar&&(this.menubar.destroy(),this.menubar=null);null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null);null!=this.keyHandler&&(this.keyHandler.destroy(),this.keyHandler=null);null!=this.keydownHandler&&(mxEvent.removeListener(document,"keydown",this.keydownHandler),this.keydownHandler=null);null!=this.keyupHandler&&(mxEvent.removeListener(document,"keyup",this.keyupHandler),this.keyupHandler=null);null!=this.resizeHandler&& (mxEvent.removeListener(window,"resize",this.resizeHandler),this.resizeHandler=null);null!=this.gestureHandler&&(mxEvent.removeGestureListeners(document,this.gestureHandler),this.gestureHandler=null);null!=this.orientationChangeHandler&&(mxEvent.removeListener(window,"orientationchange",this.orientationChangeHandler),this.orientationChangeHandler=null);null!=this.scrollHandler&&(mxEvent.removeListener(window,"scroll",this.scrollHandler),this.scrollHandler=null);if(null!=this.destroyFunctions){for(b= 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=mxUtils.getSizeForString;mxUtils.getSizeForString=function(d,m,p,t){return b(Graph.sanitizeHtml(d),m,p,t)}})();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(p){return"function"===typeof p||"[object Function]"===b.call(p)},m=Math.pow(2,53)-1;return function(p){var t=Object(p);if(null==p)throw new TypeError("Array.from requires an array-like object - not null or undefined");var n=1<arguments.length?arguments[1]:void 0,z;if("undefined"!==typeof n){if(!d(n))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(z= arguments[2])}var D=Number(t.length);D=isNaN(D)?0:0!==D&&isFinite(D)?(0<D?1:-1)*Math.floor(Math.abs(D)):D;D=Math.min(Math.max(D,0),m);for(var N=d(this)?Object(new this(D)):Array(D),F=0,P;F<D;)P=t[F],N[F]=n?"undefined"===typeof z?n(P,F):n.call(z,P,F):P,F+=1;N.length=D;return N}}());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="#e6e6e6";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(b){var d=String(this.image);if("data:image/svg+xml;base64,"==d.substring(0,26)&&null!=this.style){if("1"==mxUtils.getValue(this.style,"clipSvg","0")){if(null==this.clippedSvg||this.clippedImage!=d)this.clippedSvg=Graph.clipSvgDataUri(d),this.clippedImage=d;d=this.clippedSvg}if(null==b||null==b.createImageSymbol){if(b=Graph.getCssVariables(this.style),null!=b){if(null==this.themedSvg||this.themedImage!=d||this.themedVars!=b)this.themedSvg=Graph.setSvgDataUriCssVars(d, b),this.themedImage=d,this.themedVars=b;d=this.themedSvg}}else if(b=mxUtils.getValue(this.style,"editableCssRules",null),null!=b){if(void 0===this.canonicalSvg||this.canonicalImage!=d||this.canonicalRules!=b)this.canonicalSvg=Graph.canonicalizeSvgCssRules(d,b),this.canonicalImage=d,this.canonicalRules=b;null!=this.canonicalSvg&&(d=this.canonicalSvg.uri)}}return d}; mxImageShape.prototype.getImageCssVars=function(b){var d=String(this.image),m=null;null!=this.style&&("data:"!=d.substring(0,5)?Graph.isSameOrigin(d)&&(m=Graph.getCssVariables(this.style)):null!=b&&null!=b.createImageSymbol&&"data:image/svg+xml;base64,"==d.substring(0,26)&&(b=[],null!=this.canonicalSvg&&this.canonicalRules==mxUtils.getValue(this.style,"editableCssRules",null)&&b.push(this.canonicalSvg.vars),null!=mxUtils.getValue(this.style,"cssVars",null)&&(d=Graph.getCssVariables(this.style),null!= d?b.push(d):0==b.length&&(m="")),0<b.length&&(m=b.join("; "))));return m};(function(){var b=mxStencil.prototype.parseColor;mxStencil.prototype.parseColor=function(d,m,p,t,n){return"default"==t&&null!=n?"fillcolor"==p.nodeName?n.shapeBackgroundColor:n.shapeForegroundColor:b.apply(this,arguments)}})();(function(){var b=mxResources.get;mxResources.get=function(d,m,p){null==p&&(p=d);return b.apply(this,[d,m,p])}})(); (function(){var b=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(d,m,p,t,n,z,D,N){var F=b.apply(this,arguments);if(null!=m){var P=F.getElementsByTagName("img");0<P.length&&(P[0].className="geButton")}return F}})(); Graph=function(b,d,m,p,t,n){mxGraph.call(this,b,d,m,p);this.themes=t||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);this.standalone=null!=n?n:!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(ia){ia=this.getCurrentCellStyle(ia); return null!=ia?"1"==ia.html||"wrap"==ia[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var z=null,D=null,N=null,F=null,P=!1,T=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(ia,l){if("mouseDown"==l.getProperty("eventName")&&this.isEnabled()){ia=l.getProperty("event");var v=ia.getState();l=this.view.scale;if(!mxEvent.isAltDown(ia.getEvent())&&null!=v&&(T=this.isCellSelected(v.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(ia.getEvent()))){var H= this.selectionCellsHandler.getHandler(v.cell);if(null==H||null==H.getHandleForEvent(ia)){var O=new mxRectangle(ia.getGraphX()-1,ia.getGraphY()-1),S=mxEvent.isTouchEvent(ia.getEvent())?mxShape.prototype.svgStrokeTolerance-1:(mxShape.prototype.svgStrokeTolerance+2)/2;H=S+2;O.grow(S);if(this.isTableCell(v.cell)&&this.isCellMovable(v.cell)&&!this.isCellSelected(v.cell)&&!(mxUtils.contains(v,ia.getGraphX()-H,ia.getGraphY()-H)&&mxUtils.contains(v,ia.getGraphX()-H,ia.getGraphY()+H)&&mxUtils.contains(v,ia.getGraphX()+ H,ia.getGraphY()+H)&&mxUtils.contains(v,ia.getGraphX()+H,ia.getGraphY()-H))){var V=this.model.getParent(v.cell);H=this.model.getParent(V);if(!this.isCellSelected(H)){S*=l;var Z=2*S;if(this.model.getChildAt(H,0)!=V&&mxUtils.intersects(O,new mxRectangle(v.x,v.y-S,v.width,Z))||this.model.getChildAt(V,0)!=v.cell&&mxUtils.intersects(O,new mxRectangle(v.x-S,v.y,Z,v.height))||mxUtils.intersects(O,new mxRectangle(v.x,v.y+v.height-S,v.width,Z))||mxUtils.intersects(O,new mxRectangle(v.x+v.width-S,v.y,Z,v.height)))V= this.selectionCellsHandler.isHandled(H),this.selectCellForEvent(H,ia.getEvent()),H=this.selectionCellsHandler.getHandler(H),null!=H&&(S=H.getHandleForEvent(ia),null!=S&&(H.start(ia.getGraphX(),ia.getGraphY(),S),H.blockDelayedSelection=!V,ia.consume()))}}for(;!ia.isConsumed()&&null!=v&&(this.isTableCell(v.cell)||this.isTableRow(v.cell)||this.isTable(v.cell));)this.isSwimlane(v.cell)&&this.isCellMovable(v.cell)&&(H=this.getActualStartSize(v.cell),(0<H.x||0<H.width)&&mxUtils.intersects(O,new mxRectangle(v.x+ (H.x-H.width-1)*l+(0==H.x?v.width:0),v.y,1,v.height))||(0<H.y||0<H.height)&&mxUtils.intersects(O,new mxRectangle(v.x,v.y+(H.y-H.height-1)*l+(0==H.y?v.height:0),v.width,1)))&&(this.selectCellForEvent(v.cell,ia.getEvent()),H=this.selectionCellsHandler.getHandler(v.cell),null!=H&&null!=H.customHandles&&(S=mxEvent.CUSTOM_HANDLE-H.customHandles.length+1,H.start(ia.getGraphX(),ia.getGraphY(),S),ia.consume())),v=this.view.getState(this.model.getParent(v.cell))}}}}));this.addListener(mxEvent.CONSUME_MOUSE_EVENT, mxUtils.bind(this,function(ia,l){if("mouseDown"==l.getProperty("eventName")&&this.isEnabled()){ia=l.getProperty("event");var v=ia.getState();mxEvent.isAltDown(ia.getEvent())||mxEvent.isControlDown(l)||mxEvent.isShiftDown(l)||T||null==v||!this.model.isEdge(v.cell)||(z=new mxPoint(ia.getGraphX(),ia.getGraphY()),P=this.isCellSelected(v.cell),N=v,D=ia,null!=v.text&&null!=v.text.boundingBox&&mxUtils.contains(v.text.boundingBox,ia.getGraphX(),ia.getGraphY())?F=mxEvent.LABEL_HANDLE:(l=this.selectionCellsHandler.getHandler(v.cell), null!=l&&null!=l.bends&&0<l.bends.length&&(F=l.getHandleForEvent(ia))))}}));this.addMouseListener({mouseDown:function(ia,l){},mouseMove:mxUtils.bind(this,function(ia,l){ia=this.selectionCellsHandler.handlers.map;for(var v in ia)if(null!=ia[v].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(l.getEvent())){var H=this.tolerance;if(null!=z&&null!=N&&null!=D){if(v=N,null!=F||Math.abs(z.x-l.getGraphX())>H||Math.abs(z.y-l.getGraphY())>H){var O=null;mxEvent.isShiftDown(l.getEvent())|| (O=this.selectionCellsHandler.getHandler(v.cell));if(null!=O&&null!=O.bends&&0<O.bends.length){O.redrawHandles();var S=null!=F?F:O.getHandleForEvent(D),V=this.view.getEdgeStyle(v),Z=V==mxEdgeStyle.EntityRelation;H=v.absolutePoints;P||(S=F);S!=mxEvent.LABEL_HANDLE&&null!=H&&(S=F,null==S&&(ia=new mxRectangle(z.x,z.y),ia.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(ia,H[0].x,H[0].y)?S=0:mxUtils.contains(ia,H[H.length-1].x,H[H.length-1].y)?S=O.bends.length-1:null!=H&&(null==V&&null== S||V==mxEdgeStyle.SegmentConnector||V==mxEdgeStyle.OrthConnector)&&(null!=V&&(2==H.length||3==H.length&&(0==Math.round(H[0].x-H[1].x)&&0==Math.round(H[1].x-H[2].x)||0==Math.round(H[0].y-H[1].y)&&0==Math.round(H[1].y-H[2].y)))?S=2:(S=mxUtils.findNearestSegment(v,z.x,z.y),S=null==V?mxEvent.VIRTUAL_HANDLE-S:S+1))),null==S&&(S=mxEvent.VIRTUAL_HANDLE));ia=S==mxEvent.LABEL_HANDLE||0==S||S==O.bends.length-1;if(!Z&&(null!=v.visibleSourceState||null!=v.visibleTargetState)||ia)O.start(l.getGraphX(),l.getGraphX(), S),l.consume(),this.graphHandler.reset()}null!=O&&(this.selectionCellsHandler.isHandlerActive(O)?this.isCellSelected(v.cell)||(this.selectionCellsHandler.handlers.put(v.cell,O),this.selectCellForEvent(v.cell,l.getEvent())):this.isCellSelected(v.cell)||O.destroy());P=!1;z=D=N=F=null}}else if(v=l.getState(),null!=v&&this.isCellEditable(v.cell)){ia=this.model.getParent(v.cell);O=null;if(this.model.isEdge(v.cell)&&!this.isCellSelected(v.cell)&&!mxEvent.isAltDown(l.getEvent())&&!mxEvent.isShiftDown(l.getEvent())&& !this.isAncestorSelected(v.cell)&&(this.isSwimlane(ia)||this.model.isLayer(ia)||this.getCurrentRoot()==ia)){if(ia=new mxRectangle(l.getGraphX(),l.getGraphY()),ia.grow(mxEdgeHandler.prototype.handleImage.width/2),H=v.absolutePoints,null!=H)null!=v.text&&null!=v.text.boundingBox&&mxUtils.contains(v.text.boundingBox,l.getGraphX(),l.getGraphY())?O="move":mxUtils.contains(ia,H[0].x,H[0].y)||mxUtils.contains(ia,H[H.length-1].x,H[H.length-1].y)?O="pointer":(V=this.view.getEdgeStyle(v),V==mxEdgeStyle.EntityRelation|| null==v.visibleSourceState&&null==v.visibleTargetState||(O="crosshair",V!=mxEdgeStyle.SegmentConnector&&V!=mxEdgeStyle.OrthConnector))||(l=mxUtils.findNearestSegment(v,l.getGraphX(),l.getGraphY()),l<H.length-1&&0<=l&&(O=0==Math.round(H[l].x-H[l+1].x)?"col-resize":"row-resize"))}else if(!mxEvent.isControlDown(l.getEvent())){H=mxShape.prototype.svgStrokeTolerance/2;ia=new mxRectangle(l.getGraphX(),l.getGraphY());ia.grow(H);if(this.isTableCell(v.cell)&&this.isCellMovable(v.cell)&&(l=this.model.getParent(v.cell), H=this.model.getParent(l),!this.isCellSelected(H)))if(mxUtils.intersects(ia,new mxRectangle(v.x,v.y-2,v.width,4))&&this.model.getChildAt(H,0)!=l||mxUtils.intersects(ia,new mxRectangle(v.x,v.y+v.height-2,v.width,4)))O="row-resize";else if(mxUtils.intersects(ia,new mxRectangle(v.x-2,v.y,4,v.height))&&this.model.getChildAt(l,0)!=v.cell||mxUtils.intersects(ia,new mxRectangle(v.x+v.width-2,v.y,4,v.height)))O="col-resize";for(l=v;null==O&&null!=l&&(this.isTableCell(l.cell)||this.isTableRow(l.cell)||this.isTable(l.cell));)this.isSwimlane(l.cell)&& this.isCellMovable(l.cell)&&(H=this.getActualStartSize(l.cell),S=this.view.scale,(0<H.x||0<H.width)&&mxUtils.intersects(ia,new mxRectangle(l.x+(H.x-H.width-1)*S+(0==H.x?l.width*S:0),l.y,1,l.height))?O="col-resize":(0<H.y||0<H.height)&&mxUtils.intersects(ia,new mxRectangle(l.x,l.y+(H.y-H.height-1)*S+(0==H.y?l.height:0),l.width,1))&&(O="row-resize")),l=this.view.getState(this.model.getParent(l.cell))}null!=O&&v.setCursor(O)}}}),mouseUp:mxUtils.bind(this,function(ia,l){F=z=D=N=null})})}this.cellRenderer.minSvgStrokeWidth= .1;var c=document.createElement("div");this.cellRenderer.getLabelValue=function(ia){var l=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);ia.view.graph.isHtmlLabel(ia.cell)&&("0"==mxUtils.getValue(ia.style,"html","0")?l=mxUtils.htmlEntities(l,!1):(ia.lastLabelValue!=l&&(ia.lastLabelValue=l,ia.lastSanitizedLabelValue=Graph.sanitizeHtml(l),c.innerHTML=ia.lastSanitizedLabelValue,Graph.addLightDarkColors(c,null,"simple"==ia.view.graph.getAdaptiveColors())&&(ia.lastSanitizedLabelValue=c.innerHTML)), l=ia.lastSanitizedLabelValue));return l};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0);this.setTooltips(!0);this.setAllowLoops(!0);this.allowAutoPanning=!0;this.constrainChildren=this.resetEdgesOnConnect=!1;this.constrainRelativeChildren=!0;this.graphHandler.scrollOnMove=!1;this.graphHandler.scaleGrid=!0;this.connectionHandler.setCreateTarget(!1);this.connectionHandler.insertBeforeSource=!0;this.connectionHandler.isValidSource=function(ia, l){return!1};this.alternateEdgeStyle="vertical";null==p&&this.loadStylesheet();var f=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var ia=f.apply(this,arguments);if(this.graph.pageVisible){var l=this.graph.pageFormat,v=this.graph.pageScale,H=l.width*v;l=l.height*v;v=this.graph.view.translate;var O=this.graph.view.scale;if(Math.min(H,l)*O>this.graph.minPageBreakDist){var S=this.graph.getPageLayout(),V=this.graph.container,Z=0,ba=S.width,ha=1,na=S.height;if(null!=V){ha= (V.scrollLeft-V.clientWidth)/O-v.x;var oa=(V.scrollTop-V.clientHeight)/O-v.y;Z=Math.max(0,Math.floor(ha/H)-S.x);ba=Math.min(ba,Math.ceil((ha+3*V.clientWidth/O)/H)-S.x);ha=Math.max(1,Math.floor(oa/l)-S.y);na=Math.min(na,Math.ceil((oa+3*V.clientHeight/O)/l)-S.y)}for(V=[];Z<ba;Z++)V.push(new mxRectangle(((S.x+Z)*H+v.x)*O,(S.y*l+v.y)*O,H*O,l*O));for(ba=ha;ba<na;ba++)V.push(new mxRectangle((S.x*H+v.x)*O,((S.y+ba)*l+v.y)*O,H*O,l*O));ia=V.concat(ia)}}return ia};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex; mxGuide.prototype.getGuideColor=function(ia,l){return null==ia.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(ia){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var k=this.graphHandler.getCells;this.graphHandler.getCells=function(ia){for(var l=k.apply(this,arguments),v=new mxDictionary,H=[],O=0;O<l.length;O++){var S=this.graph.isTableCell(ia)&& this.graph.isTableCell(l[O])&&this.graph.isCellSelected(l[O])?this.graph.model.getParent(l[O]):this.graph.isTableRow(ia)&&this.graph.isTableRow(l[O])&&this.graph.isCellSelected(l[O])?l[O]:this.graph.getCompositeParent(l[O]);null==S||v.get(S)||(v.put(S,!0),H.push(S))}return H};var q=this.graphHandler.start;this.graphHandler.start=function(ia,l,v,H){var O=!1;this.graph.isTableCell(ia)&&(this.graph.isCellSelected(ia)?O=!0:ia=this.graph.model.getParent(ia));O||this.graph.isTableRow(ia)&&this.graph.isCellSelected(ia)|| (ia=this.graph.getCompositeParent(ia));q.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(ia,l){l=this.graph.getCompositeParent(l);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(ia,l,v,H,O,S){var V=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=H&&this.graph.applyNewEdgeStyle(H,[V]);return V};var y=new mxRubberband(this);this.getRubberband=function(){return y};var A=(new Date).getTime(), E=0,K=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var ia=this.currentState;K.apply(this,arguments);ia!=this.currentState?(A=(new Date).getTime(),E=0):E=(new Date).getTime()-A};var Q=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(ia){if(mxEvent.isShiftDown(ia.getEvent())&&mxEvent.isAltDown(ia.getEvent()))return!1;var l=null!=this.currentState?mxUtils.getValue(this.currentState.style,"outlineConnect","1"):"1";return"3"== l?!1:null!=this.currentState&&ia.getState()==this.currentState&&("2"==l||2E3<E)||(null==this.currentState||"0"!=l)&&Q.apply(this,arguments)};var W=this.isToggleEvent;this.isToggleEvent=function(ia){return W.apply(this,arguments)||mxEvent.isShiftDown(ia)};var J=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(J=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=J)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(ia){return mxEvent.isMouseEvent(ia.getEvent())};var ea=this.click;this.click=function(ia){var l=null==ia.state&&null!=ia.sourceState&&this.isCellLocked(this.getLayerForCell(ia.sourceState.cell));if(this.isEnabled()&&!l||ia.isConsumed())return ea.apply(this,arguments);var v=l?ia.sourceState.cell:ia.getCell();if(null!=v){var H=this.getClickableLinkForCell(v);null!=H?this.isCustomLink(H)? this.customLinkClicked(H,v):this.openLink(H):l&&this.clearSelection()}};this.tooltipHandler.getStateForEvent=function(ia){return ia.sourceState};var X=this.tooltipHandler.show;this.tooltipHandler.show=function(){X.apply(this,arguments);if(null!=this.div)for(var ia=this.div.getElementsByTagName("a"),l=0;l<ia.length;l++)null!=ia[l].getAttribute("href")&&null==ia[l].getAttribute("target")&&ia[l].setAttribute("target","_blank")};this.tooltipHandler.getStateForEvent=function(ia){return ia.sourceState}; this.getCursorForMouseEvent=function(ia){var l=null==ia.state&&null!=ia.sourceState&&this.isCellLocked(ia.sourceState.cell);return this.getCursorForCell(l?ia.sourceState.cell:ia.getCell())};var aa=this.getCursorForCell;this.getCursorForCell=function(ia){if(!this.isEnabled()||this.isCellLocked(ia)){if(null!=this.getClickableLinkForCell(ia))return"pointer";if(this.isCellLocked(ia))return"default"}return aa.apply(this,arguments)};this.selectRegion=function(ia,l){var v=Graph.intersectionSelect||mxEvent.isAltDown(l)? ia:null;ia=this.getCells(ia.x,ia.y,ia.width,ia.height,null,null,v,null,!0);if(null!=ia&&0<ia.length){v=new mxDictionary;for(var H=[],O=0;O<ia.length;O++){var S=this.getLockedGroupAncestor(this.model.getParent(ia[O]));S=null!=S?S:ia[O];v.get(S)||(v.put(S,!0),H.push(S))}ia=H}if(this.isToggleEvent(l))for(O=0;O<ia.length;O++)this.selectCellForEvent(ia[O],l);else this.selectCellsForEvent(ia,l);return ia};var ka=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent= function(ia,l,v){return this.graph.isCellSelected(ia)||this.graph.isTransparentBounds(ia)?!1:ka.apply(this,arguments)};var ja=this.updateMouseEvent;this.updateMouseEvent=function(ia){ia=ja.apply(this,arguments);null!=ia.state&&this.isCellLocked(this.getLayerForCell(ia.getCell()))&&(null==this.getLinkForCell(ia.getCell())?ia.state=this.view.getState(this.getCellAt(ia.getGraphX(),ia.getGraphY(),null,null,null,mxUtils.bind(this,function(l,v,H){return ia.state==l||this.isCellLocked(this.getLayerForCell(l.cell))&& null==this.getLinkForCell(l.cell)}))):ia.state=null);return ia};var ua=this.isCellSelectable;this.isCellSelectable=function(ia){return null!=ia&&null!=this.getLockedGroupAncestor(this.model.getParent(ia))?!1:ua.apply(this,arguments)&&!this.isCellLocked(this.getLayerForCell(ia))};this.isCellLocked=function(ia){for(;null!=ia;){if("1"==mxUtils.getValue(this.getCurrentCellStyle(ia),"locked","0"))return!0;ia=this.model.getParent(ia)}return!1};var Ba=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this, function(ia,l){"mouseDown"==l.getProperty("eventName")&&(ia=l.getProperty("event").getState(),Ba=null==ia||this.isSelectionEmpty()||this.isCellSelected(ia.cell)?null:this.getSelectionCells())}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(ia,l){if(!mxEvent.isMultiTouchEvent(l)){ia=l.getProperty("event");var v=l.getProperty("cell");null==v?(ia=mxUtils.convertPoint(this.container,mxEvent.getClientX(ia),mxEvent.getClientY(ia)),y.start(ia.x,ia.y)):null!=Ba?this.addSelectionCells(Ba): 1<this.getSelectionCount()&&this.isCellSelected(v)&&this.removeSelectionCell(v);Ba=null;l.consume()}}));this.connectionHandler.selectCells=function(ia,l){this.graph.setSelectionCell(l||ia)};this.connectionHandler.constraintHandler.isStateIgnored=function(ia,l){var v=ia.view.graph;return l&&(v.isCellSelected(ia.cell)||v.isTableRow(ia.cell)&&v.selectionCellsHandler.isHandled(v.model.getParent(ia.cell)))};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var ia=this.connectionHandler.constraintHandler; null!=ia.currentFocus&&ia.isStateIgnored(ia.currentFocus,!0)&&(ia.currentFocus=null,ia.constraints=null,ia.destroyIcons());ia.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.browserTranslate=mxClient.IS_GC&&"0"!=urlParams["browser-translate"];Graph.isBrowserTranslated=function(){try{var b=document;try{window.parent!=window&&null!=window.parent.document&&(b=window.parent.document)}catch(m){}var d=b.documentElement.className;return null!=d&&/\btranslated/.test(d)}catch(m){return!1}}; 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.pasteTextStyles="fontFamily fontSource fontSize fontColor fontStyle textOpacity align verticalAlign spacingLeft spacingRight spacingTop spacingBottom spacing labelBorderColor labelBackgroundColor horizontal textDirection".split(" ");Graph.edgeStyles="edgeStyle elbow jumpStyle jumpSize startArrow startFill startSize endArrow endFill endSize flowAnimation flowAnimationDirection flowAnimationTimingFunction flowAnimationDuration sourcePerimeterSpacing targetPerimeterSpacing curved linecap linejoin libavoidRouting".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 elkLayered elkTree elkRadial elkOrganic elkStress elkDisco elkBox".split(" ");Graph.elkLayoutAlgorithms={elkLayered:"layered",elkTree:"mrtree",elkRadial:"radial",elkOrganic:"force",elkStress:"stress",elkDisco:"disco",elkBox:"box"}; Graph.elkLayoutNameForAlgorithm=function(b){for(var d in Graph.elkLayoutAlgorithms)if(Graph.elkLayoutAlgorithms[d]===b)return d;return null};Graph.backupStyleAttribute="data-mx-given-colors";Graph.newColorPlaceholder="rgba(0, 0, 0, 0)";Graph.newBackgroundPlaceholder="rgb(0, 0, 0)";Graph.defaultAdaptiveColors="0"==urlParams.contrast?"simple":"auto";Graph.getDefaultAdaptiveColorsKey=function(){return"auto"==Graph.defaultAdaptiveColors?"automatic":Graph.defaultAdaptiveColors}; Graph.createOffscreenGraph=function(b){var d=new Graph(document.createElement("div"));d.stylesheet.styles=mxUtils.clone(b.styles);d.resetViewOnRootChange=!1;d.setConnectable(!1);d.gridEnabled=!1;d.autoScroll=!1;d.setTooltips(!1);d.setEnabled(!1);d.container.style.visibility="hidden";d.container.style.position="absolute";d.container.style.overflow="hidden";d.container.style.height="1px";d.container.style.width="1px";return d}; Graph.createSvgImage=function(b,d,m,p,t){m=unescape(encodeURIComponent(Graph.svgDoctype+'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+b+'px" height="'+d+'px" '+(null!=p&&null!=t?'viewBox="0 0 '+p+" "+t+'" ':"")+'version="1.1" style="color-scheme: light dark;">'+m+"</svg>"));return new mxImage("data:image/svg+xml;base64,"+(window.btoa?btoa(m):Base64.encode(m,!0)),b,d)}; Graph.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.svgBackgroundVar="--ge-adaptive-bg"; Graph.createSvgNode=function(b,d,m,p,t){var n=mxUtils.createXmlDocument(),z=null!=n.createElementNS?n.createElementNS(mxConstants.NS_SVG,"svg"):n.createElement("svg");null!=t&&z.setAttribute("style","background: "+t.light+"; background-color: "+t.cssText+";");null==n.createElementNS?(z.setAttribute("xmlns",mxConstants.NS_SVG),z.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):z.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);z.setAttribute("version","1.1");z.setAttribute("width", m+"px");z.setAttribute("height",p+"px");z.setAttribute("viewBox",b+" "+d+" "+m+" "+p);n.appendChild(z);return z}; Graph.addAdaptiveColors=function(b,d){if(mxUtils.lightDarkColorSupported&&(d=mxUtils.getLightDarkColor(d),!(0>d.cssText.indexOf("var(")))){for(var m="var("+Graph.svgBackgroundVar+", "+d.light+")",p=b.getElementsByTagName("*"),t=[b],n=!1,z=0;z<p.length;z++)t.push(p[z]);for(z=0;z<t.length;z++)p=t[z].getAttribute("style"),null!=p&&0<=p.indexOf(d.cssText)&&(t[z].setAttribute("style",p.split(d.cssText).join(m)),n=!0);if(n){m=b.ownerDocument;t=b.getAttribute("id");if(null==t||""==t)t="ge-svg-"+Editor.guid(), b.setAttribute("id",t);n=null!=m.createElementNS?m.createElementNS(mxConstants.NS_SVG,"style"):m.createElement("style");n.setAttribute("type","text/css");n.appendChild(m.createTextNode("@supports (color: light-dark(#000, #fff)) { #"+t+" { "+Graph.svgBackgroundVar+": "+d.cssText+"; } }"));b.insertBefore(n,b.firstChild)}}}; Graph.htmlToPng=function(b,d,m,p,t,n){t=null!=t?t:"";n=null!=n?n:Editor.htmlRasterScale;var z=document.createElement("canvas");z.width=d*n;z.height=m*n;var D=document.createElement("img");D.onload=mxUtils.bind(this,function(){try{var F=z.getContext("2d");F.scale(n,n);F.drawImage(D,0,0);p(z.toDataURL())}catch(P){p(null)}});var N=mxUtils.createXmlDocument();N=null!=N.createElementNS?N.createElementNS(mxConstants.NS_SVG,"svg"):N.createElement("svg");b=(new mxSvgCanvas2D(N)).convertHtml(b);D.onerror= function(F){p(null)};D.src="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'+d+'" height="'+m+'">'+(""!=t?'<defs xmlns="http://www.w3.org/2000/svg"><style type="text/css">'+t+"</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,p){function t(c,f,k){return null!=p?p(c,f,k):mxUtils.isValidColor(k)?(null==z&&null!=d&&(z={}),null!=z&&(z[f]=c.style.getPropertyValue(f)),k=mxUtils.getLightDarkColor(k,null,null,m),c.style.setProperty(f,k.cssText),!0):!1}for(var n=b.getElementsByTagName("*"),z=null,D=!1,N=0;N<n.length;N++)if(n[N]!=b&&null!=n[N].style){z=null;for(var F=0;F<n[N].style.length;F++){var P=n[N].style.item(F),T=n[N].style.getPropertyValue(P);D=t(n[N],P,T)||D}"FONT"==n[N].nodeName&& ""==n[N].style.getPropertyValue("color")&&(T=n[N].getAttribute("color"),D=t(n[N],"color",T)||D);null!=d&&null!=z&&n[N].setAttribute(d,JSON.stringify(z))}return D};Graph.removeLightDarkColors=function(b,d){b=b.getElementsByTagName("*");for(var m=!1,p=0;p<b.length;p++)try{var t=b[p].getAttribute(d);if(null!=t){b[p].removeAttribute(d);var n=JSON.parse(t),z;for(z in n){var D=n[z];""==D?(b[p].style[z]=null,""==b[p].getAttribute("style")&&b[p].removeAttribute("style")):b[p].style[z]=D;m=!0}}}catch(N){}return m}; Graph.getGivenColor=function(b,d){var m=null;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){try{var p=b.getAttribute(Graph.backupStyleAttribute);if(null!=p){var t=JSON.parse(p);null!=t&&null!=t[d]&&("color"==d&&"FONT"==b.nodeName&&""==t[d]&&null!=b.getAttribute("color")?m=b.getAttribute("color"):""!=t[d]&&(m=t[d]))}}catch(n){}null==m&&""!=b.style[d]&&(m=b.style[d])}return m}; Graph.setTextColor=function(b,d,m){for(var p=m?Graph.newColorPlaceholder:Graph.newBackgroundPlaceholder,t=m?"color":"background-color",n=b.getElementsByTagName("*"),z=[],D=0;D<n.length;D++)z.push({node:n[D],value:n[D].style[t]});D=document.queryCommandState("styleWithCSS");m&&!D&&document.execCommand("styleWithCSS",!1,!0);document.execCommand(m?"forecolor":"backcolor",!1,p);m&&!D&&document.execCommand("styleWithCSS",!1,!1);b=b.getElementsByTagName("*");for(D=0;D<b.length;D++){if(D<z.length&&z[D].node== b[D]&&z[D].value!=b[D].style[t]&&""==b[D].style[t])try{if(n=b[D].getAttribute(Graph.backupStyleAttribute),null!=n){var N=JSON.parse(n);N[t]="";b[D].setAttribute(Graph.backupStyleAttribute,JSON.stringify(N))}}catch(F){}if(m&&b[D].getAttribute("color")==p||b[D].style[t]==p){m&&b[D].getAttribute("color")==p&&b[D].removeAttribute("color");b[D].style[t]=d!=mxConstants.NONE?mxUtils.getLightDarkColor(d).cssText:null;try{n=b[D].getAttribute(Graph.backupStyleAttribute),N=null!=n?JSON.parse(n):{},N[t]=d!=mxConstants.NONE? d:"",b[D].setAttribute(Graph.backupStyleAttribute,JSON.stringify(N))}catch(F){}if(m&&mxClient.IS_FF){d=b[D];m=d.firstChild;if(null!=m&&"A"==m.nodeName&&null==m.nextSibling&&null!=m.firstChild){d.parentNode.insertBefore(m,d);for(p=m.firstChild;null!=p;)t=p.nextSibling,d.appendChild(p),p=t;m.appendChild(d)}break}}}};Graph.zapGremlins=function(b){return mxUtils.zapGremlins(b)};Graph.stringToBytes=function(b){for(var d=Array(b.length),m=0;m<b.length;m++)d[m]=b.charCodeAt(m);return d}; Graph.bytesToString=function(b){for(var d=Array(b.length),m=0;m<b.length;m++)d[m]=String.fromCharCode(b[m]);return d.join("")};Graph.base64EncodeUnicode=function(b){return btoa(encodeURIComponent(b).replace(/%([0-9A-F]{2})/g,function(d,m){return String.fromCharCode(parseInt(m,16))}))};Graph.base64DecodeUnicode=function(b){return decodeURIComponent(Array.prototype.map.call(atob(b),function(d){return"%"+("00"+d.charCodeAt(0).toString(16)).slice(-2)}).join(""))}; Graph.compressNode=function(b,d){b=mxUtils.getXml(b);return Graph.compress(d?b:Graph.zapGremlins(b))};Graph.arrayBufferToString=function(b){var d="";b=new Uint8Array(b);for(var m=b.byteLength,p=0;p<m;p++)d+=String.fromCharCode(b[p]);return d};Graph.stringToArrayBuffer=function(b){return Uint8Array.from(b,function(d){return d.charCodeAt(0)})}; Graph.arrayBufferIndexOfString=function(b,d,m){var p=d.charCodeAt(0),t=1,n=-1;for(m=m||0;m<b.byteLength;m++)if(b[m]==p){n=m;break}for(m=n+1;-1<n&&m<b.byteLength&&m<n+d.length-1;m++){if(b[m]!=d.charCodeAt(t))return Graph.arrayBufferIndexOfString(b,d,n+1);t++}return t==d.length-1?n:-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,p,t){t=null!=t?t:1E3;Graph.setTransitionForNodes(b,null);Graph.setOpacityForNodes(b,d);window.setTimeout(function(){Graph.setTransitionForNodes(b,"all "+t+"ms ease-in-out");Graph.setOpacityForNodes(b,m);window.setTimeout(function(){Graph.setTransitionForNodes(b,null);null!=p&&p()},t)},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(p,t){function n(T){T.view.states.visit(function(c,f){null!=f.shape&&T.model.isEdge(T.model.getParent(f.cell))?f.shape.node.parentNode.appendChild(f.shape.node):null!=f.text&&T.model.isEdge(f.cell)&&f.text.node.parentNode.appendChild(f.text.node)})}function z(T,c){if(T.getModel().isVertex(c)){var f=T.container.offsetWidth/2,k=T.container.offsetHeight/2;T.rootCell= c.referenceCell||c;T.getModel().beginUpdate();try{pageSize=null!=m&&null!=m.pageSize?m.pageSize:8+Math.max(0,Math.floor(Math.min(T.container.offsetWidth-800/120,T.container.offsetHeight-600)/30));for(var q=c.referenceCell||c,y=p.model.getCell(q.sourceCellId),A=p.getEdges(y,null,!0,!0,!1,!0),E=[],K=0;K<A.length;K++)null!=A[K].getTerminal(!0)&&null!=A[K].getTerminal(!1)&&p.isCellVisible(A[K])&&!p.isEdgeIgnored(A[K])&&p.isCellVisible(A[K].getTerminal(!0))&&p.isCellVisible(A[K].getTerminal(!1))&&p.isCellVisible(p.getLayerForCell(A[K]))&& E.push(A[K]);E=A=E;if(null!=c.startIndex||0<pageSize&&A.length>pageSize){var Q=c.startIndex||0;E=A.slice(Math.max(0,Q),Math.min(A.length,Q+pageSize))}E=p.getOpposites(E,y).concat(E);var W=T.cloneCells(E);for(K=0;K<E.length;K++)if(W[K].sourceCellId=E[K].id,T.model.isEdge(W[K]))for(W[K].geometry.x=0,W[K].geometry.y=0,W[K].geometry.points=null,W[K].setStyle(W[K].getStyle()+";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffe0;textOpacity=100;"),W[K].setTerminal(q, null==W[K].getTerminal(!0)),y=0;y<W[K].getChildCount();y++){var J=W[K].getChildAt(y);null!=J.geometry&&J.geometry.relative&&(J.setStyle(J.getStyle()+";labelBackgroundColor=#ffffffe0;textOpacity=100;"),J.geometry.offset=new mxPoint(0,0),J.geometry.y=0,J.geometry.x=.5>J.geometry.x?-.8:.5<J.geometry.x?.8:0)}if(0<c.startIndex){var ea=T.createVertex(null,null,mxResources.get("previousPage")+" ("+Math.ceil((c.startIndex||0)/pageSize)+"/"+Math.ceil(A.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;"); ea.referenceCell=q;ea.startIndex=Math.max(0,(c.startIndex||0)-pageSize);W.splice(0,0,ea)}if(A.length>(c.startIndex||0)+pageSize){var X=T.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((c.startIndex||0)/pageSize)+2)+"/"+Math.ceil(A.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");X.referenceCell=q;X.startIndex=(c.startIndex||0)+pageSize;W.splice(0,0,X)}for(var aa in T.getModel().cells){var ka=T.getModel().getCell(aa);ka!=T.rootCell&& !T.getModel().isAncestor(T.rootCell,ka)&&T.getModel().isVertex(ka)&&T.removeCells([ka])}T.addCells(W);var ja=T.getModel().getGeometry(T.rootCell);null!=ja&&(ja=ja.clone(),ja.x=f-ja.width/2,ja.y=k-ja.height/3,T.getModel().setGeometry(T.rootCell,ja));c=[];for(aa in T.getModel().cells)ka=T.getModel().getCell(aa),ka!=T.rootCell&&T.getModel().isVertex(ka)&&T.getModel().getParent(ka)==T.getDefaultParent()&&(c.push(ka),ja=T.getModel().getGeometry(ka),null!=ja&&(ja.x=f-ja.width/2,ja.y=k-ja.height/2));var ua= c.length,Ba=2*Math.PI/ua,ia=Math.max(minSize,Math.min(T.container.offsetWidth/2-40,T.container.offsetHeight/2-80));for(f=0;f<ua;f++)ja=T.getModel().getGeometry(c[f]),null!=ja&&(ja=ja.clone(),ja.x+=ia*Math.sin(f*Ba),ja.y+=ia*Math.cos(f*Ba),T.getModel().setGeometry(c[f],ja))}finally{T.getModel().endUpdate()}}}var D=document.createElement("div");D.style.position="absolute";D.style.display="block";D.style.overflow="auto";D.style.width="100%";D.style.height="100%";D.style.left="0px";D.style.top="0px"; D.style.zIndex=2;D.style.background=p.background==mxConstants.NONE||null==p.background?Editor.getDefaultPageBackgroundColor():p.background;var N=document.createElement("img");N.setAttribute("src",Editor.closeBlackImage);N.style.position="absolute";N.style.cursor="pointer";N.style.right="10px";N.style.top="10px";D.appendChild(N);var F=document.createElement("div");F.style.position="absolute";F.style.cursor="pointer";F.style.right="38px";F.style.top="14px";F.style.textAlign="right";F.style.verticalAlign= "top";mxUtils.write(F,mxResources.get("close"));D.appendChild(F);document.body.appendChild(D);var P=function(T){27==T.keyCode&&N.click()};mxEvent.addListener(document,"keydown",P);(function(T){var c=new Graph(T);c.keepEdgesInBackground=!0;c.isCellResizable=function(){return!1};c.isCellRotatable=function(){return!1};c.getCursorForCell=function(E){return this.model.isVertex(E)?"pointer":null};c.getFoldingImage=function(){return null};var f=function(){mxEvent.removeListener(document,"keydown",P);T.parentNode.removeChild(T); p.scrollCellToVisible(t)};mxEvent.addListener(N,"click",f);mxEvent.addListener(F,"click",f);c.setEnabled(!1);var k=c.click;c.click=function(E){var K=E.getCell(),Q=null!=K?null!=K.referenceCell?K.referenceCell:K:null;null!=K&&0<c.getEdges(Q).length?z(c,K):k.apply(this,arguments)};f=c.container.offsetWidth/2;var q=c.container.offsetHeight/3;c.model.beginUpdate();var y=c.importCells([t])[0];y.sourceCellId=t.id;y.geometry.x=f-y.geometry.width/2;y.geometry.y=q-y.geometry.height/2;c.model.endUpdate();var A= !1;c.getModel().addListener(mxEvent.CHANGE,function(E,K){A||(E=K.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,c.labelsVisible=!1,A=!0,mxEffects.animateChanges(c,E,function(){var Q=new mxParallelEdgeLayout(c);Q.spacing=60;var W=Q.layout;Q.layout=function(J){Q.spacing=Math.min(60,Math.max(30,60-5*J.length));W.apply(this,arguments)};Q.execute(c.getDefaultParent());mxText.prototype.enableBoundingBox=!0;c.labelsVisible=!0;c.tooltipHandler.hide();c.refresh();n(c);A=!1}))});z(c,y)})(D)})(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 p=Graph.createTabNode(4);b.parentNode.replaceChild(p,b);b=p}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")&&(p=Graph.createTabNode(4),b.innerHTML=b.innerHTML.replace(/\t/g,p.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)}; Graph.installNoteBoxStyle=function(){if(!Graph.installNoteBoxStyle.done){Graph.installNoteBoxStyle.done=!0;var b=document.createElement("style");b.setAttribute("type","text/css");b.appendChild(document.createTextNode('.geNoteBox{position:fixed;z-index:10001;min-width:120px;max-width:360px;max-height:50vh;overflow:auto;box-sizing:border-box;padding:10px 14px;background:#ffffff;color:#1d1d1f;border:1px solid #d2d2d7;border-radius:10px;box-shadow:0 4px 16px rgba(0,0,0,0.2);font:13px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;user-select:text;cursor:auto;white-space:pre-line}.geDarkMode .geNoteBox{background:#2a2a2a;color:#e5e5e7;border-color:#505050}.geNoteBox h1,.geNoteBox h2,.geNoteBox h3,.geNoteBox h4,.geNoteBox h5,.geNoteBox h6{margin:6px 0 4px 0;line-height:1.3}.geNoteBox h1{font-size:17px}.geNoteBox h2{font-size:15px}.geNoteBox h3,.geNoteBox h4,.geNoteBox h5,.geNoteBox h6{font-size:13px}.geNoteBox ul,.geNoteBox ol{margin:4px 0;padding-left:22px}.geNoteBox blockquote{margin:4px 0;padding:2px 10px;border-left:3px solid #d2d2d7;opacity:0.85}.geNoteBox pre{margin:4px 0;padding:6px 8px;border-radius:6px;background:rgba(127,127,127,0.15);overflow:auto}.geNoteBox code{font-family:monospace;font-size:12px}.geNoteBox hr{border:none;border-top:1px solid #d2d2d7;margin:6px 0}.geNoteBox a{color:#0071e3}.geDarkMode .geNoteBox a{color:#0a84ff}.geNoteBox .geNoteEditBtn{float:right;position:sticky;top:0;width:22px;height:22px;margin:-4px -9px 4px 10px;border-radius:5px;cursor:pointer;user-select:none;opacity:0.6}.geNoteBox .geNoteEditBtn:hover{opacity:1;background:rgba(127,127,127,0.15)}.geNoteBox .geNoteEditBtn img{display:block;width:16px;height:16px;margin:3px}.geDarkMode .geNoteBox .geNoteEditBtn img{filter:invert(1)}')); document.getElementsByTagName("head")[0].appendChild(b)}};Graph.stylesCompatible=function(b,d){var m=function(p){if(null==p)return"";p=p.split(";");for(var t=[],n=0;n<p.length;n++){var z=p[n].trim();if(0<z.length){var D=z.indexOf(":");if(0<D){var N=z.substring(0,D).trim().toLowerCase();z=z.substring(D+1).trim().toLowerCase();"initial"!=z&&"inherit"!=z&&"unset"!=z&&t.push(N+":"+z)}}}t.sort();return t.join(";")};return m(b)==m(d)}; Graph.optimizeHtml=function(b){if(null==b||0==b.length)return b;var d=document.createElement("div");d.innerHTML=b;Graph.optimizeNode(d);return d.innerHTML}; Graph.optimizeNode=function(b){if(null!=b){for(var d=b.firstChild;null!=d;){var m=d.nextSibling;1==d.nodeType&&Graph.optimizeNode(d);d=m}for(d=b.firstChild;null!=d;){m=d.nextSibling;if(!(1!=d.nodeType||"FONT"!=d.nodeName||d.hasAttribute("color")||d.hasAttribute("face")||d.hasAttribute("size")||d.hasAttribute("style"))){for(;null!=d.firstChild;)b.insertBefore(d.firstChild,d);b.removeChild(d)}d=m}for(d=b.firstChild;null!=d;)if(m=d.nextSibling,1==d.nodeType&&null!=m&&1==m.nodeType&&"SPAN"==d.nodeName&& "SPAN"==m.nodeName&&Graph.stylesCompatible(d.getAttribute("style"),m.getAttribute("style"))){for(;null!=m.firstChild;)d.appendChild(m.firstChild);m.parentNode.removeChild(m);d.normalize()}else d=m;for(d=b.firstChild;null!=d;){m=d.nextSibling;if(1==d.nodeType&&"SPAN"==d.nodeName){var p=d.getAttribute("style");if((null==p||0==p.trim().length)&&1>=d.attributes.length){for(;null!=d.firstChild;)b.insertBefore(d.firstChild,d);b.removeChild(d)}else if("SPAN"==b.nodeName&&Graph.stylesCompatible(p,b.getAttribute("style"))&& 1==d.attributes.length){for(;null!=d.firstChild;)b.insertBefore(d.firstChild,d);b.removeChild(d)}}d=m}b.normalize()}};Graph.sanitizeLink=function(b){if(null==b)return null;var d=document.createElement("a");d.setAttribute("href",b);Graph.sanitizeNode(d);return d.getAttribute("href")};Graph.sanitizeNode=function(b){return Graph.domPurify(b,!0)}; Graph.isStyleAllowed=function(b){b=b.replace(/\\([0-9a-fA-F]{1,6})\s?/g,function(t,n){return String.fromCharCode(parseInt(n,16))}).replace(/\\(.)/g,"$1");for(var d=/url\s*\(\s*(['"]?)(.*?)\1\s*\)/gi,m;null!==(m=d.exec(b));){var p=m[2].trim();m=!/^([a-z][a-z0-9+.-]*:|\/\/)/i.test(p);p=p.toLowerCase().startsWith("data:");if(!m&&!p)return!1}return/@import/i.test(b)?!1:!0}; DOMPurify.addHook("afterSanitizeAttributes",function(b){if("use"==b.nodeName&&(null!=b.getAttribute("xlink:href")&&!b.getAttribute("xlink:href").startsWith("#")||null!=b.getAttribute("href")&&!b.getAttribute("href").startsWith("#")))b.remove();else if("style"==b.nodeName.toLowerCase()){var d=Graph.zapGremlins(b.textContent);d==b.textContent&&Graph.isStyleAllowed(d)||b.remove()}}); DOMPurify.addHook("uponSanitizeAttribute",function(b,d){d.attrValue=Graph.zapGremlins(d.attrValue);"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)))),p=m.indexOf("<svg");if(0<=p){d.innerHTML=Graph.sanitizeHtml(m.substring(p));var t=d.getElementsByTagName("svg");if(0<t.length){document.body.appendChild(d);try{p=m=1;var n=t[0].getAttribute("width"),z=t[0].getAttribute("height");n=null!=n&&"%"!=n.charAt(n.length- 1)?parseFloat(n):NaN;z=null!=z&&"%"!=z.charAt(z.length-1)?parseFloat(z):NaN;var D=t[0].getAttribute("viewBox");if(null!=D&&!isNaN(n)&&!isNaN(z)){var N=D.split(" ");4<=D.length&&(m=parseFloat(N[2])/n,p=parseFloat(N[3])/z)}var F=t[0].getBBox();if(0<F.width&&0<F.height){for(var P=0,T=t[0].querySelectorAll("[stroke-width]"),c=0;c<T.length;c++)P=Math.max(P,parseFloat(T[c].getAttribute("stroke-width")));var f=t[0].querySelectorAll("rect,circle,ellipse,line,polyline,polygon,path");for(c=0;c<f.length;c++)try{var k= window.getComputedStyle(f[c]);k.stroke&&"none"!==k.stroke&&(P=Math.max(P,parseFloat(k.strokeWidth)||0))}catch(A){}var q=new mxRectangle(F.x,F.y,F.width,F.height);q.grow(P/2);if(null!=D&&(N=D.split(" "),4<=N.length)){var y=new mxRectangle(parseFloat(N[0]),parseFloat(N[1]),parseFloat(N[2]),parseFloat(N[3]));q.add(y)}!isNaN(n)&&!isNaN(z)&&0>q.x&&0>q.y&&q.width>n&&q.height>z?d.getElementsByTagName("svg")[0].setAttribute("viewBox","0 0 "+n+" "+z):(d.getElementsByTagName("svg")[0].setAttribute("viewBox", q.x+" "+q.y+" "+q.width+" "+q.height),d.getElementsByTagName("svg")[0].setAttribute("width",q.width/m),d.getElementsByTagName("svg")[0].setAttribute("height",q.height/p))}}catch(A){}finally{document.body.removeChild(d)}b=Editor.createSvgDataUri(mxUtils.getXml(t[0]))}}}catch(A){}return b}; Graph.getCssVariables=function(b){var d=mxUtils.getValue(b,"cssVars",null),m=null;if(null!=d&&""!=d){d=String(d).split(",");for(var p=[],t=0;t<d.length;t++){var n=mxUtils.trim(d[t]);"--"==n.substring(0,2)&&(n=n.substring(2));var z=""!=n?mxUtils.getValue(b,"--"+n,null):null;null!=z&&""!=z&&p.push("--"+n+": "+z)}0<p.length&&(m=p.join("; "))}return m}; Graph.setSvgDataUriCssVars=function(b,d){d=Graph.zapGremlins(d);if(null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26)&&Graph.isStyleAllowed(d))try{var m=decodeURIComponent(escape(atob(b.substring(26)))),p=m.indexOf("<svg");if(0<=p){var t=document.createElement("div");t.innerHTML=Graph.sanitizeHtml(m.substring(p));var n=t.getElementsByTagName("svg");if(0<n.length){var z=n[0].getAttribute("style");0<=d.indexOf("light-dark(")&&(null==z||0>z.indexOf("color-scheme"))&&(d+="; color-scheme: light dark"); n[0].setAttribute("style",(null!=z&&""!=z?z+"; ":"")+d);b="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(mxUtils.getXml(n[0]))))}}}catch(D){}return b};Graph.isSameOrigin=function(b){try{var d=document.createElement("a");d.setAttribute("href",b);return d.origin==window.location.origin}catch(m){return!1}}; Graph.prefixSvgIds=function(b,d,m){var p="fill stroke filter clip-path mask marker-start marker-mid marker-end style".split(" "),t=function(T){return T.replace(/url\(\s*(['"]?)#/g,"url($1#"+d)},n=function(T){return T.replace(/([^{}]*)(\{[^{}]*\})/g,function(c,f,k){f=f.replace(/([.#])(-?[A-Za-z_][\w-]*)/g,"$1"+d+"$2");if(null!=m){c=f.split(",");for(f=0;f<c.length;f++){var q=mxUtils.trim(c[f]);"svg"==q?c[f]=m:"svg "==q.substring(0,4)||"svg>"==q.substring(0,4)||"svg+"==q.substring(0,4)||"svg~"==q.substring(0, 4)?c[f]=m+q.substring(3):c[f]=""!=q?m+" "+q:q}f=c.join(", ")}return f+t(k)})};b=b.getElementsByTagName("*");for(var z=0;z<b.length;z++){var D=b[z],N=D.getAttribute("id");null!=N&&""!=N&&D.setAttribute("id",d+N);N=D.getAttribute("class");if(null!=N&&""!=N){var F=N.split(/\s+/);for(N=0;N<F.length;N++)""!=F[N]&&(F[N]=d+F[N]);D.setAttribute("class",F.join(" "))}if("style"==D.nodeName.toLowerCase())mxUtils.setTextContent(D,n(mxUtils.getTextContent(D)));else{for(N=0;N<p.length;N++)F=D.getAttribute(p[N]), null!=F&&0<=F.indexOf("url(")&&D.setAttribute(p[N],t(F));var P=["href","xlink:href"];for(N=0;N<P.length;N++)F=D.getAttribute(P[N]),null!=F&&"#"==F.charAt(0)&&D.setAttribute(P[N],"#"+d+F.substring(1))}}};Graph.getCssRules=function(b){var d=document.implementation.createHTMLDocument(""),m=document.createElement("style");mxUtils.setTextContent(m,b);d.body.appendChild(m);return m.sheet.cssRules}; Graph.canonicalizeSvgCssRules=function(b,d){var m=null;if(null!=b&&"data:image/svg+xml;base64,"==b.substring(0,26))try{var p=decodeURIComponent(escape(atob(b.substring(26)))),t=p.indexOf("<svg");if(0<=t){var n=document.createElement("div");n.innerHTML=Graph.sanitizeHtml(p.substring(t));var z=n.getElementsByTagName("svg");if(0<z.length){var D=z[0],N=new RegExp(d),F=D.getElementsByTagName("style");b=["fill","stroke","stop-color"];d=[];for(p=0;p<F.length;p++){var P=Graph.getCssRules(mxUtils.getTextContent(F[p])); t="";for(n=0;n<P.length;n++){var T=P[n];if(null!=T.selectorText&&N.test(T.selectorText))for(z=0;z<b.length;z++){var c=mxUtils.trim(T.style.getPropertyValue(b[z]));""!=c&&"url("!=c.substring(0,4)&&"var("!=c.substring(0,4)&&(T.style.setProperty(b[z],"var(--mx-r"+d.length+")"),d.push("--mx-r"+d.length+": "+c))}t+=T.cssText+"\n"}mxUtils.setTextContent(F[p],t)}0<d.length&&(null!=D.style&&""==D.style.getPropertyValue("color-scheme")&&(D.style.colorScheme="light dark"),m={uri:"data:image/svg+xml;base64,"+ btoa(unescape(encodeURIComponent(mxUtils.getXml(D)))),vars:d.join("; ")})}}}catch(f){}return m}; Graph.inlineSingleUseImages=function(b){for(var d=b.getElementsByTagName("use"),m={},p=[],t=0;t<d.length;t++){var n=d[t].getAttribute("href");null==n&&(n=d[t].getAttribute("xlink:href"));null!=n&&"#mx-image-"==n.substring(0,10)&&(m[n]=(m[n]||0)+1,p.push(d[t]))}for(t=0;t<p.length;t++)if(d=p[t],n=d.getAttribute("href"),null==n&&(n=d.getAttribute("xlink:href")),1==m[n]){n=b.querySelector('[id="'+n.substring(1)+'"]');var z=null!=n&&"symbol"==n.nodeName?n.getElementsByTagName("image")[0]:null;if(null!= z){z=z.cloneNode(!0);for(var D=d.attributes,N=0;N<D.length;N++){var F=D[N].name;"href"!=F&&"xlink:href"!=F&&z.setAttribute(F,D[N].value)}d.parentNode.replaceChild(z,d);n.parentNode.removeChild(n)}}}; Graph.replaceFontElements=function(b){var d="x-small small medium large x-large xx-large xxx-large".split(" "),m=b.getElementsByTagName("font");b=[];for(var p=0;p<m.length;p++)b.push(m[p]);for(p=0;p<b.length;p++){m=b[p];for(var t=null!=m.ownerDocument.createElementNS?m.ownerDocument.createElementNS(m.namespaceURI,"span"):m.ownerDocument.createElement("span"),n=m.attributes,z=0;z<n.length;z++){var D=n[z].name;"color"!=D&&"face"!=D&&"size"!=D&&t.setAttribute(D,n[z].value)}n=m.getAttribute("color"); null!=n&&""==t.style.color&&(/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$/.test(n)&&(n="#"+n),t.style.color=n);null!=m.getAttribute("face")&&""==t.style.fontFamily&&(t.style.fontFamily=m.getAttribute("face"));n=m.getAttribute("size");if(null!=n&&""==t.style.fontSize&&(z=parseInt(n),!isNaN(z))){if("+"==n.charAt(0)||"-"==n.charAt(0))z=3+z;t.style.fontSize=d[Math.max(0,Math.min(6,z-1))]}for(;null!=m.firstChild;)t.appendChild(m.firstChild);m.parentNode.replaceChild(t,m)}}; Graph.createSvgImageSymbol=function(b,d,m,p){null==d.keys&&(d.keys={},d.ids={});var t=m+"|"+p,n=d.keys[t];if(void 0===n){n=null;try{if(null!=b&&null!=m&&"data:image/svg+xml;base64,"==m.substring(0,26)){var z=decodeURIComponent(escape(atob(m.substring(26)))),D=z.indexOf("<svg");if(0<=D){var N=document.createElement("div");N.innerHTML=Graph.sanitizeHtml(z.substring(D));var F=N.getElementsByTagName("svg");if(0<F.length){var P=F[0],T=P.getAttribute("viewBox");if(null==T||""==T){var c=parseFloat(P.getAttribute("width")), f=parseFloat(P.getAttribute("height"));T=!isNaN(c)&&!isNaN(f)&&0<c&&0<f?"0 0 "+c+" "+f:null}if(null!=T){for(var k="mx-symbol-"+mxUtils.hashCode(t);null!=d.ids[k];)k+="-1";Graph.prefixSvgIds(P,k+"-","#"+k);var q=b.ownerDocument,y=null!=q.createElementNS?q.createElementNS(mxConstants.NS_SVG,"symbol"):q.createElement("symbol");y.setAttribute("id",k);y.setAttribute("viewBox",T);p||y.setAttribute("preserveAspectRatio","none");m="width height viewbox preserveaspectratio id x y version".split(" ");for(p= 0;p<P.attributes.length;p++){var A=P.attributes[p],E=A.name.toLowerCase();if("xmlns"!=E.substring(0,5)&&0>mxUtils.indexOf(m,E)){var K=A.value;if("class"==E){var Q=K.split(/\s+/);for(z=0;z<Q.length;z++)""!=Q[z]&&(Q[z]=k+"-"+Q[z]);K=Q.join(" ")}else 0<=K.indexOf("url(")&&(K=K.replace(/url\(\s*(['"]?)#/g,"url($1#"+k+"-"));y.setAttribute(A.name,K)}}var W=P.childNodes;for(p=0;p<W.length;p++)y.appendChild(null!=q.importNode?q.importNode(W[p],!0):W[p].cloneNode(!0));b.appendChild(y);d.ids[k]=t;n=k}}}}}catch(J){}d.keys[t]= n}return n};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(t,n){var z=t.getAttribute(n);if(null!=z){Graph.isPageLink(z)&&(z="#"+z.substring(z.indexOf(":")+1));var D=n;d&&"xlink:href"==n&&(t.removeAttribute(n),D="href");t.setAttribute(D,z)}}b=b.getElementsByTagName("a");if(null!=b)for(var p=0;p<b.length;p++)m(b[p],"href"),m(b[p],"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.shapeInsideMargin=2;Graph.prototype.getShapeInsidePadding=function(b){b=parseFloat(mxUtils.getValue(b,"shapeInsidePadding",this.shapeInsideMargin));return isFinite(b)&&0<=b?b:this.shapeInsideMargin};Graph.mirrorShapeInsideOutline=function(b){function d(m){if(null==m)return null;for(var p=[],t=0;t<m.length;t++)p.push([1-m[t][0],m[t][1]]);return p}return{left:d(b.right),right:d(b.left)}}; Graph.shapeInsideOutlines={rhombus:function(b,d,m){return{left:[[0,0],[.5,0],[0,.5],[.5,1],[0,1]],right:[[1,0],[.5,0],[1,.5],[.5,1],[1,1]]}},ellipse:function(b,d,m){b=[[0,0],[.5,0]];d=[[1,0],[.5,0]];for(m=1;20>m;m++){var p=m/20;p=p*p*(3-2*p);var t=.5*(1-Math.sqrt(1-Math.pow(2*p-1,2)));b.push([t,p]);d.push([1-t,p])}b.push([.5,1],[0,1]);d.push([.5,1],[1,1]);return{left:b,right:d}},triangle:function(b,d,m){d=mxUtils.getValue(b,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);m="1"==mxUtils.getValue(b, mxConstants.STYLE_FLIPH,"0");b="1"==mxUtils.getValue(b,mxConstants.STYLE_FLIPV,"0");if(d==mxConstants.DIRECTION_NORTH||d==mxConstants.DIRECTION_SOUTH){var p=m;m=b;b=p}d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST?m&&(d=d==mxConstants.DIRECTION_EAST?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_EAST):b&&(d=d==mxConstants.DIRECTION_NORTH?mxConstants.DIRECTION_SOUTH:mxConstants.DIRECTION_NORTH);return d==mxConstants.DIRECTION_NORTH?{left:[[0,0],[.5,0],[0,1]],right:[[1,0],[.5,0],[1, 1]]}:d==mxConstants.DIRECTION_SOUTH?{left:[[0,1],[.5,1],[0,0]],right:[[1,1],[.5,1],[1,0]]}:d==mxConstants.DIRECTION_WEST?{left:[[.5,0],[0,0],[0,1],[.5,1],[.5,.75],[0,.5],[.5,.25]],right:[[1,0],[.5,0],[.5,.25],[.999,.001],[.999,.999],[.5,.75],[.5,1],[1,1]]}:{left:[[0,0],[.5,0],[.5,.25],[.001,.001],[.001,.999],[.5,.75],[.5,1],[0,1]],right:[[.5,0],[1,0],[1,1],[.5,1],[.5,.75],[1,.5],[.5,.25]]}},hexagon:function(b,d,m){var p=mxUtils.getValue(b,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);p= p==mxConstants.DIRECTION_NORTH||p==mxConstants.DIRECTION_SOUTH;var t="0"!=mxUtils.getValue(b,"fixedSize","0"),n=p?m:d;b=t?Math.max(0,Math.min(.5*n,parseFloat(mxUtils.getValue(b,"size",20)))):n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(b,"size",.25))));if(b>n/2)return null;if(p)return d=b/m,{left:[[0,0],[.5,0],[0,d],[0,1-d],[.5,1],[0,1]],right:[[1,0],[.5,0],[1,d],[1,1-d],[.5,1],[1,1]]};d=b/d;return{left:[[0,0],[d,0],[0,.5],[d,1],[0,1]],right:[[1,0],[1-d,0],[1,.5],[1-d,1],[1,1]]}},parallelogram:function(b, d,m){if(mxUtils.getValue(b,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;m="0"!=mxUtils.getValue(b,"fixedSize","0")?Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(b,"size",20)))):d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(b,"size",.2))));if(m>d/2)return null;d=m/d;return"1"==mxUtils.getValue(b,mxConstants.STYLE_FLIPH,"0")!=("1"==mxUtils.getValue(b,mxConstants.STYLE_FLIPV,"0"))?{left:[[0,0],[0,1],[d,1]],right:[[1,0],[1-d,0],[1,1]]}:{left:[[0, 0],[d,0],[0,1]],right:[[1,0],[1,1],[1-d,1]]}},trapezoid:function(b,d,m){if(mxUtils.getValue(b,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;d=("0"!=mxUtils.getValue(b,"fixedSize","0")?Math.max(0,Math.min(.5*d,parseFloat(mxUtils.getValue(b,"size",20)))):d*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(b,"size",.2)))))/d;return"1"==mxUtils.getValue(b,mxConstants.STYLE_FLIPV,"0")?{left:[[0,1],[d,1],[0,0]],right:[[1,1],[1-d,1],[1,0]]}:{left:[[0,0], [d,0],[0,1]],right:[[1,0],[1-d,0],[1,1]]}},dataStorage:function(b,d,m){if(mxUtils.getValue(b,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;m="0"!=mxUtils.getValue(b,"fixedSize","0")?Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(b,"size",20)))):d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(b,"size",.1))));if(m>d/2)return null;d=m/d;m=[[0,0],[d,0]];for(var p=[[1,0]],t=1;12>t;t++){var n=t/12;m.push([d*(1-2*n)*(1-2*n),n]);p.push([1-4*d*n*(1- n),n])}m.push([d,1],[0,1]);p.push([1,1]);d={left:m,right:p};return"1"==mxUtils.getValue(b,mxConstants.STYLE_FLIPH,"0")?Graph.mirrorShapeInsideOutline(d):d},or:function(b,d,m){if(mxUtils.getValue(b,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;d=[[0,0]];for(m=1;24>m;m++){var p=m/24;p=p*p*(3-2*p);var t=Math.sqrt(2*(.5>=p?p:1-p));d.push([2*t-t*t,p])}d.push([0,1],[1,1],[1,0]);d={left:null,right:d};return"1"==mxUtils.getValue(b,mxConstants.STYLE_FLIPH, "0")?Graph.mirrorShapeInsideOutline(d):d},xor:function(b,d,m){if(mxUtils.getValue(b,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;d=[[0,0]];m=[[0,0]];for(var p=1;24>p;p++){var t=p/24;t=t*t*(3-2*t);var n=Math.sqrt(2*(.5>=t?t:1-t));d.push([t*(1-t),t]);m.push([2*n-n*n,t])}d.push([0,1]);m.push([0,1],[1,1],[1,0]);d={left:d,right:m};return"1"==mxUtils.getValue(b,mxConstants.STYLE_FLIPH,"0")?Graph.mirrorShapeInsideOutline(d):d},step:function(b,d,m){if(mxUtils.getValue(b, mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;m="0"!=mxUtils.getValue(b,"fixedSize","0")?Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(b,"size",20)))):d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(b,"size",.2))));if(m>d/2)return null;d=m/d;return"1"==mxUtils.getValue(b,mxConstants.STYLE_FLIPH,"0")?{left:[[0,0],[d,0],[0,.5],[d,1],[0,1]],right:[[1,0],[1-d,.5],[1,1]]}:{left:[[0,0],[d,.5],[0,1]],right:[[1,0],[1-d,0],[1,.5],[1-d,1],[1,1]]}}}; Object.setPrototypeOf(Graph.shapeInsideOutlines,null); Graph.shapeInsideBands={rhombus:function(b,d,m){return function(p){p=.5*Math.abs(2*p-1);return[p,1-p]}},ellipse:function(b,d,m){return function(p){p=.5*(1-Math.sqrt(Math.max(0,1-Math.pow(2*p-1,2))));return[p,1-p]}},triangle:function(b,d,m){d=mxUtils.getValue(b,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);m="1"==mxUtils.getValue(b,mxConstants.STYLE_FLIPH,"0");b="1"==mxUtils.getValue(b,mxConstants.STYLE_FLIPV,"0");if(d==mxConstants.DIRECTION_NORTH||d==mxConstants.DIRECTION_SOUTH){var p=m; m=b;b=p}d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST?m&&(d=d==mxConstants.DIRECTION_EAST?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_EAST):b&&(d=d==mxConstants.DIRECTION_NORTH?mxConstants.DIRECTION_SOUTH:mxConstants.DIRECTION_NORTH);return d==mxConstants.DIRECTION_NORTH?function(t){return[.5*(1-t),1-.5*(1-t)]}:d==mxConstants.DIRECTION_SOUTH?function(t){return[.5*t,1-.5*t]}:d==mxConstants.DIRECTION_WEST?function(t){return[Math.abs(2*t-1),1]}:function(t){return[0,1-Math.abs(2*t- 1)]}},hexagon:function(b,d,m){var p=mxUtils.getValue(b,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);p=p==mxConstants.DIRECTION_NORTH||p==mxConstants.DIRECTION_SOUTH;var t="0"!=mxUtils.getValue(b,"fixedSize","0"),n=p?m:d;b=t?Math.max(0,Math.min(.5*n,parseFloat(mxUtils.getValue(b,"size",20)))):n*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(b,"size",.25))));if(b>n/2)return null;if(p){var z=b/m;return function(N){N=.5*Math.max(0,0<z?Math.max(1-N/z,1-(1-N)/z):0);return[N,1-N]}}var D=b/ d;return function(N){N=D*Math.abs(2*N-1);return[N,1-N]}},parallelogram:function(b,d,m){if(mxUtils.getValue(b,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;m="0"!=mxUtils.getValue(b,"fixedSize","0")?Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(b,"size",20)))):d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(b,"size",.2))));if(m>d/2)return null;var p=m/d,t="1"==mxUtils.getValue(b,mxConstants.STYLE_FLIPH,"0")!=("1"==mxUtils.getValue(b,mxConstants.STYLE_FLIPV, "0"));return function(n){return t?[p*n,1-p*(1-n)]:[p*(1-n),1-p*n]}},trapezoid:function(b,d,m){if(mxUtils.getValue(b,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;var p=("0"!=mxUtils.getValue(b,"fixedSize","0")?Math.max(0,Math.min(.5*d,parseFloat(mxUtils.getValue(b,"size",20)))):d*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(b,"size",.2)))))/d,t="1"==mxUtils.getValue(b,mxConstants.STYLE_FLIPV,"0");return function(n){n=t?p*n:p*(1-n);return[n,1- n]}},dataStorage:function(b,d,m){if(mxUtils.getValue(b,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;m="0"!=mxUtils.getValue(b,"fixedSize","0")?Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(b,"size",20)))):d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(b,"size",.1))));if(m>d/2)return null;var p=m/d,t="1"==mxUtils.getValue(b,mxConstants.STYLE_FLIPH,"0");return function(n){var z=p*(1-2*n)*(1-2*n);n=1-4*p*n*(1-n);return t?[1-n,1-z]:[z,n]}},or:function(b, d,m){if(mxUtils.getValue(b,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;var p="1"==mxUtils.getValue(b,mxConstants.STYLE_FLIPH,"0");return function(t){t=Math.sqrt(2*Math.min(t,1-t));t=2*t-t*t;return p?[1-t,1]:[0,t]}},xor:function(b,d,m){if(mxUtils.getValue(b,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;var p="1"==mxUtils.getValue(b,mxConstants.STYLE_FLIPH,"0");return function(t){var n=Math.sqrt(2* Math.min(t,1-t));t*=1-t;n=2*n-n*n;return p?[1-n,1-t]:[t,n]}},step:function(b,d,m){if(mxUtils.getValue(b,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST)!=mxConstants.DIRECTION_EAST)return null;m="0"!=mxUtils.getValue(b,"fixedSize","0")?Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(b,"size",20)))):d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(b,"size",.2))));if(m>d/2)return null;var p=m/d,t="1"==mxUtils.getValue(b,mxConstants.STYLE_FLIPH,"0");return function(n){var z=p*(1-Math.abs(2* n-1));n=1-p*Math.abs(2*n-1);return t?[1-n,1-z]:[z,n]}}};Object.setPrototypeOf(Graph.shapeInsideBands,null);Graph.prototype.getShapeInsideBands=function(b,d,m){var p=null;if(null!=b&&0<d&&0<m){var t=mxUtils.getValue(b,"shapeInsideShape",null);if(null==t||""==t)t=mxUtils.getValue(b,mxConstants.STYLE_SHAPE,null);t=Graph.shapeInsideBands[t];"function"===typeof t&&(p=t(b,d,m))}return p}; Graph.prototype.createShapeInsideTextFlow=function(b,d,m){var p=this.getShapeInsideBands(b,d,m),t=null;if(null!=p){t=this.getShapeInsideBox(b,d,m);var n=this.getShapeInsidePadding(b),z=t.x,D=t.y;t={boxWidth:t.width,boxHeight:t.height,valign:mxUtils.getValue(b,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),align:mxUtils.getValue(b,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),available:function(N,F){function P(f){f+=D;return 0>f||f>m?[0,1]:p(Math.max(0,Math.min(1,f/m)))}var T=P(N); N=P((N+F)/2);F=P(F);var c=Math.max(T[0],N[0],F[0])*d-z+n;return{x:Math.max(0,c),width:Math.max(0,Math.min(T[1],N[1],F[1])*d-z-n-Math.max(0,c))}}}}return t};Graph.prototype.getShapeInsideOutline=function(b,d,m){var p=null;if(null!=b&&0<d&&0<m){var t=mxUtils.getValue(b,"shapeInsideShape",null);if(null==t||""==t)t=mxUtils.getValue(b,mxConstants.STYLE_SHAPE,null);t=Graph.shapeInsideOutlines[t];"function"===typeof t&&(p=t(b,d,m))}return p}; Graph.prototype.isShapeInsideEnabled=function(b){return null!=b&&"1"==mxUtils.getValue(b,"shapeInside","0")&&"wrap"==mxUtils.getValue(b,mxConstants.STYLE_WHITE_SPACE,null)&&"0"!=mxUtils.getValue(b,mxConstants.STYLE_HORIZONTAL,"1")&&"visible"==mxUtils.getValue(b,mxConstants.STYLE_OVERFLOW,"visible")&&null==mxUtils.getValue(b,mxConstants.STYLE_LABEL_WIDTH,null)&&mxUtils.getValue(b,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER)==mxConstants.ALIGN_CENTER&&mxUtils.getValue(b,mxConstants.STYLE_VERTICAL_LABEL_POSITION, mxConstants.ALIGN_MIDDLE)==mxConstants.ALIGN_MIDDLE};Graph.prototype.getShapeInsideFloats=function(b,d,m){return this.isShapeInsideEnabled(b)?this.getShapeInsideOutline(b,d,m):null}; Graph.prototype.getShapeInsideBox=function(b,d,m){var p=parseFloat(mxUtils.getValue(b,mxConstants.STYLE_SPACING,2)),t=p+parseFloat(mxUtils.getValue(b,mxConstants.STYLE_SPACING_TOP,0)),n=p+parseFloat(mxUtils.getValue(b,mxConstants.STYLE_SPACING_BOTTOM,0)),z=p+parseFloat(mxUtils.getValue(b,mxConstants.STYLE_SPACING_LEFT,0));p+=parseFloat(mxUtils.getValue(b,mxConstants.STYLE_SPACING_RIGHT,0));var D=mxSvgCanvas2D.prototype.foreignObjectPadding;mxUtils.getValue(b,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)== mxConstants.ALIGN_TOP&&(t+=mxText.prototype.baseSpacingTop);return new mxRectangle(z-D/2,t,Math.max(1,Math.round(d-z-p+D)),Math.max(1,Math.round(m-t-n)))}; Graph.prototype.createShapeInsideMarkup=function(b,d,m,p,t,n,z){function D(q,y,A){for(var E=[],K=0;K<q.length;K++){var Q=q[K],W=q[(K+1)%q.length],J=A?Q[1]<=y:Q[1]>=y,ea=A?W[1]<=y:W[1]>=y;J&&E.push(Q);J!=ea&&W[1]!=Q[1]&&E.push([Q[0]+(W[0]-Q[0])*(y-Q[1])/(W[1]-Q[1]),y])}return E}function N(q,y,A){for(var E=[],K=0;K<q.length;K++)E.push([q[K][0]*p-d.x-y,f+q[K][1]*t-d.y]);E=D(D(E,0,!1),k,!0);q=[];for(K=0;K<E.length;K++)q.push(Math.round(100*Math.max(.05,Math.min(99.95,E[K][0]/A*100)))/100+"% "+Math.round(100* Math.max(.05,Math.min(99.95,E[K][1]/k*100)))/100+"%");return 2<q.length?"polygon("+q.join(", ")+")":null}function F(q,y,A){return'<div data-shape-inside="1" contenteditable="false" style="float:'+q+";width:"+y+"px;height:"+k+"px;shape-outside:"+A+";shape-margin:"+c+'px;pointer-events:none;"></div>'}var P=Math.floor(d.width/2),T=d.width-P,c=null!=n?n:this.shapeInsideMargin;n="";var f=null!=m&&0>m?Math.round(-m):0,k=Math.round(null!=z?Math.max(0,Math.min(z,d.height)):d.height)+f;z=null!=b.left?N(b.left, 0,P):null;b=null!=b.right?N(b.right,P,T):null;null!=z&&(n+=F("left",P,z));null!=b&&(n+=F("right",T,b));null!=m&&0<m&&(n+='<div data-shape-inside="1" contenteditable="false" style="height:'+Math.round(m)+'px;pointer-events:none;"></div>');return n};Graph.prototype.getShapeInsideGrow=function(b,d){return null!=b&&0>b?d==mxConstants.ALIGN_BOTTOM?-b:-2*b:0}; Graph.prototype.createShapeInsideValue=function(b,d,m,p,t,n,z,D,N){D=Math.round(d.height+this.getShapeInsideGrow(m,D));return'<div style="float:left;width:'+Math.round(d.width)+"px;height:"+D+'px;">'+this.createShapeInsideMarkup(b,d,m,p,t,z,N)+n+"</div>"}; Graph.prototype.measureShapeInsideFlow=function(b,d,m,p,t,n,z,D,N){var F=null;if(null!=document.body){var P=Graph.shapeInsideMeasureDiv;null==P&&(P=document.createElement("div"),P.style.position="absolute",P.style.visibility="hidden",P.style.left="-9999px",P.style.top="0px",P.style.boxSizing="border-box",document.body.appendChild(P),Graph.shapeInsideMeasureDiv=P);D=null!=D?D:parseFloat(mxUtils.getValue(d,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE));var T=parseInt(mxUtils.getValue(d,mxConstants.STYLE_FONTSTYLE, 0));P.style.width=p.width+"px";P.style.fontFamily=mxUtils.getValue(d,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);P.style.fontSize=Math.round(D)+"px";P.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?D*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*mxSvgCanvas2D.prototype.lineHeightCorrection;P.style.fontWeight=(T&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold":"normal";P.style.fontStyle=(T&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic":"";P.style.textAlign= mxUtils.getValue(d,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER);P.style.whiteSpace="normal";P.style.wordWrap=mxConstants.WORD_WRAP;P.innerHTML=this.createShapeInsideMarkup(m,p,t,n,z,this.getShapeInsidePadding(d),N)+b;b=P.getBoundingClientRect();z=document.createTreeWalker(P,NodeFilter.SHOW_TEXT,null);p=m=d=null;for(t=[];z.nextNode();)for(n=document.createRange(),n.selectNodeContents(z.currentNode),D=n.getClientRects(),n=0;n<D.length;n++)0<D[n].width&&0<D[n].height&&(d=null==d?D[n].top:Math.min(d, D[n].top),m=null==m?D[n].bottom:Math.max(m,D[n].bottom),p=null==p?D[n].right:Math.max(p,D[n].right),t.push([D[n].top-b.top,D[n].bottom-b.top]));if(null!=d){t.sort(function(c,f){return c[0]-f[0]});F=[];for(n=0;n<t.length;n++)z=0<F.length?F[F.length-1]:null,null!=z&&t[n][0]<z[1]-2?z[1]=Math.max(z[1],t[n][1]):F.push(t[n]);F={top:d-b.top,bottom:m-b.top,right:p-b.left,lines:F}}P.innerHTML=""}return F}; Graph.prototype.computeShapeInsideSpacer=function(b,d,m,p,t,n){var z=mxUtils.getValue(d,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),D=parseFloat(mxUtils.getValue(d,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE))*mxConstants.LINE_HEIGHT,N=z!=mxConstants.ALIGN_BOTTOM,F=this,P=null,T=0;if(z!=mxConstants.ALIGN_TOP){var c=function(J,ea,X){var aa=null;if(null!=J)for(var ka=0;ka<J.length;ka++){var ja=J[ka],ua=J[(ka+1)%J.length];ja[1]!=ua[1]&&ea>=Math.min(ja[1],ua[1])&&ea<=Math.max(ja[1], ua[1])&&(ja=ja[0]+(ua[0]-ja[0])*(ea-ja[1])/(ua[1]-ja[1]),aa=null==aa?ja:X?Math.max(aa,ja):Math.min(aa,ja))}return aa};T=c(m.left,.999,!0);c=c(m.right,.999,!1);var f=24<=((null==c?1:c)-(null==T?0:T))*t;T=function(J){for(var ea=null,X=[],aa=null,ka=null,ja=function(O){var S=F.measureShapeInsideFlow(b,d,m,p,O,t,n);if(null==S)return null;var V=Math.min(0,O),Z=S.top+V;V=S.bottom+V;null==P&&(P=V-Z);var ba=P>p.height,ha=V<=p.height+.5&&(J||-.5<=Z),na=null;J?ba?na=Math.abs(p.height-V):0<=O&&(na=ha?p.height- V:f?1.5*(V-p.height):null):na=ha?Math.abs(Z-(p.height-V)):Math.abs(Z+V-p.height);var oa=!J||ba;null!=na&&(null==ea||oa&&ha&&!ea.fits||(!oa||ha==ea.fits)&&na<ea.score)&&(ea={spacer:O,score:na,fits:ha});O={spacer:O,top:Z,btm:V,overflow:ba,lines:S.lines.length};X.push(O);return O},ua=function(){return null!=ea&&ea.fits&&1>=ea.score},Ba=0,ia=0;ia<(J?8:5);ia++){var l=ja(Ba);if(null==l)return null;if(ua())break;var v=J?Ba+p.height-l.btm:Ba+(p.height-l.top-l.btm)/2;if(J){if(l.btm<=p.height+.5)aa=null==aa? Ba:Math.max(aa,Ba);else if(null==aa||Ba>aa)ka=null==ka?Ba:Math.min(ka,Ba);null!=aa&&null!=ka&&1<ka-aa&&(v=(aa+ka)/2);l.overflow||(v=Math.max(0,v))}if(Math.round(v)==Math.round(Ba))break;Ba=v}if(!J&&!ua())for(aa=function(O,S){return O.lines==S.lines&&1>=Math.abs(S.btm-S.top-(O.btm-O.top))},ka=X.slice().sort(function(O,S){return O.spacer-S.spacer}),Ba=8,ia=0;ia<ka.length-1&&0<Ba&&!ua();ia++)for(l=ka[ia],v=ka[ia+1];0<Ba&&!ua()&&!aa(l,v)&&1<v.spacer-l.spacer;){var H=Math.round((l.spacer+v.spacer)/2); if(H<=l.spacer||H>=v.spacer)break;H=ja(H);Ba--;if(null==H)break;else aa(l,H)?l=H:v=H}return ea};c=T(z==mxConstants.ALIGN_BOTTOM);z==mxConstants.ALIGN_BOTTOM&&null!=P&&P>p.height&&(null==c||!c.fits||c.score>2*D)&&(c=T(!1),N=!0);T=Math.round(null!=c?c.spacer:0)}c=function(J){var ea=null,X=F.measureShapeInsideFlow(b,d,m,p,J,t,n);if(null!=X&&0<X.lines.length){J=Math.max(0,-J);for(var aa=Math.round(p.height)+J,ka=X.lines.length;0<ka&&X.lines[ka-1][0]>=aa-1;)ka--;ka<X.lines.length&&(aa=0<ka?X.lines[ka][0]- X.lines[ka-1][1]:0,X.lines[X.lines.length-1][1]-X.lines[ka][0]<=2*D+2&&(0==ka||2<aa)&&(ea=0<ka?X.lines[ka-1][1]-J:0))}return ea};var k=c(T);if(null!=k&&z!=mxConstants.ALIGN_TOP){z=function(J,ea){ea=Math.min(0,ea);return N?Math.abs(p.height-(J.top+ea)-(J.bottom+ea)):Math.abs(p.height-(J.bottom+ea))};for(var q=this.measureShapeInsideFlow(b,d,m,p,T,t,n,null,k),y=0;3>y&&null!=q;y++){var A=Math.min(0,T);A=Math.round(N?(p.height-(q.top+A)-(q.bottom+A))/2:p.height-(q.bottom+A));for(var E=!1,K=0;2>K&&0!= A;K++){var Q=c(T+A);Q=null!=Q?Q:k+A;var W=this.measureShapeInsideFlow(b,d,m,p,T+A,t,n,null,Q);if(null!=W&&z(W,T+A)<z(q,T)&&(N||W.bottom+Math.min(0,T+A)<=p.height+.5)){T+=A;k=Q;q=W;E=!0;break}A=Math.round(A/2)}if(!E)break}}return{spacer:Math.round(T),clip:null!=k?Math.round(k):null}}; Graph.prototype.computeShapeInsideFontSize=function(b,d,m,p,t){var n=this.getShapeInsideBox(d,p,t);if(null==this.measureShapeInsideFlow(b,d,m,n,0,p,t,1))return null;for(var z=1,D=84;z<D;){var N=Math.ceil((z+D)/2),F=this.measureShapeInsideFlow(b,d,m,n,0,p,t,N);null!=F&&F.bottom<=n.height+.5&&F.right<=n.width+.5?z=N:D=N-1}return Math.max(6,z)}; Graph.prototype.getShapeInsideSpacer=function(b,d,m,p,t,n){var z=[p.width,p.height,this.getShapeInsidePadding(b.style),(m.left||[]).join(";"),(m.right||[]).join(";"),mxUtils.getValue(b.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),mxUtils.getValue(b.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),mxUtils.getValue(b.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),mxUtils.getValue(b.style,mxConstants.STYLE_FONTSTYLE,0),d].join("|");b.shapeInsideSpacerKey!= z&&(b.shapeInsideSpacerKey=z,b.shapeInsideSpacerValue=this.computeShapeInsideSpacer(d,b.style,m,p,t,n));return b.shapeInsideSpacerValue};var graphMxTextPaint=mxText.prototype.paint; mxText.prototype.paint=function(b,d){var m=this.state,p=null!=m&&null!=m.view&&m.view.graph instanceof Graph?m.view.graph:null,t=null,n=null;if(!d&&null!=p&&"function"===typeof p.getShapeInsideFloats&&"string"===typeof this.value&&""!=this.value&&null!=m.cell&&p.model.isVertex(m.cell)){var z=m.view.scale,D=m.width/z;z=m.height/z;var N=p.getShapeInsideFloats(m.style,D,z);if(null!=N)if("1"==mxUtils.getValue(m.style,"convertToSvg","0"))b.textFlow=p.createShapeInsideTextFlow(m.style,D,z),n=b;else{var F= p.getShapeInsideBox(m.style,D,z);t=this.value;var P=mxUtils.replaceTrailingNewlines(t,"<div><br></div>"),T=p.getShapeInsideSpacer(m,P,N,F,D,z);this.value=p.createShapeInsideValue(N,F,T.spacer,D,z,P,p.getShapeInsidePadding(m.style),mxUtils.getValue(m.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),T.clip)}}try{graphMxTextPaint.apply(this,arguments)}finally{null!=t&&(this.value=t),null!=n&&(n.textFlow=null)}};var graphMxTextRedraw=mxText.prototype.redraw; mxText.prototype.redraw=function(){var b=this.state,d=null!=b&&null!=b.view&&b.view.graph instanceof Graph?b.view.graph:null;if(null!=d&&"function"===typeof d.getShapeInsideFloats&&"string"===typeof this.value&&""!=this.value&&null!=b.cell&&d.model.isVertex(b.cell)){var m=b.view.scale,p=b.width/m;m=b.height/m;var t=d.getShapeInsideFloats(b.style,p,m);b=Math.round(p)+":"+Math.round(m)+":"+d.getShapeInsidePadding(b.style)+":"+(null!=t?(t.left||[]).join(";")+"|"+(t.right||[]).join(";"):"");this.shapeInsideKey!= b&&(this.shapeInsideKey=b,this.lastValue=null)}graphMxTextRedraw.apply(this,arguments)};Graph.edgeSupportsCurved=function(b){b=mxUtils.getValue(b,mxConstants.STYLE_SHAPE,null);return null==b||"connector"==b||"filledEdge"==b||"wire"==b||"pipe"==b||"link"==b||"flexArrow"==b}; Graph.getCurvePoints=function(b,d){var m=b.length;if(3>m||0<=b.indexOf(null))return b;var p=[b[0]],t=function(T,c,f){for(var k=1;16>=k;k++){var q=k/16,y=1-q;p.push(new mxPoint(y*y*T.x+2*y*q*c.x+q*q*f.x,y*y*T.y+2*y*q*c.y+q*q*f.y))}};if(d&&0==(m-1)%3)for(d=1;d+2<m;d+=3){t=b[d-1];for(var n=b[d],z=b[d+1],D=b[d+2],N=1;16>=N;N++){var F=N/16,P=1-F;p.push(new mxPoint(P*P*P*t.x+3*P*P*F*n.x+3*P*F*F*z.x+F*F*F*D.x,P*P*P*t.y+3*P*P*F*n.y+3*P*F*F*z.y+F*F*F*D.y))}}else{n=b[0];for(d=1;d<m-2;d++)z=new mxPoint((b[d].x+ b[d+1].x)/2,(b[d].y+b[d+1].y)/2),t(n,b[d],z),n=z;t(n,b[m-2],b[m-1])}return p}; Graph.getEdgeLabelAngle=function(b,d,m){var p=null!=b?b.absolutePoints:null;if(null==p||2>p.length)return null;b=b.style;null==b||1!=b[mxConstants.STYLE_CURVED]&&1!=b[mxConstants.STYLE_BEZIER]||(p=Graph.getCurvePoints(p,1==b[mxConstants.STYLE_BEZIER]));for(var t=b=null,n=1;n<p.length;n++){var z=p[n-1],D=p[n];if(null!=z&&null!=D){var N=D.x-z.x;D=D.y-z.y;var F=N*N+D*D,P=0==F?0:Math.max(0,Math.min(1,((d-z.x)*N+(m-z.y)*D)/F));F=d-(z.x+P*N);z=m-(z.y+P*D);z=F*F+z*z;if(null==t||z<t)t=z,b=180*Math.atan2(D, N)/Math.PI}}return b};Graph.getLabelAutoRotation=function(b){if(null==b||"1"!=mxUtils.getValue(b.style,"labelAutoRotate","0"))return null;var d=b.view.graph.model,m=null;if(d.isEdge(b.cell)){m=b;var p=b.absoluteOffset.x;var t=b.absoluteOffset.y}else d.isEdge(d.getParent(b.cell))&&(m=b.view.getState(d.getParent(b.cell)),p=b.getCenterX(),t=b.getCenterY());b=null!=m?Graph.getEdgeLabelAngle(m,p,t):null;null!=b&&(b=mxUtils.mod(b,360),90<b&&270>b&&(b-=180));return b};var mxTextGetTextRotation=mxText.prototype.getTextRotation; mxText.prototype.getTextRotation=function(){var b=null!=this.state?Graph.getLabelAutoRotation(this.state):null;return null!=b?b:mxTextGetTextRotation.apply(this,arguments)};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;Graph.prototype.defaultConnectionArrowsEnabled=!0;Graph.prototype.defaultConnectable=!0;Graph.prototype.defaultFoldingEnabled=!0;Graph.prototype.lightbox=!1;Graph.prototype.diagramBackgroundColor="#f0f0f0";Graph.prototype.enableDiagramBackground=!1;Graph.prototype.defaultPageBackgroundColor="1"==urlParams.embedInline?"transparent":Editor.getDefaultPageBackgroundColor(); Graph.prototype.defaultPageBorderColor="light-dark(#ffffff, #000000)";Graph.prototype.shapeForegroundColor="light-dark(#000000, #ffffff)";Graph.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","note"];Graph.prototype.showNoteIcons=!0;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,p){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var t=m.view.graph.tolerance,n=!0,z=null,D=mxUtils.bind(this,function(P){n=!0;z=new mxPoint(mxEvent.getClientX(P),mxEvent.getClientY(P))}),N=mxUtils.bind(this,function(P){n=n&&null!=z&&Math.abs(z.x-mxEvent.getClientX(P))<t&&Math.abs(z.y-mxEvent.getClientY(P))<t}),F=mxUtils.bind(this,function(P){if(n)for(var T=mxEvent.getSource(P);null!= T&&T!=p.node;){if("a"==T.nodeName.toLowerCase()){m.view.graph.labelLinkClicked(m,T,P);break}T=T.parentNode}});mxEvent.addGestureListeners(p.node,D,N,F);mxEvent.addListener(p.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&&(null!=Editor.tooltipFontSize&&(this.div.style.fontSize=Editor.tooltipFontSize+"px"),0<Editor.tooltipMaxWidth&&(this.div.style.maxWidth=Editor.tooltipMaxWidth+ "px"),mxEvent.addListener(this.div,"click",mxUtils.bind(this,function(m){var p=mxEvent.getSource(m);"A"==p.nodeName&&(p=p.getAttribute("href"),null!=p&&this.graph.isCustomLink(p)&&(mxEvent.isTouchEvent(m)||!mxEvent.isPopupTrigger(m))&&this.graph.customLinkClicked(p)&&mxEvent.consume(m))})))}}this.initTransparentBoundsStyleSync();this.initLayoutManager()}; Graph.prototype.initTransparentBoundsStyleSync=function(){this.model.addListener(mxEvent.BEFORE_UNDO,mxUtils.bind(this,function(b,d){b=d.getProperty("edit");if(null!=b&&null!=b.changes){d=this.getStylesheet();for(var m=b.changes.length,p=0;p<m;p++){var t=b.changes[p];if(t instanceof mxStyleChange&&this.model.isVertex(t.cell)){var n=d.getCellStyle(t.previous),z=d.getCellStyle(t.style);z=null!=z&&1==z.transparentBounds;if((null!=n&&1==n.transparentBounds)!=z&&(n=this.getCellGeometry(t.cell),null!=n))if(z){if(0!= n.x||0!=n.y)for(var D=this.model.getChildCount(t.cell),N=0;N<D;N++)this.translateCell(this.model.getChildAt(t.cell,N),n.x,n.y);if(0!=n.x||0!=n.y||0!=n.width||0!=n.height)n=n.clone(),n.x=0,n.y=0,n.width=0,n.height=0,this.model.setGeometry(t.cell,n)}else if(z=this.getTransparentBounds(t.cell),null!=z&&(n=n.clone(),n.x+=z.x,n.y+=z.y,n.width=z.width,n.height=z.height,this.model.setGeometry(t.cell,n),0!=z.x||0!=z.y))for(D=this.model.getChildCount(t.cell),N=0;N<D;N++)this.translateCell(this.model.getChildAt(t.cell, N),-z.x,-z.y)}}}}))}; Graph.prototype.waitForBrowserTranslate=function(){var b=this;if(Graph.isBrowserTranslated())this.initBrowserTranslate(),this.btActive=!0,this.activateBrowserTranslate();else{var d=function(){if(null!=b.btClassObservers&&Graph.isBrowserTranslated()){for(var n=0;n<b.btClassObservers.length;n++)b.btClassObservers[n].disconnect();b.btClassObservers=null;b.initBrowserTranslate();b.btActive=!0;b.activateBrowserTranslate()}};this.btClassObservers=[];var m={attributes:!0,attributeFilter:["class"]},p=new MutationObserver(d); p.observe(document.documentElement,m);this.btClassObservers.push(p);try{if(window.parent!=window&&null!=window.parent.document&&window.parent.document.documentElement!=document.documentElement){var t=new MutationObserver(d);t.observe(window.parent.document.documentElement,m);this.btClassObservers.push(t)}}catch(n){}}}; Graph.prototype.initBrowserTranslate=function(){var b=this;this.btMirrorMap=new Map;this.btRebuilding=!1;var d=document;try{window.parent!=window&&null!=window.parent.document&&(d=window.parent.document)}catch(p){}var m=d.createElement("div");m.id="bt-mirror";m.setAttribute("aria-hidden","true");m.style.cssText="position:fixed;left:-10000px;top:0;width:1px;overflow:hidden;";d.body.appendChild(m);this.btMirrorContainer=m;this.btObserver=new MutationObserver(function(p){if(!b.btRebuilding){b.btActive|| (b.btActive=!0,b.activateBrowserTranslate());for(var t=0;t<p.length;t++){for(var n=p[t].target;null!=n&&null!=n.parentNode&&n.parentNode!=b.btMirrorContainer;)n=n.parentNode;if(null!=n){var z=b.btMirrorMap.get(n);null!=z&&b.syncTranslationToForeignObject(n,z)}}}});this.btObserver.observe(m,{childList:!0,subtree:!0,characterData:!0});this.refreshBrowserTranslateMirror()}; Graph.prototype.activateBrowserTranslate=function(){this.addListener(mxEvent.SIZE,mxUtils.bind(this,function(){this.refreshBrowserTranslateMirror()}));var b=mxUtils.bind(this,function(){this.refreshBrowserTranslateMirror()});this.addListener(mxEvent.LABEL_CHANGED,b);this.addListener(mxEvent.CELLS_ADDED,b);this.getModel().addListener(mxEvent.CHANGE,function(){setTimeout(b,0)})}; Graph.prototype.addBrowserTranslateMirror=function(b){if(null!=this.btMirrorContainer)if("http://www.w3.org/1999/xhtml"==b.namespaceURI){b=document.createTreeWalker(b,NodeFilter.SHOW_TEXT,null,!1);for(var d;null!=(d=b.nextNode());){var m=d.data;if(null!=m&&0<m.trim().length){var p=document.createElement("p");p.style.cssText="margin:0;";p.textContent=m;p.setAttribute("data-bt-original",m);this.btMirrorContainer.appendChild(p);this.btMirrorMap.set(p,d)}}}else m=b.textContent,null!=m&&0<m.length&&(p= document.createElement("p"),p.style.cssText="margin:0;",p.textContent=m,p.setAttribute("data-bt-original",m),this.btMirrorContainer.appendChild(p),this.btMirrorMap.set(p,b))};Graph.prototype.syncTranslationToForeignObject=function(b,d){var m=b.textContent;if(m!=(3==d.nodeType?d.data:d.textContent))if(3==d.nodeType)d.data=m;else if(b=d.querySelectorAll("tspan"),0==b.length)d.textContent=m;else if(1==b.length)b[0].textContent=m;else for(b[0].textContent=m,d=1;d<b.length;d++)b[d].textContent=""}; Graph.prototype.refreshBrowserTranslateMirror=function(){if(null!=this.btMirrorContainer&&null!=this.container){this.btRebuilding=!0;var b={},d=0;if(null!=this.btTranslationCache)for(var m in this.btTranslationCache)b[m]=this.btTranslationCache[m],d++;for(var p=this.btMirrorContainer.children,t=0;t<p.length;t++){var n=p[t].getAttribute("data-bt-original"),z=p[t].textContent;null!=n&&z!=n&&(b[n]=z,d++)}this.btMirrorMap.clear();this.btMirrorContainer.innerHTML="";n=this.container.querySelector("svg"); if(null!=n){p=n.querySelectorAll("text");for(t=z=0;t<p.length;t++)null==p[t].closest("foreignObject")&&(this.addBrowserTranslateMirror(p[t]),z++);n=n.querySelectorAll("foreignObject > div");for(t=p=0;t<n.length;t++)this.addBrowserTranslateMirror(n[t]),p++}if(0<d){d={};for(m in b)d[b[m]]=m;m=0;p=this.btMirrorContainer.children;for(t=0;t<p.length;t++)n=p[t].getAttribute("data-bt-original"),null!=n&&null!=d[n]&&(n=d[n],p[t].setAttribute("data-bt-original",n)),n=null!=n?b[n]:null,null!=n&&(p[t].textContent= n,n=this.btMirrorMap.get(p[t]),null!=n&&this.syncTranslationToForeignObject(p[t],n),m++)}this.btRebuilding=!1}};Graph.prototype.getBrowserTranslationCache=function(){if(null==this.btMirrorContainer)return null;for(var b={},d=0,m=this.btMirrorContainer.children,p=0;p<m.length;p++){var t=m[p].getAttribute("data-bt-original"),n=m[p].textContent;null!=t&&n!=t&&(b[t]=n,d++)}return 0<d?b:null}; Graph.prototype.applyBrowserTranslationCache=function(b){if(null!=b&&null!=this.btMirrorContainer){this.btTranslationCache=b;this.btRebuilding=!0;for(var d=this.btMirrorContainer.children,m=0;m<d.length;m++){var p=d[m].getAttribute("data-bt-original");p=null!=p?b[p]:null;null!=p&&(d[m].textContent=p,p=this.btMirrorMap.get(d[m]),null!=p&&this.syncTranslationToForeignObject(d[m],p))}this.btRebuilding=!1}}; Graph.prototype.destroyBrowserTranslate=function(){if(null!=this.btClassObservers){for(var b=0;b<this.btClassObservers.length;b++)this.btClassObservers[b].disconnect();this.btClassObservers=null}null!=this.btObserver&&(this.btObserver.disconnect(),this.btObserver=null);null!=this.btMirrorContainer&&null!=this.btMirrorContainer.parentNode&&(this.btMirrorContainer.parentNode.removeChild(this.btMirrorContainer),this.btMirrorContainer=null);null!=this.btMirrorMap&&(this.btMirrorMap.clear(),this.btMirrorMap= null)};var graphDestroy=Graph.prototype.destroy;Graph.prototype.destroy=function(){this.destroyBrowserTranslate();graphDestroy.apply(this,arguments)}; (function(){Graph.prototype.useCssTransforms=!1;Graph.prototype.currentScale=1;Graph.prototype.currentTranslate=new mxPoint(0,0);Graph.prototype.pasteEdgeStyle=!1;Graph.prototype.pasteStylesToText=!1;Graph.prototype.isFillState=function(z){var D=mxUtils.getValue(z.style,mxConstants.STYLE_SHAPE,null);return!this.isSpecialColor(z.style[mxConstants.STYLE_FILLCOLOR])&&"1"!=mxUtils.getValue(z.style,"lineShape",null)&&"mxgraph.basic.arc"!=D&&(this.model.isVertex(z.cell)||"arrow"==D||"pipe"==D||"wire"== D||"filledEdge"==D||"flexArrow"==D||"mermaidSankeyLink"==D||"mxgraph.arrows2.wedgeArrow"==D)};Graph.prototype.isGradientState=function(z){var D=mxUtils.getValue(z.style,mxConstants.STYLE_SHAPE,null);return this.isFillState(z)&&"wire"!=D&&"pipe"!=D};Graph.prototype.isStrokeState=function(z){return!0};Graph.prototype.getTextColor=function(z,D){var N=D?"color":"background-color",F=null;if(null!=z&&window.getSelection)for(var P=window.getSelection(),T=z.getElementsByTagName("*"),c=0;c<T.length&&null== F;c++)null!=T[c].style&&P.containsNode(T[c],!0)&&(F=Graph.getGivenColor(T[c],N));for(;null==F&&null!=z&&z!=this.cellEditor.textarea.parentNode;)F=z==this.cellEditor.textarea&&D?"default":Graph.getGivenColor(z,N),z=z.parentNode;if("rgba(0, 0, 0, 0)"==F||"transparent"==F)F=mxConstants.NONE;return F};Graph.prototype.isSpecialColor=function(z){return 0<=mxUtils.indexOf([mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_FILLCOLOR,"inherit","swimlane","indicated"],z)};Graph.prototype.isGlassState=function(z){z= mxUtils.getValue(z.style,mxConstants.STYLE_SHAPE,null);return"label"==z||"rectangle"==z||"internalStorage"==z||"ext"==z||"umlLifeline"==z||"swimlane"==z||"process"==z||"ellipse"==z||"rhombus"==z};Graph.prototype.isRoundedState=function(z){return null!=z.shape?z.shape.isRoundable():0<=mxUtils.indexOf(this.roundableShapes,mxUtils.getValue(z.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isLineJumpState=function(z){var D=mxUtils.getValue(z.style,mxConstants.STYLE_SHAPE,null);return!mxUtils.getValue(z.style, mxConstants.STYLE_CURVED,!1)&&("connector"==D||"filledEdge"==D||"wire"==D)};Graph.prototype.isAutoSizeState=function(z){return"1"==mxUtils.getValue(z.style,mxConstants.STYLE_AUTOSIZE,null)};Graph.prototype.isAutosizeTextState=function(z){return"1"==mxUtils.getValue(z.style,"autosizeText",null)};Graph.prototype.isAutosizeTextCell=function(z){z=this.getCurrentCellStyle(z);return null!=z&&"1"==z.autosizeText};Graph.prototype.isImageState=function(z){return null!=mxUtils.getValue(z.style,mxConstants.STYLE_IMAGE, null)};Graph.prototype.isShadowState=function(z){return!0};Graph.prototype.getVerticesAndEdges=function(z,D){z=null!=z?z:!0;D=null!=D?D:!0;var N=this.model;return N.filterDescendants(function(F){return z&&N.isVertex(F)||D&&N.isEdge(F)},N.getRoot())};Graph.prototype.applyNewEdgeStyle=function(z,D,N){z=this.getCellStyle(z).newEdgeStyle;if(null!=z){this.model.beginUpdate();try{var F=Graph.decodeNewEdgeStyle(z),P;for(P in F)this.setCellStyles(P,F[P],D),"edgeStyle"==P&&"elbowEdgeStyle"==F[P]&&null!=N&& this.setCellStyles("elbow",N==mxConstants.DIRECTION_SOUTH||N==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",D)}finally{this.model.endUpdate()}}this.model.beginUpdate();try{for(N=0;N<D.length;N++){var T=this.model.getTerminal(D[N],!0);null!=T&&T==this.model.getTerminal(D[N],!1)&&this.applyLoopStyle(D[N],T)}}finally{this.model.endUpdate()}};Graph.prototype.applyLoopStyle=function(z,D){var N=this.getCellGeometry(D);D=this.getCellGeometry(z);if(null!=N&&null!=D){var F=this.gridSize,P=N.x+N.width+ 4*F;N=N.y+N.height/2;D=D.clone();D.points=[new mxPoint(P,N-2*F),new mxPoint(P,N+2*F)];this.model.beginUpdate();try{this.model.setGeometry(z,D),this.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[z]),this.setCellStyles("innerLoopWaypoints","1",[z])}finally{this.model.endUpdate()}}};Graph.prototype.getLoopFixedAxis=function(z){var D=null!=z?z.getVisibleTerminalState(!0):null;if(null==D||0==D.width||0==D.height)return null;var N=z.view;if(null==N.getPerimeterFunction(D))return null;var F= D.getCenterX(),P=D.getCenterY(),T=Math.max(D.width,D.height)+100;z=N.getPerimeterPoint(D,new mxPoint(F+T,P),!1);var c=N.getPerimeterPoint(D,new mxPoint(F-T,P),!1),f=N.getPerimeterPoint(D,new mxPoint(F,P-T),!1);N=N.getPerimeterPoint(D,new mxPoint(F,P+T),!1);f=null!=f&&null!=N&&Math.abs(f.y-N.y)<D.height/4;return null!=z&&null!=c&&Math.abs(z.x-c.x)<D.width/4?"x":f?"y":null};Graph.prototype.loopHasFixedAnchorLine=function(z){return null!=this.getLoopFixedAxis(z)};Graph.prototype.getLoopAroundPoints= function(z,D){var N=null!=z?z.getVisibleTerminalState(!0):null,F=null!=z?this.getCellGeometry(z.cell):null;if(null==N||null==D||null==F)return null;var P=z.view.scale,T=z.view.translate,c=z.origin,f=N.x/P-T.x-c.x,k=N.y/P-T.y-c.y,q=N.width/P,y=N.height/P,A=new mxPoint(D.x/P-T.x-c.x,D.y/P-T.y-c.y);var E=z.absolutePoints;null!=F.points&&2<=F.points.length?(D=F.points[0],E=F.points[F.points.length-1]):null!=E&&4<=E.length?(D=new mxPoint(E[1].x/P-T.x-c.x,E[1].y/P-T.y-c.y),E=new mxPoint(E[E.length-2].x/ P-T.x-c.x,E[E.length-2].y/P-T.y-c.y)):(D=new mxPoint(f+q/2,k+y/2-this.gridSize),E=new mxPoint(f+q/2,k+y/2+this.gridSize));F=Math.abs(D.x-E.x)>=Math.abs(D.y-E.y);D=Math.max(this.gridSize,F?Math.abs(D.x-E.x):Math.abs(D.y-E.y));var K=this.gridSize;E=this.loopHasFixedAnchorLine(z);var Q=z.absolutePoints;Q=null!=Q&&null!=Q[0]?new mxPoint(Q[0].x/P-T.x-c.x,Q[0].y/P-T.y-c.y):null;if(E&&null!=Q){if(F)return k=A.y>=Q.y?Math.max(Q.y+K,A.y):Math.min(Q.y-K,A.y),[new mxPoint(A.x-D/2,k),new mxPoint(A.x+D/2,k)]; Q=A.x>=Q.x?Math.max(Q.x+K,A.x):Math.min(Q.x-K,A.x);return[new mxPoint(Q,A.y-D/2),new mxPoint(Q,A.y+D/2)]}var W=f+q/2,J=k+y/2,ea=function(X,aa,ka){X=z.view.getPerimeterPoint(N,new mxPoint((X+T.x+c.x)*P,(aa+T.y+c.y)*P),ka);return null!=X?new mxPoint(X.x/P-T.x-c.x,X.y/P-T.y-c.y):null};F=function(X,aa,ka,ja){X=ea(X,aa,!0);ka=ea(ka,ja,!0);return null==X||null==ka||2>Math.abs(X.x-W)&&2>Math.abs(X.y-J)||2>Math.abs(ka.x-W)&&2>Math.abs(ka.y-J)?!0:Math.abs(X.x-ka.x)<K/2&&Math.abs(X.y-ka.y)<K/2};E=ea(A.x,A.y, !1);if(null==E||1>Math.abs(E.x-W)&&1>Math.abs(E.y-J))E=new mxPoint(W,J);if(Math.abs(E.y-J)>=Math.abs(E.x-W)){D=Math.max(this.gridSize,Math.min(D,q));k=E.y>=J?Math.max(E.y+K,A.y):Math.min(E.y-K,A.y);A=Math.max(f+D/2,Math.min(f+q-D/2,A.x));for(f=0;f<=q/this.gridSize&&F(A-D/2,k,A+D/2,k);f++)A=A<W?Math.min(W,A+this.gridSize):Math.max(W,A-this.gridSize);E=E.y>=J?this.gridSize:-this.gridSize;for(f=0;f<=(q+y)/this.gridSize&&F(A-D/2,k,A+D/2,k);f++)k+=E;return[new mxPoint(A-D/2,k),new mxPoint(A+D/2,k)]}D= Math.max(this.gridSize,Math.min(D,y));Q=E.x>=W?Math.max(E.x+K,A.x):Math.min(E.x-K,A.x);k=Math.max(k+D/2,Math.min(k+y-D/2,A.y));for(f=0;f<=y/this.gridSize&&F(Q,k-D/2,Q,k+D/2);f++)k=k<J?Math.min(J,k+this.gridSize):Math.max(J,k-this.gridSize);A=E.x>=W?this.gridSize:-this.gridSize;for(f=0;f<=(q+y)/this.gridSize&&F(Q,k-D/2,Q,k+D/2);f++)Q+=A;return[new mxPoint(Q,k-D/2),new mxPoint(Q,k+D/2)]};Graph.prototype.keepLoopOutsideShape=function(z,D){var N=null!=z?z.getVisibleTerminalState(!0):null;if(null==N|| null==D||0==D.length)return D;var F=z.view.scale,P=z.view.translate,T=z.origin,c=N.x/F-P.x-T.x,f=N.y/F-P.y-T.y,k=N.width/F,q=N.height/F;if(this.loopHasFixedAnchorLine(z))return D;c+=k/2;f+=q/2;q=this.gridSize;k=[];for(var y=0;y<D.length;y++){var A=D[y];if(null==A)k.push(A);else{var E=new mxPoint(A.x,A.y),K=z.view.getPerimeterPoint(N,new mxPoint((A.x+P.x+T.x)*F,(A.y+P.y+T.y)*F),!1);if(null!=K){var Q=K.x/F-P.x-T.x;K=K.y/F-P.y-T.y;var W=A.x-c;A=A.y-f;var J=Math.sqrt(W*W+A*A);J<Math.sqrt((Q-c)*(Q-c)+ (K-f)*(K-f))-.5&&(1>J&&(W=0,J=A=1),E.x=Q+W/J*q,E.y=K+A/J*q)}k.push(E)}}return k};Graph.prototype.getCommonStyle=function(z){for(var D={},N=0;N<z.length;N++){var F=this.view.getState(z[N]);null!=F&&this.mergeStyle(F.style,D,0==N)}return D};Graph.prototype.mergeStyle=function(z,D,N){if(null!=z){var F={},P;for(P in z){var T=z[P];null!=T&&(F[P]=!0,null==D[P]&&N?D[P]=T:D[P]!=T&&delete D[P])}for(P in D)F[P]||delete D[P]}};Graph.prototype.getStartEditingCell=function(z,D){D=this.getCellStyle(z);D=parseInt(mxUtils.getValue(D, mxConstants.STYLE_STARTSIZE,0));this.isTable(z)&&(!this.isSwimlane(z)||0==D)&&""==this.getLabel(z)&&0<this.model.getChildCount(z)&&(z=this.model.getChildAt(z,0),D=this.getCellStyle(z),D=parseInt(mxUtils.getValue(D,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(z)&&(!this.isSwimlane(z)||0==D)&&""==this.getLabel(z)&&0<this.model.getChildCount(z))for(D=0;D<this.model.getChildCount(z);D++){var N=this.model.getChildAt(z,D);if(this.isCellEditable(N)){z=N;break}}return z};Graph.prototype.copyStyle= function(z){return this.getCellStyle(z,!1)};Graph.prototype.pasteStyle=function(z,D,N,F){null!=z&&(F||(N=null!=N?N:Graph.cellStyles,Graph.removeKeys(z,function(P){return 0>mxUtils.indexOf(N,P)})),this.updateCellStyles(z,D))};Graph.prototype.copyCellStyles=function(z,D,N,F,P,T,c,f){var k=!1,q=!1;if(0<z.length)for(var y=0;y<z.length&&(k=this.getModel().isVertex(z[y])||k,!(q=this.getModel().isEdge(z[y])||q)||!k);y++);else q=k=!0;k=k&&!T;q=q&&!c;for(y=0;y<D.length;y++)if(z=0<=mxUtils.indexOf(Graph.textStyles, D[y]),"strokeColor"!=D[y]||null!=N[y]&&"none"!=N[y])if(0<=mxUtils.indexOf(Graph.cellStyles,D[y])||"shape"==D[y])if("shape"!=D[y]&&(k||z&&!T)&&!f&&(null==N[y]?delete F[D[y]]:F[D[y]]=N[y]),q||z&&!c)null==N[y]?delete P[D[y]]:P[D[y]]=N[y]};Graph.prototype.includeDescendants=function(z){for(var D=[],N=0;N<z.length;N++)D=D.concat(this.model.getDescendants(z[N]));return D};Graph.prototype.includeDescendantParts=function(z){for(var D=z.slice(),N=mxUtils.bind(this,function(P){for(var T=0;T<this.model.getChildCount(P);T++){var c= this.model.getChildAt(P,T);"1"==mxUtils.getValue(this.getCurrentCellStyle(c),"part","0")&&(D.push(c),N(c))}}),F=0;F<z.length;F++)N(z[F]);return D};Graph.prototype.pasteCellStyles=function(z,D,N,F,P,T){D=null!=D?D:this.currentVertexStyle;N=null!=N?N:this.currentEdgeStyle;P=null!=P?P:this.pasteEdgeStyle;T=null!=T?T:this.pasteStylesToText;this.model.beginUpdate();try{for(var c=0;c<z.length;c++){var f=z[c],k=this.model.getStyle(f),q=!1;null!=f.style&&"string"===typeof f.style&&(pairs=f.style.split(";"), q=q||0<=mxUtils.indexOf(pairs,"text"));var y=this.model.isVertex(f)&&this.model.isEdge(this.model.getParent(f));if(q||y)var A=q&&!y&&T?Graph.cellStyles:Graph.textStyles;else if(A=Graph.cellStyles.slice(),!F)for(var E="string"===typeof k?k.split(";"):[],K=0;K<E.length;K++){var Q=E[K],W=Q.indexOf("=");if(0<=W){var J=Q.substring(0,W),ea=mxUtils.indexOf(A,J);0<=ea&&A.splice(ea,1);for(q=0;q<Graph.cellStyleGroups.length;q++){var X=Graph.cellStyleGroups[q];if(0<=mxUtils.indexOf(X,J))for(var aa=0;aa<X.length;aa++){var ka= mxUtils.indexOf(A,X[aa]);0<=ka&&A.splice(ka,1)}}}}var ja=this.model.isEdge(f);q=ja||y?N:D;for(K=0;K<A.length;K++){J=A[K];var ua=q[J];if("edgeStyle"!=J||P)if(ja||!ja&&0>mxUtils.indexOf(Graph.edgeStyles,J))null!=ua?(k=mxUtils.setStyle(k,J,ua),"fontFamily"==J&&null==q.fontSource&&(k=mxUtils.setStyle(k,"fontSource",null)),ja&&"rounded"==J&&"1"==ua&&null==q.curved&&(k=mxUtils.setStyle(k,"curved",null))):F&&(k=mxUtils.setStyle(k,J,null))}Editor.simpleLabels&&(k=mxUtils.setStyle(mxUtils.setStyle(k,"html", null),"whiteSpace",null));this.model.setStyle(f,k)}}finally{this.model.endUpdate()}return z};Graph.prototype.pasteTextStyles=function(z,D){this.model.beginUpdate();try{for(var N=0;N<z.length;N++){var F=z[N];if(this.model.isVertex(F)||this.model.isEdge(F)){for(var P=this.model.getStyle(F),T=0;T<Graph.pasteTextStyles.length;T++){var c=Graph.pasteTextStyles[T],f=D[c];null!=f&&(P=mxUtils.setStyle(P,c,f),"fontFamily"==c&&null==D.fontSource&&(P=mxUtils.setStyle(P,"fontSource",null)))}Editor.simpleLabels&& (P=mxUtils.setStyle(mxUtils.setStyle(P,"html",null),"whiteSpace",null));this.model.setStyle(F,P)}}}finally{this.model.endUpdate()}return z};Graph.prototype.updateCellStyles=function(z,D){this.model.beginUpdate();try{for(var N=0;N<D.length;N++)if(this.model.isVertex(D[N])||this.model.isEdge(D[N])){var F=this.getCellStyle(D[N],!1),P=F[mxConstants.STYLE_PERIMETER],T=!1;for(f in z){var c=z[f];if(F[f]!=c){if(f==mxConstants.STYLE_SHAPE&&"umlLifeline"==F[f]&&"umlLifeline"!=c){T=!0;var f="participant"}this.setCellStyles(f, c,[D[N]])}}T&&this.setCellStyles(mxConstants.STYLE_PERIMETER,P,[D[N]])}}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(z,D,N,F,P,T){this.useCssTransforms&& (z=z/this.currentScale-this.currentTranslate.x,D=D/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(z,D,N,F,P,T){F=null!=F?F:!0;P=null!=P?P:!0;null==N&&(N=this.getCurrentRoot(),null==N&&(N=this.getModel().getRoot()));if(null!=N)for(var c=this.model.getChildCount(N)-1;0<=c;c--){var f=this.model.getChildAt(N,c),k=this.getScaledCellAt(z,D,f,F,P,T);if(null!=k)return k;if(this.isCellVisible(f)&&(P&&this.model.isEdge(f)|| F&&this.model.isVertex(f))&&(k=this.view.getState(f),null!=k&&(null==T||!T(k,z,D))&&this.intersects(k,z,D)))return f}return null};Graph.prototype.isRecursiveVertexResize=function(z){return!this.isSwimlane(z.cell)&&0<this.model.getChildCount(z.cell)&&!this.isCellCollapsed(z.cell)&&"1"==mxUtils.getValue(z.style,"recursiveResize","1")&&null==mxUtils.getValue(z.style,"childLayout",null)};Graph.prototype.getAbsoluteParent=function(z){for(var D=this.getCellGeometry(z);null!=D&&D.relative;)z=this.getModel().getParent(z), D=this.getCellGeometry(z);return z};Graph.prototype.isPart=function(z){return"1"==mxUtils.getValue(this.getCurrentCellStyle(z),"part","0")||this.isTableCell(z)||this.isTableRow(z)};Graph.prototype.getCompositeParents=function(z){for(var D=new mxDictionary,N=[],F=0;F<z.length;F++){var P=this.getCompositeParent(z[F]);this.isTableCell(P)&&(P=this.graph.model.getParent(P));this.isTableRow(P)&&(P=this.graph.model.getParent(P));null==P||D.get(P)||(D.put(P,!0),N.push(P))}return N};Graph.prototype.getReferenceTerminal= function(z){if(null!=z){var D=this.getCellGeometry(z);null!=D&&D.relative&&(z=this.model.getParent(z))}null!=z&&this.model.isEdge(z)&&(z=this.model.getParent(z));null!=z&&(z=this.getCompositeParent(z));return z};Graph.prototype.getCompositeParent=function(z){for(;this.isPart(z);){var D=this.model.getParent(z);if(!this.model.isVertex(D))break;z=D}return z};Graph.prototype.orderCells=function(z,D,N){if(null==D){D=mxUtils.sortCells(this.getEditableCells(this.getSelectionCells()),!0);for(var F=new mxDictionary, P=[],T=0;T<D.length;T++){for(var c=D[T];this.isTableCell(c)||this.isTableRow(c);)c=this.model.getParent(c);F.get(c)||(F.put(c,!0),P.push(c))}D=P}return mxGraph.prototype.orderCells.call(this,z,D,N)};Graph.prototype.filterSelectionCells=function(z){var D=this.getSelectionCells();if(null!=z){for(var N=[],F=0;F<D.length;F++)z(D[F])||N.push(D[F]);D=N}return D};var b=mxGraph.prototype.scrollRectToVisible;Graph.prototype.scrollRectToVisible=function(z){if(this.useCssTransforms){var D=this.currentScale, N=this.currentTranslate;z=new mxRectangle((z.x+2*N.x)*D-N.x,(z.y+2*N.y)*D-N.y,z.width*D,z.height*D)}b.apply(this,arguments)};Graph.prototype.isCellVisibleInViewport=function(z){z=this.view.getState(z);var D=!1;if(null!=z&&null!=this.container){z=new mxRectangle(z.x,z.y,z.width,z.height);if(this.useCssTransforms){D=this.currentTranslate;var N=this.currentScale;z=new mxRectangle((z.x+D.x)*N,(z.y+D.y)*N,z.width*N,z.height*N)}D=this.container;D=mxUtils.intersects(z,mxUtils.hasScrollbars(D)?new mxRectangle(D.scrollLeft, D.scrollTop,D.clientWidth,D.clientHeight):new mxRectangle(0,0,D.clientWidth,D.clientHeight),!0)}return D};mxCellHighlight.prototype.getStrokeWidth=function(z){z=this.strokeWidth;this.graph.useCssTransforms&&(z/=this.graph.currentScale);return z};mxGraphView.prototype.getGraphBounds=function(){var z=this.graphBounds;if(this.graph.useCssTransforms){var D=this.graph.currentTranslate,N=this.graph.currentScale;z=new mxRectangle((z.x+D.x)*N,(z.y+D.y)*N,z.width*N,z.height*N)}return z};mxGraphView.prototype.viewStateChanged= function(){this.graph.useCssTransforms?this.validate():this.revalidate();this.graph.sizeDidChange()};var d=mxGraphView.prototype.validate;mxGraphView.prototype.validate=function(z){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(z){z=m.apply(this,arguments);for(var D=[],N=0;N<z.length;N++)this.isTableRow(z[N])||this.isTableCell(z[N])||D.push(z[N]);return D};var p=mxGraph.prototype.getCellsForUngroup;Graph.prototype.getCellsForUngroup=function(z){z=p.apply(this,arguments);for(var D=[],N=0;N<z.length;N++)this.isTable(z[N])||this.isTableRow(z[N])|| this.isTableCell(z[N])||D.push(z[N]);return D};Graph.prototype.updateCssTransform=function(){var z=this.view.getDrawPane();if(null!=z)if(z=z.parentNode,this.useCssTransforms){var D=z.getAttribute("transform");z.setAttribute("transformOrigin","0 0");var N=Math.round(100*this.currentScale)/100,F=Math.round(100*this.currentTranslate.x)/100,P=Math.round(100*this.currentTranslate.y)/100;this.armTransformTransition?this.armTransformTransition=!1:""!=z.style.transition&&(z.style.transition="");z.setAttribute("transform", "scale("+N+","+N+")translate("+F+","+P+")");D!=z.getAttribute("transform")&&this.fireEvent(new mxEventObject("cssTransformChanged"),"transform",z.getAttribute("transform"))}else z.removeAttribute("transformOrigin"),z.removeAttribute("transform")};var t=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var z=this.graph.useCssTransforms,D=this.scale,N=this.translate;z&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate); t.apply(this,arguments);z&&(this.scale=D,this.translate=N)};var n=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(z,D,N){var F=this.useCssTransforms,P=this.view.scale,T=this.view.translate;F&&(this.view.scale=1,this.view.translate=new mxPoint(0,0),this.useCssTransforms=!1);n.apply(this,arguments);F&&(this.view.scale=P,this.view.translate=T,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.isViewer=function(){return!1}; Graph.prototype.labelLinkClicked=function(b,d,m){var p=d.getAttribute("href");p!=Graph.sanitizeLink(p)&&Graph.sanitizeNode(d);if(null!=p&&!this.isCustomLink(p)&&(mxEvent.isLeftMouseButton(m)&&!mxEvent.isPopupTrigger(m)||mxEvent.isTouchEvent(m))){if(!this.isEnabled()||this.isCellLocked(b.cell))b=this.isBlankLink(p)?this.linkTarget:"_top",this.openLink(this.getAbsoluteUrl(p),b);mxEvent.consume(m)}}; Graph.prototype.openLink=function(b,d,m){var p=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)Editor.suppressNewWindows||(p=window.open(b,null!=d?d:"_blank",m?null:"noopener,noreferrer"),null==p||m||(p.opener=null));else{var t=b.split("#")[1];window.location.hash=="#"+t&&(window.location.hash="");window.location.hash= t}}catch(n){}return p};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)};Graph.prototype.isRelativeUrl=function(b){return null!=b&&!this.absoluteUrlPattern.test(b)&&"data:"!==b.substring(0,5)&&!this.isExternalProtocol(b)}; Graph.prototype.getAbsoluteUrl=function(b){null!=b&&this.isRelativeUrl(b)&&(b="#"==b.charAt(0)?this.baseUrl+b:"/"==b.charAt(0)?this.domainUrl+b:this.domainPathUrl+b);return b}; Graph.prototype.initLayoutManager=function(){this.layoutManager=new mxLayoutManager(this);this.layoutManager.hasLayout=function(b){return null!=this.graph.getCellStyle(b).childLayout};this.layoutManager.getLayout=function(b,d){var m=this.graph.model.getParent(b);if(!this.graph.isCellCollapsed(b)&&(d!=mxEvent.BEGIN_UPDATE||this.hasLayout(m,d))){d=this.graph.getCellStyle(b);var p=this.graph.isTransparentBounds(b);if("stackLayout"==d.childLayout)return b=new mxStackLayout(this.graph,!0),b.resizeParentMax= !p&&"1"==mxUtils.getValue(d,"resizeParentMax","1"),b.horizontal="1"==mxUtils.getValue(d,"horizontalStack","1"),b.resizeParent=!p&&"1"==mxUtils.getValue(d,"resizeParent","1"),b.resizeLast=!p&&"1"==mxUtils.getValue(d,"resizeLast","0"),b.spacing=d.stackSpacing||b.spacing,b.border=d.stackBorder||b.border,b.marginLeft=d.marginLeft||0,b.marginRight=d.marginRight||0,b.marginTop=d.marginTop||0,b.marginBottom=d.marginBottom||0,b.allowGaps=d.allowGaps||0,b.fill=!p,b.allowGaps&&(b.gridSize=parseFloat(mxUtils.getValue(d, "stackUnitSize",20))),b;if("treeLayout"==d.childLayout)return b=new mxCompactTreeLayout(this.graph),b.horizontal="1"==mxUtils.getValue(d,"horizontalTree","1"),b.resizeParent=!p&&"1"==mxUtils.getValue(d,"resizeParent","1"),b.sortEdges="1"==mxUtils.getValue(d,"sortEdges","0"),b.groupPadding=mxUtils.getValue(d,"parentPadding",20),b.levelDistance=mxUtils.getValue(d,"treeLevelDistance",30),b.maintainParentLocation=!0,b.edgeRouting=!1,b.resetEdges=!1,b;if("flowLayout"==d.childLayout)return b=new mxHierarchicalLayout(this.graph, mxUtils.getValue(d,"flowOrientation",mxConstants.DIRECTION_EAST)),b.resizeParent=!p&&"1"==mxUtils.getValue(d,"resizeParent","1"),b.parentBorder=mxUtils.getValue(d,"parentPadding",20),b.maintainParentLocation=!0,b.intraCellSpacing=mxUtils.getValue(d,"intraCellSpacing",mxHierarchicalLayout.prototype.intraCellSpacing),b.interRankCellSpacing=mxUtils.getValue(d,"interRankCellSpacing",mxHierarchicalLayout.prototype.interRankCellSpacing),b.interHierarchySpacing=mxUtils.getValue(d,"interHierarchySpacing", mxHierarchicalLayout.prototype.interHierarchySpacing),b.parallelEdgeSpacing=mxUtils.getValue(d,"parallelEdgeSpacing",mxHierarchicalLayout.prototype.parallelEdgeSpacing),b;if("circleLayout"==d.childLayout){b=new mxCircleLayout(this.graph);b.resizeParent=!p&&"1"==mxUtils.getValue(d,"resizeParent","1");var t=parseFloat(mxUtils.getValue(d,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));t=isNaN(t)?mxConstants.DEFAULT_STARTSIZE:t;d="0"==mxUtils.getValue(d,mxConstants.STYLE_HORIZONTAL,"1");b.moveCircle= !0;b.x0=d?t+20:20;b.y0=d?20:t+20;var n=this.graph,z=b.execute;b.execute=function(D){var N=n.getModel(),F=function(){for(var q=null,y=N.getChildCount(D),A=0;A<y;A++){var E=N.getChildAt(D,A);E=N.isVertex(E)?N.getGeometry(E):null;null==E||E.relative||(q=null==q?new mxPoint(E.x,E.y):new mxPoint(Math.min(q.x,E.x),Math.min(q.y,E.y)))}return q},P=p?F():null;z.apply(this,arguments);if(null!=P){var T=F();if(null!=T&&(P.x!=T.x||P.y!=T.y)){var c=N.getChildCount(D);for(F=0;F<c;F++){var f=N.getChildAt(D,F),k= N.isVertex(f)?N.getGeometry(f):null;null==k||k.relative||n.translateCell(f,P.x-T.x,P.y-T.y)}}}P=N.getGeometry(D);if(this.resizeParent&&null!=P){c=T=0;f=N.getChildCount(D);for(F=0;F<f;F++)k=N.getGeometry(N.getChildAt(D,F)),null==k||k.relative||(T=Math.max(T,k.x+k.width),c=Math.max(c,k.y+k.height));0<T&&0<c&&(P.width!=T+20||P.height!=c+20)&&(P=P.clone(),P.width=T+20,P.height=c+20,N.setGeometry(D,P))}};return b}if("organicLayout"==d.childLayout)return new mxFastOrganicLayout(this.graph);if("tableLayout"== d.childLayout)return new TableLayout(this.graph);if(null!=d.childLayout)try{if(t=Graph.decodeChildLayout(d.childLayout),null!=t)return new mxCompositeLayout(this.graph,this.graph.createLayouts(t,{enforceCorners:!1}))}catch(D){null!=window.console&&console.error(D)}}return null};this.layoutManager.executeLayout=function(b,d){this.graph.model.contains(b)&&(d=this.getLayout(b,d?mxEvent.BEGIN_UPDATE:mxEvent.END_UPDATE),null!=d&&(this.graph.isAsyncLayout(d)?this.graph.canExecuteLayoutSync(d)?this.graph.executeLayoutSync(d, b):this.graph.scheduleAsyncLayout(b):d.execute(b)))}};Graph.prototype.getChildLayoutCells=function(b){if(null==this.layoutManager)return[];var d=this.layoutManager;return this.model.filterDescendants(function(m){return d.hasLayout(m)},b)};Graph.prototype.executeAllChildLayouts=function(b){b=this.getChildLayoutCells(b);0<b.length&&this.layoutManager.executeLayoutForCells(b)}; Graph.prototype.canExecuteLayoutSync=function(b){b=b.constructor===mxCompositeLayout&&null!=b.layouts?b.layouts:[b];for(var d=0;d<b.length;d++)if("function"===typeof b[d].prepare&&("function"!==typeof b[d].executeSync||"function"===typeof b[d].canExecuteSync&&!b[d].canExecuteSync()))return!1;return!0}; Graph.prototype.executeLayoutSync=function(b,d){b=b.constructor===mxCompositeLayout&&null!=b.layouts?b.layouts:[b];for(var m=0;m<b.length;m++)try{"function"===typeof b[m].prepare&&"function"===typeof b[m].executeSync?b[m].executeSync(d):b[m].execute(d)}catch(p){null!=window.console&&console.error(p)}}; Graph.prototype.isAsyncLayout=function(b){if(null==b)return!1;if("function"===typeof b.prepare)return!0;if(b.constructor===mxCompositeLayout&&null!=b.layouts)for(var d=0;d<b.layouts.length;d++)if("function"===typeof b.layouts[d].prepare)return!0;return!1}; Graph.prototype.scheduleAsyncLayout=function(b){null==b||this.destroyed||null!=this.asyncLayoutsApplying&&this.asyncLayoutsApplying[b.id]||(null!=this.asyncLayoutsRunning&&null!=this.asyncLayoutsRunning[b.id]?this.asyncLayoutsRunning[b.id]="dirty":(this.pendingAsyncLayouts=this.pendingAsyncLayouts||[],0>mxUtils.indexOf(this.pendingAsyncLayouts,b)&&this.pendingAsyncLayouts.push(b),this.asyncLayoutsScheduled||(this.asyncLayoutsScheduled=!0,window.setTimeout(mxUtils.bind(this,function(){this.asyncLayoutsScheduled= !1;var d=this.pendingAsyncLayouts;this.pendingAsyncLayouts=[];var m=function(n){for(var z=0;null!=n;)z++,n=n.parent;return z};d.sort(function(n,z){return m(z)-m(n)});var p=0,t=mxUtils.bind(this,function(){p<d.length&&this.runAsyncLayout(d[p++],t)});t()}),0))))}; Graph.prototype.runAsyncLayout=function(b,d){var m=this.getModel();d=null!=d?d:function(){};if(this.destroyed||null==this.layoutManager||!m.contains(b)||this.isCellCollapsed(b))d();else{var p=this.layoutManager.getLayout(b,mxEvent.END_UPDATE);if(null!=p&&this.isAsyncLayout(p)){var t=p.constructor===mxCompositeLayout&&null!=p.layouts?p.layouts:[p];this.asyncLayoutsRunning=this.asyncLayoutsRunning||{};this.asyncLayoutsRunning[b.id]="running";this.asyncLayoutsApplying=this.asyncLayoutsApplying||{};var n= this,z=0,D=function(P){n.asyncLayoutsApplying[b.id]=!0;m.beginUpdate();try{P()}finally{m.endUpdate(),delete n.asyncLayoutsApplying[b.id]}},N=function(){var P="dirty"==n.asyncLayoutsRunning[b.id];delete n.asyncLayoutsRunning[b.id];P&&n.scheduleAsyncLayout(b);d()},F=function(){if(z>=t.length||n.destroyed||!m.contains(b))N();else{var P=t[z++];try{"function"===typeof P.prepare?P.prepare(b,function(T,c){if(null==T&&null!=c&&!n.destroyed&&m.contains(b))try{D(c)}catch(f){null!=window.console&&console.error(f)}else null!= T&&null!=window.console&&console.error(T);F()}):(D(function(){P.execute(b)}),F())}catch(T){null!=window.console&&console.error(T),F()}}};F()}else d()}};Graph.encodeChildLayout=function(b){return encodeURIComponent(JSON.stringify(b))};Graph.decodeChildLayout=function(b){return null!=b&&(b=String(b),"%"==b.charAt(0)&&(b=decodeURIComponent(b)),"["==b.charAt(0))?JSON.parse(b):null}; Graph.decodeNewEdgeStyle=function(b){return null!=b?(b=String(b),"%"==b.charAt(0)&&(b=decodeURIComponent(b)),JSON.parse(b)):null}; Graph.prototype.createLayouts=function(b,d){for(var m=[],p=0;p<b.length;p++){var t=b[p].layout,n=b[p].config;if("string"===typeof Graph.elkLayoutAlgorithms[t]){if("undefined"===typeof ElkLayout)throw Error(mxResources.get("invalidCallFnNotFound",[t]));n=Graph.elkConfigToOptions(n);if(null!=d)for(var z in d)n.options[z]=d[z];m.push(new ElkLayout(this,Graph.elkLayoutAlgorithms[t],n.layoutOptions,n.options))}else if("undefined"!==typeof LibavoidRouting&&t===LibavoidRouting.LAYOUT_NAME)m.push(LibavoidRouting.createLayout(this, n));else if(0<=mxUtils.indexOf(Graph.layoutNames,t)){var D="mxOrgChartLayout"==t&&null!=n?new window[t](this,n.branchOptimizer):new window[t](this);if(null!=n)for(z in n)"function"===typeof D[z]||"__proto__"==z||"constructor"==z||"prototype"==z||"mxOrgChartLayout"==t&&"branchOptimizer"==z||(D[z]=n[z]);m.push(D)}else throw Error(mxResources.get("invalidCallFnNotFound",[t]));}return m}; Graph.elkConfigToOptions=function(b){var d={},m={};if(null!=b)for(var p in b)0===p.indexOf("elk.")?d[p]=b[p]:"edgeStyle"===p?m.edgeStyleMode=b[p]:"corners"===p?m.corners=b[p]:"resizeNodes"===p?(m.applierOptions=m.applierOptions||{},m.applierOptions.resizeParent=!!b[p]):"preserveOrigin"===p||"useViewStateSizing"===p||"respectFixedPosition"===p||"mermaidPolicy"===p||"includeEdgeLabels"===p||"includeVertexLabels"===p||"portSpread"===p||"resizeLayoutRoot"===p||"extractIsolated"===p||"sharedStems"===p|| "nonTreeEdges"===p||"groupPadding"===p?m[p]=b[p]:"rootCellIds"===p&&(m.rootCellIds=b[p]);return{layoutOptions:d,options:m}}; Graph.elkOptionsToConfig=function(b,d){var m={};if(null!=b)for(var p in b)m[p]=b[p];null!=d&&(null!=d.edgeStyleMode&&"auto"!==d.edgeStyleMode&&(m.edgeStyle=d.edgeStyleMode),null!=d.corners&&"keep"!==d.corners&&(m.corners=d.corners),null!=d.applierOptions&&null!=d.applierOptions.resizeParent&&(m.resizeNodes=!0===d.applierOptions.resizeParent),!0===d.preserveOrigin&&(m.preserveOrigin=!0),!1===d.sharedStems&&(m.sharedStems=!1),"elk"===d.nonTreeEdges&&(m.nonTreeEdges="elk"),null!=d.groupPadding&&(m.groupPadding= d.groupPadding),null!=d.rootCellIds&&0<d.rootCellIds.length&&(m.rootCellIds=d.rootCellIds.slice()));return m};Graph.prototype.getDataForCells=function(b,d){for(var m=[],p=0;p<b.length;p++){var t={};t.id=b[p].id;var n=null!=b[p].value?b[p].value.attributes:null;this.isReplacePlaceholders(b[p])&&d&&(t.value=this.getLabel(b[p]));if(null!=n)for(var z=0;z<n.length;z++)t[n[z].nodeName]=n[z].nodeValue;else t.label=this.convertValueToString(b[p]);m.push(t)}return m}; Graph.prototype.getNodesForCells=function(b){for(var d=[],m=0;m<b.length;m++){var p=this.view.getState(b[m]);if(null!=p){for(var t=this.cellRenderer.getShapesForState(p),n=0;n<t.length;n++)null!=t[n]&&null!=t[n].node&&d.push(t[n].node);null!=p.control&&null!=p.control.node&&d.push(p.control.node)}}return d}; Graph.prototype.createWipeAnimations=function(b,d){for(var m=[],p=0;p<b.length;p++){var t=this.view.getState(b[p]);null!=t&&null!=t.shape&&(this.model.isEdge(t.cell)&&null!=t.absolutePoints&&1<t.absolutePoints.length?m.push(this.createEdgeWipeAnimation(t,d)):this.model.isVertex(t.cell)&&null!=t.shape.bounds&&m.push(this.createVertexWipeAnimation(t,d)))}return m}; Graph.prototype.createEdgeWipeAnimation=function(b,d){var m=b.absolutePoints.slice(),p=b.segments,t=b.length,n=m.length;return{execute:mxUtils.bind(this,function(z,D){if(null!=b.shape){var N=[m[0]];D=z/D;d||(D=1-D);for(var F=t*D,P=1;P<n;P++)if(F<=p[P-1]){N.push(new mxPoint(m[P-1].x+(m[P].x-m[P-1].x)*F/p[P-1],m[P-1].y+(m[P].y-m[P-1].y)*F/p[P-1]));break}else F-=p[P-1],N.push(m[P]);b.shape.points=N;b.shape.redraw();0==z&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!= b.text.node&&(b.text.node.style.opacity=D)}}),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(p,t){null!=b.shape&&(t=p/t,d||(t=1-t),b.shape.bounds=new mxRectangle(m.x,m.y,m.width*t,m.height),b.shape.redraw(),0==p&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=t))}),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.createVertexPopAnimation=function(b,d){var m=new mxRectangle.fromRectangle(b.shape.bounds),p=m.getCenterX(),t=m.getCenterY();return{execute:mxUtils.bind(this,function(n,z){if(null!=b.shape){z=n/z;d||(z=1-z);var D=1-Math.exp(-5*z)*Math.cos(5*Math.PI*z);b.shape.bounds=new mxRectangle(p-m.width*D/2,t-m.height*D/2,m.width*D,m.height*D);b.shape.redraw();0==n&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=Math.min(1, 3*z))}}),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.createPopAnimations=function(b,d){for(var m=[],p=0;p<b.length;p++){var t=this.view.getState(b[p]);null!=t&&null!=t.shape&&(this.model.isEdge(t.cell)&&null!=t.absolutePoints&&1<t.absolutePoints.length?m.push(this.createEdgeWipeAnimation(t,d)):this.model.isVertex(t.cell)&&null!=t.shape.bounds&&m.push(this.createVertexPopAnimation(t,d)))}return m}; Graph.prototype.executeAnimations=function(b,d,m,p){m=null!=m?m:30;p=null!=p?p:30;var t=null,n=0,z=mxUtils.bind(this,function(){if(n==m||this.stoppingCustomActions){window.clearInterval(t);for(var D=0;D<b.length;D++)b[D].stop();null!=d&&d()}else for(D=0;D<b.length;D++)b[D].execute(n,m);n++});t=window.setInterval(z,p);z()}; Graph.prototype.executeAnimationsStepped=function(b,d,m,p){d=null!=d?d:30;var t=0,n=mxUtils.bind(this,function(){if(t<=d){for(var z=0;z<b.length;z++)b[z].execute(t,d);m(t,d,function(){t++;n()})}else{for(z=0;z<b.length;z++)b[z].stop();null!=p&&p()}});n()};Graph.prototype.getPageSize=function(){return this.pageVisible&&null!=this.pageFormat?new mxRectangle(0,0,this.pageFormat.width*this.pageScale,this.pageFormat.height*this.pageScale):this.scrollTileSize}; Graph.prototype.getPageLayout=function(b,d,m){b=null!=b?b:this.getGraphBounds();d=null!=d?d:this.view.translate;m=null!=m?m:this.view.scale;var p=this.getPageSize();if(0==b.width||0==b.height)return new mxRectangle(0,0,1,1);var t=Math.floor(Math.ceil(b.x/m-d.x)/p.width),n=Math.floor(Math.ceil(b.y/m-d.y)/p.height);return new mxRectangle(t,n,Math.ceil((Math.floor((b.x+b.width)/m)-d.x)/p.width)-t,Math.ceil((Math.floor((b.y+b.height)/m)-d.y)/p.height)-n)}; Graph.prototype.getDefaultTranslate=function(b){var d=this.getPagePadding(),m=this.getPageSize();return new mxPoint(d.x-b.x*m.width,d.y-b.y*m.height)};Graph.prototype.updateMinimumSize=function(){var b=this.getPageLayout(),d=this.getPagePadding(),m=this.getPageSize(),p=Math.ceil(2*d.x+b.width*m.width);b=Math.ceil(2*d.y+b.height*m.height);if(null==this.minimumGraphSize||this.minimumGraphSize.width!=p||this.minimumGraphSize.height!=b)this.minimumGraphSize=new mxRectangle(0,0,p,b)}; Graph.prototype.sanitizeHtml=function(b,d){return Graph.sanitizeHtml(b,d)};Graph.prototype.updatePlaceholders=function(){var b=!1,d;for(d in this.model.cells){var m=this.model.cells[d];this.isReplacePlaceholders(m)&&(this.view.invalidate(m,!1,!1),b=!0)}b&&this.view.validate()};Graph.prototype.isReplacePlaceholders=function(b){return null!=b.value&&"object"==typeof b.value&&"1"==b.value.getAttribute("placeholders")}; Graph.prototype.isZoomWheelEvent=function(b){return Graph.zoomWheel&&!mxEvent.isShiftDown(b)&&!mxEvent.isMetaDown(b)&&!mxEvent.isAltDown(b)&&(!mxEvent.isControlDown(b)||mxClient.IS_MAC)||!Graph.zoomWheel&&(mxEvent.isAltDown(b)||mxEvent.isControlDown(b))};Graph.prototype.isScrollWheelEvent=function(b){return!this.isZoomWheelEvent(b)};Graph.prototype.isTransparentClickEvent=function(b){return mxEvent.isAltDown(b)||mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(b)}; Graph.prototype.isIgnoreTerminalEvent=function(b){return mxEvent.isAltDown(b)&&!mxEvent.isShiftDown(b)&&!mxEvent.isControlDown(b)&&!mxEvent.isMetaDown(b)};Graph.prototype.isEdgeIgnored=function(b){var d=!1;null!=b&&(b=this.getCurrentCellStyle(b),d="1"==mxUtils.getValue(b,"ignoreEdge","0"));return d}; Graph.prototype.isSplitTarget=function(b,d,m){return!this.model.isEdge(d[0])&&!mxEvent.isAltDown(m)&&!mxEvent.isShiftDown(m)&&!this.isCellLocked(this.getLayerForCell(b))&&mxGraph.prototype.isSplitTarget.apply(this,arguments)};Graph.prototype.getLabel=function(b){var d=mxGraph.prototype.getLabel.apply(this,arguments);null!=d&&this.isReplacePlaceholders(b)&&null==b.getAttribute("placeholder")&&(d=this.replacePlaceholders(b,d));return d}; Graph.prototype.isLabelMovable=function(b){var d=this.getCurrentCellStyle(b);return!this.isCellLocked(b)&&(this.model.isEdge(b)&&this.edgeLabelsMovable||this.model.isVertex(b)&&(this.vertexLabelsMovable||"1"==mxUtils.getValue(d,"labelMovable","0")))};Graph.prototype.setGridSize=function(b){this.gridSize=b;this.fireEvent(new mxEventObject("gridSizeChanged"))};Graph.prototype.setDefaultParent=function(b){this.defaultParent=b;this.fireEvent(new mxEventObject("defaultParentChanged"))}; Graph.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 p=this.dateFormatCache,t=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,n=/[^-+\dA-Z]/g,z=function(A,E){A=String(A);for(E=E||2;A.length<E;)A="0"+A;return A};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(p.masks[d]||d||p.masks["default"]);"UTC:"==d.slice(0,4)&&(d=d.slice(4),m=!0);var D=m?"getUTC":"get",N=b[D+"Date"](),F=b[D+"Day"](),P=b[D+"Month"](),T=b[D+"FullYear"](),c=b[D+"Hours"](),f=b[D+"Minutes"](),k=b[D+"Seconds"]();D=b[D+"Milliseconds"]();var q=m?0:b.getTimezoneOffset(),y={d:N,dd:z(N),ddd:p.i18n.dayNames[F],dddd:p.i18n.dayNames[F+7],m:P+1,mm:z(P+1),mmm:p.i18n.monthNames[P],mmmm:p.i18n.monthNames[P+ 12],yy:String(T).slice(2),yyyy:T,h:c%12||12,hh:z(c%12||12),H:c,HH:z(c),M:f,MM:z(f),s:k,ss:z(k),l:z(D,3),L:z(99<D?Math.round(D/10):D),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(t)||[""]).pop().replace(n,""),o:(0<q?"-":"+")+z(100*Math.floor(Math.abs(q)/60)+Math.abs(q)%60,4),S:["th","st","nd","rd"][3<N%10?0:(10!=N%100-N%10)*N%10]};return d.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(A){return A in y?y[A]:A.slice(1, A.length-1)})};Graph.prototype.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 p=this.getModel(),t=p.getChildCount(p.root),n=0;n<t;n++)mxUtils.bind(this,function(z){function D(){p.isVisible(z)?(P.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(F,75)):(P.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(F,25))}var N=this.convertValueToString(z)||mxResources.get("background")||"Background",F=document.createElement("div");F.style.overflow= "hidden";F.style.textOverflow="ellipsis";F.style.padding="2px";F.style.whiteSpace="nowrap";F.style.cursor="pointer";F.setAttribute("title",mxResources.get(p.isVisible(z)?"hideIt":"show",[N]));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");F.appendChild(P);mxUtils.write(F,N);m.appendChild(F); mxEvent.addListener(F,"click",function(){p.setVisible(z,!p.isVisible(z));D();null!=b&&b(z)});D()})(p.getChildAt(p.root,n));return m}; Graph.prototype.replacePlaceholders=function(b,d,m,p){p=[];if(null!=d){for(var t,n=0;t=this.placeholderPattern.exec(d);){var z=t[0];if(2<z.length&&"%label%"!=z&&"%tooltip%"!=z){var D=null;if(t.index>n&&"%"==d.charAt(t.index-1))D=z.substring(1);else{var N=z.substring(1,z.length-1),F={mm:mxConstants.MILLIMETERS,"in":mxConstants.INCHES,m:mxConstants.METERS,current:this.view.unit};if("id"==N)D=b.id;else if("width"===N.substring(0,5)&&this.model.isVertex(b)){var P=this.getCellGeometry(b);null!=P&&(D=P.width, 5<N.length&&(D=Editor.toUnit(D,F[N.substring(6)])))}else if("height"==N.substring(0,6)&&this.model.isVertex(b))P=this.getCellGeometry(b),null!=P&&(D=P.height,6<N.length&&(D=Editor.toUnit(D,F[N.substring(7)])));else if("length"==N.substring(0,6)){for(P=b;null!=P&&!this.model.isEdge(P);)P=this.model.getParent(P);P=this.view.getState(P);null!=P&&(D=Math.round(P.length/this.view.scale),6<N.length&&(D=Editor.toUnit(D,F[N.substring(7)])))}else if(0>N.indexOf("{"))for(F=b;null==D&&null!=F;)null!=F.value&& "object"==typeof F.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(D=F.getAttribute(N+"_"+Graph.diagramLanguage)),null==D&&(D=F.hasAttribute(N)?null!=F.getAttribute(N)?F.getAttribute(N):"":null)),F=this.model.getParent(F);null==D&&("pagecount"==N.substring(0,9)&&9<N.length||"pagenumber"==N.substring(0,10)&&10<N.length?(F=N.match(/(pagecount|pagenumber)[\s]*([+-])[\s]*(\d+)/),null!=F&&(D=this.getGlobalVariable(F[1]),3<F.length&&(P=parseInt(F[3]),D+="+"==F[2]?P:-P))):D=this.getGlobalVariable(N)); null==D&&null!=m&&(D=m[N])}p.push(d.substring(n,t.index)+(null!=D?D:z));n=t.index+z.length}}p.push(d.substring(n))}return p.join("")};Graph.prototype.restoreSelection=function(b){if(null!=b&&0<b.length){for(var d=[],m=0;m<b.length;m++){var p=this.model.getCell(b[m].id);null!=p&&d.push(p)}this.setSelectionCells(d)}else this.clearSelection()};Graph.prototype.isLockedGroup=function(b){return null!=b&&"1"==mxUtils.getValue(this.getCurrentCellStyle(b),"lockedGroup","0")}; Graph.prototype.hasLockedGroupStyle=function(b){return null!=b&&null!=this.getCurrentCellStyle(b).lockedGroup};Graph.prototype.isLockedGroupIconVisible=function(b){if(null==b)return!1;var d=this.getCurrentCellStyle(b).lockedGroupIcon;return"0"==d?!1:"1"==d?!0:this.hasLockedGroupStyle(b)};Graph.prototype.isEditIconVisible=function(b){return null!=b&&"1"==mxUtils.getValue(this.getCurrentCellStyle(b),"editIcon","0")}; Graph.prototype.getLockedGroupAncestor=function(b){for(;null!=b;){if(this.isLockedGroup(b))return b;b=this.model.getParent(b)}return null};Graph.prototype.getLockedGroupStyleAncestor=function(b){for(;null!=b;){if(this.hasLockedGroupStyle(b))return b;b=this.model.getParent(b)}return null}; Graph.prototype.selectCellForEvent=function(b,d){var m=this.getLockedGroupAncestor(this.model.getParent(b));null!=m&&(b=m);null==b||this.isToggleEvent(d)||1!=this.getSelectionCount()||(m=this.getSelectionCell(),null==m||m!=b&&!this.model.isAncestor(b,m)||(m=this.model.getParent(b),null!=m&&this.isTransparentBounds(m)&&(b=m)));mxEvent.isShiftDown(d)&&!this.isSelectionEmpty()&&this.selectTableRange(this.getSelectionCell(),b)||mxGraph.prototype.selectCellForEvent.apply(this,[b,d])}; Graph.prototype.selectTableRange=function(b,d){var m=!1;if(this.isTableCell(b)&&this.isTableCell(d)){var p=this.model.getParent(b),t=this.model.getParent(p),n=this.model.getParent(d);if(t==this.model.getParent(n)){b=p.getIndex(b);p=t.getIndex(p);var z=n.getIndex(d),D=t.getIndex(n);n=Math.max(p,D);d=Math.min(b,z);b=Math.max(b,z);z=[];for(p=Math.min(p,D);p<=n;p++){D=this.model.getChildAt(t,p);for(var N=d;N<=b;N++)z.push(this.model.getChildAt(D,N))}0<z.length&&(1<z.length||1<this.getSelectionCount()|| !this.isCellSelected(z[0]))&&(this.setSelectionCells(z),m=!0)}}return m}; Graph.prototype.snapCellsToGrid=function(b,d){this.getModel().beginUpdate();try{for(var m=0;m<b.length;m++){var p=b[m],t=this.getCellGeometry(p);if(null!=t){t=t.clone();if(this.getModel().isVertex(p))t.x=Math.round(t.x/d)*d,t.y=Math.round(t.y/d)*d,t.width=Math.round(t.width/d)*d,t.height=Math.round(t.height/d)*d;else if(this.getModel().isEdge(p)&&null!=t.points)for(var n=0;n<t.points.length;n++)t.points[n].x=Math.round(t.points[n].x/d)*d,t.points[n].y=Math.round(t.points[n].y/d)*d;this.getModel().setGeometry(p, t)}}}finally{this.getModel().endUpdate()}};Graph.prototype.removeChildCells=function(b){this.model.beginUpdate();try{for(var d=this.model.getChildCount(b);0<=d;d--)this.model.remove(this.model.getChildAt(b,d))}finally{this.model.endUpdate()}}; Graph.prototype.updateShapes=function(b,d,m){this.model.beginUpdate();try{var p=this.model.getStyle(b),t=m?this.stylesheet.getCellStyle(p,{},!1):null;null!=t&&null==t[mxConstants.STYLE_SHAPE]&&(this.model.isVertex(b)?t[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultVertexStyle()[mxConstants.STYLE_SHAPE]:this.model.isEdge(b)&&(t[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultEdgeStyle()[mxConstants.STYLE_SHAPE]));for(var n=0;n<d.length;n++){if(this.model.isVertex(b)&&this.model.isVertex(d[n])|| this.model.isEdge(b)&&this.model.isEdge(d[n]))if(m){var z=this.model.getStyle(d[n]);if("string"===typeof z){var D=z.split(";");0<D.length&&0>D[0].indexOf("=")&&(D=D.slice(1));this.model.setStyle(d[n],D.join(";"))}this.setCellStyles(mxConstants.STYLE_PERIMETER,null,[d[n]]);this.setCellStyles("points",null,[d[n]]);this.pasteStyle(t,[d[n]],null,!0)}else t=this.copyStyle(d[n]),this.model.setStyle(d[n],p),this.pasteStyle(t,[d[n]]);"1"==mxUtils.getValue(this.getCellStyle(d[n],!1),"composite","0")&&this.removeChildCells(d[n]); if(this.model.isVertex(b)&&this.model.isVertex(d[n])&&0<this.model.getChildCount(b)&&d[n]!=b){this.removeChildCells(d[n]);var N=this.getCellGeometry(b),F=this.getCellGeometry(d[n]);null!=N&&null!=F&&(F=F.clone(),F.relative||(F.x=Math.round(F.getCenterX()-N.width/2),F.y=Math.round(F.getCenterY()-N.height/2)),F.width=N.width,F.height=N.height,this.model.setGeometry(d[n],F));for(var P=this.cloneCells(this.model.getChildCells(b)),T=0;T<P.length;T++)this.model.add(d[n],P[T])}}}finally{this.model.endUpdate()}}; Graph.prototype.updateEdgeLabelShape=function(b,d,m){m=null!=m?m:3;var p=this.copyStyle(d),t=d;this.model.beginUpdate();try{if(this.model.isEdge(d)){var n=this.model.getValue(d),z=n;null!=n&&"object"==typeof n?(z=this.convertValueToString(d),n=n.cloneNode(!0),Graph.translateDiagram&&null!=Graph.diagramLanguage&&n.hasAttribute("label_"+Graph.diagramLanguage)?n.setAttribute("label_"+Graph.diagramLanguage,""):n.setAttribute("label","")):n="";var D=this.getCellGeometry(d);t=new mxCell(z,new mxGeometry(0, 0,0,0),"");t.geometry.relative=!0;t.vertex=!0;null!=D&&(t.geometry.x=D.x,t.geometry.y=D.y,null!=D.offset&&(t.geometry.offset=D.offset.clone()));t=this.addCell(t,d);this.model.setValue(d,n)}this.updateShapes(b,[t],!0);this.pasteStyle(p,[t],"fontFamily fontSource fontSize fontColor fontStyle textOpacity horizontal textDirection".split(" "));this.setCellStyles("resizable",null,[t]);var N=this.getCellGeometry(t),F=this.getPreferredSizeForCell(t,null,!1);if(null!=N&&null!=F){var P=F.width+2*m,T=F.height+ 2*m;N=N.clone();var c=null!=N.offset?N.offset:new mxPoint(0,0);N.offset=new mxPoint(Math.round(c.x+(N.width-P)/2),Math.round(c.y+(N.height-T)/2));N.width=P;N.height=T;this.model.setGeometry(t,N)}}finally{this.model.endUpdate()}return t};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,p,t,n,z,D,N){n=n?n:!1;if(b.geometry.relative&&this.model.isEdge(b.parent))return[];for(;b.geometry.relative&&this.model.isVertex(b.parent);)b=b.parent;var F=this.isCloneConnectSource(b),P=F?b:this.getCompositeParent(b),T=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(P.geometry.x,P.geometry.y);d==mxConstants.DIRECTION_NORTH?(T.x+=P.geometry.width/2,T.y-=m): d==mxConstants.DIRECTION_SOUTH?(T.x+=P.geometry.width/2,T.y+=P.geometry.height+m):(T.x=d==mxConstants.DIRECTION_WEST?T.x-m:T.x+(P.geometry.width+m),T.y+=P.geometry.height/2);var c=this.view.getState(this.model.getParent(b));m=this.view.scale;var f=this.view.translate;P=f.x*m;f=f.y*m;null!=c&&this.model.isVertex(c.cell)&&(P=c.x,f=c.y);this.model.isVertex(b.parent)&&b.geometry.relative&&(T.x+=b.parent.geometry.x,T.y+=b.parent.geometry.y);n=n?null:(new mxRectangle(P+T.x*m,f+T.y*m)).grow(40*m);n=null!= n?this.getCells(0,0,0,0,null,null,n,null,!0):null;c=this.view.getState(b);var k=null,q=null;if(null!=n){n=n.reverse();for(var y=0;y<n.length;y++)if(!this.isCellLocked(n[y])&&!this.model.isEdge(n[y])&&n[y]!=b)if(!this.model.isAncestor(b,n[y])&&this.isContainer(n[y])&&(null==k||n[y]==this.model.getParent(b)))k=n[y];else if(null==q&&this.isCellConnectable(n[y])&&!this.model.isAncestor(n[y],b)&&!this.isSwimlane(n[y])){var A=this.view.getState(n[y]);null==c||null==A||mxUtils.intersects(c,A)||(q=n[y])}}var E= !mxEvent.isShiftDown(p)||mxEvent.isControlDown(p)||t;E&&("1"!=urlParams.sketch||t)&&(d==mxConstants.DIRECTION_NORTH?T.y-=b.geometry.height/2:d==mxConstants.DIRECTION_SOUTH?T.y+=b.geometry.height/2:T.x=d==mxConstants.DIRECTION_WEST?T.x-b.geometry.width/2:T.x+b.geometry.width/2);var K=[],Q=q;q=k;t=mxUtils.bind(this,function(W){if(null==z||null!=W||null==q&&F){this.model.beginUpdate();try{if(null==Q&&E){var J=this.getAbsoluteParent(null!=W?W:b);J=F?b:this.getCompositeParent(J);Q=null!=W?W:this.duplicateCells([J], !1)[0];null!=W&&this.addCells([Q],this.model.getParent(b),null,null,null,!0);var ea=this.getCellGeometry(Q);null!=ea&&(null!=W&&"1"==urlParams.sketch&&(d==mxConstants.DIRECTION_NORTH?T.y-=ea.height/2:d==mxConstants.DIRECTION_SOUTH?T.y+=ea.height/2:T.x=d==mxConstants.DIRECTION_WEST?T.x-ea.width/2:T.x+ea.width/2),ea.x=T.x-ea.width/2,ea.y=T.y-ea.height/2);null!=k?(this.addCells([Q],k,null,null,null,!0),q=null):E&&!F&&this.addCells([Q],this.getDefaultParent(),null,null,null,!0)}var X=mxEvent.isControlDown(p)&& mxEvent.isShiftDown(p)&&E||null==q&&F?null:this.insertEdge(this.model.getParent(b),null,"",b,Q,this.createCurrentEdgeStyle());null!=X&&(K.push(X),this.applyNewEdgeStyle(b,[X],d),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(X,b));if(null==q&&null!=Q&&null!=b.parent&&F&&d==mxConstants.DIRECTION_WEST){var aa=b.parent.getIndex(b);this.model.add(b.parent,Q,aa)}null==q&&null!=Q&&K.push(Q);null==Q&&null!=X&&X.geometry.setTerminalPoint(T,!1);null!=X&&this.fireEvent(new mxEventObject("cellsInserted", "cells",[X]))}finally{this.model.endUpdate()}}if(null!=D)D(K);else return K});if(null==z&&null==N||null!=Q||!E||null==q&&F)return t(Q);if(null!=N)return t(N);z(P+T.x*m,f+T.y*m,t)}; Graph.prototype.getIndexableText=function(b){b=null!=b?b:this.model.getDescendants(this.model.root);for(var d=document.createElement("div"),m=[],p,t=0;t<b.length;t++)if(p=b[t],this.model.isVertex(p)||this.model.isEdge(p))this.isHtmlLabel(p)?(d.innerHTML=Graph.sanitizeHtml(this.getLabel(p)),p=mxUtils.extractTextWithWhitespace([d])):p=this.getLabel(p),p=mxUtils.trim(p.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<p.length&&m.push(p);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 p=b;null==m&&null!=p;)null!=p.value&&"object"==typeof p.value&&(m=p.hasAttribute(d)?null!=p.getAttribute(d)?p.getAttribute(d):"":null),p=this.model.getParent(p)}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}; Graph.prototype.getLinkTargetForCell=function(b){return null!=b.value&&"object"==typeof b.value?b.value.getAttribute("linkTarget"):null};Graph.prototype.postProcessCellStyle=function(b,d){return this.updateHorizontalStyle(b,this.replaceDefaultColors(b,mxGraph.prototype.postProcessCellStyle.apply(this,arguments)))}; Graph.prototype.updateHorizontalStyle=function(b,d){if(null!=b&&null!=d&&null!=this.layoutManager){var m=this.model.getParent(b);this.model.isVertex(m)&&this.isCellCollapsed(b)&&(b=this.layoutManager.getLayout(m),null!=b&&b.constructor==mxStackLayout&&(d[mxConstants.STYLE_HORIZONTAL]=!b.horizontal))}return d}; Graph.prototype.replaceDefaultColors=function(b,d){if(null!=d&&null!=this.shapeBackgroundColor&&null!=this.shapeForegroundColor){b=this.shapeBackgroundColor;var m=this.shapeForegroundColor;this.replaceDefaultColor(d,mxConstants.STYLE_FONTCOLOR,m);this.replaceDefaultColor(d,mxConstants.STYLE_FILLCOLOR,b);this.replaceDefaultColor(d,mxConstants.STYLE_GRADIENTCOLOR,m);this.replaceDefaultColor(d,mxConstants.STYLE_STROKECOLOR,m);this.replaceDefaultColor(d,mxConstants.STYLE_IMAGE_BORDER,m);this.replaceDefaultColor(d, mxConstants.STYLE_IMAGE_BACKGROUND,b);this.replaceDefaultColor(d,mxConstants.STYLE_LABEL_BORDERCOLOR,m);this.replaceDefaultColor(d,mxConstants.STYLE_SWIMLANE_FILLCOLOR,b);this.replaceDefaultColor(d,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,b)}return d};Graph.prototype.replaceDefaultColor=function(b,d,m){null!=b&&null!=m&&"none"!=m&&""!=m&&"default"==b[d]&&(b[d]=this.getDefaultColor(b,d,m))}; Graph.prototype.getDefaultColor=function(b,d,m){d="default"+d.charAt(0).toUpperCase()+d.substring(1);"invert"==b[d]&&(b=mxUtils.getLightDarkColor(m),m="light-dark("+b.dark+", "+b.light+")");return m}; Graph.prototype.setAdaptiveColors=function(b){this.adaptiveColors="default"==b?null:b;"1"==urlParams.embedInline?null!=this.container&&(this.container.style.colorScheme="none"==this.getAdaptiveColors()?"light":""):(b=this.view.getDrawPane().ownerSVGElement,null!=b&&(b.style.colorScheme="none"==this.getAdaptiveColors()?"light":""))};Graph.prototype.getAdaptiveColors=function(){return null!=this.adaptiveColors?this.adaptiveColors:Graph.defaultAdaptiveColors}; Graph.prototype.updateAlternateBounds=function(b,d,m){if(null!=b&&null!=d&&null!=this.layoutManager&&null!=d.alternateBounds){var p=this.layoutManager.getLayout(this.model.getParent(b));null!=p&&p.constructor==mxStackLayout&&(p.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,p=0;p<b.length&&m;p++)m=m&&this.model.isEdge(b[p]);p=null;if(1==b.length&&m){var t=this.getCellGeometry(b[0]);null!=t&&(p=t.getTerminalPoint(!0))}p=null!=p?p:this.getBoundingBoxFromGeometry(b,m);null!=p&&(m=Math.round(this.snap(d.x)),d=Math.round(this.snap(d.y)),this.cellsMoved(b,m-p.x,d-p.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,p,t){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 n=0;n<m.length;n++){var z=this.view.getState(m[n]),D=this.getCellGeometry(m[n]);if(null!=z&&null!=D&&("1"!=mxUtils.getValue(z.style,"expandToFront","0")||this.isCellCollapsed(m[n])||this.orderCells(!1,[m[n]]),null!=this.layoutManager)){var N=0,F=0;if(D.alternateBounds)N=D.width- D.alternateBounds.width,F=D.height-D.alternateBounds.height;else{var P=this.useCssTransforms?1:this.view.scale;N=Math.round(D.width-z.width/P);F=Math.round(D.height-z.height/P)}if(0!=F||0!=N){var T=this.model.getParent(m[n]),c=this.layoutManager.getLayout(T);null==c?null!=t&&this.isMoveCellsEvent(t,z)&&this.moveSiblings(z,T,N,F):null!=t&&mxEvent.isAltDown(t)||c.constructor!=mxStackLayout||c.resizeLast||this.resizeParentStacks(T,c,N,F)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(m)}}; Graph.prototype.moveSiblings=function(b,d,m,p){this.model.beginUpdate();try{var t=this.getCellsBeyond(b.x,b.y,d,!0,!0);for(d=0;d<t.length;d++)if(t[d]!=b.cell){var n=this.view.getState(t[d]),z=this.getCellGeometry(t[d]);null!=n&&null!=z&&(z=z.clone(),z.translate(Math.round(m*Math.max(0,Math.min(1,(n.x-b.x)/b.width))),Math.round(p*Math.max(0,Math.min(1,(n.y-b.y)/b.height)))),this.model.setGeometry(t[d],z))}}finally{this.model.endUpdate()}}; Graph.prototype.resizeParentStacks=function(b,d,m,p){if(null!=this.layoutManager&&null!=d&&d.constructor==mxStackLayout&&!d.resizeLast){this.model.beginUpdate();try{for(var t=d.horizontal;null!=b&&null!=d&&d.constructor==mxStackLayout&&d.horizontal==t&&!d.resizeLast;){var n=this.getCellGeometry(b),z=this.view.getState(b);null!=z&&null!=n&&(n=n.clone(),d.horizontal?n.width+=m+Math.min(0,z.width/this.view.scale-n.width):n.height+=p+Math.min(0,z.height/this.view.scale-n.height),this.model.setGeometry(b, n));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.borderBandSize=8; Graph.prototype.getBorderContainer=function(b,d,m){var p=this.borderBandSize,t=null;if(0<p&&null!=b&&this.model.isVertex(b)){var n=this.getCellGeometry(b);if(null==n||Math.min(n.width,n.height)>3*p)for(b=this.model.getParent(b);null==t&&this.model.isVertex(b);){n=this.view.getState(b);if(null!=n){var z=new mxPoint(d,m),D=mxUtils.getValue(n.style,mxConstants.STYLE_ROTATION,0);0!=D&&(D=mxUtils.toRadians(-D),z=mxUtils.getRotatedPoint(z,Math.cos(D),Math.sin(D),new mxPoint(n.getCenterX(),n.getCenterY()))); if(z.x>=n.x+p&&z.x<=n.x+n.width-p&&z.y>=n.y+p&&z.y<=n.y+n.height-p)break;z.x>=n.x-p&&z.x<=n.x+n.width+p&&z.y>=n.y-p&&z.y<=n.y+n.height+p&&this.isContainer(b)&&!this.isTable(b)&&!this.isTableRow(b)&&!this.isTableCell(b)&&!this.isCellLocked(b)&&this.isCellConnectable(b)&&(t=b)}b=this.model.getParent(b)}}return t};Graph.prototype.isTransparentBounds=function(b){return"1"==this.getCurrentCellStyle(b).transparentBounds}; Graph.prototype.isMoveIconVisible=function(b){var d=this.getCurrentCellStyle(b).moveIcon;return null!=d?"1"==d:this.isTransparentBounds(b)};Graph.prototype.getMoveIconDragCells=function(b){return null}; Graph.prototype.getNestedCornerIconOffset=function(b,d,m,p){for(var t=this.model,n=this.view,z=this.getSelectionCells(),D=new mxDictionary,N=0,F=0;F<z.length;F++){var P=z[F];if(P!=b){for(var T=[P],c=t.getParent(P);null!=c&&c!=b;)T.push(c),c=t.getParent(c);if(c==b)for(c=0;c<T.length;c++){var f=T[c];if(null==D.get(f)&&(D.put(f,!0),(f==P||this.isTransparentBounds(f))&&p(f)&&(f=n.getState(f),null!=f))){f=[[f.x,f.y],[f.x+f.width,f.y],[f.x,f.y+f.height],[f.x+f.width,f.y+f.height]];for(var k=0;k<f.length;k++)if(16> Math.abs(f[k][0]-d)&&16>Math.abs(f[k][1]-m)){N++;break}}}}}return 16*N};Graph.prototype.getNestedTransparentBoundsCount=function(b){if(!this.isTransparentBounds(b))return 0;var d=this.model,m=this,p=0,t=function(n){for(var z=d.getChildCount(n),D=0;D<z;D++){var N=d.getChildAt(n,D);m.isTransparentBounds(N)&&p++;t(N)}};t(b);return p};Graph.prototype.isConnectIconVisible=function(b){b=this.getCurrentCellStyle(b).connectIcon;return null!=b?"1"==b:Editor.showConnectHandle}; Graph.prototype.isSelectParentFirst=function(b){return"1"==this.getCurrentCellStyle(b).selectParentFirst};Graph.prototype.parsePadding=function(b){return mxUtils.parsePadding(b)};Graph.prototype.getTransparentBoundsPadding=function(b){b=this.getCurrentCellStyle(b);return this.parsePadding(mxUtils.getValue(b,mxConstants.STYLE_GROUP_PADDING,0))}; Graph.prototype.invalidateTransparentBoundsAncestors=function(b,d){for(b=d&&null!=b?b:null!=b?this.model.getParent(b):null;null!=b;)this.isTransparentBounds(b)&&this.view.invalidate(b,!1,!0),b=this.model.getParent(b)};var graphProcessChange=Graph.prototype.processChange; Graph.prototype.processChange=function(b){graphProcessChange.apply(this,arguments);b instanceof mxChildChange?(this.invalidateTransparentBoundsAncestors(b.child),this.invalidateTransparentBoundsAncestors(b.previous,!0)):(b instanceof mxGeometryChange||b instanceof mxTerminalChange)&&this.invalidateTransparentBoundsAncestors(b.cell)}; Graph.prototype.getTransparentChildBounds=function(b){for(var d=null,m=this.model.getChildCount(b),p=0;p<m;p++){var t=this.model.getChildAt(b,p),n=null;if(this.model.isVertex(t)){var z=this.getCellGeometry(t);if(null!=z&&!z.relative)if(this.isTransparentBounds(t)){var D=this.getTransparentBounds(t);null!=D&&(n=new mxRectangle(z.x+D.x,z.y+D.y,D.width,D.height))}else n=new mxRectangle(z.x,z.y,z.width,z.height)}else if(this.model.isEdge(t)&&(z=this.getCellGeometry(t),null!=z))for(D=[],null==this.model.getTerminal(t, !0)&&null!=z.getTerminalPoint(!0)&&D.push(z.getTerminalPoint(!0)),null==this.model.getTerminal(t,!1)&&null!=z.getTerminalPoint(!1)&&D.push(z.getTerminalPoint(!1)),null!=z.points&&(D=D.concat(z.points)),z=0;z<D.length;z++)null!=D[z]&&(null==n?n=new mxRectangle(D[z].x,D[z].y,0,0):n.add(new mxRectangle(D[z].x,D[z].y,0,0)));null!=n&&(null==d?d=mxRectangle.fromRectangle(n):d.add(n))}return d}; Graph.prototype.getTransparentBounds=function(b){var d=this.getTransparentChildBounds(b);if(null==d)return null;var m=this.getTransparentBoundsPadding(b),p=this.isSwimlane(b)?this.getActualStartSize(b):new mxRectangle;b=this.getActualFooterSize(b);return new mxRectangle(d.x-m.w-p.x-b.x,d.y-m.n-p.y-b.y,d.width+m.w+m.e+p.x+p.width+b.x+b.width,d.height+m.n+m.s+p.y+p.height+b.y+b.height)}; Graph.prototype.getBoundsForGroup=function(b,d,m){var p=null;if(null!=d)for(var t=0;t<d.length;t++){var n=null;if(this.model.isEdge(d[t]))n=this.getBoundingBoxFromGeometry([d[t]],!0);else if(this.model.isVertex(d[t])){var z=this.getCellGeometry(d[t]);if(null==z||z.relative)continue;if(this.isTransparentBounds(d[t])){var D=this.getTransparentBounds(d[t]);null!=D&&(n=new mxRectangle(z.x+D.x,z.y+D.y,D.width,D.height))}else n=new mxRectangle(z.x,z.y,z.width,z.height)}null!=n&&(null==p?p=n:p.add(n))}null!= p&&(this.isSwimlane(b)&&(b=this.getStartSize(b),p.x-=b.width,p.y-=b.height,p.width+=b.width,p.height+=b.height),null!=m&&(p.x-=m,p.y-=m,p.width+=2*m,p.height+=2*m));return p};Graph.prototype.updateGroupBounds=function(b,d,m,p,t,n,z){if(null!=b){for(var D=[],N=0;N<b.length;N++)this.isTransparentBounds(b[N])||D.push(b[N]);if(D.length<b.length)return mxGraph.prototype.updateGroupBounds.call(this,D,d,m,p,t,n,z),b}return mxGraph.prototype.updateGroupBounds.apply(this,arguments)}; Graph.prototype.getBoundingBoxFromGeometry=function(b,d,m,p){var t=null,n=null;if(null!=b){n=[];for(var z=0;z<b.length;z++){var D=this.model.isVertex(b[z])?this.getCellGeometry(b[z]):null;if(null!=D&&!D.relative&&this.isTransparentBounds(b[z])){var N=this.getTransparentBounds(b[z]);null!=N&&(D=new mxRectangle(D.x+N.x,D.y+N.y,N.width,N.height),null==t?t=D:t.add(D))}else n.push(b[z])}}b=mxGraph.prototype.getBoundingBoxFromGeometry.call(this,n,d,null!=m?m:b,p);null!=b&&(null==t?t=b:t.add(b));return t}; 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))};Graph.prototype.isLabelMovable=function(b){var d=this.getCurrentCellStyle(b);return null!=d.movableLabel?"0"!=d.movableLabel:mxGraph.prototype.isLabelMovable.apply(this,arguments)}; Graph.prototype.selectAll=function(b){b=b||this.getDefaultParent();this.isCellLocked(b)||mxGraph.prototype.selectAll.apply(this,arguments)};Graph.prototype.selectCells=function(b,d,m){m=m||this.getDefaultParent();this.isCellLocked(m)||mxGraph.prototype.selectCells.apply(this,arguments)};Graph.prototype.getSwimlaneAt=function(b,d,m){var p=mxGraph.prototype.getSwimlaneAt.apply(this,arguments);this.isCellLocked(p)&&(p=null);return p}; Graph.prototype.isCellFoldable=function(b){var d=this.getCurrentCellStyle(b);return this.foldingEnabled&&!this.isTransparentBounds(b)&&"0"!=mxUtils.getValue(d,mxConstants.STYLE_RESIZABLE,"1")&&("1"==d.treeFolding||!this.isCellLocked(b)&&(this.isContainer(b)&&"0"!=d.collapsible||!this.isContainer(b)&&"1"==d.collapsible))};Graph.prototype.reset=function(){this.isEditing()&&this.stopEditing(!0);this.escape();this.isSelectionEmpty()||this.clearSelection()}; Graph.prototype.zoom=function(b,d){b=Math.max(.01,Math.min(this.view.scale*b,160))/this.view.scale;mxGraph.prototype.zoom.apply(this,arguments)};Graph.prototype.getZoomSteps=function(){if(null==this.zoomSteps||this.zoomStepsFactor!=this.zoomFactor){for(var b=[1],d=20;1<d;)d=Math.max(Math.min(Math.round(d/this.zoomFactor),d-1),1),b.splice(0,0,d/20);for(d=20;3200>d;)d=Math.min(Math.max(Math.round(d*this.zoomFactor),d+1),3200),b.push(d/20);this.zoomSteps=b;this.zoomStepsFactor=this.zoomFactor}return this.zoomSteps}; Graph.prototype.getZoomStep=function(b,d){var m=this.getZoomSteps(),p=d?m[m.length-1]:m[0];if(d)for(d=0;d<m.length;d++){if(m[d]>b+1E-6){p=m[d];break}}else for(d=m.length-1;0<=d;d--)if(m[d]<b-1E-6){p=m[d];break}return p};Graph.prototype.zoomIn=function(){this.zoom(this.getZoomStep(this.view.scale,!0)/this.view.scale)};Graph.prototype.zoomOut=function(){this.zoom(this.getZoomStep(this.view.scale,!1)/this.view.scale)}; Graph.prototype.fitPages=function(b,d){var m=1;null==b&&(m=this.getPageLayout(),b=m.width,m=m.height);var p=this.pageScale,t=this.pageFormat,n=this.container.clientHeight-10;b=(this.container.clientWidth-10)/(b*t.width)/p;this.zoomTo(Math.floor(20*(d?b:Math.min(b,n/(m*t.height)/p)))/20);mxUtils.hasScrollbars(this.container)&&(b=this.getPagePadding(),this.container.scrollLeft=Math.min(b.x*this.view.scale,(this.container.scrollWidth-this.container.clientWidth)/2),d||(this.container.scrollTop=Math.min(b.y* this.view.scale,(this.container.scrollHeight-this.container.clientHeight)/2)))}; Graph.prototype.fitWindow=function(b,d,m,p,t){d=null!=d?d:10;var n=this.container.clientWidth-d,z=this.container.clientHeight-d,D=Math.floor(20*Math.min(n/b.width,z/b.height))/20;null!=m&&(D=Math.min(D,m));if(!p||D<m)this.zoomTo(D,null,null,mxUtils.hasScrollbars(this.container)),mxUtils.hasScrollbars(this.container)&&(m=this.view.translate,this.container.scrollLeft=(b.x+m.x)*this.view.scale-Math.max((n-b.width*this.view.scale)/2+d/2,0),this.container.scrollTop=(b.y+m.y)*this.view.scale-Math.max((z- b.height*this.view.scale)/2+d/2,0),t&&this.pageVisible&&(b=this.view.getBackgroundPageBounds(),d=this.container.clientWidth,t=this.container.clientHeight,b.width<=d&&(this.container.scrollLeft=b.x+b.width/2-d/2),b.height<=t&&(this.container.scrollTop=b.y+b.height/2-t/2)))}; Graph.prototype.getCurrentViewBox=function(){var b=this.view,d=this.container,m=b.scale;b=b.translate;return{x:Math.round(d.scrollLeft/m-b.x),y:Math.round(d.scrollTop/m-b.y),width:Math.round(d.clientWidth/m),height:Math.round(d.clientHeight/m),scale:Math.round(1E4*m)/1E4}}; Graph.prototype.convertValueToTooltip=function(b,d){var m=null;mxUtils.isNode(b.value)&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(m=b.value.getAttribute("tooltip_"+Graph.diagramLanguage)),null==m&&(m=b.value.getAttribute("tooltip")),null!=m&&(null!=m&&this.isReplacePlaceholders(b)&&(m=this.replacePlaceholders(b,m)),m=Graph.sanitizeHtml(m),d&&0<m.length&&0<Editor.tooltipMaxWidth&&(m='<div style="max-width:'+Editor.tooltipMaxWidth+'px;text-overflow:ellipsis;overflow:hidden;">'+m+"</div>"))); return m}; Graph.prototype.getTooltipForCell=function(b){if(null!=window.urlParams&&"0"==urlParams.tooltips)return null;var d=this.getLockedGroupAncestor(b);null!=d&&(b=d);d="";if(mxUtils.isNode(b.value)&&(d=this.convertValueToTooltip(b),null==d)){var m=this.builtInProperties;b=b.value.attributes;var p=[];d="";this.isEnabled()&&(m.push("linkTarget"),m.push("link"));for(var t=0;t<b.length;t++)(Graph.translateDiagram&&"label"==b[t].nodeName||0>mxUtils.indexOf(m,b[t].nodeName))&&0<b[t].nodeValue.length&&p.push({name:b[t].nodeName, value:b[t].nodeValue});p.sort(function(n,z){return n.name<z.name?-1:n.name>z.name?1:0});for(t=0;t<p.length;t++)"link"==p[t].name&&this.isCustomLink(p[t].value)||(d+=("link"!=p[t].name?"<b>"+mxUtils.htmlEntities(p[t].name)+":</b> ":"")+mxUtils.htmlEntities(p[t].value)+"\n");0<d.length&&(d=d.substring(0,d.length-1),mxClient.IS_SVG&&(d='<div style="max-width:360px;text-overflow:ellipsis;overflow:hidden;">'+d+"</div>"))}return d}; Graph.prototype.getTooltip=function(b,d,m,p){if(null!=b&&null!=b.overlays){var t=!1;b.overlays.visit(function(n,z){null==z.overlay||!z.overlay.isTooltipOverlay||d!=z.node&&d.parentNode!=z.node||(t=!0)});if(t)return this.convertValueToTooltip(b.cell,!0)}return mxGraph.prototype.getTooltip.apply(this,arguments)}; Graph.prototype.addFlowAnimationToNode=function(b,d,m,p){if(null!=b&&null!=p){var t=b.getAttribute("stroke-dasharray");if(""==t||null==t){var n=String(mxUtils.getValue(d,mxConstants.STYLE_DASH_PATTERN,"8")).split(" ");t=1==mxUtils.getValue(d,mxConstants.STYLE_FIX_DASH,!1)||null==d.dashPattern?1:mxUtils.getNumber(d,mxConstants.STYLE_STROKEWIDTH,1);if(0<n.length)for(var z=0;z<n.length;z++)n[z]=Math.round(Number(n[z])*m*t*100)/100;b.setAttribute("stroke-dasharray",n.join(" "))}else n=t.split(" ");if(0< n.length){for(z=t=0;z<n.length;z++){var D=parseFloat(n[z]);isNaN(D)||(t+=parseFloat(n[z]))}0!=n.length%2&&(t*=2);m=Math.round(t/m/16*parseInt(mxUtils.getValue(d,"flowAnimationDuration",500)));n=mxUtils.getValue(d,"flowAnimationTimingFunction","linear");d=mxUtils.getValue(d,"flowAnimationDirection","normal");b.style.animation=p+" "+m+"ms "+mxUtils.htmlEntities(n)+" infinite "+mxUtils.htmlEntities(d);b.style.strokeDashoffset=t}}}; Graph.prototype.addFlowAnimationStyle=function(){var b=document.getElementsByTagName("head")[0];if(null!=b&&null==this.flowAnimationId){this.flowAnimationId="ge-flow-animation-"+Editor.guid();var d=document.createElement("style");d.innerHTML=this.createFlowAnimationCss(this.flowAnimationId);b.appendChild(d)}return this.flowAnimationId};Graph.prototype.createFlowAnimationCss=function(b){return"@keyframes "+b+" {\n to {\n stroke-dashoffset: 0;\n }\n}"};Graph.prototype.stringToBytes=function(b){return Graph.stringToBytes(b)}; Graph.prototype.bytesToString=function(b){return Graph.bytesToString(b)};Graph.prototype.compressNode=function(b){return Graph.compressNode(b)};Graph.prototype.compress=function(b,d){return Graph.compress(b,d)};Graph.prototype.decompress=function(b,d){return Graph.decompress(b,d)};Graph.prototype.zapGremlins=function(b){return Graph.zapGremlins(b)};HoverIcons=function(b){mxEventSource.call(this);this.graph=b;this.init()};mxUtils.extend(HoverIcons,mxEventSource);HoverIcons.prototype.arrowSpacing=2; HoverIcons.prototype.updateDelay=500;HoverIcons.prototype.activationDelay=140;HoverIcons.prototype.currentState=null;HoverIcons.prototype.activeArrow=null;HoverIcons.prototype.inactiveOpacity=15;HoverIcons.prototype.cssCursor="copy";HoverIcons.prototype.checkCollisions=!0;HoverIcons.prototype.arrowFill="#29b6f2";HoverIcons.prototype.triangleUp=Graph.createSvgImage(18,28,'<path d="m 6 26 L 12 26 L 12 12 L 18 12 L 9 1 L 1 12 L 6 12 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'); HoverIcons.prototype.triangleRight=Graph.createSvgImage(26,18,'<path d="m 1 6 L 14 6 L 14 1 L 26 9 L 14 18 L 14 12 L 1 12 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.triangleDown=Graph.createSvgImage(18,26,'<path d="m 6 1 L 6 14 L 1 14 L 9 26 L 18 14 L 12 14 L 12 1 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'); HoverIcons.prototype.triangleLeft=Graph.createSvgImage(28,18,'<path d="m 1 9 L 12 1 L 12 6 L 26 6 L 26 12 L 12 12 L 12 18 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.roundDrop=Graph.createSvgImage(26,26,'<circle cx="13" cy="13" r="12" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'); HoverIcons.prototype.refreshTarget=new mxImage("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjM2cHgiIGhlaWdodD0iMzZweCI+PGVsbGlwc2UgZmlsbD0iIzI5YjZmMiIgY3g9IjEyIiBjeT0iMTIiIHJ4PSIxMiIgcnk9IjEyIi8+PHBhdGggdHJhbnNmb3JtPSJzY2FsZSgwLjgpIHRyYW5zbGF0ZSgyLjQsIDIuNCkiIHN0cm9rZT0iI2ZmZiIgZmlsbD0iI2ZmZiIgZD0iTTEyIDZ2M2w0LTQtNC00djNjLTQuNDIgMC04IDMuNTgtOCA4IDAgMS41Ny40NiAzLjAzIDEuMjQgNC4yNkw2LjcgMTQuOGMtLjQ1LS44My0uNy0xLjc5LS43LTIuOCAwLTMuMzEgMi42OS02IDYtNnptNi43NiAxLjc0TDE3LjMgOS4yYy40NC44NC43IDEuNzkuNyAyLjggMCAzLjMxLTIuNjkgNi02IDZ2LTNsLTQgNCA0IDR2LTNjNC40MiAwIDgtMy41OCA4LTggMC0xLjU3LS40Ni0zLjAzLTEuMjQtNC4yNnoiLz48cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIi8+PC9zdmc+Cg==",38, 38);HoverIcons.prototype.tolerance=mxClient.IS_TOUCH?6:0; HoverIcons.prototype.init=function(){this.arrowUp=this.createArrow(this.triangleUp,mxResources.get("plusTooltip"),mxConstants.DIRECTION_NORTH);this.arrowRight=this.createArrow(this.triangleRight,mxResources.get("plusTooltip"),mxConstants.DIRECTION_EAST);this.arrowDown=this.createArrow(this.triangleDown,mxResources.get("plusTooltip"),mxConstants.DIRECTION_SOUTH);this.arrowLeft=this.createArrow(this.triangleLeft,mxResources.get("plusTooltip"),mxConstants.DIRECTION_WEST);this.elts=[this.arrowUp,this.arrowRight, this.arrowDown,this.arrowLeft];this.resetHandler=mxUtils.bind(this,function(){this.reset()});this.repaintHandler=mxUtils.bind(this,function(){this.repaint()});this.graph.selectionModel.addListener(mxEvent.CHANGE,this.resetHandler);this.graph.model.addListener(mxEvent.CHANGE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE,this.repaintHandler); this.graph.view.addListener(mxEvent.DOWN,this.repaintHandler);this.graph.view.addListener(mxEvent.UP,this.repaintHandler);this.graph.addListener(mxEvent.ROOT,this.repaintHandler);this.graph.addListener(mxEvent.ESCAPE,this.resetHandler);mxEvent.addListener(this.graph.container,"scroll",this.resetHandler);this.graph.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){this.mouseDownPoint=null}));mxEvent.addListener(this.graph.container,"mouseleave",mxUtils.bind(this,function(m){null!=m.relatedTarget&& mxEvent.getSource(m)==this.graph.container&&this.setDisplay("none")}));this.graph.addListener(mxEvent.START_EDITING,mxUtils.bind(this,function(m){this.reset()}));var b=this.graph.click;this.graph.click=mxUtils.bind(this,function(m){b.apply(this.graph,arguments);null==this.currentState||this.graph.isCellSelected(this.currentState.cell)||!mxEvent.isTouchEvent(m.getEvent())||this.graph.model.isVertex(m.getCell())||this.reset()});var d=!1;this.graph.addMouseListener({mouseDown:mxUtils.bind(this,function(m, p){d=!1;m=p.getEvent();this.isResetEvent(m)?this.reset():this.isActive()||(p=this.getState(p.getState(),p.getGraphX(),p.getGraphY()),null==p&&mxEvent.isTouchEvent(m)||this.update(p));this.setDisplay("none")}),mouseMove:mxUtils.bind(this,function(m,p){m=p.getEvent();this.isResetEvent(m)?this.reset():this.graph.isMouseDown||mxEvent.isTouchEvent(m)||this.update(this.getState(p.getState(),p.getGraphX(),p.getGraphY()),p.getGraphX(),p.getGraphY());null!=this.graph.connectionHandler&&null!=this.graph.connectionHandler.shape&& (d=!0)}),mouseUp:mxUtils.bind(this,function(m,p){m=p.getEvent();mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(m),mxEvent.getClientY(m));this.isResetEvent(m)?this.reset():this.isActive()&&!d&&null!=this.mouseDownPoint?this.click(this.currentState,this.getDirection(),p):this.isActive()?1==this.graph.getSelectionCount()&&this.graph.model.isEdge(this.graph.getSelectionCell())?this.reset():this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(p.getGraphX(),p.getGraphY())), p.getGraphX(),p.getGraphY())):mxEvent.isTouchEvent(m)||null!=this.bbox&&mxUtils.contains(this.bbox,p.getGraphX(),p.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(m)||this.reset();d=!1;this.resetActiveArrow()})})};HoverIcons.prototype.isResetEvent=function(b,d){return mxEvent.isAltDown(b)||null==this.activeArrow&&mxEvent.isShiftDown(b)||mxEvent.isPopupTrigger(b)&&!this.graph.isCloneEvent(b)}; HoverIcons.prototype.createArrow=function(b,d,m){var p=null;p=mxUtils.createImage(b.src);p.style.width=b.width+"px";p.style.height=b.height+"px";p.style.padding=this.tolerance+"px";null!=d&&p.setAttribute("title",d);p.style.position="absolute";p.style.cursor=this.cssCursor;mxEvent.addGestureListeners(p,mxUtils.bind(this,function(t){null==this.currentState||this.isResetEvent(t)||(this.mouseDownPoint=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(t),mxEvent.getClientY(t)),this.drag(t, this.mouseDownPoint.x,this.mouseDownPoint.y),this.activeArrow=p,this.setDisplay("none"),mxEvent.consume(t))}));mxEvent.redirectMouseEvents(p,this.graph,this.currentState);mxEvent.addListener(p,"mouseenter",mxUtils.bind(this,function(t){mxEvent.isMouseEvent(t)&&(null!=this.activeArrow&&this.activeArrow!=p&&mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.graph.connectionHandler.constraintHandler.reset(),mxUtils.setOpacity(p,100),this.activeArrow=p,this.fireEvent(new mxEventObject("focus", "arrow",p,"direction",m,"event",t)))}));mxEvent.addListener(p,"mouseleave",mxUtils.bind(this,function(t){mxEvent.isMouseEvent(t)&&this.fireEvent(new mxEventObject("blur","arrow",p,"direction",m,"event",t));this.graph.isMouseDown||this.resetActiveArrow()}));return p};HoverIcons.prototype.resetActiveArrow=function(){null!=this.activeArrow&&(mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.activeArrow=null)}; HoverIcons.prototype.getDirection=function(){var b=mxConstants.DIRECTION_EAST;this.activeArrow==this.arrowUp?b=mxConstants.DIRECTION_NORTH:this.activeArrow==this.arrowDown?b=mxConstants.DIRECTION_SOUTH:this.activeArrow==this.arrowLeft&&(b=mxConstants.DIRECTION_WEST);return b};HoverIcons.prototype.visitNodes=function(b){for(var d=0;d<this.elts.length;d++)null!=this.elts[d]&&b(this.elts[d])};HoverIcons.prototype.removeNodes=function(){this.visitNodes(function(b){null!=b.parentNode&&b.parentNode.removeChild(b)})}; HoverIcons.prototype.setDisplay=function(b){this.visitNodes(function(d){d.style.display=b})};HoverIcons.prototype.isActive=function(){return null!=this.activeArrow&&null!=this.currentState}; HoverIcons.prototype.drag=function(b,d,m){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);null!=this.currentState&&(this.graph.connectionHandler.start(this.currentState,d,m),this.graph.isMouseTrigger=mxEvent.isMouseEvent(b),this.graph.isMouseDown=!0,d=this.graph.selectionCellsHandler.getHandler(this.currentState.cell),null!=d&&d.setHandlesVisible(!1),d=this.graph.connectionHandler.edgeState,null!=b&&mxEvent.isShiftDown(b)&&mxEvent.isControlDown(b)&&null!=d&&"orthogonalEdgeStyle"=== mxUtils.getValue(d.style,mxConstants.STYLE_EDGE,null)&&(b=this.getDirection(),d.cell.style=mxUtils.setStyle(d.cell.style,"sourcePortConstraint",b),d.style.sourcePortConstraint=b))};HoverIcons.prototype.getStateAt=function(b,d,m){return this.graph.view.getState(this.graph.getCellAt(d,m))}; HoverIcons.prototype.click=function(b,d,m){var p=m.getEvent(),t=m.getGraphX(),n=m.getGraphY();t=this.getStateAt(b,t,n);null==t||!this.graph.model.isEdge(t.cell)||this.graph.isCloneEvent(p)||t.getVisibleTerminalState(!0)!=b&&t.getVisibleTerminalState(!1)!=b?null!=b&&this.execute(b,d,m):(this.graph.setSelectionCell(t.cell),this.reset());m.consume()}; 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(D,N,F){if(null!=m){var P=new mxRectangle(N,F,D.clientWidth,D.clientHeight);mxUtils.intersects(P,m)&&(D==this.arrowUp?F-=P.y+P.height-m.y:D==this.arrowRight?N+=m.x+m.width-P.x:D==this.arrowDown?F+=m.y+m.height-P.y:D==this.arrowLeft&&(N-=P.x+P.width-m.x))}D.style.left=N+"px";D.style.top=F+"px";mxUtils.setOpacity(D,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 p=this.graph.getCellAt(b.x-this.triangleLeft.width/2,this.currentState.getCenterY()),t=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==p&&p==t&&t==b&&(b=t=p=d=null);var n=this.graph.getCellGeometry(this.currentState.cell),z=mxUtils.bind(this,function(D,N){var F=this.graph.model.isVertex(D)&&this.graph.getCellGeometry(D);null==D||this.graph.model.isAncestor(D, this.currentState.cell)||this.graph.isSwimlane(D)||!(null==F||null==n||F.height<3*n.height&&F.width<3*n.width)?N.style.visibility="visible":N.style.visibility="hidden"});z(d,this.arrowRight);z(p,this.arrowLeft);z(t,this.arrowUp);z(b,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")), this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title",mxResources.get("plusTooltip"))):(this.arrowLeft.removeAttribute("title"),this.arrowRight.removeAttribute("title"),this.arrowUp.removeAttribute("title"),this.arrowDown.removeAttribute("title"))}else this.reset();null!=this.currentState&&(this.bbox=this.computeBoundingBox(),null!=this.bbox&&this.bbox.grow(10))}}; HoverIcons.prototype.computeBoundingBox=function(){var b=this.graph.model.isEdge(this.currentState.cell)?null:mxRectangle.fromRectangle(this.currentState);this.visitNodes(function(d){null!=d.parentNode&&(d=new mxRectangle(d.offsetLeft,d.offsetTop,d.offsetWidth,d.offsetHeight),null==b?b=d:b.add(d))});return b}; HoverIcons.prototype.getState=function(b,d,m){if(null!=b)if(b=b.cell,this.graph.getModel().contains(b)){if(this.graph.getModel().isVertex(b)&&!this.graph.isCellConnectable(b)){var p=this.graph.getModel().getParent(b);this.graph.getModel().isVertex(p)&&this.graph.isCellConnectable(p)&&(b=p)}null==d||null==m||null!=this.currentState&&this.currentState.cell==b||(d=this.graph.getBorderContainer(b,d,m),null!=d&&(b=d));if(this.graph.isCellLocked(b)||this.graph.model.isEdge(b))b=null;b=this.graph.view.getState(b); null!=b&&null==b.style&&(b=null)}else b=null;return b}; HoverIcons.prototype.update=function(b,d,m){if(!this.graph.connectionArrowsEnabled||null!=this.graph.freehand&&this.graph.freehand.isDrawing()||null!=b&&"0"==mxUtils.getValue(b.style,"allowArrows","1"))this.reset();else{null!=b&&null!=b.cell.geometry&&b.cell.geometry.relative&&this.graph.model.isEdge(b.cell.parent)&&(b=null);var p=null;this.prev!=b||this.isActive()?(this.startTime=(new Date).getTime(),this.prev=b,p=0,null!=this.updateThread&&window.clearTimeout(this.updateThread),null!=b&&(this.updateThread= window.setTimeout(mxUtils.bind(this,function(){this.isActive()||this.graph.isMouseDown||this.graph.panningHandler.isActive()||(this.prev=b,this.update(b,d,m))}),this.updateDelay+10))):null!=this.startTime&&(p=(new Date).getTime()-this.startTime);this.setDisplay("");null!=this.currentState&&this.currentState!=b&&p<this.activationDelay&&null!=this.bbox&&!mxUtils.contains(this.bbox,d,m)?this.reset(!1):(null!=this.currentState||p>this.activationDelay)&&this.currentState!=b&&(p>this.updateDelay&&null!= b||null==this.bbox||null==d||null==m||!mxUtils.contains(this.bbox,d,m))&&(null!=b&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(b),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!=b&&this.graph.connectionHandler.constraintHandler.reset()):this.reset())}}; HoverIcons.prototype.setCurrentState=function(b){"eastwest"!=b.style.portConstraint&&(null!=this.arrowUp&&this.graph.container.appendChild(this.arrowUp),null!=this.arrowDown&&this.graph.container.appendChild(this.arrowDown));null!=this.arrowRight&&this.graph.container.appendChild(this.arrowRight);null!=this.arrowLeft&&this.graph.container.appendChild(this.arrowLeft);this.currentState=b}; Graph.prototype.removeTextStyleForCell=function(b,d){var m=this.getCurrentCellStyle(b),p=!1;this.getModel().beginUpdate();try{if("1"==mxUtils.getValue(m,"html","0")){var t=this.convertValueToString(b);"0"!=mxUtils.getValue(m,"nl2Br","1")&&(t=t.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));t=Editor.convertHtmlToText(t);this.cellLabelChanged(b,t);p=!0}d&&(this.setCellStyles("fontSource",null,[b]),this.setCellStyles(mxConstants.STYLE_FONTFAMILY,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTSIZE, null,[b]),this.setCellStyles(mxConstants.STYLE_FONTSTYLE,null,[b]),this.setCellStyles(mxConstants.STYLE_FONTCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BORDERCOLOR,null,[b]),this.setCellStyles(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null,[b]))}finally{this.getModel().endUpdate()}return p};Graph.prototype.createParent=function(b,d,m,p,t){b=this.cloneCell(b);for(var n=0;n<m;n++){var z=this.cloneCell(d),D=this.getCellGeometry(z);null!=D&&(D.x+=n*p,D.y+=n*t);b.insert(z)}return b}; Graph.prototype.createTable=function(b,d,m,p,t,n,z,D,N){m=null!=m?m:60;p=null!=p?p:40;n=null!=n?n:30;D=null!=D?D:"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;strokeColor=inherit;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fixedHeader=1;";N=null!=N?N:"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;strokeColor=inherit;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;"; return this.createParent(this.createVertex(null,null,null!=t?t:"",0,0,d*m,b*p+(null!=t?n:0),null!=z?z:"shape=table;startSize="+(null!=t?n:"0")+";container=1;collapsible=0;childLayout=tableLayout;fixedHeader=1;"),this.createParent(this.createVertex(null,null,"",0,0,d*m,p,D),this.createVertex(null,null,"",0,0,m,p,N),d,m,0),b,0,p)}; Graph.prototype.setTableValues=function(b,d,m){for(var p=this.model.getChildCells(b,!0),t=0;t<p.length;t++)if(null!=m&&(p[t].value=m[t]),null!=d)for(var n=this.model.getChildCells(p[t],!0),z=0;z<n.length;z++)null!=d[t][z]&&(n[z].value=d[t][z]);return b}; Graph.prototype.createCrossFunctionalSwimlane=function(b,d,m,p,t,n,z,D,N){m=null!=m?m:120;p=null!=p?p:120;z=null!=z?z:"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;fixedHeader=1;collapsible=0;recursiveResize=0;expand=0;";D=null!=D?D:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;strokeColor=inherit;connectable=0;fillColor=none;startSize=40;collapsible=0;recursiveResize=0;expand=0;"; N=null!=N?N:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;connectable=0;strokeColor=inherit;fillColor=none;startSize=0;collapsible=0;recursiveResize=0;expand=0;";t=this.createVertex(null,null,null!=t?t:"",0,0,d*m,b*p,null!=n?n:"shape=table;childLayout=tableLayout;fixedHeader=1;"+(null==t?"startSize=0;fillColor=none;":"startSize=40;")+"collapsible=0;recursiveResize=0;expand=0;");n=mxUtils.getValue(this.getCellStyle(t),mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);t.geometry.width+= n;t.geometry.height+=n;z=this.createVertex(null,null,"",0,n,d*m+n,p,z);t.insert(this.createParent(z,this.createVertex(null,null,"",n,0,m,p,D),d,m,0));return 1<b?(z.geometry.y=p+n,this.createParent(t,this.createParent(z,this.createVertex(null,null,"",n,0,m,p,N),d,m,0),b-1,0,p)):t}; Graph.prototype.visitTableCells=function(b,d){var m=null,p=this.model.getChildCells(b,!0);b=this.getActualStartSize(b,!0);for(var t=0;t<p.length;t++){for(var n=this.getActualStartSize(p[t],!0),z=this.model.getChildCells(p[t],!0),D=this.getCellStyle(p[t],!0),N=null,F=[],P=0;P<z.length;P++){var T=this.getCellGeometry(z[P]);if(null==T)F.push(null);else{var c={cell:z[P],rospan:1,colspan:1,row:t,col:P,geo:T};T=null!=T.alternateBounds?T.alternateBounds:T;c.point=new mxPoint(T.width+(null!=N?N.point.x:b.x+ n.x),T.height+(null!=m&&null!=m[0]?m[0].point.y:b.y+n.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!=N&&1<N.colspan?(c.rowspan=N.rowspan,c.colspan=N.colspan-1,c.actual=N.actual):(N=this.getCurrentCellStyle(z[P],!0),null!=N&&(c.rowspan=parseInt(N.rowspan||1),c.colspan=parseInt(N.colspan||1)));N=1==mxUtils.getValue(D,mxConstants.STYLE_SWIMLANE_HEAD,1)&&mxUtils.getValue(D,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!= mxConstants.NONE;d(c,z.length,p.length,b.x+(N?n.x:0),b.y+(N?n.y:0));F.push(c);N=c}}m=F}};Graph.prototype.getTableLines=function(b,d,m){var p=[],t=[];(d||m)&&this.visitTableCells(b,mxUtils.bind(this,function(n,z,D,N,F){d&&n.row<D-1&&(null==p[n.row]&&(p[n.row]=[new mxPoint(N,n.point.y)]),1<n.rowspan&&p[n.row].push(null),p[n.row].push(n.point));m&&n.col<z-1&&(null==t[n.col]&&(t[n.col]=[new mxPoint(n.point.x,F)]),1<n.colspan&&t[n.col].push(null),t[n.col].push(n.point))}));return p.concat(t)}; Graph.prototype.paintTableCellLines=function(b,d,m,p,t,n,z,D){if(null!=z&&z!=mxConstants.NONE){var N=this.model,F=!1,P=!1;if(this.isTableRow(d)){var T=N.getChildCells(N.getParent(d),!0);var c=mxUtils.indexOf(T,d);d=(N="0"!=mxUtils.getValue(this.getCurrentCellStyle(N.getParent(d)),"rowLines","1"))&&0<c;T=N&&c<T.length-1}else if(this.isTableCell(d)){F=N.getParent(d);c=N.getParent(F);T=N.getChildCells(c,!0);P=N.getChildCells(F,!0);c=this.getCurrentCellStyle(c);N="0"!=mxUtils.getValue(c,"rowLines","1"); c="0"!=mxUtils.getValue(c,"columnLines","1");F=mxUtils.indexOf(T,F);var f=mxUtils.indexOf(P,d);d=N&&0<F;T=N&&F<T.length-1;F=c&&0<f;P=c&&f<P.length-1}else return;if(d||T||F||P)b.setStrokeColor(z),b.setStrokeWidth(D),b.setDashed(!1),b.setShadow(!1),d&&(b.begin(),b.moveTo(m,p),b.lineTo(m+t,p),b.stroke()),T&&(b.begin(),b.moveTo(m,p+n),b.lineTo(m+t,p+n),b.stroke()),F&&(b.begin(),b.moveTo(m,p),b.lineTo(m,p+n),b.stroke()),P&&(b.begin(),b.moveTo(m+t,p),b.lineTo(m+t,p+n),b.stroke())}}; 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 p=this.getModel();p.beginUpdate();try{var t=this.getCellGeometry(b);if(null!=t){t=t.clone();t.height+=d;p.setGeometry(b,t);var n=p.getParent(b),z=p.getChildCells(n,!0);if(!m){var D=mxUtils.indexOf(z,b);if(D<z.length-1){var N=z[D+1],F=this.getCellGeometry(N);null!=F&&(F=F.clone(),F.y+=d,F.height-=d,p.setGeometry(N,F))}}var P=this.getCellGeometry(n);null!=P&&(m||(m=b==z[z.length-1]),m&&(P=P.clone(),P.height+=d,p.setGeometry(n,P)))}}finally{p.endUpdate()}}; Graph.prototype.setTableColumnWidth=function(b,d,m){m=null!=m?m:!1;var p=this.getModel(),t=p.getParent(b),n=p.getParent(t),z=p.getChildCells(t,!0);b=mxUtils.indexOf(z,b);var D=b==z.length-1;p.beginUpdate();try{for(var N=p.getChildCells(n,!0),F=0;F<N.length;F++){t=N[F];z=p.getChildCells(t,!0);var P=z[b],T=this.getCellGeometry(P);null!=T&&(T=T.clone(),T.width+=d,null!=T.alternateBounds&&(T.alternateBounds.width+=d),p.setGeometry(P,T));b<z.length-1&&(P=z[b+1],T=this.getCellGeometry(P),null!=T&&(T=T.clone(), T.x+=d,m||(T.width-=d,null!=T.alternateBounds&&(T.alternateBounds.width-=d)),p.setGeometry(P,T)))}if(D||m){var c=this.getCellGeometry(n);null!=c&&(c=c.clone(),c.width+=d,p.setGeometry(n,c))}null!=this.layoutManager&&this.layoutManager.executeLayout(n)}finally{p.endUpdate()}}; Graph.prototype.resizeAllTableRows=function(b,d){var m=this.getModel(),p=m.getChildCells(b,!0);if(0!=p.length){m.beginUpdate();try{for(var t=0;t<p.length;t++){var n=this.getCellGeometry(p[t]);null!=n&&(n=n.clone(),n.y+=d*t,n.height=Math.max(Graph.minTableRowHeight,n.height+d),m.setGeometry(p[t],n))}var z=this.getCellGeometry(b);null!=z&&(z=z.clone(),z.height+=d*p.length,m.setGeometry(b,z));null!=this.layoutManager&&this.layoutManager.executeLayout(b)}finally{m.endUpdate()}}}; Graph.prototype.resizeAllTableColumns=function(b,d){var m=this.getModel(),p=m.getChildCells(b,!0);if(0!=p.length){m.beginUpdate();try{for(var t=0;t<p.length;t++)for(var n=m.getChildCells(p[t],!0),z=0;z<n.length;z++){var D=this.getCellGeometry(n[z]);null!=D&&(D=D.clone(),D.x+=d*z,D.width=Math.max(Graph.minTableColumnWidth,D.width+d),null!=D.alternateBounds&&(D.alternateBounds.width=Math.max(Graph.minTableColumnWidth,D.alternateBounds.width+d)),m.setGeometry(n[z],D))}var N=this.getCellGeometry(b);if(null!= N){var F=m.getChildCells(p[0],!0).length;N=N.clone();N.width+=d*F;m.setGeometry(b,N)}null!=this.layoutManager&&this.layoutManager.executeLayout(b)}finally{m.endUpdate()}}}; Graph.prototype.distributeRows=function(b){var d=this.getModel(),m=d.getChildCells(b,!0);if(!(2>m.length)){d.beginUpdate();try{for(var p=0,t=0;t<m.length;t++){var n=this.getCellGeometry(m[t]);null!=n&&(p+=n.height)}var z=p/m.length;for(t=p=0;t<m.length;t++)n=this.getCellGeometry(m[t]),null!=n&&(n=n.clone(),0==t&&(p=n.y),n.y=p,n.height=z,d.setGeometry(m[t],n),p+=z);null!=this.layoutManager&&this.layoutManager.executeLayout(b)}finally{d.endUpdate()}}}; Graph.prototype.distributeColumns=function(b){var d=this.getModel(),m=d.getChildCells(b,!0);if(0!=m.length){var p=d.getChildCells(m[0],!0);if(!(2>p.length)){d.beginUpdate();try{for(var t=0,n=0;n<p.length;n++){var z=this.getCellGeometry(p[n]);null!=z&&(t+=(null!=z.alternateBounds?z.alternateBounds:z).width)}var D=t/p.length;for(n=0;n<m.length;n++){var N=d.getChildCells(m[n],!0);for(t=p=0;t<N.length;t++)z=this.getCellGeometry(N[t]),null!=z&&(z=z.clone(),0==t&&(p=z.x),z.x=p,z.width=D,null!=z.alternateBounds&& (z.alternateBounds.width=D),d.setGeometry(N[t],z),p+=D)}null!=this.layoutManager&&this.layoutManager.executeLayout(b)}finally{d.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,p=0;p<b.length;p++)if(!this.isVertexIgnored(b[p])){var t=this.graph.getCellGeometry(b[p]);null!=t&&(m+=d?t.width:t.height)}return m}; TableLayout.prototype.getRowLayout=function(b,d){var m=this.graph.model.getChildCells(b,!0),p=this.graph.getActualStartSize(b,!0);b=this.getSize(m,!0);d=Math.max(0,d-p.x-p.width);var t=[];p=p.x;for(var n=0;n<m.length;n++){var z=this.graph.getCellGeometry(m[n]);null!=z&&(p+=0<b?(null!=z.alternateBounds?z.alternateBounds.width:z.width)*d/b:d/m.length,t.push(Math.round(p)))}return t}; TableLayout.prototype.layoutRow=function(b,d,m,p){var t=this.graph.getModel(),n=t.getChildCells(b,!0);b=this.graph.getActualStartSize(b,!0);var z=b.x,D=0;null!=d&&(d=d.slice(),d.splice(0,0,b.x));for(var N=0;N<n.length;N++){var F=this.graph.getCellGeometry(n[N]);null!=F&&(F=F.clone(),F.y=b.y,F.height=Math.max(0,m-b.y-b.height),null!=d?(F.x=d[N],F.width=Math.max(0,d[N+1]-F.x),N==n.length-1&&N<d.length-2&&(F.width=Math.max(0,p-F.x-b.x-b.width))):(F.x=z,z+=F.width,N==n.length-1?F.width=Math.max(0,p-b.x- b.width-D):D+=F.width),F.alternateBounds=new mxRectangle(0,0,F.width,F.height),t.setGeometry(n[N],F))}return D}; TableLayout.prototype.execute=function(b){var d=null!=b?this.graph.getCellGeometry(b):null;if(null!=d){var m=this.graph.getActualStartSize(b,!0),p=this.graph.getCellStyle(b),t="1"==mxUtils.getValue(p,"resizeLastRow","0"),n="1"==mxUtils.getValue(p,"resizeLast","0");p="1"==mxUtils.getValue(p,"fixedRows","0");var z=this.graph.getModel(),D=0;z.beginUpdate();try{for(var N=z.getChildCells(b,!0),F=0;F<N.length;F++)z.setVisible(N[F],!0);if(0<N.length&&!this.graph.isCellCollapsed(b)){var P=0;for(F=0;F<N.length;F++){var T= this.graph.getActualStartSize(N[F],!0);P=Math.max(P,T.x+T.width)}var c=m.x+m.width+P,f=m.y+m.height;c+=0<c?Graph.minTableColumnWidth:0;f+=0<f?Graph.minTableRowHeight:0;if(d.width<c||d.height<f)d=d.clone(),d.width=Math.max(d.width,c),d.height=Math.max(d.height,f),z.setGeometry(b,d)}var k=d.height-m.y-m.height,q=d.width-m.x-m.width,y=this.getSize(N,!1);if(0<k&&0<q&&0<N.length&&0<y){if(t){var A=this.graph.getCellGeometry(N[N.length-1]);null!=A&&(A=A.clone(),A.height=k-y+A.height,z.setGeometry(N[N.length- 1],A))}var E=n?null:this.getRowLayout(N[0],q);T=[];var K=m.y;for(F=0;F<N.length;F++)A=this.graph.getCellGeometry(N[F]),null!=A&&(A=A.clone(),A.x=m.x,A.width=q,A.y=Math.round(K),K=t||p?K+A.height:K+A.height/y*k,A.height=Math.round(K)-A.y,z.setGeometry(N[F],A),D=Math.max(D,this.layoutRow(N[F],E,A.height,q,T)));p&&k<y&&(d=d.clone(),d.height=K+m.height,z.setGeometry(b,d));n&&q<D+Graph.minTableColumnWidth&&(d=d.clone(),d.width=D+m.width+m.x+Graph.minTableColumnWidth,z.setGeometry(b,d));this.graph.visitTableCells(b, mxUtils.bind(this,function(Q){z.setVisible(Q.cell,Q.actual.cell==Q.cell);if(Q.actual.cell!=Q.cell){if(Q.actual.row==Q.row){var W=null!=Q.geo.alternateBounds?Q.geo.alternateBounds:Q.geo;Q.actual.geo.width+=W.width}Q.actual.col==Q.col&&(W=null!=Q.geo.alternateBounds?Q.geo.alternateBounds:Q.geo,Q.actual.geo.height+=W.height)}}))}else for(F=0;F<N.length;F++)z.setVisible(N[F],!1)}finally{z.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(c,f){f=null!=f?f:!0;var k=this.getState(c);null!=k&&f&&this.graph.model.isEdge(k.cell)&&null!=k.style&&1!=k.style[mxConstants.STYLE_CURVED]&&!k.invalid&&this.updateLineJumps(k)&&this.graph.cellRenderer.redraw(k,!1,this.isRendering());if(null!=k&&k.invalid){if(this.graph.showLinkIcons){k= this.graph.getLinkForCell(c);var q=null!=k&&0<k.length,y=!1;if(null!=c.overlays)for(k=0;k<c.overlays.length;k++)if(c.overlays[k].isLinkOverlay){y=!0;break}if(q&&!y)k=this.graph.createLinkOverlay(c),null!=k&&(null==c.overlays&&(c.overlays=[]),c.overlays.push(k));else if(!q&&y){for(k=c.overlays.length-1;0<=k;k--)c.overlays[k].isLinkOverlay&&c.overlays.splice(k,1);0==c.overlays.length&&(c.overlays=null)}}else if(null!=c.overlays){for(k=c.overlays.length-1;0<=k;k--)c.overlays[k].isLinkOverlay&&c.overlays.splice(k, 1);0==c.overlays.length&&(c.overlays=null)}if(this.graph.showTooltipIcons){k=this.graph.convertValueToTooltip(c);q=null!=k&&0<k.length;y=!1;if(null!=c.overlays)for(k=0;k<c.overlays.length;k++)if(c.overlays[k].isTooltipOverlay){y=!0;break}if(q&&!y)k=this.graph.createTooltipOverlay(c),null!=k&&(null==c.overlays&&(c.overlays=[]),c.overlays.push(k));else if(!q&&y){for(k=c.overlays.length-1;0<=k;k--)c.overlays[k].isTooltipOverlay&&c.overlays.splice(k,1);0==c.overlays.length&&(c.overlays=null)}}else if(null!= c.overlays){for(k=c.overlays.length-1;0<=k;k--)c.overlays[k].isTooltipOverlay&&c.overlays.splice(k,1);0==c.overlays.length&&(c.overlays=null)}if(this.graph.showNoteIcons){k=this.graph.getNoteForCell(c);q=null!=k&&0<k.length;y=!1;if(null!=c.overlays)for(k=0;k<c.overlays.length;k++)if(c.overlays[k].isNoteOverlay){y=!0;break}if(q&&!y)k=this.graph.createNoteOverlay(c),null!=k&&(null==c.overlays&&(c.overlays=[]),c.overlays.push(k));else if(!q&&y){for(k=c.overlays.length-1;0<=k;k--)c.overlays[k].isNoteOverlay&& c.overlays.splice(k,1);0==c.overlays.length&&(c.overlays=null)}}else if(null!=c.overlays){for(k=c.overlays.length-1;0<=k;k--)c.overlays[k].isNoteOverlay&&c.overlays.splice(k,1);0==c.overlays.length&&(c.overlays=null)}}k=d.apply(this,arguments);null!=k&&f&&this.graph.model.isEdge(k.cell)&&null!=k.style&&1!=k.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(k);return k};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(c){var f=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=f)for(var k=null,q=!1,y=0;y<f.length;y++){var A=f[y];if("hidden"==A.getAttribute("visibility"))q||(k=A.getAttribute("d"));else if("none"==A.getAttribute("stroke"))q||k!=A.getAttribute("d")||(k=null);else if(null==A.getAttribute("data-rough-fill")&&(null==k||k==A.getAttribute("d"))){if(null==c||0==--c)return A;k=A.getAttribute("d"); q=!0}}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(c){m.apply(this,arguments);this.isFlowAnimationEnabled()&&this.addFlowAnimationToShape()};var p=mxShape.prototype.createSvgCanvas;mxShape.prototype.createSvgCanvas=function(c){c=p.apply(this, arguments);null!=this.state&&(c.adaptiveColors=this.state.view.graph.getAdaptiveColors());return c};var t=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(c,f){return t.apply(this,arguments)||null!=c.routedPoints&&null!=f.routedPoints&&!mxUtils.equalPoints(f.routedPoints,c.routedPoints)};var n=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(c){n.apply(this,arguments);if(this.graph.model.isVertex(c.cell)&&null!=this.graph.isTransparentBounds&& this.graph.isTransparentBounds(c.cell)){var f=this.graph.getTransparentBounds(c.cell);null!=f?(c.x=this.scale*(this.translate.x+c.origin.x+f.x),c.y=this.scale*(this.translate.y+c.origin.y+f.y),c.width=this.scale*f.width,c.height=this.scale*f.height,c.unscaledWidth=f.width,c.unscaledHeight=f.height):(c.width=0,c.height=0,c.unscaledWidth=0,c.unscaledHeight=0)}this.graph.model.isEdge(c.cell)&&1!=c.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(c)};var z=mxMorphing.prototype.getDelta;mxMorphing.prototype.getDelta= function(c){return null!=c&&null!=c.cell&&null!=this.graph.isTransparentBounds&&this.graph.isTransparentBounds(c.cell)?new mxPoint(0,0):z.apply(this,arguments)};mxGraphView.prototype.updateLineJumps=function(c){var f=c.absolutePoints;if(Graph.lineJumpsEnabled){var k=null!=c.routedPoints,q=null;if(null!=f&&null!=this.validEdges&&"none"!==mxUtils.getValue(c.style,"jumpStyle","none")){var y=function(ia,l,v){var H=new mxPoint(l,v);H.type=ia;q.push(H);H=null!=c.routedPoints?c.routedPoints[q.length-1]: null;return null==H||H.type!=ia||H.x!=l||H.y!=v},A=.5*this.scale;k=!1;q=[];for(var E=0;E<f.length-1;E++){for(var K=f[E+1],Q=f[E],W=[],J=f[E+2];E<f.length-2&&mxUtils.ptSegDistSq(Q.x,Q.y,J.x,J.y,K.x,K.y)<1*this.scale*this.scale;)K=J,E++,J=f[E+2];k=y(0,Q.x,Q.y)||k;for(var ea=0;ea<this.validEdges.length;ea++){var X=this.validEdges[ea],aa=X.absolutePoints;if(null!=aa&&mxUtils.intersects(c,X)&&"1"!=X.style.noJump){var ka=null;for(X=0;X<aa.length-1;X++){var ja=aa[X+1],ua=aa[X];for(J=aa[X+2];X<aa.length- 2&&mxUtils.ptSegDistSq(ua.x,ua.y,J.x,J.y,ja.x,ja.y)<1*this.scale*this.scale;)ja=J,X++,J=aa[X+2];var Ba=mxUtils.intersection(Q.x,Q.y,K.x,K.y,ua.x,ua.y,ja.x,ja.y);if(null!=Ba&&(Math.abs(Ba.x-Q.x)>A||Math.abs(Ba.y-Q.y)>A)&&(Math.abs(Ba.x-K.x)>A||Math.abs(Ba.y-K.y)>A)&&(null==ka||mxUtils.ptLineDist(Q.x,Q.y,K.x,K.y,ka.x,ka.y)>A||mxUtils.ptLineDist(Q.x,Q.y,K.x,K.y,ua.x,ua.y)>A)&&(null==J||mxUtils.ptLineDist(Q.x,Q.y,K.x,K.y,J.x,J.y)>A||mxUtils.ptLineDist(Q.x,Q.y,K.x,K.y,ja.x,ja.y)>A)){J=Ba.x-Q.x;ka=Ba.y- Q.y;Ba={distSq:J*J+ka*ka,x:Ba.x,y:Ba.y};J=W.length;for(ka=0;ka<W.length;ka++)if(W[ka].distSq>Ba.distSq){J=ka;break}(0==J||Math.abs(W[J-1].x-Ba.x)>A||Math.abs(W[J-1].y-Ba.y)>A)&&(J==W.length||Math.abs(W[J].x-Ba.x)>A||Math.abs(W[J].y-Ba.y)>A)&&W.splice(J,0,Ba)}ka=ua}}}for(X=0;X<W.length;X++)k=y(1,W[X].x,W[X].y)||k}Ba=f[f.length-1];k=y(0,Ba.x,Ba.y)||k}c.routedPoints=q;return k}return!1};var D=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(c,f,k){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)D.apply(this,arguments);else{var q=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,y=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,A=mxUtils.getValue(this.style,"jumpStyle","none"),E=!0,K=null,Q=null,W=[],J=null;c.begin();for(var ea=0;ea<this.state.routedPoints.length;ea++){var X= this.state.routedPoints[ea],aa=new mxPoint(X.x/this.scale,X.y/this.scale);0==ea?aa=f[0]:ea==this.state.routedPoints.length-1&&(aa=f[f.length-1]);var ka=!1;if(null!=K&&1==X.type){var ja=this.state.routedPoints[ea+1];X=ja.x/this.scale-aa.x;ja=ja.y/this.scale-aa.y;X=X*X+ja*ja;null==J&&(J=new mxPoint(aa.x-K.x,aa.y-K.y),Q=Math.sqrt(J.x*J.x+J.y*J.y),0<Q?(J.x=J.x*y/Q,J.y=J.y*y/Q):J=null);X>y*y&&0<Q&&(X=K.x-aa.x,ja=K.y-aa.y,X=X*X+ja*ja,X>y*y&&(ka=new mxPoint(aa.x-J.x,aa.y-J.y),X=new mxPoint(aa.x+J.x,aa.y+ J.y),W.push(ka),this.addPoints(c,W,k,q,!1,null,E),W=0>Math.round(J.x)||0==Math.round(J.x)&&0>=Math.round(J.y)?1:-1,E=!1,"sharp"==A?(c.lineTo(ka.x-J.y*W,ka.y+J.x*W),c.lineTo(X.x-J.y*W,X.y+J.x*W),c.lineTo(X.x,X.y)):"line"==A?(c.moveTo(ka.x+J.y*W,ka.y-J.x*W),c.lineTo(ka.x-J.y*W,ka.y+J.x*W),c.moveTo(X.x-J.y*W,X.y+J.x*W),c.lineTo(X.x+J.y*W,X.y-J.x*W),c.moveTo(X.x,X.y)):"arc"==A?(W*=1.3,c.curveTo(ka.x-J.y*W,ka.y+J.x*W,X.x-J.y*W,X.y+J.x*W,X.x,X.y)):(c.moveTo(X.x,X.y),E=!0),W=[X],ka=!0))}else J=null;ka|| (W.push(aa),K=aa)}this.addPoints(c,W,k,q,!1,null,E);c.stroke()}};var N=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=function(c,f,k,q){return null!=f&&"centerPerimeter"==f.style[mxConstants.STYLE_PERIMETER]?new mxPoint(f.getCenterX(),f.getCenterY()):N.apply(this,arguments)};var F=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(c,f,k,q){if(null==f||null==c||"1"!=f.style.snapToPoint&&"1"!=c.style.snapToPoint)F.apply(this, arguments);else{f=this.getTerminalPort(c,f,q);var y=this.getNextPoint(c,k,q),A=this.graph.isOrthogonal(c),E=mxUtils.toRadians(Number(f.style[mxConstants.STYLE_ROTATION]||"0")),K=new mxPoint(f.getCenterX(),f.getCenterY());if(0!=E){var Q=Math.cos(-E),W=Math.sin(-E);y=mxUtils.getRotatedPoint(y,Q,W,K)}Q=parseFloat(c.style[mxConstants.STYLE_PERIMETER_SPACING]||0);Q+=parseFloat(c.style[q?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);y=this.getPerimeterPoint(f, y,0==E&&A,Q);0!=E&&(Q=Math.cos(E),W=Math.sin(E),y=mxUtils.getRotatedPoint(y,Q,W,K));c.setAbsoluteTerminalPoint(this.snapToAnchorPoint(c,f,k,q,y),q)}};mxGraphView.prototype.snapToAnchorPoint=function(c,f,k,q,y){if(null!=f&&null!=c){c=this.graph.getAllConnectionConstraints(f);q=k=null;if(null!=c)for(var A=0;A<c.length;A++){var E=this.graph.getConnectionPoint(f,c[A]);if(null!=E){var K=(E.x-y.x)*(E.x-y.x)+(E.y-y.y)*(E.y-y.y);if(null==q||K<q)k=E,q=K}}null!=k&&(y=k)}return y};var P=mxStencil.prototype.evaluateTextAttribute; mxStencil.prototype.evaluateTextAttribute=function(c,f,k){var q=P.apply(this,arguments);"1"==c.getAttribute("placeholders")&&null!=k.state&&(q=k.state.view.graph.replacePlaceholders(k.state.cell,q));return q};var T=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(c){if(null!=c.style&&"undefined"!==typeof pako){var f=mxUtils.getValue(c.style,mxConstants.STYLE_SHAPE,null);if(null!=f&&"string"===typeof f&&"stencil("==f.substring(0,8))try{var k=f.substring(8,f.length- 1),q=mxUtils.parseXml(Graph.decompress(k));return new mxShape(new mxStencil(q.documentElement))}catch(y){null!=window.console&&console.log("Error in shape: "+y)}}return T.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 p=0;p<d.length;p++){var t=d[p];if(!mxStencilRegistry.isFileLoaded(t))if(mxStencilRegistry.setFileLoaded(t),".xml"==t.toLowerCase().substring(t.length-4,t.length))mxStencilRegistry.loadStencilSet(t, null);else if(".js"==t.toLowerCase().substring(t.length-3,t.length))try{if(mxStencilRegistry.allowEval){var n=mxUtils.load(t);null!=n&&200<=n.getStatus()&&299>=n.getStatus()&&eval.call(window,n.getText())}}catch(z){null!=window.console&&console.log("error in getStencil:",b,m,d,t,z)}}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}; mxStencilRegistry.loadStencilSet=function(b,d,m,p){var t=mxStencilRegistry.packages[b];if(null!=m&&m||null==t){var n=!1;if(null==t)try{if(p){mxStencilRegistry.loadStencil(b,mxUtils.bind(this,function(z){null!=z&&null!=z.documentElement&&(mxStencilRegistry.packages[b]=z,n=!0,mxStencilRegistry.parseStencilSet(z.documentElement,d,n))}));return}t=mxStencilRegistry.loadStencil(b);mxStencilRegistry.packages[b]=t;n=!0}catch(z){null!=window.console&&console.log("error in loadStencilSet:",b,z)}null!=t&&null!= t.documentElement&&mxStencilRegistry.parseStencilSet(t.documentElement,d,n)}};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 p=b.firstChild;null!=p;)"shapes"==p.nodeName&&mxStencilRegistry.parseStencilSet(p,d,m),p=p.nextSibling;else{m=null!=m?m:!0;p=b.firstChild;var t="";b=b.getAttribute("name");for(null!=b&&(t=b+".");null!=p;){if(p.nodeType==mxConstants.NODETYPE_ELEMENT&&(b=p.getAttribute("name"),null!=b)){t=t.toLowerCase();var n=b.replace(/ /g,"_");m&&mxStencilRegistry.addStencil(t+n.toLowerCase(),new mxStencil(p));if(null!=d){var z=p.getAttribute("w"), D=p.getAttribute("h");z=null==z?80:parseInt(z,10);D=null==D?80:parseInt(D,10);d(t,n,b,z,D)}}p=p.nextSibling}}}; "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,L){switch(L){case mxConstants.POINTS:return x;case mxConstants.MILLIMETERS:return Math.round(1E3*x/mxConstants.PIXELS_PER_MM)/1E3;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(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 p=mxGraphLayout.prototype.isEdgeIgnored;mxGraphLayout.prototype.isEdgeIgnored=function(x){return p.apply(this,arguments)||this.graph.isEdgeIgnored(x)};var t=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(x){return this.graph.isCloneEvent(x)!=t.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 L in this.graph.currentEdgeStyle)x.style[L]=this.graph.currentEdgeStyle[L];if(null!=this.previous){var M=this.previous.style.newEdgeStyle;if(null!=M)try{var R=Graph.decodeNewEdgeStyle(M); for(L in R)x.style[L]=R[L]}catch(Y){}}x.style=this.graph.postProcessCellStyle(x.cell,x.style);return x};var n=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var x=n.apply(this,arguments);x.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return x};mxConnectionHandler.prototype.updatePreview=function(x){};var z=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var x=z.apply(this,arguments), L=x.getCell;x.getCell=mxUtils.bind(this,function(M){var R=L.apply(this,arguments);this.error=null;return R});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")+";",L="shape curved rounded comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification comicStyle jumpStyle jumpSize libavoidRouting".split(" "), M=0;M<L.length;M++)null!=this.currentEdgeStyle[L[M]]&&(x+=L[M]+"="+this.currentEdgeStyle[L[M]]+";");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,L){L=null!=L?L:{};for(var M=0;M<x.length;M++){var R=x[M];L[mxObjectIdentity.get(R)]=R.getId();for(var Y=this.model.getChildCount(R),ca=0;ca<Y;ca++)this.createCellLookup([this.model.getChildAt(R,ca)],L)}return L};Graph.prototype.createCellMapping=function(x,L,M){M=null!=M?M:{};for(var R in x){var Y=L[R];null==M[Y]&&(M[Y]=x[R].getId()||"")}return M};Graph.prototype.importGraphModel=function(x, L,M,R){L=null!=L?L:0;M=null!=M?M:0;var Y=new mxCodec(x.ownerDocument),ca=new mxGraphModel;Y.decode(x,ca);x=[];Y={};var ma={},sa=ca.getChildren(this.cloneCell(ca.root,this.isCloneInvalidEdges(),Y));if(null!=sa){var wa=this.createCellLookup([ca.root]);sa=sa.slice();this.model.beginUpdate();try{if(1!=sa.length||this.isCellLocked(this.getDefaultParent()))for(ca=0;ca<sa.length;ca++)xa=this.model.getChildren(this.moveCells([sa[ca]],L,M,!1,this.model.getRoot())[0]),null!=xa&&(x=x.concat(xa));else{var xa= ca.getChildren(sa[0]);null!=xa&&(x=this.moveCells(xa,L,M,!1,this.getDefaultParent()),ma[ca.getChildAt(ca.root,0).getId()]=this.getDefaultParent().getId())}if(null!=x&&(this.createCellMapping(Y,wa,ma),this.updateCustomLinks(ma,x),R)){this.isGridEnabled()&&(L=this.snap(L),M=this.snap(M));var Ma=this.getBoundingBoxFromGeometry(x,!0);null!=Ma&&this.moveCells(x,L-Ma.x,M-Ma.y)}}finally{this.model.endUpdate()}}return x};Graph.prototype.encodeCells=function(x){for(var L={},M=this.cloneCells(x,null,L),R=new mxDictionary, Y=0;Y<x.length;Y++)R.put(x[Y],!0);var ca=new mxCodec,ma=new mxGraphModel,sa=ma.getChildAt(ma.getRoot(),0);for(Y=0;Y<M.length;Y++){ma.add(sa,M[Y]);var wa=this.view.getState(x[Y]);if(null!=wa){var xa=this.getCellGeometry(M[Y]);null!=xa&&xa.relative&&!this.model.isEdge(x[Y])&&null==R.get(this.model.getParent(x[Y]))&&(xa.offset=null,xa.relative=!1,xa.x=wa.x/wa.view.scale-wa.view.translate.x,xa.y=wa.y/wa.view.scale-wa.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(L,this.createCellLookup(x)), M);return ca.encode(ma)};Graph.prototype.isSwimlane=function(x,L){var M=null;null==x||this.model.isEdge(x)||this.model.getParent(x)==this.model.getRoot()||(M=this.getCurrentCellStyle(x,L)[mxConstants.STYLE_SHAPE]);return M==mxConstants.SHAPE_SWIMLANE||"table"==M||"tableRow"==M};var D=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(x){return null!=x&&D.apply(this,arguments)?this.isTableCell(x)||this.isTableRow(x)?this.isCellEditable(this.model.getParent(x)):!0:!1};var N=Graph.prototype.isCellMovable; Graph.prototype.isCellMovable=function(x){return null!=x&&N.apply(this,arguments)?this.isTableCell(x)||this.isTableRow(x)?this.isCellMovable(this.model.getParent(x)):!0:!1};var F=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(x){var L=this.model.getParent(x);if(null!=L){var M=this.getCurrentCellStyle(L);if(null!=M.expand)return"0"!=M.expand}return F.apply(this,arguments)&&(null==L||!this.isTable(L))};var P=Graph.prototype.isContractParent;Graph.prototype.isContractParent=function(x){var L= this.model.getParent(x);if(null!=L){var M=this.getCurrentCellStyle(L);if(null!=M.contract)return"0"!=M.contract}return P.apply(this,arguments)&&(null==L||!this.isTable(L))};var T=Graph.prototype.splitEdge;Graph.prototype.splitEdge=function(x,L,M,R,Y,ca,ma,sa){null==sa&&(sa=this.model.getParent(x),this.isTable(sa)||this.isTableRow(sa))&&(sa=this.getCellAt(ca,ma,null,!0,!1));M=null;this.model.beginUpdate();try{var wa=this.getCellGeometry(x);if(null!=wa&&null!=wa.points&&0<wa.points.length&&1==L.length&& this.model.isVertex(L[0])){var xa=this.getCellGeometry(L[0]);if(null!=xa&&!xa.relative){var Ma=new mxRectangle(xa.x+R,xa.y+Y,xa.width,xa.height),Xa=wa.points;xa=[];for(var Ta=0;Ta<Xa.length;Ta++)Ma.intersectsPoint(Xa[Ta].x,Xa[Ta].y)||xa.push(Xa[Ta]);xa.length<Xa.length&&(wa=wa.clone(),wa.points=xa,this.model.setGeometry(x,wa))}}M=T.apply(this,[x,L,M,R,Y,ca,ma,sa]);this.model.setValue(M,"");var kb=this.getChildCells(M,!0);for(Ta=0;Ta<kb.length;Ta++)wa=this.getCellGeometry(kb[Ta]),null!=wa&&wa.relative&& 0<wa.x&&this.model.remove(kb[Ta]);var nb=this.getChildCells(x,!0);for(Ta=0;Ta<nb.length;Ta++)wa=this.getCellGeometry(nb[Ta]),null!=wa&&wa.relative&&0>=wa.x&&this.model.remove(nb[Ta]);var qb=this.model.getTerminal(M,!1);if(null!=qb){var sb=this.getCurrentCellStyle(qb);null!=sb&&"1"==sb.snapToPoint&&(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[x]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[x]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[M]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y, null,[M]))}}finally{this.model.endUpdate()}return M};var c=Graph.prototype.selectCell;Graph.prototype.selectCell=function(x,L,M){if(L||M)c.apply(this,arguments);else{var R=this.getSelectionCell(),Y=null,ca=[],ma=mxUtils.bind(this,function(sa){if(null!=this.view.getState(sa)&&(this.model.isVertex(sa)||this.model.isEdge(sa)))if(ca.push(sa),sa==R)Y=ca.length-1;else if(x&&null==R&&0<ca.length||null!=Y&&x&&ca.length>Y||!x&&0<Y)return;for(var wa=0;wa<this.model.getChildCount(sa);wa++)ma(this.model.getChildAt(sa, wa))});ma(this.model.root);0<ca.length&&(Y=null!=Y?mxUtils.mod(Y+(x?1:-1),ca.length):0,this.setSelectionCell(ca[Y]))}};Graph.prototype.swapShapes=function(x,L){if(this.model.isVertex(x)&&this.model.isVertex(L)&&2==this.getMovableCells([x,L]).length){var M=this.getCellGeometry(x),R=this.getCellGeometry(L);if(null!=M&&null!=R){var Y=M.clone(),ca=R.clone();this.model.beginUpdate();try{Y.x=R.getCenterX()-M.width/2,Y.y=R.getCenterY()-M.height/2,ca.x=M.getCenterX()-R.width/2,ca.y=M.getCenterY()-R.height/ 2,this.model.setGeometry(x,Y),this.model.setGeometry(L,ca)}finally{this.model.endUpdate()}}}};var f=Graph.prototype.moveCells;Graph.prototype.moveCells=function(x,L,M,R,Y,ca,ma){ma=null!=ma?ma:{};if(this.isTable(Y)){for(var sa=[],wa=0;wa<x.length;wa++)this.isTable(x[wa])?sa=sa.concat(this.model.getChildCells(x[wa],!0).reverse()):sa.push(x[wa]);x=sa}this.model.beginUpdate();try{sa=[];for(wa=0;wa<x.length;wa++)if(null!=Y&&this.isTableRow(x[wa])){var xa=this.model.getParent(x[wa]),Ma=this.getCellGeometry(x[wa]); this.isTable(xa)&&sa.push(xa);if(null!=xa&&null!=Ma&&this.isTable(xa)&&this.isTable(Y)&&(R||xa!=Y)){if(!R){var Xa=this.getCellGeometry(xa);null!=Xa&&(Xa=Xa.clone(),Xa.height-=Ma.height,this.model.setGeometry(xa,Xa))}Xa=this.getCellGeometry(Y);null!=Xa&&(Xa=Xa.clone(),Xa.height+=Ma.height,this.model.setGeometry(Y,Xa));var Ta=this.model.getChildCells(Y,!0);if(0<Ta.length){x[wa]=R?this.cloneCell(x[wa]):x[wa];var kb=this.model.getChildCells(x[wa],!0),nb=this.model.getChildCells(Ta[0],!0),qb=nb.length- kb.length;if(0<qb)for(var sb=0;sb<qb;sb++){var eb=this.cloneCell(kb[kb.length-1]);null!=eb&&(eb.value="",this.model.add(x[wa],eb))}else if(0>qb)for(sb=0;sb>qb;sb--)this.model.remove(kb[kb.length+sb-1]);kb=this.model.getChildCells(x[wa],!0);for(sb=0;sb<nb.length;sb++){var hb=this.getCellGeometry(nb[sb]),bb=this.getCellGeometry(kb[sb]);null!=hb&&null!=bb&&(bb=bb.clone(),bb.width=hb.width,this.model.setGeometry(kb[sb],bb))}}}}var xb=f.apply(this,arguments);for(wa=0;wa<sa.length;wa++)!R&&this.model.contains(sa[wa])&& 0==this.model.getChildCount(sa[wa])&&this.model.remove(sa[wa]);R&&this.updateCustomLinks(this.createCellMapping(ma,this.createCellLookup(x)),xb)}finally{this.model.endUpdate()}return xb};var k=Graph.prototype.removeCells;Graph.prototype.removeCells=function(x,L){var M=[];this.model.beginUpdate();try{for(var R=0;R<x.length;R++)if(this.isTableCell(x[R])){var Y=this.model.getParent(x[R]),ca=this.model.getParent(Y);1==this.model.getChildCount(Y)&&1==this.model.getChildCount(ca)?0>mxUtils.indexOf(x,ca)&& 0>mxUtils.indexOf(M,ca)&&M.push(ca):this.labelChanged(x[R],"")}else{if(this.isTableRow(x[R])&&(ca=this.model.getParent(x[R]),0>mxUtils.indexOf(x,ca)&&0>mxUtils.indexOf(M,ca))){for(var ma=this.model.getChildCells(ca,!0),sa=0,wa=0;wa<ma.length;wa++)0<=mxUtils.indexOf(x,ma[wa])&&sa++;sa==ma.length&&M.push(ca)}M.push(x[R])}M=k.apply(this,[M,L])}finally{this.model.endUpdate()}return M};Graph.prototype.updateCustomLinks=function(x,L,M){M=null!=M?M:new Graph;for(var R=0;R<L.length;R++)null!=L[R]&&M.updateCustomLinksForCell(x, L[R],M)};Graph.prototype.updateCustomLinksForCell=function(x,L){this.doUpdateCustomLinksForCell(x,L);for(var M=this.model.getChildCount(L),R=0;R<M;R++)this.updateCustomLinksForCell(x,this.model.getChildAt(L,R))};Graph.prototype.doUpdateCustomLinksForCell=function(x,L){};Graph.prototype.getAllConnectionConstraints=function(x,L){if(null!=x){L=mxUtils.getValue(x.style,"points",null);if(null!=L){x=[];try{var M=JSON.parse(L);for(L=0;L<M.length;L++){var R=M[L];x.push(new mxConnectionConstraint(new mxPoint(R[0], R[1]),2<R.length?"0"!=R[2]:!0,null,3<R.length?R[3]:0,4<R.length?R[4]:0))}}catch(ca){}return x}if(null!=x.shape&&null!=x.shape.bounds){R=x.shape.direction;L=x.shape.bounds;var Y=x.shape.scale;M=L.width/Y;L=L.height/Y;if(R==mxConstants.DIRECTION_NORTH||R==mxConstants.DIRECTION_SOUTH)R=M,M=L,L=R;L=x.shape.getConstraints(x.style,M,L);if(null!=L)return L;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 L=this.getCurrentCellStyle(x);L=mxUtils.getValue(L,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,L,[x])}};var q=Graph.prototype.resetEdge;Graph.prototype.resetEdge=function(x){null!=x&&this.setCellStyles("innerLoopWaypoints",null,[x]);return q.apply(this,arguments)};var y=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler= function(x,L){if(null!=x){var M=x.getVisibleTerminalState(!0),R=x.getVisibleTerminalState(!1);if(null!=M&&M==R){M=this.createEdgeSegmentHandler(x);var Y=M.changePoints,ca=M.getPreviewPoints,ma=M.updatePreviewState,sa=M.clonePreviewState;M.getPreviewPoints=function(xa){if(!this.isSource&&!this.isTarget){var Ma=this.getCurrentPoints();return null!=Ma&&4==Ma.length&&1<this.index&&this.index<Ma.length-1&&(Ma=this.graph.getLoopAroundPoints(this.state,xa),null!=Ma)?this.graph.keepLoopOutsideShape(this.state, Ma):this.graph.keepLoopOutsideShape(this.state,ca.apply(this,arguments))}return ca.apply(this,arguments)};M.clonePreviewState=function(xa,Ma){var Xa=sa.apply(this,arguments);this.isSource||this.isTarget||null==Xa||null==Xa.style||(Xa.style[mxConstants.STYLE_EDGE]="orthogonalEdgeStyle",Xa.style.innerLoopWaypoints="1");return Xa};M.changePoints=function(xa,Ma,Xa){Ma=this.graph.keepLoopOutsideShape(this.state,Ma);var Ta=this.graph.getModel();Ta.beginUpdate();try{xa=Y.call(this,xa,Ma,Xa),null!=xa&&null!= Ma&&2<=Ma.length&&(this.graph.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[xa]),this.graph.setCellStyles("innerLoopWaypoints","1",[xa]))}finally{Ta.endUpdate()}return xa};var wa=M.start;M.start=function(xa,Ma,Xa){this.validLoopPoints=null;wa.apply(this,arguments)};M.rerouteLoopPreview=function(xa){var Ma=this.state.getVisibleTerminalState(!0),Xa=this.state.getVisibleTerminalState(!1);xa.view.updateFixedTerminalPoints(xa,Ma,Xa);xa.view.updatePoints(xa,this.points,Ma,Xa);xa.view.updateFloatingTerminalPoints(xa, Ma,Xa)};M.getCommittedLoopPoints=function(){var xa=this.graph.getCellGeometry(this.state.cell);if(null!=xa&&null!=xa.points&&2<=xa.points.length)return xa.points.map(function(qb){return new mxPoint(qb.x,qb.y)});xa=this.state.absolutePoints;if(null!=xa&&4<=xa.length){for(var Ma=this.state.view.scale,Xa=this.state.view.translate,Ta=this.state.origin,kb=[],nb=1;nb<xa.length-1;nb++)null!=xa[nb]&&kb.push(new mxPoint(xa[nb].x/Ma-Xa.x-Ta.x,xa[nb].y/Ma-Xa.y-Ta.y));if(2<=kb.length)return kb}return null};M.isLoopSpike= function(xa){xa=xa.absolutePoints;if(null==xa||2>xa.length||null==xa[0]||null==xa[xa.length-1])return!0;var Ma=this.graph.gridSize*this.state.view.scale/2;return Math.abs(xa[0].x-xa[xa.length-1].x)<Ma&&Math.abs(xa[0].y-xa[xa.length-1].y)<Ma};M.updatePreviewState=function(xa,Ma,Xa,Ta,kb){this.isSource||this.isTarget||null!=this.validLoopPoints||(this.validLoopPoints=this.getCommittedLoopPoints());ma.apply(this,arguments);if(!this.isSource&&!this.isTarget){if(null!=this.points&&2==this.points.length&& 0==Math.round(this.points[0].x-this.points[1].x)&&0==Math.round(this.points[0].y-this.points[1].y)){var nb=this.graph.getLoopAroundPoints(this.state,Ma);null!=nb&&(this.points=this.graph.keepLoopOutsideShape(this.state,nb),this.rerouteLoopPreview(xa))}this.isLoopSpike(xa)?null!=this.validLoopPoints&&(this.points=this.validLoopPoints.map(function(qb){return new mxPoint(qb.x,qb.y)}),this.rerouteLoopPreview(xa)):null!=this.points&&2<=this.points.length&&(this.validLoopPoints=this.points.map(function(qb){return new mxPoint(qb.x, qb.y)}))}};return M}}return y.apply(this,arguments)};Graph.prototype.isValidRoot=function(x){for(var L=this.model.getChildCount(x),M=0,R=0;R<L;R++){var Y=this.model.getChildAt(x,R);this.model.isVertex(Y)&&(Y=this.getCellGeometry(Y),null==Y||Y.relative||M++)}return 0<M||this.isContainer(x)};Graph.prototype.isValidDropTarget=function(x,L,M){for(var R=this.getCurrentCellStyle(x),Y=!0,ca=!0,ma=0;ma<L.length&&ca;ma++)Y=Y&&this.isTable(L[ma]),ca=ca&&this.isTableRow(L[ma]);return!this.isCellLocked(x)&&null== this.getLockedGroupAncestor(x)&&(this.isTargetShape(x,L,M)||("1"!=mxUtils.getValue(R,"part","0")||this.isContainer(x))&&"0"!=mxUtils.getValue(R,"dropTarget","1")&&(mxGraph.prototype.isValidDropTarget.apply(this,arguments)||this.isContainer(x))&&!this.isTableRow(x)&&(!this.isTable(x)||ca||Y))};Graph.prototype.createGroupCell=function(){var x=mxGraph.prototype.createGroupCell.apply(this,arguments);x.setStyle(Editor.defaultTransparentGroups?"group;transparentBounds=1;":"group");return x};var A=Graph.prototype.translateCell; Graph.prototype.translateCell=function(x,L,M){if(this.isTransparentBounds(x))for(var R=this.model.getChildCount(x),Y=0;Y<R;Y++)this.translateCell(this.model.getChildAt(x,Y),L,M);else A.apply(this,arguments)};var E=Graph.prototype.groupCells;Graph.prototype.groupCells=function(x,L,M){null==x&&Editor.defaultTransparentGroups&&(x=this.createGroupCell(M));if(null!=x&&this.isTransparentBounds(x)){null==M&&(M=mxUtils.sortCells(this.getSelectionCells(),!0));M=this.getCellsForGroup(M);if(0<M.length){var R= this.model.getParent(x);null==R&&(R=this.model.getParent(M[0]));this.model.beginUpdate();try{this.model.setGeometry(x,new mxGeometry(0,0,0,0));var Y=this.model.getChildCount(R);this.cellsAdded([x],R,Y,null,null,!1,!1,!1);Y=this.model.getChildCount(x);this.cellsAdded(M,x,Y,null,null,!1,!1,!1);this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",x,"border",L,"cells",M))}finally{this.model.endUpdate()}}return x}return E.apply(this,arguments)};Graph.prototype.isExtendParentsOnAdd=function(x){var L= mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(L&&null!=x&&null!=this.layoutManager){var M=this.model.getParent(x);null!=M&&(M=this.layoutManager.getLayout(M),null!=M&&M.constructor==mxStackLayout&&(L=!1))}return L};Graph.prototype.getPreferredSizeForCell=function(x,L,M){M=null!=M?M:this.gridEnabled;var R=this.getShapeInsidePreferredSize(x,L,M);null==R&&(R=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments),null!=R&&(R.width+=10,R.height+=4,M&&(R.width=this.snap(R.width), R.height=this.snap(R.height))));return R};Graph.prototype.getShapeInsidePreferredSize=function(x,L,M){var R=null,Y=null!=x?this.getCurrentCellStyle(x):null,ca=null!=Y?mxUtils.getValue(Y,"shapeInsideShape",null):null;ca=null==ca||""==ca?null!=Y?mxUtils.getValue(Y,mxConstants.STYLE_SHAPE,null):null:ca;if(null!=x&&this.model.isVertex(x)&&"function"===typeof Graph.shapeInsideOutlines[ca]){Y=this.getCellGeometry(x);var ma=this.view.getState(x);ma=null!=ma?ma:this.view.createState(x);if(null!=Y&&null!= ma&&0<Y.width&&0<Y.height&&this.isShapeInsideEnabled(ma.style)){var sa=this.cellRenderer.getLabelValue(ma);if(null!=sa&&""!=sa){sa=sa.replace(/\n/g,"<br>");var wa=Y.width,xa=Y.height,Ma=mxUtils.bind(this,function(Ta,kb){var nb=this.getShapeInsideOutline(ma.style,Ta,kb);if(null==nb)return!1;var qb=this.getShapeInsideBox(ma.style,Ta,kb);Ta=this.measureShapeInsideFlow(sa,ma.style,nb,qb,0,Ta,kb);return null!=Ta&&Ta.bottom<=qb.height+.5&&Ta.right<=qb.width+.5});if(null!=this.measureShapeInsideFlow(sa, ma.style,this.getShapeInsideOutline(ma.style,wa,xa)||{left:null,right:null},this.getShapeInsideBox(ma.style,wa,xa),0,wa,xa)){var Xa=null!=L?function(Ta){return[wa,Math.max(1,xa*Ta)]}:function(Ta){return[Math.max(1,wa*Ta),Math.max(1,xa*Ta)]};x=function(Ta){Ta=Xa(Ta);return Ma(Ta[0],Ta[1])};L=R=1;if(x(1)){for(;.0625<R&&x(.5*R);)R*=.5;L=R;R*=.5}else{for(R=0;7>R++&&!x(2*L);)L*=2;R=L;L*=2;if(!x(L))return null}for(Y=0;6>Y;Y++)ca=(R+L)/2,x(ca)?L=ca:R=ca;L=Xa(L);x=Math.ceil(L[0]);L=Math.ceil(L[1]);M&&(x= this.snap(x+this.gridSize/2),L=this.snap(L+this.gridSize/2));R=new mxRectangle(0,0,x,L)}}}}return R};Graph.prototype.getAutosizeTextAvailableSpace=function(x,L,M,R){var Y=0,ca=0;(null!=R&&null!=this.getImage(R)||null!=x[mxConstants.STYLE_IMAGE])&&x[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL&&(x[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(Y+=parseFloat(mxUtils.getValue(x,mxConstants.STYLE_IMAGE_WIDTH,mxLabel.prototype.imageSize))),x[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&& (ca+=parseFloat(mxUtils.getValue(x,mxConstants.STYLE_IMAGE_HEIGHT,mxLabel.prototype.imageSize))));Y+=2*parseFloat(mxUtils.getValue(x,mxConstants.STYLE_SPACING,2));Y+=parseFloat(mxUtils.getValue(x,mxConstants.STYLE_SPACING_LEFT,2));Y+=parseFloat(mxUtils.getValue(x,mxConstants.STYLE_SPACING_RIGHT,2));ca+=2*parseFloat(mxUtils.getValue(x,mxConstants.STYLE_SPACING,2));ca+=parseFloat(mxUtils.getValue(x,mxConstants.STYLE_SPACING_TOP,2));ca+=parseFloat(mxUtils.getValue(x,mxConstants.STYLE_SPACING_BOTTOM, 2));null!=R&&(R=this.getFoldingImage(R),null!=R&&(Y+=R.width+8));x=mxUtils.getValue(x,mxConstants.STYLE_HORIZONTAL,!0);Y=(x?L:M)-Y;L=(x?M:L)-ca;return 0>=Y||0>=L?null:{availW:Y,availH:L}};Graph.prototype.computeAutosizeTextFontSize=function(x,L,M,R,Y,ca){var ma=1,sa=84,wa=ca?L:null,xa=null;if(ca){for(var Ma=x.replace(/<br\s*\/?>/gi,"\n").replace(/<[^>]*>/g,"").split(/[\s\n]+/),Xa=[],Ta=0;Ta<Ma.length;Ta++)0<Ma[Ta].length&&Xa.push(mxUtils.htmlEntities(Ma[Ta],!1));0<Xa.length&&(xa=Xa.join("<br>"))}for(;ma< sa;)Ma=Math.ceil((ma+sa)/2),Xa=mxUtils.getSizeForString(x,Ma,R,wa,Y),(Xa=ca?Xa.height<=M:Xa.width<=L&&Xa.height<=M)&&ca&&null!=xa&&mxUtils.getSizeForString(xa,Ma,R,null,Y).width>L&&(Xa=!1),Xa?ma=Ma:sa=Ma-1;return Math.max(6,ma)};Graph.prototype.updateAutosizeTextFontSize=function(x,L){var M=this.view.getState(x);null==M&&(M=this.view.createState(x));L=L||M.style;var R=this.getCellGeometry(x);if(null!=R&&!this.model.isEdge(x)){var Y=this.cellRenderer.getLabelValue(M);if(null!=Y&&0!=Y.length&&(M=this.getAutosizeTextAvailableSpace(L, R.width,R.height,M),null!=M)){this.isHtmlLabel(x)||(Y=mxUtils.htmlEntities(Y,!1));Y=Y.replace(/\n/g,"<br>");var ca=L[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,ma=L[mxConstants.STYLE_FONTSTYLE],sa="wrap"==L[mxConstants.STYLE_WHITE_SPACE],wa=null;if(sa){var xa=this.getShapeInsideFloats(L,R.width,R.height);null!=xa&&(wa=this.computeShapeInsideFontSize(Y,L,xa,R.width,R.height))}null==wa&&(wa=this.computeAutosizeTextFontSize(Y,M.availW,M.availH,ca,ma,sa));this.setCellStyles(mxConstants.STYLE_FONTSIZE, wa,[x])}}};Graph.prototype.cellsResized=function(x,L,M){var R=mxGraph.prototype.cellsResized.apply(this,arguments);if(null!=x)for(var Y=0;Y<x.length;Y++)this.model.isVertex(x[Y])&&this.isAutosizeTextCell(x[Y])&&this.updateAutosizeTextFontSize(x[Y]);return R};Graph.prototype.isRotatableGroup=function(x){var L=this.getModel();return L.isVertex(x)&&0<L.getChildCount(x)&&!this.isTable(x)&&!this.isTableRow(x)&&!this.isTableCell(x)&&!this.isSwimlane(x)};Graph.prototype.setCellRotation=function(x,L){var M= parseFloat(L);!isNaN(M)&&this.isRotatableGroup(x)?this.rotateCell(x,M-(parseFloat(this.getCurrentCellStyle(x)[mxConstants.STYLE_ROTATION])||0)):this.setCellStyles(mxConstants.STYLE_ROTATION,L,[x])};Graph.prototype.rotateCell=function(x,L,M){if(0!=L){var R=this.getModel();if(R.isVertex(x)||R.isEdge(x)){R.beginUpdate();try{if(!R.isEdge(x)){var Y=(this.getCurrentCellStyle(x)[mxConstants.STYLE_ROTATION]||0)+L;this.setCellStyles(mxConstants.STYLE_ROTATION,Y,[x])}var ca=this.getCellGeometry(x);if(null!= ca){var ma=this.getCellGeometry(M);null==ma||R.isEdge(M)||(ca=ca.clone(),ca.rotate(L,new mxPoint(ma.width/2,ma.height/2)),R.setGeometry(x,ca));if(R.isVertex(x)&&!ca.relative||R.isEdge(x)){var sa=R.getChildCount(x);for(M=0;M<sa;M++)this.rotateCell(R.getChildAt(x,M),L,x)}}}finally{R.endUpdate()}}}};Graph.prototype.isRotatedGroupResize=function(x){return this.isRotatableGroup(x)&&0!=mxUtils.mod(parseFloat(this.getCurrentCellStyle(x)[mxConstants.STYLE_ROTATION])||0,360)};var K=Graph.prototype.resizeChildCells; Graph.prototype.resizeChildCells=function(x,L){if(this.isRotatedGroupResize(x)){var M=parseFloat(this.getCurrentCellStyle(x)[mxConstants.STYLE_ROTATION])||0;this.resizeRotatedGroupChildren(x,this.model.getGeometry(x),L,M,M)}else K.apply(this,arguments)};Graph.prototype.resizeRotatedGroupChildren=function(x,L,M,R,Y){var ca=this.getModel(),ma=0!=L.width?M.width/L.width:1,sa=0!=L.height?M.height/L.height:1,wa=mxUtils.toRadians(R),xa=Math.cos(-wa),Ma=Math.sin(-wa);wa=mxUtils.toRadians(Y);var Xa=Math.cos(wa), Ta=Math.sin(wa),kb=L.width/2,nb=L.height/2,qb=M.width/2,sb=M.height/2,eb=function(Bb,Eb){var Lb=xa*(Bb-kb)-Ma*(Eb-nb);Bb=Ma*(Bb-kb)+xa*(Eb-nb);Lb*=ma;Bb*=sa;return new mxPoint(qb+Xa*Lb-Ta*Bb,sb+Ta*Lb+Xa*Bb)};L=function(Bb){if(null!=Bb)for(var Eb=0;Eb<Bb.length;Eb++)if(null!=Bb[Eb]){var Lb=eb(Bb[Eb].x,Bb[Eb].y);Bb[Eb].x=Lb.x;Bb[Eb].y=Lb.y}};M=ca.getChildCount(x);for(wa=0;wa<M;wa++){var hb=ca.getChildAt(x,wa),bb=this.getCellGeometry(hb);if(null!=bb)if(ca.isEdge(hb))bb=bb.clone(),L([bb.sourcePoint,bb.targetPoint]), L(bb.points),ca.setGeometry(hb,bb);else if(ca.isVertex(hb)&&!bb.relative){var xb=this.getCurrentCellStyle(hb),tb=parseFloat(xb[mxConstants.STYLE_ROTATION])||0,ib=mxUtils.toRadians(tb-R),zb=ma*Math.cos(ib),Kb=sa*Math.sin(ib),Nb=Math.sqrt(zb*zb+Kb*Kb);ib=Math.sqrt(ma*ma*Math.sin(ib)*Math.sin(ib)+sa*sa*Math.cos(ib)*Math.cos(ib));"fixed"==xb[mxConstants.STYLE_ASPECT]&&(Nb=ib=Math.min(Nb,ib));var Zb=eb(bb.getCenterX(),bb.getCenterY()),Sb=bb;bb=bb.clone();var Pb=tb;this.isCellResizable(hb)&&("0"!=xb[mxConstants.STYLE_RESIZE_WIDTH]&& (bb.width=Sb.width*Nb),"0"!=xb[mxConstants.STYLE_RESIZE_HEIGHT]&&(bb.height=Sb.height*ib),Pb=Math.round(100*(Y+mxUtils.toDegree(Math.atan2(Kb,zb))))/100);this.isCellMovable(hb)&&(bb.x=Zb.x-bb.width/2,bb.y=Zb.y-bb.height/2);ca.setGeometry(hb,bb);.01<Math.abs(mxUtils.mod(Pb,360)-mxUtils.mod(tb,360))?this.setCellStyles(mxConstants.STYLE_ROTATION,mxUtils.mod(Pb,360),[hb]):Pb=tb;this.resizeRotatedGroupChildren(hb,Sb,bb,tb,Pb)}else this.scaleCell(hb,ma,sa,!0)}};Graph.prototype.turnShapes=function(x,L){var M= this.getModel(),R=[];M.beginUpdate();try{for(var Y=0;Y<x.length;Y++){var ca=x[Y];if(M.isEdge(ca)){var ma=M.getTerminal(ca,!0),sa=M.getTerminal(ca,!1);if(null!=ma&&ma==sa){var wa=this.view.getState(ca),xa=M.getGeometry(ca);if(null!=wa&&null!=xa&&null!=wa.absolutePoints&&4<=wa.absolutePoints.length&&(null==xa.points||2>xa.points.length)&&null==wa.style[mxConstants.STYLE_EXIT_X]&&null==wa.style[mxConstants.STYLE_ENTRY_X]){for(var Ma=this.view.scale,Xa=this.view.translate,Ta=wa.origin,kb=wa.absolutePoints, nb=[],qb=1;qb<kb.length-1;qb++)null!=kb[qb]&&nb.push(new mxPoint(kb[qb].x/Ma-Xa.x-Ta.x,kb[qb].y/Ma-Xa.y-Ta.y));2<=nb.length&&(xa=xa.clone(),xa.points=nb,M.setGeometry(ca,xa),this.setCellStyles(mxConstants.STYLE_EDGE,"orthogonalEdgeStyle",[ca]),this.setCellStyles("innerLoopWaypoints","1",[ca]))}}M.setTerminal(ca,sa,!0);M.setTerminal(ca,ma,!1);var sb=M.getGeometry(ca);if(null!=sb){sb=sb.clone();null!=sb.points&&sb.points.reverse();var eb=sb.getTerminalPoint(!0),hb=sb.getTerminalPoint(!1);sb.setTerminalPoint(eb, !1);sb.setTerminalPoint(hb,!0);M.setGeometry(ca,sb);var bb=this.view.getState(ca),xb=this.view.getState(ma),tb=this.view.getState(sa);if(null!=bb){var ib=null!=xb?this.getConnectionConstraint(bb,xb,!0):null,zb=null!=tb?this.getConnectionConstraint(bb,tb,!1):null;this.setConnectionConstraint(ca,ma,!0,zb);this.setConnectionConstraint(ca,sa,!1,ib);var Kb=mxUtils.getValue(bb.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,mxUtils.getValue(bb.style, mxConstants.STYLE_TARGET_PERIMETER_SPACING),[ca]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,Kb,[ca])}R.push(ca)}}else if(M.isVertex(ca))if(this.isRotatableGroup(ca))this.rotateCell(ca,L?-90:90),R.push(ca);else if(sb=this.getCellGeometry(ca),null!=sb){if(!(this.isTable(ca)||this.isTableRow(ca)||this.isTableCell(ca)||this.isSwimlane(ca))){sb=sb.clone();sb.x+=sb.width/2-sb.height/2;sb.y+=sb.height/2-sb.width/2;var Nb=sb.width;sb.width=sb.height;sb.height=Nb;M.setGeometry(ca,sb)}var Zb= this.view.getState(ca);if(null!=Zb){var Sb=[mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_NORTH],Pb=mxUtils.getValue(Zb.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);this.setCellStyles(mxConstants.STYLE_DIRECTION,Sb[mxUtils.mod(mxUtils.indexOf(Sb,Pb)+(L?-1:1),Sb.length)],[ca])}R.push(ca)}}}finally{M.endUpdate()}return R};Graph.prototype.rotateEdges=function(x,L){var M=this.getModel(),R=[];M.beginUpdate();try{for(var Y=0;Y<x.length;Y++){var ca= x[Y];if(M.isEdge(ca)&&!this.isCellLocked(ca)&&null==M.getTerminal(ca,!0)&&null==M.getTerminal(ca,!1)){var ma=M.getGeometry(ca);if(null!=ma&&null!=ma.getTerminalPoint(!0)&&null!=ma.getTerminalPoint(!1)){ma=ma.clone();var sa=[ma.getTerminalPoint(!0),ma.getTerminalPoint(!1)];null!=ma.points&&(sa=sa.concat(ma.points));for(var wa=sa[0].x,xa=sa[0].y,Ma=sa[0].x,Xa=sa[0].y,Ta=1;Ta<sa.length;Ta++)wa=Math.min(wa,sa[Ta].x),xa=Math.min(xa,sa[Ta].y),Ma=Math.max(Ma,sa[Ta].x),Xa=Math.max(Xa,sa[Ta].y);var kb=(wa+ Ma)/2,nb=(xa+Xa)/2;for(Ta=0;Ta<sa.length;Ta++){var qb=sa[Ta].x-kb,sb=sa[Ta].y-nb;sa[Ta].x=L?kb+sb:kb-sb;sa[Ta].y=L?nb-qb:nb+qb}M.setGeometry(ca,ma);R.push(ca)}}}}finally{M.endUpdate()}return R};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 Q=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&&(null==x.previous.equals||!x.previous.equals(x.geometry)))){var L=x.cell;this.isTableCell(L)&&(L=this.model.getParent(L));this.isTableRow(L)&&(L=this.model.getParent(L));var M=this.view.getState(L);null!=M&&null!=M.shape&&(this.view.invalidate(L),M.shape.bounds=null)}Q.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 L=0;L<x.length;L++){var M=this.view.getState(x[L]);null!=M&&null!=M.shape&&null!=M.shape.stencil&&this.stencilHasPlaceholders(M.shape.stencil)?this.removeStateForCell(x[L]):this.isReplacePlaceholders(x[L])&&this.view.invalidate(x[L],!1,!1)}};Graph.prototype.replaceElement=function(x,L){L=x.ownerDocument.createElement(null!=L?L:"span");for(var M=Array.prototype.slice.call(x.attributes);attr= M.pop();)L.setAttribute(attr.nodeName,attr.nodeValue);L.innerHTML=x.innerHTML;x.parentNode.replaceChild(L,x)};Graph.prototype.processElements=function(x,L){if(null!=x){x=x.getElementsByTagName("*");for(var M=0;M<x.length;M++)null!=x[M]&&L(x[M])}};Graph.prototype.updateLabelElements=function(x,L,M){x=null!=x?x:this.getSelectionCells();for(var R=document.createElement("div"),Y=0;Y<x.length;Y++){var ca=this.getCurrentCellStyle(x[Y]);if(null!=ca&&"1"==ca.html&&(ca=this.convertValueToString(x[Y]),null!= ca&&0<ca.length)){R.innerHTML=Graph.sanitizeHtml(ca);for(var ma=R.getElementsByTagName(null!=M?M:"*"),sa=0;sa<ma.length;sa++)L(ma[sa]);R.innerHTML!=ca&&this.cellLabelChanged(x[Y],R.innerHTML)}}};Graph.prototype.cellLabelChanged=function(x,L,M){L=Graph.zapGremlins(L);this.model.beginUpdate();try{if(null!=x.value&&"object"==typeof x.value){if(this.isReplacePlaceholders(x)&&null!=x.getAttribute("placeholder"))for(var R=x.getAttribute("placeholder"),Y=x;null!=Y;){if(Y==this.model.getRoot()||null!=Y.value&& "object"==typeof Y.value&&Y.hasAttribute(R)){this.setAttributeForCell(Y,R,L);break}Y=this.model.getParent(Y)}var ca=x.value.cloneNode(!0);Graph.translateDiagram&&null!=Graph.diagramLanguage&&ca.hasAttribute("label_"+Graph.diagramLanguage)?ca.setAttribute("label_"+Graph.diagramLanguage,L):ca.setAttribute("label",L);L=ca}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 L=new mxDictionary,M=0;M<x.length;M++)L.put(x[M],!0);var R=[];for(M=0;M<x.length;M++){var Y=this.model.getParent(x[M]);null==Y||L.get(Y)||(L.put(Y,!0),R.push(Y))}for(M=0;M<R.length;M++)if(Y=this.view.getState(R[M]),null!=Y&&(this.model.isEdge(Y.cell)||this.model.isVertex(Y.cell))&&this.isCellDeletable(Y.cell)&&(this.isTransparentState(Y)||this.isTransparentBounds(Y.cell))){for(var ca=!0,ma=0;ma<this.model.getChildCount(Y.cell)&&ca;ma++)L.get(this.model.getChildAt(Y.cell, ma))||(ca=!1);ca&&x.push(Y.cell)}L=new mxDictionary;for(M=0;M<x.length;M++)L.put(x[M],!0);for(M=0;M<R.length;M++)for(Y=R[M];!L.get(Y)&&this.isTransparentBounds(Y);){ca=null;var sa=!1,wa=this.model.getChildCount(Y);for(ma=0;ma<wa;ma++){var xa=this.model.getChildAt(Y,ma);if(!L.get(xa)){if(null!=ca){sa=!0;break}ca=xa}}if(sa||null==ca||!this.isTransparentBounds(ca)||!this.isCellDeletable(ca))break;ma=this.model.getChildren(ca);null!=ma&&0<ma.length&&this.cellsAdded(ma.slice(),Y,this.model.getChildCount(Y), null,null,!0);L.put(ca,!0);x.push(ca)}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(x){for(var L=[],M=0;M<x.length;M++)this.isCellDeletable(x[M])&&(this.isTransparentState(this.view.getState(x[M]))||this.isTransparentBounds(x[M]))&&L.push(x[M]);x=L;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(x,L){this.setAttributeForCell(x,"link",L)};Graph.prototype.createLinkOverlay=function(x){var L= this.getLinkForCell(x);if(null!=L&&0<L.length){var M=this.getLinkOverlayTooltip(L);M=new mxCellOverlay(new mxImage(Editor.lightDarkLinkImage,16,16),M,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP,new mxPoint(8,-8));M.isLinkOverlay=!0;M.cursor="pointer";var R=this;M.addListener(mxEvent.CLICK,mxUtils.bind(this,function(Y,ca){R.isEnabled()?R.setSelectionCell(ca.getProperty("cell")):this.isCustomLink(L)?this.customLinkClicked(L,x):(Y=this.getLinkTargetForCell(x),this.openLink(this.getAbsoluteUrl(L),Y))})); return M}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;x.cursor="pointer";var L=this;x.addListener(mxEvent.CLICK,function(M,R){M=R.getProperty("cell");L.isEnabled()&&L.isCellEditable(M)?(L.setSelectionCell(M),L.editTooltip(M)): (R=R.getProperty("event"),M=L.convertValueToTooltip(M,!0),null!=M&&0<M.length&&L.tooltipHandler.show(M,R.clientX,R.clientY))});return x}return null};Graph.prototype.createNoteOverlay=function(x){x=this.getNoteForCell(x);if(null!=x&&0<x.length){x=new mxCellOverlay(new mxImage(Editor.lightDarkNoteImage,16,16),null,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM,new mxPoint(-8,8));x.isNoteOverlay=!0;x.cursor="pointer";var L=this;x.addListener(mxEvent.CLICK,function(M,R){L.showNoteBox(R.getProperty("cell"), R.getProperty("event"))});return x}return null};Graph.prototype.showNoteBox=function(x,L){var M=this.convertValueToNote(x);if(null!=M&&0!=M.length){this.hideNoteBox();Graph.installNoteBoxStyle();var R=document.createElement("div");R.className="geNoteBox";R.innerHTML=Graph.sanitizeHtml(M);if(this.isEnabled()&&this.isCellEditable(x)){M=document.createElement("a");M.className="geNoteEditBtn";M.setAttribute("title",mxResources.get("editNote",null,"Edit Note"));var Y=document.createElement("img");Y.setAttribute("src", Editor.editImage);M.appendChild(Y);mxEvent.addListener(M,"click",mxUtils.bind(this,function(sa){this.hideNoteBox();this.setSelectionCell(x);this.editNote(x);mxEvent.consume(sa)}));R.insertBefore(M,R.firstChild)}var ca=this;mxEvent.addListener(R,"click",function(sa){for(var wa=mxEvent.getSource(sa);null!=wa&&wa!=R;){if("A"==wa.nodeName){wa=wa.getAttribute("href");null!=wa&&ca.openLink(wa);mxEvent.consume(sa);break}wa=wa.parentNode}});document.body.appendChild(R);M=null!=L?mxEvent.getClientX(L):20; L=null!=L?mxEvent.getClientY(L):20;Y=window.innerHeight||document.documentElement.clientHeight;R.style.left=Math.max(8,Math.min(M,(window.innerWidth||document.documentElement.clientWidth)-R.offsetWidth-8))+"px";R.style.top=Math.max(8,Math.min(L+8,Y-R.offsetHeight-8))+"px";var ma=mxUtils.bind(this,function(sa){if("keydown"!=sa.type||27==sa.keyCode)"mousedown"==sa.type&&R.contains(mxEvent.getSource(sa))||this.hideNoteBox()});this.noteBox={div:R,closeHandler:ma};window.setTimeout(function(){mxEvent.addListener(document, "mousedown",ma);mxEvent.addListener(document,"keydown",ma)},0)}};Graph.prototype.hideNoteBox=function(){null!=this.noteBox&&(null!=this.noteBox.div.parentNode&&this.noteBox.div.parentNode.removeChild(this.noteBox.div),mxEvent.removeListener(document,"mousedown",this.noteBox.closeHandler),mxEvent.removeListener(document,"keydown",this.noteBox.closeHandler),this.noteBox=null)};Graph.prototype.editNote=function(x){};Graph.prototype.editTooltip=function(x){};Graph.prototype.setTooltipForCell=function(x, L){var M="tooltip";Graph.translateDiagram&&null!=Graph.diagramLanguage&&mxUtils.isNode(x.value)&&x.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(M="tooltip_"+Graph.diagramLanguage);this.setAttributeForCell(x,M,L)};Graph.prototype.getNoteForCell=function(x){return this.getAttributeForCell(x,"note",null)};Graph.prototype.setNoteForCell=function(x,L){this.setAttributeForCell(x,"note",null!=L&&0<L.length?L:null)};Graph.prototype.convertValueToNote=function(x){var L=this.getNoteForCell(x);null!= L&&this.isReplacePlaceholders(x)&&(L=this.replacePlaceholders(x,L));return L};Graph.prototype.getAttributeForCell=function(x,L,M){x=null!=x.value&&"object"===typeof x.value?x.value.getAttribute(L):null;return null!=x?x:M};Graph.prototype.setAttributeForCell=function(x,L,M){if(null!=x.value&&"object"==typeof x.value)var R=x.value.cloneNode(!0);else R=mxUtils.createXmlDocument().createElement("UserObject"),R.setAttribute("label",x.value||"");null!=M?R.setAttribute(L,M):R.removeAttribute(L);this.model.setValue(x, R)};Graph.prototype.isTargetShape=function(x,L,M){x=mxUtils.getValue(this.getCurrentCellStyle(x),mxConstants.STYLE_SHAPE,"");for(M=0;M<L.length;M++){var R=mxUtils.getValue(this.getCurrentCellStyle(L[M]),"targetShapes","").split(",");if(0<=mxUtils.indexOf(R,x))return!0}return!1};var W=Graph.prototype.getDropTarget;Graph.prototype.getDropTarget=function(x,L,M,R){if(mxEvent.isAltDown(L))return null;for(var Y=0;Y<x.length;Y++){var ca=this.model.getParent(x[Y]);if(this.model.isEdge(ca)&&0>mxUtils.indexOf(x, ca))return null}ca=W.apply(this,arguments);var ma=!0;for(Y=0;Y<x.length&&ma;Y++)ma=ma&&this.isTableRow(x[Y]);ma&&(this.isTableCell(ca)&&(ca=this.model.getParent(ca)),this.isTableRow(ca)&&(ca=this.model.getParent(ca)),this.isTable(ca)||(ca=null));return ca};Graph.prototype.click=function(x){mxGraph.prototype.click.call(this,x);this.firstClickState=x.getState();this.firstClickSource=x.getSource()};Graph.prototype.dblClick=function(x,L){this.isEnabled()&&(L=this.insertTextForEvent(x,L),mxGraph.prototype.dblClick.call(this, x,L))};Graph.prototype.insertTextForEvent=function(x,L){var M=mxUtils.convertPoint(this.container,mxEvent.getClientX(x),mxEvent.getClientY(x));if(null!=x&&!this.model.isVertex(L)){var R=this.model.isEdge(L)?this.view.getState(L):null,Y=mxEvent.getSource(x);this.firstClickState!=R||this.firstClickSource!=Y||null!=R&&null!=R.text&&null!=R.text.node&&null!=R.text.boundingBox&&(mxUtils.contains(R.text.boundingBox,M.x,M.y)||mxUtils.isAncestorNode(R.text.node,mxEvent.getSource(x)))||(null!=R||this.isCellLocked(this.getDefaultParent()))&& (null==R||this.isCellLocked(R.cell)||null!=this.getLockedGroupAncestor(this.model.getParent(R.cell)))||!(null!=R||mxClient.IS_SVG&&Y==this.view.getCanvas().ownerSVGElement)||(null==R&&(R=this.view.getState(this.getCellAt(M.x,M.y))),L=this.addText(M.x,M.y,R))}return L};Graph.prototype.getInsertPoint=function(x){x=this.getGridSize();var L=this.container.scrollLeft/this.view.scale-this.view.translate.x,M=this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible){var R=this.getPageLayout(), Y=this.getPageSize();L=Math.max(L,R.x*Y.width);M=Math.max(M,R.y*Y.height)}return new mxPoint(this.snap(L+x),this.snap(M+x))};Graph.prototype.getFreeInsertPoint=function(x){var L=this.view,M=this.getGraphBounds(),R=this.getInsertPoint(x);x=this.snap(Math.round(Math.max(R.x,M.x/L.scale-L.translate.x+(0==M.width?2*this.gridSize:0))));L=this.snap(Math.round(Math.max(R.y,(M.y+M.height)/L.scale-L.translate.y+2*this.gridSize)));return new mxPoint(x,L)};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,L){x=null!=x?x:"";null!=L&&(0<x.length&&";"!=x.charAt(x.length-1)&&(x+=";"),x+="fontSize="+L+";");return x};Graph.prototype.addText=function(x,L,M){var R=new mxCell;R.value="Text";R.geometry=new mxGeometry(0,0,0,0);R.vertex=!0;if(null!=M&&this.model.isEdge(M.cell)){R.style="edgeLabel;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];", this.edgeFontSize);R.geometry.relative=!0;R.connectable=!1;var Y=this.view.getRelativePoint(M,x,L);R.geometry.x=Math.round(1E4*Y.x)/1E4;R.geometry.y=Math.round(Y.y);R.geometry.offset=new mxPoint(0,0);Y=this.view.getPoint(M,R.geometry);var ca=this.view.scale;R.geometry.offset=new mxPoint(Math.round((x-Y.x)/ca),Math.round((L-Y.y)/ca))}else Y=this.view.translate,R.style="text;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.vertexFontSize),R.geometry.width= 40,R.geometry.height=20,R.geometry.x=Math.round(x/this.view.scale)-Y.x-(null!=M?M.origin.x:0),R.geometry.y=Math.round(L/this.view.scale)-Y.y-(null!=M?M.origin.y:0),R.style+="autosize=1;";this.getModel().beginUpdate();try{this.addCells([R],null!=M?M.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[R])),this.autoSizeCell(R)}finally{this.getModel().endUpdate()}return R};Graph.prototype.addClickHandler=function(x,L,M){var R=mxUtils.bind(this,function(){var wa=this.container.getElementsByTagName("a"); if(null!=wa)for(var xa=0;xa<wa.length;xa++){var Ma=this.getAbsoluteUrl(wa[xa].getAttribute("href"));null!=Ma&&(wa[xa].setAttribute("rel",this.linkRelation),wa[xa].setAttribute("href",Ma),null!=L&&mxEvent.addGestureListeners(wa[xa],null,null,L))}});this.model.addListener(mxEvent.CHANGE,R);R();var Y=this.container.style.cursor,ca=this.getTolerance(),ma=this,sa={currentState:null,currentLink:null,currentTarget:null,highlight:null!=x&&""!=x&&x!=mxConstants.NONE?new mxCellHighlight(ma,x,4):null,startX:0, startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(wa){var xa=wa.sourceState;if(null==xa||null==ma.getLinkForCell(xa.cell))wa=ma.getCellAt(wa.getGraphX(),wa.getGraphY(),null,null,null,function(Ma,Xa,Ta){return null==ma.getLinkForCell(Ma.cell)}),xa=null==xa||ma.model.isAncestor(wa,xa.cell)?ma.view.getState(wa):null;xa!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=xa,null!=this.currentState&&this.activate(this.currentState))},mouseDown:function(wa,xa){this.startX= xa.getGraphX();this.startY=xa.getGraphY();this.scrollLeft=ma.container.scrollLeft;this.scrollTop=ma.container.scrollTop;null==this.currentLink&&"auto"==ma.container.style.overflow&&(ma.container.style.cursor="move");this.updateCurrentState(xa)},mouseMove:function(wa,xa){if(ma.isMouseDown)null!=this.currentLink&&(wa=Math.abs(this.startX-xa.getGraphX()),xa=Math.abs(this.startY-xa.getGraphY()),(wa>ca||xa>ca)&&this.clear());else{for(wa=xa.getSource();null!=wa&&"a"!=wa.nodeName.toLowerCase();)wa=wa.parentNode; null!=wa?this.clear():(null!=ma.tooltipHandler&&null!=this.currentLink&&null!=this.currentState&&ma.tooltipHandler.reset(xa,!0,this.currentState),(null==this.currentState||xa.getState()!=this.currentState&&null!=xa.sourceState||!ma.intersects(this.currentState,xa.getGraphX(),xa.getGraphY()))&&this.updateCurrentState(xa))}},mouseUp:function(wa,xa){var Ma=xa.getSource();for(wa=xa.getEvent();null!=Ma&&"a"!=Ma.nodeName.toLowerCase();)Ma=Ma.parentNode;null==Ma&&Math.abs(this.scrollLeft-ma.container.scrollLeft)< ca&&Math.abs(this.scrollTop-ma.container.scrollTop)<ca&&(null==xa.sourceState||!xa.isSource(xa.sourceState.control))&&((mxEvent.isLeftMouseButton(wa)||mxEvent.isMiddleMouseButton(wa))&&!mxEvent.isPopupTrigger(wa)||mxEvent.isTouchEvent(wa))&&(null!=this.currentLink?(Ma=ma.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&Ma||null==L||L(wa,this.currentLink,null!=this.currentState?this.currentState.cell:null),mxEvent.isConsumed(wa)||(wa=null!=this.currentTarget?this.currentTarget: mxEvent.isMiddleMouseButton(wa)?"_blank":Ma?ma.linkTarget:"_top",ma.openLink(this.currentLink,wa),xa.consume())):null!=M&&!xa.isConsumed()&&Math.abs(this.scrollLeft-ma.container.scrollLeft)<ca&&Math.abs(this.scrollTop-ma.container.scrollTop)<ca&&Math.abs(this.startX-xa.getGraphX())<ca&&Math.abs(this.startY-xa.getGraphY())<ca&&M(xa.getEvent()));this.clear()},activate:function(wa){this.currentLink=ma.getAbsoluteUrl(ma.getLinkForCell(wa.cell));null!=this.currentLink&&(this.currentTarget=ma.getLinkTargetForCell(wa.cell), ma.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(wa))},clear:function(){null!=ma.container&&(ma.container.style.cursor=Y);this.currentLink=this.currentState=this.currentTarget=null;null!=this.highlight&&this.highlight.hide();null!=ma.tooltipHandler&&ma.tooltipHandler.hide()}};ma.click=function(wa){};ma.addMouseListener(sa);mxEvent.addListener(document,"mouseleave",function(wa){sa.clear()})};Graph.prototype.duplicateCells=function(x,L){x=null!=x?x:this.getSelectionCells(); L=null!=L?L:!0;for(var M=0;M<x.length;M++)this.isTableCell(x[M])&&(x[M]=this.model.getParent(x[M]));x=this.model.getTopmostCells(x);var R=this.getModel(),Y=this.gridSize,ca=[];R.beginUpdate();try{var ma={},sa=this.createCellLookup(x),wa=this.cloneCells(x,!1,ma,!0);for(M=0;M<x.length;M++){var xa=R.getParent(x[M]);if(null!=xa){var Ma=this.moveCells([wa[M]],Y,Y,!1)[0];ca.push(Ma);if(L)R.add(xa,wa[M]);else{var Xa=xa.getIndex(x[M]);R.add(xa,wa[M],Xa+1)}if(this.isTable(xa)){var Ta=this.getCellGeometry(wa[M]), kb=this.getCellGeometry(xa);null!=Ta&&null!=kb&&(kb=kb.clone(),kb.height+=Ta.height,R.setGeometry(xa,kb))}}else ca.push(wa[M])}this.updateCustomLinks(this.createCellMapping(ma,sa),wa,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",wa))}finally{R.endUpdate()}return ca};Graph.prototype.insertImage=function(x,L,M){if(null!=x&&null!=this.cellEditor.textarea){for(var R=this.cellEditor.textarea.getElementsByTagName("img"),Y=[],ca=0;ca<R.length;ca++)Y.push(R[ca]);document.execCommand("insertimage", !1,x);x=this.cellEditor.textarea.getElementsByTagName("img");if(x.length==Y.length+1)for(ca=x.length-1;0<=ca;ca--)if(0==ca||x[ca]!=Y[ca-1]){x[ca].setAttribute("width",L);x[ca].setAttribute("height",M);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 L=this.cellEditor.textarea.getElementsByTagName("a"),M=[],R=0;R<L.length;R++)M.push(L[R]);document.execCommand("createlink",!1,mxUtils.trim(x)); L=this.cellEditor.textarea.getElementsByTagName("a");if(L.length==M.length+1)for(R=L.length-1;0<=R;R--)if(L[R]!=M[R-1]){for(L=L[R].getElementsByTagName("a");0<L.length;){for(M=L[0].parentNode;null!=L[0].firstChild;)M.insertBefore(L[0].firstChild,L[0]);M.removeChild(L[0])}break}}else document.execCommand("createlink",!1,mxUtils.trim(x))};var J=Graph.prototype.getResizableCells;Graph.prototype.getResizableCells=function(x){var L=J.apply(this,arguments);if(null!=x)for(var M=0;M<x.length;M++)(this.isTransparentBounds(x[M])|| this.getCurrentCellStyle(x[M])[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE)&&0>mxUtils.indexOf(L,x[M])&&L.push(x[M]);return L};Graph.prototype.isCellResizable=function(x){if(this.isTransparentBounds(x))return!1;var L=mxGraph.prototype.isCellResizable.apply(this,arguments),M=this.getCurrentCellStyle(x);return!this.isTableCell(x)&&!this.isTableRow(x)&&(L||"0"!=mxUtils.getValue(M,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==M[mxConstants.STYLE_WHITE_SPACE])};Graph.prototype.alignCells=function(x, L,M){null==L&&(L=this.getMovableCells(this.getSelectionCells()));var R=!1;if(null!=L)for(var Y=0;Y<L.length;Y++)if(this.isTransparentBounds(L[Y])){R=!0;break}if(!R)return mxGraph.prototype.alignCells.apply(this,arguments);var ca=this;R=function(Ma){if(ca.model.isEdge(Ma))return null;var Xa=ca.getCellGeometry(Ma);if(null==Xa||Xa.relative)return null;var Ta=ca.getOriginForCell(Ma);return ca.isTransparentBounds(Ma)?(Ma=ca.getTransparentBounds(Ma),null==Ma?null:new mxRectangle(Ta.x+Xa.x+Ma.x,Ta.y+Xa.y+ Ma.y,Ma.width,Ma.height)):new mxRectangle(Ta.x+Xa.x,Ta.y+Xa.y,Xa.width,Xa.height)};if(null!=L&&1<L.length){if(null==M)for(Y=0;Y<L.length;Y++){var ma=R(L[Y]);if(null!=ma)if(null==M)if(x==mxConstants.ALIGN_CENTER){M=ma.x+ma.width/2;break}else if(x==mxConstants.ALIGN_RIGHT)M=ma.x+ma.width;else if(x==mxConstants.ALIGN_TOP)M=ma.y;else if(x==mxConstants.ALIGN_MIDDLE){M=ma.y+ma.height/2;break}else M=x==mxConstants.ALIGN_BOTTOM?ma.y+ma.height:ma.x;else M=x==mxConstants.ALIGN_RIGHT?Math.max(M,ma.x+ma.width): x==mxConstants.ALIGN_TOP?Math.min(M,ma.y):x==mxConstants.ALIGN_BOTTOM?Math.max(M,ma.y+ma.height):Math.min(M,ma.x)}if(null!=M){L=mxUtils.sortCells(L);this.model.beginUpdate();try{for(Y=0;Y<L.length;Y++)if(ma=R(L[Y]),null!=ma){var sa=0,wa=0;x==mxConstants.ALIGN_CENTER?sa=M-(ma.x+ma.width/2):x==mxConstants.ALIGN_RIGHT?sa=M-(ma.x+ma.width):x==mxConstants.ALIGN_TOP?wa=M-ma.y:x==mxConstants.ALIGN_MIDDLE?wa=M-(ma.y+ma.height/2):x==mxConstants.ALIGN_BOTTOM?wa=M-(ma.y+ma.height):sa=M-ma.x;if(0!=sa||0!=wa)if(this.isTransparentBounds(L[Y]))this.translateCell(L[Y], sa,wa);else{var xa=this.getCellGeometry(L[Y]).clone();xa.x+=sa;xa.y+=wa;this.resizeCell(L[Y],xa)}}this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",x,"cells",L))}finally{this.model.endUpdate()}}}return L};Graph.prototype.distributeCells=function(x,L,M){null==L&&(L=this.getSelectionCells());if(null!=L&&1<L.length){for(var R=[],Y=null,ca=null,ma=0,sa=0;sa<L.length;sa++)if(this.getModel().isVertex(L[sa])){var wa=this.view.getState(L[sa]);if(null!=wa){var xa=x?wa.getCenterX():wa.getCenterY(); Y=null!=Y?Math.max(Y,xa):xa;ca=null!=ca?Math.min(ca,xa):xa;M&&(ma+=x?wa.unscaledWidth:wa.unscaledHeight);R.push(wa)}}if(2<R.length){R.sort(function(qb,sb){return x?qb.x-sb.x:qb.y-sb.y});M&&(ma-=x?R[0].unscaledWidth/2+R[R.length-1].unscaledWidth/2:R[0].unscaledHeight/2+R[R.length-1].unscaledHeight/2);wa=this.view.translate;xa=this.view.scale;ca=ca/xa-(x?wa.x:wa.y);Y=Y/xa-(x?wa.x:wa.y);this.getModel().beginUpdate();try{var Ma=(Y-ca-ma)/(R.length-1),Xa=ca+(M?x?R[0].unscaledWidth/2:R[0].unscaledHeight/ 2:0);for(sa=1;sa<R.length-1;sa++){var Ta=this.view.getState(this.model.getParent(R[sa].cell)),kb=this.getCellGeometry(R[sa].cell);Xa+=Ma;if(null!=kb&&null!=Ta)if(this.isTransparentBounds(R[sa].cell)){var nb=x?M?R[sa].x/xa-wa.x:R[sa].getCenterX()/xa-wa.x:M?R[sa].y/xa-wa.y:R[sa].getCenterY()/xa-wa.y;x?this.translateCell(R[sa].cell,Xa-nb,0):this.translateCell(R[sa].cell,0,Xa-nb)}else kb=kb.clone(),x?kb.x=Math.round(Xa-(M?0:kb.width/2))-Ta.origin.x:kb.y=Math.round(Xa-(M?0:kb.height/2))-Ta.origin.y,this.getModel().setGeometry(R[sa].cell, kb);M&&(Xa+=x?R[sa].unscaledWidth:R[sa].unscaledHeight)}}finally{this.getModel().endUpdate()}}}return L};Graph.prototype.isCloneEvent=function(x){return mxClient.IS_MAC&&mxEvent.isMetaDown(x)||mxEvent.isControlDown(x)};Graph.prototype.createSvgImageExport=function(x,L,M,R){x=new mxImageExport;var Y=this;if(M){var ca=x.drawCellState;x.drawCellState=function(sa,wa){ca.apply(this,arguments);if(null!=wa.root&&null!=sa.cell&&null!=sa.cell.geometry){var xa=Y.view.scale,Ma=function(kb,nb,qb,sb,eb,hb,bb){null!= bb&&wa.setLink(bb,R);wa.image(nb,qb,16,16,kb,!0);null!=bb&&wa.setLink(null);kb=wa.root.lastChild;null!=kb&&(nb=kb.ownerDocument.createElementNS(mxConstants.NS_SVG,"g"),nb.style.cursor="pointer",nb.setAttribute("data-icon",eb),null!=hb&&nb.setAttribute("data-icon-content",hb),null!=sb&&""!=sb&&(eb=kb.ownerDocument.createElementNS(mxConstants.NS_SVG,"title"),mxUtils.write(eb,sb.substring(0,1E3)),nb.appendChild(eb)),wa.root.replaceChild(nb,kb),nb.appendChild(kb),eb=(sb="a"==kb.nodeName.toLowerCase())? kb.lastChild:kb,null!=eb&&null!=eb.getAttribute&&null!=eb.getAttribute("x")&&(hb=kb.ownerDocument.createElementNS(mxConstants.NS_SVG,"rect"),hb.setAttribute("x",eb.getAttribute("x")),hb.setAttribute("y",eb.getAttribute("y")),hb.setAttribute("width",eb.getAttribute("width")),hb.setAttribute("height",eb.getAttribute("height")),hb.setAttribute("fill","none"),hb.setAttribute("pointer-events","all"),(sb?kb:nb).appendChild(hb)))},Xa=function(kb){var nb=document.createElement("div");nb.innerHTML=Graph.sanitizeHtml(kb); return null!=nb.firstChild?mxUtils.getXml(nb):null},Ta=Y.convertValueToTooltip(sa.cell);null!=Ta&&""!=Ta&&Ma(Editor.lightDarkTooltipImage,sa.x/xa-16,sa.y/xa-16,Editor.convertHtmlToText(Ta),"tooltip",Xa(Ta));Ta=Graph.sanitizeLink(Y.getLinkForCell(sa.cell));null==Ta||""==Ta||Y.isCustomLink(Ta)||Ma(Editor.lightDarkLinkImage,(sa.x+sa.width)/xa,sa.y/xa-16,Ta,"link",null,Ta);Ta=null!=Y.getNoteForCell?Y.getNoteForCell(sa.cell):null;null!=Ta&&""!=Ta&&(Ta=Y.convertValueToNote(sa.cell),Xa=Xa(Ta),null!=Xa&& Ma(Editor.lightDarkNoteImage,sa.x/xa-16,(sa.y+sa.height)/xa,Editor.convertHtmlToText(Ta),"note",Xa))}}}x.addCellData=function(sa,wa,xa){wa.setAttribute("data-cell-id",sa.id);if(xa)if(mxUtils.isNode(sa.value))for(xa=0;xa<sa.value.attributes.length;xa++){var Ma=sa.value.attributes[xa];wa.setAttribute("data-cell-"+Ma.name,Ma.value)}else if("object"===typeof sa.value)for(Ma in sa.value)wa.setAttribute("data-cell-"+Ma,sa.value[Ma]);else null!=sa.value&&wa.setAttribute("data-cell-value",sa.value);if(L&& mxUtils.isNode(sa.value))for(xa=0;xa<sa.value.attributes.length;xa++)Ma=sa.value.attributes[xa],wa.setAttribute("data-meta-"+Ma.name,Ma.value);return wa};var ma=x.visitStatesRecursive;x.visitStatesRecursive=function(sa,wa,xa){if(null!=sa){var Ma=wa.root,Xa=wa.root.ownerDocument;wa.root=this.addCellData(sa.cell,null!=Xa.createElementNS?Xa.createElementNS(mxConstants.NS_SVG,"g"):Xa.createElement("g"),Editor.addSvgMetadata);Ma.appendChild(wa.root);ma.apply(this,arguments);wa.root=Ma}};x.getLinkForCellState= mxUtils.bind(this,function(sa,wa){return this.getLinkForCell(sa.cell)});x.getTitleForCellState=mxUtils.bind(this,function(sa,wa){return Editor.convertHtmlToText(this.convertValueToTooltip(sa.cell))});return x};Graph.prototype.parseBackgroundImage=function(x){var L=null;null!=x&&0<x.length&&(x=JSON.parse(x),L=new mxImage(x.src,x.width,x.height));return L};Graph.prototype.getBackgroundImageObject=function(x){return x};Graph.prototype.getSvg=function(x,L,M,R,Y,ca,ma,sa,wa,xa,Ma,Xa,Ta,kb,nb,qb,sb){var eb= null;if(null!=kb){eb=new mxDictionary;for(var hb=0;hb<kb.length;hb++)eb.put(kb[hb],!0)}Y=this.useCssTransforms;var bb=this.enableFlowAnimation;this.enableFlowAnimation=!1;Y&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{L=null!=L?L:1;M=null!=M?M:0;ca=null!=ca?ca:!0;ma=null!=ma?ma:!0;xa=null!=xa?xa:!1;wa=null!=wa?wa:this.defaultExportLinkTarget;var xb="page"==Ta?this.view.getBackgroundPageBounds():ca&&null==eb||R||"diagram"==Ta?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()), tb=this.backgroundImage,ib=this.view.translate,zb=this.view.scale;"diagram"==Ta&&null!=tb&&null!=tb.width&&null!=tb.height&&(xb=mxRectangle.fromRectangle(xb),xb.add(new mxRectangle((ib.x+tb.x)*zb,(ib.y+tb.y)*zb,tb.width*zb,tb.height*zb)));if(null==xb)throw Error(mxResources.get("drawingEmpty"));R=L/zb;if("page"!=Ta){sa=null!=sa?sa:this.createSvgImageExport();var Kb={state:{scale:R}},Nb=null;this.view.states.visit(mxUtils.bind(this,function(Ra,fb){if(null!=fb.shape&&null!=fb.shape.boundingBox&&(Ra= sa.getSvgShapeOffset(fb.shape,Kb),0!=Ra)){for(var jb=ca&&null==eb,lb=fb.cell;!jb&&null!=lb;)jb=null!=eb?eb.get(lb):this.isCellSelected(lb),lb=this.model.getParent(lb);jb&&(Ra=Ra*zb/L,Nb=null!=Nb?Nb:mxRectangle.fromRectangle(xb),Nb.add(new mxRectangle(fb.shape.boundingBox.x+Ra,fb.shape.boundingBox.y+Ra,fb.shape.boundingBox.width,fb.shape.boundingBox.height)))}}));null!=Nb&&(xb=Nb)}var Zb=Math.max(1,Math.ceil(xb.width*R)+2*M)+(xa&&0==M?5:0),Sb=Math.max(1,Math.ceil(xb.height*R)+2*M)+(xa&&0==M?5:0),Pb= mxUtils.getLightDarkColor(x),Bb=Graph.createSvgNode(0,0,Zb,Sb,Pb),Eb=Bb.ownerDocument;if(null!=x){var Lb=mxUtils.createElementNs(Eb,mxConstants.NS_SVG,"rect");Lb.setAttribute("fill",Pb.light);Lb.style.fill=Pb.cssText;Lb.setAttribute("width","100%");Lb.setAttribute("height","100%");Lb.setAttribute("x","0");Lb.setAttribute("y","0");Bb.appendChild(Lb)}var dc=mxUtils.createElementNs(Eb,mxConstants.NS_SVG,"g");Bb.appendChild(dc);var Qb=this.createSvgCanvas(dc),g=Math.floor((M/L-xb.x/zb)*R)/R,r=Math.floor((M/ L-xb.y/zb)*R)/R;Qb.translate(g,r);Qb.idPrefix="drawio-svg-"+Editor.guid();if(sb){var B=this.gridSize*L,u=this.view.gridSteps*B;x=[];for(hb=1;hb<this.view.gridSteps;hb++)M=hb*B,x.push("M 0 "+M+" L "+u+" "+M+" M "+M+" 0 L "+M+" "+u);var C=mxUtils.getLightDarkColor(this.view.gridColor),G=mxUtils.createElementNs(Eb,mxConstants.NS_SVG,"pattern");G.setAttribute("id",Qb.idPrefix+"-grid");G.setAttribute("patternUnits","userSpaceOnUse");G.setAttribute("width",u);G.setAttribute("height",u);G.setAttribute("x", mxUtils.mod((ib.x+g)*L,u));G.setAttribute("y",mxUtils.mod((ib.y+r)*L,u));if(0<x.length){var I=mxUtils.createElementNs(Eb,mxConstants.NS_SVG,"path");I.setAttribute("d",x.join(" "));I.setAttribute("fill","none");I.setAttribute("stroke",C.light);I.style.stroke=C.cssText;I.setAttribute("opacity","0.2");I.setAttribute("stroke-width",L);G.appendChild(I)}var da=mxUtils.createElementNs(Eb,mxConstants.NS_SVG,"path");da.setAttribute("d","M "+u+" 0 L 0 0 0 "+u);da.setAttribute("fill","none");da.setAttribute("stroke", C.light);da.style.stroke=C.cssText;da.setAttribute("stroke-width",L);G.appendChild(da);Qb.defs.appendChild(G);var U=mxUtils.createElementNs(Eb,mxConstants.NS_SVG,"rect");U.setAttribute("width","100%");U.setAttribute("height","100%");U.setAttribute("fill","url(#"+G.getAttribute("id")+")");Bb.insertBefore(U,dc)}var Aa=document.createElement("div"),pa=Qb.getAlternateText;Qb.getAlternateText=function(Ra,fb,jb,lb,pb,Tb,ec,fc,gc,hc,ic,jc,kc){if(null!=Tb&&0<this.state.fontSize)try{return mxUtils.isNode(Tb)? Tb=Tb.innerText:(Aa.innerHTML=Tb,Tb=mxUtils.extractTextWithWhitespace(Aa.childNodes)),Tb}catch(lc){return pa.apply(this,arguments)}else return pa.apply(this,arguments)};if(null!=tb&&null!=tb.width&&null!=tb.height){hb=zb/L;var Ya=new mxRectangle((tb.x+ib.x)*hb,(tb.y+ib.y)*hb,tb.width*hb,tb.height*hb);mxUtils.intersects(xb,Ya)&&Qb.image(tb.x+ib.x,tb.y+ib.y,tb.width,tb.height,tb.src,!0)}Qb.scale(R);Qb.textEnabled=ma;sa=null!=sa?sa:this.createSvgImageExport();var ub=sa.getLinkForCellState;sa.getLinkForCellState= function(Ra,fb){var jb=Ra.view.graph.getAbsoluteUrl(ub.apply(this,arguments));return null==jb||Ra.view.graph.isCustomLink(jb)?null:jb};sa.getLinkTargetForCellState=function(Ra,fb){return Ra.view.graph.getLinkTargetForCell(Ra.cell)};var mb=sa.drawCellState,Qa=null,Ua=mxUtils.bind(this,function(){if(null==Qa){Qa="ge-flow-animation-"+Editor.guid();var Ra=null!=Eb.createElementNS?Eb.createElementNS(mxConstants.NS_SVG,"style"):Eb.createElement("style");Ra.innerHTML=this.createFlowAnimationCss(Qa);Eb.getElementsByTagName("defs")[0].appendChild(Ra)}return Qa}); sa.drawCellState=function(Ra,fb){for(var jb=Ra.view.graph,lb=null!=eb?eb.get(Ra.cell):jb.isCellSelected(Ra.cell),pb=jb.model.getParent(Ra.cell);!(ca&&null==eb||lb)&&null!=pb;)lb=null!=eb?eb.get(pb):jb.isCellSelected(pb),pb=jb.model.getParent(pb);if(null!=Ra.shape)try{var Tb=Ra.shape.isFlowAnimationEnabled,ec=Ra.shape.addFlowAnimationToShape;Ra.shape.isFlowAnimationEnabled=function(){return bb&&jb.model.isEdge(Ra.cell)&&"1"==mxUtils.getValue(Ra.style,"flowAnimation","0")};Ra.shape.addFlowAnimationToShape= function(){jb.addFlowAnimationToNode(this.getFlowAnimationPath(),Ra.style,L,Ua())};if(ca&&null==eb||lb)jb.view.redrawEnumerationState(Ra),mb.apply(this,arguments),this.doDrawShape(Ra.secondLabel,fb)}finally{Ra.shape.isFlowAnimationEnabled=Tb,Ra.shape.addFlowAnimationToShape=ec}};var Wa=null!=this.view.currentRoot?this.view.currentRoot:this.model.root;sa.drawState(this.getView().getState(Wa),Qb);this.addForeignObjectWarning(Qb,Bb);Graph.inlineSingleUseImages(Bb);Graph.replaceFontElements(Bb);Graph.addAdaptiveColors(Bb, this.shapeBackgroundColor);qb?this.disableSvgLinks(Bb):this.updateSvgLinks(Bb,wa,!0);return Bb}finally{this.enableFlowAnimation=bb,Y&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.addForeignObjectWarning=function(x,L){if("0"!=urlParams["svg-warning"]&&0<L.getElementsByTagName("foreignObject").length){var M=x.createElement("switch"),R=x.createElement("g");R.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var Y=x.createElement("a"); Y.setAttribute("transform","translate(0,-5)");null==Y.setAttributeNS||L.ownerDocument!=document&&null==document.documentMode?(Y.setAttribute("xlink:href",Graph.foreignObjectWarningLink),Y.setAttribute("target","_blank")):(Y.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Graph.foreignObjectWarningLink),Y.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);M.appendChild(R);Y.appendChild(x);M.appendChild(Y);L.appendChild(M)}};Graph.prototype.disableSvgLinks=function(x,L){x=x.getElementsByTagName("a");for(var M=0;M<x.length;M++){var R=x[M].getAttribute("href");null==R&&(R=x[M].getAttribute("xlink:href"));null!=R&&(x[M].style.pointerEvents="none",x[M].setAttribute("href",""));L&&L(x[M])}};Graph.prototype.updateSvgLinks=function(x,L,M){x=x.getElementsByTagName("a");for(var R=0;R<x.length;R++)if(null== x[R].getAttribute("target")){var Y=x[R].getAttribute("href");null==Y&&(Y=x[R].getAttribute("xlink:href"));null!=Y&&(null!=L&&/^https?:\/\//.test(Y)?x[R].setAttribute("target",L):M&&this.isCustomLink(Y)&&x[R].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;x.dedupImages=!0;x.createImageSymbol=function(L,M){this.imageSymbols= null!=this.imageSymbols?this.imageSymbols:{};return Graph.createSvgImageSymbol(this.defs,this.imageSymbols,L,M)};return x};Graph.prototype.getSelectedElement=function(){var x=null;if(window.getSelection){var L=window.getSelection();L.getRangeAt&&L.rangeCount&&(x=L.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,L,M){for(;null!=x&&x.nodeName!=L;){if(x==M)return null;x=x.parentNode}return x};Graph.prototype.getParentByNames=function(x,L,M){for(;null!=x&&!(0<=mxUtils.indexOf(L,x.nodeName));){if(x==M)return null;x=x.parentNode}return x};Graph.prototype.selectNode=function(x){var L=null;if(window.getSelection){if(L=window.getSelection(),L.getRangeAt&&L.rangeCount){var M=document.createRange();M.selectNode(x); L.removeAllRanges();L.addRange(M)}}else(L=document.selection)&&"Control"!=L.type&&(x=L.createRange(),x.collapse(!0),M=L.createRange(),M.setEndPoint("StartToStart",x),M.select())};Graph.prototype.flipEdgePoints=function(x,L,M){var R=this.getCellGeometry(x);if(null!=R){R=R.clone();if(null!=R.points)for(var Y=0;Y<R.points.length;Y++)L?R.points[Y].x=M+(M-R.points[Y].x):R.points[Y].y=M+(M-R.points[Y].y);Y=function(ca){null!=ca&&(L?ca.x=M+(M-ca.x):ca.y=M+(M-ca.y))};Y(R.getTerminalPoint(!0));Y(R.getTerminalPoint(!1)); this.model.setGeometry(x,R)}};Graph.prototype.flipChildren=function(x,L,M){this.model.beginUpdate();try{for(var R=this.model.getChildCount(x),Y=0;Y<R;Y++){var ca=this.model.getChildAt(x,Y);if(this.model.isEdge(ca))this.flipEdgePoints(ca,L,M);else{var ma=this.getCellGeometry(ca);null!=ma&&(ma=ma.clone(),L?ma.x=M+(M-ma.x-ma.width):ma.y=M+(M-ma.y-ma.height),this.model.setGeometry(ca,ma))}}}finally{this.model.endUpdate()}};Graph.prototype.getConnectionPoint=function(x,L,M){return null!=x&&1==mxUtils.getValue(x.style, "legacyAnchorPoints",1)?this.getLegacyConnectionPoint(x,L,M):mxGraph.prototype.getConnectionPoint.apply(this,arguments)};Graph.prototype.getLegacyConnectionPoint=function(x,L,M){M=null!=M?M:!0;var R=null;if(null!=x&&null!=L.point){var Y=this.view.getPerimeterBounds(x),ca=new mxPoint(Y.getCenterX(),Y.getCenterY()),ma=x.style[mxConstants.STYLE_DIRECTION],sa=0;null!=ma&&1==mxUtils.getValue(x.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(ma==mxConstants.DIRECTION_NORTH?sa+=270:ma==mxConstants.DIRECTION_WEST? sa+=180:ma==mxConstants.DIRECTION_SOUTH&&(sa+=90),ma!=mxConstants.DIRECTION_NORTH&&ma!=mxConstants.DIRECTION_SOUTH||Y.rotate90());R=this.view.scale;R=new mxPoint(Y.x+L.point.x*Y.width+L.dx*R,Y.y+L.point.y*Y.height+L.dy*R);var wa=x.style[mxConstants.STYLE_ROTATION]||0;if(L.perimeter)0!=sa&&(ma=Y=0,90==sa?ma=1:180==sa?Y=-1:270==sa&&(ma=-1),R=mxUtils.getRotatedPoint(R,Y,ma,ca)),R=this.view.getPerimeterPoint(x,R,!1);else if(wa+=sa,this.getModel().isVertex(x.cell)){sa=1==x.style[mxConstants.STYLE_FLIPH]; L=1==x.style[mxConstants.STYLE_FLIPV];null!=x.shape&&null!=x.shape.stencil&&(sa=1==mxUtils.getValue(x.style,"stencilFlipH",0)||sa,L=1==mxUtils.getValue(x.style,"stencilFlipV",0)||L);if(ma==mxConstants.DIRECTION_NORTH||ma==mxConstants.DIRECTION_SOUTH)x=sa,sa=L,L=x;sa&&(R.x=2*Y.getCenterX()-R.x);L&&(R.y=2*Y.getCenterY()-R.y)}0!=wa&&null!=R&&(x=mxUtils.toRadians(wa),Y=Math.cos(x),ma=Math.sin(x),R=mxUtils.getRotatedPoint(R,Y,ma,ca))}M&&null!=R&&(R.x=Math.round(R.x),R.y=Math.round(R.y));return R};Graph.prototype.flipCells= function(x,L){this.model.beginUpdate();try{x=this.model.getTopmostCells(x);for(var M=[],R=0;R<x.length;R++)if(this.model.isEdge(x[R])){var Y=this.view.getState(x[R]);null!=Y&&this.flipEdgePoints(x[R],L,(L?Y.getCenterX():Y.getCenterY())/this.view.scale-(L?Y.origin.x:Y.origin.y)-(L?this.view.translate.x:this.view.translate.y))}else{var ca=this.getCellGeometry(x[R]);null!=ca&&this.flipChildren(x[R],L,L?ca.getCenterX()-ca.x:ca.getCenterY()-ca.y);M.push(x[R])}this.toggleCellStyles(L?mxConstants.STYLE_FLIPH: mxConstants.STYLE_FLIPV,!1,M);this.setCellStyles("legacyAnchorPoints","0",M)}finally{this.model.endUpdate()}};Graph.prototype.deleteCells=function(x,L){var M=null;if(null!=x&&0<x.length){this.model.beginUpdate();try{for(var R=0;R<x.length;R++){var Y=this.model.getParent(x[R]);if(this.isTable(Y)){var ca=this.getCellGeometry(x[R]),ma=this.getCellGeometry(Y);null!=ca&&null!=ma&&(ma=ma.clone(),ma.height-=ca.height,this.model.setGeometry(Y,ma))}}var sa=this.selectParentAfterDelete?this.model.getParents(x): null;this.removeCells(x,L)}finally{this.model.endUpdate()}if(null!=sa)for(M=[],R=0;R<sa.length;R++)this.model.contains(sa[R])&&(this.model.isVertex(sa[R])||this.model.isEdge(sa[R]))&&M.push(sa[R])}return M};Graph.prototype.insertTableColumn=function(x,L){var M=this.getModel();M.beginUpdate();try{var R=x,Y=0;if(this.isTableCell(x)){var ca=M.getParent(x);R=M.getParent(ca);Y=mxUtils.indexOf(M.getChildCells(ca,!0),x)}else this.isTableRow(x)?R=M.getParent(x):x=M.getChildCells(R,!0)[0],L||(Y=M.getChildCells(x, !0).length-1);var ma=M.getChildCells(R,!0),sa=Graph.minTableColumnWidth;for(x=0;x<ma.length;x++){var wa=M.getChildCells(ma[x],!0)[Y],xa=M.cloneCell(wa,!1);null==xa&&(xa=this.createVertex());var Ma=this.getCellGeometry(xa);xa.value=null;xa.style=mxUtils.setStyle(mxUtils.setStyle(xa.style,"rowspan",null),"colspan",null);if(null!=Ma){null!=Ma.alternateBounds&&(Ma.width=Ma.alternateBounds.width,Ma.height=Ma.alternateBounds.height,Ma.alternateBounds=null);sa=Ma.width;var Xa=this.getCellGeometry(ma[x]); null!=Xa&&(Ma.height=Xa.height)}M.add(ma[x],xa,Y+(L?0:1))}var Ta=this.getCellGeometry(R);null!=Ta&&(Ta=Ta.clone(),Ta.width+=sa,M.setGeometry(R,Ta))}finally{M.endUpdate()}};Graph.prototype.deleteLane=function(x){var L=this.getModel();L.beginUpdate();try{var M=null;M="stackLayout"==this.getCurrentCellStyle(x).childLayout?x:L.getParent(x);var R=L.getChildCells(M,!0);0==R.length?L.remove(M):(M==x&&(x=R[R.length-1]),L.remove(x))}finally{L.endUpdate()}};Graph.prototype.insertLane=function(x,L){var M=this.getModel(); M.beginUpdate();try{var R=null;if("stackLayout"==this.getCurrentCellStyle(x).childLayout){R=x;var Y=M.getChildCells(R,!0);x=Y[L?0:Y.length-1]}else R=M.getParent(x);var ca=R.getIndex(x);x=M.cloneCell(x,!1);x.value=null;M.add(R,x,ca+(L?0:1))}finally{M.endUpdate()}};Graph.prototype.insertTableRow=function(x,L){var M=this.getModel();M.beginUpdate();try{var R=x,Y=x;if(this.isTableCell(x))Y=M.getParent(x),R=M.getParent(Y);else if(this.isTableRow(x))R=M.getParent(x);else{var ca=M.getChildCells(R,!0);Y=ca[L? 0:ca.length-1]}if(null!=Y){var ma=M.getChildCells(Y,!0),sa=R.getIndex(Y);Y=M.cloneCell(Y,!1);Y.value=null;var wa=this.getCellGeometry(Y);if(null!=wa){for(ca=0;ca<ma.length;ca++){x=M.cloneCell(ma[ca],!1);x.value=null;x.style=mxUtils.setStyle(mxUtils.setStyle(x.style,"rowspan",null),"colspan",null);var xa=this.getCellGeometry(x);null!=xa&&(null!=xa.alternateBounds&&(xa.width=xa.alternateBounds.width,xa.height=xa.alternateBounds.height,xa.alternateBounds=null),xa.height=wa.height);Y.insert(x)}M.add(R, Y,sa+(L?0:1));var Ma=this.getCellGeometry(R);null!=Ma&&(Ma=Ma.clone(),Ma.height+=wa.height,M.setGeometry(R,Ma))}}else if(Ma=this.getCellGeometry(R),null!=Ma){var Xa=Ma.width;Y=this.createVertex(null,null,"",0,0,Xa,40,"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;strokeColor=inherit;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fixedHeader=1;");Y.insert(this.createVertex(null,null,"",0,0,Xa,40,"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;strokeColor=inherit;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;")); M.add(R,Y);Ma=Ma.clone();Ma.height+=40;M.setGeometry(R,Ma)}}finally{M.endUpdate()}};Graph.prototype.deleteTableColumn=function(x){var L=this.getModel();L.beginUpdate();try{var M=x,R=x;this.isTableCell(x)&&(R=L.getParent(x));this.isTableRow(R)&&(M=L.getParent(R));var Y=L.getChildCells(M,!0);if(0==Y.length)L.remove(M);else{this.isTableRow(R)||(R=Y[0]);var ca=L.getChildCells(R,!0);if(1>=ca.length)L.remove(M);else{var ma=ca.length-1;this.isTableCell(x)&&(ma=mxUtils.indexOf(ca,x));for(R=x=0;R<Y.length;R++){var sa= L.getChildCells(Y[R],!0)[ma];L.remove(sa);var wa=this.getCellGeometry(sa);null!=wa&&(x=Math.max(x,wa.width))}var xa=this.getCellGeometry(M);null!=xa&&(xa=xa.clone(),xa.width-=x,L.setGeometry(M,xa))}}}finally{L.endUpdate()}};Graph.prototype.deleteTableRow=function(x){var L=this.getModel();L.beginUpdate();try{var M=x,R=x;this.isTableCell(x)&&(x=R=L.getParent(x));this.isTableRow(x)&&(M=L.getParent(R));var Y=L.getChildCells(M,!0);if(1>=Y.length)L.remove(M);else{this.isTableRow(R)||(R=Y[Y.length-1]);L.remove(R); x=0;var ca=this.getCellGeometry(R);null!=ca&&(x=ca.height);var ma=this.getCellGeometry(M);null!=ma&&(ma=ma.clone(),ma.height-=x,L.setGeometry(M,ma))}}finally{L.endUpdate()}};Graph.prototype.insertRow=function(x,L){for(var M=x.tBodies[0],R=M.rows[0].cells,Y=x=0;Y<R.length;Y++){var ca=R[Y].getAttribute("colspan");x+=null!=ca?parseInt(ca):1}L=M.insertRow(L);for(Y=0;Y<x;Y++)mxUtils.br(L.insertCell(-1));return L.cells[0]};Graph.prototype.deleteRow=function(x,L){x.tBodies[0].deleteRow(L)};Graph.prototype.insertColumn= function(x,L){var M=x.tHead;if(null!=M)for(var R=0;R<M.rows.length;R++){var Y=document.createElement("th");M.rows[R].appendChild(Y);mxUtils.br(Y)}x=x.tBodies[0];for(M=0;M<x.rows.length;M++)R=x.rows[M].insertCell(L),mxUtils.br(R);return x.rows[0].cells[0<=L?L:x.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(x,L){if(0<=L){x=x.tBodies[0].rows;for(var M=0;M<x.length;M++)x[M].cells.length>L&&x[M].deleteCell(L)}};Graph.prototype.pasteHtmlAtCaret=function(x){if(window.getSelection){var L= window.getSelection();if(L.getRangeAt&&L.rangeCount){L=L.getRangeAt(0);L.deleteContents();var M=document.createElement("div");M.innerHTML=x;x=document.createDocumentFragment();for(var R;R=M.firstChild;)lastNode=x.appendChild(R);L.insertNode(x)}}else(L=document.selection)&&"Control"!=L.type&&L.createRange().pasteHTML(x)};Graph.prototype.createLinkForHint=function(x,L,M){function R(ca,ma){ca.length>ma&&(ca=ca.substring(0,Math.round(ma/2))+"..."+ca.substring(ca.length-Math.round(ma/4)));return ca}x= null!=x?x:"javascript:void(0);";if(null==L||0==L.length)L=this.isCustomLink(x)?this.getLinkTitle(x):x;var Y=document.createElement("a");Y.setAttribute("rel",this.linkRelation);Y.setAttribute("href",this.getAbsoluteUrl(x));Y.setAttribute("title",R(this.isCustomLink(x)?this.getLinkTitle(x):x,80));null!=this.linkTarget&&Y.setAttribute("target",this.linkTarget);mxUtils.write(Y,R(L,40));this.isCustomLink(x)&&mxEvent.addListener(Y,"click",mxUtils.bind(this,function(ca){this.customLinkClicked(x,M);mxEvent.consume(ca)})); return Y};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(ca,ma){this.popupMenuHandler.hideMenu()});var x=this.updateMouseEvent;this.updateMouseEvent=function(ca){ca=x.apply(this,arguments);if(mxEvent.isTouchEvent(ca.getEvent())&&null==ca.getState()){var ma=this.getCellAt(ca.graphX,ca.graphY);null!=ma&&this.isSwimlane(ma)&&this.hitsSwimlaneContent(ma,ca.graphX,ca.graphY)|| (ca.state=this.view.getState(ma),null!=ca.state&&null!=ca.state.shape&&(this.container.style.cursor=ca.state.shape.node.style.cursor))}null==ca.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return ca};var L=!1,M=!1,R=!1,Y=this.fireMouseEvent;this.fireMouseEvent=function(ca,ma,sa){ca==mxEvent.MOUSE_DOWN&&(ma=this.updateMouseEvent(ma),L=this.isCellSelected(ma.getCell()),M=this.isSelectionEmpty(),R=this.popupMenuHandler.isMenuShowing());Y.apply(this,arguments)};this.popupMenuHandler.mouseUp= mxUtils.bind(this,function(ca,ma){if(null!=this.freehand&&!this.freehand.isDrawing()){var sa=mxEvent.isMouseEvent(ma.getEvent());this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==ma.getState()||!ma.isSource(ma.getState().control))&&(this.popupMenuHandler.popupTrigger||!R&&!sa&&(M&&null==ma.getCell()&&this.isSelectionEmpty()||L&&this.isCellSelected(ma.getCell())));sa=!L||sa?null:mxUtils.bind(this,function(wa){window.setTimeout(mxUtils.bind(this,function(){if(!this.isEditing()&& this.isTouchPopupMenuEnabled()){var xa=mxUtils.getScrollOrigin();this.popupMenuHandler.popup(ma.getX()+xa.x+1,ma.getY()+xa.y+1,wa,ma.getEvent())}}),300)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,[ca,ma,sa])}})};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 L=this.textarea.ownerDocument.defaultView.getSelection(),M=L.getRangeAt(0);x=Graph.createTabNode(x);M.insertNode(x);M.setStartAfter(x);M.setEndAfter(x);L.removeAllRanges();L.addRange(M)};mxCellEditor.prototype.alignText= function(x,L){var M=this.graph.getView().getState(this.editingCell);if(null!=M){M=mxUtils.getValue(M.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);var R=null!=M&&"vertical-"==M.substring(0,9),Y=null!=L&&mxEvent.isShiftDown(L);if(Y||null!=window.getSelection&&null!=window.getSelection().containsNode){var ca=!0;this.graph.processElements(this.textarea,function(ma){Y||R||window.getSelection().containsNode(ma,!0)?(ma.removeAttribute("align"),ma.style.textAlign=null):ca=!1}); (ca||R)&&this.graph.cellEditor.setAlign(x)}R||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 L=[],M=0,R=x.rangeCount;M<R;++M)L.push(x.getRangeAt(M));return L}}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 L=0,M=x.length;L<M;++L)sel.addRange(x[L])}else document.selection&&x.select&&x.select()}catch(R){}};var ea=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(x){null!=x.text&&(x.text.replaceLinefeeds="0"!=mxUtils.getValue(x.style,"nl2Br","1"));ea.apply(this,arguments)};var X=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(x,L){this.isKeepFocusEvent(x)||!mxEvent.isAltDown(x.getEvent())? X.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(x){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var aa=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.removeShapeInsideNodes=function(){if(null!=this.textarea){for(var x=this.textarea.querySelectorAll("[data-shape-inside]"),L=0;L<x.length;L++)x[L].parentNode.removeChild(x[L]);x=this.textarea.querySelectorAll("[data-shape-inside-wrapper]"); for(L=0;L<x.length;L++){for(;null!=x[L].firstChild;)x[L].parentNode.insertBefore(x[L].firstChild,x[L]);x[L].parentNode.removeChild(x[L])}}};mxCellEditor.prototype.updateShapeInsideFloats=function(){var x=this.graph.view.getState(this.editingCell);this.shapeInsideAlign=null;if(!(null==x||null==this.textarea||this.codeViewMode||""==this.textarea.innerHTML||this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText())){var L=x.view.scale,M=x.width/L;L=x.height/L;var R=this.graph.getShapeInsideFloats(x.style, M,L);if(null==R)this.removeShapeInsideNodes();else{for(var Y=this.textarea.querySelectorAll("[data-shape-inside]"),ca=0;ca<Y.length;ca++)Y[ca].parentNode.removeChild(Y[ca]);Y=this.textarea.querySelector("[data-shape-inside-wrapper]");var ma=ca=null;if(null==Y){ma=window.getSelection();null!=ma&&0<ma.rangeCount&&this.textarea.contains(ma.anchorNode)&&(ca={anchorNode:ma.anchorNode,anchorOffset:ma.anchorOffset,focusNode:ma.focusNode,focusOffset:ma.focusOffset,collapsed:ma.isCollapsed,host:ma.anchorNode== this.textarea||ma.focusNode==this.textarea});Y=document.createElement("div");for(Y.setAttribute("data-shape-inside-wrapper","1");null!=this.textarea.firstChild;)Y.appendChild(this.textarea.firstChild);this.textarea.appendChild(Y)}var sa=this.graph.getShapeInsideBox(x.style,M,L),wa=Graph.sanitizeHtml(Y.innerHTML,!0);this.shapeInsideAlign=wa=this.graph.computeShapeInsideSpacer(wa,x.style,R,sa,M,L);Y.style.cssText="float:left;width:"+Math.round(sa.width)+"px;height:"+Math.round(sa.height+this.graph.getShapeInsideGrow(wa.spacer, mxUtils.getValue(x.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)))+"px;";Y.insertAdjacentHTML("afterbegin",this.graph.createShapeInsideMarkup(R,sa,wa.spacer,M,L,this.graph.getShapeInsidePadding(x.style),wa.clip));if(null!=ca){x=document.createRange();try{if(ca.host){for(var xa=Y.lastChild;null!=xa&&null!=xa.lastChild;)xa=xa.lastChild;ca.collapsed&&null!=xa&&3==xa.nodeType?(x.setStart(xa,xa.length),x.collapse(!0)):(x.selectNodeContents(Y),ca.collapsed&&x.collapse(!1))}else x.setStart(ca.anchorNode, ca.anchorOffset),x.setEnd(ca.focusNode,ca.focusOffset);ma.removeAllRanges();ma.addRange(x)}catch(Ma){}}this.resize()}}};mxCellEditor.prototype.startEditing=function(x,L){x=this.graph.getStartEditingCell(x,L);aa.apply(this,arguments);var M=this.graph.view.getState(x);this.textarea.className=null!=M&&1==M.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";Graph.browserTranslate&&(this.textarea.classList.add("notranslate"),this.textarea.setAttribute("translate","no"));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!=M&&this.graph.isAutosizeTextState(M)&&this.resize();null!=this.textarea&&null!=M&&null!=this.graph.getShapeInsideFloats(M.style,M.width/M.view.scale,M.height/M.view.scale)&&(this.shapeInsideListener=mxUtils.bind(this,function(){null!=this.textarea&&null==this.textarea.querySelector("[data-shape-inside-wrapper]")? window.setTimeout(mxUtils.bind(this,function(){null!=this.textarea&&this.updateShapeInsideFloats()}),0):this.updateShapeInsideFloats()}),mxEvent.addListener(this.textarea,"input",this.shapeInsideListener),this.updateShapeInsideFloats())};mxCellEditor.prototype.toggleViewMode=function(){this.removeShapeInsideNodes();var x=this.graph.view.getState(this.editingCell);if(null!=x){var L=null!=x&&"0"!=mxUtils.getValue(x.style,"nl2Br","1"),M=this.saveSelection();if(this.codeViewMode){Graph.removeLightDarkColors(this.textarea, Graph.backupStyleAttribute);sa=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<sa.length&&"\n"==sa.charAt(sa.length-1)&&(sa=sa.substring(0,sa.length-1));sa=Graph.sanitizeHtml(L?sa.replace(/\n/g,"<br/>"):sa,!0);this.textarea.className="mxCellEditor geContentEditable";wa=mxUtils.getValue(x.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);L=mxUtils.getValue(x.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);var R=mxUtils.getValue(x.style,mxConstants.STYLE_ALIGN, mxConstants.ALIGN_LEFT),Y=(mxUtils.getValue(x.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,ca=(mxUtils.getValue(x.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,ma=[];(mxUtils.getValue(x.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&ma.push("underline");(mxUtils.getValue(x.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&& ma.push("line-through");0<ma.length&&(mxUtils.getValue(x.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&ma.push("dotted");this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(wa*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(wa)+"px";this.textarea.style.textDecoration=ma.join(" ");this.textarea.style.fontWeight=Y?"bold":"normal";this.textarea.style.fontStyle=ca?"italic": "";this.textarea.style.fontFamily=L;this.textarea.style.textAlign=R;this.textarea.style.padding="0px";this.textarea.innerHTML!=sa&&(this.textarea.innerHTML=sa,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 sa=mxUtils.htmlEntities(this.textarea.innerHTML);8!=document.documentMode&&(sa=mxUtils.replaceTrailingNewlines(sa,"<div><br></div>"));sa=Graph.sanitizeHtml(L?sa.replace(/\n/g,"").replace(/<br\s*.?>/g,"<br>"):sa,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var wa=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT? Math.round(wa*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(wa)+"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!=sa&&(this.textarea.innerHTML=sa);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&& this.restoreSelection(this.switchSelectionState);this.switchSelectionState=M;this.resize();this.updateShapeInsideFloats()}};var ka=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(x,L){if(null!=this.textarea)if(x=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=x){var M=x.view.scale;this.bounds=mxRectangle.fromRectangle(x);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*M;this.bounds.height=60*M;var R=null!=x.text?x.text.margin:null; null==R&&(R=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+=R.x*this.bounds.width;this.bounds.y+=R.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/M)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/M)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&& (this.textarea.style.height=Math.round(this.bounds.height/M)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*M);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/M)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*M);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("+M+","+M+")")}else if(null!=x&&null!=this.graph.getShapeInsideFloats(x.style,x.width/x.view.scale,x.height/x.view.scale)){M=x.view.scale;R=x.style;var Y=this.graph.getCellGeometry(this.editingCell);if(null!=Y){var ca=this.shapeInsideAlign,ma=null!=ca&&0>ca.spacer?-ca.spacer:0;ca=null!=ca?this.graph.getShapeInsideGrow(ca.spacer,mxUtils.getValue(R,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)):0;this.bounds=mxRectangle.fromRectangle(x); this.textarea.style.left=Math.round(x.x)+"px";this.textarea.style.top=Math.round(x.y-ma*M)+"px";mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px");mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+M+","+M+")");this.textarea.style.borderWidth="0";M=mxSvgCanvas2D.prototype.foreignObjectPadding;this.textarea.style.width=Math.round(Y.width+M)+"px";this.textarea.style.height=Math.round(Y.height+ca)+"px";this.textarea.style.overflow="visible";this.textarea.style.boxSizing= "border-box";this.textarea.style.wordWrap=mxConstants.WORD_WRAP;this.textarea.style.whiteSpace="normal";var sa=parseInt(mxUtils.getValue(R,mxConstants.STYLE_SPACING,2));this.textarea.style.paddingLeft=Math.round(sa+parseInt(mxUtils.getValue(R,mxConstants.STYLE_SPACING_LEFT,0)))+"px";this.textarea.style.paddingRight=Math.round(sa+parseInt(mxUtils.getValue(R,mxConstants.STYLE_SPACING_RIGHT,0)))+"px";this.textarea.style.paddingTop=Math.round(sa+parseInt(mxUtils.getValue(R,mxConstants.STYLE_SPACING_TOP, 0))+(mxUtils.getValue(R,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)==mxConstants.ALIGN_TOP?mxText.prototype.baseSpacingTop:0))+"px";this.textarea.style.paddingBottom=Math.round(sa+parseInt(mxUtils.getValue(R,mxConstants.STYLE_SPACING_BOTTOM,0)))+"px";this.graph.isAutosizeTextState(x)&&(M=mxUtils.trim(this.textarea.innerText||""),0<M.length&&(M=mxUtils.htmlEntities(M,!1).replace(/\n/g,"<br>"),ma=this.graph.getShapeInsideFloats(R,Y.width,Y.height),R=null!=ma?this.graph.computeShapeInsideFontSize(M, R,ma,Y.width,Y.height):null,null!=R&&(this.textarea.style.fontSize=R+"px",this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?R*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT)))}}else null!=x&&this.graph.isAutosizeTextState(x)?(M=x.view.scale,R=x.style,Y=this.graph.getCellGeometry(this.editingCell),null!=Y&&(this.bounds=mxRectangle.fromRectangle(x),this.textarea.style.left=Math.round(x.x)+"px",this.textarea.style.top=Math.round(x.y)+"px",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("+M+","+M+")"),this.textarea.style.borderWidth="0",M=mxSvgCanvas2D.prototype.foreignObjectPadding,this.textarea.style.width=Math.round(Y.width+M)+"px",this.textarea.style.height=Math.round(Y.height)+"px",this.textarea.style.overflow="hidden",this.textarea.style.boxSizing="border-box","wrap"==R[mxConstants.STYLE_WHITE_SPACE]&& (this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal"),sa=parseInt(mxUtils.getValue(R,mxConstants.STYLE_SPACING,2)),M=sa+parseInt(mxUtils.getValue(R,mxConstants.STYLE_SPACING_TOP,0)),ma=sa+parseInt(mxUtils.getValue(R,mxConstants.STYLE_SPACING_BOTTOM,0)),ca=sa+parseInt(mxUtils.getValue(R,mxConstants.STYLE_SPACING_LEFT,0)),sa+=parseInt(mxUtils.getValue(R,mxConstants.STYLE_SPACING_RIGHT,0)),this.textarea.style.paddingLeft=Math.round(ca)+"px",this.textarea.style.paddingRight= Math.round(sa)+"px",this.textarea.style.paddingTop=Math.round(M)+"px",this.textarea.style.paddingBottom=Math.round(ma)+"px",this.textarea.style.display="table-cell",this.textarea.style.flexDirection="",this.textarea.style.justifyContent="",M=mxUtils.getValue(R,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),this.textarea.style.verticalAlign=M==mxConstants.ALIGN_MIDDLE?"middle":M==mxConstants.ALIGN_BOTTOM?"bottom":"top",M=this.textarea.innerText,null!=M&&0<M.length&&(Y=this.graph.getAutosizeTextAvailableSpace(R, Y.width,Y.height,x),null!=Y&&(M=mxUtils.htmlEntities(M,!1).replace(/\n/g,"<br>"),R=this.graph.computeAutosizeTextFontSize(M,Y.availW,Y.availH,R[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,R[mxConstants.STYLE_FONTSTYLE],"wrap"==R[mxConstants.STYLE_WHITE_SPACE]),this.textarea.style.fontSize=R+"px",this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?R*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT)))):(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="",ka.apply(this,arguments))};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(x,L){if("0"== mxUtils.getValue(x.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var M=this.graph.getEditingValue(x.cell,L);"1"==mxUtils.getValue(x.style,"nl2Br","1")&&(M=M.replace(/\n/g,"<br/>"));return Graph.sanitizeHtml(M,!0)};mxCellEditorSetEditingValue=mxCellEditor.prototype.setEditingValue;mxCellEditor.prototype.setEditingValue=function(x,L){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){this.removeShapeInsideNodes();if("0"==mxUtils.getValue(x.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var L=Graph.sanitizeHtml(this.textarea.innerHTML,!0);Editor.optimizeHtmlLabels&&(L=Graph.optimizeHtml(L));"1"==mxUtils.getValue(x.style,"nl2Br", "1")?(L=L.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"),0<L.length&&("<br/>"==L.substring(L.length-5)||"<br>"==L.substring(L.length-4))&&(L=L.substring(0,L.lastIndexOf("<br"))+"<div><br/></div>")):L=L.replace(/\r\n/g,"").replace(/\n/g,"");return L};var ja=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(x){null!=this.shapeInsideListener&&(null!=this.textarea&&mxEvent.removeListener(this.textarea,"input",this.shapeInsideListener),this.shapeInsideAlign=this.shapeInsideListener= null);this.codeViewMode&&this.toggleViewMode();ja.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(x){}};var ua=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(x,L){this.graph.getModel().beginUpdate();try{ua.apply(this,arguments),""==L&&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 L=this.graph.getView().scale;return new mxRectangle(0,0,null==x.text?30:x.text.size*L+20,30)};mxGraphHandlerIsValidDropTarget= mxGraphHandler.prototype.isValidDropTarget;mxGraphHandler.prototype.isValidDropTarget=function(x,L){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(L.getEvent)};var Ba=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(x){var L=Ba.apply(this,arguments);if(null!=L){var M=this.graph.getLockedGroupAncestor(this.graph.model.getParent(L));null!=M&&(L=M)}return L};var ia=mxGraphHandler.prototype.isPropagateSelectionCell; mxGraphHandler.prototype.isPropagateSelectionCell=function(x,L,M){var R=this.graph.model.getParent(x);if(null!=R){if(this.graph.isSelectParentFirst(R))return!this.graph.isCellSelected(R)&&!this.graph.isSiblingSelected(x);if(this.graph.isTransparentBounds(R))return!1}return ia.apply(this,arguments)};var l=mxConstraintHandler.prototype.getCellForEvent;mxConstraintHandler.prototype.getCellForEvent=function(x,L){var M=l.apply(this,arguments),R=null!=L?L.x:x.getGraphX(),Y=null!=L?L.y:x.getGraphY();if(null!= M&&this.graph.model.isEdge(M)){var ca=this.graph.model;M=this.graph.getCellAt(R,Y,null,!0,!1,function(sa){return ca.isEdge(ca.getParent(sa.cell))});if(null!=M&&!this.graph.isCellConnectable(M)){var ma=ca.getParent(M);ca.isVertex(ma)&&this.graph.isCellConnectable(ma)&&(M=ma)}M=this.graph.isCellLocked(M)?null:M}null==M||null!=this.currentFocus&&this.currentFocus.cell==M||(R=this.graph.getBorderContainer(M,R,Y),null!=R&&(M=R));return M};var v=mxSelectionCellsHandler.prototype.getHandledSelectionCells; mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){for(var x=v.apply(this,arguments),L=this.graph,M=new mxDictionary,R=[],Y=0;Y<x.length;Y++)null==M.get(x[Y])&&(M.put(x[Y],!0),R.push(x[Y]));for(Y=0;Y<x.length;Y++)for(var ca=L.model.getParent(x[Y]);null!=ca&&L.isTransparentBounds(ca);)null==M.get(ca)&&(M.put(ca,!0),R.push(ca)),ca=L.model.getParent(ca);return R};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 L=this.graph.view.translate,M=this.graph.view.scale;x=this.roundLength((this.bounds.x+this.currentDx)/M-L.x);L=this.roundLength((this.bounds.y+this.currentDy)/M-L.y);M=this.graph.view.unit;this.hint.innerHTML=d(x,M)+", "+d(L,M);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 H=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(x,L){H.apply(this,arguments);var M=this.graph.getCellStyle(x);if(null==M.childLayout){var R=this.graph.model.getParent(x),Y=null!=R?this.graph.getCellGeometry(R):null;if(null!=Y&&(M=this.graph.getCellStyle(R), "stackLayout"==M.childLayout)){var ca=parseFloat(mxUtils.getValue(M,"stackBorder",mxStackLayout.prototype.border));M="1"==mxUtils.getValue(M,"horizontalStack","1");var ma=this.graph.getActualStartSize(R);Y=Y.clone();M?Y.height=L.height+ma.y+ma.height+2*ca:Y.width=L.width+ma.x+ma.width+2*ca;this.graph.model.setGeometry(R,Y)}}};var O=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function x(sa){M.get(sa)||(M.put(sa,!0), Y.push(sa))}for(var L=O.apply(this,arguments),M=new mxDictionary,R=this.graph.model,Y=[],ca=0;ca<L.length;ca++){var ma=L[ca];this.graph.isTableCell(ma)?x(R.getParent(R.getParent(ma))):this.graph.isTableRow(ma)&&x(R.getParent(ma));x(ma)}return Y};var S=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(x){return S.apply(this,arguments)&&!mxEvent.isControlDown(x.getEvent())&&!mxEvent.isShiftDown(x.getEvent())};var V=mxVertexHandler.prototype.isGhostPreview; mxVertexHandler.prototype.isGhostPreview=function(){return V.apply(this,arguments)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isSwimlane(this.state.cell)};var Z=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(x){var L=Z.apply(this,arguments);L.stroke="#C0C0C0";L.strokewidth=1;var M=this.graph.model.getParent(this.state.cell);null!=M&&this.graph.isTransparentBounds(M)&& (L.isDashed=!0);return L};var ba=mxVertexHandler.prototype.isSelectionDashed;mxVertexHandler.prototype.isSelectionDashed=function(){return this.graph.isTransparentBounds(this.state.cell)?!0:ba.apply(this,arguments)};var ha=mxVertexHandler.prototype.getSelectionColor;mxVertexHandler.prototype.getSelectionColor=function(){return this.graph.isTransparentBounds(this.state.cell)&&!this.graph.isCellSelected(this.state.cell)?"#C0C0C0":ha.apply(this,arguments)};var na=mxVertexHandler.prototype.updateParentHighlight; mxVertexHandler.prototype.updateParentHighlight=function(){na.apply(this,arguments);null!=this.selectionBorder&&this.graph.isTransparentBounds(this.state.cell)&&(this.selectionBorder.stroke=this.getSelectionColor(),this.selectionBorder.redraw())};var oa=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=function(x){var L=oa.apply(this,arguments);L.stroke="#C0C0C0";L.strokewidth=1;return L};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,L){return this.graph.isRecursiveVertexResize(x)&&!mxEvent.isAltDown(L.getEvent())};var fa=mxVertexHandler.prototype.resizeCell;mxVertexHandler.prototype.resizeCell=function(x,L,M,R,Y,ca,ma){ma&&this.graph.isRotatedGroupResize(x)&&(this.childOffsetY=this.childOffsetX=0); fa.apply(this,arguments)};mxVertexHandler.prototype.isCenteredEvent=function(x,L){return mxEvent.isControlDown(L.getEvent())||mxEvent.isMetaDown(L.getEvent())};var qa=mxVertexHandler.prototype.isRotationHandleVisible;mxVertexHandler.prototype.isRotationHandleVisible=function(){return qa.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)&&!this.graph.isTransparentBounds(this.state.cell)&&"1"!=mxUtils.getValue(this.state.style, "labelAutoRotate","0")};mxVertexHandler.prototype.isConnectHandleVisible=function(){return this.graph.isConnectIconVisible(this.state.cell)&&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(),L=this.graph,M=L.getNestedCornerIconOffset(this.state.cell, this.bounds.x+this.bounds.width,this.bounds.y+this.bounds.height,function(R){return L.isConnectIconVisible(R)&&L.isEnabled()&&L.isCellConnectable(R)&&!L.isTableCell(R)&&!L.isTableRow(R)&&!L.isTable(R)});return new mxPoint(this.bounds.x+this.bounds.width-this.connectHandleVSpacing+x.x/2+M,this.bounds.y+this.bounds.height-this.connectHandleVSpacing+x.y/2+M)};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 ya=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){var x=this.graph.model.getParent(this.state.cell);return null!=x&&this.graph.isTransparentBounds(x)?!1:ya.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var ta=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(x){return x.tableHandle||x.lockHandle||x.editIconHandle|| x.moveGroupHandle||ta.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};mxVertexHandler.prototype.getSelectionBorderInset=function(){var x=0;this.graph.isTransparentBounds(this.state.cell)?x=-this.graph.getNestedTransparentBoundsCount(this.state.cell):this.graph.isTableRow(this.state.cell)?x=1:this.graph.isTableCell(this.state.cell)&&(x=2);return x};var Ca=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds= function(){return Ca.apply(this,arguments).grow(-this.getSelectionBorderInset())};var la=null,ra=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==la&&(la=mxCellRenderer.defaultShapes.tableLine);var x=ra.apply(this,arguments);if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){var L=function(eb,hb,bb){for(var xb=[],tb=0;tb<eb.length;tb++){var ib=eb[tb];xb.push(null==ib?null:new mxPoint((wa+ib.x+hb)*ca,(xa+ib.y+ bb)*ca))}return xb},M=this,R=this.graph,Y=R.model,ca=R.view.scale,ma=this.state,sa=this.selectionBorder,wa=this.state.origin.x+R.view.translate.x,xa=this.state.origin.y+R.view.translate.y;null==x&&(x=[]);var Ma=R.view.getCellStates(Y.getChildCells(this.state.cell,!0));if(0<Ma.length){var Xa=Y.getChildCells(Ma[0].cell,!0),Ta=R.getTableLines(this.state.cell,!1,!0),kb=R.getTableLines(this.state.cell,!0,!1);for(Y=0;Y<Ma.length;Y++)mxUtils.bind(this,function(eb){var hb=Ma[eb],bb=null;if(R.isCellMovable(hb.cell)){bb= eb<Ma.length-1?Ma[eb+1]:null;bb=null!=bb?R.getCellGeometry(bb.cell):null;var xb=null!=bb&&null!=bb.alternateBounds?bb.alternateBounds:bb;bb=null!=kb[eb]?new la(kb[eb],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!1);bb.isDashed=sa.isDashed;bb.svgStrokeTolerance++;bb=new mxHandle(hb,"row-resize",null,bb);bb.tableHandle=!0;var tb=0;bb.shape.node.parentNode.insertBefore(bb.shape.node,bb.shape.node.parentNode.firstChild);bb.redraw=function(){if(null!=this.shape){this.shape.stroke= 0==tb?mxConstants.NONE:sa.stroke;if(this.shape.constructor==la)this.shape.line=L(kb[eb],0,tb),this.shape.updateBoundsFromLine();else{var ib=R.getActualStartSize(ma.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height+tb*ca;this.shape.bounds.x=ma.x+(eb==Ma.length-1?0:ib.x*ca);this.shape.bounds.width=ma.width-(eb==Ma.length-1?0:ib.width+ib.x+ca)}this.shape.redraw()}};bb.setPosition=function(ib,zb,Kb){tb=Math.max(Graph.minTableRowHeight-ib.height,zb.y-ib.y-ib.height); null!=xb&&mxEvent.isShiftDown(Kb.getEvent())&&(tb=Math.min(tb,xb.height-Graph.minTableRowHeight))};bb.execute=function(ib){if(0!=tb){var zb=mxEvent.isShiftDown(ib.getEvent());(ib=mxEvent.isControlDown(ib.getEvent())||mxEvent.isMetaDown(ib.getEvent()))&&zb?R.distributeRows(ma.cell):ib?R.resizeAllTableRows(ma.cell,tb):R.setTableRowHeight(this.state.cell,tb,!zb)}else M.blockDelayedSelection||(zb=R.getCellAt(ib.getGraphX(),ib.getGraphY())||ma.cell,R.graphHandler.selectCellForEvent(zb,ib));tb=0};bb.reset= function(){tb=0}}x.push(bb)})(Y);for(Y=0;Y<Xa.length;Y++)mxUtils.bind(this,function(eb){var hb=R.view.getState(Xa[eb]),bb=R.getCellGeometry(Xa[eb]),xb=null!=bb.alternateBounds?bb.alternateBounds:bb;null==hb&&(hb=new mxCellState(R.view,Xa[eb],R.getCellStyle(Xa[eb])),hb.x=ma.x+bb.x*ca,hb.y=ma.y+bb.y*ca,hb.width=xb.width*ca,hb.height=xb.height*ca,hb.updateCachedBounds());bb=eb<Xa.length-1?Xa[eb+1]:null;bb=null!=bb?R.getCellGeometry(bb):null;var tb=null!=bb&&null!=bb.alternateBounds?bb.alternateBounds: bb;bb=null!=Ta[eb]?new la(Ta[eb],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);bb.isDashed=sa.isDashed;bb.svgStrokeTolerance++;hb=new mxHandle(hb,"col-resize",null,bb);hb.tableHandle=!0;var ib=0;hb.shape.node.parentNode.insertBefore(hb.shape.node,hb.shape.node.parentNode.firstChild);hb.redraw=function(){if(null!=this.shape){this.shape.stroke=0==ib?mxConstants.NONE:sa.stroke;if(this.shape.constructor==la)this.shape.line=L(Ta[eb],ib,0),this.shape.updateBoundsFromLine();else{var zb= R.getActualStartSize(ma.cell,!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(xb.width+ib)*ca;this.shape.bounds.y=ma.y+(eb==Xa.length-1?0:zb.y*ca);this.shape.bounds.height=ma.height-(eb==Xa.length-1?0:(zb.height+zb.y)*ca)}this.shape.redraw()}};hb.setPosition=function(zb,Kb,Nb){ib=Math.max(Graph.minTableColumnWidth-xb.width,Kb.x-zb.x-xb.width);null!=tb&&mxEvent.isShiftDown(Nb.getEvent())&&(ib=Math.min(ib,tb.width-Graph.minTableColumnWidth))};hb.execute=function(zb){if(0!=ib){var Kb= mxEvent.isShiftDown(zb.getEvent());(zb=mxEvent.isControlDown(zb.getEvent())||mxEvent.isMetaDown(zb.getEvent()))&&Kb?R.distributeColumns(ma.cell):zb?R.resizeAllTableColumns(ma.cell,ib):R.setTableColumnWidth(this.state.cell,ib,!Kb)}else M.blockDelayedSelection||(Kb=R.getCellAt(zb.getGraphX(),zb.getGraphY())||ma.cell,R.graphHandler.selectCellForEvent(Kb,zb));ib=0};hb.positionChanged=function(){};hb.reset=function(){ib=0};x.push(hb)})(Y)}}if(this.graph.isLockedGroupIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){null== x&&(x=[]);M=this;R=this.graph;var nb=this.state.cell,qb=16,sb=this.graph.isLockedGroup(nb);Y=new mxImageShape(new mxRectangle(0,0,qb,qb),(sb?HoverIcons.prototype.lockHandle:HoverIcons.prototype.unlockHandle).src);Y.preserveImageAspect=!1;Y=new mxHandle(this.state,"pointer",null,Y);Y.lockHandle=!0;Y.setPosition=function(){};Y.positionChanged=function(){};Y.reset=function(){};Y.redraw=function(){if(null!=this.shape){var eb=M.getHandlePadding(),hb=R.getNestedCornerIconOffset(nb,M.bounds.x,M.bounds.y, function(tb){return R.isLockedGroupIconVisible(tb)&&R.isCellMovable(tb)});eb=new mxPoint(M.bounds.x-12-eb.x/2-hb,M.bounds.y-12-eb.y/2-hb);R.isMoveIconVisible(nb)&&R.isCellMovable(nb)&&(eb.y+=24);hb=Number(null!=M.currentAlpha?M.currentAlpha:M.state.style[mxConstants.STYLE_ROTATION]||"0");var bb=mxUtils.toRadians(hb);if(0!=bb){var xb=new mxPoint(M.state.getCenterX(),M.state.getCenterY());eb=mxUtils.getRotatedPoint(eb,Math.cos(bb),Math.sin(bb),xb)}this.shape.bounds.width=qb;this.shape.bounds.height= qb;this.shape.bounds.x=eb.x-qb/2;this.shape.bounds.y=eb.y-qb/2;this.shape.rotation=hb;this.shape.redraw()}};Y.execute=function(eb){R.getModel().beginUpdate();try{R.setCellStyles("lockedGroup",sb?"0":"1",[nb])}finally{R.getModel().endUpdate()}if(!sb){eb=R.getSelectionCells();for(var hb=[],bb=0;bb<eb.length;bb++)eb[bb]!=nb&&R.model.isAncestor(nb,eb[bb])||hb.push(eb[bb]);hb.length!=eb.length&&R.setSelectionCells(0<hb.length?hb:[nb])}};x.push(Y)}this.graph.isEditIconVisible(this.state.cell)&&(null==x&& (x=[]),M=this,R=this.graph,nb=this.state.cell,qb=16,Y=new mxImageShape(new mxRectangle(0,0,qb,qb),HoverIcons.prototype.editHandle.src),Y.preserveImageAspect=!1,Y=new mxHandle(this.state,"pointer",null,Y),Y.editIconHandle=!0,Y.setPosition=function(){},Y.positionChanged=function(){},Y.reset=function(){},Y.redraw=function(){if(null!=this.shape){var eb=M.getHandlePadding(),hb=R.getNestedCornerIconOffset(nb,M.bounds.x,M.bounds.y,function(tb){return R.isEditIconVisible(tb)});eb=new mxPoint(M.bounds.x-12- eb.x/2-hb,M.bounds.y-12-eb.y/2-hb);R.isCellMovable(nb)&&(R.isLockedGroupIconVisible(nb)||R.isMoveIconVisible(nb))&&(eb.x+=24);hb=Number(null!=M.currentAlpha?M.currentAlpha:M.state.style[mxConstants.STYLE_ROTATION]||"0");var bb=mxUtils.toRadians(hb);if(0!=bb){var xb=new mxPoint(M.state.getCenterX(),M.state.getCenterY());eb=mxUtils.getRotatedPoint(eb,Math.cos(bb),Math.sin(bb),xb)}this.shape.bounds.width=qb;this.shape.bounds.height=qb;this.shape.bounds.x=eb.x-qb/2;this.shape.bounds.y=eb.y-qb/2;this.shape.rotation= hb;this.shape.redraw()}},Y.execute=function(eb){R.startEditingAtCell(nb)},x.push(Y));this.graph.isMoveIconVisible(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&(null==x&&(x=[]),M=this,R=this.graph,nb=this.state.cell,qb=16,Y=new mxImageShape(new mxRectangle(0,0,qb,qb),HoverIcons.prototype.moveHandle.src),Y.preserveImageAspect=!1,Y=new mxHandle(this.state,"move",null,Y),Y.moveGroupHandle=!0,Y.setPosition=function(){},Y.positionChanged=function(){},Y.execute=function(){},Y.reset=function(){}, Y.redraw=function(){if(null!=this.shape){var eb=M.getHandlePadding(),hb=R.getNestedCornerIconOffset(nb,M.bounds.x,M.bounds.y,function(xb){return R.isMoveIconVisible(xb)&&R.isCellMovable(xb)}),bb=M.bounds.x-12-eb.x/2-hb;eb=M.bounds.y-12-eb.y/2-hb;this.shape.bounds.width=qb;this.shape.bounds.height=qb;this.shape.bounds.x=bb-qb/2;this.shape.bounds.y=eb-qb/2;this.shape.redraw()}},x.push(Y));return null!=x?x.reverse():null};var va=mxVertexHandler.prototype.setHandlesVisible,Ia=mxVertexHandler.prototype.start; mxVertexHandler.prototype.start=function(x,L,M){Ia.apply(this,arguments);var R=this.graph;if(null!=this.parentState&&R.isTransparentBounds(this.parentState.cell)){var Y=R.view.scale,ca=R.view.translate,ma=this.parentState;this.parentState=ma.clone();this.parentState.x=Y*(ca.x+ma.origin.x);this.parentState.y=Y*(ca.y+ma.origin.y)}for(Y=R.model.getParent(this.state.cell);null!=Y;)R.isTransparentBounds(Y)&&(ca=R.selectionCellsHandler.getHandler(Y),null!=ca&&null!=ca.selectionBorder&&(ca.selectionBorder.node.style.visibility= "hidden")),Y=R.model.getParent(Y);if(!this.livePreviewActive&&null==this.ghostPreview&&null!=this.index&&this.index!=mxEvent.LABEL_HANDLE&&null!=this.sizers){for(R=0;R<this.sizers.length;R++)null!=this.sizers[R]&&R!=this.index&&(this.sizers[R].node.style.display="none");null!=this.rotationShape&&this.index!=mxEvent.ROTATION_HANDLE&&(this.rotationShape.node.style.visibility="hidden");this.resizeHandlesHidden=!0}};var La=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){if(this.resizeHandlesHidden){if(null!= this.sizers)for(var x=0;x<this.sizers.length;x++)null!=this.sizers[x]&&(this.sizers[x].node.style.display="");null!=this.rotationShape&&(this.rotationShape.node.style.visibility="");this.resizeHandlesHidden=null}x=this.graph;for(var L=null!=this.state?x.model.getParent(this.state.cell):null;null!=L;){if(x.isTransparentBounds(L)){var M=x.selectionCellsHandler.getHandler(L);null!=M&&null!=M.selectionBorder&&(M.selectionBorder.node.style.visibility="")}L=x.model.getParent(L)}La.apply(this,arguments)}; mxVertexHandler.prototype.setHandlesVisible=function(x){va.apply(this,arguments);if(null!=this.moveHandles)for(var L=0;L<this.moveHandles.length;L++)null!=this.moveHandles[L]&&(this.moveHandles[L].node.style.visibility=x?"":"hidden");if(null!=this.cornerHandles)for(L=0;L<this.cornerHandles.length;L++)this.cornerHandles[L].node.style.visibility=x?"":"hidden";this.graph.isTransparentBounds(this.state.cell)&&null!=this.selectionBorder&&(this.selectionBorder.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,L=x.model,M=[],R=0;R<L.getChildCount(this.state.cell);R++)mxUtils.bind(this,function(Y){if(null!=Y&&L.isVertex(Y.cell)&&x.isCellMovable(Y.cell)){var ca=new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);ca=new mxImageShape(ca,this.rowHandleImage.src);ca.rowState=Y;ca.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;ca.init(this.graph.getView().getOverlayPane());ca.node.style.cursor="move"; mxEvent.addGestureListeners(ca.node,mxUtils.bind(this,function(ma){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);!this.graph.isToggleEvent(ma)&&this.graph.isCellSelected(Y.cell)||this.graph.selectCellForEvent(Y.cell,ma);mxEvent.isPopupTrigger(ma)||(this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(ma),mxEvent.getClientY(ma),this.graph.getSelectionCells()),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(ma),this.graph.isMouseDown= !0);mxEvent.consume(ma)}),null,mxUtils.bind(this,function(ma){mxEvent.isPopupTrigger(ma)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(ma),mxEvent.getClientY(ma),Y.cell,ma),mxEvent.consume(ma))}));M.push(ca)}else M.push(null)})(this.graph.view.getState(L.getChildAt(this.state.cell,R)));return M};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 Ga=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){Ga.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles(); if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell))this.refreshMoveHandles();else if(this.graph.isCellMovable(this.state.cell)&&(this.graph.isTransparentBounds(this.state.cell)||1==this.graph.getSelectionCount()&&(this.graph.isTableCell(this.state.cell)||this.graph.isTableRow(this.state.cell)))){this.cornerHandles=[];for(var x=0;4>x;x++){var L=new mxRectangleShape(new mxRectangle(0,0,6,6),"#ffffff",mxConstants.HANDLE_STROKECOLOR);L.dialect=mxConstants.DIALECT_SVG;L.init(this.graph.view.getOverlayPane()); this.cornerHandles.push(L)}}this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&this.refreshMoveHandles();x=this.graph.getLinkForCell(this.state.cell);L=this.graph.getLinksForState(this.state);this.updateLinkHint(x,L)};var Da=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var x=new mxPoint(0,0),L=this.tolerance,M=this.state.style.shape;null==mxCellRenderer.defaultShapes[M]&&mxStencilRegistry.getStencil(M);M=this.graph.isTable(this.state.cell)|| this.graph.cellEditor.getEditingCell()==this.state.cell;if(!M&&null!=this.customHandles)for(var R=0;R<this.customHandles.length;R++)if(null!=this.customHandles[R]&&!this.customHandles[R].lockHandle&&!this.customHandles[R].editIconHandle&&!this.customHandles[R].moveGroupHandle&&null!=this.customHandles[R].shape&&null!=this.customHandles[R].shape.bounds){var Y=this.customHandles[R].shape.bounds,ca=Y.getCenterX(),ma=Y.getCenterY();if(Math.abs(this.state.x-ca)<Y.width/2||Math.abs(this.state.y-ma)<Y.height/ 2||Math.abs(this.state.x+this.state.width-ca)<Y.width/2||Math.abs(this.state.y+this.state.height-ma)<Y.height/2){M=!0;break}}M&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(L/=2,this.graph.isTable(this.state.cell)&&(L+=7),x.x=this.sizers[0].bounds.width+L,x.y=this.sizers[0].bounds.height+L):x=Da.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 L=this.state.view.unit;this.hint.innerHTML=d(this.roundLength(this.bounds.width/x),L)+" x "+d(this.roundLength(this.bounds.height/x),L)}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 Pa=mxEdgeHandler.prototype.refresh;mxEdgeHandler.prototype.refresh=function(){Pa.apply(this,arguments);var x=this.graph.getLinkForCell(this.state.cell),L=this.graph.getLinksForState(this.state);this.updateLinkHint(x,L)};var Ka=mxEdgeHandler.prototype.mouseMove; mxEdgeHandler.prototype.mouseMove=function(x,L){Ka.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 Na=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(x,L){Na.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint= function(x,L,M){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));var R=this.graph.view.translate,Y=this.graph.view.scale,ca=this.roundLength(L.x/Y-R.x);R=this.roundLength(L.y/Y-R.y);var ma=this.graph.view.unit;this.hint.innerHTML=d(ca,ma)+", "+d(R,ma);this.hint.style.visibility="visible";null!=M&&(M.view.updateEdgeBounds(M),this.hint.innerHTML+=" ("+(ma==mxConstants.POINTS?Math.round(M.length/Y):d(M.length/Y,ma))+")");if(this.isSource||this.isTarget)null!=this.constraintHandler&& null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(M=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*M.x)+"%, "+Math.round(100*M.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(),L.y)+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")};Graph.createFoldingImage= function(x,L){return L?Graph.createSvgImage(x,x,'<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"/>',9,9):Graph.createSvgImage(x,x,'<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"/>', 9,9)};Graph.updateFoldingImages=function(x){Graph.prototype.expandedImage=Graph.createFoldingImage(x,!1);Graph.prototype.collapsedImage=Graph.createFoldingImage(x,!0)};Graph.updateFoldingImages(9);Graph.foldingImages={};Graph.prototype.getFoldingImage=function(x){var L=mxGraph.prototype.getFoldingImage.apply(this,arguments);if(null!=L){var M=parseInt(mxUtils.getValue(x.style,"foldingIconSize",0));if(0<M){var R=M+"-"+this.isCellCollapsed(x.cell);L=Graph.foldingImages[R];null==L&&(L=Graph.createFoldingImage(M, this.isCellCollapsed(x.cell)),Graph.foldingImages[R]=L)}}return L};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);HoverIcons.prototype.lockHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"/>', 24,24);HoverIcons.prototype.unlockHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M18 8h-1V6c0-2.76-2.24-5-5-5-2.28 0-4.27 .54-4.84 2.75-.14.54.18 1.08.72 1.22.53.14 1.08-.18 1.22-.72C9.44 3.93 10.63 3 12 3c1.65 0 3 1.35 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"/>',24,24);HoverIcons.prototype.editHandle= Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/>',24,24);HoverIcons.prototype.moveHandle=Graph.createSvgImage(16,16,'<path stroke="'+HoverIcons.prototype.arrowFill+'" stroke-width="0.7" fill="'+HoverIcons.prototype.arrowFill+'" d="M12 2 L9 5 L11 5 L11 11 L5 11 L5 9 L2 12 L5 15 L5 13 L11 13 L11 19 L9 19 L12 22 L15 19 L13 19 L13 13 L19 13 L19 15 L22 12 L19 9 L19 11 L13 11 L13 5 L15 5 Z"/>', 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+'"/>');mxVertexHandler.TABLE_HANDLE_COLOR="#fca000";mxVertexHandler.prototype.handleImage=HoverIcons.prototype.mainHandle;mxVertexHandler.prototype.secondaryHandleImage=HoverIcons.prototype.secondaryHandle;mxVertexHandler.prototype.rowHandleImage=Graph.createSvgImage(14, 12,'<rect x="2" y="2" width="10" height="3" stroke-width="1" stroke="#ffffff" fill="'+HoverIcons.prototype.arrowFill+'"/><rect x="2" y="7" width="10" height="3" stroke-width="1" stroke="#ffffff" fill="'+HoverIcons.prototype.arrowFill+'"/>');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;var Oa=mxEdgeHandler.prototype.removePoint; mxEdgeHandler.prototype.removePoint=function(x,L){var M=0==L;(M||null!=this.abspoints&&L==this.abspoints.length-1)&&null!=this.abspoints&&null!=this.abspoints[L]&&null==this.graph.getModel().getTerminal(x.cell,M)?this.graph.fireEvent(new mxEventObject("doubleClickEdgeTerminal","cell",x.cell,"source",M,"point",this.abspoints[L].clone())):Oa.apply(this,arguments)};var Fa=mxEdgeHandler.prototype.changePoints;mxEdgeHandler.prototype.changePoints=function(x,L,M){null!=x&&null!=L&&0<L.length&&"1"==mxUtils.getValue(this.graph.getCellStyle(x), "libavoidRouting",null)&&this.graph.setCellStyles("libavoidRouting",null,[x]);return Fa.apply(this,arguments)};var za=mxEdgeSegmentHandler.prototype.getPreviewPoints;mxEdgeSegmentHandler.prototype.getPreviewPoints=function(x){if((this.isSource||this.isTarget)&&"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.previewEndpointDrag){var L=null;try{L=LibavoidRouting.previewEndpointDrag(this,x)}catch(M){}if(null!=L)return L}return za.apply(this,arguments)};var Ja=mxEdgeHandler.prototype.reset; mxEdgeHandler.prototype.reset=function(){"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.endPreview&&LibavoidRouting.endPreview(this);return Ja.apply(this,arguments)};var Ha=mxEdgeHandler.prototype.setInnerBendsOpacity;mxEdgeHandler.prototype.setInnerBendsOpacity=function(x,L,M){if(null!=this.state&&null!=x&&"1"==mxUtils.getValue(this.state.style,"libavoidRouting",null))for(var R=L;R<M;R++)null!=x[R]&&null!=x[R].node&&mxUtils.setOpacity(x[R].node,this.virtualBendOpacity);else return Ha.apply(this, arguments)};var Sa=mxConnectionHandler.prototype.updateEdgeState;mxConnectionHandler.prototype.updateEdgeState=function(x,L){if(null!=this.edgeState&&"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.connectionWaypoints&&"1"==mxUtils.getValue(this.edgeState.style,"libavoidRouting",null))try{this.waypoints=LibavoidRouting.connectionWaypoints(this)}catch(M){this.waypoints=null}Sa.apply(this,arguments)};var ab=mxConnectionHandler.prototype.reset;mxConnectionHandler.prototype.reset=function(){"undefined"!== typeof LibavoidRouting&&null!=LibavoidRouting.endPreview&&(LibavoidRouting.endPreview(this),this.waypoints=null);return ab.apply(this,arguments)};var Va=mxGraphHandler.prototype.updateLivePreview;mxGraphHandler.prototype.updateLivePreview=function(x,L){Va.apply(this,arguments);if("undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.livePreviewMove)try{LibavoidRouting.livePreviewMove(this,x,L)}catch(M){}};var db=mxGraphHandler.prototype.reset;mxGraphHandler.prototype.reset=function(){db.apply(this, arguments);"undefined"!==typeof LibavoidRouting&&null!=LibavoidRouting.endMovePreview&&LibavoidRouting.endMovePreview(this)};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 L=x.getEvent();return null==x.getState()&&!mxEvent.isMouseEvent(L)||mxEvent.isPopupTrigger(L)&&(null==x.getState()||mxEvent.isControlDown(L)||mxEvent.isShiftDown(L))}}else mxPanningHandler.prototype.isPanningTrigger= function(x){var L=x.getEvent();return mxEvent.isLeftMouseButton(L)&&(this.useLeftButtonForPanning&&null==x.getState()||mxEvent.isControlDown(L)&&!mxEvent.isShiftDown(L))||this.usePopupTrigger&&mxEvent.isPopupTrigger(L)};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,L){if(this.cancelled)this.cancelled=!1,L.consume();else{var M=null!=this.div&&"none"!=this.div.style.display,R=x=null,Y=null,ca=null;null!=this.first&&null!=this.currentX&&null!=this.currentY&&(x=this.first.x,R=this.first.y,Y=(this.currentX-x)/this.graph.view.scale,ca=(this.currentY-R)/this.graph.view.scale,mxEvent.isAltDown(L.getEvent())||(Y=this.graph.snap(Y), ca=this.graph.snap(ca),this.graph.isGridEnabled()||(Math.abs(Y)<this.graph.tolerance&&(Y=0),Math.abs(ca)<this.graph.tolerance&&(ca=0))));this.reset();if(M){if(this.isSpaceEvent(L)){M=[this.graph.getDefaultParent()];var ma=this.graph.getCellAt(x,R,M[0],!0,!1,mxUtils.bind(this,function(Xa){return!this.graph.isContainer(Xa.cell)||this.graph.isCellLocked(Xa.cell)||this.graph.isCellCollapsed(Xa.cell)||this.graph.isTable(Xa.cell)||this.graph.isTableRow(Xa.cell)||this.graph.isTableCell(Xa.cell)}));if(null!= ma){for(var sa=[];ma!=M[0];)sa.unshift(ma),ma=this.graph.model.getParent(ma);M=M.concat(sa)}this.graph.model.beginUpdate();try{for(ma=0;ma<M.length;ma++){var wa=this.graph.getCellsBeyond(x,R,M[ma],!0,!0);for(sa=0;sa<wa.length;sa++)if(this.graph.isCellMovable(wa[sa])&&0>mxUtils.indexOf(M,wa[sa])){var xa=this.graph.view.getState(wa[sa]),Ma=this.graph.getCellGeometry(wa[sa]);null!=xa&&null!=Ma&&(Ma=Ma.clone(),Ma.translate(Y,ca),this.graph.model.setGeometry(wa[sa],Ma))}0<ma&&this.graph.isCellResizable(M[ma])&& (Ma=this.graph.getCellGeometry(M[ma]),null!=Ma&&(Ma=Ma.clone(),Ma.width=Math.max(0,Ma.width+Y),Ma.height=Math.max(0,Ma.height+ca),this.graph.model.setGeometry(M[ma],Ma)))}}finally{this.graph.model.endUpdate()}}else wa=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(wa,L.getEvent());L.consume()}}};mxRubberband.prototype.mouseMove=function(x,L){if(!L.isConsumed()&&null!=this.first){var M=mxUtils.getScrollOrigin(this.graph.container);x=mxUtils.getOffset(this.graph.container); M.x-=x.x;M.y-=x.y;x=L.getX()+M.x;M=L.getY()+M.y;var R=this.first.x-x,Y=this.first.y-M,ca=this.graph.tolerance;if(null!=this.div||Math.abs(R)>ca||Math.abs(Y)>ca)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(x,M),this.isSpaceEvent(L)?(x=this.x+this.width,M=this.y+this.height,R=this.graph.view.scale,mxEvent.isAltDown(L.getEvent())||(this.width=this.graph.snap(this.width/R)*R,this.height=this.graph.snap(this.height/R)*R,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=M-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)),L.consume()}};var Ea=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);Ea.apply(this,arguments)};var Za=(new Date).getTime(),cb=0,$a=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(x,L,M,R){$a.apply(this,arguments);M!=this.currentTerminalState?(Za=(new Date).getTime(),cb=0):cb=(new Date).getTime()-Za;this.currentTerminalState= M};var gb=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(x){if(mxEvent.isShiftDown(x.getEvent())&&mxEvent.isAltDown(x.getEvent()))return!1;var L=null!=this.currentTerminalState?mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"):"1";return"3"==L?!1:null!=this.currentTerminalState&&x.getState()==this.currentTerminalState&&("2"==L||2E3<cb)||(null==this.currentTerminalState||"0"!=L)&&gb.apply(this,arguments)};mxEdgeHandler.prototype.createHandleShape= function(x,L,M){L=null!=x&&0==x;var R=this.state.getVisibleTerminalState(L);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,R,L):null;M=null!=(null!=x?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(L),x):null)?M?this.endFixedHandleImage:this.fixedHandleImage:null!=x&&null!=R?M?this.endTerminalHandleImage:this.terminalHandleImage:M?this.endHandleImage: this.handleImage;if(null!=M)return M=new mxImageShape(new mxRectangle(0,0,M.width,M.height),M.src),M.preserveImageAspect=!1,M;M=mxConstants.HANDLE_SIZE;this.preferHtml&&--M;return new mxRectangleShape(new mxRectangle(0,0,M,M),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var ob=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(x,L,M,R){R=L==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:L==mxEvent.CONNECT_HANDLE?HoverIcons.prototype.connectHandle: L==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:R;return ob.apply(this,arguments)};var vb=mxVertexHandler.prototype.createSizers;mxVertexHandler.prototype.createSizers=function(){var x=vb.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 rb=mxVertexHandler.prototype.destroySizers;mxVertexHandler.prototype.destroySizers= function(){rb.apply(this,arguments);this.connectShape=null};var wb=mxVertexHandler.prototype.getHandleForEvent;mxVertexHandler.prototype.getHandleForEvent=function(x){if(null!=this.connectShape&&null!=this.connectShape.node&&"hidden"!=this.connectShape.node.style.visibility){var L=mxEvent.isMouseEvent(x.getEvent())?1:this.tolerance;L=this.allowHandleBoundsCheck&&0<L?new mxRectangle(x.getGraphX()-L,x.getGraphY()-L,2*L,2*L):null;if(x.isSource(this.connectShape)||null!=L&&this.connectShape.intersectsRectangle(L))return mxEvent.CONNECT_HANDLE}return wb.apply(this, arguments)};var Ib=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(x,L){if(!L.isConsumed()&&this.graph.isEnabled()&&null!=this.connectShape&&this.getHandleForEvent(L)==mxEvent.CONNECT_HANDLE){var M=L.getGraphX(),R=L.getGraphY();this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);this.graph.connectHandleClickState=this.state;this.graph.connectionHandler.start(this.state,M,R);this.graph.isMouseTrigger=mxEvent.isMouseEvent(L.getEvent());this.graph.isMouseDown= !0;M=this.graph.selectionCellsHandler.getHandler(this.state.cell);null!=M&&M.setHandlesVisible(!1);L.consume()}else Ib.apply(this,arguments)};var Fb=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(x){if(null!=x&&1==x.length){var L=this.graph.getModel(),M=L.getParent(x[0]),R=this.graph.getCellGeometry(x[0]);if(L.isEdge(M)&&null!=R&&R.relative&&(L=this.graph.view.getState(x[0]),null!=L&&2>L.width&&2>L.height&&null!=L.text&&null!=L.text.boundingBox))return mxRectangle.fromRectangle(L.text.boundingBox)}return Fb.apply(this, arguments)};var Ub=mxGraphHandler.prototype.getGuideStates;mxGraphHandler.prototype.getGuideStates=function(){var x=Ub.apply(this,arguments),L=this.graph.container;L=null!=L?new mxRectangle(L.scrollLeft-this.graph.panDx-L.clientWidth/2,L.scrollTop-this.graph.panDy-L.clientHeight/2,2*L.clientWidth,2*L.clientHeight):null;for(var M=[],R=0;R<x.length;R++)"1"==mxUtils.getValue(x[R].style,"part","0")||null!=L&&!mxUtils.intersects(L,x[R])||M.push(x[R]);return M};var Rb=mxVertexHandler.prototype.getSelectionBounds; mxVertexHandler.prototype.getSelectionBounds=function(x){var L=this.graph.getModel(),M=L.getParent(x.cell),R=this.graph.getCellGeometry(x.cell);return L.isEdge(M)&&null!=R&&R.relative&&2>x.width&&2>x.height&&null!=x.text&&null!=x.text.boundingBox?(L=x.text.unrotatedBoundingBox||x.text.boundingBox,M=L.x,R=L.y,null!=x.text.unrotatedBoundingBox&&(M=x.text.boundingBox.getCenterX()-L.width/2,R=x.text.boundingBox.getCenterY()-L.height/2),new mxRectangle(Math.round(M),Math.round(R),Math.round(L.width),Math.round(L.height))): Rb.apply(this,arguments)};var ac=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(x,L){var M=this.graph.getModel(),R=M.getParent(this.state.cell),Y=this.graph.getCellGeometry(this.state.cell),ca=this.getHandleForEvent(L);if(null!=ca&&ca<=mxEvent.CUSTOM_HANDLE&&null!=this.customHandles){var ma=this.customHandles[mxEvent.CUSTOM_HANDLE-ca];if(null!=ma&&ma.moveGroupHandle){M=this.graph.getMoveIconDragCells(this.state.cell);null!=M&&(this.graph.graphHandler.start(this.state.cell, mxEvent.getClientX(L.getEvent()),mxEvent.getClientY(L.getEvent()),M),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(L.getEvent()),this.graph.isMouseDown=!0,L.consume());return}}(ca==mxEvent.ROTATION_HANDLE||ca==mxEvent.CONNECT_HANDLE||!M.isEdge(R)||null==Y||!Y.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&ac.apply(this,arguments)};mxVertexHandler.prototype.rotateClick=function(){var x=mxUtils.getValue(this.state.style,mxConstants.STYLE_STROKECOLOR, mxConstants.NONE),L=mxUtils.getValue(this.state.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);this.state.view.graph.model.isVertex(this.state.cell)&&x==mxConstants.NONE&&L==mxConstants.NONE?(x=this.state.view.graph,x.isRotatableGroup(this.state.cell)?x.rotateCell(this.state.cell,90):(L=mxUtils.mod(mxUtils.getValue(this.state.style,mxConstants.STYLE_ROTATION,0)+90,360),x.setCellStyles(mxConstants.STYLE_ROTATION,L,[this.state.cell]))):this.state.view.graph.turnShapes([this.state.cell])};var Mb= mxVertexHandler.prototype.updateLivePreview;mxVertexHandler.prototype.updateLivePreview=function(x){if(null!=this.state&&this.graph.isAutosizeTextState(this.state)){var L=this.graph.view.scale,M=this.state.style,R=this.roundLength(this.bounds.width/L),Y=this.roundLength(this.bounds.height/L),ca=this.graph.cellRenderer.getLabelValue(this.state);if(null!=ca&&0<ca.length){var ma=this.graph.getAutosizeTextAvailableSpace(M,R,Y,this.state);if(null!=ma){this.graph.isHtmlLabel(this.state.cell)||(ca=mxUtils.htmlEntities(ca, !1));ca=ca.replace(/\n/g,"<br>");var sa=M[mxConstants.STYLE_FONTFAMILY]||mxConstants.DEFAULT_FONTFAMILY,wa=M[mxConstants.STYLE_FONTSTYLE],xa="wrap"==M[mxConstants.STYLE_WHITE_SPACE];L=null;if(xa){var Ma=this.graph.getShapeInsideFloats(M,R,Y);null!=Ma&&(L=this.graph.computeShapeInsideFontSize(ca,M,Ma,R,Y))}null==L&&(L=this.graph.computeAutosizeTextFontSize(ca,ma.availW,ma.availH,sa,wa,xa));R=M[mxConstants.STYLE_FONTSIZE];M[mxConstants.STYLE_FONTSIZE]=L;Mb.apply(this,arguments);this.state.style[mxConstants.STYLE_FONTSIZE]= R;return}}}Mb.apply(this,arguments)};var Xb=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(x,L){Xb.apply(this,arguments);this.resizeHandlesHidden&&null!=this.index&&!this.inTolerance&&this.redrawHandles();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 yb=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(x,L){yb.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.sizeGuidesEnabled=!0;mxVertexHandler.prototype.isSizeGuidesEnabled=function(){return this.sizeGuidesEnabled&&(null==this.graph.graphHandler||this.graph.graphHandler.guidesEnabled)};mxVertexHandler.prototype.isSizeGuidesEnabledForEvent=function(x){return this.isSizeGuidesEnabled()&&!mxEvent.isAltDown(x)};mxVertexHandler.prototype.getSizeGuideTolerance=function(x){return x&& this.graph.gridEnabled?this.graph.gridSize/2:2};mxVertexHandler.prototype.getSizeGuideStates=function(){var x=this.graph,L=x.getModel(),M=x.view,R=M.scale,Y=this.state.cell,ca=x.container;ca=null!=ca?new mxRectangle(ca.scrollLeft-x.panDx-ca.clientWidth/2,ca.scrollTop-x.panDy-ca.clientHeight/2,2*ca.clientWidth,2*ca.clientHeight):null;for(var ma=M.getCellStates(L.filterDescendants(function(qb){return qb!=Y&&L.isVertex(qb)&&!x.isCellSelected(qb)&&!L.isAncestor(Y,qb)&&null!=L.getGeometry(qb)&&!L.getGeometry(qb).relative&& null!=M.getState(qb)},x.getDefaultParent())),sa=this.state.getCenterX(),wa=this.state.getCenterY(),xa=90==mxUtils.mod(mxUtils.getNumber(this.state.style,mxConstants.STYLE_ROTATION,0),360)%180,Ma=[],Xa=0;Xa<ma.length;Xa++){var Ta=x.graphHandler.getGuideState(ma[Xa]);if(0<Ta.width&&0<Ta.height&&(null==ca||mxUtils.intersects(ca,Ta))){var kb=Ta.getCenterX()-sa,nb=Ta.getCenterY()-wa;Ma.push({state:Ta,width:(xa?Ta.height:Ta.width)/R,height:(xa?Ta.width:Ta.height)/R,dist:kb*kb+nb*nb})}}Ma.sort(function(qb, sb){return qb.dist-sb.dist});return Ma};mxVertexHandler.prototype.getSizeGuideMatch=function(x,L,M,R){for(var Y=null,ca=0;ca<this.sizeGuideStates.length;ca++){var ma=this.sizeGuideStates[ca],sa=(L?ma.width:ma.height)*R,wa=Math.abs(sa-x);1<=sa&&wa<=M&&(null==Y||wa<Y.diff)&&(Y={state:ma.state,value:sa,diff:wa})}return Y};mxVertexHandler.prototype.snapSize=function(x,L,M,R,Y,ca,ma){var sa=this.getSizeGuideTolerance(R)*Y;R=this.graph.getCellGeometry(this.state.cell);var wa=null!=R&&0<R.width&&0<R.height? R.width/R.height:null;if(!ca||null!=wa)if(R=ca||1!=M&&6!=M?this.getSizeGuideMatch(x.width,!0,sa,Y):null,sa=ca||3!=M&&4!=M?this.getSizeGuideMatch(x.height,!1,sa,Y):null,ca&&(null!=R&&(null==sa||R.diff<=sa.diff)?sa=null:R=null),null!=R||null!=sa){var xa=null!=R?R.value:ca?sa.value*wa:null;wa=null!=sa?sa.value:ca?R.value/wa:null;var Ma=x.x,Xa=x.y;null!=xa&&(ma?Ma=x.x+(x.width-xa)/2:0==M||3==M||5==M?.01<Math.abs(x.x+x.width-L.x-L.width)?xa=null:Ma=x.x+x.width-xa:.01<Math.abs(x.x-L.x)&&(xa=null));null!= wa&&(ma?Xa=x.y+(x.height-wa)/2:3>M?.01<Math.abs(x.y+x.height-L.y-L.height)?wa=null:Xa=x.y+x.height-wa:.01<Math.abs(x.y-L.y)&&(wa=null));null!=this.minBounds&&(null!=xa&&xa<this.minBounds.x*Y+this.minBounds.width*Y+Math.max(0,this.x0*Y-Ma)&&(xa=null),null!=wa&&wa<this.minBounds.y*Y+this.minBounds.height*Y+Math.max(0,this.y0*Y-Xa)&&(wa=null));if(!ca||null!=xa&&null!=wa)null!=xa&&(x.x=Ma,x.width=xa,this.sizeGuideWidthState=null!=R?R.state:null),null!=wa&&(x.y=Xa,x.height=wa,this.sizeGuideHeightState= null!=sa?sa.state:null)}};mxVertexHandler.prototype.getEdgeGuideMatch=function(x,L,M){for(var R=null,Y=0;Y<this.sizeGuideStates.length;Y++)for(var ca=this.sizeGuideStates[Y].state,ma=L?[ca.x,ca.getCenterX(),ca.x+ca.width]:[ca.y,ca.getCenterY(),ca.y+ca.height],sa=0;sa<ma.length;sa++){var wa=Math.abs(ma[sa]-x);wa<=M&&(null==R||wa<R.diff)&&(R={state:ca,value:ma[sa],diff:wa})}return R};mxVertexHandler.prototype.isEdgeGuideSizeAllowed=function(x,L,M,R){return 1>x?!1:null!=this.minBounds?M?x>=this.minBounds.x* R+this.minBounds.width*R+Math.max(0,this.x0*R-L):x>=this.minBounds.y*R+this.minBounds.height*R+Math.max(0,this.y0*R-L):!0};mxVertexHandler.prototype.snapEdges=function(x,L,M,R,Y){var ca=this.graph.getCellGeometry(this.state.cell);if(0==mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0")&&null!=ca&&!ca.relative&&mxGuide.prototype.positionEnabled){ca=this.graph.view;var ma=null!=this.parentState?this.parentState.x:ca.translate.x*ca.scale,sa=null!=this.parentState?this.parentState.y: ca.translate.y*ca.scale,wa=Math.max(2,this.getSizeGuideTolerance(R)*ca.scale);if(null!=this.sizeGuideWidthState||0!=M&&3!=M&&5!=M)null==this.sizeGuideWidthState&&(2==M||4==M||7==M)&&.01>=Math.abs(x.x-L.x)&&(R=this.getEdgeGuideMatch(ma+(x.x+x.width)*ca.scale,!0,wa),null!=R&&(xa=(R.value-ma)/ca.scale-x.x,this.isEdgeGuideSizeAllowed(xa,x.x,!0,Y)&&(x.width=xa,this.edgeGuideXMatch=R)));else if(.01>=Math.abs(x.x+x.width-L.x-L.width)&&(R=this.getEdgeGuideMatch(ma+x.x*ca.scale,!0,wa),null!=R)){ma=(R.value- ma)/ca.scale;var xa=x.x+x.width-ma;this.isEdgeGuideSizeAllowed(xa,ma,!0,Y)&&(x.width=xa,x.x=ma,this.edgeGuideXMatch=R)}null==this.sizeGuideHeightState&&3>M?.01>=Math.abs(x.y+x.height-L.y-L.height)&&(R=this.getEdgeGuideMatch(sa+x.y*ca.scale,!1,wa),null!=R&&(L=(R.value-sa)/ca.scale,M=x.y+x.height-L,this.isEdgeGuideSizeAllowed(M,L,!1,Y)&&(x.height=M,x.y=L,this.edgeGuideYMatch=R))):null==this.sizeGuideHeightState&&4<M&&.01>=Math.abs(x.y-L.y)&&(R=this.getEdgeGuideMatch(sa+(x.y+x.height)*ca.scale,!1,wa), null!=R&&(M=(R.value-sa)/ca.scale-x.y,this.isEdgeGuideSizeAllowed(M,x.y,!1,Y)&&(x.height=M,this.edgeGuideYMatch=R)))}};mxVertexHandler.prototype.createEdgeGuideShape=function(x,L,M){L=[L,M];null==x?(x=new mxPolyline(L,mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH),x.dialect=mxConstants.DIALECT_SVG,x.pointerEvents=!1,x.init(this.graph.getView().getOverlayPane())):x.points=L;x.node.style.visibility="visible";x.redraw();return x};mxVertexHandler.prototype.createSizeGuideShape=function(x,L,M, R){var Y=5*this.graph.view.scale,ca=L.getCenterX(),ma=L.getCenterY(),sa=R?new mxPoint(L.x,ma):new mxPoint(ca,L.y);L=R?new mxPoint(L.x+L.width,ma):new mxPoint(ca,L.y+L.height);var wa=R?0:Y;R=R?Y:0;sa=[new mxPoint(sa.x-wa,sa.y-R),new mxPoint(sa.x+wa,sa.y+R),sa,L,new mxPoint(L.x-wa,L.y-R),new mxPoint(L.x+wa,L.y+R)];if(0!=M)for(R=Math.cos(M),M=Math.sin(M),ca=new mxPoint(ca,ma),ma=0;ma<sa.length;ma++)sa[ma]=mxUtils.getRotatedPoint(sa[ma],R,M,ca);null==x?(x=new mxPolyline(sa,mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH), x.dialect=mxConstants.DIALECT_SVG,x.pointerEvents=!1,x.init(this.graph.getView().getOverlayPane())):x.points=sa;x.node.style.visibility="visible";x.redraw();return x};mxVertexHandler.prototype.redrawSizeGuides=function(){this.sizeGuideShapes=null!=this.sizeGuideShapes?this.sizeGuideShapes:[];var x=0;if(null!=this.state&&null!=this.bounds){var L=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),M=90==mxUtils.mod(mxUtils.getNumber(this.state.style,mxConstants.STYLE_ROTATION,0),360)% 180,R=function(ma){ma=mxUtils.mod(mxUtils.getNumber(ma.style,mxConstants.STYLE_ROTATION,0),360);return 90==ma%180?0:mxUtils.toRadians(ma)},Y=mxUtils.bind(this,function(ma,sa,wa){this.sizeGuideShapes[x]=this.createSizeGuideShape(this.sizeGuideShapes[x],ma,sa,wa);x++}),ca=mxUtils.bind(this,function(ma,sa){this.sizeGuideShapes[x]=this.createEdgeGuideShape(this.sizeGuideShapes[x],ma,sa);x++});null!=this.sizeGuideWidthState&&(Y(this.bounds,L,!0),Y(this.sizeGuideWidthState,R(this.sizeGuideWidthState),!M)); null!=this.sizeGuideHeightState&&(Y(this.bounds,L,!1),Y(this.sizeGuideHeightState,R(this.sizeGuideHeightState),M));null!=this.edgeGuideXMatch&&(L=this.edgeGuideXMatch.state,ca(new mxPoint(this.edgeGuideXMatch.value,Math.min(this.bounds.y,L.y)),new mxPoint(this.edgeGuideXMatch.value,Math.max(this.bounds.y+this.bounds.height,L.y+L.height))));null!=this.edgeGuideYMatch&&(L=this.edgeGuideYMatch.state,ca(new mxPoint(Math.min(this.bounds.x,L.x),this.edgeGuideYMatch.value),new mxPoint(Math.max(this.bounds.x+ this.bounds.width,L.x+L.width),this.edgeGuideYMatch.value)))}for(ca=x;ca<this.sizeGuideShapes.length;ca++)null!=this.sizeGuideShapes[ca]&&(this.sizeGuideShapes[ca].node.style.visibility="hidden")};mxVertexHandler.prototype.destroySizeGuides=function(){if(null!=this.sizeGuideShapes){for(var x=0;x<this.sizeGuideShapes.length;x++)null!=this.sizeGuideShapes[x]&&this.sizeGuideShapes[x].destroy();this.sizeGuideShapes=null}this.sizeGuidesActive=this.edgeGuideYMatch=this.edgeGuideXMatch=this.sizeGuideHeightState= this.sizeGuideWidthState=this.sizeGuideStates=null};var Vb=mxVertexHandler.prototype.start;mxVertexHandler.prototype.start=function(x,L,M){Vb.apply(this,arguments);this.sizeGuideStates=null!=this.state&&0<=M&&this.isSizeGuidesEnabled()?this.getSizeGuideStates():null};var Jb=mxVertexHandler.prototype.resizeVertex;mxVertexHandler.prototype.resizeVertex=function(x){this.sizeGuidesActive=this.isSizeGuidesEnabledForEvent(x.getEvent());Jb.apply(this,arguments);this.redrawSizeGuides()};var Yb=mxVertexHandler.prototype.union; mxVertexHandler.prototype.union=function(x,L,M,R,Y,ca,ma,sa,wa){var xa=Yb.apply(this,arguments);this.edgeGuideYMatch=this.edgeGuideXMatch=this.sizeGuideHeightState=this.sizeGuideWidthState=null;this.sizeGuidesActive&&!this.singleSizer&&0<=R&&null!=this.sizeGuideStates&&0<this.sizeGuideStates.length&&(this.snapSize(xa,x,R,Y,ca,sa,wa),sa||wa||this.snapEdges(xa,x,R,Y,ca));return xa};var cc=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){cc.apply(this,arguments);this.destroySizeGuides()}; var Gb=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){Gb.apply(this,arguments);this.destroySizeGuides()};mxVertexHandler.prototype.updateLinkHint=function(x,L){try{if(null==x&&(null==L||0==L.length))null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=x||null!=L&&0<L.length){var M=document.createElement("img");M.className="geAdaptiveAsset";M.setAttribute("src",Editor.editImage);M.setAttribute("title",mxResources.get("editLink")); M.setAttribute("width","14");M.setAttribute("height","14");M.style.paddingLeft="8px";M.style.marginLeft="auto";M.style.marginBottom="-1px";M.style.cursor="pointer";var R=M.cloneNode(!0);R.setAttribute("src",Editor.trashImage);R.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));R.style.paddingLeft="4px";R.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 Y=document.createElement("div");Y.style.display="flex";Y.style.alignItems="center";Y.appendChild(this.graph.createLinkForHint(x,null,this.state.cell));this.linkHint.appendChild(Y);if(this.graph.isEnabled()&&"function"===typeof this.graph.editLink&& !this.graph.isCellLocked(this.state.cell)){var ca=M.cloneNode(!0);Y.appendChild(ca);mxEvent.addListener(ca,"click",mxUtils.bind(this,function(sa){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();mxEvent.consume(sa)}));var ma=R.cloneNode(!0);Y.appendChild(ma);mxEvent.addListener(ma,"click",mxUtils.bind(this,function(sa){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(sa)}))}}if(null!=L)for(Y=0;Y<L.length;Y++)mxUtils.bind(this,function(sa,wa){var xa=document.createElement("div"); xa.style.display="flex";xa.style.alignItems="center";xa.style.marginTop=null!=x||0<wa?"6px":"0px";xa.appendChild(this.graph.createLinkForHint(sa.getAttribute("href"),mxUtils.getTextContent(sa),this.state.cell));var Ma=M.cloneNode(!0);xa.appendChild(Ma);var Xa=mxUtils.bind(this,function(Ta){var kb=document.createElement("div");kb.innerHTML=Graph.sanitizeHtml(this.graph.getLabel(this.state.cell));var nb=kb.getElementsByTagName("a")[wa];if(null!=nb){if(null==Ta||""==Ta){for(Ta=nb.cloneNode(!0).firstChild;null!= Ta;)nb.parentNode.insertBefore(Ta.cloneNode(!0),nb),Ta=Ta.nextSibling;nb.parentNode.removeChild(nb)}else nb.setAttribute("href",Ta);this.graph.labelChanged(this.state.cell,kb.innerHTML)}});mxEvent.addListener(Ma,"click",mxUtils.bind(this,function(Ta){this.graph.showLinkDialog(sa.getAttribute("href")||"",mxResources.get("ok"),Xa);mxEvent.consume(Ta)}));Ma=R.cloneNode(!0);xa.appendChild(Ma);mxEvent.addListener(Ma,"click",mxUtils.bind(this,function(Ta){Xa();mxEvent.consume(Ta)}));this.linkHint.appendChild(xa)})(L[Y], Y)}null!=this.linkHint&&Graph.sanitizeNode(this.linkHint)}catch(sa){}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var Ob=mxEdgeHandler.prototype.createConstraintHandler;mxEdgeHandler.prototype.createConstraintHandler=function(){var x=Ob.apply(this,arguments);x.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});return x};var bc=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){bc.apply(this, arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var $b=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 L=this.cornerHandles,M=L[0].bounds.height/2;L[0].bounds.x=this.state.x-L[0].bounds.width/2+x;L[0].bounds.y=this.state.y-M+x;L[0].redraw();L[1].bounds.x=L[0].bounds.x+this.state.width-2*x;L[1].bounds.y=L[0].bounds.y;L[1].redraw();L[2].bounds.x=L[0].bounds.x;L[2].bounds.y=this.state.y+this.state.height-2*x;L[2].redraw();L[3].bounds.x= L[1].bounds.x;L[3].bounds.y=L[2].bounds.y;L[3].redraw();L=1==this.graph.getSelectionCount()&&(!this.graph.isTransparentBounds(this.state.cell)||this.graph.isCellSelected(this.state.cell));for(x=0;x<this.cornerHandles.length;x++)this.cornerHandles[x].node.style.display=L?"":"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":"");$b.apply(this);if(null!=this.customHandles)for(x=0;x<this.customHandles.length;x++)null!=this.customHandles[x]&&(this.customHandles[x].lockHandle||this.customHandles[x].editIconHandle||this.customHandles[x].moveGroupHandle)&&this.customHandles[x].redraw();null!=this.rotationShape&&null!=this.rotationShape.node&&(x=Number(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.rotationShape.rotation!== x&&(L=this.rotationShape.node.style.visibility,this.rotationShape.rotation=x,this.rotationShape.redraw(),this.rotationShape.node.style.visibility=L));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&&(L=mxUtils.toRadians(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),x=Math.cos(L),L=Math.sin(L),M=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),x=mxUtils.getRotatedPoint(this.getConnectHandlePosition(),x,L,M),this.moveSizerTo(this.connectShape,x.x,x.y)));null!=this.state&&null!=this.linkHint&&(x=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),L=new mxRectangle(this.state.x, this.state.y-22,this.state.width+24,this.state.height+22),M=mxUtils.getBoundingBox(L,this.state.style[mxConstants.STYLE_ROTATION]||"0",x),x=null!=M?mxUtils.getBoundingBox(this.state,this.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,L=null!=this.state.text?this.state.text.boundingBox:null,null==M&&(M=this.state),M=M.y+M.height,null!=L&&(M=Math.max(M,L.y+L.height)),this.linkHint.style.left=x.x+x.width/2+"px",this.linkHint.style.top=Math.round(M+this.verticalOffset/2+Editor.hintOffset)+"px", this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":"")};var Wb=mxVertexHandler.prototype.drawPreview;mxVertexHandler.prototype.drawPreview=function(){if(null!=this.selectionBorder){var x=Graph.getLabelAutoRotation(this.state);this.selectionBorder.rotation=null!=x?x:Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")}Wb.apply(this,arguments)};var Cb=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){Cb.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 Hb=mxEdgeHandler.prototype.redrawHandles;mxEdgeHandler.prototype.redrawHandles= function(){if(null!=this.marker&&(Hb.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 Ab=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=function(){Ab.apply(this, arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var Db=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Db.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(g,r,B){mxShape.call(this);this.line=g;this.stroke=r;this.strokewidth=null!=B?B:1;this.updateBoundsFromLine()}function d(){mxSwimlane.call(this)}function m(){mxSwimlane.call(this)}function p(){mxCylinder.call(this)}function t(){mxConnector.call(this)}function n(){mxCylinder.call(this)}function z(){mxActor.call(this)}function D(){mxCylinder.call(this)}function N(){mxCylinder.call(this)}function F(){mxCylinder.call(this)}function P(){mxCylinder.call(this)}function T(){mxShape.call(this)} function c(){mxShape.call(this)}function f(g,r,B,u){mxShape.call(this);this.bounds=g;this.fill=r;this.stroke=B;this.strokewidth=null!=u?u:1}function k(){mxActor.call(this)}function q(){mxCylinder.call(this)}function y(){mxCylinder.call(this)}function A(){mxShape.call(this)}function E(){mxActor.call(this)}function K(){mxActor.call(this)}function Q(){mxActor.call(this)}function W(){mxActor.call(this)}function J(){mxActor.call(this)}function ea(){mxActor.call(this)}function X(){mxActor.call(this)}function aa(g, r){this.canvas=g;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=r;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,aa.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,aa.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,aa.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,aa.prototype.quadTo);this.originalCurveTo= this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,aa.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,aa.prototype.arcTo)}function ka(){mxRectangleShape.call(this)}function ja(){mxRectangleShape.call(this)}function ua(){mxActor.call(this)}function Ba(){mxActor.call(this)}function ia(){mxActor.call(this)}function l(){mxActor.call(this)}function v(){mxRectangleShape.call(this)}function H(){mxRectangleShape.call(this)}function O(){mxCylinder.call(this)} function S(){mxShape.call(this)}function V(){mxShape.call(this)}function Z(){mxEllipse.call(this)}function ba(){mxShape.call(this)}function ha(){mxShape.call(this)}function na(g,r){function B(){mxShape.call(this)}mxUtils.extend(B,mxShape);B.prototype.iconSize=r;B.prototype.paintBackground=function(u,C,G,I,da){da=Math.min(this.iconSize,I,da);C+=(I-da)/2;g.prototype.hasOwnProperty("paintVertexShape")?g.prototype.paintVertexShape.call(this,u,C,G,da,da):(g.prototype.paintBackground.call(this,u,C,G,da, da),"function"===typeof g.prototype.paintForeground&&g.prototype.paintForeground.call(this,u,C,G,da,da))};return B}function oa(){mxShape.call(this)}function fa(){mxShape.call(this)}function qa(){mxShape.call(this)}function ya(){mxShape.call(this)}function ta(){mxShape.call(this)}function Ca(){mxRectangleShape.call(this)}function la(){mxShape.call(this)}function ra(){mxShape.call(this)}function va(){mxShape.call(this)}function Ia(){mxShape.call(this)}function La(){mxShape.call(this)}function Ga(){mxCylinder.call(this)} function Da(){mxCylinder.call(this)}function Pa(){mxRectangleShape.call(this)}function Ka(){mxDoubleEllipse.call(this)}function Na(){mxDoubleEllipse.call(this)}function Oa(){mxArrowConnector.call(this);this.spacing=0}function Fa(){mxArrowConnector.call(this);this.spacing=0}function za(){mxActor.call(this)}function Ja(){mxRectangleShape.call(this)}function Ha(){mxActor.call(this)}function Sa(){mxActor.call(this)}function ab(){mxActor.call(this)}function Va(){mxActor.call(this)}function db(){mxActor.call(this)} function Ea(){mxActor.call(this)}function Za(){mxActor.call(this)}function cb(){mxActor.call(this)}function $a(){mxActor.call(this)}function gb(){mxActor.call(this)}function ob(){mxEllipse.call(this)}function vb(){mxEllipse.call(this)}function rb(){mxEllipse.call(this)}function wb(){mxRhombus.call(this)}function Ib(){mxEllipse.call(this)}function Fb(){mxEllipse.call(this)}function Ub(){mxEllipse.call(this)}function Rb(){mxEllipse.call(this)}function ac(){mxActor.call(this)}function Mb(){mxActor.call(this)} function Xb(){mxActor.call(this)}function yb(g,r,B,u){mxShape.call(this);this.bounds=g;this.fill=r;this.stroke=B;this.strokewidth=null!=u?u:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=!0;this.indent=2;this.rectOutline="single"}function Vb(){mxConnector.call(this)}function Jb(){mxConnector.call(this)}function Yb(){mxActor.call(this)}function cc(g,r,B,u,C,G,I,da,U,Aa){I+=U;var pa=u.clone();u.x-=C*(2*I+U);u.y-=G*(2*I+U);C*=I+U;G*=I+U;return function(){g.ellipse(pa.x-C-I,pa.y-G-I,2* I,2*I);Aa?g.fillAndStroke():g.stroke()}}function Gb(){mxRectangleShape.call(this)}function Ob(){mxActor.call(this)}function bc(){mxShape.call(this)}function $b(){mxShape.call(this)}function Wb(){mxActor.call(this)}function Cb(){mxActor.call(this)}function Hb(){mxActor.call(this)}function Ab(){mxActor.call(this)}function Db(){mxConnector.call(this)}var x=mxShape.prototype.getLabelMargins;mxShape.prototype.getLabelMargins=function(g){if(null!=this.stencil&&null!=this.stencil.desc&&null!=this.style){if(null== this.stencil.labelBounds){for(var r=this.stencil.desc.getElementsByTagName("labelBounds"),B=[],u=0;u<r.length;u++)B.push({condition:r[u].getAttribute("if"),x:Number(r[u].getAttribute("x")||0),y:Number(r[u].getAttribute("y")||0),w:Number(r[u].getAttribute("w")||this.stencil.w0),h:Number(r[u].getAttribute("h")||this.stencil.h0)});this.stencil.labelBounds=B}for(u=0;u<this.stencil.labelBounds.length;u++)if(r=this.stencil.labelBounds[u],null==r.condition||"1"==mxUtils.getValue(this.style,r.condition,"0")){u= this.stencil.computeAspect(this.style,g.x,g.y,g.width,g.height);B=u.x-g.x+r.x*u.width;var C=u.y-g.y+r.y*u.height;return new mxRectangle(B,C,g.width-B-r.w*u.width,g.height-C-r.h*u.height)}}return x.apply(this,arguments)};mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var g=null;if(null!=this.line)for(var r=0;r<this.line.length;r++){var B=this.line[r];null!=B&&(B=new mxRectangle(B.x,B.y,this.strokewidth,this.strokewidth),null==g?g=B:g.add(B))}this.bounds=null!=g?g:new mxRectangle}; b.prototype.paintVertexShape=function(g,r,B,u,C){this.paintTableLine(g,this.line,0,0)};b.prototype.paintTableLine=function(g,r,B,u){if(null!=r){var C=null;g.begin();for(var G=0;G<r.length;G++){var I=r[G];null!=I&&(null==C?g.moveTo(I.x+B,I.y+u):null!=C&&g.lineTo(I.x+B,I.y+u));C=I}g.end();g.stroke()}};b.prototype.intersectsRectangle=function(g){var r=!1;if(mxShape.prototype.intersectsRectangle.apply(this,arguments)&&null!=this.line)for(var B=null,u=0;u<this.line.length&&!r;u++){var C=this.line[u];null!= C&&null!=B&&(r=mxUtils.rectangleIntersectsSegment(g,B,C));B=C}return r};mxCellRenderer.registerShape("tableLine",b);mxUtils.extend(d,mxSwimlane);d.prototype.fixedHeaderDefault=!1;d.prototype.paintVertexShape=function(g,r,B,u,C){var G=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):!1,I=this.isHorizontal(),da=this.getTitleSize(),U=mxUtils.getValue(this.style,mxConstants.STYLE_FIXED_HEADER,this.fixedHeaderDefault);0==da&&this.isRounded&&!this.outline?(U=mxShape.prototype.getArcSize.call(this, u,C),g.begin(),g.roundrect(r,B,u,C,U,U),g.fillAndStroke()):0==da&&!U||this.outline?Ub.prototype.paintVertexShape.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),g.translate(-r,-B));G||this.outline||!(I&&da<C||!I&&da<u)||this.paintForeground(g,r,B,u,C)};d.prototype.paintForeground=function(g,r,B,u,C){if(null!=this.state){var G=this.flipH,I=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var da=G;G=I;I=da}g.rotate(-this.getShapeRotation(), G,I,r+u/2,B+C/2);s=this.scale;r=this.bounds.x/s;B=this.bounds.y/s;u=this.bounds.width/s;C=this.bounds.height/s;this.paintTableForeground(g,r,B,u,C)}};d.prototype.paintTableForeground=function(g,r,B,u,C){u=this.state.view.graph.getTableLines(this.state.cell,"0"!=mxUtils.getValue(this.state.style,"rowLines","1"),"0"!=mxUtils.getValue(this.state.style,"columnLines","1"));for(C=0;C<u.length;C++)b.prototype.paintTableLine(g,u[C],r,B)};d.prototype.configurePointerEvents=function(g){0==this.getTitleSize()? g.pointerEvents=!1:mxSwimlane.prototype.configurePointerEvents.apply(this,arguments)};mxCellRenderer.registerShape("table",d);mxUtils.extend(m,d);m.prototype.paintForeground=function(){};mxCellRenderer.registerShape("tableRow",m);var L=mxSwimlane.prototype.paintVertexShape;mxSwimlane.prototype.paintVertexShape=function(g,r,B,u,C){L.apply(this,arguments);if(null!=this.state&&!this.outline){var G=this.state.view.graph;if((null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.laneFill&&this.laneFill!= mxConstants.NONE)&&null!=G.paintTableCellLines){var I=this.state.cell;if(null!=G.isTableRow&&G.isTableRow(I)){var da=this.getTitleSize();this.isHorizontal()?G.paintTableCellLines(g,I,0,0,u,Math.min(da,C),this.stroke,this.strokewidth):G.paintTableCellLines(g,I,0,0,Math.min(da,u),C,this.stroke,this.strokewidth)}else G.paintTableCellLines(g,I,0,0,u,C,this.stroke,this.strokewidth)}}};mxUtils.extend(p,mxCylinder);p.prototype.size=20;p.prototype.darkOpacity=0;p.prototype.darkOpacity2=0;p.prototype.paintVertexShape= function(g,r,B,u,C){var G=Math.max(0,Math.min(u,Math.min(C,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),I=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),da=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));g.translate(r,B);g.begin();g.moveTo(0,0);g.lineTo(u-G,0);g.lineTo(u,G);g.lineTo(u,C);g.lineTo(G,C);g.lineTo(0,C-G);g.lineTo(0,0);g.close();g.end();g.fillAndStroke();this.outline||(g.setShadow(!1), 0!=I&&(g.setFillAlpha(Math.abs(I)),g.setFillColor(0>I?"#FFFFFF":"#000000"),g.begin(),g.moveTo(0,0),g.lineTo(u-G,0),g.lineTo(u,G),g.lineTo(G,G),g.close(),g.fill()),0!=da&&(g.setFillAlpha(Math.abs(da)),g.setFillColor(0>da?"#FFFFFF":"#000000"),g.begin(),g.moveTo(0,0),g.lineTo(G,G),g.lineTo(G,C),g.lineTo(0,C-G),g.close(),g.fill()),g.begin(),g.moveTo(G,C),g.lineTo(G,G),g.lineTo(0,0),g.moveTo(G,G),g.lineTo(u,G),g.end(),g.stroke())};p.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style, "boundedLbl",!1)?(g=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(g,g,0,0)):null};mxCellRenderer.registerShape("cube",p);var M=Math.tan(mxUtils.toRadians(30)),R=(.5-M)/2;mxCellRenderer.registerShape("isoRectangle",z);mxUtils.extend(t,mxConnector);t.prototype.paintEdgeShape=function(g,r){var B=this.createMarker(g,r,!0),u=this.createMarker(g,r,!1);g.setDashed(!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);null!=this.isDashed&&g.setDashed(this.isDashed, null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);g.setShadow(!1);g.setStrokeColor(this.fill);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);g.setStrokeColor(this.stroke);g.setFillColor(this.stroke);g.setDashed(!1);null!=B&&B();null!=u&&u()};mxCellRenderer.registerShape("wire",t);mxUtils.extend(n,mxCylinder);n.prototype.size=6;n.prototype.paintVertexShape=function(g,r,B,u,C){g.setFillColor(this.stroke);var G=Math.max(0,parseFloat(mxUtils.getValue(this.style, "size",this.size))-2)+2*this.strokewidth;g.ellipse(r+.5*(u-G),B+.5*(C-G),G,G);g.fill();g.setFillColor(mxConstants.NONE);g.rect(r,B,u,C);g.fill()};mxCellRenderer.registerShape("waypoint",n);mxUtils.extend(z,mxActor);z.prototype.size=20;z.prototype.redrawPath=function(g,r,B,u,C){r=Math.min(u,C/M);g.translate((u-r)/2,(C-r)/2+r/4);g.moveTo(0,.25*r);g.lineTo(.5*r,r*R);g.lineTo(r,.25*r);g.lineTo(.5*r,(.5-R)*r);g.lineTo(0,.25*r);g.close();g.end()};mxCellRenderer.registerShape("isoRectangle",z);mxUtils.extend(D, mxCylinder);D.prototype.size=20;D.prototype.redrawPath=function(g,r,B,u,C,G){r=Math.min(u,C/(.5+M));G?(g.moveTo(0,.25*r),g.lineTo(.5*r,(.5-R)*r),g.lineTo(r,.25*r),g.moveTo(.5*r,(.5-R)*r),g.lineTo(.5*r,(1-R)*r)):(g.translate((u-r)/2,(C-r)/2),g.moveTo(0,.25*r),g.lineTo(.5*r,r*R),g.lineTo(r,.25*r),g.lineTo(r,.75*r),g.lineTo(.5*r,(1-R)*r),g.lineTo(0,.75*r),g.close());g.end()};mxCellRenderer.registerShape("isoCube",D);mxUtils.extend(N,mxCylinder);N.prototype.redrawPath=function(g,r,B,u,C,G){r=Math.min(C/ 2,Math.round(C/8)+this.strokewidth-1);if(G&&null!=this.fill||!G&&null==this.fill)g.moveTo(0,r),g.curveTo(0,2*r,u,2*r,u,r),G||(g.stroke(),g.begin()),g.translate(0,r/2),g.moveTo(0,r),g.curveTo(0,2*r,u,2*r,u,r),G||(g.stroke(),g.begin()),g.translate(0,r/2),g.moveTo(0,r),g.curveTo(0,2*r,u,2*r,u,r),G||(g.stroke(),g.begin()),g.translate(0,-r);G||(g.moveTo(0,r),g.curveTo(0,-r/3,u,-r/3,u,r),g.lineTo(u,C-r),g.curveTo(u,C+r/3,0,C+r/3,0,C-r),g.close())};N.prototype.getLabelMargins=function(g){return new mxRectangle(0, 2.5*Math.min(g.height/2,Math.round(g.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",N);mxUtils.extend(F,mxCylinder);F.prototype.size=30;F.prototype.darkOpacity=0;F.prototype.paintVertexShape=function(g,r,B,u,C){var G=Math.max(0,Math.min(u,Math.min(C,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),I=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));g.translate(r,B);g.begin();g.moveTo(0,0);g.lineTo(u-G,0);g.lineTo(u, G);g.lineTo(u,C);g.lineTo(0,C);g.lineTo(0,0);g.close();g.end();g.fillAndStroke();this.outline||(g.setShadow(!1),0!=I&&(g.setFillAlpha(Math.abs(I)),g.setFillColor(0>I?"#FFFFFF":"#000000"),g.begin(),g.moveTo(u-G,0),g.lineTo(u-G,G),g.lineTo(u,G),g.close(),g.fill()),g.begin(),g.moveTo(u-G,0),g.lineTo(u-G,G),g.lineTo(u,G),g.end(),g.stroke())};mxCellRenderer.registerShape("note",F);mxUtils.extend(P,F);mxCellRenderer.registerShape("note2",P);P.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style, "boundedLbl",!1)){var r=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(g.height*this.scale,r*this.scale),0,0)}return null};mxUtils.extend(T,mxShape);T.prototype.isoAngle=15;T.prototype.paintVertexShape=function(g,r,B,u,C){var G=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;G=Math.min(u*Math.tan(G),.5*C);g.translate(r,B);g.begin();g.moveTo(.5*u,0);g.lineTo(u,G);g.lineTo(u,C-G);g.lineTo(.5*u,C);g.lineTo(0,C-G);g.lineTo(0, G);g.close();g.fillAndStroke();g.setShadow(!1);g.begin();g.moveTo(0,G);g.lineTo(.5*u,2*G);g.lineTo(u,G);g.moveTo(.5*u,2*G);g.lineTo(.5*u,C);g.stroke()};mxCellRenderer.registerShape("isoCube2",T);mxUtils.extend(c,mxShape);c.prototype.size=15;c.prototype.paintVertexShape=function(g,r,B,u,C){var G=Math.max(0,Math.min(.5*C,parseFloat(mxUtils.getValue(this.style,"size",this.size))));g.translate(r,B);0==G?(g.rect(0,0,u,C),g.fillAndStroke()):(g.begin(),g.moveTo(0,G),g.arcTo(.5*u,G,0,0,1,.5*u,0),g.arcTo(.5* u,G,0,0,1,u,G),g.lineTo(u,C-G),g.arcTo(.5*u,G,0,0,1,.5*u,C),g.arcTo(.5*u,G,0,0,1,0,C-G),g.close(),g.fillAndStroke(),g.setShadow(!1),g.begin(),g.moveTo(u,G),g.arcTo(.5*u,G,0,0,1,.5*u,2*G),g.arcTo(.5*u,G,0,0,1,0,G),g.stroke())};mxCellRenderer.registerShape("cylinder2",c);mxUtils.extend(f,mxCylinder);f.prototype.size=15;f.prototype.paintVertexShape=function(g,r,B,u,C){var G=Math.max(0,Math.min(.5*C,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),I=mxUtils.getValue(this.style,"lid",!0);g.translate(r, B);0==G?(g.rect(0,0,u,C),g.fillAndStroke()):(g.begin(),I?(g.moveTo(0,G),g.arcTo(.5*u,G,0,0,1,.5*u,0),g.arcTo(.5*u,G,0,0,1,u,G)):(g.moveTo(0,0),g.arcTo(.5*u,G,0,0,0,.5*u,G),g.arcTo(.5*u,G,0,0,0,u,0)),g.lineTo(u,C-G),g.arcTo(.5*u,G,0,0,1,.5*u,C),g.arcTo(.5*u,G,0,0,1,0,C-G),g.close(),g.fillAndStroke(),g.setShadow(!1),I&&(g.begin(),g.moveTo(u,G),g.arcTo(.5*u,G,0,0,1,.5*u,2*G),g.arcTo(.5*u,G,0,0,1,0,G),g.stroke()))};mxCellRenderer.registerShape("cylinder3",f);mxUtils.extend(k,mxActor);k.prototype.redrawPath= function(g,r,B,u,C){g.moveTo(0,0);g.quadTo(u/2,.5*C,u,0);g.quadTo(.5*u,C/2,u,C);g.quadTo(u/2,.5*C,0,C);g.quadTo(.5*u,C/2,0,0);g.end()};mxCellRenderer.registerShape("switch",k);mxUtils.extend(q,mxCylinder);q.prototype.tabWidth=60;q.prototype.tabHeight=20;q.prototype.tabPosition="right";q.prototype.arcSize=.1;q.prototype.isRoundable=function(){return!0};q.prototype.paintVertexShape=function(g,r,B,u,C){g.translate(r,B);r=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))); B=Math.max(0,Math.min(C,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var G=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),I=mxUtils.getValue(this.style,"rounded",!1),da=mxUtils.getValue(this.style,"absoluteArcSize",!1),U=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));da||(U*=Math.min(u,C));U=Math.min(U,.5*u,.5*(C-B));r=Math.max(r,U);r=Math.min(u-U,r);I||(U=0);g.begin();"left"==G?(g.moveTo(Math.max(U,0),B),g.lineTo(Math.max(U,0),0),g.lineTo(r, 0),g.lineTo(r,B)):(g.moveTo(u-r,B),g.lineTo(u-r,0),g.lineTo(u-Math.max(U,0),0),g.lineTo(u-Math.max(U,0),B));I?(g.moveTo(0,U+B),g.arcTo(U,U,0,0,1,U,B),g.lineTo(u-U,B),g.arcTo(U,U,0,0,1,u,U+B),g.lineTo(u,C-U),g.arcTo(U,U,0,0,1,u-U,C),g.lineTo(U,C),g.arcTo(U,U,0,0,1,0,C-U)):(g.moveTo(0,B),g.lineTo(u,B),g.lineTo(u,C),g.lineTo(0,C));g.close();g.fillAndStroke();g.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(g.begin(),g.moveTo(u-30,B+20),g.lineTo(u-20,B+10),g.lineTo(u-10, B+20),g.close(),g.stroke())};mxCellRenderer.registerShape("folder",q);q.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var B=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var u=mxUtils.getValue(this.style,"rounded",!1),C=mxUtils.getValue(this.style,"absoluteArcSize",!1),G=parseFloat(mxUtils.getValue(this.style, "arcSize",this.arcSize));C||(G*=Math.min(g.width,g.height));G=Math.min(G,.5*g.width,.5*(g.height-r));u||(G=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(G,0,Math.min(g.width,g.width-B),Math.min(g.height,g.height-r)):new mxRectangle(Math.min(g.width,g.width-B),0,G,Math.min(g.height,g.height-r))}return new mxRectangle(0,Math.min(g.height,r),0,0)}return null};mxUtils.extend(y,mxCylinder);y.prototype.arcSize=.1;y.prototype.paintVertexShape=function(g,r,B, u,C){g.translate(r,B);var G=mxUtils.getValue(this.style,"rounded",!1),I=mxUtils.getValue(this.style,"absoluteArcSize",!1);r=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));B=mxUtils.getValue(this.style,"umlStateConnection",null);I||(r*=Math.min(u,C));r=Math.min(r,.5*u,.5*C);G||(r=0);G=0;null!=B&&(G=10);g.begin();g.moveTo(G,r);g.arcTo(r,r,0,0,1,G+r,0);g.lineTo(u-r,0);g.arcTo(r,r,0,0,1,u,r);g.lineTo(u,C-r);g.arcTo(r,r,0,0,1,u-r,C);g.lineTo(G+r,C);g.arcTo(r,r,0,0,1,G,C-r);g.close();g.fillAndStroke(); g.setShadow(!1);"collapseState"==mxUtils.getValue(this.style,"umlStateSymbol",null)&&(g.roundrect(u-40,C-20,10,10,3,3),g.stroke(),g.roundrect(u-20,C-20,10,10,3,3),g.stroke(),g.begin(),g.moveTo(u-30,C-15),g.lineTo(u-20,C-15),g.stroke());"connPointRefEntry"==B?(g.ellipse(0,.5*C-10,20,20),g.fillAndStroke()):"connPointRefExit"==B&&(g.ellipse(0,.5*C-10,20,20),g.fillAndStroke(),g.begin(),g.moveTo(5,.5*C-5),g.lineTo(15,.5*C+5),g.moveTo(15,.5*C-5),g.lineTo(5,.5*C+5),g.stroke())};y.prototype.getLabelMargins= function(g){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",y);mxUtils.extend(A,mxShape);A.prototype.featureColor="#666666";A.prototype.paintVertexShape=function(g,r,B,u,C){var G=mxUtils.getValue(this.style,"smileyType","happy"),I=mxUtils.getValue(this.style,"smileyFeatureColor",A.prototype.featureColor);g.translate(r,B);r=Math.min(u,C)/2;g.ellipse(u/ 2-r,C/2-r,2*r,2*r);g.fillAndStroke();r=Math.min(u,C)/30;u/=2;C/=2;g.setFillColor(I);g.setStrokeColor(I);g.setStrokeWidth(2*r);I=1.5*r;B=5*r;var da=5*r;g.ellipse(u-B-I,C-da-I,2*I,2*I);g.fillAndStroke();g.ellipse(u+B-I,C-da-I,2*I,2*I);g.fillAndStroke();g.setStrokeWidth(1*r);g.setFillColor("#000000");"happy"==G?(G=u,I=C+2*r,g.begin(),g.moveTo(G+7.5*r,I),g.arcTo(7.5*r,7.5*r,0,1,1,G-7.5*r,I),g.lineTo(G-6.818*r,I),g.arcTo(6.818*r,6.818*r,0,1,0,G+6.818*r,I),g.close(),g.fillAndStroke()):"sad"==G?(G=u,I=C+ 7*r,g.begin(),g.moveTo(G-7.5*r,I),g.arcTo(7.5*r,7.5*r,0,1,1,G+7.5*r,I),g.lineTo(G+6.818*r,I),g.arcTo(6.818*r,6.818*r,0,1,0,G-6.818*r,I),g.close(),g.fillAndStroke()):(g.begin(),g.moveTo(u-5*r,C+7*r),g.lineTo(u+5*r,C+7*r),g.stroke())};mxCellRenderer.registerShape("smileyFace",A);mxUtils.extend(E,mxActor);E.prototype.size=30;E.prototype.isRoundable=function(){return!0};E.prototype.redrawPath=function(g,r,B,u,C){r=Math.max(0,Math.min(u,Math.min(C,parseFloat(mxUtils.getValue(this.style,"size",this.size))))); B=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,0),new mxPoint(u,0),new mxPoint(u,C),new mxPoint(0,C),new mxPoint(0,r)],this.isRounded,B,!0);g.end()};mxCellRenderer.registerShape("card",E);mxUtils.extend(K,mxActor);K.prototype.size=.4;K.prototype.redrawPath=function(g,r,B,u,C){r=C*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));g.moveTo(0,r/2);g.quadTo(u/4,1.4*r,u/2,r/2);g.quadTo(3*u/4,r*(1-1.4), u,r/2);g.lineTo(u,C-r/2);g.quadTo(3*u/4,C-1.4*r,u/2,C-r/2);g.quadTo(u/4,C-r*(1-1.4),0,C-r/2);g.lineTo(0,r/2);g.close();g.end()};K.prototype.getLabelBounds=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"size",this.size),B=g.width,u=g.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return r*=u,new mxRectangle(g.x,g.y+r,B,u-2*r);r*=B;return new mxRectangle(g.x+r,g.y,B-2*r,u)}return g}; mxCellRenderer.registerShape("tape",K);mxUtils.extend(Q,mxActor);Q.prototype.size=.3;Q.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*g.height):null};Q.prototype.redrawPath=function(g,r,B,u,C){r=C*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));g.moveTo(0,0);g.lineTo(u,0);g.lineTo(u,C-r/2);g.quadTo(3*u/4,C-1.4*r,u/2,C-r/2);g.quadTo(u/4,C-r*(1- 1.4),0,C-r/2);g.lineTo(0,r/2);g.close();g.end()};mxCellRenderer.registerShape("document",Q);var Y=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(g,r,B,u){var C=mxUtils.getValue(this.style,"size");return null!=C?u*Math.max(0,Math.min(1,C)):Y.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale, g.height*r),0,0)}return null};f.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"size",15);mxUtils.getValue(this.style,"lid",!0)||(r/=2);return new mxRectangle(0,Math.min(g.height*this.scale,2*r*this.scale),0,Math.max(0,.3*r*this.scale))}return null};q.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style, "labelInHeader",!1)){var B=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;r=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var u=mxUtils.getValue(this.style,"rounded",!1),C=mxUtils.getValue(this.style,"absoluteArcSize",!1),G=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));C||(G*=Math.min(g.width,g.height));G=Math.min(G,.5*g.width,.5*(g.height-r));u||(G=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(G,0,Math.min(g.width,g.width- B),Math.min(g.height,g.height-r)):new mxRectangle(Math.min(g.width,g.width-B),0,G,Math.min(g.height,g.height-r))}return new mxRectangle(0,Math.min(g.height,r),0,0)}return null};y.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};P.prototype.getLabelMargins=function(g){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var r=mxUtils.getValue(this.style,"size", 15);return new mxRectangle(0,Math.min(g.height*this.scale,r*this.scale),0,Math.max(0,r*this.scale))}return null};mxUtils.extend(W,mxActor);W.prototype.size=.2;W.prototype.fixedSize=20;W.prototype.isRoundable=function(){return!0};W.prototype.redrawPath=function(g,r,B,u,C){r="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))));B=mxUtils.getValue(this.style, mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,C),new mxPoint(r,0),new mxPoint(u,0),new mxPoint(u-r,C)],this.isRounded,B,!0);g.end()};mxCellRenderer.registerShape("parallelogram",W);mxUtils.extend(J,mxActor);J.prototype.size=.2;J.prototype.fixedSize=20;J.prototype.isRoundable=function(){return!0};J.prototype.redrawPath=function(g,r,B,u,C){r="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))));B=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,C),new mxPoint(r,0),new mxPoint(u-r,0),new mxPoint(u,C)],this.isRounded,B,!0)};mxCellRenderer.registerShape("trapezoid",J);mxUtils.extend(ea,mxActor);ea.prototype.size=.5;ea.prototype.redrawPath=function(g,r,B,u,C){g.setFillColor(null);r=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style, "size",this.size))));B=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(u,0),new mxPoint(r,0),new mxPoint(r,C/2),new mxPoint(0,C/2),new mxPoint(r,C/2),new mxPoint(r,C),new mxPoint(u,C)],this.isRounded,B,!1);g.end()};mxCellRenderer.registerShape("curlyBracket",ea);mxUtils.extend(X,mxActor);X.prototype.redrawPath=function(g,r,B,u,C){g.setStrokeWidth(1);g.setFillColor(this.stroke);r=u/5;g.rect(0,0,r,C);g.fillAndStroke();g.rect(2*r,0,r,C); g.fillAndStroke();g.rect(4*r,0,r,C);g.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",X);aa.prototype.moveTo=function(g,r){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r;this.firstX=g;this.firstY=r};aa.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)};aa.prototype.quadTo=function(g,r,B,u){this.originalQuadTo.apply(this.canvas, arguments);this.lastX=B;this.lastY=u};aa.prototype.curveTo=function(g,r,B,u,C,G){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=C;this.lastY=G};aa.prototype.arcTo=function(g,r,B,u,C,G,I){this.originalArcTo.apply(this.canvas,arguments);this.lastX=G;this.lastY=I};aa.prototype.lineTo=function(g,r){if(null!=this.lastX&&null!=this.lastY){var B=function(pa){return"number"===typeof pa?pa?0>pa?-1:1:pa===pa?0:NaN:NaN},u=Math.abs(g-this.lastX),C=Math.abs(r-this.lastY),G=Math.sqrt(u*u+C*C);if(2> G){this.originalLineTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r;return}var I=Math.round(G/10),da=this.defaultVariation;5>I&&(I=5,da/=3);var U=B(g-this.lastX)*u/I;B=B(r-this.lastY)*C/I;u/=G;C/=G;for(G=0;G<I;G++){var Aa=(Math.random()-.5)*da;this.originalLineTo.call(this.canvas,U*G+this.lastX-Aa*C,B*G+this.lastY-Aa*u)}this.originalLineTo.call(this.canvas,g,r)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=g;this.lastY=r};aa.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 ca=mxShape.prototype.beforePaint;mxShape.prototype.beforePaint=function(g){ca.apply(this,arguments);null==g.handJiggle&&(g.handJiggle=this.createHandJiggle(g))};var ma=mxShape.prototype.afterPaint;mxShape.prototype.afterPaint=function(g){ma.apply(this,arguments);null!=g.handJiggle&& (g.handJiggle.destroy(),delete g.handJiggle)};mxShape.prototype.createComicCanvas=function(g){return new aa(g,mxUtils.getValue(this.style,"jiggle",Editor.sketchDefaultJiggle))};mxShape.prototype.createHandJiggle=function(g){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(g)};var sa=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"))&&sa.apply(this,arguments)};var wa=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(g,r,B,u,C){if(null==g.handJiggle||g.handJiggle.constructor!=aa)wa.apply(this,arguments);else{var G=!0;null!=this.style&&(G="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(G||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)G|| null!=this.fill&&this.fill!=mxConstants.NONE||(g.pointerEvents=!1),g.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?G=Math.min(u/2,Math.min(C/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(G=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,G=Math.min(u*G,C*G)),g.moveTo(r+G,B),g.lineTo(r+u-G,B),g.quadTo(r+u,B,r+u,B+G),g.lineTo(r+u,B+C-G),g.quadTo(r+u,B+C,r+u-G, B+C),g.lineTo(r+G,B+C),g.quadTo(r,B+C,r,B+C-G),g.lineTo(r,B+G),g.quadTo(r,B,r+G,B)):(g.moveTo(r,B),g.lineTo(r+u,B),g.lineTo(r+u,B+C),g.lineTo(r,B+C),g.lineTo(r,B)),g.close(),g.end(),g.fillAndStroke()}};mxUtils.extend(ka,mxRectangleShape);ka.prototype.size=.1;ka.prototype.fixedSize=!1;ka.prototype.isHtmlAllowed=function(){return!1};ka.prototype.getLabelBounds=function(g){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST|| this.direction==mxConstants.DIRECTION_WEST)){var r=g.width,B=g.height;g=new mxRectangle(g.x,g.y,r,B);var u=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),C=parseFloat(mxUtils.getValue(this.style,"size",this.size));u?C=Math.max(0,Math.min(r,C*this.scale)):(C=r*Math.max(0,Math.min(1,C)),this.isRounded&&(u=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,C=Math.max(C,Math.min(r*u,B*u))));g.x+=Math.round(C);g.width-=Math.round(2*C);return g}return g}; ka.prototype.paintForeground=function(g,r,B,u,C){var G=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),I=parseFloat(mxUtils.getValue(this.style,"size",this.size));I=G?Math.max(0,Math.min(u,I)):u*Math.max(0,Math.min(1,I));this.isRounded&&(G=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,I=Math.max(I,Math.min(u*G,C*G)));I=Math.round(I);g.begin();g.moveTo(r+I,B);g.lineTo(r+I,B+C);g.moveTo(r+u-I,B);g.lineTo(r+u-I,B+C);g.end();g.stroke();mxRectangleShape.prototype.paintForeground.apply(this, arguments)};mxCellRenderer.registerShape("process",ka);mxCellRenderer.registerShape("process2",ka);mxUtils.extend(ja,mxRectangleShape);ja.prototype.paintBackground=function(g,r,B,u,C){g.setFillColor(mxConstants.NONE);g.rect(r,B,u,C);g.fill()};ja.prototype.paintForeground=function(g,r,B,u,C){};mxCellRenderer.registerShape("transparent",ja);mxUtils.extend(ua,mxHexagon);ua.prototype.size=30;ua.prototype.position=.5;ua.prototype.position2=.5;ua.prototype.base=20;ua.prototype.getLabelMargins=function(){return new mxRectangle(0, 0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};ua.prototype.isRoundable=function(){return!0};ua.prototype.redrawPath=function(g,r,B,u,C){r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;B=Math.max(0,Math.min(C,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var G=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),I=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2", this.position2)))),da=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(g,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,C-B),new mxPoint(Math.min(u,G+da),C-B),new mxPoint(I,C),new mxPoint(Math.max(0,G),C-B),new mxPoint(0,C-B)],this.isRounded,r,!0,[4])};mxCellRenderer.registerShape("callout",ua);mxUtils.extend(Ba,mxActor);Ba.prototype.tipX=-.25;Ba.prototype.tipY=1;Ba.prototype.base=20;Ba.prototype.maxTipOffset=100;Ba.prototype.isRoundable=function(){return!0}; Ba.prototype.getTipOffset=function(){var g=this.maxTipOffset,r=parseFloat(mxUtils.getValue(this.style,"tipX",this.tipX)),B=parseFloat(mxUtils.getValue(this.style,"tipY",this.tipY));return new mxPoint(Math.max(-g,Math.min(g,isFinite(r)?r:this.tipX)),Math.max(-g,Math.min(g,isFinite(B)?B:this.tipY)))};Ba.prototype.getTailPoints=function(g,r){var B=this.getTipOffset(),u=B.x*g;B=B.y*r;if(Math.abs(u)<=g/2&&Math.abs(B)<=r/2)return null;var C=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/ 2,G=parseFloat(mxUtils.getValue(this.style,"base",this.base));G=isFinite(G)?Math.max(0,G):this.base;C=this.isRounded?C:0;var I=new mxPoint(g/2+u,r/2+B);if(Math.abs(u)*r>=Math.abs(B)*g&&0!=u)return C=Math.min(C,r/2),G=Math.max(0,Math.min(G,r-2*C))/2,B=r/2+g/2*B/Math.abs(u),B=Math.max(C+G,Math.min(r-C-G,B)),0<u?{points:[new mxPoint(g,B-G),I,new mxPoint(g,B+G)],index:2}:{points:[new mxPoint(0,B+G),I,new mxPoint(0,B-G)],index:4};C=Math.min(C,g/2);G=Math.max(0,Math.min(G,g-2*C))/2;u=g/2+r/2*u/Math.abs(B); u=Math.max(C+G,Math.min(g-C-G,u));return 0<B?{points:[new mxPoint(u+G,r),I,new mxPoint(u-G,r)],index:3}:{points:[new mxPoint(u-G,0),I,new mxPoint(u+G,0)],index:1}};Ba.prototype.redrawPath=function(g,r,B,u,C){r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;B=[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,C),new mxPoint(0,C)];u=this.getTailPoints(u,C);C=null;null!=u&&(B.splice.apply(B,[u.index,0].concat(u.points)),C=[u.index,u.index+1,u.index+2]);this.addPoints(g, B,this.isRounded,r,!0,C)};Ba.prototype.getShapeBoundingBox=function(){var g=mxShape.prototype.getShapeBoundingBox.apply(this,arguments);if(null!=g&&null!=this.bounds){var r=this.createBoundingBox(),B=this.scale,u=r.width/B,C=r.height/B,G=this.getTailPoints(u,C);if(null!=G){var I=G.points[1],da=r.x+r.width/2;r=r.y+r.height/2;B=new mxRectangle(da+(I.x-u/2)*B*(this.flipH?-1:1),r+(I.y-C/2)*B*(this.flipV?-1:1),0,0);this.augmentBoundingBox(B);u=G.points[0].x-I.x;C=G.points[0].y-I.y;var U=G.points[2].x- I.x;G=G.points[2].y-I.y;I=Math.sqrt(u*u+C*C);var Aa=Math.sqrt(U*U+G*G);0<I&&0<Aa&&(G=Math.sqrt((1-Math.max(-1,Math.min(1,(u*U+C*G)/(I*Aa))))/2),B.grow(((0<G?Math.min(10,1/G):10)-1)*this.strokewidth*this.scale/2));G=this.getShapeRotation();0!=G&&(B=mxUtils.getBoundingBox(B,G,new mxPoint(da,r)));g.add(B)}}return g};mxCellRenderer.registerShape("wedgeCallout",Ba);mxUtils.extend(ia,mxActor);ia.prototype.size=.2;ia.prototype.fixedSize=20;ia.prototype.isRoundable=function(){return!0};ia.prototype.redrawPath= function(g,r,B,u,C){r="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))));B=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(u-r,0),new mxPoint(u,C/2),new mxPoint(u-r,C),new mxPoint(0,C),new mxPoint(r,C/2)],this.isRounded,B,!0);g.end()};mxCellRenderer.registerShape("step", ia);mxUtils.extend(l,mxHexagon);l.prototype.size=.25;l.prototype.fixedSize=20;l.prototype.isRoundable=function(){return!0};l.prototype.redrawPath=function(g,r,B,u,C){r="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))));B=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r, 0),new mxPoint(u-r,0),new mxPoint(u,.5*C),new mxPoint(u-r,C),new mxPoint(r,C),new mxPoint(0,.5*C)],this.isRounded,B,!0)};mxCellRenderer.registerShape("hexagon",l);mxUtils.extend(v,mxRectangleShape);v.prototype.isHtmlAllowed=function(){return!1};v.prototype.paintForeground=function(g,r,B,u,C){var G=Math.min(u/5,C/5)+1;g.begin();g.moveTo(r+u/2,B+G);g.lineTo(r+u/2,B+C-G);g.moveTo(r+G,B+C/2);g.lineTo(r+u-G,B+C/2);g.end();g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus", v);var xa=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(g){if(1==this.style["double"]){var r=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(g.x+r,g.y+r,g.width-2*r,g.height-2*r)}return g};mxRhombus.prototype.paintVertexShape=function(g,r,B,u,C){xa.apply(this,arguments);var G=r,I=B,da=u,U=C;if(!this.outline&&1==this.style["double"]){var Aa=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]|| 0);r+=Aa;B+=Aa;u-=2*Aa;C-=2*Aa;0<u&&0<C&&(g.setShadow(!1),xa.apply(this,[g,r,B,u,C]))}this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(g,G,I,da,U,0)};mxShape.prototype.paintGlassEffect=function(g,r,B,u,C,G){var I=Math.ceil(this.strokewidth/2);g.setGradient("#ffffff","#ffffff",r,B,u,.6*C,"south",.9,.1);g.begin();this.paintGlassEffectPath(g,r,B,u,C,I,G);g.close();g.fill()};mxShape.prototype.paintGlassEffectPath=function(g,r,B,u,C,G,I){I+=2*G;this.isRounded? (g.moveTo(r-G+I,B-G),g.quadTo(r-G,B-G,r-G,B-G+I),g.lineTo(r-G,B+.4*C),g.quadTo(r+.5*u,B+.7*C,r+u+G,B+.4*C),g.lineTo(r+u+G,B-G+I),g.quadTo(r+u+G,B-G,r+u+G-I,B-G)):(g.moveTo(r-G,B-G),g.lineTo(r-G,B+.4*C),g.quadTo(r+.5*u,B+.7*C,r+u+G,B+.4*C),g.lineTo(r+u+G,B-G))};mxEllipse.prototype.paintGlassEffectPath=function(g,r,B,u,C,G,I){I=u/2+G;G=C/2+G;r+=u/2;B+=C/2;g.moveTo(r-I,B);g.curveTo(r-I,B-.5522847498*G,r-.5522847498*I,B-G,r,B-G);g.curveTo(r+.5522847498*I,B-G,r+I,B-.5522847498*G,r+I,B);g.quadTo(r,B+.2* C,r-I,B)};mxRhombus.prototype.paintGlassEffectPath=function(g,r,B,u,C,G,I){G=u/2;I=C/2;var da=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,B+I),new mxPoint(r+G,B),new mxPoint(r+u,B+I)],this.isRounded,da,!1);g.quadTo(r+G,B+.7*C,r,B+I)};var Ma=mxEllipse.prototype.paintVertexShape;mxEllipse.prototype.paintVertexShape=function(g,r,B,u,C){Ma.apply(this,arguments);this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&& this.paintGlassEffect(g,r,B,u,C,0)};mxUtils.extend(H,mxRectangleShape);H.prototype.isHtmlAllowed=function(){return!1};H.prototype.getLabelBounds=function(g){if(1==this.style["double"]){var r=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(g.x+r,g.y+r,g.width-2*r,g.height-2*r)}return g};H.prototype.paintForeground=function(g,r,B,u,C){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var G=Math.max(2,this.strokewidth+ 1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);r+=G;B+=G;u-=2*G;C-=2*G;0<u&&0<C&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}g.setDashed(!1);G=0;do{var I=mxCellRenderer.defaultShapes[this.style["symbol"+G]];if(null!=I){var da=this.style["symbol"+G+"Align"],U=this.style["symbol"+G+"VerticalAlign"],Aa=this.style["symbol"+G+"Width"],pa=this.style["symbol"+G+"Height"],Ya=this.style["symbol"+G+"Spacing"]||0,ub=this.style["symbol"+G+"VSpacing"]||Ya,mb=this.style["symbol"+G+ "ArcSpacing"];null!=mb&&(mb*=this.getArcSize(u+this.strokewidth,C+this.strokewidth),Ya+=mb,ub+=mb);mb=r;var Qa=B;mb=da==mxConstants.ALIGN_CENTER?mb+(u-Aa)/2:da==mxConstants.ALIGN_RIGHT?mb+(u-Aa-Ya):mb+Ya;Qa=U==mxConstants.ALIGN_MIDDLE?Qa+(C-pa)/2:U==mxConstants.ALIGN_BOTTOM?Qa+(C-pa-ub):Qa+ub;g.save();da=new I;da.style=this.style;I.prototype.paintVertexShape.call(da,g,mb,Qa,Aa,pa);g.restore()}G++}while(null!=I)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext", H);mxUtils.extend(O,mxCylinder);O.prototype.redrawPath=function(g,r,B,u,C,G){G?(g.moveTo(0,0),g.lineTo(u/2,C/2),g.lineTo(u,0),g.end()):(g.moveTo(0,0),g.lineTo(u,0),g.lineTo(u,C),g.lineTo(0,C),g.close())};mxCellRenderer.registerShape("message",O);mxUtils.extend(S,mxShape);S.prototype.paintBackground=function(g,r,B,u,C){g.translate(r,B);g.ellipse(u/4,0,u/2,C/4);g.fillAndStroke();g.begin();g.moveTo(u/2,C/4);g.lineTo(u/2,2*C/3);g.moveTo(u/2,C/3);g.lineTo(0,C/3);g.moveTo(u/2,C/3);g.lineTo(u,C/3);g.moveTo(u/ 2,2*C/3);g.lineTo(0,C);g.moveTo(u/2,2*C/3);g.lineTo(u,C);g.end();g.stroke()};mxCellRenderer.registerShape("umlActor",S);mxUtils.extend(V,mxShape);V.prototype.getLabelMargins=function(g){return new mxRectangle(g.width/6,0,0,0)};V.prototype.paintBackground=function(g,r,B,u,C){g.translate(r,B);g.begin();g.moveTo(0,C/4);g.lineTo(0,3*C/4);g.end();g.stroke();g.begin();g.moveTo(0,C/2);g.lineTo(u/6,C/2);g.end();g.stroke();g.ellipse(u/6,0,5*u/6,C);g.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary", V);mxUtils.extend(Z,mxEllipse);Z.prototype.paintVertexShape=function(g,r,B,u,C){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.begin();g.moveTo(r+u/8,B+C);g.lineTo(r+7*u/8,B+C);g.end();g.stroke()};mxCellRenderer.registerShape("umlEntity",Z);mxUtils.extend(ba,mxShape);ba.prototype.paintVertexShape=function(g,r,B,u,C){g.translate(r,B);g.begin();g.moveTo(u,0);g.lineTo(0,C);g.moveTo(0,0);g.lineTo(u,C);g.end();g.stroke()};mxCellRenderer.registerShape("umlDestroy",ba);mxUtils.extend(ha,mxShape); ha.prototype.getLabelBounds=function(g){return new mxRectangle(g.x,g.y+g.height/8,g.width,7*g.height/8)};ha.prototype.paintBackground=function(g,r,B,u,C){g.translate(r,B);g.begin();g.moveTo(3*u/8,C/8*1.1);g.lineTo(5*u/8,0);g.end();g.stroke();g.ellipse(0,C/8,u,7*C/8);g.fillAndStroke()};ha.prototype.paintForeground=function(g,r,B,u,C){g.begin();g.moveTo(3*u/8,C/8*1.1);g.lineTo(5*u/8,C/4);g.end();g.stroke()};mxCellRenderer.registerShape("umlControl",ha);mxUtils.extend(oa,mxShape);oa.prototype.iconSize= 44;oa.prototype.paintBackground=function(g,r,B,u,C){C=Math.min(this.iconSize,u,C);var G=.9*C,I=.45*C;r=r+u/2-C/2;u=B+C/2;var da=r+.175*G;G=da-G;g.begin();g.moveTo(G,u-I/2);g.lineTo(G,u+I/2);g.end();g.stroke();g.begin();g.moveTo(G,u);g.lineTo(da,u);g.end();g.stroke();g.ellipse(r,B,C,C);g.fillAndStroke()};mxCellRenderer.registerShape("seqBoundary",oa);mxCellRenderer.registerShape("seqControl",na(ha,44));mxCellRenderer.registerShape("seqEntity",na(Z,44));mxUtils.extend(fa,mxShape);fa.prototype.paintBackground= function(g,r,B,u,C){var G=C/2,I=G/(2.5+C/50);g.save();g.translate(r,B);g.begin();g.moveTo(I,0);g.lineTo(u-I,0);g.arcTo(I,G,0,0,1,u-I,C);g.lineTo(I,C);g.arcTo(I,G,0,0,1,I,0);g.close();g.fillAndStroke();g.restore()};fa.prototype.paintForeground=function(g,r,B,u,C){var G=C/2,I=G/(2.5+C/50);g.save();g.translate(r,B);g.begin();g.moveTo(u-I,0);g.arcTo(I,G,0,0,0,u-I,C);g.stroke();g.restore()};mxCellRenderer.registerShape("seqQueue",fa);mxUtils.extend(qa,mxShape);qa.prototype.paintBackground=function(g,r, B,u,C){g.rect(r+6,B-6,u,C);g.fillAndStroke();g.rect(r,B,u,C);g.fillAndStroke()};mxCellRenderer.registerShape("seqCollections",qa);mxUtils.extend(ya,mxShape);ya.prototype.paintBackground=function(g,r,B,u,C){C=u/3;var G=u/3,I=C/2,da=I/(2.5+C/50);g.translate(r+(u-C)/2,B);g.begin();g.moveTo(0,da);g.arcTo(I,da,0,0,0,C,da);g.arcTo(I,da,0,0,0,0,da);g.lineTo(0,G-da);g.arcTo(I,da,0,0,0,C,G-da);g.lineTo(C,da);g.fillAndStroke()};mxCellRenderer.registerShape("seqDatabase",ya);mxUtils.extend(ta,mxShape);ta.prototype.paintBackground= function(g,r,B,u,C){r+=u/2;B+=15;u=B+15;C=u+20;var G=u+10,I=C+15;g.ellipse(r-15,B-15,30,30);g.fillAndStroke();g.begin();g.moveTo(r,u);g.lineTo(r,C);g.moveTo(r-18,G);g.lineTo(r+18,G);g.moveTo(r,C);g.lineTo(r-16,I);g.moveTo(r,C);g.lineTo(r+16,I);g.stroke()};mxCellRenderer.registerShape("seqActorStick",ta);mxUtils.extend(Ca,mxRectangleShape);Ca.prototype.size=40;Ca.prototype.isHtmlAllowed=function(){return!1};Ca.prototype.isMirrored=function(){return"1"==mxUtils.getValue(this.style,"lifelineMirror", "0")};Ca.prototype.getHeadSize=function(g){return Math.max(0,Math.min(this.isMirrored()?g/2:g,parseFloat(mxUtils.getValue(this.style,"size",this.size))))};Ca.prototype.getLabelBounds=function(g){var r=Math.max(0,Math.min(this.isMirrored()?g.height/2:g.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(g.x,g.y,g.width,r)};Ca.prototype.paintBackground=function(g,r,B,u,C){var G=this.getHeadSize(C),I=this.isMirrored(),da=mxUtils.getValue(this.style,"participant"); null==da||null==this.state?(mxRectangleShape.prototype.paintBackground.call(this,g,r,B,u,G),I&&mxRectangleShape.prototype.paintBackground.call(this,g,r,B+C-G,u,G)):(da=this.state.view.graph.cellRenderer.getShape(da),null!=da&&da!=Ca&&(da=new da,da.apply(this.state),g.save(),da.paintVertexShape(g,r,B,u,G),g.restore(),I&&(g.save(),da.paintVertexShape(g,r,B+C-G,u,G),g.restore())));C=I?C-G:C;G<C&&(g.setDashed("1"==mxUtils.getValue(this.style,"lifelineDashed","1")),g.begin(),g.moveTo(r+u/2,B+G),g.lineTo(r+ u/2,B+C),g.end(),g.stroke())};Ca.prototype.paintForeground=function(g,r,B,u,C){var G=mxUtils.getValue(this.style,"participant"),I=this.getHeadSize(C),da=this.isMirrored();null==G&&(mxRectangleShape.prototype.paintForeground.call(this,g,r,B,u,Math.min(C,I)),da&&mxRectangleShape.prototype.paintForeground.call(this,g,r,B+C-I,u,I));da&&this.paintMirrorLabel(g,r,B+C-I,u,I)};Ca.prototype.paintMirrorLabel=function(g,r,B,u,C){var G=null!=this.state?this.state.view.graph.getLabel(this.state.cell):null;this.mirrorLabelValue= G;if(null!=G&&""!=G){g.setFontColor(mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,"black"));g.setFontBackgroundColor(mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null));g.setFontBorderColor(mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null));g.setFontFamily(mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY));g.setFontSize(parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE))); g.setFontStyle(parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,0)));var I=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),da=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),U=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,2)),Aa=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,0))+U,pa=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,0))+U,Ya=parseFloat(mxUtils.getValue(this.style, mxConstants.STYLE_SPACING_LEFT,0))+U;U=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,0))+U;r=I==mxConstants.ALIGN_LEFT?r+Ya:I==mxConstants.ALIGN_RIGHT?r+u-U:r+u/2;B=da==mxConstants.ALIGN_TOP?B+Aa+1:da==mxConstants.ALIGN_BOTTOM?B+C-pa-1:B+C/2;C="wrap"==mxUtils.getValue(this.style,mxConstants.STYLE_WHITE_SPACE,null);Aa="1"==mxUtils.getValue(this.style,"html","0")?"html":"";"html"==Aa&&(G=Graph.sanitizeHtml(G));g.text(r,B,C?u-Ya-U:0,0,G,I,da,C,Aa,null,!1,0,null)}};mxCellRenderer.registerShape("umlLifeline", Ca);var Xa=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(g,r){return Xa.apply(this,arguments)||void 0!==r.mirrorLabelValue&&r.mirrorLabelValue!=g.view.graph.getLabel(g.cell)};mxUtils.extend(la,mxShape);la.prototype.width=60;la.prototype.height=30;la.prototype.corner=10;la.prototype.configurePointerEvents=function(g){var r=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);null==this.style||null!=r&&r!=mxConstants.NONE&&0!= this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(g.pointerEvents=!1)};la.prototype.getLabelMargins=function(g){return new mxRectangle(0,0,g.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),g.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};la.prototype.paintBackground=function(g,r,B,u,C){var G=this.corner,I=Math.min(u,Math.max(G,parseFloat(mxUtils.getValue(this.style,"width",this.width)))), da=Math.min(C,Math.max(1.5*G,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),U=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);U!=mxConstants.NONE&&(g.setFillColor(U),g.rect(r,B,u,C),g.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(g,r,B,u,C),g.setGradient(this.fill,this.gradient,r,B,u,C,this.gradientDirection)):g.setFillColor(this.fill);g.pointerEvents=!0;g.begin();g.moveTo(r, B);g.lineTo(r+I,B);g.lineTo(r+I,B+Math.max(0,da-1.5*G));g.lineTo(r+Math.max(0,I-G),B+da);g.lineTo(r,B+da);g.close();g.fillAndStroke();this.configurePointerEvents(g);g.begin();g.moveTo(r+I,B);g.lineTo(r+u,B);g.lineTo(r+u,B+C);g.lineTo(r,B+C);g.lineTo(r,B+da);g.stroke()};mxCellRenderer.registerShape("umlFrame",la);mxPerimeter.CenterPerimeter=function(g,r,B,u){return new mxPoint(g.getCenterX(),g.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);mxPerimeter.LifelinePerimeter= function(g,r,B,u){u=Ca.prototype.size;var C=g.y+g.height;null!=r&&(u=mxUtils.getValue(r.style,"size",u)*r.view.scale,"1"==mxUtils.getValue(r.style,"lifelineMirror","0")&&(C-=u));r=parseFloat(r.style[mxConstants.STYLE_STROKEWIDTH]||1)*r.view.scale/2-1;B.x<g.getCenterX()&&(r=-1*(r+1));return new mxPoint(g.getCenterX()+r,Math.min(C,Math.max(g.y+u,B.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(g,r,B,u){u=!0;return mxPerimeter.RectanglePerimeter.apply(this, arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(g,r,B,u){u=parseFloat(r.style[mxConstants.STYLE_STROKEWIDTH]||1)*r.view.scale/2-1;null!=r.style.backboneSize&&(u+=parseFloat(r.style.backboneSize)*r.view.scale/2-1);if("south"==r.style[mxConstants.STYLE_DIRECTION]||"north"==r.style[mxConstants.STYLE_DIRECTION])return B.x<g.getCenterX()&&(u=-1*(u+1)),new mxPoint(g.getCenterX()+u,Math.min(g.y+g.height,Math.max(g.y,B.y))); B.y<g.getCenterY()&&(u=-1*(u+1));return new mxPoint(Math.min(g.x+g.width,Math.max(g.x,B.x)),g.getCenterY()+u)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(g,r,B,u){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(g,new mxRectangle(0,0,0,Math.max(0,Math.min(g.height,parseFloat(mxUtils.getValue(r.style,"size",ua.prototype.size))*r.view.scale))),r.style),r,B,u)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter); mxPerimeter.ParallelogramPerimeter=function(g,r,B,u){var C="0"!=mxUtils.getValue(r.style,"fixedSize","0"),G=C?W.prototype.fixedSize:W.prototype.size;null!=r&&(G=mxUtils.getValue(r.style,"size",G));C&&(G*=r.view.scale);var I=g.x,da=g.y,U=g.width,Aa=g.height;r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH?(C=C?Math.max(0,Math.min(Aa,G)):Aa*Math.max(0,Math.min(1,G)),da= [new mxPoint(I,da),new mxPoint(I+U,da+C),new mxPoint(I+U,da+Aa),new mxPoint(I,da+Aa-C),new mxPoint(I,da)]):(C=C?Math.max(0,Math.min(.5*U,G)):U*Math.max(0,Math.min(1,G)),da=[new mxPoint(I+C,da),new mxPoint(I+U,da),new mxPoint(I+U-C,da+Aa),new mxPoint(I,da+Aa),new mxPoint(I+C,da)]);Aa=g.getCenterX();g=g.getCenterY();g=new mxPoint(Aa,g);u&&(B.x<I||B.x>I+U?g.y=B.y:g.x=B.x);return mxUtils.getPerimeterPoint(da,g,B)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter= function(g,r,B,u){var C="0"!=mxUtils.getValue(r.style,"fixedSize","0"),G=C?J.prototype.fixedSize:J.prototype.size;null!=r&&(G=mxUtils.getValue(r.style,"size",G));C&&(G*=r.view.scale);var I=g.x,da=g.y,U=g.width,Aa=g.height;r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_EAST?(C=C?Math.max(0,Math.min(.5*U,G)):U*Math.max(0,Math.min(1,G)),da=[new mxPoint(I+C,da),new mxPoint(I+U-C,da),new mxPoint(I+U,da+Aa), new mxPoint(I,da+Aa),new mxPoint(I+C,da)]):r==mxConstants.DIRECTION_WEST?(C=C?Math.max(0,Math.min(U,G)):U*Math.max(0,Math.min(1,G)),da=[new mxPoint(I,da),new mxPoint(I+U,da),new mxPoint(I+U-C,da+Aa),new mxPoint(I+C,da+Aa),new mxPoint(I,da)]):r==mxConstants.DIRECTION_NORTH?(C=C?Math.max(0,Math.min(Aa,G)):Aa*Math.max(0,Math.min(1,G)),da=[new mxPoint(I,da+C),new mxPoint(I+U,da),new mxPoint(I+U,da+Aa),new mxPoint(I,da+Aa-C),new mxPoint(I,da+C)]):(C=C?Math.max(0,Math.min(Aa,G)):Aa*Math.max(0,Math.min(1, G)),da=[new mxPoint(I,da),new mxPoint(I+U,da+C),new mxPoint(I+U,da+Aa-C),new mxPoint(I,da+Aa),new mxPoint(I,da)]);Aa=g.getCenterX();g=g.getCenterY();g=new mxPoint(Aa,g);u&&(B.x<I||B.x>I+U?g.y=B.y:g.x=B.x);return mxUtils.getPerimeterPoint(da,g,B)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(g,r,B,u){var C="0"!=mxUtils.getValue(r.style,"fixedSize","0"),G=C?ia.prototype.fixedSize:ia.prototype.size;null!=r&&(G=mxUtils.getValue(r.style, "size",G));C&&(G*=r.view.scale);var I=g.x,da=g.y,U=g.width,Aa=g.height,pa=g.getCenterX();g=g.getCenterY();r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_EAST?(C=C?Math.max(0,Math.min(U,G)):U*Math.max(0,Math.min(1,G)),da=[new mxPoint(I,da),new mxPoint(I+U-C,da),new mxPoint(I+U,g),new mxPoint(I+U-C,da+Aa),new mxPoint(I,da+Aa),new mxPoint(I+C,g),new mxPoint(I,da)]):r==mxConstants.DIRECTION_WEST?(C=C?Math.max(0, Math.min(U,G)):U*Math.max(0,Math.min(1,G)),da=[new mxPoint(I+C,da),new mxPoint(I+U,da),new mxPoint(I+U-C,g),new mxPoint(I+U,da+Aa),new mxPoint(I+C,da+Aa),new mxPoint(I,g),new mxPoint(I+C,da)]):r==mxConstants.DIRECTION_NORTH?(C=C?Math.max(0,Math.min(Aa,G)):Aa*Math.max(0,Math.min(1,G)),da=[new mxPoint(I,da+C),new mxPoint(pa,da),new mxPoint(I+U,da+C),new mxPoint(I+U,da+Aa),new mxPoint(pa,da+Aa-C),new mxPoint(I,da+Aa),new mxPoint(I,da+C)]):(C=C?Math.max(0,Math.min(Aa,G)):Aa*Math.max(0,Math.min(1,G)), da=[new mxPoint(I,da),new mxPoint(pa,da+C),new mxPoint(I+U,da),new mxPoint(I+U,da+Aa-C),new mxPoint(pa,da+Aa),new mxPoint(I,da+Aa-C),new mxPoint(I,da)]);pa=new mxPoint(pa,g);u&&(B.x<I||B.x>I+U?pa.y=B.y:pa.x=B.x);return mxUtils.getPerimeterPoint(da,pa,B)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(g,r,B,u){var C="0"!=mxUtils.getValue(r.style,"fixedSize","0"),G=C?l.prototype.fixedSize:l.prototype.size;null!=r&&(G=mxUtils.getValue(r.style, "size",G));C&&(G*=r.view.scale);var I=g.x,da=g.y,U=g.width,Aa=g.height,pa=g.getCenterX();g=g.getCenterY();r=null!=r?mxUtils.getValue(r.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH?(C=C?Math.max(0,Math.min(Aa,G)):Aa*Math.max(0,Math.min(1,G)),da=[new mxPoint(pa,da),new mxPoint(I+U,da+C),new mxPoint(I+U,da+Aa-C),new mxPoint(pa,da+Aa),new mxPoint(I,da+Aa-C),new mxPoint(I,da+C),new mxPoint(pa,da)]): (C=C?Math.max(0,Math.min(U,G)):U*Math.max(0,Math.min(1,G)),da=[new mxPoint(I+C,da),new mxPoint(I+U-C,da),new mxPoint(I+U,g),new mxPoint(I+U-C,da+Aa),new mxPoint(I+C,da+Aa),new mxPoint(I,g),new mxPoint(I+C,da)]);pa=new mxPoint(pa,g);u&&(B.x<I||B.x>I+U?pa.y=B.y:pa.x=B.x);return mxUtils.getPerimeterPoint(da,pa,B)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(ra,mxShape);ra.prototype.size=10;ra.prototype.paintBackground=function(g,r,B,u,C){var G=parseFloat(mxUtils.getValue(this.style, "size",this.size));g.translate(r,B);g.ellipse((u-G)/2,0,G,G);g.fillAndStroke();g.begin();g.moveTo(u/2,G);g.lineTo(u/2,C);g.end();g.stroke()};mxCellRenderer.registerShape("lollipop",ra);mxUtils.extend(va,mxShape);va.prototype.size=10;va.prototype.inset=2;va.prototype.paintBackground=function(g,r,B,u,C){var G=parseFloat(mxUtils.getValue(this.style,"size",this.size)),I=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;g.translate(r,B);g.begin();g.moveTo(u/2,G+I);g.lineTo(u/ 2,C);g.end();g.stroke();g.begin();g.moveTo((u-G)/2-I,G/2);g.quadTo((u-G)/2-I,G+I,u/2,G+I);g.quadTo((u+G)/2+I,G+I,(u+G)/2+I,G/2);g.end();g.stroke()};mxCellRenderer.registerShape("requires",va);mxUtils.extend(Ia,mxShape);Ia.prototype.paintBackground=function(g,r,B,u,C){g.translate(r,B);g.begin();g.moveTo(0,0);g.quadTo(u,0,u,C/2);g.quadTo(u,C,0,C);g.end();g.stroke()};mxCellRenderer.registerShape("requiredInterface",Ia);mxUtils.extend(La,mxShape);La.prototype.inset=2;La.prototype.paintBackground=function(g, r,B,u,C){var G=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;g.translate(r,B);g.ellipse(0,G,u-2*G,C-2*G);g.fillAndStroke();g.begin();g.moveTo(u/2,0);g.quadTo(u,0,u,C/2);g.quadTo(u,C,u/2,C);g.end();g.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",La);mxUtils.extend(Ga,mxCylinder);Ga.prototype.jettyWidth=20;Ga.prototype.jettyHeight=10;Ga.prototype.redrawPath=function(g,r,B,u,C,G){var I=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth)); r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));B=I/2;I=B+I/2;var da=Math.min(r,C-r),U=Math.min(da+2*r,C-r);G?(g.moveTo(B,da),g.lineTo(I,da),g.lineTo(I,da+r),g.lineTo(B,da+r),g.moveTo(B,U),g.lineTo(I,U),g.lineTo(I,U+r),g.lineTo(B,U+r)):(g.moveTo(B,0),g.lineTo(u,0),g.lineTo(u,C),g.lineTo(B,C),g.lineTo(B,U+r),g.lineTo(0,U+r),g.lineTo(0,U),g.lineTo(B,U),g.lineTo(B,da+r),g.lineTo(0,da+r),g.lineTo(0,da),g.lineTo(B,da),g.close());g.end()};mxCellRenderer.registerShape("module", Ga);mxUtils.extend(Da,mxCylinder);Da.prototype.jettyWidth=32;Da.prototype.jettyHeight=12;Da.prototype.redrawPath=function(g,r,B,u,C,G){var I=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));B=I/2;I=B+I/2;var da=.3*C-r/2,U=.7*C-r/2;G?(g.moveTo(B,da),g.lineTo(I,da),g.lineTo(I,da+r),g.lineTo(B,da+r),g.moveTo(B,U),g.lineTo(I,U),g.lineTo(I,U+r),g.lineTo(B,U+r)):(g.moveTo(B,0),g.lineTo(u,0),g.lineTo(u,C),g.lineTo(B, C),g.lineTo(B,U+r),g.lineTo(0,U+r),g.lineTo(0,U),g.lineTo(B,U),g.lineTo(B,da+r),g.lineTo(0,da+r),g.lineTo(0,da),g.lineTo(B,da),g.close());g.end()};mxCellRenderer.registerShape("component",Da);mxUtils.extend(Pa,mxRectangleShape);Pa.prototype.paintForeground=function(g,r,B,u,C){var G=u/2,I=C/2,da=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;g.begin();this.addPoints(g,[new mxPoint(r+G,B),new mxPoint(r+u,B+I),new mxPoint(r+G,B+C),new mxPoint(r,B+I)],this.isRounded, da,!0);g.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",Pa);mxUtils.extend(Ka,mxDoubleEllipse);Ka.prototype.outerStroke=!0;Ka.prototype.paintVertexShape=function(g,r,B,u,C){var G=Math.min(4,Math.min(u/5,C/5));0<u&&0<C&&(g.ellipse(r+G,B+G,u-2*G,C-2*G),g.fillAndStroke());g.setShadow(!1);this.outerStroke&&(g.ellipse(r,B,u,C),g.stroke())};mxCellRenderer.registerShape("endState",Ka);mxUtils.extend(Na,Ka);Na.prototype.outerStroke= !1;mxCellRenderer.registerShape("startState",Na);mxUtils.extend(Oa,mxArrowConnector);Oa.prototype.defaultWidth=4;Oa.prototype.isOpenEnded=function(){return!0};Oa.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};Oa.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",Oa);mxUtils.extend(Fa,mxArrowConnector);Fa.prototype.defaultWidth=10;Fa.prototype.defaultArrowWidth=20;Fa.prototype.getStartArrowWidth= function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};Fa.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};Fa.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",Fa);mxUtils.extend(za,mxActor);za.prototype.size=30;za.prototype.isRoundable=function(){return!0}; za.prototype.getLabelMargins=function(g){return mxUtils.getValue(this.style,"boundedLbl",!1)?(g=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(0,g,0,0)):null};za.prototype.redrawPath=function(g,r,B,u,C){r=Math.min(C,parseFloat(mxUtils.getValue(this.style,"size",this.size)));B=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,C),new mxPoint(0,r),new mxPoint(u,0),new mxPoint(u,C)],this.isRounded,B, !0);g.end()};mxCellRenderer.registerShape("manualInput",za);mxUtils.extend(Ja,mxRectangleShape);Ja.prototype.dx=20;Ja.prototype.dy=20;Ja.prototype.isHtmlAllowed=function(){return!1};Ja.prototype.paintForeground=function(g,r,B,u,C){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var G=0;if(this.isRounded){var I=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;G=Math.max(G,Math.min(u*I,C*I))}I=Math.max(G,Math.min(u,parseFloat(mxUtils.getValue(this.style, "dx",this.dx))));G=Math.max(G,Math.min(C,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.begin();g.moveTo(r,B+G);g.lineTo(r+u,B+G);g.end();g.stroke();g.begin();g.moveTo(r+I,B);g.lineTo(r+I,B+C);g.end();g.stroke()};mxCellRenderer.registerShape("internalStorage",Ja);mxUtils.extend(Ha,mxActor);Ha.prototype.dx=20;Ha.prototype.dy=20;Ha.prototype.isRoundable=function(){return!0};Ha.prototype.redrawPath=function(g,r,B,u,C){r=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))); B=Math.max(0,Math.min(C,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var G=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,B),new mxPoint(r,B),new mxPoint(r,C),new mxPoint(0,C)],this.isRounded,G,!0);g.end()};mxCellRenderer.registerShape("corner",Ha);mxUtils.extend(Sa,mxActor);Sa.prototype.redrawPath=function(g,r,B,u,C){g.moveTo(0, 0);g.lineTo(0,C);g.end();g.moveTo(u,0);g.lineTo(u,C);g.end();g.moveTo(0,C/2);g.lineTo(u,C/2);g.end()};mxCellRenderer.registerShape("crossbar",Sa);mxUtils.extend(ab,mxActor);ab.prototype.dx=20;ab.prototype.dy=20;ab.prototype.isRoundable=function(){return!0};ab.prototype.redrawPath=function(g,r,B,u,C){r=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));B=Math.max(0,Math.min(C,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size", this.size));var G=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,B),new mxPoint((u+r)/2,B),new mxPoint((u+r)/2,C),new mxPoint((u-r)/2,C),new mxPoint((u-r)/2,B),new mxPoint(0,B)],this.isRounded,G,!0);g.end()};mxCellRenderer.registerShape("tee",ab);mxUtils.extend(Va,mxActor);Va.prototype.arrowWidth=.3;Va.prototype.arrowSize=.2;Va.prototype.isRoundable=function(){return!0};Va.prototype.redrawPath=function(g, r,B,u,C){var G=C*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));r=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));B=(C-G)/2;G=B+G;var I=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,B),new mxPoint(u-r,B),new mxPoint(u-r,0),new mxPoint(u,C/2),new mxPoint(u-r,C),new mxPoint(u-r,G),new mxPoint(0,G)],this.isRounded,I,!0);g.end()};mxCellRenderer.registerShape("singleArrow", Va);mxUtils.extend(db,mxActor);db.prototype.isRoundable=function(){return!0};db.prototype.redrawPath=function(g,r,B,u,C){var G=C*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Va.prototype.arrowWidth))));r=u*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Va.prototype.arrowSize))));B=(C-G)/2;G=B+G;var I=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,C/2),new mxPoint(r,0),new mxPoint(r, B),new mxPoint(u-r,B),new mxPoint(u-r,0),new mxPoint(u,C/2),new mxPoint(u-r,C),new mxPoint(u-r,G),new mxPoint(r,G),new mxPoint(r,C)],this.isRounded,I,!0);g.end()};mxCellRenderer.registerShape("doubleArrow",db);mxUtils.extend(Ea,mxActor);Ea.prototype.size=.1;Ea.prototype.fixedSize=20;Ea.prototype.redrawPath=function(g,r,B,u,C){r="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))));g.moveTo(r,0);g.lineTo(u,0);g.quadTo(u-2*r,C/2,u,C);g.lineTo(r,C);g.quadTo(r-2*r,C/2,r,0);g.close();g.end()};mxCellRenderer.registerShape("dataStorage",Ea);mxUtils.extend(Za,mxActor);Za.prototype.redrawPath=function(g,r,B,u,C){g.moveTo(0,0);g.quadTo(u,0,u,C/2);g.quadTo(u,C,0,C);g.close();g.end()};mxCellRenderer.registerShape("or",Za);mxUtils.extend(cb,mxActor);cb.prototype.redrawPath=function(g,r,B,u,C){g.moveTo(0,0);g.quadTo(u,0,u,C/2);g.quadTo(u,C,0,C);g.quadTo(u/2,C/2,0,0); g.close();g.end()};mxCellRenderer.registerShape("xor",cb);mxUtils.extend($a,mxActor);$a.prototype.size=20;$a.prototype.isRoundable=function(){return!0};$a.prototype.redrawPath=function(g,r,B,u,C){r=Math.min(u/2,Math.min(C,parseFloat(mxUtils.getValue(this.style,"size",this.size))));B=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(r,0),new mxPoint(u-r,0),new mxPoint(u,.8*r),new mxPoint(u,C),new mxPoint(0,C),new mxPoint(0,.8*r)],this.isRounded, B,!0);g.end()};mxCellRenderer.registerShape("loopLimit",$a);mxUtils.extend(gb,mxActor);gb.prototype.size=.375;gb.prototype.isRoundable=function(){return!0};gb.prototype.redrawPath=function(g,r,B,u,C){r=C*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));B=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(g,[new mxPoint(0,0),new mxPoint(u,0),new mxPoint(u,C-r),new mxPoint(u/2,C),new mxPoint(0,C-r)],this.isRounded,B,!0); g.end()};mxCellRenderer.registerShape("offPageConnector",gb);mxUtils.extend(ob,mxEllipse);ob.prototype.paintVertexShape=function(g,r,B,u,C){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.begin();g.moveTo(r+u/2,B+C);g.lineTo(r+u,B+C);g.end();g.stroke()};mxCellRenderer.registerShape("tapeData",ob);mxUtils.extend(vb,mxEllipse);vb.prototype.paintVertexShape=function(g,r,B,u,C){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r,B+C/2);g.lineTo(r+ u,B+C/2);g.end();g.stroke();g.begin();g.moveTo(r+u/2,B);g.lineTo(r+u/2,B+C);g.end();g.stroke()};mxCellRenderer.registerShape("orEllipse",vb);mxUtils.extend(rb,mxEllipse);rb.prototype.paintVertexShape=function(g,r,B,u,C){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r+.145*u,B+.145*C);g.lineTo(r+.855*u,B+.855*C);g.end();g.stroke();g.begin();g.moveTo(r+.855*u,B+.145*C);g.lineTo(r+.145*u,B+.855*C);g.end();g.stroke()};mxCellRenderer.registerShape("sumEllipse", rb);mxUtils.extend(wb,mxRhombus);wb.prototype.paintVertexShape=function(g,r,B,u,C){mxRhombus.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();g.moveTo(r,B+C/2);g.lineTo(r+u,B+C/2);g.end();g.stroke()};mxCellRenderer.registerShape("sortShape",wb);mxUtils.extend(Ib,mxEllipse);Ib.prototype.paintVertexShape=function(g,r,B,u,C){g.begin();g.moveTo(r,B);g.lineTo(r+u,B);g.lineTo(r+u/2,B+C/2);g.close();g.fillAndStroke();g.begin();g.moveTo(r,B+C);g.lineTo(r+u,B+C);g.lineTo(r+u/2,B+ C/2);g.close();g.fillAndStroke()};mxCellRenderer.registerShape("collate",Ib);mxUtils.extend(Fb,mxEllipse);Fb.prototype.paintVertexShape=function(g,r,B,u,C){var G=g.state.strokeWidth/2,I=10+2*G,da=B+C-I/2;g.begin();g.moveTo(r,B);g.lineTo(r,B+C);g.moveTo(r+G,da);g.lineTo(r+G+I,da-I/2);g.moveTo(r+G,da);g.lineTo(r+G+I,da+I/2);g.moveTo(r+G,da);g.lineTo(r+u-G,da);g.moveTo(r+u,B);g.lineTo(r+u,B+C);g.moveTo(r+u-G,da);g.lineTo(r+u-I-G,da-I/2);g.moveTo(r+u-G,da);g.lineTo(r+u-I-G,da+I/2);g.end();g.stroke()}; mxCellRenderer.registerShape("dimension",Fb);mxUtils.extend(Ub,mxEllipse);Ub.prototype.drawHidden=!0;Ub.prototype.paintVertexShape=function(g,r,B,u,C){this.outline||g.setStrokeColor(null);if(null!=this.style){var G=g.pointerEvents,I=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||I||(g.pointerEvents=!1);var da="1"==mxUtils.getValue(this.style,"top","1"),U="1"==mxUtils.getValue(this.style,"left","1"),Aa="1"==mxUtils.getValue(this.style, "right","1"),pa="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||I||this.outline||da||Aa||pa||U?(g.rect(r,B,u,C),g.fill(),g.pointerEvents=G,g.setStrokeColor(this.stroke),g.setLineCap("square"),g.begin(),g.moveTo(r,B),this.outline||da?g.lineTo(r+u,B):g.moveTo(r+u,B),this.outline||Aa?g.lineTo(r+u,B+C):g.moveTo(r+u,B+C),this.outline||pa?g.lineTo(r,B+C):g.moveTo(r,B+C),(this.outline||U)&&g.lineTo(r,B),g.end(),g.stroke(),g.setLineCap("flat")):g.setStrokeColor(this.stroke)}null==this.state|| this.outline||null==this.fill||this.fill==mxConstants.NONE||(G=this.state.view.graph,null!=G.paintTableCellLines&&G.paintTableCellLines(g,this.state.cell,r,B,u,C,this.stroke,this.strokewidth))};mxCellRenderer.registerShape("partialRectangle",Ub);mxUtils.extend(Rb,mxEllipse);Rb.prototype.paintVertexShape=function(g,r,B,u,C){mxEllipse.prototype.paintVertexShape.apply(this,arguments);g.setShadow(!1);g.begin();"vertical"==mxUtils.getValue(this.style,"line")?(g.moveTo(r+u/2,B),g.lineTo(r+u/2,B+C)):(g.moveTo(r, B+C/2),g.lineTo(r+u,B+C/2));g.end();g.stroke()};mxCellRenderer.registerShape("lineEllipse",Rb);mxUtils.extend(ac,mxActor);ac.prototype.redrawPath=function(g,r,B,u,C){r=Math.min(u,C/2);g.moveTo(0,0);g.lineTo(u-r,0);g.quadTo(u,0,u,C/2);g.quadTo(u,C,u-r,C);g.lineTo(0,C);g.close();g.end()};mxCellRenderer.registerShape("delay",ac);mxUtils.extend(Mb,mxActor);Mb.prototype.size=.2;Mb.prototype.redrawPath=function(g,r,B,u,C){r=Math.min(C,u);var G=Math.max(0,Math.min(r,r*parseFloat(mxUtils.getValue(this.style, "size",this.size))));r=(C-G)/2;B=r+G;var I=(u-G)/2;G=I+G;g.moveTo(0,r);g.lineTo(I,r);g.lineTo(I,0);g.lineTo(G,0);g.lineTo(G,r);g.lineTo(u,r);g.lineTo(u,B);g.lineTo(G,B);g.lineTo(G,C);g.lineTo(I,C);g.lineTo(I,B);g.lineTo(0,B);g.close();g.end()};mxCellRenderer.registerShape("cross",Mb);mxUtils.extend(Xb,mxActor);Xb.prototype.size=.25;Xb.prototype.redrawPath=function(g,r,B,u,C){r=Math.min(u,C/2);B=Math.min(u-r,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*u);g.moveTo(0,C/2);g.lineTo(B, 0);g.lineTo(u-r,0);g.quadTo(u,0,u,C/2);g.quadTo(u,C,u-r,C);g.lineTo(B,C);g.close();g.end()};mxCellRenderer.registerShape("display",Xb);mxUtils.extend(yb,mxActor);yb.prototype.cst={RECT2:"mxgraph.basic.rect"};yb.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"}]}];yb.prototype.paintVertexShape=function(g,r,B,u,C){g.translate(r,B);this.strictDrawShape(g,0,0,u,C)};yb.prototype.strictDrawShape=function(g,r,B,u,C,G){var I=G&&G.rectStyle?G.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),da=G&&G.absoluteCornerSize?G.absoluteCornerSize:mxUtils.getValue(this.style,"absoluteCornerSize",this.absoluteCornerSize),U=G&&G.size?G.size:Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),Aa=G&&G.rectOutline? G.rectOutline:mxUtils.getValue(this.style,"rectOutline",this.rectOutline),pa=G&&G.indent?G.indent:Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"indent",this.indent)))),Ya=G&&G.dashed?G.dashed:mxUtils.getValue(this.style,"dashed",!1),ub=G&&G.dashPattern?G.dashPattern:mxUtils.getValue(this.style,"dashPattern",null),mb=G&&G.relIndent?G.relIndent:Math.max(0,Math.min(50,pa)),Qa=G&&G.top?G.top:mxUtils.getValue(this.style,"top",!0),Ua=G&&G.right?G.right:mxUtils.getValue(this.style,"right", !0),Wa=G&&G.bottom?G.bottom:mxUtils.getValue(this.style,"bottom",!0),Ra=G&&G.left?G.left:mxUtils.getValue(this.style,"left",!0),fb=G&&G.topLeftStyle?G.topLeftStyle:mxUtils.getValue(this.style,"topLeftStyle","default"),jb=G&&G.topRightStyle?G.topRightStyle:mxUtils.getValue(this.style,"topRightStyle","default"),lb=G&&G.bottomRightStyle?G.bottomRightStyle:mxUtils.getValue(this.style,"bottomRightStyle","default"),pb=G&&G.bottomLeftStyle?G.bottomLeftStyle:mxUtils.getValue(this.style,"bottomLeftStyle", "default"),Tb=G&&G.fillColor?G.fillColor:mxUtils.getValue(this.style,"fillColor","#ffffff");G&&G.strokeColor||mxUtils.getValue(this.style,"strokeColor","#000000");var ec=G&&G.strokeWidth?G.strokeWidth:mxUtils.getValue(this.style,"strokeWidth","1"),fc=G&&G.fillColor2?G.fillColor2:mxUtils.getValue(this.style,"fillColor2","none"),gc=G&&G.gradientColor2?G.gradientColor2:mxUtils.getValue(this.style,"gradientColor2","none"),hc=G&&G.gradientDirection2?G.gradientDirection2:mxUtils.getValue(this.style,"gradientDirection2", "south"),ic=G&&G.opacity?G.opacity:mxUtils.getValue(this.style,"opacity","100"),jc=Math.max(0,Math.min(50,U));G=yb.prototype;g.setDashed(Ya);ub&&""!=ub&&g.setDashPattern(ub);g.setStrokeWidth(ec);U=Math.min(.5*C,.5*u,U);da||(U=jc*Math.min(u,C)/100);U=Math.min(U,.5*Math.min(u,C));da||(pa=Math.min(mb*Math.min(u,C)/100));pa=Math.min(pa,.5*Math.min(u,C)-U);(Qa||Ua||Wa||Ra)&&"frame"!=Aa&&(g.begin(),Qa?G.moveNW(g,r,B,u,C,I,fb,U,Ra):g.moveTo(0,0),Qa&&G.paintNW(g,r,B,u,C,I,fb,U,Ra),G.paintTop(g,r,B,u,C,I, jb,U,Ua),Ua&&G.paintNE(g,r,B,u,C,I,jb,U,Qa),G.paintRight(g,r,B,u,C,I,lb,U,Wa),Wa&&G.paintSE(g,r,B,u,C,I,lb,U,Ua),G.paintBottom(g,r,B,u,C,I,pb,U,Ra),Ra&&G.paintSW(g,r,B,u,C,I,pb,U,Wa),G.paintLeft(g,r,B,u,C,I,fb,U,Qa),g.close(),g.fill(),g.setShadow(!1),g.setFillColor(fc),Ya=da=ic,"none"==fc&&(da=0),"none"==gc&&(Ya=0),g.setGradient(fc,gc,0,0,u,C,hc,da,Ya),g.begin(),Qa?G.moveNWInner(g,r,B,u,C,I,fb,U,pa,Qa,Ra):g.moveTo(pa,0),G.paintLeftInner(g,r,B,u,C,I,pb,U,pa,Wa,Ra),Ra&&Wa&&G.paintSWInner(g,r,B,u,C, I,pb,U,pa,Wa),G.paintBottomInner(g,r,B,u,C,I,lb,U,pa,Ua,Wa),Wa&&Ua&&G.paintSEInner(g,r,B,u,C,I,lb,U,pa),G.paintRightInner(g,r,B,u,C,I,jb,U,pa,Qa,Ua),Ua&&Qa&&G.paintNEInner(g,r,B,u,C,I,jb,U,pa),G.paintTopInner(g,r,B,u,C,I,fb,U,pa,Ra,Qa),Qa&&Ra&&G.paintNWInner(g,r,B,u,C,I,fb,U,pa),g.fill(),"none"==Tb&&(g.begin(),G.paintFolds(g,r,B,u,C,I,fb,jb,lb,pb,U,Qa,Ua,Wa,Ra),g.stroke()));Qa||Ua||Wa||!Ra?Qa||Ua||!Wa||Ra?!Qa&&!Ua&&Wa&&Ra?"frame"!=Aa?(g.begin(),G.moveSE(g,r,B,u,C,I,lb,U,Ua),G.paintBottom(g,r,B,u, C,I,pb,U,Ra),G.paintSW(g,r,B,u,C,I,pb,U,Wa),G.paintLeft(g,r,B,u,C,I,fb,U,Qa),"double"==Aa&&(G.moveNWInner(g,r,B,u,C,I,fb,U,pa,Qa,Ra),G.paintLeftInner(g,r,B,u,C,I,pb,U,pa,Wa,Ra),G.paintSWInner(g,r,B,u,C,I,pb,U,pa,Wa),G.paintBottomInner(g,r,B,u,C,I,lb,U,pa,Ua,Wa)),g.stroke()):(g.begin(),G.moveSE(g,r,B,u,C,I,lb,U,Ua),G.paintBottom(g,r,B,u,C,I,pb,U,Ra),G.paintSW(g,r,B,u,C,I,pb,U,Wa),G.paintLeft(g,r,B,u,C,I,fb,U,Qa),G.lineNWInner(g,r,B,u,C,I,fb,U,pa,Qa,Ra),G.paintLeftInner(g,r,B,u,C,I,pb,U,pa,Wa,Ra),G.paintSWInner(g, r,B,u,C,I,pb,U,pa,Wa),G.paintBottomInner(g,r,B,u,C,I,lb,U,pa,Ua,Wa),g.close(),g.fillAndStroke()):Qa||!Ua||Wa||Ra?!Qa&&Ua&&!Wa&&Ra?"frame"!=Aa?(g.begin(),G.moveSW(g,r,B,u,C,I,fb,U,Wa),G.paintLeft(g,r,B,u,C,I,fb,U,Qa),"double"==Aa&&(G.moveNWInner(g,r,B,u,C,I,fb,U,pa,Qa,Ra),G.paintLeftInner(g,r,B,u,C,I,pb,U,pa,Wa,Ra)),g.stroke(),g.begin(),G.moveNE(g,r,B,u,C,I,jb,U,Qa),G.paintRight(g,r,B,u,C,I,lb,U,Wa),"double"==Aa&&(G.moveSEInner(g,r,B,u,C,I,lb,U,pa,Wa),G.paintRightInner(g,r,B,u,C,I,jb,U,pa,Qa,Ua)), g.stroke()):(g.begin(),G.moveSW(g,r,B,u,C,I,fb,U,Wa),G.paintLeft(g,r,B,u,C,I,fb,U,Qa),G.lineNWInner(g,r,B,u,C,I,fb,U,pa,Qa,Ra),G.paintLeftInner(g,r,B,u,C,I,pb,U,pa,Wa,Ra),g.close(),g.fillAndStroke(),g.begin(),G.moveNE(g,r,B,u,C,I,jb,U,Qa),G.paintRight(g,r,B,u,C,I,lb,U,Wa),G.lineSEInner(g,r,B,u,C,I,lb,U,pa,Wa),G.paintRightInner(g,r,B,u,C,I,jb,U,pa,Qa,Ua),g.close(),g.fillAndStroke()):!Qa&&Ua&&Wa&&!Ra?"frame"!=Aa?(g.begin(),G.moveNE(g,r,B,u,C,I,jb,U,Qa),G.paintRight(g,r,B,u,C,I,lb,U,Wa),G.paintSE(g, r,B,u,C,I,lb,U,Ua),G.paintBottom(g,r,B,u,C,I,pb,U,Ra),"double"==Aa&&(G.moveSWInner(g,r,B,u,C,I,pb,U,pa,Ra),G.paintBottomInner(g,r,B,u,C,I,lb,U,pa,Ua,Wa),G.paintSEInner(g,r,B,u,C,I,lb,U,pa),G.paintRightInner(g,r,B,u,C,I,jb,U,pa,Qa,Ua)),g.stroke()):(g.begin(),G.moveNE(g,r,B,u,C,I,jb,U,Qa),G.paintRight(g,r,B,u,C,I,lb,U,Wa),G.paintSE(g,r,B,u,C,I,lb,U,Ua),G.paintBottom(g,r,B,u,C,I,pb,U,Ra),G.lineSWInner(g,r,B,u,C,I,pb,U,pa,Ra),G.paintBottomInner(g,r,B,u,C,I,lb,U,pa,Ua,Wa),G.paintSEInner(g,r,B,u,C,I,lb, U,pa),G.paintRightInner(g,r,B,u,C,I,jb,U,pa,Qa,Ua),g.close(),g.fillAndStroke()):!Qa&&Ua&&Wa&&Ra?"frame"!=Aa?(g.begin(),G.moveNE(g,r,B,u,C,I,jb,U,Qa),G.paintRight(g,r,B,u,C,I,lb,U,Wa),G.paintSE(g,r,B,u,C,I,lb,U,Ua),G.paintBottom(g,r,B,u,C,I,pb,U,Ra),G.paintSW(g,r,B,u,C,I,pb,U,Wa),G.paintLeft(g,r,B,u,C,I,fb,U,Qa),"double"==Aa&&(G.moveNWInner(g,r,B,u,C,I,fb,U,pa,Qa,Ra),G.paintLeftInner(g,r,B,u,C,I,pb,U,pa,Wa,Ra),G.paintSWInner(g,r,B,u,C,I,pb,U,pa,Wa),G.paintBottomInner(g,r,B,u,C,I,lb,U,pa,Ua,Wa),G.paintSEInner(g, r,B,u,C,I,lb,U,pa),G.paintRightInner(g,r,B,u,C,I,jb,U,pa,Qa,Ua)),g.stroke()):(g.begin(),G.moveNE(g,r,B,u,C,I,jb,U,Qa),G.paintRight(g,r,B,u,C,I,lb,U,Wa),G.paintSE(g,r,B,u,C,I,lb,U,Ua),G.paintBottom(g,r,B,u,C,I,pb,U,Ra),G.paintSW(g,r,B,u,C,I,pb,U,Wa),G.paintLeft(g,r,B,u,C,I,fb,U,Qa),G.lineNWInner(g,r,B,u,C,I,fb,U,pa,Qa,Ra),G.paintLeftInner(g,r,B,u,C,I,pb,U,pa,Wa,Ra),G.paintSWInner(g,r,B,u,C,I,pb,U,pa,Wa),G.paintBottomInner(g,r,B,u,C,I,lb,U,pa,Ua,Wa),G.paintSEInner(g,r,B,u,C,I,lb,U,pa),G.paintRightInner(g, r,B,u,C,I,jb,U,pa,Qa,Ua),g.close(),g.fillAndStroke()):!Qa||Ua||Wa||Ra?Qa&&!Ua&&!Wa&&Ra?"frame"!=Aa?(g.begin(),G.moveSW(g,r,B,u,C,I,pb,U,Wa),G.paintLeft(g,r,B,u,C,I,fb,U,Qa),G.paintNW(g,r,B,u,C,I,fb,U,Ra),G.paintTop(g,r,B,u,C,I,jb,U,Ua),"double"==Aa&&(G.moveNEInner(g,r,B,u,C,I,jb,U,pa,Ua),G.paintTopInner(g,r,B,u,C,I,fb,U,pa,Ra,Qa),G.paintNWInner(g,r,B,u,C,I,fb,U,pa),G.paintLeftInner(g,r,B,u,C,I,pb,U,pa,Wa,Ra)),g.stroke()):(g.begin(),G.moveSW(g,r,B,u,C,I,pb,U,Wa),G.paintLeft(g,r,B,u,C,I,fb,U,Qa),G.paintNW(g, r,B,u,C,I,fb,U,Ra),G.paintTop(g,r,B,u,C,I,jb,U,Ua),G.lineNEInner(g,r,B,u,C,I,jb,U,pa,Ua),G.paintTopInner(g,r,B,u,C,I,fb,U,pa,Ra,Qa),G.paintNWInner(g,r,B,u,C,I,fb,U,pa),G.paintLeftInner(g,r,B,u,C,I,pb,U,pa,Wa,Ra),g.close(),g.fillAndStroke()):Qa&&!Ua&&Wa&&!Ra?"frame"!=Aa?(g.begin(),G.moveNW(g,r,B,u,C,I,fb,U,Ra),G.paintTop(g,r,B,u,C,I,jb,U,Ua),"double"==Aa&&(G.moveNEInner(g,r,B,u,C,I,jb,U,pa,Ua),G.paintTopInner(g,r,B,u,C,I,fb,U,pa,Ra,Qa)),g.stroke(),g.begin(),G.moveSE(g,r,B,u,C,I,lb,U,Ua),G.paintBottom(g, r,B,u,C,I,pb,U,Ra),"double"==Aa&&(G.moveSWInner(g,r,B,u,C,I,pb,U,pa,Ra),G.paintBottomInner(g,r,B,u,C,I,lb,U,pa,Ua,Wa)),g.stroke()):(g.begin(),G.moveNW(g,r,B,u,C,I,fb,U,Ra),G.paintTop(g,r,B,u,C,I,jb,U,Ua),G.lineNEInner(g,r,B,u,C,I,jb,U,pa,Ua),G.paintTopInner(g,r,B,u,C,I,fb,U,pa,Ra,Qa),g.close(),g.fillAndStroke(),g.begin(),G.moveSE(g,r,B,u,C,I,lb,U,Ua),G.paintBottom(g,r,B,u,C,I,pb,U,Ra),G.lineSWInner(g,r,B,u,C,I,pb,U,pa,Ra),G.paintBottomInner(g,r,B,u,C,I,lb,U,pa,Ua,Wa),g.close(),g.fillAndStroke()): Qa&&!Ua&&Wa&&Ra?"frame"!=Aa?(g.begin(),G.moveSE(g,r,B,u,C,I,lb,U,Ua),G.paintBottom(g,r,B,u,C,I,pb,U,Ra),G.paintSW(g,r,B,u,C,I,pb,U,Wa),G.paintLeft(g,r,B,u,C,I,fb,U,Qa),G.paintNW(g,r,B,u,C,I,fb,U,Ra),G.paintTop(g,r,B,u,C,I,jb,U,Ua),"double"==Aa&&(G.moveNEInner(g,r,B,u,C,I,jb,U,pa,Ua),G.paintTopInner(g,r,B,u,C,I,fb,U,pa,Ra,Qa),G.paintNWInner(g,r,B,u,C,I,fb,U,pa),G.paintLeftInner(g,r,B,u,C,I,pb,U,pa,Wa,Ra),G.paintSWInner(g,r,B,u,C,I,pb,U,pa,Wa),G.paintBottomInner(g,r,B,u,C,I,lb,U,pa,Ua,Wa)),g.stroke()): (g.begin(),G.moveSE(g,r,B,u,C,I,lb,U,Ua),G.paintBottom(g,r,B,u,C,I,pb,U,Ra),G.paintSW(g,r,B,u,C,I,pb,U,Wa),G.paintLeft(g,r,B,u,C,I,fb,U,Qa),G.paintNW(g,r,B,u,C,I,fb,U,Ra),G.paintTop(g,r,B,u,C,I,jb,U,Ua),G.lineNEInner(g,r,B,u,C,I,jb,U,pa,Ua),G.paintTopInner(g,r,B,u,C,I,fb,U,pa,Ra,Qa),G.paintNWInner(g,r,B,u,C,I,fb,U,pa),G.paintLeftInner(g,r,B,u,C,I,pb,U,pa,Wa,Ra),G.paintSWInner(g,r,B,u,C,I,pb,U,pa,Wa),G.paintBottomInner(g,r,B,u,C,I,lb,U,pa,Ua,Wa),g.close(),g.fillAndStroke()):Qa&&Ua&&!Wa&&!Ra?"frame"!= Aa?(g.begin(),G.moveNW(g,r,B,u,C,I,fb,U,Ra),G.paintTop(g,r,B,u,C,I,jb,U,Ua),G.paintNE(g,r,B,u,C,I,jb,U,Qa),G.paintRight(g,r,B,u,C,I,lb,U,Wa),"double"==Aa&&(G.moveSEInner(g,r,B,u,C,I,lb,U,pa,Wa),G.paintRightInner(g,r,B,u,C,I,jb,U,pa,Qa,Ua),G.paintNEInner(g,r,B,u,C,I,jb,U,pa),G.paintTopInner(g,r,B,u,C,I,fb,U,pa,Ra,Qa)),g.stroke()):(g.begin(),G.moveNW(g,r,B,u,C,I,fb,U,Ra),G.paintTop(g,r,B,u,C,I,jb,U,Ua),G.paintNE(g,r,B,u,C,I,jb,U,Qa),G.paintRight(g,r,B,u,C,I,lb,U,Wa),G.lineSEInner(g,r,B,u,C,I,lb,U,pa, Wa),G.paintRightInner(g,r,B,u,C,I,jb,U,pa,Qa,Ua),G.paintNEInner(g,r,B,u,C,I,jb,U,pa),G.paintTopInner(g,r,B,u,C,I,fb,U,pa,Ra,Qa),g.close(),g.fillAndStroke()):Qa&&Ua&&!Wa&&Ra?"frame"!=Aa?(g.begin(),G.moveSW(g,r,B,u,C,I,pb,U,Wa),G.paintLeft(g,r,B,u,C,I,fb,U,Qa),G.paintNW(g,r,B,u,C,I,fb,U,Ra),G.paintTop(g,r,B,u,C,I,jb,U,Ua),G.paintNE(g,r,B,u,C,I,jb,U,Qa),G.paintRight(g,r,B,u,C,I,lb,U,Wa),"double"==Aa&&(G.moveSEInner(g,r,B,u,C,I,lb,U,pa,Wa),G.paintRightInner(g,r,B,u,C,I,jb,U,pa,Qa,Ua),G.paintNEInner(g, r,B,u,C,I,jb,U,pa),G.paintTopInner(g,r,B,u,C,I,fb,U,pa,Ra,Qa),G.paintNWInner(g,r,B,u,C,I,fb,U,pa),G.paintLeftInner(g,r,B,u,C,I,pb,U,pa,Wa,Ra)),g.stroke()):(g.begin(),G.moveSW(g,r,B,u,C,I,pb,U,Wa),G.paintLeft(g,r,B,u,C,I,fb,U,Qa),G.paintNW(g,r,B,u,C,I,fb,U,Ra),G.paintTop(g,r,B,u,C,I,jb,U,Ua),G.paintNE(g,r,B,u,C,I,jb,U,Qa),G.paintRight(g,r,B,u,C,I,lb,U,Wa),G.lineSEInner(g,r,B,u,C,I,lb,U,pa,Wa),G.paintRightInner(g,r,B,u,C,I,jb,U,pa,Qa,Ua),G.paintNEInner(g,r,B,u,C,I,jb,U,pa),G.paintTopInner(g,r,B,u,C, I,fb,U,pa,Ra,Qa),G.paintNWInner(g,r,B,u,C,I,fb,U,pa),G.paintLeftInner(g,r,B,u,C,I,pb,U,pa,Wa,Ra),g.close(),g.fillAndStroke()):Qa&&Ua&&Wa&&!Ra?"frame"!=Aa?(g.begin(),G.moveNW(g,r,B,u,C,I,fb,U,Ra),G.paintTop(g,r,B,u,C,I,jb,U,Ua),G.paintNE(g,r,B,u,C,I,jb,U,Qa),G.paintRight(g,r,B,u,C,I,lb,U,Wa),G.paintSE(g,r,B,u,C,I,lb,U,Ua),G.paintBottom(g,r,B,u,C,I,pb,U,Ra),"double"==Aa&&(G.moveSWInner(g,r,B,u,C,I,pb,U,pa,Ra),G.paintBottomInner(g,r,B,u,C,I,lb,U,pa,Ua,Wa),G.paintSEInner(g,r,B,u,C,I,lb,U,pa),G.paintRightInner(g, r,B,u,C,I,jb,U,pa,Qa,Ua),G.paintNEInner(g,r,B,u,C,I,jb,U,pa),G.paintTopInner(g,r,B,u,C,I,fb,U,pa,Ra,Qa)),g.stroke()):(g.begin(),G.moveNW(g,r,B,u,C,I,fb,U,Ra),G.paintTop(g,r,B,u,C,I,jb,U,Ua),G.paintNE(g,r,B,u,C,I,jb,U,Qa),G.paintRight(g,r,B,u,C,I,lb,U,Wa),G.paintSE(g,r,B,u,C,I,lb,U,Ua),G.paintBottom(g,r,B,u,C,I,pb,U,Ra),G.lineSWInner(g,r,B,u,C,I,pb,U,pa,Ra),G.paintBottomInner(g,r,B,u,C,I,lb,U,pa,Ua,Wa),G.paintSEInner(g,r,B,u,C,I,lb,U,pa),G.paintRightInner(g,r,B,u,C,I,jb,U,pa,Qa,Ua),G.paintNEInner(g, r,B,u,C,I,jb,U,pa),G.paintTopInner(g,r,B,u,C,I,fb,U,pa,Ra,Qa),g.close(),g.fillAndStroke()):Qa&&Ua&&Wa&&Ra&&("frame"!=Aa?(g.begin(),G.moveNW(g,r,B,u,C,I,fb,U,Ra),G.paintNW(g,r,B,u,C,I,fb,U,Ra),G.paintTop(g,r,B,u,C,I,jb,U,Ua),G.paintNE(g,r,B,u,C,I,jb,U,Qa),G.paintRight(g,r,B,u,C,I,lb,U,Wa),G.paintSE(g,r,B,u,C,I,lb,U,Ua),G.paintBottom(g,r,B,u,C,I,pb,U,Ra),G.paintSW(g,r,B,u,C,I,pb,U,Wa),G.paintLeft(g,r,B,u,C,I,fb,U,Qa),g.close(),"double"==Aa&&(G.moveSWInner(g,r,B,u,C,I,pb,U,pa,Ra),G.paintSWInner(g,r, B,u,C,I,pb,U,pa,Wa),G.paintBottomInner(g,r,B,u,C,I,lb,U,pa,Ua,Wa),G.paintSEInner(g,r,B,u,C,I,lb,U,pa),G.paintRightInner(g,r,B,u,C,I,jb,U,pa,Qa,Ua),G.paintNEInner(g,r,B,u,C,I,jb,U,pa),G.paintTopInner(g,r,B,u,C,I,fb,U,pa,Ra,Qa),G.paintNWInner(g,r,B,u,C,I,fb,U,pa),G.paintLeftInner(g,r,B,u,C,I,pb,U,pa,Wa,Ra),g.close()),g.stroke()):(g.begin(),G.moveNW(g,r,B,u,C,I,fb,U,Ra),G.paintNW(g,r,B,u,C,I,fb,U,Ra),G.paintTop(g,r,B,u,C,I,jb,U,Ua),G.paintNE(g,r,B,u,C,I,jb,U,Qa),G.paintRight(g,r,B,u,C,I,lb,U,Wa),G.paintSE(g, r,B,u,C,I,lb,U,Ua),G.paintBottom(g,r,B,u,C,I,pb,U,Ra),G.paintSW(g,r,B,u,C,I,pb,U,Wa),G.paintLeft(g,r,B,u,C,I,fb,U,Qa),g.close(),G.moveSWInner(g,r,B,u,C,I,pb,U,pa,Ra),G.paintSWInner(g,r,B,u,C,I,pb,U,pa,Wa),G.paintBottomInner(g,r,B,u,C,I,lb,U,pa,Ua,Wa),G.paintSEInner(g,r,B,u,C,I,lb,U,pa),G.paintRightInner(g,r,B,u,C,I,jb,U,pa,Qa,Ua),G.paintNEInner(g,r,B,u,C,I,jb,U,pa),G.paintTopInner(g,r,B,u,C,I,fb,U,pa,Ra,Qa),G.paintNWInner(g,r,B,u,C,I,fb,U,pa),G.paintLeftInner(g,r,B,u,C,I,pb,U,pa,Wa,Ra),g.close(), g.fillAndStroke())):"frame"!=Aa?(g.begin(),G.moveNW(g,r,B,u,C,I,fb,U,Ra),G.paintTop(g,r,B,u,C,I,jb,U,Ua),"double"==Aa&&(G.moveNEInner(g,r,B,u,C,I,jb,U,pa,Ua),G.paintTopInner(g,r,B,u,C,I,fb,U,pa,Ra,Qa)),g.stroke()):(g.begin(),G.moveNW(g,r,B,u,C,I,fb,U,Ra),G.paintTop(g,r,B,u,C,I,jb,U,Ua),G.lineNEInner(g,r,B,u,C,I,jb,U,pa,Ua),G.paintTopInner(g,r,B,u,C,I,fb,U,pa,Ra,Qa),g.close(),g.fillAndStroke()):"frame"!=Aa?(g.begin(),G.moveNE(g,r,B,u,C,I,jb,U,Qa),G.paintRight(g,r,B,u,C,I,lb,U,Wa),"double"==Aa&&(G.moveSEInner(g, r,B,u,C,I,lb,U,pa,Wa),G.paintRightInner(g,r,B,u,C,I,jb,U,pa,Qa,Ua)),g.stroke()):(g.begin(),G.moveNE(g,r,B,u,C,I,jb,U,Qa),G.paintRight(g,r,B,u,C,I,lb,U,Wa),G.lineSEInner(g,r,B,u,C,I,lb,U,pa,Wa),G.paintRightInner(g,r,B,u,C,I,jb,U,pa,Qa,Ua),g.close(),g.fillAndStroke()):"frame"!=Aa?(g.begin(),G.moveSE(g,r,B,u,C,I,lb,U,Ua),G.paintBottom(g,r,B,u,C,I,pb,U,Ra),"double"==Aa&&(G.moveSWInner(g,r,B,u,C,I,pb,U,pa,Ra),G.paintBottomInner(g,r,B,u,C,I,lb,U,pa,Ua,Wa)),g.stroke()):(g.begin(),G.moveSE(g,r,B,u,C,I,lb, U,Ua),G.paintBottom(g,r,B,u,C,I,pb,U,Ra),G.lineSWInner(g,r,B,u,C,I,pb,U,pa,Ra),G.paintBottomInner(g,r,B,u,C,I,lb,U,pa,Ua,Wa),g.close(),g.fillAndStroke()):"frame"!=Aa?(g.begin(),G.moveSW(g,r,B,u,C,I,fb,U,Wa),G.paintLeft(g,r,B,u,C,I,fb,U,Qa),"double"==Aa&&(G.moveNWInner(g,r,B,u,C,I,fb,U,pa,Qa,Ra),G.paintLeftInner(g,r,B,u,C,I,pb,U,pa,Wa,Ra)),g.stroke()):(g.begin(),G.moveSW(g,r,B,u,C,I,fb,U,Wa),G.paintLeft(g,r,B,u,C,I,fb,U,Qa),G.lineNWInner(g,r,B,u,C,I,fb,U,pa,Qa,Ra),G.paintLeftInner(g,r,B,u,C,I,pb,U, pa,Wa,Ra),g.close(),g.fillAndStroke());g.begin();G.paintFolds(g,r,B,u,C,I,fb,jb,lb,pb,U,Qa,Ua,Wa,Ra);g.stroke()};yb.prototype.moveNW=function(g,r,B,u,C,G,I,da,U){"square"==I||"default"==I&&"square"==G||!U?g.moveTo(0,0):g.moveTo(0,da)};yb.prototype.moveNE=function(g,r,B,u,C,G,I,da,U){"square"==I||"default"==I&&"square"==G||!U?g.moveTo(u,0):g.moveTo(u-da,0)};yb.prototype.moveSE=function(g,r,B,u,C,G,I,da,U){"square"==I||"default"==I&&"square"==G||!U?g.moveTo(u,C):g.moveTo(u,C-da)};yb.prototype.moveSW= function(g,r,B,u,C,G,I,da,U){"square"==I||"default"==I&&"square"==G||!U?g.moveTo(0,C):g.moveTo(da,C)};yb.prototype.paintNW=function(g,r,B,u,C,G,I,da,U){if(U)if("rounded"==I||"default"==I&&"rounded"==G||"invRound"==I||"default"==I&&"invRound"==G){r=0;if("rounded"==I||"default"==I&&"rounded"==G)r=1;g.arcTo(da,da,0,0,r,da,0)}else("snip"==I||"default"==I&&"snip"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(da,0);else g.lineTo(0,0)};yb.prototype.paintTop=function(g,r,B,u,C,G,I,da,U){"square"==I|| "default"==I&&"square"==G||!U?g.lineTo(u,0):g.lineTo(u-da,0)};yb.prototype.paintNE=function(g,r,B,u,C,G,I,da,U){if(U)if("rounded"==I||"default"==I&&"rounded"==G||"invRound"==I||"default"==I&&"invRound"==G){r=0;if("rounded"==I||"default"==I&&"rounded"==G)r=1;g.arcTo(da,da,0,0,r,u,da)}else("snip"==I||"default"==I&&"snip"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(u,da);else g.lineTo(u,0)};yb.prototype.paintRight=function(g,r,B,u,C,G,I,da,U){"square"==I||"default"==I&&"square"==G||!U?g.lineTo(u, C):g.lineTo(u,C-da)};yb.prototype.paintLeft=function(g,r,B,u,C,G,I,da,U){"square"==I||"default"==I&&"square"==G||!U?g.lineTo(0,0):g.lineTo(0,da)};yb.prototype.paintSE=function(g,r,B,u,C,G,I,da,U){if(U)if("rounded"==I||"default"==I&&"rounded"==G||"invRound"==I||"default"==I&&"invRound"==G){r=0;if("rounded"==I||"default"==I&&"rounded"==G)r=1;g.arcTo(da,da,0,0,r,u-da,C)}else("snip"==I||"default"==I&&"snip"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(u-da,C);else g.lineTo(u,C)};yb.prototype.paintBottom= function(g,r,B,u,C,G,I,da,U){"square"==I||"default"==I&&"square"==G||!U?g.lineTo(0,C):g.lineTo(da,C)};yb.prototype.paintSW=function(g,r,B,u,C,G,I,da,U){if(U)if("rounded"==I||"default"==I&&"rounded"==G||"invRound"==I||"default"==I&&"invRound"==G){r=0;if("rounded"==I||"default"==I&&"rounded"==G)r=1;g.arcTo(da,da,0,0,r,0,C-da)}else("snip"==I||"default"==I&&"snip"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(0,C-da);else g.lineTo(0,C)};yb.prototype.paintNWInner=function(g,r,B,u,C,G,I,da,U){if("rounded"== I||"default"==I&&"rounded"==G)g.arcTo(da-.5*U,da-.5*U,0,0,0,U,.5*U+da);else if("invRound"==I||"default"==I&&"invRound"==G)g.arcTo(da+U,da+U,0,0,1,U,U+da);else if("snip"==I||"default"==I&&"snip"==G)g.lineTo(U,.5*U+da);else if("fold"==I||"default"==I&&"fold"==G)g.lineTo(U+da,U+da),g.lineTo(U,U+da)};yb.prototype.paintTopInner=function(g,r,B,u,C,G,I,da,U,Aa,pa){Aa||pa?!Aa&&pa?g.lineTo(0,U):Aa&&!pa?g.lineTo(U,0):Aa?"square"==I||"default"==I&&"square"==G?g.lineTo(U,U):"rounded"==I||"default"==I&&"rounded"== G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(da+.5*U,U):g.lineTo(da+U,U):g.lineTo(0,U):g.lineTo(0,0)};yb.prototype.paintNEInner=function(g,r,B,u,C,G,I,da,U){if("rounded"==I||"default"==I&&"rounded"==G)g.arcTo(da-.5*U,da-.5*U,0,0,0,u-da-.5*U,U);else if("invRound"==I||"default"==I&&"invRound"==G)g.arcTo(da+U,da+U,0,0,1,u-da-U,U);else if("snip"==I||"default"==I&&"snip"==G)g.lineTo(u-da-.5*U,U);else if("fold"==I||"default"==I&&"fold"==G)g.lineTo(u-da-U,da+U),g.lineTo(u-da-U,U)};yb.prototype.paintRightInner= function(g,r,B,u,C,G,I,da,U,Aa,pa){Aa||pa?!Aa&&pa?g.lineTo(u-U,0):Aa&&!pa?g.lineTo(u,U):Aa?"square"==I||"default"==I&&"square"==G?g.lineTo(u-U,U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(u-U,da+.5*U):g.lineTo(u-U,da+U):g.lineTo(u-U,0):g.lineTo(u,0)};yb.prototype.paintLeftInner=function(g,r,B,u,C,G,I,da,U,Aa,pa){Aa||pa?!Aa&&pa?g.lineTo(U,C):Aa&&!pa?g.lineTo(0,C-U):Aa?"square"==I||"default"==I&&"square"==G?g.lineTo(U,C-U):"rounded"==I||"default"==I&&"rounded"== G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(U,C-da-.5*U):g.lineTo(U,C-da-U):g.lineTo(U,C):g.lineTo(0,C)};yb.prototype.paintSEInner=function(g,r,B,u,C,G,I,da,U){if("rounded"==I||"default"==I&&"rounded"==G)g.arcTo(da-.5*U,da-.5*U,0,0,0,u-U,C-da-.5*U);else if("invRound"==I||"default"==I&&"invRound"==G)g.arcTo(da+U,da+U,0,0,1,u-U,C-da-U);else if("snip"==I||"default"==I&&"snip"==G)g.lineTo(u-U,C-da-.5*U);else if("fold"==I||"default"==I&&"fold"==G)g.lineTo(u-da-U,C-da-U),g.lineTo(u-U,C-da-U)};yb.prototype.paintBottomInner= function(g,r,B,u,C,G,I,da,U,Aa,pa){Aa||pa?!Aa&&pa?g.lineTo(u,C-U):Aa&&!pa?g.lineTo(u-U,C):"square"==I||"default"==I&&"square"==G||!Aa?g.lineTo(u-U,C-U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(u-da-.5*U,C-U):g.lineTo(u-da-U,C-U):g.lineTo(u,C)};yb.prototype.paintSWInner=function(g,r,B,u,C,G,I,da,U,Aa){if(!Aa)g.lineTo(U,C);else if("square"==I||"default"==I&&"square"==G)g.lineTo(U,C-U);else if("rounded"==I||"default"==I&&"rounded"==G)g.arcTo(da-.5*U,da-.5* U,0,0,0,da+.5*U,C-U);else if("invRound"==I||"default"==I&&"invRound"==G)g.arcTo(da+U,da+U,0,0,1,da+U,C-U);else if("snip"==I||"default"==I&&"snip"==G)g.lineTo(da+.5*U,C-U);else if("fold"==I||"default"==I&&"fold"==G)g.lineTo(U+da,C-da-U),g.lineTo(U+da,C-U)};yb.prototype.moveSWInner=function(g,r,B,u,C,G,I,da,U,Aa){Aa?"square"==I||"default"==I&&"square"==G?g.moveTo(U,C-U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.moveTo(U,C-da-.5*U):("invRound"==I||"default"==I&&"invRound"== G||"fold"==I||"default"==I&&"fold"==G)&&g.moveTo(U,C-da-U):g.moveTo(0,C-U)};yb.prototype.lineSWInner=function(g,r,B,u,C,G,I,da,U,Aa){Aa?"square"==I||"default"==I&&"square"==G?g.lineTo(U,C-U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(U,C-da-.5*U):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(U,C-da-U):g.lineTo(0,C-U)};yb.prototype.moveSEInner=function(g,r,B,u,C,G,I,da,U,Aa){Aa?"square"==I||"default"==I&&"square"== G?g.moveTo(u-U,C-U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.moveTo(u-U,C-da-.5*U):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.moveTo(u-U,C-da-U):g.moveTo(u-U,C)};yb.prototype.lineSEInner=function(g,r,B,u,C,G,I,da,U,Aa){Aa?"square"==I||"default"==I&&"square"==G?g.lineTo(u-U,C-U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(u-U,C-da-.5*U):("invRound"==I||"default"==I&&"invRound"== G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(u-U,C-da-U):g.lineTo(u-U,C)};yb.prototype.moveNEInner=function(g,r,B,u,C,G,I,da,U,Aa){Aa?"square"==I||"default"==I&&"square"==G||Aa?g.moveTo(u-U,U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.moveTo(u-U,da+.5*U):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.moveTo(u-U,da+U):g.moveTo(u,U)};yb.prototype.lineNEInner=function(g,r,B,u,C,G,I,da,U,Aa){Aa?"square"==I||"default"==I&&"square"== G||Aa?g.lineTo(u-U,U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(u-U,da+.5*U):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(u-U,da+U):g.lineTo(u,U)};yb.prototype.moveNWInner=function(g,r,B,u,C,G,I,da,U,Aa,pa){Aa||pa?!Aa&&pa?g.moveTo(U,0):Aa&&!pa?g.moveTo(0,U):"square"==I||"default"==I&&"square"==G?g.moveTo(U,U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.moveTo(U,da+.5*U):("invRound"== I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.moveTo(U,da+U):g.moveTo(0,0)};yb.prototype.lineNWInner=function(g,r,B,u,C,G,I,da,U,Aa,pa){Aa||pa?!Aa&&pa?g.lineTo(U,0):Aa&&!pa?g.lineTo(0,U):"square"==I||"default"==I&&"square"==G?g.lineTo(U,U):"rounded"==I||"default"==I&&"rounded"==G||"snip"==I||"default"==I&&"snip"==G?g.lineTo(U,da+.5*U):("invRound"==I||"default"==I&&"invRound"==G||"fold"==I||"default"==I&&"fold"==G)&&g.lineTo(U,da+U):g.lineTo(0,0)};yb.prototype.paintFolds=function(g, r,B,u,C,G,I,da,U,Aa,pa,Ya,ub,mb,Qa){if("fold"==G||"fold"==I||"fold"==da||"fold"==U||"fold"==Aa)("fold"==I||"default"==I&&"fold"==G)&&Ya&&Qa&&(g.moveTo(0,pa),g.lineTo(pa,pa),g.lineTo(pa,0)),("fold"==da||"default"==da&&"fold"==G)&&Ya&&ub&&(g.moveTo(u-pa,0),g.lineTo(u-pa,pa),g.lineTo(u,pa)),("fold"==U||"default"==U&&"fold"==G)&&mb&&ub&&(g.moveTo(u-pa,C),g.lineTo(u-pa,C-pa),g.lineTo(u,C-pa)),("fold"==Aa||"default"==Aa&&"fold"==G)&&mb&&Qa&&(g.moveTo(0,C-pa),g.lineTo(pa,C-pa),g.lineTo(pa,C))};mxCellRenderer.registerShape(yb.prototype.cst.RECT2, yb);yb.prototype.constraints=null;mxUtils.extend(Vb,mxConnector);Vb.prototype.origPaintEdgeShape=Vb.prototype.paintEdgeShape;Vb.prototype.paintEdgeShape=function(g,r){for(var B=[],u=0;u<r.length;u++)B.push(mxUtils.clone(r[u]));u=g.state.dashed;var C=g.state.fixDash;Vb.prototype.origPaintEdgeShape.apply(this,[g,B]);3<=g.state.strokeWidth&&(B=mxUtils.getValue(this.style,"fillColor",null),null!=B&&(g.setStrokeColor(B),g.setStrokeWidth(g.state.strokeWidth-2),g.setDashed(u,C),Vb.prototype.origPaintEdgeShape.apply(this, [g,r])))};mxCellRenderer.registerShape("filledEdge",Vb);mxUtils.extend(Jb,mxConnector);Jb.prototype.defaultWidth=4;Jb.prototype.getEdgeWidth=function(){return Math.max(0,mxUtils.getNumber(this.style,"width",this.defaultWidth))};Jb.prototype.getFlowAnimationPath=function(){return mxShape.prototype.getFlowAnimationPath.call(this,2)||mxShape.prototype.getFlowAnimationPath.call(this)};Jb.prototype.origPaintEdgeShape=Jb.prototype.paintEdgeShape;Jb.prototype.paintEdgeShape=function(g,r){for(var B=[],u= 0;u<r.length;u++)B.push(mxUtils.clone(r[u]));u=g.state.dashed;var C=g.state.fixDash,G=this.getEdgeWidth();g.setStrokeWidth(G+2*this.strokewidth);g.setDashed(!1);Jb.prototype.origPaintEdgeShape.apply(this,[g,B]);B=mxUtils.getValue(this.style,"fillColor",null);null!=B&&(g.setStrokeWidth(G),g.setStrokeColor(B),g.setDashed(u,C),Jb.prototype.origPaintEdgeShape.apply(this,[g,r]))};mxCellRenderer.registerShape("pipe",Jb);mxUtils.extend(Yb,mxRectangleShape);Yb.prototype.size=10;Yb.prototype.isRoundable=function(){return!0}; Yb.prototype.paintVertexShape=function(g,r,B,u,C){g.translate(r,B);r=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,null);null!=r&&r!=mxConstants.NONE&&(g.setStrokeColor("none"),g.begin(),g.rect(0,0,u,C),g.fillAndStroke(),g.setStrokeColor(this.stroke));var G=Math.max(5,parseFloat(mxUtils.getValue(this.style,"size",this.size)));r=C/2;B=this.strokewidth;B=this.isRounded?B/2:B;C-=B;G=Math.max(1,Math.round(u/G)-1);var I=u/(G+1),da=I/2;g.begin();g.moveTo(0,r);if(this.isRounded){g.curveTo(.4*da, r-.4*(r-B),.6*da,B,da,B);for(var U=0;U<G;U++){var Aa=da+U*I,pa=Aa+I,Ya=0==U%2?C:B;g.curveTo(Aa+.4*I,0==U%2?B:C,pa-.4*I,Ya,pa,Ya)}C=0==G%2?B:C;g.curveTo(da+G*I+.4*da,C,u-.4*da,r-(C==B?1:-1)*(r-B)*.4,u,r)}else{g.lineTo(da,B);for(U=0;U<G;U++)pa=da+(U+1)*I,Ya=0==U%2?C:B,g.lineTo(pa,Ya);g.lineTo(u,r)}g.stroke()};mxCellRenderer.registerShape("zigzag",Yb);"undefined"!==typeof StyleFormatPanel&&function(){var g=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var r= this.editorUi.getSelectionState(),B=g.apply(this,arguments);"umlFrame"==r.style.shape&&B.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return B}}();mxMarker.addMarker("dash",function(g,r,B,u,C,G,I,da,U,Aa){var pa=C*(I+U+1),Ya=G*(I+U+1);return function(){g.begin();g.moveTo(u.x-pa/2-Ya/2,u.y-Ya/2+pa/2);g.lineTo(u.x+Ya/2-3*pa/2,u.y-3*Ya/2-pa/2);g.stroke()}});mxMarker.addMarker("box",function(g,r,B,u,C,G,I,da,U,Aa){var pa=C*(I+U+1),Ya=G*(I+U+1),ub=u.x+pa/2, mb=u.y+Ya/2;u.x-=pa;u.y-=Ya;return function(){g.begin();g.moveTo(ub-pa/2-Ya/2,mb-Ya/2+pa/2);g.lineTo(ub-pa/2+Ya/2,mb-Ya/2-pa/2);g.lineTo(ub+Ya/2-3*pa/2,mb-3*Ya/2-pa/2);g.lineTo(ub-Ya/2-3*pa/2,mb-3*Ya/2+pa/2);g.close();Aa?g.fillAndStroke():g.stroke()}});mxMarker.addMarker("cross",function(g,r,B,u,C,G,I,da,U,Aa){var pa=C*(I+U+1),Ya=G*(I+U+1);return function(){g.begin();g.moveTo(u.x-pa/2-Ya/2,u.y-Ya/2+pa/2);g.lineTo(u.x+Ya/2-3*pa/2,u.y-3*Ya/2-pa/2);g.moveTo(u.x-pa/2+Ya/2,u.y-Ya/2-pa/2);g.lineTo(u.x- Ya/2-3*pa/2,u.y-3*Ya/2+pa/2);g.stroke()}});mxMarker.addMarker("circle",cc);mxMarker.addMarker("circlePlus",function(g,r,B,u,C,G,I,da,U,Aa){var pa=u.clone(),Ya=cc.apply(this,arguments),ub=C*(I+2*U),mb=G*(I+2*U);return function(){Ya.apply(this,arguments);g.begin();g.moveTo(pa.x-C*U,pa.y-G*U);g.lineTo(pa.x-2*ub+C*U,pa.y-2*mb+G*U);g.moveTo(pa.x-ub-mb+G*U,pa.y-mb+ub-C*U);g.lineTo(pa.x+mb-ub-G*U,pa.y-mb-ub+C*U);g.stroke()}});mxMarker.addMarker("halfCircle",function(g,r,B,u,C,G,I,da,U,Aa){var pa=C*(I+U+ 1),Ya=G*(I+U+1),ub=u.clone();u.x-=pa;u.y-=Ya;return function(){g.begin();g.moveTo(ub.x-Ya,ub.y+pa);g.quadTo(u.x-Ya,u.y+pa,u.x,u.y);g.quadTo(u.x+Ya,u.y-pa,ub.x+Ya,ub.y-pa);g.stroke()}});mxMarker.addMarker("async",function(g,r,B,u,C,G,I,da,U,Aa){r=C*U*1.118;B=G*U*1.118;C*=I+U;G*=I+U;var pa=u.clone();pa.x-=r;pa.y-=B;u.x+=-C-r;u.y+=-G-B;return function(){g.begin();g.moveTo(pa.x,pa.y);da?g.lineTo(pa.x-C-G/2,pa.y-G+C/2):g.lineTo(pa.x+G/2-C,pa.y-G-C/2);g.lineTo(pa.x-C,pa.y-G);g.close();Aa?g.fillAndStroke(): g.stroke()}});mxMarker.addMarker("openAsync",function(g){g=null!=g?g:2;return function(r,B,u,C,G,I,da,U,Aa,pa){G*=da+Aa;I*=da+Aa;var Ya=C.clone();return function(){r.begin();r.moveTo(Ya.x,Ya.y);U?r.lineTo(Ya.x-G-I/g,Ya.y-I+G/g):r.lineTo(Ya.x+I/g-G,Ya.y-I-G/g);r.stroke()}}}(2));mxUtils.extend(Gb,mxRectangleShape);Gb.prototype.arcStartY=25;Gb.prototype.arcMidY=-25;Gb.prototype.arcEndY=25;Gb.prototype.paintForeground=function(g,r,B,u,C){mxRectangleShape.prototype.paintForeground.apply(this,arguments); if(null!=this.state){var G=this.state.view.graph;if(null==G.cellEditor||G.cellEditor.editingCell!=this.state.cell)if(G=G.convertValueToString(this.state.cell),null!=G&&0!=G.length){var I=parseFloat(mxUtils.getValue(this.style,"arcStartY",this.arcStartY)),da=parseFloat(mxUtils.getValue(this.style,"arcMidY",this.arcMidY)),U=parseFloat(mxUtils.getValue(this.style,"arcEndY",this.arcEndY)),Aa=mxUtils.getValue(this.style,"curveType","round");if(null!=g.root&&"function"===typeof g.getBaseUrl){null!=this._curvedTextGroup&& null!=this._curvedTextGroup.parentNode&&this._curvedTextGroup.parentNode.removeChild(this._curvedTextGroup);this._curvedTextGroup=null;g.translate(r,B);var pa=g.state,Ya=parseFloat(mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)),ub=Ya/2,mb=(I+U)/2,Qa=Math.max(Math.abs(Gb.prototype.arcMidY),Math.min(mb,C-mb));da=Math.max(-Qa,Math.min(Qa,da));var Ua=mb+da;da=Math.min(I,U,Ua);Qa=Math.max(I,U,Ua);mb=Qa-da;var Wa=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN, mxConstants.ALIGN_MIDDLE);this._curveYOffset=mb=Wa==mxConstants.ALIGN_TOP?ub-da:Wa==mxConstants.ALIGN_BOTTOM?C-ub-Qa:(C-mb)/2-da;Wa=u-ub;da=(ub+pa.dx)*pa.scale;I=(I+mb+pa.dy)*pa.scale;Qa=((ub+Wa)/2+pa.dx)*pa.scale;Ua=(Ua+mb+pa.dy)*pa.scale;ub=(Wa+pa.dx)*pa.scale;U=(U+mb+pa.dy)*pa.scale;"round"==Aa?(Wa=Math.sqrt((ub-da)*(ub-da)+(U-I)*(U-I)),Aa=(da+ub)/2,mb=(I+U)/2,Aa=Math.sqrt((Qa-Aa)*(Qa-Aa)+(Ua-mb)*(Ua-mb)),.5>Aa?(Aa="M "+g.format(da)+" "+g.format(I)+" L "+g.format(ub)+" "+g.format(U),da=Wa):(Wa/= 2,mb=Wa*Wa/(2*Aa)+Aa/2,Ua=0<(ub-da)*(Ua-I)-(U-I)*(Qa-da)?0:1,Qa=Aa>Wa?1:0,Aa="M "+g.format(da)+" "+g.format(I)+" A "+g.format(mb)+" "+g.format(mb)+" 0 "+Qa+" "+Ua+" "+g.format(ub)+" "+g.format(U),da=2*Math.asin(Math.min(1,Wa/mb)),Qa&&(da=2*Math.PI-da),da*=mb)):(Aa="M "+g.format(da)+" "+g.format(I)+" Q "+g.format(Qa)+" "+g.format(Ua)+" "+g.format(ub)+" "+g.format(U),mb=Qa-da,Wa=Ua-I,Qa=ub-Qa,Ua=U-Ua,da=ub-da,I=U-I,da=(Math.sqrt(mb*mb+Wa*Wa)+Math.sqrt(Qa*Qa+Ua*Ua)+Math.sqrt(da*da+I*I))/2);U=(g.idPrefix|| "")+"ctp-"+mxObjectIdentity.get(this);Qa=(I=!mxClient.IS_CHROMEAPP&&g.root.ownerDocument==document)?g.getBaseUrl().replace(/([\(\)])/g,"\\$1"):"";ub=g.createElement("g");Ua=pa.transform||"";0<Ua.length&&ub.setAttribute("transform",Ua);1>pa.alpha&&ub.setAttribute("opacity",pa.alpha);Ua=g.createElement("defs");mb=g.createElement("path");mb.setAttribute("id",U);mb.setAttribute("d",Aa);Ua.appendChild(mb);ub.appendChild(Ua);Aa=g.createElement("text");mb=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY, mxConstants.DEFAULT_FONTFAMILY);Wa=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,"#000000");Ua=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,0);Aa.setAttribute("font-size",Ya*pa.scale+"px");Aa.setAttribute("font-family",mxUtils.parseCssFontFamily(mb));Aa.setAttribute("fill",Wa);(Ua&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&Aa.setAttribute("font-weight","bold");(Ua&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&Aa.setAttribute("font-style","italic");pa=[];(Ua&mxConstants.FONT_UNDERLINE)== mxConstants.FONT_UNDERLINE&&pa.push("underline");(Ua&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&pa.push("line-through");0<pa.length&&(Aa.setAttribute("text-decoration",pa.join(" ")),(Ua&mxConstants.FONT_UNDERLINE_DOTTED)==mxConstants.FONT_UNDERLINE_DOTTED&&(Aa.style.textDecorationStyle="dotted"));Ya=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER);Ua="middle";pa="50%";Ya==mxConstants.ALIGN_LEFT?(Ua="start",pa="0%"):Ya==mxConstants.ALIGN_RIGHT&&(Ua= "end",pa="100%");Aa.setAttribute("text-anchor",Ua);Aa.setAttribute("dominant-baseline","central");Ya=g.createElement("textPath");Ya.setAttribute("startOffset",pa);pa=(I?Qa:"")+"#"+U;Ya.setAttribute("href",pa);I&&Ya.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",pa);Ya.setAttribute("textLength",da);Ya.setAttribute("lengthAdjust","spacing");mxUtils.write(Ya,G);Aa.appendChild(Ya);ub.appendChild(Aa);g.root.appendChild(ub);this._curvedTextGroup=ub}else g.text(r+u/2,B+C/2,0,0,G,mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE,!1,"",null,!1,0)}}};Gb.prototype.destroy=function(){null!=this._curvedTextGroup&&null!=this._curvedTextGroup.parentNode&&this._curvedTextGroup.parentNode.removeChild(this._curvedTextGroup);this._curvedTextGroup=null;mxRectangleShape.prototype.destroy.apply(this,arguments)};mxCellRenderer.registerShape("curvedText",Gb);mxUtils.extend(Ob,mxActor);Ob.prototype.tabSize=8;Ob.prototype.tabInset=4;Ob.prototype.holeSize=1;Ob.prototype.isRoundable=function(){return!1};Ob.prototype.redrawPath= function(g,r,B,u,C){r=Math.max(0,Math.min(u,parseFloat(mxUtils.getValue(this.style,"tabSize",this.tabSize))));var G=Math.max(0,Math.min(C,parseFloat(mxUtils.getValue(this.style,"tabInset",this.tabInset))));B=(C-G)/2;G=B+G;g.moveTo(0,B);g.lineTo(0,G);g.lineTo(r,C);g.lineTo(u,C);g.lineTo(u,0);g.lineTo(r,0);g.close();g.end()};Ob.prototype.paintVertexShape=function(g,r,B,u,C){mxActor.prototype.paintVertexShape.apply(this,arguments);var G=Math.max(0,parseFloat(mxUtils.getValue(this.style,"holeSize",this.holeSize))); if(!(0>=G)){var I=parseFloat(mxUtils.getValue(this.style,"tabSize",this.tabSize)),da=mxUtils.getValue(this.style,"holeColor",mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,"#333333"));g.setFillColor(da);g.setStrokeColor(da);g.begin();g.ellipse(I/2-G,C/2-G,2*G,2*G);g.fillAndStroke()}};Ob.prototype.getLabelBounds=function(g){var r=parseFloat(mxUtils.getValue(this.style,"tabSize",this.tabSize))*this.scale;return new mxRectangle(g.x+r,g.y,g.width-r,g.height)};mxCellRenderer.registerShape("gitTag", Ob);mxUtils.extend(bc,mxShape);bc.prototype.paintVertexShape=function(g,r,B,u,C){var G=mxUtils.getValue(this.style,"innerColor","#ECECFF");g.translate(r,B);g.ellipse(0,0,u,C);g.fillAndStroke();r=.6*Math.min(u,C);u=(u-r)/2;C=(C-r)/2;g.setFillColor(G);g.setStrokeColor(G);g.ellipse(u,C,r,r);g.fillAndStroke()};mxCellRenderer.registerShape("gitMergeCommit",bc);mxUtils.extend($b,mxShape);$b.prototype.paintVertexShape=function(g,r,B,u,C){var G=mxUtils.getValue(this.style,"featureColor","#fff");g.translate(r, B);r=u/2;B=C/2;var I=Math.min(u,C)/20;g.ellipse(0,0,u,C);g.fillAndStroke();g.setFillColor(G);g.setStrokeColor(G);g.setStrokeWidth(0);u=2.75*I;g.ellipse(r-3*I-u,B+2*I-u,2*u,2*u);g.fillAndStroke();g.ellipse(r+3*I-u,B+2*I-u,2*u,2*u);g.fillAndStroke();g.setStrokeWidth(1*I);g.begin();g.moveTo(r+3*I,B+1*I);g.lineTo(r,B-5*I);g.stroke();g.begin();g.moveTo(r-3*I,B+1*I);g.lineTo(r,B-5*I);g.stroke()};mxCellRenderer.registerShape("gitCherryPick",$b);mxUtils.extend(Wb,mxActor);Wb.prototype.isRoundable=function(){return!1}; Wb.prototype.redrawPath=function(g,r,B,u,C){r=.8*u;C*=.8;B=.15*r;u=.8*B;var G=.1*r,I=.1*C;g.moveTo(G,I);G+=.25*r;I+=.1*-C;g.arcTo(B,B,0,0,0,G,I);G+=.25*r;I+=0;g.arcTo(B,B,0,0,0,G,I);G+=.25*r;I+=0;g.arcTo(B,B,0,0,0,G,I);G+=.25*r;I+=.1*C;g.arcTo(B,B,0,0,0,G,I);G+=.15*r;I+=.33*C;g.arcTo(B,B,0,0,0,G,I);G+=0;I+=.34*C;g.arcTo(u,u,0,0,0,G,I);G+=.15*-r;I+=.33*C;g.arcTo(B,B,0,0,0,G,I);G+=.25*-r;I+=.15*C;g.arcTo(B,B,0,0,0,G,I);G+=.25*-r;I+=0;g.arcTo(B,B,0,0,0,G,I);G+=.25*-r;I+=0;g.arcTo(B,B,0,0,0,G,I);G+=.25* -r;I+=.15*-C;g.arcTo(B,B,0,0,0,G,I);G+=.1*-r;I+=.33*-C;g.arcTo(B,B,0,0,0,G,I);G+=0;I+=.34*-C;g.arcTo(u,u,0,0,0,G,I);g.arcTo(B,B,0,0,0,G+.1*r,I+.33*-C);g.close();g.end()};Wb.prototype.getLabelBounds=function(g){var r=.1*g.width,B=.1*g.height;return new mxRectangle(g.x+r,g.y+B,g.width-2*r,g.height-2*B)};mxCellRenderer.registerShape("mindmapBang",Wb);mxUtils.extend(Cb,mxActor);Cb.prototype.isRoundable=function(){return!1};Cb.prototype.redrawPath=function(g,r,B,u,C){g.moveTo(0,0);g.lineTo(0,C);g.quadTo(2* u,C/2,0,0);g.close();g.end()};mxCellRenderer.registerShape("ishikawaHead",Cb);mxUtils.extend(Hb,mxActor);Hb.prototype.isRoundable=function(){return!1};Hb.prototype.redrawPath=function(g,r,B,u,C){r=C/4;g.moveTo(0,0);g.lineTo(r,C/2);g.lineTo(0,C);g.lineTo(u,C);g.lineTo(u,0);g.close();g.end()};Hb.prototype.getLabelBounds=function(g){var r=g.height/4;return new mxRectangle(g.x+r,g.y,g.width-r,g.height)};mxCellRenderer.registerShape("mermaidOdd",Hb);mxUtils.extend(Ab,mxActor);Ab.prototype.isRoundable= function(){return!1};Ab.prototype.paintVertexShape=function(g,r,B,u,C){g.setLineJoin&&g.setLineJoin("round");mxActor.prototype.paintVertexShape.apply(this,arguments)};Ab.prototype.redrawPath=function(g,r,B,u,C){var G={};mxUtils.getValue(this.style,"dirs","right").split(/[,| ]+/).forEach(function(I){I=I.trim().toLowerCase();"x"===I?(G.right=!0,G.left=!0):"y"===I?(G.up=!0,G.down=!0):I&&(G[I]=!0)});B=parseFloat(mxUtils.getValue(this.style,"nodePadding","8"));r=C/2;B/=2;u=G.right&&G.left&&G.up&&G.down? [[0,0],[r,0],[u/2,2*B],[u-r,0],[u,0],[u,-C/3],[u+2*B,-C/2],[u,-2*C/3],[u,-C],[u-r,-C],[u/2,-C-2*B],[r,-C],[0,-C],[0,-2*C/3],[-2*B,-C/2],[0,-C/3]]:G.right&&G.left&&G.up?[[r,0],[u-r,0],[u,-C/2],[u-r,-C],[r,-C],[0,-C/2]]:G.right&&G.left&&G.down?[[0,0],[r,-C],[u-r,-C],[u,0]]:G.right&&G.up&&G.down?[[0,0],[u,-r],[u,-C+r],[0,-C]]:G.left&&G.up&&G.down?[[u,0],[0,-r],[0,-C+r],[u,-C]]:G.right&&G.left?[[r,0],[r,-B],[u-r,-B],[u-r,0],[u,-C/2],[u-r,-C],[u-r,-C+B],[r,-C+B],[r,-C],[0,-C/2]]:G.up&&G.down?[[u/2,0], [0,-B],[r,-B],[r,-C+B],[0,-C+B],[u/2,-C],[u,-C+B],[u-r,-C+B],[u-r,-B],[u,-B]]:G.right&&G.up?[[0,0],[u,-r],[0,-C]]:G.right&&G.down?[[0,0],[u,0],[0,-C]]:G.left&&G.up?[[u,0],[0,-r],[u,-C]]:G.left&&G.down?[[u,0],[0,0],[u,-C]]:G.right?[[r,-B],[u-r,-B],[u-r,0],[u,-C/2],[u-r,-C],[u-r,-C+B],[r,-C+B]]:G.left?[[r,0],[r,-B],[u-r,-B],[u-r,-C+B],[r,-C+B],[r,-C],[0,-C/2]]:G.up?[[r,-B],[r,-C+B],[0,-C+B],[u/2,-C],[u,-C+B],[u-r,-C+B],[u-r,-B]]:G.down?[[u/2,0],[0,-B],[r,-B],[r,-C+B],[u-r,-C+B],[u-r,-B],[u,-B]]:[[0, 0],[u,0],[u,-C],[0,-C]];g.moveTo(u[0][0],C+u[0][1]);for(r=1;r<u.length;r++)g.lineTo(u[r][0],C+u[r][1]);g.close();g.end()};mxCellRenderer.registerShape("mermaidBlockArrow",Ab);mxUtils.extend(Db,mxConnector);Db.prototype.defaultWidth=10;Db.prototype.getEdgeWidth=function(){return Math.max(1,mxUtils.getNumber(this.style,"width",this.defaultWidth))};Db.prototype.getSvgScreenOffset=function(){return 0};Db.prototype.augmentBoundingBox=function(g){mxShape.prototype.augmentBoundingBox.apply(this,arguments); var r=(this.getEdgeWidth()/2+this.strokewidth)*this.scale;g.y-=r;g.height+=2*r};Db.prototype.paintEdgeShape=function(g,r){var B=r[0],u=r[r.length-1];if(null!=B&&null!=u){r=B.x;B=B.y;var C=u.x;u=u.y;for(var G=(r+C)/2,I=this.getEdgeWidth()/2,da=[],U=[],Aa=0;32>=Aa;Aa++){var pa=Aa/32,Ya=1-pa,ub=Ya*Ya*Ya*r+3*Ya*Ya*pa*G+3*Ya*pa*pa*G+pa*pa*pa*C,mb=Ya*Ya*Ya*B+3*Ya*Ya*pa*B+3*Ya*pa*pa*u+pa*pa*pa*u,Qa=3*Ya*Ya*(G-r)+3*pa*pa*(C-G);Ya=6*Ya*pa*(u-B);pa=Math.sqrt(Qa*Qa+Ya*Ya);0==pa&&(Qa=1,Ya=0,pa=1);Ya=-Ya/pa*I; Qa=Qa/pa*I;da.push(new mxPoint(ub+Ya,mb+Qa));U.push(new mxPoint(ub-Ya,mb-Qa))}g.begin();g.moveTo(da[0].x,da[0].y);for(Aa=1;32>=Aa;Aa++)g.lineTo(da[Aa].x,da[Aa].y);for(Aa=32;0<=Aa;Aa--)g.lineTo(U[Aa].x,U[Aa].y);g.close();r=g.node;g.fillAndStroke();null!=r&&null!=r.setAttribute&&null!=r.parentNode&&(g=r.getAttribute("style"),r.setAttribute("style",(null!=g&&""!=g?g+";":"")+"mix-blend-mode:multiply"))}};mxCellRenderer.registerShape("mermaidSankeyLink",Db);if("undefined"!==typeof mxVertexHandler){var Ta= function(g,r,B){return kb(g,["width"],r,function(u,C,G,I,da){da=g.shape.getEdgeWidth()*g.view.scale+B;return new mxPoint(I.x+C*u/4+G*da/2,I.y+G*u/4-C*da/2)},function(u,C,G,I,da,U){u=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,da.x,da.y,U.x,U.y));g.style.width=Math.round(Math.round(2*u)/g.view.scale-B)})},kb=function(g,r,B,u,C){return ib(g,r,function(G){var I=g.absolutePoints;if(null!=I&&0<I.length){var da=I.length-1;G=g.view.translate;var U=g.view.scale,Aa=B?I[0]:I[da];I=B?I[1]:I[da-1];da=I.x-Aa.x;var pa= I.y-Aa.y,Ya=Math.sqrt(da*da+pa*pa);Aa=u.call(this,Ya,da/Ya,pa/Ya,Aa,I);return new mxPoint(Aa.x/U-G.x,Aa.y/U-G.y)}return null},function(G,I,da){var U=g.absolutePoints,Aa=U.length-1;G=g.view.translate;var pa=g.view.scale,Ya=B?U[0]:U[Aa];U=B?U[1]:U[Aa-1];Aa=U.x-Ya.x;var ub=U.y-Ya.y,mb=Math.sqrt(Aa*Aa+ub*ub);I.x=(I.x+G.x)*pa;I.y=(I.y+G.y)*pa;C.call(this,mb,Aa/mb,ub/mb,Ya,U,I,da)})},nb=function(g,r){return function(B){return[kb(B,["startWidth"],!0,function(u,C,G,I,da){da=mxUtils.getNumber(B.style,"startWidth", g)*B.view.scale+r;return new mxPoint(I.x+C*u/4+G*da/2,I.y+G*u/4-C*da/2)},function(u,C,G,I,da,U){u=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,da.x,da.y,U.x,U.y));B.style.startWidth=Math.round(2*u)/B.view.scale-r})]}},qb=function(g){return function(r){return[ib(r,["arrowWidth","arrowSize"],function(B){var u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Va.prototype.arrowWidth))),C=Math.max(0,Math.min(g,mxUtils.getValue(this.state.style,"arrowSize",Va.prototype.arrowSize)));return new mxPoint(B.x+ (1-C)*B.width,B.y+(1-u)*B.height/2)},function(B,u){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(B.y+B.height/2-u.y)/B.height*2));this.state.style.arrowSize=Math.max(0,Math.min(g,(B.x+B.width-u.x)/B.width))})]}},sb=function(g){return function(r){return[ib(r,["size"],function(B){var u=Math.max(0,Math.min(.5*B.height,parseFloat(mxUtils.getValue(this.state.style,"size",g))));return new mxPoint(B.x,B.y+u)},function(B,u){this.state.style.size=Math.max(0,u.y-B.y)},!0)]}},eb=function(g,r,B){return function(u){var C= [ib(u,["size"],function(G){var I=Math.max(0,Math.min(G.width,Math.min(G.height,parseFloat(mxUtils.getValue(this.state.style,"size",r)))))*g;return new mxPoint(G.x+I,G.y+I)},function(G,I){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(G.width,I.x-G.x),Math.min(G.height,I.y-G.y)))/g)},!1)];B&&mxUtils.getValue(u.style,mxConstants.STYLE_ROUNDED,!1)&&C.push(tb(u));return C}},hb=function(g,r,B,u,C){B=null!=B?B:.5;return function(G){var I=[ib(G,["size"],function(da){var U=null!=C?"0"!=mxUtils.getValue(this.state.style, "fixedSize","0"):null,Aa=parseFloat(mxUtils.getValue(this.state.style,"size",U?C:g));return new mxPoint(da.x+Math.max(0,Math.min(.5*da.width,Aa*(U?1:da.width))),da.getCenterY())},function(da,U,Aa){da=null!=C&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?U.x-da.x:Math.max(0,Math.min(B,(U.x-da.x)/da.width));this.state.style.size=da},!1,u)];r&&mxUtils.getValue(G.style,mxConstants.STYLE_ROUNDED,!1)&&I.push(tb(G));return I}},bb=function(g,r,B){g=null!=g?g:.5;return function(u){var C=[ib(u,["size"], function(G){var I=null!=B?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,da=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",I?B:r)));return new mxPoint(G.x+Math.min(.75*G.width*g,da*(I?.75:.75*G.width)),G.y+G.height/4)},function(G,I){G=null!=B&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?I.x-G.x:Math.max(0,Math.min(g,(I.x-G.x)/G.width*.75));this.state.style.size=G},!1,!0)];mxUtils.getValue(u.style,mxConstants.STYLE_ROUNDED,!1)&&C.push(tb(u));return C}},xb= function(){return function(g){var r=[];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(tb(g));return r}},tb=function(g,r){return ib(g,[mxConstants.STYLE_ARCSIZE],function(B){var u=null!=r?r:B.height/8;if("1"==mxUtils.getValue(g.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var C=mxUtils.getValue(g.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(B.x+B.width-Math.min(B.width/2,C),B.y+u)}C=Math.max(0,parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_ARCSIZE, 100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(B.x+B.width-Math.min(Math.max(B.width/2,B.height/2),Math.min(B.width,B.height)*C),B.y+u)},function(B,u,C){"1"==mxUtils.getValue(g.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(B.width,2*(B.x+B.width-u.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(B.width-u.x+B.x)/Math.min(B.width,B.height))))})},ib=function(g,r,B,u, C,G,I){var da=new mxHandle(g,null,mxVertexHandler.prototype.secondaryHandleImage);da.execute=function(Aa){for(var pa=0;pa<r.length;pa++)this.copyStyle(r[pa]);I&&I(Aa)};da.getPosition=B;da.setPosition=u;da.ignoreGrid=null!=C?C:!0;if(G){var U=da.positionChanged;da.positionChanged=function(){U.apply(this,arguments);g.view.invalidate(this.state.cell);g.view.validate()}}return da},zb={link:function(g){return[Ta(g,!0,10),Ta(g,!1,10)]},pipe:function(g){return[Ta(g,!0,10),Ta(g,!1,10)]},flexArrow:function(g){var r= g.view.graph.gridSize/g.view.scale,B=[];mxUtils.getValue(g.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(B.push(kb(g,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(u,C,G,I,da){u=(g.shape.getEdgeWidth()-g.shape.strokewidth)*g.view.scale;da=3*mxUtils.getNumber(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+C*(da+g.shape.strokewidth*g.view.scale)+G*u/2,I.y+G*(da+g.shape.strokewidth*g.view.scale)- C*u/2)},function(u,C,G,I,da,U,Aa){u=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,da.x,da.y,U.x,U.y));C=mxUtils.ptLineDist(I.x,I.y,I.x+G,I.y-C,U.x,U.y);g.style[mxConstants.STYLE_STARTSIZE]=Math.round((C-g.shape.strokewidth)/3/g.view.scale);g.style.width=Math.round(2*u/g.view.scale);if(mxEvent.isShiftDown(Aa.getEvent())||mxEvent.isControlDown(Aa.getEvent()))g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE];mxEvent.isAltDown(Aa.getEvent())||Math.abs(parseFloat(g.style[mxConstants.STYLE_STARTSIZE])- parseFloat(g.style[mxConstants.STYLE_ENDSIZE]))<r/6&&(g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE])})),B.push(kb(g,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(u,C,G,I,da){u=(g.shape.getStartArrowWidth()-g.shape.strokewidth)*g.view.scale;da=3*mxUtils.getNumber(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+C*(da+g.shape.strokewidth*g.view.scale)+G*u/2,I.y+G*(da+g.shape.strokewidth* g.view.scale)-C*u/2)},function(u,C,G,I,da,U,Aa){u=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,da.x,da.y,U.x,U.y));C=mxUtils.ptLineDist(I.x,I.y,I.x+G,I.y-C,U.x,U.y);g.style[mxConstants.STYLE_STARTSIZE]=Math.round((C-g.shape.strokewidth)/3/g.view.scale);g.style.startWidth=Math.round(Math.max(0,Math.round(2*u)-g.shape.getEdgeWidth())/g.view.scale);if(mxEvent.isShiftDown(Aa.getEvent())||mxEvent.isControlDown(Aa.getEvent()))g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE],g.style.endWidth= g.style.startWidth;mxEvent.isAltDown(Aa.getEvent())||(Math.abs(parseFloat(g.style[mxConstants.STYLE_STARTSIZE])-parseFloat(g.style[mxConstants.STYLE_ENDSIZE]))<r/6&&(g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(g.style.startWidth)-parseFloat(g.style.endWidth))<r&&(g.style.startWidth=g.style.endWidth))})));mxUtils.getValue(g.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(B.push(kb(g,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE], !1,function(u,C,G,I,da){u=(g.shape.getEdgeWidth()-g.shape.strokewidth)*g.view.scale;da=3*mxUtils.getNumber(g.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+C*(da+g.shape.strokewidth*g.view.scale)-G*u/2,I.y+G*(da+g.shape.strokewidth*g.view.scale)+C*u/2)},function(u,C,G,I,da,U,Aa){u=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,da.x,da.y,U.x,U.y));C=mxUtils.ptLineDist(I.x,I.y,I.x+G,I.y-C,U.x,U.y);g.style[mxConstants.STYLE_ENDSIZE]=Math.round((C-g.shape.strokewidth)/ 3/g.view.scale);g.style.width=Math.round(2*u/g.view.scale);if(mxEvent.isShiftDown(Aa.getEvent())||mxEvent.isControlDown(Aa.getEvent()))g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE];mxEvent.isAltDown(Aa.getEvent())||Math.abs(parseFloat(g.style[mxConstants.STYLE_ENDSIZE])-parseFloat(g.style[mxConstants.STYLE_STARTSIZE]))<r/6&&(g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE])})),B.push(kb(g,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE], !1,function(u,C,G,I,da){u=(g.shape.getEndArrowWidth()-g.shape.strokewidth)*g.view.scale;da=3*mxUtils.getNumber(g.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*g.view.scale;return new mxPoint(I.x+C*(da+g.shape.strokewidth*g.view.scale)-G*u/2,I.y+G*(da+g.shape.strokewidth*g.view.scale)+C*u/2)},function(u,C,G,I,da,U,Aa){u=Math.sqrt(mxUtils.ptSegDistSq(I.x,I.y,da.x,da.y,U.x,U.y));C=mxUtils.ptLineDist(I.x,I.y,I.x+G,I.y-C,U.x,U.y);g.style[mxConstants.STYLE_ENDSIZE]=Math.round((C-g.shape.strokewidth)/ 3/g.view.scale);g.style.endWidth=Math.round(Math.max(0,Math.round(2*u)-g.shape.getEdgeWidth())/g.view.scale);if(mxEvent.isShiftDown(Aa.getEvent())||mxEvent.isControlDown(Aa.getEvent()))g.style[mxConstants.STYLE_STARTSIZE]=g.style[mxConstants.STYLE_ENDSIZE],g.style.startWidth=g.style.endWidth;mxEvent.isAltDown(Aa.getEvent())||(Math.abs(parseFloat(g.style[mxConstants.STYLE_ENDSIZE])-parseFloat(g.style[mxConstants.STYLE_STARTSIZE]))<r/6&&(g.style[mxConstants.STYLE_ENDSIZE]=g.style[mxConstants.STYLE_STARTSIZE]), Math.abs(parseFloat(g.style.endWidth)-parseFloat(g.style.startWidth))<r&&(g.style.endWidth=g.style.startWidth))})));return B},swimlane:function(g){var r=[];if(mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED)){var B=parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));r.push(tb(g,B/2))}r.push(ib(g,[mxConstants.STYLE_STARTSIZE],function(u){var C=parseFloat(mxUtils.getValue(g.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(g.style, mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(u.getCenterX(),u.y+Math.max(0,Math.min(u.height,C))):new mxPoint(u.x+Math.max(0,Math.min(u.width,C)),u.getCenterY())},function(u,C){g.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(u.height,C.y-u.y))):Math.round(Math.max(0,Math.min(u.width,C.x-u.x)))},!1,null,function(u){var C=g.view.graph;if(!mxEvent.isShiftDown(u.getEvent())&&!mxEvent.isControlDown(u.getEvent())&&(C.isTableRow(g.cell)|| C.isTableCell(g.cell))){u=C.getSwimlaneDirection(g.style);var G=C.model.getParent(g.cell);G=C.model.getChildCells(G,!0);for(var I=[],da=0;da<G.length;da++)G[da]!=g.cell&&C.isSwimlane(G[da])&&C.getSwimlaneDirection(C.getCurrentCellStyle(G[da]))==u&&I.push(G[da]);C.setCellStyles(mxConstants.STYLE_STARTSIZE,g.style[mxConstants.STYLE_STARTSIZE],I)}}));return r},label:xb(),ext:xb(),rectangle:xb(),triangle:xb(),rhombus:xb(),umlLifeline:function(g){return[ib(g,["size"],function(r){var B=Math.max(0,Math.min(r.height, parseFloat(mxUtils.getValue(this.state.style,"size",Ca.prototype.size))));return new mxPoint(r.getCenterX(),r.y+B)},function(r,B){this.state.style.size=Math.round(Math.max(0,Math.min(r.height,B.y-r.y)))},!1)]},umlFrame:function(g){return[ib(g,["width","height"],function(r){var B=Math.max(la.prototype.corner,Math.min(r.width,mxUtils.getValue(this.state.style,"width",la.prototype.width))),u=Math.max(1.5*la.prototype.corner,Math.min(r.height,mxUtils.getValue(this.state.style,"height",la.prototype.height))); return new mxPoint(r.x+B,r.y+u)},function(r,B){this.state.style.width=Math.round(Math.max(la.prototype.corner,Math.min(r.width,B.x-r.x)));this.state.style.height=Math.round(Math.max(1.5*la.prototype.corner,Math.min(r.height,B.y-r.y)))},!1)]},process:function(g){var r=[ib(g,["size"],function(B){var u="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),C=parseFloat(mxUtils.getValue(this.state.style,"size",ka.prototype.size));return u?new mxPoint(B.x+C,B.y+B.height/4):new mxPoint(B.x+B.width*C,B.y+ B.height/4)},function(B,u){B="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(.5*B.width,u.x-B.x)):Math.max(0,Math.min(.5,(u.x-B.x)/B.width));this.state.style.size=B},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(tb(g));return r},cross:function(g){return[ib(g,["size"],function(r){var B=Math.min(r.width,r.height);B=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",Mb.prototype.size)))*B/2;return new mxPoint(r.getCenterX()-B,r.getCenterY()- B)},function(r,B){var u=Math.min(r.width,r.height);this.state.style.size=Math.max(0,Math.min(1,Math.min(Math.max(0,r.getCenterY()-B.y)/u*2,Math.max(0,r.getCenterX()-B.x)/u*2)))})]},note:function(g){return[ib(g,["size"],function(r){var B=Math.max(0,Math.min(r.width,Math.min(r.height,parseFloat(mxUtils.getValue(this.state.style,"size",F.prototype.size)))));return new mxPoint(r.x+r.width-B,r.y+B)},function(r,B){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(r.width,r.x+r.width-B.x),Math.min(r.height, B.y-r.y))))})]},note2:function(g){return[ib(g,["size"],function(r){var B=Math.max(0,Math.min(r.width,Math.min(r.height,parseFloat(mxUtils.getValue(this.state.style,"size",P.prototype.size)))));return new mxPoint(r.x+r.width-B,r.y+B)},function(r,B){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(r.width,r.x+r.width-B.x),Math.min(r.height,B.y-r.y))))})]},manualInput:function(g){var r=[ib(g,["size"],function(B){var u=Math.max(0,Math.min(B.height,mxUtils.getValue(this.state.style,"size", za.prototype.size)));return new mxPoint(B.x+B.width/4,B.y+3*u/4)},function(B,u){this.state.style.size=Math.round(Math.max(0,Math.min(B.height,4*(u.y-B.y)/3)))},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(tb(g));return r},dataStorage:function(g){return[ib(g,["size"],function(r){var B="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),u=parseFloat(mxUtils.getValue(this.state.style,"size",B?Ea.prototype.fixedSize:Ea.prototype.size));return new mxPoint(r.x+r.width-u*(B?1: r.width),r.getCenterY())},function(r,B){r="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(r.width,r.x+r.width-B.x)):Math.max(0,Math.min(1,(r.x+r.width-B.x)/r.width));this.state.style.size=r},!1)]},callout:function(g){var r=[ib(g,["size","position"],function(B){var u=Math.max(0,Math.min(B.height,mxUtils.getValue(this.state.style,"size",ua.prototype.size))),C=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",ua.prototype.position)));mxUtils.getValue(this.state.style, "base",ua.prototype.base);return new mxPoint(B.x+C*B.width,B.y+B.height-u)},function(B,u){mxUtils.getValue(this.state.style,"base",ua.prototype.base);this.state.style.size=Math.round(Math.max(0,Math.min(B.height,B.y+B.height-u.y)));this.state.style.position=Math.round(100*Math.max(0,Math.min(1,(u.x-B.x)/B.width)))/100},!1),ib(g,["position2"],function(B){var u=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",ua.prototype.position2)));return new mxPoint(B.x+u*B.width,B.y+B.height)}, function(B,u){this.state.style.position2=Math.round(100*Math.max(0,Math.min(1,(u.x-B.x)/B.width)))/100},!1),ib(g,["base"],function(B){var u=Math.max(0,Math.min(B.height,mxUtils.getValue(this.state.style,"size",ua.prototype.size))),C=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",ua.prototype.position))),G=Math.max(0,Math.min(B.width,mxUtils.getValue(this.state.style,"base",ua.prototype.base)));return new mxPoint(B.x+Math.min(B.width,C*B.width+G),B.y+B.height-u)},function(B,u){var C= Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",ua.prototype.position)));this.state.style.base=Math.round(Math.max(0,Math.min(B.width,u.x-B.x-C*B.width)))},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(tb(g));return r},wedgeCallout:function(g){var r=[ib(g,["tipX","tipY"],function(B){var u=null!=this.state.shape?this.state.shape.getTipOffset():new mxPoint(Ba.prototype.tipX,Ba.prototype.tipY);return new mxPoint(B.getCenterX()+u.x*B.width,B.getCenterY()+u.y*B.height)}, function(B,u){var C=Ba.prototype.maxTipOffset;this.state.style.tipX=Math.round(1E3*Math.max(-C,Math.min(C,(u.x-B.getCenterX())/Math.max(1,B.width))))/1E3;this.state.style.tipY=Math.round(1E3*Math.max(-C,Math.min(C,(u.y-B.getCenterY())/Math.max(1,B.height))))/1E3},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(tb(g));return r},internalStorage:function(g){var r=[ib(g,["dx","dy"],function(B){var u=Math.max(0,Math.min(B.width,mxUtils.getValue(this.state.style,"dx",Ja.prototype.dx))), C=Math.max(0,Math.min(B.height,mxUtils.getValue(this.state.style,"dy",Ja.prototype.dy)));return new mxPoint(B.x+u,B.y+C)},function(B,u){this.state.style.dx=Math.round(Math.max(0,Math.min(B.width,u.x-B.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(B.height,u.y-B.y)))},!1)];mxUtils.getValue(g.style,mxConstants.STYLE_ROUNDED,!1)&&r.push(tb(g));return r},module:function(g){return[ib(g,["jettyWidth","jettyHeight"],function(r){var B=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style, "jettyWidth",Ga.prototype.jettyWidth))),u=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"jettyHeight",Ga.prototype.jettyHeight)));return new mxPoint(r.x+B/2,r.y+2*u)},function(r,B){this.state.style.jettyWidth=Math.round(2*Math.max(0,Math.min(r.width,B.x-r.x)));this.state.style.jettyHeight=Math.round(Math.max(0,Math.min(r.height,B.y-r.y))/2)})]},corner:function(g){return[ib(g,["dx","dy"],function(r){var B=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"dx",Ha.prototype.dx))), u=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"dy",Ha.prototype.dy)));return new mxPoint(r.x+B,r.y+u)},function(r,B){this.state.style.dx=Math.round(Math.max(0,Math.min(r.width,B.x-r.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(r.height,B.y-r.y)))},!1)]},tee:function(g){return[ib(g,["dx","dy"],function(r){var B=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style,"dx",ab.prototype.dx))),u=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"dy",ab.prototype.dy))); return new mxPoint(r.x+(r.width+B)/2,r.y+u)},function(r,B){this.state.style.dx=Math.round(Math.max(0,2*Math.min(r.width/2,B.x-r.x-r.width/2)));this.state.style.dy=Math.round(Math.max(0,Math.min(r.height,B.y-r.y)))},!1)]},singleArrow:qb(1),doubleArrow:qb(.5),"mxgraph.arrows2.wedgeArrow":nb(20,20),"mxgraph.arrows2.wedgeArrowDashed":nb(20,20),"mxgraph.arrows2.wedgeArrowDashed2":nb(20,20),folder:function(g){return[ib(g,["tabWidth","tabHeight"],function(r){var B=Math.max(0,Math.min(r.width,mxUtils.getValue(this.state.style, "tabWidth",q.prototype.tabWidth))),u=Math.max(0,Math.min(r.height,mxUtils.getValue(this.state.style,"tabHeight",q.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(B=r.width-B);return new mxPoint(r.x+B,r.y+u)},function(r,B){var u=Math.max(0,Math.min(r.width,B.x-r.x));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(u=r.width-u);this.state.style.tabWidth=Math.round(u);this.state.style.tabHeight= Math.round(Math.max(0,Math.min(r.height,B.y-r.y)))},!1)]},document:function(g){return[ib(g,["size"],function(r){var B=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",Q.prototype.size))));return new mxPoint(r.x+3*r.width/4,r.y+(1-B)*r.height)},function(r,B){this.state.style.size=Math.max(0,Math.min(1,(r.y+r.height-B.y)/r.height))},!1)]},tape:function(g){return[ib(g,["size"],function(r){var B=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",K.prototype.size)))); return new mxPoint(r.getCenterX(),r.y+B*r.height/2)},function(r,B){this.state.style.size=Math.max(0,Math.min(1,(B.y-r.y)/r.height*2))},!1)]},isoCube2:function(g){return[ib(g,["isoAngle"],function(r){var B=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.state.style,"isoAngle",T.isoAngle))))*Math.PI/200;return new mxPoint(r.x,r.y+Math.min(r.width*Math.tan(B),.5*r.height))},function(r,B){this.state.style.isoAngle=Math.max(0,50*(B.y-r.y)/r.height)},!0)]},cylinder2:sb(c.prototype.size),cylinder3:sb(f.prototype.size), offPageConnector:function(g){return[ib(g,["size"],function(r){var B=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",gb.prototype.size))));return new mxPoint(r.getCenterX(),r.y+(1-B)*r.height)},function(r,B){this.state.style.size=Math.max(0,Math.min(1,(r.y+r.height-B.y)/r.height))},!1)]},"mxgraph.basic.rect":function(g){var r=[Graph.createHandle(g,["size"],function(B){var u=Math.max(0,Math.min(B.width/2,B.height/2,parseFloat(mxUtils.getValue(this.state.style,"size",this.size)))); return new mxPoint(B.x+u,B.y+u)},function(B,u){this.state.style.size=Math.round(100*Math.max(0,Math.min(B.height/2,B.width/2,u.x-B.x)))/100})];g=Graph.createHandle(g,["indent"],function(B){var u=Math.max(0,Math.min(100,parseFloat(mxUtils.getValue(this.state.style,"indent",this.dx2))));return new mxPoint(B.x+.75*B.width,B.y+u*B.height/200)},function(B,u){this.state.style.indent=Math.round(100*Math.max(0,Math.min(100,200*(u.y-B.y)/B.height)))/100});r.push(g);return r},curvedText:function(g){var r=function(B){return(null!= B.shape?B.shape._curveYOffset:0)||0};return[ib(g,["arcStartY"],function(B){var u=parseFloat(mxUtils.getValue(this.state.style,"arcStartY",Gb.prototype.arcStartY)),C=r(this.state);return new mxPoint(B.x+10,B.y+Math.max(0,Math.min(B.height,u+C)))},function(B,u){var C=r(this.state);this.state.style.arcStartY=Math.round(Math.max(0,Math.min(B.height,u.y-B.y))-C)},!1),ib(g,["arcMidY"],function(B){var u=parseFloat(mxUtils.getValue(this.state.style,"arcStartY",Gb.prototype.arcStartY)),C=parseFloat(mxUtils.getValue(this.state.style, "arcEndY",Gb.prototype.arcEndY)),G=parseFloat(mxUtils.getValue(this.state.style,"arcMidY",Gb.prototype.arcMidY));u=(u+C)/2;C=r(this.state);return new mxPoint(B.x+B.width/2+10,B.y+Math.max(0,Math.min(B.height,u+G+C)))},function(B,u){var C=parseFloat(mxUtils.getValue(this.state.style,"arcStartY",Gb.prototype.arcStartY)),G=parseFloat(mxUtils.getValue(this.state.style,"arcEndY",Gb.prototype.arcEndY));C=(C+G)/2;G=r(this.state);var I=Math.max(Math.abs(Gb.prototype.arcMidY),Math.min(C,B.height-C));this.state.style.arcMidY= Math.round(Math.max(-I,Math.min(I,u.y-B.y-G-C)))},!1),ib(g,["arcEndY"],function(B){var u=parseFloat(mxUtils.getValue(this.state.style,"arcEndY",Gb.prototype.arcEndY)),C=r(this.state);return new mxPoint(B.x+B.width-10,B.y+Math.max(0,Math.min(B.height,u+C)))},function(B,u){var C=r(this.state);this.state.style.arcEndY=Math.round(Math.max(0,Math.min(B.height,u.y-B.y))-C)},!1)]},step:hb(ia.prototype.size,!0,null,!0,ia.prototype.fixedSize),hexagon:hb(l.prototype.size,!0,.5,!0,l.prototype.fixedSize),curlyBracket:hb(ea.prototype.size, !1),display:hb(Xb.prototype.size,!1),cube:eb(1,p.prototype.size,!1),card:eb(.5,E.prototype.size,!0),loopLimit:eb(.5,$a.prototype.size,!0),trapezoid:bb(.5,J.prototype.size,J.prototype.fixedSize),parallelogram:bb(1,W.prototype.size,W.prototype.fixedSize),zigzag:function(g){return[ib(g,["size"],function(r){var B=Math.max(5,parseFloat(mxUtils.getValue(this.state.style,"size",Yb.prototype.size)));return new mxPoint(r.x+3*B,r.y)},function(r,B){this.state.style.size=Math.max(5,Math.round((B.x-r.x)/3))}, !1)]}};Graph.createHandle=ib;Graph.handleFactory=zb;var Kb=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){var g=Kb.apply(this,arguments);if(this.graph.isCellRotatable(this.state.cell)){var r=this.state.style.shape;null==mxCellRenderer.defaultShapes[r]&&null==mxStencilRegistry.getStencil(r)?r=mxConstants.SHAPE_RECTANGLE:this.state.view.graph.isSwimlane(this.state.cell)&&(r=mxConstants.SHAPE_SWIMLANE);r=zb[r];null==r&&null!=this.state.shape&&this.state.shape.isRoundable()&& (r=zb[mxConstants.SHAPE_RECTANGLE]);null!=r&&(r=r(this.state),null!=r&&(g=null==g?r:g.concat(r)))}return g};mxEdgeHandler.prototype.createCustomHandles=function(){var g=this.state.style.shape;null==mxCellRenderer.defaultShapes[g]&&null==mxStencilRegistry.getStencil(g)&&(g=mxConstants.SHAPE_CONNECTOR);g=zb[g];return null!=g?g(this.state):null}}else Graph.createHandle=function(){},Graph.handleFactory={};var Nb=Graph.prototype.getPreferredSizeForCell;Graph.prototype.getPreferredSizeForCell=function(g, r,B){var u=this.getCellStyle(g);if(null!=u&&"curvedText"==u[mxConstants.STYLE_SHAPE]){var C=this.convertValueToString(g);if(null!=C&&0<C.length){var G=parseFloat(mxUtils.getValue(u,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)),I=mxUtils.getValue(u,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);u=mxUtils.getValue(u,mxConstants.STYLE_FONTSTYLE,0);C=.85*mxUtils.getSizeForString(C,G,I,null,u).width;I=this.model.getGeometry(g);I=null!=I?I.height:60;(B=null!=B?B:this.gridEnabled)&& (C=this.snap(C+this.gridSize/2));return new mxRectangle(0,0,Math.max(C,2*G)+10,I)}return null}return Nb.apply(this,arguments)};var Zb=mxCellRenderer.prototype.checkPlaceholderStyles;mxCellRenderer.prototype.checkPlaceholderStyles=function(g){return null!=g.style&&"curvedText"==g.style[mxConstants.STYLE_SHAPE]?!0:Zb.apply(this,arguments)};if("undefined"!==typeof mxCellEditor){var Sb=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(g,r){Sb.apply(this,arguments);var B= this.graph.view.getState(g);null!=B&&null!=B.style&&"curvedText"==B.style[mxConstants.STYLE_SHAPE]&&null!=B.shape&&B.shape.redraw()};var Pb=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(g){var r=this.editingCell;Pb.apply(this,arguments);null!=r&&(r=this.graph.view.getState(r),null!=r&&null!=r.style&&"curvedText"==r.style[mxConstants.STYLE_SHAPE]&&null!=r.shape&&r.shape.redraw())}}var Bb=new mxPoint(1,0),Eb=new mxPoint(1,0),Lb=mxUtils.toRadians(-30);Bb=mxUtils.getRotatedPoint(Bb, Math.cos(Lb),Math.sin(Lb));var dc=mxUtils.toRadians(-150);Eb=mxUtils.getRotatedPoint(Eb,Math.cos(dc),Math.sin(dc));mxEdgeStyle.IsometricConnector=function(g,r,B,u,C){var G=g.view;u=null!=u&&0<u.length?u[0]:null;var I=g.absolutePoints,da=I[0];I=I[I.length-1];null!=u&&(u=G.transformControlPoint(g,u));null==da&&null!=r&&(da=new mxPoint(r.getCenterX(),r.getCenterY()));null==I&&null!=B&&(I=new mxPoint(B.getCenterX(),B.getCenterY()));var U=Bb.x,Aa=Bb.y,pa=Eb.x,Ya=Eb.y,ub="horizontal"==mxUtils.getValue(g.style, "elbow","horizontal");if(null!=I&&null!=da){g=function(Qa,Ua,Wa){Qa-=mb.x;var Ra=Ua-mb.y;Ua=(Ya*Qa-pa*Ra)/(U*Ya-Aa*pa);Qa=(Aa*Qa-U*Ra)/(Aa*pa-U*Ya);ub?(Wa&&(mb=new mxPoint(mb.x+U*Ua,mb.y+Aa*Ua),C.push(mb)),mb=new mxPoint(mb.x+pa*Qa,mb.y+Ya*Qa)):(Wa&&(mb=new mxPoint(mb.x+pa*Qa,mb.y+Ya*Qa),C.push(mb)),mb=new mxPoint(mb.x+U*Ua,mb.y+Aa*Ua));C.push(mb)};var mb=da;null==u&&(u=new mxPoint(da.x+(I.x-da.x)/2,da.y+(I.y-da.y)/2));g(u.x,u.y,!0);g(I.x,I.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector); var Qb=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(g,r){if(r==mxEdgeStyle.IsometricConnector){var B=new mxElbowEdgeHandler(g);B.snapToTerminals=!1;return B}return Qb.apply(this,arguments)};z.prototype.constraints=[];D.prototype.getConstraints=function(g,r,B){g=[];var u=Math.tan(mxUtils.toRadians(30)),C=(.5-u)/2;u=Math.min(r,B/(.5+u));r=(r-u)/2;B=(B-u)/2;g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,B+.25*u));g.push(new mxConnectionConstraint(new mxPoint(0, 0),!1,null,r+.5*u,B+u*C));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+u,B+.25*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+u,B+.75*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r+.5*u,B+(1-C)*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,B+.75*u));return g};T.prototype.getConstraints=function(g,r,B){g=[];var u=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;u=Math.min(r* Math.tan(u),.5*B);g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,u));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,B-u));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,B-u));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null, 0,u));return g};ua.prototype.getConstraints=function(g,r,B){g=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var u=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"size",this.size))));parseFloat(mxUtils.getValue(this.style,"position",this.position));var C=r*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2))));parseFloat(mxUtils.getValue(this.style,"base",this.base));g.push(new mxConnectionConstraint(new mxPoint(0, 0),!1));g.push(new mxConnectionConstraint(new mxPoint(.25,0),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(.75,0),!1));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*(B-u)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,B-u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,C,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0, B-u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(B-u)));r>=2*u&&g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return g};mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0, .5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0)];mxEllipse.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0, 0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5))];Ub.prototype.constraints=mxRectangleShape.prototype.constraints;mxImageShape.prototype.constraints=mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints= mxRectangleShape.prototype.constraints;v.prototype.constraints=mxRectangleShape.prototype.constraints;mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints;Ob.prototype.constraints=mxRectangleShape.prototype.constraints;Ba.prototype.constraints=mxRectangleShape.prototype.constraints;Wb.prototype.constraints=mxEllipse.prototype.constraints;Hb.prototype.constraints=mxEllipse.prototype.constraints;A.prototype.constraints=mxEllipse.prototype.constraints;F.prototype.getConstraints=function(g, r,B){g=[];var u=Math.max(0,Math.min(r,Math.min(B,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-u),0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-u,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-.5*u,.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null, r,.5*(B+u)));g.push(new mxConnectionConstraint(new mxPoint(1,1),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));r>=2*u&&g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return g};E.prototype.getConstraints=function(g,r,B){g=[];var u=Math.max(0,Math.min(r,Math.min(B,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));g.push(new mxConnectionConstraint(new mxPoint(1, 0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(B+u)));g.push(new mxConnectionConstraint(new mxPoint(0,1),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(1, 1),!1));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));r>=2*u&&g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return g};p.prototype.getConstraints=function(g,r,B){g=[];var u=Math.max(0,Math.min(r,Math.min(B,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-u),0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-u,0));g.push(new mxConnectionConstraint(new mxPoint(0, 0),!1,null,r-.5*u,.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*(B+u)));g.push(new mxConnectionConstraint(new mxPoint(1,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,B-.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,B-u));g.push(new mxConnectionConstraint(new mxPoint(0, 0),!1,null,0,.5*(B-u)));return g};f.prototype.getConstraints=function(g,r,B){g=[];r=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"size",this.size))));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,r));g.push(new mxConnectionConstraint(new mxPoint(1, 0),!1,null,0,r));g.push(new mxConnectionConstraint(new mxPoint(1,1),!1,null,0,-r));g.push(new mxConnectionConstraint(new mxPoint(0,1),!1,null,0,-r));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,r+.5*(.5*B-r)));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,r+.5*(.5*B-r)));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,B-r-.5*(.5*B-r)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,B-r-.5*(.5*B-r)));g.push(new mxConnectionConstraint(new mxPoint(.145, 0),!1,null,0,.29*r));g.push(new mxConnectionConstraint(new mxPoint(.855,0),!1,null,0,.29*r));g.push(new mxConnectionConstraint(new mxPoint(.855,1),!1,null,0,.29*-r));g.push(new mxConnectionConstraint(new mxPoint(.145,1),!1,null,0,.29*-r));return g};q.prototype.getConstraints=function(g,r,B){g=[];var u=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))),C=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));"left"==mxUtils.getValue(this.style, "tabPosition",this.tabPosition)?(g.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,0)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,0)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,C)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),C))):(g.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-.5*u,0)),g.push(new mxConnectionConstraint(new mxPoint(0, 0),!1,null,r-u,0)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-u,C)),g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-u),C)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,C));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.25*(B-C)+C));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*(B-C)+C));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.75*(B-C)+C));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1, null,r,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,C));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.25*(B-C)+C));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(B-C)+C));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.75*(B-C)+C));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,B));g.push(new mxConnectionConstraint(new mxPoint(.25,1),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(.75, 1),!1));return g};Ja.prototype.constraints=mxRectangleShape.prototype.constraints;Ea.prototype.constraints=mxRectangleShape.prototype.constraints;ob.prototype.constraints=mxEllipse.prototype.constraints;vb.prototype.constraints=mxEllipse.prototype.constraints;rb.prototype.constraints=mxEllipse.prototype.constraints;Rb.prototype.constraints=mxEllipse.prototype.constraints;za.prototype.constraints=mxRectangleShape.prototype.constraints;ac.prototype.constraints=mxRectangleShape.prototype.constraints; Xb.prototype.getConstraints=function(g,r,B){g=[];var u=Math.min(r,B/2),C=Math.min(r-u,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*r);g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,C,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(C+r-u),0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-u,0));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null));g.push(new mxConnectionConstraint(new mxPoint(0, 0),!1,null,r-u,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(C+r-u),B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,C,B));return g};Ga.prototype.getConstraints=function(g,r,B){r=parseFloat(mxUtils.getValue(g,"jettyWidth",Ga.prototype.jettyWidth))/2;g=parseFloat(mxUtils.getValue(g,"jettyHeight",Ga.prototype.jettyHeight));var u=[new mxConnectionConstraint(new mxPoint(0,0),!1,null,r),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,r),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(B-.5*g,1.5*g)),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(B-.5*g,3.5*g))];B>5*g&&u.push(new mxConnectionConstraint(new mxPoint(0,.75),!1,null,r));B>8*g&&u.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null,r));B>15*g&&u.push(new mxConnectionConstraint(new mxPoint(0,.25),!1,null,r));return u};$a.prototype.constraints=mxRectangleShape.prototype.constraints;gb.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)];S.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)];Da.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)];k.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)];K.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)];ia.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,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];ra.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.5,1),!1)];mxDoubleEllipse.prototype.constraints=mxEllipse.prototype.constraints;mxRhombus.prototype.constraints=mxEllipse.prototype.constraints;mxTriangle.prototype.constraints= [new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0)];mxHexagon.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.375,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.625,0),!0),new mxConnectionConstraint(new mxPoint(0, .25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.375,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.625,1),!0)];mxCloud.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.25),!1),new mxConnectionConstraint(new mxPoint(.4, .1),!1),new mxConnectionConstraint(new mxPoint(.16,.55),!1),new mxConnectionConstraint(new mxPoint(.07,.4),!1),new mxConnectionConstraint(new mxPoint(.31,.8),!1),new mxConnectionConstraint(new mxPoint(.13,.77),!1),new mxConnectionConstraint(new mxPoint(.8,.8),!1),new mxConnectionConstraint(new mxPoint(.55,.95),!1),new mxConnectionConstraint(new mxPoint(.875,.5),!1),new mxConnectionConstraint(new mxPoint(.96,.7),!1),new mxConnectionConstraint(new mxPoint(.625,.2),!1),new mxConnectionConstraint(new mxPoint(.88, .25),!1)];W.prototype.constraints=mxRectangleShape.prototype.constraints;J.prototype.constraints=mxRectangleShape.prototype.constraints;Q.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;ab.prototype.getConstraints=function(g,r,B){g=[];var u=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),C=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(1, 0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*C));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,C));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.75*r+.25*u,C));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),C));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),.5*(B+C)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),B));g.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));g.push(new mxConnectionConstraint(new mxPoint(0, 0),!1,null,.5*(r-u),B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-u),.5*(B+C)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-u),C));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*r-.25*u,C));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,C));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*C));return g};Ha.prototype.getConstraints=function(g,r,B){g=[];var u=Math.max(0,Math.min(r,parseFloat(mxUtils.getValue(this.style, "dx",this.dx)))),C=Math.max(0,Math.min(B,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(1,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,.5*C));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,C));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+u),C));g.push(new mxConnectionConstraint(new mxPoint(0, 0),!1,null,u,C));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,.5*(B+C)));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,u,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*u,B));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,1),!1));return g};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)];Va.prototype.getConstraints=function(g,r,B){g=[];var u=B*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),C=r*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style, "arrowSize",this.arrowSize))));u=(B-u)/2;g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-C),u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-C,0));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-C,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r-C),B-u));g.push(new mxConnectionConstraint(new mxPoint(0, 0),!1,null,0,B-u));return g};db.prototype.getConstraints=function(g,r,B){g=[];var u=B*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Va.prototype.arrowWidth)))),C=r*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Va.prototype.arrowSize))));u=(B-u)/2;g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,C,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*r,u));g.push(new mxConnectionConstraint(new mxPoint(0, 0),!1,null,r-C,0));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r-C,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*r,B-u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,C,B));return g};Mb.prototype.getConstraints=function(g,r,B){g=[];var u=Math.min(B,r),C=Math.max(0,Math.min(u,u*parseFloat(mxUtils.getValue(this.style,"size",this.size))));u=(B-C)/2;var G=u+C,I=(r-C)/2;C=I+C;g.push(new mxConnectionConstraint(new mxPoint(0, 0),!1,null,I,.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,0));g.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,C,0));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,C,.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,C,u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,B-.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,B));g.push(new mxConnectionConstraint(new mxPoint(.5, 1),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,C,B));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,C,B-.5*u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,C,G));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(r+C),u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,u));g.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,r,G));g.push(new mxConnectionConstraint(new mxPoint(0, 0),!1,null,.5*(r+C),G));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,G));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*I,u));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,u));g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,G));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*I,G));g.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,I,u));return g};Ca.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)];cb.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)];Ia.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];La.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]})();function Actions(b){this.editorUi=b;this.actions={};this.init()} Actions.prototype.init=function(){function b(F){n.escape();F=n.deleteCells(n.getDeletableCells(n.getSelectionCells()),F);null!=F&&n.setSelectionCells(F)}function d(){if(!n.isSelectionEmpty()){n.getModel().beginUpdate();try{for(var F=n.getSelectionCells(),P=0;P<F.length;P++)n.cellLabelChanged(F[P],"")}finally{n.getModel().endUpdate()}}}function m(F,P,T,c,f){f.getModel().beginUpdate();try{var k=f.getCellGeometry(F);null!=k&&T&&c&&(T/=c,k=k.clone(),1<T?k.height=k.width/T:k.width=k.height*T,f.getModel().setGeometry(F, k));f.setCellStyles(mxConstants.STYLE_CLIP_PATH,P,[F]);f.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[F])}finally{f.getModel().endUpdate()}}var p=this.editorUi,t=p.editor,n=t.graph,z=function(){return Action.prototype.isEnabled.apply(this,arguments)&&n.isEnabled()};this.addAction("new...",function(){n.openLink(p.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";p.openFile()});var D=new Action("smartFit",function(){if(p.chromelessResize)n.isLightboxView()?(1== n.view.scale?p.lightboxFit():n.zoomTo(1),p.chromelessResize(!1)):p.chromelessResize(!0);else{n.popupMenuHandler.hideMenu();var F=n.view.scale,P=n.container.scrollLeft,T=n.container.scrollTop,c=n.view.translate.x,f=n.view.translate.y;p.actions.get("resetView").funct();1E-5>Math.abs(F-n.view.scale)&&5>Math.abs(P-n.container.scrollLeft)&&5>Math.abs(T-n.container.scrollTop)&&c==n.view.translate.x&&f==n.view.translate.y&&p.actions.get("fitWindow").funct()}},null,null,"Enter");D.getTitle=function(){return mxResources.get("fitWindow")+ " / "+mxResources.get("resetView")};this.put("smartFit",D);this.addAction("keyPressEnter",function(){n.isSelectionEmpty()?p.actions.get("smartFit").funct():n.isEnabled()&&n.startEditingAtCell()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){p.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(F,P){try{var T=mxUtils.parseXml(F);t.graph.setSelectionCells(t.graph.importGraphModel(T.documentElement))}catch(c){mxUtils.alert(mxResources.get("invalidOrMissingFile")+ ": "+c.message)}}));p.showDialog((new OpenDialog(this)).container,320,220,!0,!0,function(){window.openFile=null})}).isEnabled=z;this.addAction("save",function(){p.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=z;this.addAction("saveAs...",function(){p.saveFile(!0)},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+S");this.addAction("export...",function(){p.showDialog((new ExportDialog(p)).container,360,396,!0,!0)});this.addAction("editDiagram...",function(){var F=new EditDiagramDialog(p);p.showDialog(F.container, 620,420,!0,!1,null,null,null,new mxRectangle(0,0,440,280));F.init()}).isEnabled=z;this.addAction("pageSetup...",function(){p.showDialog((new PageSetupDialog(p)).container,420,null,!0,!0)}).isEnabled=z;this.addAction("print...",function(){p.showPrintDialog()},null,"",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(n,null,10,10)});this.addAction("undo",function(){p.undo()},null,"",Editor.ctrlKey+"+Z");this.addAction("redo",function(){p.redo()},null,"",mxClient.IS_WIN?Editor.ctrlKey+ "+Y":Editor.ctrlKey+"+"+Editor.shiftKey+"+Z");this.addAction("cut",function(){var F=null;try{F=p.copyXml(),null!=F&&n.removeCells(F,!1)}catch(P){}try{null==F&&mxClipboard.cut(n)}catch(P){p.handleError(P)}},null,"",Editor.ctrlKey+"+X");this.addAction("copy",function(){try{p.copyXml()}catch(F){}try{mxClipboard.copy(n)}catch(F){p.handleError(F)}},null,"",Editor.ctrlKey+"+C");this.addAction("paste",function(){p.pasteFromClipboard()},!1,"",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(F){p.pasteFromClipboard(n.popupMenuHandler.getTriggerPoint())}); this.addAction("swap",function(){var F=n.getSelectionCells();2==F.length&&n.swapShapes(F[0],F[1])});this.addAction("copySize",function(){var F=n.getSelectionCell();n.isEnabled()&&null!=F&&n.getModel().isVertex(F)&&(F=n.getCellGeometry(F),null!=F&&(p.copiedSize=new mxRectangle(F.x,F.y,F.width,F.height)))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+F");this.addAction("pasteSize",function(){if(n.isEnabled()&&!n.isSelectionEmpty()&&null!=p.copiedSize){n.getModel().beginUpdate();try{for(var F=n.getResizableCells(n.getSelectionCells()), P=0;P<F.length;P++)if(n.getModel().isVertex(F[P])){var T=n.getCellGeometry(F[P]);null!=T&&(T=T.clone(),T.width=p.copiedSize.width,T.height=p.copiedSize.height,n.getModel().setGeometry(F[P],T))}}finally{n.getModel().endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+V");this.addAction("copyData",function(){var F=n.getSelectionCell()||n.getModel().getRoot();n.isEnabled()&&null!=F&&(F=F.cloneValue(),null==F||isNaN(F.nodeType)||(p.copiedValue=F))},null,null,Editor.altKey+"+"+Editor.shiftKey+ "+B");this.addAction("copyAsText",function(){var F=n.getSelectionCell();if(n.isEnabled()&&null!=F)try{n.isHtmlLabel(F)?p.writeHtmlToClipboard(n.getLabel(F),mxUtils.bind(this,function(P){p.handleError(P)})):p.writeTextToClipboard(n.getLabel(F),mxUtils.bind(this,function(P){p.handleError(P)}))}catch(P){p.handleError(P)}});this.addAction("pasteData",function(F,P){function T(k,q){var y=c.getValue(k);q=k.cloneValue(q);q.removeAttribute("placeholders");null==y||isNaN(y.nodeType)||q.setAttribute("placeholders", y.getAttribute("placeholders"));null!=F&&mxEvent.isShiftDown(F)||q.setAttribute("label",n.convertValueToString(k));c.setValue(k,q)}F=null!=P?P:F;var c=n.getModel();if(n.isEnabled()&&!n.isSelectionEmpty()&&null!=p.copiedValue){c.beginUpdate();try{var f=n.getEditableCells(n.getSelectionCells());if(0==f.length)T(c.getRoot(),p.copiedValue);else for(P=0;P<f.length;P++)T(f[P],p.copiedValue)}finally{c.endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+E");this.addAction("delete",function(F,P){F= null!=P?P:F;null!=F&&mxEvent.isShiftDown(F)?d():b(null!=F&&(mxEvent.isControlDown(F)||mxEvent.isMetaDown(F)||mxEvent.isAltDown(F)))},null,null,"Delete");this.addAction("deleteAll",function(){b(!0)});this.addAction("deleteLabels",function(){d()},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){try{n.setSelectionCells(n.duplicateCells()),n.scrollCellToVisible(n.getSelectionCell())}catch(F){p.handleError(F)}},null,null,Editor.ctrlKey+"+D");this.put("mergeCells",new Action("merge", function(){var F=p.getSelectionState();if(null!=F.mergeCell){n.getModel().beginUpdate();try{n.setCellStyles("rowspan",F.rowspan,[F.mergeCell]),n.setCellStyles("colspan",F.colspan,[F.mergeCell])}finally{n.getModel().endUpdate()}}}));this.put("unmergeCells",new Action("unmerge",function(){var F=p.getSelectionState();if(0<F.cells.length){n.getModel().beginUpdate();try{n.setCellStyles("rowspan",null,F.cells),n.setCellStyles("colspan",null,F.cells)}finally{n.getModel().endUpdate()}}}));D=new Action("turn", function(F,P){F=null!=P?P:F;n.turnShapes(n.getResizableCells(n.getSelectionCells()),null!=F?mxEvent.isShiftDown(F):!1)},null,null,mxClient.IS_SF?null:Editor.ctrlKey+"+R");D.getTitle=function(){return mxResources.get("turn")+" / "+mxResources.get("reverse")};this.put("turn",D);D=new Action("rotateEdge",function(F,P){F=null!=P?P:F;n.rotateEdges(n.getSelectionCells(),null!=F?mxEvent.isShiftDown(F):!1)});D.getTitle=function(){return mxResources.get("turn")};this.put("rotateEdge",D);this.put("selectConnections", new Action("selectEdges",function(F){F=n.getSelectionCell();n.isEnabled()&&null!=F&&n.addSelectionCells(n.getEdges(F))}));this.addAction("selectVertices",function(){n.selectVertices(null,!0)},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+I");this.addAction("selectEdges",function(){n.selectEdges()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+E");this.addAction("selectAll",function(){n.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){n.clearSelection()}, null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+A");this.addAction("lockUnlock",function(){if(!n.isSelectionEmpty()){n.getModel().beginUpdate();try{var F=n.getSelectionCells(),P=n.getCurrentCellStyle(n.getSelectionCell()),T=1==mxUtils.getValue(P,mxConstants.STYLE_EDITABLE,1)?0:1;n.setCellStyles(mxConstants.STYLE_MOVABLE,T,F);n.setCellStyles(mxConstants.STYLE_RESIZABLE,T,F);n.setCellStyles(mxConstants.STYLE_ROTATABLE,T,F);n.setCellStyles(mxConstants.STYLE_DELETABLE,T,F);n.setCellStyles(mxConstants.STYLE_EDITABLE, T,F);n.setCellStyles("locked",1==T?0:1,F);n.setCellStyles("connectable",T,F)}finally{n.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+L");this.addAction("explore",function(){var F=n.getSelectionCell();n.model.isEdge(F)&&(F=n.model.getTerminal(F,!0));n.model.isVertex(F)&&Graph.exploreFromCell(p.editor.graph,F)});this.addAction("home",function(){n.home()},null,null,"Shift+Home");this.addAction("exitGroup",function(){n.exitGroup()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+Home");this.addAction("enterGroup", function(){n.enterGroup()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+End");this.addAction("collapse",function(){n.foldCells(!0)},null,null,Editor.ctrlKey+"+Home");this.addAction("expand",function(){n.foldCells(!1)},null,null,Editor.ctrlKey+"+End");this.addAction("toFront",function(){n.orderCells(!1)},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+F");this.addAction("toBack",function(){n.orderCells(!0)},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+B");this.addAction("bringForward",function(F){n.orderCells(!1, null,!0)},null,null,Editor.ctrlKey+"+Alt+Shift+F");this.addAction("sendBackward",function(F){n.orderCells(!0,null,!0)},null,null,Editor.ctrlKey+"+Alt+Shift+B");this.addAction("alignCellsLeft",function(){n.isEnabled()&&n.alignCells(mxConstants.ALIGN_LEFT)});this.addAction("alignCellsCenter",function(){n.isEnabled()&&n.alignCells(mxConstants.ALIGN_CENTER)});this.addAction("alignCellsRight",function(){n.isEnabled()&&n.alignCells(mxConstants.ALIGN_RIGHT)});this.addAction("alignCellsTop",function(){n.isEnabled()&& n.alignCells(mxConstants.ALIGN_TOP)});this.addAction("alignCellsMiddle",function(){n.isEnabled()&&n.alignCells(mxConstants.ALIGN_MIDDLE)});this.addAction("alignCellsBottom",function(){n.isEnabled()&&n.alignCells(mxConstants.ALIGN_BOTTOM)});this.addAction("distributeHorizontal",function(){n.isEnabled()&&n.distributeCells(!0)});this.addAction("distributeVertical",function(){n.isEnabled()&&n.distributeCells(!1)});this.addAction("group",function(){if(n.isEnabled()){var F=mxUtils.sortCells(n.getSelectionCells(), !0);1!=F.length||n.isTable(F[0])||n.isTableRow(F[0])?(F=n.getCellsForGroup(F),1<F.length&&n.setSelectionCell(n.groupCells(null,0,F))):n.setCellStyles("container","1")}},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",function(){if(n.isEnabled()){var F=n.getEditableCells(n.getSelectionCells());n.model.beginUpdate();try{var P=n.ungroupCells();if(null!=F)for(var T=0;T<F.length;T++)n.model.contains(F[T])&&(0==n.model.getChildCount(F[T])&&n.model.isVertex(F[T])&&n.setCellStyles("container","0", [F[T]]),P.push(F[T]))}finally{n.model.endUpdate()}0<P.length&&n.setSelectionCells(P)}},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+U");this.addAction("removeFromGroup",function(){if(n.isEnabled()){var F=n.getSelectionCells();if(null!=F){for(var P=[],T=0;T<F.length;T++)n.isTableRow(F[T])||n.isTableCell(F[T])||P.push(F[T]);n.removeCellsFromParent(P);0<P.length&&n.scrollCellToVisible(P[0])}}});this.addAction("edit",function(){n.isEnabled()&&n.startEditingAtCell()},null,null,"F2/Enter");this.addAction("editData...", function(){var F=n.getSelectionCells();p.showDataDialog(0<F.length?F:n.getModel().getRoot())},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var F=n.getSelectionCell();if(n.isEnabled()&&null!=F&&n.isCellEditable(F)){var P="";if(mxUtils.isNode(F.value)){var T=null;Graph.translateDiagram&&null!=Graph.diagramLanguage&&F.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(T=F.value.getAttribute("tooltip_"+Graph.diagramLanguage));null==T&&(T=F.value.getAttribute("tooltip")); null!=T&&(P=T)}P=new MarkupDialog(p,mxResources.get("editTooltip")+":",P,function(c){n.setTooltipForCell(F,c)});p.showDialog(P.container,420,300,!0,!0,null,null,null,new mxRectangle(0,0,320,240),null,"editTooltip");P.init()}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+T");this.addAction("editNote...",function(){var F=n.getSelectionCell();if(n.isEnabled()&&null!=F&&n.isCellEditable(F)){var P=n.getNoteForCell(F)||"";P=new MarkupDialog(p,mxResources.get("editNote")+":",P,function(T){n.setNoteForCell(F, T)});p.showDialog(P.container,420,300,!0,!0,null,null,null,new mxRectangle(0,0,320,240),null,"editNote");P.init()}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+N");this.addAction("openLink",function(){var F=n.getLinkForCell(n.getSelectionCell());null!=F&&n.openLink(F)});this.addAction("editLink...",function(){var F=n.getSelectionCell();if(n.isEnabled()&&null!=F&&n.isCellEditable(F)){var P=n.getLinkForCell(F,!0)||"";p.showLinkDialog(P,mxResources.get("ok"),function(T,c,f){n.getModel().beginUpdate(); try{n.setLinkForCell(F,0<T.length?T:null),n.setAttributeForCell(F,"linkTarget",f)}finally{n.getModel().endUpdate()}},!0,n.getLinkTargetForCell(F))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+L");this.put("insertImage",new Action("image...",function(){n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())&&(n.clearSelection(),p.actions.get("image").funct())})).isEnabled=z;this.addAction("editImage...",function(){p.actions.get("image").funct()});this.put("insertLink",new Action("link...",function(){n.isEnabled()&& !n.isCellLocked(n.getDefaultParent())&&p.showLinkDialog("",mxResources.get("ok"),function(F,P,T){F=mxUtils.trim(F);if(0<F.length){var c=null,f=n.getLinkTitle(F);null!=P&&0<P.length&&(c=P[0].iconUrl,f=P[0].name||P[0].type,f=f.charAt(0).toUpperCase()+f.substring(1),30<f.length&&(f=f.substring(0,30)+"..."));P=new mxCell(f,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=n.getCenterInsertPoint(n.getBoundingBoxFromGeometry([P],!0));P.geometry.x=c.x;P.geometry.y=c.y;n.setAttributeForCell(P,"linkTarget",T);n.setLinkForCell(P,F);n.cellSizeUpdated(P,!0);n.getModel().beginUpdate();try{P=n.addCell(P),n.fireEvent(new mxEventObject("cellsInserted","cells",[P]))}finally{n.getModel().endUpdate()}n.setSelectionCell(P);n.scrollCellToVisible(n.getSelectionCell())}},!0)},null,null,"L")).isEnabled=z;this.addAction("link...",mxUtils.bind(this,function(){if(n.isEnabled())if(n.cellEditor.isContentEditing()){var F= n.getSelectedElement(),P=n.getParentByName(F,"A",n.cellEditor.textarea),T="";if(null==P&&null!=F&&null!=F.getElementsByTagName)for(var c=F.getElementsByTagName("a"),f=0;f<c.length&&null==P;f++)c[f].textContent==F.textContent&&(P=c[f]);null!=P&&"A"==P.nodeName&&(T=P.getAttribute("href")||"",n.selectNode(P));var k=n.cellEditor.saveSelection();p.showLinkDialog(T,mxResources.get("ok"),mxUtils.bind(this,function(q){n.cellEditor.restoreSelection(k);null!=q&&n.insertLink(q)}))}else n.isSelectionEmpty()? this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=z;this.addAction("autosize",function(){var F=n.getSelectionCells();if(null!=F){n.getModel().beginUpdate();try{for(var P=0;P<F.length;P++){var T=F[P];if(n.getModel().isVertex(T))if(n.isAutosizeTextCell(T)&&n.setCellStyles("autosizeText",null,[T]),0<n.getModel().getChildCount(T)){var c=n.getTransparentBoundsPadding(T);n.updateGroupBounds([T],0,!0,c.n,c.e,c.s,c.w)}else n.updateCellSize(T)}}finally{n.getModel().endUpdate()}}},null, null,Editor.ctrlKey+"+"+Editor.shiftKey+"+Y");this.addAction("snapToGrid",function(){n.snapCellsToGrid(n.getSelectionCells(),n.gridSize)});this.addAction("formattedText",function(){n.stopEditing();var F=n.getCommonStyle(n.getSelectionCells());F="1"==mxUtils.getValue(F,"html","0")?null:"1";n.getModel().beginUpdate();try{for(var P=n.getEditableCells(n.getSelectionCells()),T=0;T<P.length;T++){var c=n.getView().getState(P[T]);if(null!=c){var f=mxUtils.getValue(c.style,"html","0");if("1"==f&&null==F)n.removeTextStyleForCell(c.cell), n.setCellStyles("html",F,[P[T]]);else if("0"==f&&"1"==F){var k=mxUtils.htmlEntities(n.convertValueToString(c.cell),!1);"0"!=mxUtils.getValue(c.style,"nl2Br","1")&&(k=k.replace(/\n/g,"<br/>"));n.cellLabelChanged(c.cell,Graph.sanitizeHtml(k));n.setCellStyles("html",F,[P[T]])}}}p.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=F?F:"0"],"cells",P))}finally{n.getModel().endUpdate()}});this.addAction("wordWrap",function(){var F=n.getView().getState(n.getSelectionCell()),P="wrap"; n.stopEditing();null!=F&&"wrap"==F.style[mxConstants.STYLE_WHITE_SPACE]&&(P=null);n.setCellStyles(mxConstants.STYLE_WHITE_SPACE,P)});this.addAction("rotation",function(){var F="0",P=n.getView().getState(n.getSelectionCell());null!=P&&(F=P.style[mxConstants.STYLE_ROTATION]||F);F=new FilenameDialog(p,F,mxResources.get("apply"),function(T){if(null!=T&&0<T.length){var c=n.getSelectionCells();n.getModel().beginUpdate();try{for(var f=0;f<c.length;f++)n.setCellRotation(c[f],T)}finally{n.getModel().endUpdate()}}}, mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");p.showDialog(F.container,375,80,!0,!0);F.init()});this.addAction("resetView",function(){n.zoomTo(1);p.resetScrollbars()},null,null,"Enter/Home");this.addAction("zoomIn",function(F){n.isFastZoomEnabled()?n.lazyZoom(!0,!0,p.buttonZoomDelay):n.zoomIn()},null,null,Editor.ctrlKey+" + / Alt+Mousewheel");this.addAction("zoomOut",function(F){n.isFastZoomEnabled()?n.lazyZoom(!1,!0,p.buttonZoomDelay):n.zoomOut()},null,null,Editor.ctrlKey+ " - / Alt+Mousewheel");this.addAction("fitWindow",function(){p.fitDiagramOrPages()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+H");this.addAction("fitPage",mxUtils.bind(this,function(){n.pageVisible?n.fitPages(1):this.get("pageView").funct()}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){n.pageVisible?n.fitPages(2):this.get("pageView").funct()}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){n.pageVisible? n.fitPages(1,!0):this.get("pageView").funct()}));this.put("customZoom",new Action("custom...",mxUtils.bind(this,function(){var F=new FilenameDialog(this.editorUi,parseInt(100*n.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(P){P=parseInt(P);!isNaN(P)&&0<P&&n.zoomTo(P/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(F.container,300,80,!0,!0);F.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var F=new FilenameDialog(this.editorUi, parseInt(100*n.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(P){P=parseInt(P);!isNaN(P)&&0<P&&(P=new ChangePageSetup(p,null,null,null,P/100),P.ignoreColor=!0,P.ignoreImage=!0,n.model.execute(P))}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(F.container,300,80,!0,!0);F.init()}));D=null;D=this.addAction("grid",function(){n.setGridEnabled(!n.isGridEnabled());n.defaultGridEnabled=n.isGridEnabled();p.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+ "+"+Editor.shiftKey+"+G");D.setToggleAction(!0);D.setSelectedCallback(function(){return n.isGridEnabled()});D.setEnabled(!1);D=this.addAction("guides",function(){n.graphHandler.guidesEnabled=!n.graphHandler.guidesEnabled;p.fireEvent(new mxEventObject("guidesEnabledChanged"))});D.setToggleAction(!0);D.setSelectedCallback(function(){return n.graphHandler.guidesEnabled});D.setEnabled(!1);D=this.addAction("animations",function(){Editor.enableAnimations=!Editor.enableAnimations;p.fireEvent(new mxEventObject("enableAnimationsChanged"))}); D.setToggleAction(!0);D.setSelectedCallback(function(){return Editor.enableAnimations});D=this.addAction("tooltips",function(){n.tooltipHandler.setEnabled(!n.tooltipHandler.isEnabled());p.fireEvent(new mxEventObject("tooltipsEnabledChanged"))});D.setToggleAction(!0);D.setSelectedCallback(function(){return n.tooltipHandler.isEnabled()});D=this.addAction("collapseExpand",function(){var F=new ChangePageSetup(p);F.ignoreColor=!0;F.ignoreImage=!0;F.foldingEnabled=!n.foldingEnabled;n.model.execute(F)}); D.setToggleAction(!0);D.setSelectedCallback(function(){return n.foldingEnabled});D.isEnabled=z;D=this.addAction("pageView",mxUtils.bind(this,function(){var F=!n.pageVisible;null!=p.editor.savedGraphState&&null!=p.editor.savedGraphState.page&&(p.editor.savedGraphState.page=F?"1":"0");p.editor.setModified(!0);p.setPageVisible(F)}));D.setToggleAction(!0);D.setSelectedCallback(function(){return n.pageVisible});D=this.addAction("connectionArrows",function(){n.connectionArrowsEnabled=!n.connectionArrowsEnabled; p.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+A");D.setToggleAction(!0);D.setSelectedCallback(function(){return n.connectionArrowsEnabled});D=this.addAction("connectionPoints",function(){n.setConnectable(!n.connectionHandler.isEnabled());p.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+O");D.setToggleAction(!0);D.setSelectedCallback(function(){return n.connectionHandler.isEnabled()}); D=this.addAction("autosave",function(){p.editor.setAutosave(!p.editor.autosave)});D.setToggleAction(!0);D.setSelectedCallback(function(){return p.editor.autosave});D.isEnabled=z;D.visible=!1;this.addAction("help",function(){var F="";mxResources.isLanguageSupported(mxClient.language)&&(F="_"+mxClient.language);n.openLink(RESOURCES_PATH+"/help"+F+".html")});var N=!1;D=new Action("about",function(){N||(p.showDialog((new AboutDialog(p)).container,320,280,!0,!0,function(){N=!1}),N=!0)});D.getTitle=function(){return mxResources.get("about")+ " Graph Editor..."};this.put("about",D);D=mxUtils.bind(this,function(F,P,T,c){return this.addAction(F,function(){if(null!=T&&n.cellEditor.isContentEditing())T();else{n.stopEditing(!1);n.getModel().beginUpdate();try{var f=n.getEditableCells(n.getSelectionCells());n.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,P,f);(P&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?n.updateLabelElements(f,function(q){q.style.fontWeight=null;"B"==q.nodeName&&n.replaceElement(q)}):(P&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC? n.updateLabelElements(f,function(q){q.style.fontStyle=null;"I"==q.nodeName&&n.replaceElement(q)}):(P&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.updateLabelElements(f,function(q){q.style.textDecoration=null;"U"==q.nodeName&&n.replaceElement(q)});for(var k=0;k<f.length;k++)0==n.model.getChildCount(f[k])&&n.autoSizeCell(f[k],!1)}finally{n.getModel().endUpdate()}}},null,null,c)});D("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");D("italic", mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");D("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){p.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000","default",n.shapeForegroundColor,void 0,mxResources.get("fontColor"))});this.addAction("strokeColor...",function(){p.menus.pickColor(mxConstants.STYLE_STROKECOLOR,null,null,"default", n.shapeForegroundColor,void 0,mxResources.get("strokeColor"))});this.addAction("fillColor...",function(){p.menus.pickColor(mxConstants.STYLE_FILLCOLOR,null,null,"default",n.shapeBackgroundColor,void 0,mxResources.get("fillColor"))});this.addAction("gradientColor...",function(){p.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR,null,null,"default",n.shapeForegroundColor,void 0,mxResources.get("gradientColor"))});this.addAction("backgroundColor...",function(){p.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR, "backcolor",null,"default",n.shapeBackgroundColor,void 0,mxResources.get("backgroundColor"))});this.addAction("borderColor...",function(){p.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR,null,null,"default",n.shapeForegroundColor,void 0,mxResources.get("borderColor"))});this.addAction("removeFormat",function(){if(n.isEnabled()&&!n.isSelectionEmpty()&&!n.isEditing()){n.getModel().beginUpdate();try{for(var F=n.getSelectionCells(),P=0;P<F.length;P++)n.removeTextStyleForCell(F[P],!0)}finally{n.getModel().endUpdate()}}}); this.addAction("vertical",function(){p.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){p.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){n.getModel().beginUpdate();try{n.setCellStyles(mxConstants.STYLE_DASHED,null),n.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),p.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}}); this.addAction("dashed",function(){n.getModel().beginUpdate();try{n.setCellStyles(mxConstants.STYLE_DASHED,"1"),n.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),p.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}});this.addAction("dotted",function(){n.getModel().beginUpdate();try{n.setCellStyles(mxConstants.STYLE_DASHED,"1"),n.setCellStyles(mxConstants.STYLE_DASH_PATTERN, "1 4"),p.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}});this.addAction("sharp",function(){n.getModel().beginUpdate();try{n.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),n.setCellStyles(mxConstants.STYLE_CURVED,"0"),p.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","0"],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}}); this.addAction("rounded",function(){n.getModel().beginUpdate();try{n.setCellStyles(mxConstants.STYLE_ROUNDED,"1"),n.setCellStyles(mxConstants.STYLE_CURVED,"0"),p.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!n.isSelectionEmpty()&&n.isEnabled()){n.getModel().beginUpdate();try{var F=n.getSelectionCells(),P=n.getCurrentCellStyle(F[0]), T="1"==mxUtils.getValue(P,mxConstants.STYLE_ROUNDED,"0")?"0":"1";n.setCellStyles(mxConstants.STYLE_ROUNDED,T);n.setCellStyles(mxConstants.STYLE_CURVED,null);p.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[T,"0"],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}}});this.addAction("curved",function(){n.getModel().beginUpdate();try{n.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),n.setCellStyles(mxConstants.STYLE_CURVED, "1"),p.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",n.getSelectionCells()))}finally{n.getModel().endUpdate()}});this.addAction("collapsible",function(){var F=n.view.getState(n.getSelectionCell()),P="1";null!=F&&null!=n.getFoldingImage(F)&&(P="0");n.setCellStyles("collapsible",P);p.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[P],"cells",n.getSelectionCells()))});this.addAction("editStyle...", mxUtils.bind(this,function(){var F=n.getEditableCells(n.getSelectionCells());if(null!=F&&0<F.length){var P=n.getModel();P=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",P.getStyle(F[0])||"",function(T){null!=T&&n.setCellStyle(mxUtils.trim(T),F)},null,null,400,220);this.editorUi.showDialog(P.container,420,300,!0,!0,null,null,null,new mxRectangle(0,0,300,200),null,"editStyle");P.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){n.isEnabled()&& !n.isSelectionEmpty()&&p.setDefaultStyle(n.getSelectionCell())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+D");this.addAction("clearDefaultStyle",function(){n.isEnabled()&&p.clearDefaultStyle()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+R");this.addAction("addWaypoint",function(){var F=n.getSelectionCell();if(null!=F&&n.getModel().isEdge(F)){var P=t.graph.selectionCellsHandler.getHandler(F);if(P instanceof mxEdgeHandler){var T=0,c=0;F=n.getModel().getParent(F);for(var f=n.getCellGeometry(F);n.getModel().isVertex(F)&& null!=f;)T+=f.x,c+=f.y,F=n.getModel().getParent(F),f=n.getCellGeometry(F);F=n.popupMenuHandler.getTriggerPoint();T=Math.round(n.snap(F.x-T));c=Math.round(n.snap(F.y-c));P.addPointAt(P.state,T,c)}}});this.addAction("removeWaypoint",function(){var F=p.actions.get("removeWaypoint");null!=F.handler&&F.handler.removePoint(F.handler.state,F.index)});this.addAction("clearAnchors",function(){var F=n.getSelectionCells();if(null!=F){F=n.getEditableCells(n.addAllEdges(F));n.getModel().beginUpdate();try{for(var P= 0;P<F.length;P++){var T=F[P];n.getModel().isEdge(T)&&(n.setCellStyles(mxConstants.STYLE_EXIT_X,null,[T]),n.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[T]),n.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[T]),n.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[T]))}}finally{n.getModel().endUpdate()}}});this.addAction("clearWaypoints",function(){var F=n.getSelectionCells();if(null!=F){F=n.getEditableCells(n.addAllEdges(F));n.getModel().beginUpdate();try{for(var P=0;P<F.length;P++){var T=F[P];if(n.getModel().isEdge(T)){var c= n.getCellGeometry(T);null!=c&&(c=c.clone(),c.points=null,c.x=0,c.y=0,c.offset=null,n.getModel().setGeometry(T,c));n.setCellStyles("innerLoopWaypoints",null,[T])}}}finally{n.getModel().endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+R");D=this.addAction("subscript",mxUtils.bind(this,function(){n.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");D=this.addAction("superscript",mxUtils.bind(this,function(){n.cellEditor.isContentEditing()&& document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");D=this.addAction("decreaseFontSize",mxUtils.bind(this,function(){if(!n.isSelectionEmpty()){var F=n.getCurrentCellStyle(n.getSelectionCell());F=mxUtils.getValue(F,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);n.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.max(1,F-1),n.getSelectionCells())}}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+" + (Numpad)");D=this.addAction("increaseFontSize",mxUtils.bind(this,function(){if(!n.isSelectionEmpty()){var F= n.getCurrentCellStyle(n.getSelectionCell());F=mxUtils.getValue(F,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);n.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.min(100,F+1),n.getSelectionCells())}}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+" - (Numpad)");this.addAction("image...",function(){if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())){var F=mxResources.get("image")+" ("+mxResources.get("url")+"):",P=n.getView().getState(n.getSelectionCell()),T="",c=null;null!=P&&(T=P.style[mxConstants.STYLE_IMAGE]|| T,c=P.style[mxConstants.STYLE_CLIP_PATH]||c);var f=n.cellEditor.saveSelection();p.showImageDialog(F,T,function(k,q,y,A,E,K){if(n.cellEditor.isContentEditing())n.cellEditor.restoreSelection(f),n.insertImage(k,q,y);else{var Q=n.getSelectionCells();if(null!=k&&(0<k.length||0<Q.length)){var W=null;n.getModel().beginUpdate();try{if(0==Q.length){Q=[n.insertVertex(n.getDefaultParent(),null,"",0,0,q,y,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var J=n.getCenterInsertPoint(n.getBoundingBoxFromGeometry(Q, !0));Q[0].geometry.x=J.x;Q[0].geometry.y=J.y;null!=A&&m(Q[0],A,E,K,n);W=Q;n.fireEvent(new mxEventObject("cellsInserted","cells",W))}n.setCellStyles(mxConstants.STYLE_IMAGE,0<k.length?k:null,Q);var ea=n.getCurrentCellStyle(Q[0]);"image"!=ea[mxConstants.STYLE_SHAPE]&&"label"!=ea[mxConstants.STYLE_SHAPE]?n.setCellStyles(mxConstants.STYLE_SHAPE,"image",Q):0==k.length&&n.setCellStyles(mxConstants.STYLE_SHAPE,null,Q);null==A&&n.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,Q);if(null!=q&&null!=y)for(k= 0;k<Q.length;k++){var X=Q[k];if("0"!=n.getCurrentCellStyle(X).expand){var aa=n.getModel().getGeometry(X);null!=aa&&(aa=aa.clone(),aa.width=q,aa.height=y,n.getModel().setGeometry(X,aa))}null!=A&&m(X,A,E,K,n)}}finally{n.getModel().endUpdate()}null!=W&&(n.setSelectionCells(W),n.scrollCellToVisible(W[0]))}}},n.cellEditor.isContentEditing(),!n.cellEditor.isContentEditing(),!0,c)}}).isEnabled=z;this.addAction("crop...",function(){var F=n.getSelectionCell();if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())&& null!=F){var P=n.getCurrentCellStyle(F),T=P[mxConstants.STYLE_IMAGE],c=P[mxConstants.STYLE_SHAPE];T&&"image"==c&&(P=new CropImageDialog(p,T,P[mxConstants.STYLE_CLIP_PATH],function(f,k,q){m(F,f,k,q,n)}),p.showDialog(P.container,380,390,!0,!0,null,null,null,new mxRectangle(0,0,440,450)))}}).isEnabled=z;D=this.addAction("layers",mxUtils.bind(this,function(){if(null==this.layersWindow){var F=null!=p.installWindowPersistence?mxSettings.getWindowState("layers"):null;this.layersWindow=new LayersWindow(p, null!=F&&null!=F.x?F.x:document.body.offsetWidth-280,null!=F&&null!=F.y?F.y:120,null!=F&&null!=F.w?F.w:212,null!=F&&null!=F.h?F.h:200);this.layersWindow.window.addListener("show",mxUtils.bind(this,function(){p.fireEvent(new mxEventObject("layers"))}));this.layersWindow.window.addListener("hide",function(){p.fireEvent(new mxEventObject("layers"))});null!=p.installWindowPersistence&&(p.installWindowPersistence("layers",this.layersWindow),null!=F&&p.restoreWindowState("layers",this.layersWindow));this.layersWindow.window.setVisible(!0); p.fireEvent(new mxEventObject("layers"));this.layersWindow.init()}else this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+L");D.setToggleAction(!0);D.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));D=this.addAction("format",mxUtils.bind(this,function(){p.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+P");D.setToggleAction(!0);D.setSelectedCallback(mxUtils.bind(this, function(){return p.isFormatPanelVisible()}));D=this.addAction("outline",mxUtils.bind(this,function(){if(null==this.outlineWindow){var F=null!=p.installWindowPersistence?mxSettings.getWindowState("outline"):null;this.outlineWindow=new OutlineWindow(p,null!=F&&null!=F.x?F.x:document.body.offsetWidth-260,null!=F&&null!=F.y?F.y:100,null!=F&&null!=F.w?F.w:180,null!=F&&null!=F.h?F.h:180);this.outlineWindow.window.addListener("show",mxUtils.bind(this,function(){p.fireEvent(new mxEventObject("outline"))})); this.outlineWindow.window.addListener("hide",function(){p.fireEvent(new mxEventObject("outline"))});null!=p.installWindowPersistence&&(p.installWindowPersistence("outline",this.outlineWindow),null!=F&&p.restoreWindowState("outline",this.outlineWindow));this.outlineWindow.window.setVisible(!0);p.fireEvent(new mxEventObject("outline"))}else this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+O");D.setToggleAction(!0);D.setSelectedCallback(mxUtils.bind(this, function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}));this.addAction("editPolygon...",function(){var F=n.getSelectionCell();if(n.isEnabled()&&null!=F){var P=n.view.getState(F);if(null!=P&&"mxgraph.basic.polygon"===mxUtils.getValue(P.style,mxConstants.STYLE_SHAPE)){var T=new PolygonDialog(p,F);p.showDialog(T.container,680,540,!0,!0,function(){T.destroy()},null,null,new mxRectangle(0,0,740,600));T.init()}}}).isEnabled=z;this.addAction("editConnectionPoints...",function(){var F= n.getSelectionCell();if(n.isEnabled()&&!n.isCellLocked(n.getDefaultParent())&&null!=F&&null!=F.geometry){var P=new ConnectionPointsDialog(p,F);p.showDialog(P.container,400,450,!0,!1,function(){P.destroy()},null,null,new mxRectangle(0,0,450,500),null,"editConnectionPoints");P.init()}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+Q").isEnabled=z}; Actions.prototype.addAction=function(b,d,m,p,t,n){var z=b;"..."==z.substring(z.length-3)&&(z=z.substring(0,z.length-3));return this.put(z,new Action(b,d,m,p,t,n))};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,p,t,n){mxEventSource.call(this);this.label=b;this.funct=this.createFunction(d);this.enabled=null!=m?m:!0;this.iconCls=p;this.shortcut=t;this.visible=null!=n?n:!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); DrawioFile.prototype.allChangesSavedKey="allChangesSaved";DrawioFile.prototype.savingSpinnerKey="saving";DrawioFile.prototype.savingStatusKey="saving";DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.optimisticSyncDelay=300;DrawioFile.prototype.loadFontsTimeout=5E3;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.lastSaved=null;DrawioFile.prototype.lastChanged=null; DrawioFile.prototype.opened=null;DrawioFile.prototype.modified=!1;DrawioFile.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,!0),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(d){}}return this.shadowPages}; DrawioFile.prototype.setShadowPages=function(b,d){this.shadowPages=b;this.shadowVars=void 0!==d?d: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,d,m){EditorUi.debug("DrawioFile.synchronizeFile",[this],"latestFile",[m],"savingFile",this.savingFile);if(this.savingFile)null!=d&&d({message:mxResources.get("busy")});else{var p=!0,t=window.setTimeout(mxUtils.bind(this,function(){p=!1;null!=d&&d({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.synchronizeFile(b,d)})})}),this.ui.timeout),n=mxUtils.bind(this,function(D){p&&(window.clearTimeout(t),null!= d&&d(D))}),z=mxUtils.bind(this,function(){return!p});null!=this.sync?this.sync.fileChanged(mxUtils.bind(this,function(D){p&&(window.clearTimeout(t),this.sync.cleanup(b,d,D))}),n,z):this.updateFile(mxUtils.bind(this,function(){p&&(window.clearTimeout(t),null!=b&&b())}),n,z,null,null,m)}}; DrawioFile.prototype.updateFile=function(b,d,m,p,t,n){if(null==m||!m())if(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",t,"invalidChecksum",this.invalidChecksum,"latestFile",[n]),this.ui.getCurrentFile()!=this||this.invalidChecksum)null!=d&&d();else{var z=mxUtils.bind(this,function(D){try{null!=m&&m()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[D]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=d&&d():null!=D?this.mergeFile(D, b,d,p,t):this.reloadFile(b,d))}catch(N){null!=d&&d(N)}});null!=n?z(n):this.getLatestVersion(z,d)}}; DrawioFile.prototype.mergeFile=function(b,d,m,p,t){try{var n=b.getShadowPages();if(null!=n&&0<n.length){var z=this.getShadowPages(),D=[this.ui.diffPages(null!=p?p:z,n)];p=null;try{var N=mxUtils.parseXml(b.initialData).documentElement;null!=N&&"mxfile"==N.nodeName&&(p=N.getAttribute("vars"))}catch(A){}p!=this.getShadowVars()&&(D[0][EditorUi.DIFF_FILE]={vars:p});var F=this.ignorePatches(D);if(F)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(), EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",F),null!=d&&d();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var P=this.isModified()?this.ui.diffPages(z,this.isRealtime()?this.ownPages:this.ui.pages):null,T=this.ui.patchPages(this.ui.clonePages(z),D[0]),c=this.ui.getHashValueForPages(T,{}),f=this.ui.getHashValueForPages(n,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",z,"pages",n,"patched",T,"patches",D,"changes",P,"checksum", c,"current",f,"valid",c==f,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",t);if(null!=c&&c!=f)this.checksumError(m,D,null,null,"mergeFile",c,f,b.getCurrentRevisionId());else{this.setShadowPages(n,p);if(null!=this.sync){var k=this.sync.patchRealtime(D,DrawioFile.LAST_WRITE_WINS?P:null,null,t);null==k||mxUtils.isEmptyObject(k)||D.push(k)}this.patch(D,DrawioFile.LAST_WRITE_WINS?P:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor()); this.descriptorChanged();null!=d&&d()}}catch(A){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=m&&m(A);try{if(!(A instanceof DOMException&&"InvalidCharacterError"==A.name)){var q=this.getCurrentUser(),y=null!=q?q.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),y,A)}}catch(E){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(A){null!=m&&m(A)}}; DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var d=new mxCodec(mxUtils.createXmlDocument()),m=d.document.createElement("mxfile");if(null!=b)for(var p=0;p<b.length;p++){var t=d.encode(new mxGraphModel(b[p].root));"1"!=urlParams.dev&&(t=this.ui.anonymizeNode(t,!0));t.setAttribute("id",b[p].getId());b[p].viewState&&this.ui.editor.graph.saveViewState(b[p].viewState,t,!0);m.appendChild(t)}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,p,t,n,z,D){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var N=this.getCurrentUser(),F=null!=N?N.id:"unknown",P=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",T=JSON.stringify(d).length,c=null;if(null!=d&&1E3>T){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(f){try{var k=null!=c?"report":"error",q=this.ui.getHashValueForPages(f.getShadowPages()),y="unknown",A="unknown",E="unknown";try{var K=null!=f.initialData&&0<f.initialData.length?mxUtils.parseXml(f.initialData).documentElement:null;null!=K&&(null!=K.getAttribute("version")&&(y=K.getAttribute("version")),null!=K.getAttribute("agent")&&(A=K.getAttribute("agent")),null!=K.getAttribute("type")&&(E=K.getAttribute("type")))}catch(Q){}EditorUi.logError("Checksum "+ k+" in "+t,null,this.getMode()+"."+P,"user_"+F+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+T+"-patches_"+d.length+(null!=c?"-json_"+c:"")+"-size_"+this.getSize()+(null!=n?"-expected_"+n:"")+(null!=z?"-current_"+z:"")+(null!=D?"-rev_"+this.ui.hashValue(D):"")+(null!=q?"-latest_"+q:"")+"-latestRev_"+this.ui.hashValue(f.getCurrentRevisionId())+("-latestVersion_"+y)+("-latestAgent_"+A)+("-latestType_"+E));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+P,action:t,label:"user_"+ F+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+T+"-patches_"+d.length+"-size_"+this.getSize()})}catch(Q){}}),function(){})}catch(f){}}; DrawioFile.prototype.sendErrorReport=function(b,d,m,p){try{var t=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),n=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),z=this.getCurrentUser(),D=null!=z?this.ui.hashValue(z.id):"unknown",N=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",F=this.getTitle(),P=F.lastIndexOf(".");z="xml";0<P&&(z=F.substring(P));var T=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()+" ("+z+")\nUser="+D+N+"\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"+T+"\n\nShadow:\n"+t+"\n\nData:\n"+n,p)}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),p=this.ui.editor.graph,t=p.getSelectionCells(),n=p.getViewState(),z=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(D){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[m],"viewState",[n],"latestFile",D);null!=D?(this.ui.replaceFileData(D.getData(), [m]),this.ui.restoreViewState(z,n,t),this.setDescriptor(D.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 N=this.ui.getCurrentFile();null!=N&&(N.stats=this.stats,N.patch([m]),N.fileChanged());this.ui.restoreViewState(z,n,t);null!=b&&b()}else null!=d&&d(this.ui.fileLoadedError)}),!0))}),d)}catch(D){null!=d&&d(D)}}; 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,p){if(null!=b){EditorUi.debug("DrawioFile.patch",[this],"patches",b,"undoable",m,"realtime",this.isRealtime(),"modified",this.isModified());var t=this.ui.editor.undoManager,n=t.history.slice(),z=t.indexOfNextAdd,D=this.ui.editor.graph;D.container.style.visibility="hidden";var N=this.changeListenerEnabled;this.changeListenerEnabled=m;var F=D.foldingEnabled,P=D.mathEnabled,T=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null;this.ui.patchFileNode(b); var c=D.cellRenderer.redraw;D.cellRenderer.redraw=function(E){E.view.graph.isEditing(E.cell)&&(E.view.graph.scrollCellToVisible(E.cell),E.view.graph.cellEditor.resize());c.apply(this,arguments)};D.model.beginUpdate();try{if(m){for(var f=this.ui.pages.slice(),k=this.ui.currentPage,q=this.ui.applyPatches(this.ui.pages,b,!0,d,this.isModified()),y=0;y<q.length;y++){var A=mxUtils.indexOf(this.ui.pages,q[y]);0>A?this.ui.insertPage(q[y],Math.min(y,this.ui.pages.length)):this.ui.movePage(A,y)}for(y=0;y<f.length;y++)0> mxUtils.indexOf(q,f[y])&&this.ui.removePage(f[y]);0<=mxUtils.indexOf(this.ui.pages,k)&&this.ui.selectPage(k,!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);D.checkDefaultParent()}finally{D.container.style.visibility="",D.model.endUpdate(),D.cellRenderer.redraw=c,this.changeListenerEnabled=N,m||(t.history= n,t.indexOfNextAdd=z,t.fireEvent(new mxEventObject(mxEvent.CLEAR))),t=T!=(null!=this.ui.fileNode?this.ui.fileNode.getAttribute("vars"):null),(n=null==this.ui.currentPage||this.ui.currentPage.needsUpdate)&&P!=D.mathEnabled?(this.ui.editor.updateGraphComponents(),D.refresh()):t?D.refresh():n&&(F!=D.foldingEnabled?D.view.revalidate():D.view.validate(),D.sizeDidChange()),null!=this.sync&&this.isRealtime()&&!p&&(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.loadFonts=function(b){if(this.ui.getCurrentFile()==this&&/(\.svg)$/i.test(this.getTitle())&&this.ui.getSvgFileProperties(this.ui.fileNode).embedFonts){var d=null,m=!1,p=function(){m||(m=!0,window.clearTimeout(d),b())};d=window.setTimeout(p,this.loadFontsTimeout);try{this.ui.editor.loadFonts(mxUtils.bind(this,function(){this.ui.editor.embedExtFonts(p)}))}catch(t){p()}}else b()}; DrawioFile.prototype.save=function(b,d,m,p,t,n){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",p,"overwrite",t,"manual",n,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!t&&this.invalidChecksum)if(null!=m)m({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else{this.clearAutosave();var z=mxUtils.bind(this,function(){try{this.updateFileData(),null!=d&&d()}catch(D){if(null!= m)m(D);else throw D;}});p?z():this.loadFonts(z)}else if(null!=m)m({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));}catch(D){if(null!=m)m(D);else throw D;}}; 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}; DrawioFile.prototype.updateFileData=function(){null!=this.sync&&this.sync.sendLocalChanges();this.setData(this.createData());null!=this.sync&&this.sync.fileDataUpdated()};DrawioFile.prototype.isCompressedStorage=function(){return Editor.defaultCompressed};DrawioFile.prototype.isCompressed=function(){var b=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("compressed"):null;return null!=b?"false"!=b:this.isCompressedStorage()&&Editor.compressXml}; DrawioFile.prototype.setLocked=function(b){this.ui.fileNode.setAttribute("locked",b?"true":"false");this.ui.fireEvent(new mxEventObject("lockedChanged"));this.fileChanged();b&&this.ui.editor.graph.clearSelection()};DrawioFile.prototype.isLocked=function(){var b=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("locked"):null;return null!=b?"true"==b:!1};DrawioFile.prototype.saveAs=function(b,d,m){};DrawioFile.prototype.saveFile=function(b,d,m,p){};DrawioFile.prototype.getFileUrl=function(){return null}; DrawioFile.prototype.getFolderUrl=function(b){return null};DrawioFile.prototype.getPublicUrl=function(b){b(null)};DrawioFile.prototype.isRestricted=function(){return DrawioFile.RESTRICT_EXPORT};DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.getShadowModified=function(){return this.shadowModified};DrawioFile.prototype.setShadowModified=function(b){this.shadowModified=b};DrawioFile.prototype.setModified=function(b){this.shadowModified=this.modified=b}; DrawioFile.prototype.isAutosaveOptional=function(){return!1};DrawioFile.prototype.isAutosave=function(){return!this.inConflictState&&this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(b,d,m){};DrawioFile.prototype.isMovable=function(){return!1};DrawioFile.prototype.isTrashed=function(){return!1};DrawioFile.prototype.move=function(b,d,m){}; DrawioFile.prototype.share=function(){null!=this.ui.drive?this.ui.confirm(mxResources.get("saveItToGoogleDriveToCollaborate",[this.getTitle()]),mxUtils.bind(this,function(){this.ui.pickFolder(App.MODE_GOOGLE,mxUtils.bind(this,function(b){var d=this.ui.editor.graph,m=d.getSelectionCells(),p=d.getViewState(),t=this.ui.currentPage;this.ui.createFile(this.getTitle(),this.ui.getFileData(null,null,null,null,null,null,null,null,this),null,App.MODE_GOOGLE,null,!0,b,null,null,mxUtils.bind(this,function(){this.ui.restoreViewState(t, p,m);this.ui.actions.get("share").funct()}))}))}),null,mxResources.get("saveToGoogleDrive"),mxResources.get("cancel")):this.ui.alert(mxResources.get("sharingAvailable"),null,380)};DrawioFile.prototype.getHash=function(){return""};DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.isChromelessView()||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""}; DrawioFile.prototype.setData=function(b){this.data=b;EditorUi.debug("DrawioFile.setData",[this],"data",[b])};DrawioFile.prototype.getData=function(){return this.data};DrawioFile.prototype.removeExtFonts=function(b){for(var d=0;null!=b&&d<b.length;d++){var m=b[d];null!=m.id&&0==m.id.indexOf("extFont_")&&m.parentNode.removeChild(m)}}; DrawioFile.prototype.open=function(){this.stats.opened++;var b=this.getData();null!=b&&(this.ui.setFileData(b,this),this.isModified()||this.setShadowPages(this.ui.clonePages(this.ui.pages)));this.installListeners();this.isSyncSupported()&&this.startSync();EditorUi.debug("DrawioFile.open",[this])};DrawioFile.prototype.isPolling=function(){return!1};DrawioFile.prototype.getPollingInterval=function(){return 1E4};DrawioFile.prototype.isSyncSupported=function(){return!1}; DrawioFile.prototype.isRealtime=function(){return null!=this.ownPages&&null!=this.ui.pages};DrawioFile.prototype.isRealtimeSupported=function(){return!1};DrawioFile.prototype.isRealtimeEnabled=function(){return Editor.enableRealtime&&"0"!=urlParams["fast-sync"]};DrawioFile.prototype.setRealtimeEnabled=function(){};DrawioFile.prototype.isRealtimeOptional=function(){return!1}; DrawioFile.prototype.getRealtimeState=function(){return null!=this.sync&&null!=this.sync.p2pCollab?this.sync.p2pCollab.getState():3};DrawioFile.prototype.getRealtimeError=function(){return null!=this.sync&&null!=this.sync.p2pCollab?this.sync.p2pCollab.getLastError():null};DrawioFile.prototype.isOptimisticSync=function(){return!1};DrawioFile.prototype.isRevisionHistorySupported=function(){return!1};DrawioFile.prototype.getRevisions=function(b,d){b(null)}; DrawioFile.prototype.getRecoveryVersion=function(b,d){this.isRevisionHistorySupported()?this.getRevisions(mxUtils.bind(this,function(m){if(null==m||2>m.length)b(null);else{var p=m.length-2,t=Math.max(0,p-5+1),n=mxUtils.bind(this,function(){if(p<t)EditorUi.debug("DrawioFile.getRecoveryVersion",[this],"no valid revision found in",m.length-1-t,"probed"),b(null);else{var z=m[p--];null==z||"function"!==typeof z.getXml?n():z.getXml(mxUtils.bind(this,function(D){if(this.ui.isFileDataLoadable(D)){var N=this.ui.formatRecoveryDate(z.modifiedDate); b({type:"version",label:null!=N?mxResources.get("recoverVersionFrom",[N]):mxResources.get("recoverPreviousVersion"),description:mxResources.get("recoveryVersionDesc"),data:D,date:z.modifiedDate,lossy:!1})}else n()}),mxUtils.bind(this,function(){n()}))}});n()}}),mxUtils.bind(this,function(){b(null)})):b(null)};DrawioFile.prototype.loadDescriptor=function(b,d){b(null)};DrawioFile.prototype.loadPatchDescriptor=function(b,d){this.loadDescriptor(mxUtils.bind(this,function(m){b(m)}),d)}; DrawioFile.prototype.patchDescriptor=function(b,d){this.setDescriptorEtag(b,this.getDescriptorEtag(d));this.descriptorChanged()}; DrawioFile.prototype.startSync=function(){"auto"!=DrawioFile.SYNC&&"fast"!=DrawioFile.SYNC||"1"==urlParams.stealth||"1"!=urlParams.rt&&this.ui.editor.chromeless&&!this.ui.editor.editable||(null==this.sync&&(this.sync=new DrawioFileSync(this)),this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.ui.fireEvent(new mxEventObject("realtimeStateChanged"))})),this.sync.start())};DrawioFile.prototype.isConflict=function(){return!1}; DrawioFile.prototype.getChannelId=function(){return Graph.compress(this.getHash()).replace(/[\/ +]/g,"_")};DrawioFile.prototype.getChannelKey=function(b){return null};DrawioFile.prototype.getCurrentUser=function(){return null};DrawioFile.prototype.getLatestVersion=function(b,d){b(null)};DrawioFile.prototype.getLatestVersionId=function(b,d){b(-1)};DrawioFile.prototype.getLastModifiedDate=function(){return new Date}; DrawioFile.prototype.setCurrentRevisionId=function(b){this.setDescriptorRevisionId(this.getDescriptor(),b)};DrawioFile.prototype.getCurrentRevisionId=function(){return this.getDescriptorRevisionId(this.getDescriptor())};DrawioFile.prototype.setCurrentEtag=function(b){this.setDescriptorEtag(this.getDescriptor(),b)};DrawioFile.prototype.getCurrentEtag=function(){return this.getDescriptorEtag(this.getDescriptor())};DrawioFile.prototype.getDescriptor=function(){return null}; DrawioFile.prototype.setDescriptor=function(){};DrawioFile.prototype.setDescriptorRevisionId=function(b,d){this.setDescriptorEtag(b,d)};DrawioFile.prototype.getDescriptorRevisionId=function(b){return this.getDescriptorEtag(b)};DrawioFile.prototype.setDescriptorEtag=function(b,d){};DrawioFile.prototype.getDescriptorEtag=function(b){return null};DrawioFile.prototype.getDescriptorSecret=function(b){return null};DrawioFile.prototype.getDescriptorChecksum=function(b){return null}; DrawioFile.prototype.installListeners=function(){null==this.changeListener&&(this.changeListener=mxUtils.bind(this,function(b,d){b=null!=d?d.getProperty("edit"):null;!this.changeListenerEnabled||!this.isEditable()||null!=b&&b.ignoreEdit||this.fileChanged()}),this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener),this.ui.editor.graph.addListener("gridSizeChanged",this.changeListener),this.ui.editor.graph.addListener("shadowVisibleChanged",this.changeListener),this.ui.addListener("pageFormatChanged", this.changeListener),this.ui.addListener("pageScaleChanged",this.changeListener),this.ui.addListener("backgroundColorChanged",this.changeListener),this.ui.addListener("backgroundImageChanged",this.changeListener),this.ui.addListener("foldingEnabledChanged",this.changeListener),this.ui.addListener("mathEnabledChanged",this.changeListener),this.ui.addListener("gridEnabledChanged",this.changeListener),this.ui.addListener("guidesEnabledChanged",this.changeListener),this.ui.addListener("tooltipsEnabledChanged", this.changeListener),this.ui.addListener("pageViewChanged",this.changeListener),this.ui.addListener("connectionPointsChanged",this.changeListener),this.ui.addListener("connectionArrowsChanged",this.changeListener))}; DrawioFile.prototype.addAllSavedStatus=function(b){if(null!=this.ui.statusContainer&&this.ui.getCurrentFile()==this){b=null!=b?b:mxUtils.htmlEntities(mxResources.get(this.allChangesSavedKey));var d=this.isRevisionHistorySupported()&&b!=mxUtils.htmlEntities(mxResources.get(this.savingStatusKey))+"..."?'data-action="revisionHistory" ':"";this.ui.editor.setStatus("<div "+d+'title="'+b+'">'+b+(this.isLocked()?' <img class="geToolbarButton geAdaptiveAsset" data-action="properties" style="margin-left:4px;flex-shrink:0;" src="'+ Editor.lockedImage+'"/>':"")+"</div>")}}; DrawioFile.prototype.saveDraft=function(b){try{if(b=null!=b?b:this.ui.getFileData(),this.ui.isDiagramDataEmpty(b))this.removeDraft();else{null==this.draftId&&(this.draftId=null!=this.usedDraftId?this.usedDraftId:Editor.guid());var d={type:"draft",created:this.created,modified:(new Date).getTime(),data:b,title:this.getTitle(),fileObject:this.fileObject,aliveCheck:this.ui.draftAliveCheck};this.ui.setDatabaseItem(".draft_"+this.draftId,JSON.stringify(d));EditorUi.debug("DrawioFile.saveDraft",[this], "draftId",this.draftId,[d])}}catch(m){this.removeDraft()}};DrawioFile.prototype.removeDraft=function(){try{null!=this.draftId&&(EditorUi.debug("DrawioFile.removeDraft",[this],"draftId",this.draftId),this.ui.removeDatabaseItem(".draft_"+this.draftId),this.usedDraftId=this.draftId,this.draftId=null)}catch(b){}}; DrawioFile.prototype.addUnsavedStatus=function(b){this.inConflictState||null==this.ui.statusContainer||this.ui.getCurrentFile()!=this||(b instanceof Error&&null!=b.message&&""!=b.message?this.ui.updateStatus(mxUtils.bind(this,function(){var d=mxUtils.htmlEntities(mxResources.get("unsavedChanges"));this.ui.editor.setStatus('<div title="'+d+'" data-title="'+mxUtils.htmlEntities(mxResources.get("unsavedChanges"))+'" data-message="'+mxUtils.htmlEntities(b.message)+'" class="geStatusAlert">'+d+" ("+mxUtils.htmlEntities(b.message)+ ")</div>")})):(this.ui.updateStatus(mxUtils.bind(this,function(){var d=this.getErrorMessage(b);if(null==d&&null!=this.lastSaved){var m=this.ui.timeSince(new Date(this.lastSaved));null!=m&&(d=mxResources.get("lastSaved",[m]))}null!=d&&60<d.length&&(d=d.substring(0,60)+"...");d=mxUtils.htmlEntities(mxResources.get("unsavedChangesClickHereToSave"))+(null!=d&&""!=d?" ("+mxUtils.htmlEntities(d)+")":"");m='data-action="'+(null!=this.ui.mode&&this.isEditable()?"save":"saveAs")+'"';this.ui.editor.setStatus("<div "+ m+' title="'+d+'" class="geStatusAlert">'+d+"</div>")})),EditorUi.enableDrafts&&(null==this.getMode()||EditorUi.isElectronApp)&&(this.lastDraftSave=this.lastDraftSave||Date.now(),null!=this.saveDraftThread&&(window.clearTimeout(this.saveDraftThread),this.saveDraftThread=null,Date.now()-this.lastDraftSave>Math.max(2*EditorUi.draftSaveDelay,3E4)&&(this.lastDraftSave=Date.now(),this.saveDraft())),this.saveDraftThread=window.setTimeout(mxUtils.bind(this,function(){this.lastDraftSave=Date.now();this.saveDraftThread= null;this.saveDraft()}),EditorUi.draftSaveDelay||0))))};DrawioFile.prototype.addConflictStatus=function(b,d){this.ui.updateStatus(mxUtils.bind(this,function(){this.invalidChecksum&&null==b&&(b=mxResources.get("checksum"));this.setConflictStatus(mxUtils.htmlEntities(mxResources.get("fileChangedSync"))+(null!=b&&""!=b?" ("+mxUtils.htmlEntities(b)+")":""),d)}));this.ui.spinner.stop();this.clearAutosave()}; DrawioFile.prototype.setConflictStatus=function(b,d){this.ui.editor.setStatus('<div title="'+b+'" '+(null!=d?'data-action="statusFunction"':"")+' class="geStatusAlert">'+b+'<img data-link="https://www.drawio.com/doc/faq/synchronize" src="'+Editor.helpImage+'" style="margin-left:2px;cursor:help;"/></div>',d)}; DrawioFile.prototype.showRefreshDialog=function(b,d,m){null==m&&(m=mxResources.get("checksum"));this.ui.editor.isChromelessView()&&!this.ui.editor.editable?this.ui.alert(mxResources.get("fileChangedSync"),mxUtils.bind(this,function(){this.reloadFile(b,d)})):(this.addConflictStatus(m,mxUtils.bind(this,function(){this.showRefreshDialog(b,d)})),this.ui.showError(mxResources.get("warning")+" ("+m+")",mxResources.get("fileChangedSyncDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(mxUtils.bind(this, function(){null!=b&&b();this.ui.alert(mxResources.get("copyCreated"))}),d)}),null,mxResources.get("merge"),mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&this.reloadFile(mxUtils.bind(this,function(){this.ui.spinner.stop();null!=b&&b()}),mxUtils.bind(this,function(){this.ui.spinner.stop();null!=d&&d()}))}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),380,130))}; DrawioFile.prototype.showCopyDialog=function(b,d,m){this.invalidChecksum=this.inConflictState=!1;this.addUnsavedStatus();this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedOverwriteDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(b,d)}),null,mxResources.get("overwrite"),m,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),380,150)}; DrawioFile.prototype.showConflictDialog=function(b,d){this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedSyncDialog"),mxResources.get("overwrite"),b,null,mxResources.get("merge"),d,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog();this.handleFileError(null,!1)}),380,130)}; DrawioFile.prototype.redirectToNewApp=function(b,d){this.ui.spinner.stop();if(!this.redirectDialogShowing){this.redirectDialogShowing=!0;var m=window.location.protocol+"//"+window.location.host+"/"+this.ui.getSearch("create title mode url drive splash state".split(" "))+"#"+this.getHash(),p=mxResources.get("redirectToNewApp");null!=d&&(p+=" ("+d+")");d=mxUtils.bind(this,function(){var t=mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href==m?window.location.reload():window.location.href= m});null==b&&this.isModified()?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.redirectDialogShowing=!1}),t,mxResources.get("cancel"),mxResources.get("discardChanges")):t()});null!=b?this.isModified()?this.ui.confirm(p,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;b()}),d,mxResources.get("cancel"),mxResources.get("discardChanges")):this.ui.confirm(p,d,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;b()})):this.ui.alert(mxResources.get("redirectToNewApp"), d)}}; DrawioFile.prototype.handleFileSuccess=function(b){this.ui.spinner.stop();this.ui.getCurrentFile()==this&&(EditorUi.debug("DrawioFile.handleFileSuccess",[this],"saved",b,"modified",this.isModified(),"remoteFileChanged",null==this.sync?"n/a":this.sync.remoteFileChanged),this.isModified()?this.fileChanged():b?(this.isTrashed()?this.ui.updateStatus(mxUtils.bind(this,function(){this.addAllSavedStatus(mxUtils.htmlEntities(mxResources.get(this.allChangesSavedKey))+" ("+mxUtils.htmlEntities(mxResources.get("fileMovedToTrash"))+")")})): this.ui.updateStatus(mxUtils.bind(this,function(){this.addAllSavedStatus()})),null!=this.sync&&(this.sync.resetUpdateStatusThread(),this.sync.remoteFileChanged&&(this.sync.remoteFileChanged=!1,this.sync.fileChangedNotify()))):this.ui.clearStatus())}; DrawioFile.prototype.handleFileError=function(b,d){if(d||null==b||b.code!=App.ERROR_BUSY)this.ui.spinner.stop(),this.ui.getCurrentFile()==this&&(this.inConflictState?this.handleConflictError(b,d):(this.isModified()&&this.addUnsavedStatus(b),d?this.ui.handleError(b,null!=b?mxResources.get("errorSavingFile"):null):this.isModified()||this.ui.updateStatus(mxUtils.bind(this,function(){var m=this.getErrorMessage(b);null!=m&&60<m.length&&(m=m.substring(0,60)+"...");this.ui.editor.setStatus('<div class="geStatusAlert">'+ mxUtils.htmlEntities(mxResources.get("error"))+(null!=m?" ("+mxUtils.htmlEntities(m)+")":"")+"</div>")}))))}; DrawioFile.prototype.handleConflictError=function(b,d){var m=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),p=mxUtils.bind(this,function(z){this.handleFileError(z,!0)}),t=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&(this.ui.clearStatus(),this.save(!0,m,p,null,!0,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage))}),n=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&& this.synchronizeFile(mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&this.save(!0,m,p,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage)}),p)});"none"==DrawioFile.SYNC?this.showCopyDialog(m,p,t):this.invalidChecksum&&d?this.showRefreshDialog(m,p,this.getErrorMessage(b)):d?this.showConflictDialog(t,n):this.addConflictStatus(this.getErrorMessage(b),mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument"))); this.synchronizeFile(m,p)}))};DrawioFile.prototype.getErrorMessage=function(b){var d=null!=b?null!=b.error?b.error.message:b.message:null;null==d&&null!=b&&b.code==App.ERROR_TIMEOUT?d=mxResources.get("timeout"):"0"==d&&(d=mxResources.get("noResponse"));return d};DrawioFile.prototype.isOverdue=function(){return null!=this.ageStart&&Date.now()-this.ageStart.getTime()>=this.ui.warnInterval}; DrawioFile.prototype.compressionChanged=function(b){var d=null!=this.ownPages?this.ownPages:this.ui.pages;if(null!=d)for(var m=0;m<d.length;m++){var p=d[m].node;if(null!=p&&(null==this.ui.currentPage||this.ui.currentPage.getId()!=d[m].getId())){var t=p.getElementsByTagName("mxGraphModel");t=0<t.length?t[0]:null;var n=Graph.decompress(mxUtils.getNodeValue(p));b?0==n.length&&null!=t&&(EditorUi.removeChildNodes(p),mxUtils.setTextContent(p,Graph.compressNode(t)),EditorUi.debug("DrawioFile.compressionChanged", [this],"Page "+m+" compressed")):0<n.length&&null==t&&(EditorUi.removeChildNodes(p),p.appendChild(mxUtils.parseXml(n).documentElement),EditorUi.debug("DrawioFile.compressionChanged",[this],"Page "+m+" decompressed"))}}};DrawioFile.prototype.fileReplaced=function(b){this.inConflictState=this.invalidChecksum=!1;null!=b&&this.patch(b);null!=this.sync&&this.sync.initRealtime();EditorUi.debug("DrawioFile.fileReplaced",[this],"patches",b)}; DrawioFile.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(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,p,t,n,z){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;n=null!=n?n:this.ui.getPagesForXml(b,!0);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(n),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=m&&m()):this.sync.fileSaved(n,d,m,p,t,z)}catch(F){this.invalidChecksum= this.inConflictState=!0;this.descriptorChanged();null!=p&&p(F);try{var D=this.getCurrentUser(),N=null!=D?D.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),N,F)}catch(P){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[d],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(F){this.descriptorChanged(),null!=p&&p(F)}}; DrawioFile.prototype.autosave=function(b,d,m,p){null==this.lastAutosave&&(this.lastAutosave=Date.now());var t=Date.now()-this.lastAutosave<d?b:0;this.clearAutosave();var n=window.setTimeout(mxUtils.bind(this,function(){try{if(this.lastAutosave=null,this.autosaveThread==n&&(this.autosaveThread=null),EditorUi.debug("DrawioFile.autosave",[this],"thread",n,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile),this.isModified()&&this.isAutosaveNow()){var z=this.isAutosaveRevision(); z&&(this.lastAutosaveRevision=(new Date).getTime());this.save(z,mxUtils.bind(this,function(D){this.autosaveCompleted();null!=m&&m(D)}),mxUtils.bind(this,function(D){null!=p&&p(D)}))}else this.isModified()||this.ui.clearStatus(),null!=m&&m(null)}catch(D){null!=p&&p(D)}}),t);this.autosaveThread=n;EditorUi.debug("DrawioFile.autosave",[this],"thread",n,"delay",b,"maxDelay",d,"actualDelay",t,"lastAutosave",this.lastAutosave,"saving",this.savingFile)};DrawioFile.prototype.isAutosaveNow=function(){return!0}; DrawioFile.prototype.autosaveCompleted=function(){};DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)};DrawioFile.prototype.isAutosaveRevision=function(){var b=(new Date).getTime();return null==this.lastAutosaveRevision||b-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay};DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))}; 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(d){}this.stats.closed++;this.destroy()};DrawioFile.prototype.hasSameExtension=function(b,d){if(null!=b&&null!=d){var m=b.lastIndexOf(".");b=0<m?b.substring(m):"";m=d.lastIndexOf(".");return b===(0<m?d.substring(m):"")}return b==d}; 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.anchoredCommentsSupported=function(){return!1};DrawioFile.prototype.mentionsSupported=function(){return!1};DrawioFile.prototype.freeMentionsSupported=function(){return this.mentionsSupported()};DrawioFile.prototype.mentionsLiveSearch=function(){return!1};DrawioFile.prototype.mentionNotificationsSupported=function(){return!0};DrawioFile.prototype.getMentionCandidates=function(b,d,m){b([])};DrawioFile.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,p,t,n,z){DrawioFile.call(this,b,d);this.title=m;this.mode=p?null:App.MODE_DEVICE;this.fileHandle=t;this.desc=n;this.editable=z};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,p,t){this.saveAs(this.title,d,m,p,t)};LocalFile.prototype.saveAs=function(b,d,m,p,t){this.saveFile(b,!1,d,m,null,p,t)}; 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,p,t,n,z){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;var D=mxUtils.bind(this,function(P,T){var c=mxUtils.bind(this,function(){var f=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var k=this.getData();if(f){var q=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(y){P(y,k,f)}),T,this.ui.getCurrentFile()!=this?k:null,q.scale,q.border)}else P(k, k,f)});t||n?(t||this.updateFileData(),c()):this.loadFonts(mxUtils.bind(this,function(){this.updateFileData();c()}))}),N=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=m&&m()});if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=!0;var F=mxUtils.bind(this,function(P,T){this.savingFile=!1;null!=T&&T.abort().then(function(){},function(){});null!=p&&p({error:P})});this.fileHandle.createWritable().then(mxUtils.bind(this, function(P){D(mxUtils.bind(this,function(T,c,f){this.saveDraft(c);this.fileHandle.getFile().then(mxUtils.bind(this,function(k){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[k],"conflict",this.desc.lastModified!=k.lastModified);z||this.desc.lastModified==k.lastModified?P.write(f?this.ui.base64ToBlob(T,"image/png"):T).then(mxUtils.bind(this,function(){P.close().then(mxUtils.bind(this,function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(q){try{var y= this.desc;this.savingFile=!1;this.desc=q;this.fileSaved(c,y,N,F);this.removeDraft()}catch(A){F(A)}}),F)}),F)}),mxUtils.bind(this,function(q){F(q,P)})):(this.inConflictState=!0,F(null,P))}),mxUtils.bind(this,function(k){this.invalidFileHandle=!0;F(k,P)}))}),mxUtils.bind(this,function(T){F(T,P)}))}),F)}}else D(mxUtils.bind(this,function(P,T,c){this.ui.isOfflineApp()||this.ui.isLocalFileSave()?this.ui.doSaveLocalFile(P,b,c?"image/png":"text/xml",c):P.length<MAX_REQUEST_SIZE?(T=b.lastIndexOf("."),T=0< T?b.substring(T+1):"xml",(new mxXmlRequest(SAVE_URL,"format="+T+"&xml="+encodeURIComponent(P)+"&filename="+encodeURIComponent(b)+(c?"&binary=1":""))).simulate(document,"_blank")):this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(P)}));N()}),p)};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+"; Editor.thinShapesImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI5Ljc1IDI5Ljc1Wm0tMTMgNS40NXEuNC4wNS43NS4wNUgxOS4wNXY0LjY1cTAgLjI1LjE3NS40MjV0LjQyNS4xNzVIMzkuOXEuMjUgMCAuNDI1LS4xNzV0LjE3NS0uNDI1VjE5LjY1cTAtLjI1LS4xNzUtLjQyNXQtLjQyNS0uMTc1aC00LjY1VjE3LjVxMC0uMzUtLjA1LS43NWg0LjdxMS4xNSAwIDIgLjg3NS44NS44NzUuODUgMi4wMjVWMzkuOXEwIDEuMTUtLjg1IDItLjg1Ljg1LTIgLjg1SDE5LjY1cS0xLjE1IDAtMi4wMjUtLjg1dC0uODc1LTJabTEuNS0zLjk1cS01LjQ1IDAtOS4yMjUtMy44LTMuNzc1LTMuOC0zLjc3NS05LjIgMC01LjQ1IDMuNzc1LTkuMjI1UTEyLjggNS4yNSAxOC4yNSA1LjI1cTUuNCAwIDkuMiAzLjc3NSAzLjggMy43NzUgMy44IDkuMjI1IDAgNS40LTMuOCA5LjItMy44IDMuOC05LjIgMy44Wm0tLjA1LTIuM3E0LjQ1IDAgNy42LTMuMTI1IDMuMTUtMy4xMjUgMy4xNS03LjU3NXQtMy4xMjUtNy42UTIyLjcgNy41IDE4LjI1IDcuNXQtNy42IDMuMTI1UTcuNSAxMy43NSA3LjUgMTguMnQzLjEyNSA3LjZxMy4xMjUgMy4xNSA3LjU3NSAzLjE1Wm0uMDUtMTAuN1oiLz48L3N2Zz4="; Editor.thinUndoImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTE0LjQgMzcuNXYtMi4yNWgxMy45cTMuNiAwIDYuMjI1LTIuMzc1UTM3LjE1IDMwLjUgMzcuMTUgMjYuOXEwLTMuNTUtMi42MjUtNS45LTIuNjI1LTIuMzUtNi4yMjUtMi4zNUgxMi45NUwxOSAyNC43bC0xLjYgMS42LTguOC04LjggOC44LTguOCAxLjYgMS42LTYuMDUgNi4wNWgxNS4zcTQuNTUgMCA3Ljg1IDMuMDV0My4zIDcuNXEwIDQuNS0zLjMgNy41NXQtNy44NSAzLjA1WiIvPjwvc3ZnPg==";Editor.thinRedoImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTE5Ljc1IDM3LjVxLTQuNTUgMC03Ljg1LTMuMDVUOC42IDI2LjlxMC00LjQ1IDMuMy03LjV0Ny44NS0zLjA1aDE1LjNMMjkgMTAuM2wxLjYtMS42IDguOCA4LjgtOC44IDguOC0xLjYtMS42IDYuMDUtNi4wNUgxOS43cS0zLjYgMC02LjIyNSAyLjM1LTIuNjI1IDIuMzUtMi42MjUgNS45IDAgMy42IDIuNjI1IDUuOTc1UTE2LjEgMzUuMjUgMTkuNyAzNS4yNWgxMy45djIuMjVaIi8+PC9zdmc+"; Editor.thinDoubleArrowRightImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTEzIDM1LjMtMS42LTEuNiA5Ljc1LTkuNzUtOS43NS05LjcgMS42LTEuNiAxMS4zNSAxMS4zWm0xMi4zIDAtMS42LTEuNiA5Ljc1LTkuNzUtOS43NS05LjcgMS42LTEuNiAxMS4zIDExLjNaIi8+PC9zdmc+";Editor.thinNoteImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgOTYgOTYwIDk2MCIgd2lkdGg9IjQ4Ij48cGF0aCBkPSJNMjM3LjY5NCA5NTUuOTk5cS0yMy41MjkgMC00MC42MTEtMTcuMDgyLTE3LjA4Mi0xNy4wODItMTcuMDgyLTQwLjYxMVYyNTMuNjk0cTAtMjMuNTI5IDE3LjA4Mi00MC42MTEgMTcuMDgyLTE3LjA4MiA0MC42MTEtMTcuMDgyaDM0Ny41MzdsMTk0Ljc2OCAxOTQuNzY4djUwNy41MzdxMCAyMy41MjktMTcuMDgyIDQwLjYxMS0xNy4wODIgMTcuMDgyLTQwLjYxMSAxNy4wODJIMjM3LjY5NFpNNTYyLjUzOSA0MTEuMjNWMjQxLjM4NUgyMzcuNjk0cS00LjYxNiAwLTguNDYzIDMuODQ2LTMuODQ2IDMuODQ3LTMuODQ2IDguNDYzdjY0NC42MTJxMCA0LjYxNiAzLjg0NiA4LjQ2MyAzLjg0NyAzLjg0NiA4LjQ2MyAzLjg0Nmg0ODQuNjEycTQuNjE2IDAgOC40NjMtMy44NDYgMy44NDYtMy44NDcgMy44NDYtOC40NjNWNDExLjIzSDU2Mi41MzlaTTIyNS4zODUgMjQxLjM4NVY0MTEuMjMgMjQxLjM4NXY2NjkuMjNWMjQxLjM4NVoiLz48L3N2Zz4="; Editor.thinAddCircleImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTIzIDMzLjVoMi4yNXYtOC4yaDguMjVWMjNoLTguMjV2LTguNUgyM1YyM2gtOC41djIuM0gyM1ptMSA5LjVxLTMuOTUgMC03LjQtMS41dC02LjAyNS00LjA3NVE4IDM0Ljg1IDYuNSAzMS40VDUgMjRxMC0zLjk1IDEuNS03LjQyNVE4IDEzLjEgMTAuNTc1IDEwLjU1IDEzLjE1IDggMTYuNiA2LjVUMjQgNXEzLjk1IDAgNy40MjUgMS41UTM0LjkgOCAzNy40NSAxMC41NSA0MCAxMy4xIDQxLjUgMTYuNTc1IDQzIDIwLjA1IDQzIDI0cTAgMy45NS0xLjUgNy40dC00LjA1IDYuMDI1UTM0LjkgNDAgMzEuNDI1IDQxLjUgMjcuOTUgNDMgMjQgNDNabS4wNS0yLjI1cTYuOTUgMCAxMS44MjUtNC45IDQuODc1LTQuOSA0Ljg3NS0xMS45IDAtNi45NS00Ljg3NS0xMS44MjVRMzEgNy4yNSAyNCA3LjI1cS02Ljk1IDAtMTEuODUgNC44NzVRNy4yNSAxNyA3LjI1IDI0cTAgNi45NSA0LjkgMTEuODUgNC45IDQuOSAxMS45IDQuOVpNMjQgMjRaIi8+PC9zdmc+"; Editor.thinDeleteImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTEzLjkgNDFxLTEuMTUgMC0yLS44NS0uODUtLjg1LS44NS0yLjA1VjEwLjlIOVY4LjY1aDguNTV2LTEuNGgxMi45djEuNEgzOXYyLjI1aC0yLjA1djI3LjJxMCAxLjItLjg1IDIuMDUtLjg1Ljg1LTIgLjg1Wm0yMC44LTMwLjFIMTMuM3YyNy4ycTAgLjMuMTc1LjQ3NXQuNDI1LjE3NWgyMC4ycS4yIDAgLjQtLjJ0LjItLjQ1Wk0xOS4wNSAzNC41aDIuM1YxNS4xaC0yLjNabTcuNiAwaDIuM1YxNS4xaC0yLjNaTTEzLjMgMTAuOXYyNy44NVYzOC4xWiIvPjwvc3ZnPg==";Editor.thinLightImage= "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI0IDMwLjc1cTIuOCAwIDQuNzc1LTEuOTc1UTMwLjc1IDI2LjggMzAuNzUgMjRxMC0yLjgtMS45NzUtNC43NzVRMjYuOCAxNy4yNSAyNCAxNy4yNXEtMi44IDAtNC43NzUgMS45NzVRMTcuMjUgMjEuMiAxNy4yNSAyNHEwIDIuOCAxLjk3NSA0Ljc3NVEyMS4yIDMwLjc1IDI0IDMwLjc1Wk0yNCAzM3EtMy43NSAwLTYuMzc1LTIuNjI1VDE1IDI0cTAtMy43NSAyLjYyNS02LjM3NVQyNCAxNXEzLjc1IDAgNi4zNzUgMi42MjVUMzMgMjRxMCAzLjc1LTIuNjI1IDYuMzc1VDI0IDMzWk0zLjY1IDI1LjE1cS0uNSAwLS44MjUtLjMyNVEyLjUgMjQuNSAyLjUgMjRxMC0uNS4zMjUtLjgyNS4zMjUtLjMyNS44MjUtLjMyNWg1LjJxLjUgMCAuODI1LjMyNVExMCAyMy41IDEwIDI0cTAgLjUtLjMyNS44MjUtLjMyNS4zMjUtLjgyNS4zMjVabTM1LjUgMHEtLjUgMC0uODI1LS4zMjVRMzggMjQuNSAzOCAyNHEwLS41LjMyNS0uODI1LjMyNS0uMzI1LjgyNS0uMzI1aDUuMnEuNSAwIC44MjUuMzI1LjMyNS4zMjUuMzI1LjgyNSAwIC41LS4zMjUuODI1LS4zMjUuMzI1LS44MjUuMzI1Wk0yNCAxMHEtLjUgMC0uODI1LS4zMjUtLjMyNS0uMzI1LS4zMjUtLjgyNXYtNS4ycTAtLjUuMzI1LS44MjVRMjMuNSAyLjUgMjQgMi41cS41IDAgLjgyNS4zMjUuMzI1LjMyNS4zMjUuODI1djUuMnEwIC41LS4zMjUuODI1UTI0LjUgMTAgMjQgMTBabTAgMzUuNXEtLjUgMC0uODI1LS4zMjUtLjMyNS0uMzI1LS4zMjUtLjgyNXYtNS4ycTAtLjUuMzI1LS44MjVRMjMuNSAzOCAyNCAzOHEuNSAwIC44MjUuMzI1LjMyNS4zMjUuMzI1LjgyNXY1LjJxMCAuNS0uMzI1LjgyNS0uMzI1LjMyNS0uODI1LjMyNVpNMTIuNSAxNC4xbC0zLTIuOTVxLS4zNS0uMzUtLjMyNS0uODI1UTkuMiA5Ljg1IDkuNSA5LjVxLjM1LS4zNS44LS4zNS40NSAwIC44NS4zNWwyLjk1IDNxLjMuMzUuMy44IDAgLjQ1LS4zLjgtLjMuMy0uNzc1LjMtLjQ3NSAwLS44MjUtLjNabTI0LjM1IDI0LjQtMi45NS0zcS0uMy0uMzUtLjMtLjggMC0uNDUuMzUtLjguMjUtLjM1LjcyNS0uMzV0LjgyNS4zNWwzIDIuOTVxLjM1LjM1LjMyNS44MjUtLjAyNS40NzUtLjMyNS44MjUtLjM1LjM1LS44LjM1LS40NSAwLS44NS0uMzVaTTMzLjkgMTQuMXEtLjM1LS4zNS0uMzUtLjggMC0uNDUuMzUtLjhsMi45NS0zcS4zNS0uMzUuODI1LS4zMjUuNDc1LjAyNS44MjUuMzI1LjM1LjM1LjM1LjggMCAuNDUtLjM1Ljg1bC0zIDIuOTVxLS4zLjMtLjc3NS4zLS40NzUgMC0uODI1LS4zWk05LjUgMzguNXEtLjM1LS4zNS0uMzUtLjggMC0uNDUuMzUtLjg1bDMtMi45NXEuMzUtLjM1LjgtLjM1LjQ1IDAgLjguMzUuMzUuMy4zMjUuNzc1LS4wMjUuNDc1LS4zMjUuODI1bC0yLjk1IDNxLS40LjM1LS44NS4zNS0uNDUgMC0uOC0uMzVaTTI0IDI0WiIvPjwvc3ZnPg=="; Editor.thinDarkImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI0LjA1IDQxcS03LjEgMC0xMi4wNS00Ljk1UTcuMDUgMzEuMSA3LjA1IDI0cTAtNi44IDQuNi0xMS42NSA0LjYtNC44NSAxMS4zLTUuMjUuMiAwIC40NS4wMjV0LjcuMDI1UTIyLjc1IDguNyAyMiAxMC43MjVxLS43NSAyLjAyNS0uNzUgNC4yNzUgMCA0LjkgMy40NSA4LjM1IDMuNDUgMy40NSA4LjM1IDMuNDUgMi4yIDAgNC4yNzUtLjY3NVQ0MC45IDI0LjJxMCAuMzUuMDI1LjU1LjAyNS4yLjAyNS4zNS0uNCA2LjctNS4yNSAxMS4zUTMwLjg1IDQxIDI0LjA1IDQxWm0wLTIuMjVxNS4xNSAwIDkuMDc1LTMuMTI1UTM3LjA1IDMyLjUgMzguMiAyOC4xcS0xLjIuNS0yLjUuNzI1LTEuMy4yMjUtMi42NS4yMjUtNS44NSAwLTkuOTUtNC4xVDE5IDE1cTAtMS4xNS4yMjUtMi40MjVUMjAgOS43NXEtNC42NSAxLjQtNy42NSA1LjM3NVQ5LjM1IDI0cTAgNi4xNSA0LjI3NSAxMC40NSA0LjI3NSA0LjMgMTAuNDI1IDQuM1ptLS4yNS0xNC41WiIvPjwvc3ZnPg=="; Editor.thinCommentImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTEyLjUgMjcuNWgyM3YtMi4yNWgtMjNabTAtNi4zNWgyM3YtMi4zaC0yM1ptMC02LjRoMjNWMTIuNWgtMjNaTTQzIDQyLjEgMzUuOSAzNWgtMjhxLTEuMTUgMC0yLjAyNS0uODc1VDUgMzIuMVY3LjlxMC0xLjE1Ljg3NS0yLjAyNVQ3LjkgNWgzMi4ycTEuMiAwIDIuMDUuODc1UTQzIDYuNzUgNDMgNy45Wk03LjI1IDcuOXYyNC44NUgzNi45bDMuODUgMy44NVY3LjlxMC0uMy0uMTc1LS40NzVUNDAuMSA3LjI1SDcuOXEtLjMgMC0uNDc1LjE3NVQ3LjI1IDcuOVptMCAwdjI4LjdWNy4yNSA3LjlaIi8+PC9zdmc+"; Editor.lightDarkCommentImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBzdHlsZT0iY29sb3Itc2NoZW1lOmxpZ2h0IGRhcms7IiBmaWxsPSJsaWdodC1kYXJrKCMwMDAwMDAsI2ZmZmZmZikiPjxwYXRoIGQ9Ik0yNDAtNDAwaDQ4MHYtODBIMjQwdjgwWm0wLTEyMGg0ODB2LTgwSDI0MHY4MFptMC0xMjBoNDgwdi04MEgyNDB2ODBaTTgwLTgwdi03MjBxMC0zMyAyMy41LTU2LjVUMTYwLTg4MGg2NDBxMzMgMCA1Ni41IDIzLjVUODgwLTgwMHY0ODBxMCAzMy0yMy41IDU2LjVUODAwLTI0MEgyNDBMODAtODBabTEyNi0yNDBoNTk0di00ODBIMTYwdjUyNWw0Ni00NVptLTQ2IDB2LTQ4MCA0ODBaIi8+PC9zdmc+"; Editor.thinMenuImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTEzLjUgMjYuMTVxLjkgMCAxLjUyNS0uNjI1LjYyNS0uNjI1LjYyNS0xLjUyNSAwLS45LS42MjUtMS41MjUtLjYyNS0uNjI1LTEuNTI1LS42MjUtLjkgMC0xLjUyNS42MjUtLjYyNS42MjUtLjYyNSAxLjUyNSAwIC45LjYyNSAxLjUyNS42MjUuNjI1IDEuNTI1LjYyNVptMTAuNSAwcS45IDAgMS41MjUtLjYyNS42MjUtLjYyNS42MjUtMS41MjUgMC0uOS0uNjI1LTEuNTI1UTI0LjkgMjEuODUgMjQgMjEuODVxLS45IDAtMS41MjUuNjI1LS42MjUuNjI1LS42MjUgMS41MjUgMCAuOS42MjUgMS41MjUuNjI1LjYyNSAxLjUyNS42MjVabTEwLjUgMHEuODUgMCAxLjQ3NS0uNjI1UTM2LjYgMjQuOSAzNi42IDI0cTAtLjktLjYyNS0xLjUyNS0uNjI1LS42MjUtMS41MjUtLjYyNS0uODUgMC0xLjQ3NS42MjUtLjYyNS42MjUtLjYyNSAxLjUyNSAwIC45LjYyNSAxLjUyNS42MjUuNjI1IDEuNTI1LjYyNVpNMjQgNDNxLTMuOTUgMC03LjQtMS41dC02LjAyNS00LjA3NVE4IDM0Ljg1IDYuNSAzMS40VDUgMjRxMC0zLjk1IDEuNS03LjQyNVE4IDEzLjEgMTAuNTc1IDEwLjU1IDEzLjE1IDggMTYuNiA2LjVUMjQgNXEzLjk1IDAgNy40MjUgMS41UTM0LjkgOCAzNy40NSAxMC41NSA0MCAxMy4xIDQxLjUgMTYuNTc1IDQzIDIwLjA1IDQzIDI0cTAgMy45NS0xLjUgNy40dC00LjA1IDYuMDI1UTM0LjkgNDAgMzEuNDI1IDQxLjUgMjcuOTUgNDMgMjQgNDNabTAtMi4yNXE3IDAgMTEuODc1LTQuOVQ0MC43NSAyNHEwLTctNC44NzUtMTEuODc1VDI0IDcuMjVxLTYuOTUgMC0xMS44NSA0Ljg3NVE3LjI1IDE3IDcuMjUgMjRxMCA2Ljk1IDQuOSAxMS44NSA0LjkgNC45IDExLjg1IDQuOVpNMjQgMjRaIi8+PC9zdmc+"; Editor.thinViewImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTUgMzlWOWgzOHYzMFptMjguNTUtMjAuNmg3LjJ2LTcuMTVoLTcuMlptMCA4Ljk1aDcuMnYtNi43aC03LjJabS0yNi4zIDkuNEgzMS4zdi0yNS41SDcuMjVabTI2LjMgMGg3LjJWMjkuNmgtNy4yWiIvPjwvc3ZnPg==";Editor.thinUserAddImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTM2LjYgMjcuNXYtNi4zNWgtNi4zNXYtMi4zaDYuMzVWMTIuNWgyLjN2Ni4zNWg2LjM1djIuM0gzOC45djYuMzVaTTE4IDIzLjM1cS0yLjkgMC00Ljc3NS0xLjg3NVExMS4zNSAxOS42IDExLjM1IDE2LjdxMC0yLjkgMS44NzUtNC43NVQxOCAxMC4xcTIuOSAwIDQuNzc1IDEuODUgMS44NzUgMS44NSAxLjg3NSA0Ljc1dC0xLjg3NSA0Ljc3NVEyMC45IDIzLjM1IDE4IDIzLjM1Wk0zIDM4LjZ2LTMuOHEwLTEuNS44LTIuNzV0Mi4yNS0xLjlxMy40NS0xLjUgNi4yNzUtMi4xNSAyLjgyNS0uNjUgNS42NzUtLjY1IDIuODUgMCA1LjY1LjY1IDIuOC42NSA2LjI1IDIuMTUgMS40NS43IDIuMjc1IDEuOTI1VDMzIDM0Ljh2My44Wm0yLjI1LTIuMjVoMjUuNVYzNC44cTAtLjc1LS41LTEuNDc1LS41LS43MjUtMS4zLTEuMTI1LTMuMi0xLjUtNS42NzUtMi4wNVEyMC44IDI5LjYgMTggMjkuNnEtMi44IDAtNS4zLjU1VDcgMzIuMnEtLjguNC0xLjI3NSAxLjEyNS0uNDc1LjcyNS0uNDc1IDEuNDc1Wk0xOCAyMS4xcTEuODUgMCAzLjEtMS4yNXQxLjI1LTMuMTVxMC0xLjg1LTEuMjUtMy4xVDE4IDEyLjM1cS0xLjg1IDAtMy4xIDEuMjV0LTEuMjUgMy4xcTAgMS45IDEuMjUgMy4xNVQxOCAyMS4xWm0wLTQuNFptMCAxOS42NVoiLz48L3N2Zz4="; Editor.thinUserFlashImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTkgMzguNnYtMy44cTAtMS42Ljg1LTIuOC44NS0xLjIgMi4yLTEuODUgMy4yLTEuNCA2LjEyNS0yLjEgMi45MjUtLjcgNS44MjUtLjcgMS40NSAwIDIuOS4xNzV0Mi45LjUyNXYyLjJxLTEuNDUtLjM1LTIuODc1LS41UTI1LjUgMjkuNiAyNCAyOS42cS0yLjc1IDAtNS40LjYtMi42NS42LTUuNiAyLS43NS40LTEuMjUgMS4xMjV0LS41IDEuNDc1djEuNTVIMjkuOHYyLjI1Wm0yLjI1LTIuMjVIMjkuOFptMTIuNzUtMTNxLTIuOSAwLTQuNzc1LTEuODc1UTE3LjM1IDE5LjYgMTcuMzUgMTYuN3EwLTIuOSAxLjg3NS00Ljc1VDI0IDEwLjFxMi45IDAgNC43NzUgMS44NSAxLjg3NSAxLjg1IDEuODc1IDQuNzV0LTEuODc1IDQuNzc1UTI2LjkgMjMuMzUgMjQgMjMuMzVabTAtMi4yNXExLjg1IDAgMy4xLTEuMjV0MS4yNS0zLjE1cTAtMS44NS0xLjI1LTMuMVQyNCAxMi4zNXEtMS44NSAwLTMuMSAxLjI1dC0xLjI1IDMuMXEwIDEuOSAxLjI1IDMuMTVUMjQgMjEuMVptMC00LjRabTEyLjg1IDI4LjA1di03LjhoLTMuNHYtMTAuMWg5LjE1bC0zLjggNy42NWgzLjdaIi8+PC9zdmc+"; Editor.thinShareImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTExLjkgNDVxLTEuMiAwLTIuMDUtLjg1UTkgNDMuMyA5IDQyLjFWMTguOHEwLTEuMTUuODUtMiAuODUtLjg1IDIuMDUtLjg1aDYuOXYyLjI1aC02LjlxLS4yNSAwLS40NS4ydC0uMi40djIzLjNxMCAuMjUuMi40NXQuNDUuMmgyNC4ycS4yNSAwIC40NS0uMnQuMi0uNDVWMTguOHEwLS4yLS4yLS40dC0uNDUtLjJoLTYuOTV2LTIuMjVoNi45NXExLjIgMCAyLjA1Ljg1Ljg1Ljg1Ljg1IDJ2MjMuM3EwIDEuMi0uODUgMi4wNS0uODUuODUtMi4wNS44NVptMTAuOTUtMTQuNVY4LjFsLTQuNiA0LjU1LTEuNjUtMS42IDcuMzUtNy4zNSA3LjM1IDcuMzUtMS42IDEuNi00LjYtNC41NXYyMi40WiIvPjwvc3ZnPg=="; Editor.thinTextImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTMuNCA0NC42di05LjI1aDMuNTV2LTIyLjdIMy40VjMuNGg5LjI1djMuNTVoMjIuN1YzLjRoOS4yNXY5LjI1aC0zLjU1djIyLjdoMy41NXY5LjI1aC05LjI1di0zLjU1aC0yMi43djMuNTVabTkuMjUtNS44NWgyMi43di0zLjRoMy40di0yMi43aC0zLjR2LTMuNGgtMjIuN3YzLjRoLTMuNHYyMi43aDMuNFptMy4xNS02LjI1IDcuMzUtMTkuMTVoMS42NWw3LjQ1IDE5LjE1aC0yLjFMMjggMjdoLTcuODVsLTIuMSA1LjVabTQuOTUtNy4zNWg2LjVMMjQuMSAxNi44aC0uM1ptLTE1LjEtMTQuOGg0Ljd2LTQuN2gtNC43Wm0zMiAwaDQuN3YtNC43aC00LjdabTAgMzJoNC43di00LjdoLTQuN1ptLTMyIDBoNC43di00LjdoLTQuN1ptMzItMzJabTAgMjcuM1ptLTI3LjMgMFptMC0yNy4zWiIvPjwvc3ZnPg=="; Editor.thinRectangleImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTUgMzlWOWgzOHYzMFptMi4yNS0yLjI1aDMzLjV2LTI1LjVINy4yNVptMCAwdi0yNS41IDI1LjVaIi8+PC9zdmc+";Editor.thinDataImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI4Ljg1IDM5LjF2LTIuMjVIMzRxMS4yIDAgMi4wMjUtLjgyNVQzNi44NSAzNHYtNC45cTAtMS43NSAxLjA3NS0zLjEyNXQyLjcyNS0xLjgyNXYtLjNxLTEuNjUtLjQ1LTIuNzI1LTEuODI1UTM2Ljg1IDIwLjY1IDM2Ljg1IDE4LjlWMTRxMC0xLjItLjgyNS0yLjAyNVQzNCAxMS4xNWgtNS4xNVY4LjlIMzRxMi4xNSAwIDMuNjI1IDEuNVQzOS4xIDE0djQuOXEwIDEuMjUuODUgMi4wNzUuODUuODI1IDIuMS44MjVoLjg1djQuNGgtLjg1cS0xLjI1IDAtMi4xLjgyNS0uODUuODI1LS44NSAyLjA3NVYzNHEwIDIuMS0xLjUgMy42VDM0IDM5LjFaTTE0IDM5LjFxLTIuMTUgMC0zLjYyNS0xLjVUOC45IDM0di00LjlxMC0xLjI1LS44NS0yLjA3NS0uODUtLjgyNS0yLjEtLjgyNUg1LjF2LTQuNGguODVxMS4yNSAwIDIuMS0uODI1Ljg1LS44MjUuODUtMi4wNzVWMTRxMC0yLjEgMS41LTMuNlQxNCA4LjloNS4xNXYyLjI1SDE0cS0xLjIgMC0yLjAyNS44MjVUMTEuMTUgMTR2NC45cTAgMS43NS0xLjA3NSAzLjEyNVQ3LjM1IDIzLjg1di4zcTEuNjUuNDUgMi43MjUgMS44MjVRMTEuMTUgMjcuMzUgMTEuMTUgMjkuMVYzNHEwIDEuMi44MjUgMi4wMjVUMTQgMzYuODVoNS4xNXYyLjI1WiIvPjwvc3ZnPg=="; Editor.thinExpandImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI0IDMwLjEgMTIuNyAxOC43NWwxLjYtMS42IDkuNyA5LjcgOS43LTkuNyAxLjYgMS42NVoiLz48L3N2Zz4=";Editor.thinGridImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iNDgiPjxwYXRoIGQ9Ik0yMjMuMjkxLTE1NC41cS0yOS4xMTcgMC00OC45NTQtMTkuODM3VDE1NC41LTIyMy4yOTFxMC0yOS4xMTggMTkuODM3LTQ4LjkxM1ExOTQuMTc0LTI5MiAyMjMuMjkxLTI5MnEyOS4xMTggMCA0OC45MTMgMTkuNzk2UTI5Mi0yNTIuNDA5IDI5Mi0yMjMuMjkxcTAgMjkuMTE3LTE5Ljc5NiA0OC45NTQtMTkuNzk1IDE5LjgzNy00OC45MTMgMTkuODM3Wm0yNTYuOCAwcS0yOS4wNDggMC00OC44ODUtMTkuODM3LTE5LjgzNi0xOS44MzctMTkuODM2LTQ4Ljk1NCAwLTI5LjExOCAxOS43NDUtNDguOTEzUTQ1MC44NjEtMjkyIDQ3OS45MDktMjkydDQ4Ljg4NSAxOS43OTZxMTkuODM2IDE5Ljc5NSAxOS44MzYgNDguOTEzIDAgMjkuMTE3LTE5Ljc0NSA0OC45NTQtMTkuNzQ2IDE5LjgzNy00OC43OTQgMTkuODM3Wm0yNTYuNjE4IDBxLTI5LjExOCAwLTQ4LjkxMy0xOS44MzdRNjY4LTE5NC4xNzQgNjY4LTIyMy4yOTFxMC0yOS4xMTggMTkuNzk2LTQ4LjkxM1E3MDcuNTkxLTI5MiA3MzYuNzA5LTI5MnEyOS4xMTcgMCA0OC45NTQgMTkuNzk2IDE5LjgzNyAxOS43OTUgMTkuODM3IDQ4LjkxMyAwIDI5LjExNy0xOS44MzcgNDguOTU0VDczNi43MDktMTU0LjVaTTIyMy4yOTEtNDExLjM3cS0yOS4xMTcgMC00OC45NTQtMTkuNzQ1LTE5LjgzNy0xOS43NDYtMTkuODM3LTQ4Ljc5NHQxOS44MzctNDguODg1cTE5LjgzNy0xOS44MzYgNDguOTU0LTE5LjgzNiAyOS4xMTggMCA0OC45MTMgMTkuNzQ1UTI5Mi01MDkuMTM5IDI5Mi00ODAuMDkxdC0xOS43OTYgNDguODg1cS0xOS43OTUgMTkuODM2LTQ4LjkxMyAxOS44MzZabTI1Ni44IDBxLTI5LjA0OCAwLTQ4Ljg4NS0xOS43NDUtMTkuODM2LTE5Ljc0Ni0xOS44MzYtNDguNzk0dDE5Ljc0NS00OC44ODVxMTkuNzQ2LTE5LjgzNiA0OC43OTQtMTkuODM2dDQ4Ljg4NSAxOS43NDVxMTkuODM2IDE5Ljc0NiAxOS44MzYgNDguNzk0dC0xOS43NDUgNDguODg1cS0xOS43NDYgMTkuODM2LTQ4Ljc5NCAxOS44MzZabTI1Ni42MTggMHEtMjkuMTE4IDAtNDguOTEzLTE5Ljc0NVE2NjgtNDUwLjg2MSA2NjgtNDc5LjkwOXQxOS43OTYtNDguODg1cTE5Ljc5NS0xOS44MzYgNDguOTEzLTE5LjgzNiAyOS4xMTcgMCA0OC45NTQgMTkuNzQ1IDE5LjgzNyAxOS43NDYgMTkuODM3IDQ4Ljc5NHQtMTkuODM3IDQ4Ljg4NXEtMTkuODM3IDE5LjgzNi00OC45NTQgMTkuODM2Wk0yMjMuMjkxLTY2OHEtMjkuMTE3IDAtNDguOTU0LTE5Ljc5Ni0xOS44MzctMTkuNzk1LTE5LjgzNy00OC45MTMgMC0yOS4xMTcgMTkuODM3LTQ4Ljk1NHQ0OC45NTQtMTkuODM3cTI5LjExOCAwIDQ4LjkxMyAxOS44MzdRMjkyLTc2NS44MjYgMjkyLTczNi43MDlxMCAyOS4xMTgtMTkuNzk2IDQ4LjkxM1EyNTIuNDA5LTY2OCAyMjMuMjkxLTY2OFptMjU2LjggMHEtMjkuMDQ4IDAtNDguODg1LTE5Ljc5Ni0xOS44MzYtMTkuNzk1LTE5LjgzNi00OC45MTMgMC0yOS4xMTcgMTkuNzQ1LTQ4Ljk1NCAxOS43NDYtMTkuODM3IDQ4Ljc5NC0xOS44Mzd0NDguODg1IDE5LjgzN3ExOS44MzYgMTkuODM3IDE5LjgzNiA0OC45NTQgMCAyOS4xMTgtMTkuNzQ1IDQ4LjkxM1E1MDkuMTM5LTY2OCA0ODAuMDkxLTY2OFptMjU2LjYxOCAwcS0yOS4xMTggMC00OC45MTMtMTkuNzk2UTY2OC03MDcuNTkxIDY2OC03MzYuNzA5cTAtMjkuMTE3IDE5Ljc5Ni00OC45NTQgMTkuNzk1LTE5LjgzNyA0OC45MTMtMTkuODM3IDI5LjExNyAwIDQ4Ljk1NCAxOS44Mzd0MTkuODM3IDQ4Ljk1NHEwIDI5LjExOC0xOS44MzcgNDguOTEzUTc2NS44MjYtNjY4IDczNi43MDktNjY4WiIvPjwvc3ZnPg=="; Editor.thinOpenImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjQiPjxwYXRoIGQ9Ik0yNDAtODBxLTMzIDAtNTYuNS0yMy41VDE2MC0xNjB2LTY0MHEwLTMzIDIzLjUtNTYuNVQyNDAtODgwaDMyMGwyNDAgMjQwdjI0MGgtODB2LTIwMEg1MjB2LTIwMEgyNDB2NjQwaDM2MHY4MEgyNDBabTYzOCAxNUw3NjAtMTgzdjg5aC04MHYtMjI2aDIyNnY4MGgtOTBsMTE4IDExOC01NiA1N1ptLTYzOC05NXYtNjQwIDY0MFoiLz48L3N2Zz4=";Editor.selectImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjAwLTEyMHEtMzMgMC01Ni41LTIzLjVUMTIwLTIwMHYtNTYwcTAtMzMgMjMuNS01Ni41VDIwMC04NDBoNTYwcTggMCAxNSAxLjV0MTQgNC41bC03NCA3NEgyMDB2NTYwaDU2MHYtMjY2bDgwLTgwdjM0NnEwIDMzLTIzLjUgNTYuNVQ3NjAtMTIwSDIwMFptMjYxLTE2MEwyMzUtNTA2bDU2LTU2IDE3MCAxNzAgMzY3LTM2NyA1NyA1NS00MjQgNDI0WiIvPjwvc3ZnPg=="; Editor.styles=[{},{commonStyle:{fontColor:"#393C56",strokeColor:"#E07A5F",fillColor:"#F2CC8F"},graph:{background:"#F4F1DE",gridColor:"#D4D0C0"}},{vertexStyle:{strokeColor:"#BAC8D3",fillColor:"#09555B",fontColor:"#EEEEEE"},edgeStyle:{strokeColor:"#0B4D6A"}},{vertexStyle:{strokeColor:"#FFFFFF",fillColor:"#182E3E",fontColor:"#FFFFFF"},edgeStyle:{strokeColor:"#23445D"},graph:{background:"#FCE7CD",gridColor:"#CFBDA8"}},{vertexStyle:{strokeColor:"#D0CEE2",fillColor:"#5D7F99"},edgeStyle:{strokeColor:"#736CA8"}, commonStyle:{fontColor:"#1A1A1A"}},{commonStyle:{fontColor:"#46495D",strokeColor:"#788AA3",fillColor:"#B2C9AB"}},{commonStyle:{fontColor:"#5AA9E6",strokeColor:"#FF6392",fillColor:"#FFE45E"}},{commonStyle:{fontColor:"#E4FDE1",strokeColor:"#028090",fillColor:"#F45B69"},graph:{background:"#114B5F",gridColor:"#0B3240"}},{commonStyle:{fontColor:"#FEFAE0",strokeColor:"#DDA15E",fillColor:"#BC6C25"},graph:{background:"#283618",gridColor:"#48632C"}},{commonStyle:{fontColor:"#143642",strokeColor:"#0F8B8D", fillColor:"#FAE5C7"},edgeStyle:{strokeColor:"#A8201A"},graph:{background:"#DAD2D8",gridColor:"#ABA4A9"}},{},{vertexStyle:{strokeColor:"#D0CEE2",fillColor:"#FAD9D5"},edgeStyle:{strokeColor:"#09555B"},commonStyle:{fontColor:"#1A1A1A"}},{commonStyle:{fontColor:"#1D3557",strokeColor:"#457B9D",fillColor:"#A8DADC"},graph:{background:"#F1FAEE"}},{commonStyle:{fontColor:"#095C86",strokeColor:"#AF45ED",fillColor:"#F694C1"},edgeStyle:{strokeColor:"#60E696"}},{commonStyle:{fontColor:"#5C5C5C",strokeColor:"#006658", fillColor:"#21C0A5"}},{vertexStyle:{strokeColor:"#FFFFFF",fillColor:"#F08E81"},edgeStyle:{strokeColor:"#182E3E"},commonStyle:{fontColor:"#1A1A1A"},graph:{background:"#B0E3E6",gridColor:"#87AEB0"}},{vertexStyle:{strokeColor:"#909090",fillColor:"#F5AB50"},edgeStyle:{strokeColor:"#182E3E"},commonStyle:{fontColor:"#1A1A1A"},graph:{background:"#EEEEEE"}},{vertexStyle:{strokeColor:"#BAC8D3",fillColor:"#B1DDF0",fontColor:"#182E3E"},edgeStyle:{strokeColor:"#EEEEEE",fontColor:"#FFFFFF"},graph:{background:"#09555B", gridColor:"#13B4C2"}},{vertexStyle:{strokeColor:"#EEEEEE",fillColor:"#56517E",fontColor:"#FFFFFF"},edgeStyle:{strokeColor:"#182E3E"},graph:{background:"#FAD9D5",gridColor:"#BFA6A3"}},{vertexStyle:{fillColor:"#EEEEEE",fontColor:"#1A1A1A"},edgeStyle:{fontColor:"#FFFFFF"},commonStyle:{strokeColor:"#FFFFFF"},graph:{background:"#182E3E",gridColor:"#4D94C7"}}];Editor.logoImage="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIKICAgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzA2LjE4NSAxMjAuMjk2IgogICB2aWV3Qm94PSIyNCAyNiA2OCA2OCIKICAgeT0iMHB4IgogICB4PSIwcHgiCiAgIHZlcnNpb249IjEuMSI+CiAgIAkgPGc+PGxpbmUKICAgICAgIHkyPSI3Mi4zOTQiCiAgICAgICB4Mj0iNDEuMDYxIgogICAgICAgeTE9IjQzLjM4NCIKICAgICAgIHgxPSI1OC4wNjkiCiAgICAgICBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiCiAgICAgICBzdHJva2Utd2lkdGg9IjMuNTUyOCIKICAgICAgIHN0cm9rZT0iI0ZGRkZGRiIKICAgICAgIGZpbGw9Im5vbmUiIC8+PGxpbmUKICAgICAgIHkyPSI3Mi4zOTQiCiAgICAgICB4Mj0iNzUuMDc2IgogICAgICAgeTE9IjQzLjM4NCIKICAgICAgIHgxPSI1OC4wNjgiCiAgICAgICBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiCiAgICAgICBzdHJva2Utd2lkdGg9IjMuNTAwOCIKICAgICAgIHN0cm9rZT0iI0ZGRkZGRiIKICAgICAgIGZpbGw9Im5vbmUiIC8+PGc+PHBhdGgKICAgICAgICAgZD0iTTUyLjc3Myw3Ny4wODRjMCwxLjk1NC0xLjU5OSwzLjU1My0zLjU1MywzLjU1M0gzNi45OTljLTEuOTU0LDAtMy41NTMtMS41OTktMy41NTMtMy41NTN2LTkuMzc5ICAgIGMwLTEuOTU0LDEuNTk5LTMuNTUzLDMuNTUzLTMuNTUzaDEyLjIyMmMxLjk1NCwwLDMuNTUzLDEuNTk5LDMuNTUzLDMuNTUzVjc3LjA4NHoiCiAgICAgICAgIGZpbGw9IiNGRkZGRkYiIC8+PC9nPjxnCiAgICAgICBpZD0iZzM0MTkiPjxwYXRoCiAgICAgICAgIGQ9Ik02Ny43NjIsNDguMDc0YzAsMS45NTQtMS41OTksMy41NTMtMy41NTMsMy41NTNINTEuOTg4Yy0xLjk1NCwwLTMuNTUzLTEuNTk5LTMuNTUzLTMuNTUzdi05LjM3OSAgICBjMC0xLjk1NCwxLjU5OS0zLjU1MywzLjU1My0zLjU1M0g2NC4yMWMxLjk1NCwwLDMuNTUzLDEuNTk5LDMuNTUzLDMuNTUzVjQ4LjA3NHoiCiAgICAgICAgIGZpbGw9IiNGRkZGRkYiIC8+PC9nPjxnPjxwYXRoCiAgICAgICAgIGQ9Ik04Mi43NTIsNzcuMDg0YzAsMS45NTQtMS41OTksMy41NTMtMy41NTMsMy41NTNINjYuOTc3Yy0xLjk1NCwwLTMuNTUzLTEuNTk5LTMuNTUzLTMuNTUzdi05LjM3OSAgICBjMC0xLjk1NCwxLjU5OS0zLjU1MywzLjU1My0zLjU1M2gxMi4yMjJjMS45NTQsMCwzLjU1MywxLjU5OSwzLjU1MywzLjU1M1Y3Ny4wODR6IgogICAgICAgICBmaWxsPSIjRkZGRkZGIiAvPjwvZz48L2c+PC9zdmc+"; Editor.saveImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iYmxhY2siIHdpZHRoPSIxOHB4IiBoZWlnaHQ9IjE4cHgiPjxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz48cGF0aCBkPSJNMTkgMTJ2N0g1di03SDN2N2MwIDEuMS45IDIgMiAyaDE0YzEuMSAwIDItLjkgMi0ydi03aC0yem0tNiAuNjdsMi41OS0yLjU4TDE3IDExLjVsLTUgNS01LTUgMS40MS0xLjQxTDExIDEyLjY3VjNoMnoiLz48L3N2Zz4=";Editor.globeImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTEuOTkgMkM2LjQ3IDIgMiA2LjQ4IDIgMTJzNC40NyAxMCA5Ljk5IDEwQzE3LjUyIDIyIDIyIDE3LjUyIDIyIDEyUzE3LjUyIDIgMTEuOTkgMnptNi45MyA2aC0yLjk1Yy0uMzItMS4yNS0uNzgtMi40NS0xLjM4LTMuNTYgMS44NC42MyAzLjM3IDEuOTEgNC4zMyAzLjU2ek0xMiA0LjA0Yy44MyAxLjIgMS40OCAyLjUzIDEuOTEgMy45NmgtMy44MmMuNDMtMS40MyAxLjA4LTIuNzYgMS45MS0zLjk2ek00LjI2IDE0QzQuMSAxMy4zNiA0IDEyLjY5IDQgMTJzLjEtMS4zNi4yNi0yaDMuMzhjLS4wOC42Ni0uMTQgMS4zMi0uMTQgMiAwIC42OC4wNiAxLjM0LjE0IDJINC4yNnptLjgyIDJoMi45NWMuMzIgMS4yNS43OCAyLjQ1IDEuMzggMy41Ni0xLjg0LS42My0zLjM3LTEuOS00LjMzLTMuNTZ6bTIuOTUtOEg1LjA4Yy45Ni0xLjY2IDIuNDktMi45MyA0LjMzLTMuNTZDOC44MSA1LjU1IDguMzUgNi43NSA4LjAzIDh6TTEyIDE5Ljk2Yy0uODMtMS4yLTEuNDgtMi41My0xLjkxLTMuOTZoMy44MmMtLjQzIDEuNDMtMS4wOCAyLjc2LTEuOTEgMy45NnpNMTQuMzQgMTRIOS42NmMtLjA5LS42Ni0uMTYtMS4zMi0uMTYtMiAwLS42OC4wNy0xLjM1LjE2LTJoNC42OGMuMDkuNjUuMTYgMS4zMi4xNiAyIDAgLjY4LS4wNyAxLjM0LS4xNiAyem0uMjUgNS41NmMuNi0xLjExIDEuMDYtMi4zMSAxLjM4LTMuNTZoMi45NWMtLjk2IDEuNjUtMi40OSAyLjkzLTQuMzMgMy41NnpNMTYuMzYgMTRjLjA4LS42Ni4xNC0xLjMyLjE0LTIgMC0uNjgtLjA2LTEuMzQtLjE0LTJoMy4zOGMuMTYuNjQuMjYgMS4zMS4yNiAycy0uMSAxLjM2LS4yNiAyaC0zLjM4eiIvPjwvc3ZnPg=="; Editor.commentImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMjQwLTQwMGg0ODB2LTgwSDI0MHY4MFptMC0xMjBoNDgwdi04MEgyNDB2ODBabTAtMTIwaDQ4MHYtODBIMjQwdjgwWk04ODAtODAgNzIwLTI0MEgxNjBxLTMzIDAtNTYuNS0yMy41VDgwLTMyMHYtNDgwcTAtMzMgMjMuNS01Ni41VDE2MC04ODBoNjQwcTMzIDAgNTYuNSAyMy41VDg4MC04MDB2NzIwWk0xNjAtMzIwaDU5NGw0NiA0NXYtNTI1SDE2MHY0ODBabTAgMHYtNDgwIDQ4MFoiLz48L3N2Zz4="; Editor.userImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgMTJjMi4yMSAwIDQtMS43OSA0LTRzLTEuNzktNC00LTQtNCAxLjc5LTQgNCAxLjc5IDQgNCA0em0wIDJjLTIuNjcgMC04IDEuMzQtOCA0djJoMTZ2LTJjMC0yLjY2LTUuMzMtNC04LTR6Ii8+PC9zdmc+";Editor.groupImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDAtMTYwdi0xMTJxMC0zNCAxNy41LTYyLjVUMTA0LTM3OHE2Mi0zMSAxMjYtNDYuNVQzNjAtNDQwcTY2IDAgMTMwIDE1LjVUNjE2LTM3OHEyOSAxNSA0Ni41IDQzLjVUNjgwLTI3MnYxMTJINDBabTcyMCAwdi0xMjBxMC00NC0yNC41LTg0LjVUNjY2LTQzNHE1MSA2IDk2IDIwLjV0ODQgMzUuNXEzNiAyMCA1NSA0NC41dDE5IDUzLjV2MTIwSDc2MFpNMzYwLTQ4MHEtNjYgMC0xMTMtNDd0LTQ3LTExM3EwLTY2IDQ3LTExM3QxMTMtNDdxNjYgMCAxMTMgNDd0NDcgMTEzcTAgNjYtNDcgMTEzdC0xMTMgNDdabTQwMC0xNjBxMCA2Ni00NyAxMTN0LTExMyA0N3EtMTEgMC0yOC0yLjV0LTI4LTUuNXEyNy0zMiA0MS41LTcxdDE0LjUtODFxMC00Mi0xNC41LTgxVDU0NC03OTJxMTQtNSAyOC02LjV0MjgtMS41cTY2IDAgMTEzIDQ3dDQ3IDExM1pNMTIwLTI0MGg0ODB2LTMycTAtMTEtNS41LTIwVDU4MC0zMDZxLTU0LTI3LTEwOS00MC41VDM2MC0zNjBxLTU2IDAtMTExIDEzLjVUMTQwLTMwNnEtOSA1LTE0LjUgMTR0LTUuNSAyMHYzMlptMjQwLTMyMHEzMyAwIDU2LjUtMjMuNVQ0NDAtNjQwcTAtMzMtMjMuNS01Ni41VDM2MC03MjBxLTMzIDAtNTYuNSAyMy41VDI4MC02NDBxMCAzMyAyMy41IDU2LjVUMzYwLTU2MFptMCAzMjBabTAtNDAwWiIvPjwvc3ZnPg=="; Editor.syncImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgNFYxTDggNWw0IDRWNmMzLjMxIDAgNiAyLjY5IDYgNiAwIDEuMDEtLjI1IDEuOTctLjcgMi44bDEuNDYgMS40NkMxOS41NCAxNS4wMyAyMCAxMy41NyAyMCAxMmMwLTQuNDItMy41OC04LTgtOHptMCAxNGMtMy4zMSAwLTYtMi42OS02LTYgMC0xLjAxLjI1LTEuOTcuNy0yLjhMNS4yNCA3Ljc0QzQuNDYgOC45NyA0IDEwLjQzIDQgMTJjMCA0LjQyIDMuNTggOCA4IDh2M2w0LTQtNC00djN6Ii8+PC9zdmc+";Editor.cloudImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTEyIDZjMi42MiAwIDQuODggMS44NiA1LjM5IDQuNDNsLjMgMS41IDEuNTMuMTFjMS41Ni4xIDIuNzggMS40MSAyLjc4IDIuOTYgMCAxLjY1LTEuMzUgMy0zIDNINmMtMi4yMSAwLTQtMS43OS00LTQgMC0yLjA1IDEuNTMtMy43NiAzLjU2LTMuOTdsMS4wNy0uMTEuNS0uOTVDOC4wOCA3LjE0IDkuOTQgNiAxMiA2bTAtMkM5LjExIDQgNi42IDUuNjQgNS4zNSA4LjA0IDIuMzQgOC4zNiAwIDEwLjkxIDAgMTRjMCAzLjMxIDIuNjkgNiA2IDZoMTNjMi43NiAwIDUtMi4yNCA1LTUgMC0yLjY0LTIuMDUtNC43OC00LjY1LTQuOTZDMTguNjcgNi41OSAxNS42NCA0IDEyIDR6Ii8+PC9zdmc+"; Editor.cloudOffImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTI0IDE1YzAtMi42NC0yLjA1LTQuNzgtNC42NS00Ljk2QzE4LjY3IDYuNTkgMTUuNjQgNCAxMiA0Yy0xLjMzIDAtMi41Ny4zNi0zLjY1Ljk3bDEuNDkgMS40OUMxMC41MSA2LjE3IDExLjIzIDYgMTIgNmMzLjA0IDAgNS41IDIuNDYgNS41IDUuNXYuNUgxOWMxLjY2IDAgMyAxLjM0IDMgMyAwIC45OS0uNDggMS44NS0xLjIxIDIuNGwxLjQxIDEuNDFjMS4wOS0uOTIgMS44LTIuMjcgMS44LTMuODF6TTQuNDEgMy44NkwzIDUuMjdsMi43NyAyLjc3aC0uNDJDMi4zNCA4LjM2IDAgMTAuOTEgMCAxNGMwIDMuMzEgMi42OSA2IDYgNmgxMS43M2wyIDIgMS40MS0xLjQxTDQuNDEgMy44NnpNNiAxOGMtMi4yMSAwLTQtMS43OS00LTRzMS43OS00IDQtNGgxLjczbDggOEg2eiIvPjwvc3ZnPg=="; Editor.calendarImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDI0IDI0IiBoZWlnaHQ9IjI0cHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0cHgiIGZpbGw9IiMwMDAwMDAiPjxnPjxwYXRoIGQ9Ik0wLDBoMjR2MjRIMFYweiIgZmlsbD0ibm9uZSIvPjwvZz48Zz48cGF0aCBkPSJNMjAsNEg0QzIuOSw0LDIsNC45LDIsNnYxMmMwLDEuMSwwLjksMiwyLDJoMTZjMS4xLDAsMi0wLjksMi0yVjZDMjIsNC45LDIxLjEsNCwyMCw0eiBNOCwxMUg0VjZoNFYxMXogTTE0LDExaC00VjZoNFYxMXogTTIwLDExaC00VjZoNFYxMXogTTgsMThINHYtNWg0VjE4eiBNMTQsMThoLTR2LTVoNFYxOHogTTIwLDE4aC00di01aDRWMTh6Ii8+PC9nPjwvc3ZnPg=="; Editor.syncProblemImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMyAxMmMwIDIuMjEuOTEgNC4yIDIuMzYgNS42NEwzIDIwaDZ2LTZsLTIuMjQgMi4yNEM1LjY4IDE1LjE1IDUgMTMuNjYgNSAxMmMwLTIuNjEgMS42Ny00LjgzIDQtNS42NVY0LjI2QzUuNTUgNS4xNSAzIDguMjcgMyAxMnptOCA1aDJ2LTJoLTJ2MnpNMjEgNGgtNnY2bDIuMjQtMi4yNEMxOC4zMiA4Ljg1IDE5IDEwLjM0IDE5IDEyYzAgMi42MS0xLjY3IDQuODMtNCA1LjY1djIuMDljMy40NS0uODkgNi00LjAxIDYtNy43NCAwLTIuMjEtLjkxLTQuMi0yLjM2LTUuNjRMMjEgNHptLTEwIDloMlY3aC0ydjZ6Ii8+PC9zdmc+"; Editor.tailSpin="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9Ii0yIC0yIDQ0IDQ0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPGRlZnM+CiAgICAgICAgPGxpbmVhckdyYWRpZW50IHgxPSI4LjA0MiUiIHkxPSIwJSIgeDI9IjY1LjY4MiUiIHkyPSIyMy44NjUlIiBpZD0iYSI+CiAgICAgICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiM4MDgwODAiIHN0b3Atb3BhY2l0eT0iMCIgb2Zmc2V0PSIwJSIvPgogICAgICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjODA4MDgwIiBzdG9wLW9wYWNpdHk9Ii42MzEiIG9mZnNldD0iNjMuMTQ2JSIvPgogICAgICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjODA4MDgwIiBvZmZzZXQ9IjEwMCUiLz4KICAgICAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPC9kZWZzPgogICAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEpIj4KICAgICAgICAgICAgPHBhdGggZD0iTTM2IDE4YzAtOS45NC04LjA2LTE4LTE4LTE4IiBzdHJva2U9InVybCgjYSkiIHN0cm9rZS13aWR0aD0iNiI+CiAgICAgICAgICAgICAgICA8YW5pbWF0ZVRyYW5zZm9ybQogICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgICAgICAgICAgZnJvbT0iMCAxOCAxOCIKICAgICAgICAgICAgICAgICAgICB0bz0iMzYwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIGR1cj0iMC45cyIKICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgLz4KICAgICAgICAgICAgPC9wYXRoPgogICAgICAgICAgICA8Y2lyY2xlIGZpbGw9IiM4MDgwODAiIGN4PSIzNiIgY3k9IjE4IiByPSIxIj4KICAgICAgICAgICAgICAgIDxhbmltYXRlVHJhbnNmb3JtCiAgICAgICAgICAgICAgICAgICAgYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIgogICAgICAgICAgICAgICAgICAgIHR5cGU9InJvdGF0ZSIKICAgICAgICAgICAgICAgICAgICBmcm9tPSIwIDE4IDE4IgogICAgICAgICAgICAgICAgICAgIHRvPSIzNjAgMTggMTgiCiAgICAgICAgICAgICAgICAgICAgZHVyPSIwLjlzIgogICAgICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiAvPgogICAgICAgICAgICA8L2NpcmNsZT4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPgo="; Editor.mailImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMjRweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTIyIDZjMC0xLjEtLjktMi0yLTJINGMtMS4xIDAtMiAuOS0yIDJ2MTJjMCAxLjEuOSAyIDIgMmgxNmMxLjEgMCAyLS45IDItMlY2em0tMiAwbC04IDQuOTlMNCA2aDE2em0wIDEySDRWOGw4IDUgOC01djEweiIvPjwvc3ZnPg==";Editor.cameraImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMThweCIgdmlld0JveD0iMCAwIDI0IDI0IiB3aWR0aD0iMThweCIgZmlsbD0iIzAwMDAwMCI+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTE0LjEyIDRsMS44MyAySDIwdjEySDRWNmg0LjA1bDEuODMtMmg0LjI0TTE1IDJIOUw3LjE3IDRINGMtMS4xIDAtMiAuOS0yIDJ2MTJjMCAxLjEuOSAyIDIgMmgxNmMxLjEgMCAyLS45IDItMlY2YzAtMS4xLS45LTItMi0yaC0zLjE3TDE1IDJ6bS0zIDdjMS42NSAwIDMgMS4zNSAzIDNzLTEuMzUgMy0zIDMtMy0xLjM1LTMtMyAxLjM1LTMgMy0zbTAtMmMtMi43NiAwLTUgMi4yNC01IDVzMi4yNCA1IDUgNSA1LTIuMjQgNS01LTIuMjQtNS01LTV6Ii8+PC9zdmc+"; Editor.tagsImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNODU2LTM5MCA1NzAtMTA0cS0xMiAxMi0yNyAxOHQtMzAgNnEtMTUgMC0zMC02dC0yNy0xOEwxMDMtNDU3cS0xMS0xMS0xNy0yNS41VDgwLTUxM3YtMjg3cTAtMzMgMjMuNS01Ni41VDE2MC04ODBoMjg3cTE2IDAgMzEgNi41dDI2IDE3LjVsMzUyIDM1M3ExMiAxMiAxNy41IDI3dDUuNSAzMHEwIDE1LTUuNSAyOS41VDg1Ni0zOTBaTTUxMy0xNjBsMjg2LTI4Ni0zNTMtMzU0SDE2MHYyODZsMzUzIDM1NFpNMjYwLTY0MHEyNSAwIDQyLjUtMTcuNVQzMjAtNzAwcTAtMjUtMTcuNS00Mi41VDI2MC03NjBxLTI1IDAtNDIuNSAxNy41VDIwMC03MDBxMCAyNSAxNy41IDQyLjVUMjYwLTY0MFptMjIwIDE2MFoiLz48L3N2Zz4="; Editor.contrastImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTgwcS04MyAwLTE1Ni0zMS41VDE5Ny0xOTdxLTU0LTU0LTg1LjUtMTI3VDgwLTQ4MHEwLTgzIDMxLjUtMTU2VDE5Ny03NjNxNTQtNTQgMTI3LTg1LjVUNDgwLTg4MHE4MyAwIDE1NiAzMS41VDc2My03NjNxNTQgNTQgODUuNSAxMjdUODgwLTQ4MHEwIDgzLTMxLjUgMTU2VDc2My0xOTdxLTU0IDU0LTEyNyA4NS41VDQ4MC04MFptNDAtODNxMTE5LTE1IDE5OS41LTEwNC41VDgwMC00ODBxMC0xMjMtODAuNS0yMTIuNVQ1MjAtNzk3djYzNFoiLz48L3N2Zz4="; Editor.chevronUpImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTUyOCAyOTYtMzQ0bC01Ni01NiAyNDAtMjQwIDI0MCAyNDAtNTYgNTYtMTg0LTE4NFoiLz48L3N2Zz4=";Editor.chevronDownImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTM0NCAyNDAtNTg0bDU2LTU2IDE4NCAxODQgMTg0LTE4NCA1NiA1Ni0yNDAgMjQwWiIvPjwvc3ZnPg=="; Editor.chevronLeftImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNTYwLTI0MCAzMjAtNDgwbDI0MC0yNDAgNTYgNTYtMTg0IDE4NCAxODQgMTg0LTU2IDU2WiIvPjwvc3ZnPg==";Editor.chevronRightImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNTA0LTQ4MCAzMjAtNjY0bDU2LTU2IDI0MCAyNDAtMjQwIDI0MC01Ni01NiAxODQtMTg0WiIvPjwvc3ZnPg=="; Editor.rightPanelOpenImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDYwLTMyMHYtMzIwTDMwMC00ODBsMTYwIDE2MFpNMjAwLTEyMHEtMzMgMC01Ni41LTIzLjVUMTIwLTIwMHYtNTYwcTAtMzMgMjMuNS01Ni41VDIwMC04NDBoNTYwcTMzIDAgNTYuNSAyMy41VDg0MC03NjB2NTYwcTAgMzMtMjMuNSA1Ni41VDc2MC0xMjBIMjAwWm00NDAtODBoMTIwdi01NjBINjQwdjU2MFptLTgwIDB2LTU2MEgyMDB2NTYwaDM2MFptODAgMGgxMjAtMTIwWiIvPjwvc3ZnPg=="; Editor.rightPanelCloseImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNMzAwLTY0MHYzMjBsMTYwLTE2MC0xNjAtMTYwWk0yMDAtMTIwcS0zMyAwLTU2LjUtMjMuNVQxMjAtMjAwdi01NjBxMC0zMyAyMy41LTU2LjVUMjAwLTg0MGg1NjBxMzMgMCA1Ni41IDIzLjVUODQwLTc2MHY1NjBxMCAzMy0yMy41IDU2LjVUNzYwLTEyMEgyMDBabTQ0MC04MGgxMjB2LTU2MEg2NDB2NTYwWm0tODAgMHYtNTYwSDIwMHY1NjBoMzYwWm04MCAwaDEyMC0xMjBaIi8+PC9zdmc+"; Editor.spinImage="data:image/gif;base64,R0lGODlhDAAMAPUxAEVriVp7lmCAmmGBm2OCnGmHn3OPpneSqYKbr4OcsIScsI2kto6kt46lt5KnuZmtvpquvpuvv56ywaCzwqK1xKu7yay9yq+/zLHAzbfF0bjG0bzJ1LzK1MDN18jT28nT3M3X3tHa4dTc49Xd5Njf5dng5t3k6d/l6uDm6uru8e7x8/Dz9fT29/b4+Pj5+fj5+vr6+v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkKADEAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAADAAMAAAGR8CYcEgsOgYAIax4CCQuQldrCBEsiK8VS2hoFGOrlJDA+cZQwkLnqyoJFZKviSS0ICrE0ec0jDAwIiUeGyBFGhMPFBkhZo1BACH5BAkKAC4ALAAAAAAMAAwAhVB0kFR3k1V4k2CAmmWEnW6Lo3KOpXeSqH2XrIOcsISdsImhtIqhtJCmuJGnuZuwv52wwJ+ywZ+ywqm6yLHBzbLCzrXEz7fF0LnH0rrI0r7L1b/M1sXR2cfT28rV3czW3s/Z4Nfe5Nvi6ODm6uLn6+Ln7OLo7OXq7efs7+zw8u/y9PDy9PX3+Pr7+////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZDQJdwSCxGDAIAoVFkFBwYSyIwGE4OkCJxIdG6WkJEx8sSKj7elfBB0a5SQg1EQ0SVVMPKhDM6iUIkRR4ZFxsgJl6JQQAh+QQJCgAxACwAAAAADAAMAIVGa4lcfZdjgpxkg51nhp5ui6N3kqh5lKqFnbGHn7KIoLOQp7iRp7mSqLmTqbqarr6br7+fssGitcOitcSuvsuuv8uwwMyzw861xNC5x9K6x9K/zNbDztjE0NnG0drJ1NzQ2eDS2+LT2+LV3ePZ4Oba4ebb4ufc4+jm6+7t8PLt8PPt8fPx8/Xx9PX09vf19/j3+Pn///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CYcEgsUhQFggFSjCQmnE1jcBhqGBXiIuAQSi7FGEIgfIzCFoCXFCZiPO0hKBMiwl7ET6eUYqlWLkUnISImKC1xbUEAIfkECQoAMgAsAAAAAAwADACFTnKPT3KPVHaTYoKcb4yjcY6leZSpf5mtgZuvh5+yiqG0i6K1jqW3kae5nrHBnrLBn7LCoLPCobTDqbrIqrvIs8LOtMPPtcPPtcTPuMbRucfSvcrUvsvVwMzWxdHaydTcytXdzNbezdff0drh2ODl2+Ln3eTp4Obq4ujs5Ont5uvu6O3w6u7w6u7x7/L09vj5+vr7+vv7////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkdAmXBILHIcicOCUqxELKKPxKAYgiYd4oMAEWo8RVmjIMScwhmBcJMKXwLCECmMGAhPI1QRwBiaSixCMDFhLSorLi8wYYxCQQAh+QQJCgAxACwAAAAADAAMAIVZepVggJphgZtnhp5vjKN2kah3kqmBmq+KobSLorWNpLaRp7mWq7ybr7+gs8KitcSktsWnuManucexwM2ywc63xtG6yNO9ytS+ytW/zNbDz9jH0tvL1d3N197S2+LU3OPU3ePV3eTX3+Xa4efb4ufd5Onl6u7r7vHs7/Lt8PLw8/Xy9Pby9fb09ff2+Pn3+Pn6+vr///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGSMCYcEgseiwSR+RS7GA4JFGF8RiWNiEiJTERgkjFGAQh/KTCGoJwpApnBkITKrwoCFWnFlEhaAxXLC9CBwAGRS4wQgELYY1CQQAh+QQJCgAzACwAAAAADAAMAIVMcI5SdZFhgZtti6JwjaR4k6mAma6Cm6+KobSLorWLo7WNo7aPpredsMCescGitMOitcSmuMaqu8ixwc2zws63xdC4xtG5x9K9ytXAzdfCztjF0NnF0drK1d3M1t7P2N/P2eDT2+LX3+Xe5Onh5+vi5+vj6Ozk6e3n7O/o7O/q7vHs7/Lt8PPu8fPx8/X3+Pn6+vv7+/v8/Pz///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRcCZcEgsmkIbTOZTLIlGqZNnchm2SCgiJ6IRqljFmQUiXIVnoITQde4chC9Y+LEQxmTFRkFSNFAqDAMIRQoCAAEEDmeLQQAh+QQJCgAwACwAAAAADAAMAIVXeZRefplff5lhgZtph59yjqV2kaeAmq6FnbGFnrGLorWNpLaQp7mRqLmYrb2essGgs8Klt8apusitvcquv8u2xNC7yNO8ydS8ytTAzdfBzdfM1t7N197Q2eDU3OPX3+XZ4ObZ4ebc4+jf5erg5erg5uvp7fDu8fPv8vTz9fb09vf19/j3+Pn4+fn5+vr6+/v///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRUCYcEgspkwjEKhUVJ1QsBNp0xm2VixiSOMRvlxFGAcTJook5eEHIhQcwpWIkAFQECkNy9AQWFwyEAkPRQ4FAwQIE2llQQAh+QQJCgAvACwAAAAADAAMAIVNcY5SdZFigptph6BvjKN0kKd8lquAmq+EnbGGn7KHn7ONpLaOpbearr+csMCdscCescGhtMOnuMauvsuzws60w862xdC9ytW/y9a/zNbCztjG0drH0tvK1N3M1t7N19/U3ePb4uff5urj6Ozk6e3l6u7m6u7o7PDq7vDt8PPv8vTw8vTw8/X19vf6+vv///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CXcEgsvlytVUplJLJIpSEDUESFTELBwSgCCQEV42kjDFiMo4uQsDB2MkLHoEHUTD7DRAHC8VAiZ0QSCgYIDxhNiUEAOw=="; Editor.svgSpinImage="data:image/svg+xml;base64,77u/PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMDAgMjAwIj4KICAgIDxzdHlsZT4KICAgICAgICBjaXJjbGUgewogICAgICAgICAgICBmaWxsOiBsaWdodC1kYXJrKCMzMzMzMzMsICNkYWRhZGEpOwogICAgICAgICAgICBzdHJva2U6IGxpZ2h0LWRhcmsoIzMzMzMzMywgI2RhZGFkYSk7CiAgICAgICAgfQogICAgPC9zdHlsZT4KICAgIDxjaXJjbGUgc3Ryb2tlLXdpZHRoPSIxMiIgcj0iMjAiIGN4PSIzMCIgY3k9IjEwMCI+CiAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ib3BhY2l0eSIgY2FsY01vZGU9InNwbGluZSIgZHVyPSIyIiB2YWx1ZXM9IjE7MDsxOyIga2V5U3BsaW5lcz0iLjUgMCAuNSAxOy41IDAgLjUgMSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSItLjQiPjwvYW5pbWF0ZT4KICAgIDwvY2lyY2xlPgogICAgPGNpcmNsZSBzdHJva2Utd2lkdGg9IjEyIiByPSIyMCIgY3g9IjEwMCIgY3k9IjEwMCI+CiAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ib3BhY2l0eSIgY2FsY01vZGU9InNwbGluZSIgZHVyPSIyIiB2YWx1ZXM9IjE7MDsxOyIga2V5U3BsaW5lcz0iLjUgMCAuNSAxOy41IDAgLjUgMSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSItLjIiPjwvYW5pbWF0ZT4KICAgIDwvY2lyY2xlPgogICAgPGNpcmNsZSBzdHJva2Utd2lkdGg9IjEyIiByPSIyMCIgY3g9IjE3MCIgY3k9IjEwMCI+CiAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ib3BhY2l0eSIgY2FsY01vZGU9InNwbGluZSIgZHVyPSIyIiB2YWx1ZXM9IjE7MDsxOyIga2V5U3BsaW5lcz0iLjUgMCAuNSAxOy41IDAgLjUgMSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIwIj48L2FuaW1hdGU+CiAgICA8L2NpcmNsZT4KPC9zdmc+"; Editor.errorImage="data:image/gif;base64,R0lGODlhEAAQAPcAAADGAIQAAISEhP8AAP///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH5BAEAAAAALAAAAAAQABAAAAhoAAEIFBigYMGBCAkGGMCQ4cGECxtKHBAAYUQCEzFSHLiQgMeGHjEGEAAg4oCQJz86LCkxpEqHAkwyRClxpEyXGmGaREmTIsmOL1GO/DkzI0yOE2sKIMlRJsWhCQHENDiUaVSpS5cmDAgAOw=="; Editor.smallPlusImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MDdCMTdENjVCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MDdCMTdENjZCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowN0IxN0Q2M0I4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowN0IxN0Q2NEI4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PtjrjmgAAAAtSURBVHjaYvz//z8DMigvLwcLdHZ2MiKLMzEQCaivkLGsrOw/dU0cAr4GCDAARQsQbTFrv10AAAAASUVORK5CYII="; Editor.hiResImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAA+CAMAAACLMWy1AAAAh1BMVEUAAABMTExERERBQUFBQUFFRUVAQEBCQkJAQEA6OjpDQ0NKSkpBQUFBQUFERERERERBQUFCQkJCQkJCQkJJSUlBQUFCQkJDQ0NDQ0NCQkJDQ0NBQUFBQUFCQkJBQUFCQkJCQkJDQ0NCQkJHR0dBQUFCQkJCQkJAQEBCQkJDQ0NAQEBERERCQkIk1hS2AAAAKnRSTlMAAjj96BL7PgQFRwfu3TYazKuVjRXl1V1DPCn1uLGjnWNVIgy9hU40eGqPkM38AAACG0lEQVRYw+2X63KbMBCFzwZblgGDceN74muatpLe//m6MHV3gHGFAv2RjM94MAbxzdnVsQbBDKwH8AH8MDAyafzjqYeyOG04XE7RS8nIRDXg6BlT+rA0nmtAPh+NQRDxIASIMG44rAMrGunBgHwy3uUldxggIStGKp2f+DQc2O4h4eQsX3O2IFB/oEbsjOKbStnjAEA+zJ0ylZTbgvoDn8xNyn6Dbj5Kd4GsNpABa6duQPfSdEj88TgMAhKuCWjAkgmFXPLnsD0pWd3OFGdrMugQII/eOMPEiGOzqPMIeWrcSoMCg71W1pXBPvCP+gS/OdXqQ3uW23+93XGWLl/OaBb805bNcBPoEIcVJsnHzcxpZH86u5KZ9gDby5dQCcnKqdbke4ItI4Tzd7IW9hZQt4EO6GG9b9sYuuK9Wwn8TIr2xKbF2+3Nhr+qxChJ/AI6pIfCu4z4Zowp4ZUNihz79vewzctnHDwTvQO/hCdFBzrUGDOPn2Y/F8YKT4oOATLvlhOznzmBSdFBJWtc58y7r+UVFOCQczy3wpN6pegDqHtsCPTGvH9JuTO0Dyg8icldYPk+RB6g8Aofj4m2EKBvtTmUPD9xDd1pPcSReV2U5iD/ik2yrngtvvqBfPzOvKiDTKTsCdoHZJ7pLLffgTwlJ5vJdtJV2/jiAYaLvLGhMAEDO5QcDg2M/jOw/8Zn+K3ZwJvHT7ZffgC/NvA3zcybTeIfE4EAAAAASUVORK5CYII="; Editor.loResImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAA+CAMAAACLMWy1AAAAS1BMVEVAQEAAAAA1NTVBQUFDQ0NDQ0NFRUVERERBQUFBQUFBQUFAQEBBQUFBQUFCQkJCQkJCQkJBQUFCQkJDQ0NDQ0NCQkJCQkJCQkJGRkb5/XqTAAAAGXRSTlP+AAWODlASCsesX+Lc2LyWe3pwa1tCPjohjSJfoAAAAI1JREFUWMPt1MkKhTAMRuG0anvneXr/J71nUypKcdqI/N8yhLMKMZE1CahnClDQzMPB44ED3EgeCubgDWnWQMHpwTtKwTe+UHD4sJ94wbUEHHFGhILlYDeSnsQeabeCgsPBgB0MOZZ9oGA5GJFiJSfUULAfjLjARrhCwX7wh2YCDwVbwZkUBKqFFJRN+wOcwSgR2sREcgAAAABJRU5ErkJggg==";Editor.blankImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg=="; Editor.facebookImage=IMAGE_PATH+"/facebook.png";Editor.tweetImage=IMAGE_PATH+"/tweet.png";Editor.svgBrokenImage=Graph.createSvgImage(10,10,'<rect x="0" y="0" width="10" height="10" stroke="#000" fill="transparent"/><path d="m 0 0 L 10 10 L 0 10 L 10 0" stroke="#000" fill="transparent"/>');Editor.configurationKey=".configuration";Editor.settingsKey=".drawio-config";Editor.defaultCustomLibraries=[];Editor.enableCustomLibraries=!0;Editor.inlineExtIcons=!1;Editor.enableUncompressedLibraries=!1;Editor.enableCustomProperties= !0;Editor.enableSimpleTheme=!0;Editor.enableHashObjects=!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&"1"!=urlParams.embed&&window.top==window.self;Editor.defaultIncludeDiagram=!0;Editor.enableServiceWorker="0"!=urlParams.pwa&&"serviceWorker"in navigator&&("1"==urlParams.offline||"1"==urlParams.enableSW||/.*\.diagrams\.net$/.test(window.location.hostname)||/.*\.draw\.io$/.test(window.location.hostname));try{Editor.enableServiceWorker&&navigator.serviceWorker}catch(l){Editor.enableServiceWorker= !1}Editor.defaultLanguages=null;Editor.enableWebFonts=!window.mxIsElectron;Editor.enableLocalFonts=!1;Editor.localFonts=null;Editor.enableShadowOption=!mxClient.IS_SF;Editor.enableExportUrl=!0;Editor.enableRealtime=!0;Editor.enableRealtimeCache=!0;Editor.p2pSyncNotify=!1;Editor.compressXml=!0;Editor.defaultCompressed=!1;Editor.oneDriveInlinePicker=null!=window.urlParams&&"0"==window.urlParams.inlinePicker?!1:!0;Editor.globalVars=null;Editor.defaultBorder=5;Editor.addSvgMetadata=!1;Editor.mathOutputSize= !0;Editor.enableAnimations=!0;Editor.insertAnimations=!0;Editor.enableWindowDocking="1"!=urlParams.embedInline;Editor.pasteAtMousePointer=!0;Editor.fitDiagramOnLoad=!0;Editor.fitDiagramOnPage=!0;Editor.showLinkIcons=!1;Editor.showTooltipIcons=!1;Editor.showNoteIcons=!0;Editor.tooltipFontSize=null;Editor.tooltipMaxWidth=360;Editor.expandPatternsForPrint=!0;Editor.defaultTextStyle="text;html=1;whiteSpace=wrap;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;rounded=0;";Editor.defaultNoteStyle= "shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;autosizeText=1;";Editor.enableAi=/test\.draw\.io$/.test(window.location.hostname)||/preprod\.diagrams\.net$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname);Editor.aiActions=["createPublic","create","update","assist"];Editor.gptApiKey=null!=urlParams["gpt-api-key"]? decodeURIComponent(urlParams["gpt-api-key"]):null;Editor.geminiApiKey=null!=urlParams["gemini-api-key"]?decodeURIComponent(urlParams["gemini-api-key"]):null;Editor.claudeApiKey=null!=urlParams["claude-api-key"]?decodeURIComponent(urlParams["claude-api-key"]):null;Editor.gptUrl=null!=urlParams["gpt-url"]?decodeURIComponent(urlParams["gpt-url"]):"https://api.openai.com/v1/chat/completions";Editor.aiGlobals={gptApiKey:Editor.gptApiKey,geminiApiKey:Editor.geminiApiKey,claudeApiKey:Editor.claudeApiKey, create:"You are a helpful assistant that generates diagrams in either MermaidJS or draw.io XML format based on the given prompt. Begin with a concise checklist (3-7 bullets) of what you will do; keep items conceptual, not implementation-level. Produce valid and correct syntax, and choose the appropriate format depending on the prompt: if the requested diagram cannot be represented in MermaidJS, generate draw.io XML instead but do not use indentation and newlines. When asked to modify a diagram that is given in the conversation as draw.io XML, return the complete updated diagram as draw.io XML, not MermaidJS, and keep the existing id attribute of every cell that is kept so it can be matched to the diagram on the canvas. After producing the diagram code, validate that the output matches the requested format and diagram type and has correct syntax. Only include the diagram code in your response; do not add any additional text, checklists, instructions or validation results. If the prompt is a question or does not ask for a diagram, answer it as plain text without any diagram code instead.", update:"You are a helpful assistant that helps with the following draw.io diagram and returns an updated draw.io diagram if needed. When asked to modify the diagram, return the complete updated diagram as draw.io XML without indentation and newlines - never as MermaidJS or any other format - and keep the existing id attribute of every cell that is kept so it can be matched to the diagram on the canvas. 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}",system:"{action}",messages:[{role:"user",content:"{prompt}"}]}, responsePath:"$.content[0].text"}};Editor.aiModels=[{name:"Claude 4.8 Opus",model:"claude-opus-4-8",config:"claude"},{name:"Claude 4.6 Opus",model:"claude-opus-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.maxPublicPromptLength=1E4;if("ac.draw.io"==window.location.hostname|| "aj.draw.io"==window.location.hostname||/\.cdn\.prod\.atlassian-dev\.net$/.test(window.location.hostname)||/\.cdn\.prod\.atlassian-dev-us-gov-mod\.net$/.test(window.location.hostname))Editor.maxPublicPromptLength=window.DRAWIO_ATLASSIAN_PROMPT_LENGTH;Editor.replaceSvgDataUris=!0;Editor.foreignObjectImages=!0;Editor.embedSvgFonts=!0;Editor.svgFileTheme="auto";Editor.svgRasterScale=4;Editor.htmlRasterScale=4;Editor.config=null;Editor.configVersion=null;Editor.createInheritProperty=function(l,v){return{name:v, dispName:l,type:"bool",defVal:!1,isVisible:function(H,O){return 1==H.vertices.length?(O=O.editorUi.editor.graph.model,H=O.getParent(H.vertices[0]),O.isEdge(H)||O.isVertex(H)):!1},getValue:function(H,O){return"inherit"==mxUtils.getValue(H.style,v)},valueChanged:function(H,O,S,V){O=V.editorUi.editor.graph;"1"==H?O.setCellStyles(v,"inherit",S.vertices):O.setCellStyles(v,null,S.vertices)}}};Editor.isPatternFillStyle=function(l){l=mxUtils.getValue(l,"fillStyle","auto");return"auto"!=l&&"solid"!=l};Editor.commonProperties= [{name:"enumerate",dispName:"Enumerate",type:"bool",defVal:!1,onChange:function(l){l.refresh()}},{name:"enumerateValue",dispName:"Enumerate Value",type:"string",defVal:"",isVisible:function(l,v){return"1"==mxUtils.getValue(l.style,"enumerate","0")}},{name:"comic",dispName:"Comic",type:"bool",defVal:!1,isVisible:function(l,v){return"1"!=mxUtils.getValue(l.style,"sketch","0")}},{name:"jiggle",dispName:"Jiggle",type:"float",min:0,defVal:1,isVisible:function(l,v){return"1"==mxUtils.getValue(l.style,"comic", "0")||"1"==mxUtils.getValue(l.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"fillWeight",dispName:"Fill Weight",type:"int",defVal:-1,isVisible:function(l,v){return("1"==mxUtils.getValue(l.style,"sketch","1"==urlParams.rough?"1":"0")||Editor.isPatternFillStyle(l.style))&&0<l.vertices.length}},{name:"hachureGap",dispName:"Hachure Gap",type:"int",defVal:-1,isVisible:function(l,v){return("1"==mxUtils.getValue(l.style,"sketch","1"==urlParams.rough?"1":"0")||Editor.isPatternFillStyle(l.style))&& 0<l.vertices.length}},{name:"hachureAngle",dispName:"Hachure Angle",type:"int",defVal:-41,isVisible:function(l,v){return("1"==mxUtils.getValue(l.style,"sketch","1"==urlParams.rough?"1":"0")||Editor.isPatternFillStyle(l.style)&&"dots"!=mxUtils.getValue(l.style,"fillStyle","auto"))&&0<l.vertices.length}},{name:"curveFitting",dispName:"Curve Fitting",type:"float",defVal:.95,isVisible:function(l,v){return"1"==mxUtils.getValue(l.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"simplification",dispName:"Simplification", type:"float",defVal:0,min:0,max:1,isVisible:function(l,v){return"1"==mxUtils.getValue(l.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"disableMultiStroke",dispName:"Disable Multi Stroke",type:"bool",defVal:!1,isVisible:function(l,v){return"1"==mxUtils.getValue(l.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"disableMultiStrokeFill",dispName:"Disable Multi Stroke Fill",type:"bool",defVal:!1,isVisible:function(l,v){return"1"==mxUtils.getValue(l.style,"sketch","1"==urlParams.rough?"1": "0")&&0<l.vertices.length}},{name:"dashOffset",dispName:"Dash Offset",type:"int",defVal:-1,isVisible:function(l,v){return"1"==mxUtils.getValue(l.style,"sketch","1"==urlParams.rough?"1":"0")&&0<l.vertices.length}},{name:"dashGap",dispName:"Dash Gap",type:"int",defVal:-1,isVisible:function(l,v){return"1"==mxUtils.getValue(l.style,"sketch","1"==urlParams.rough?"1":"0")&&0<l.vertices.length}},{name:"zigzagOffset",dispName:"ZigZag Offset",type:"int",defVal:-1,isVisible:function(l,v){return"1"==mxUtils.getValue(l.style, "sketch","1"==urlParams.rough?"1":"0")&&0<l.vertices.length}},{name:"sketchStyle",dispName:"Sketch Style",type:"enum",defVal:"rough",enumList:[{val:"rough",dispName:"Rough"},{val:"comic",dispName:"Comic"}],isVisible:function(l,v){return"1"==mxUtils.getValue(l.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:mxConstants.STYLE_SHADOWCOLOR,dispName:"Shadow Color",type:"color",getDefaultValue:function(){return mxConstants.SHADOWCOLOR},isVisible:function(l,v){return"1"==mxUtils.getValue(l.style,mxConstants.STYLE_SHADOW, "0")||"1"==mxUtils.getValue(l.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(l,v){return"1"==mxUtils.getValue(l.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(l.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(l,v){return"1"==mxUtils.getValue(l.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(l.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(l,v){return"1"==mxUtils.getValue(l.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(l.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(l,v){return"1"==mxUtils.getValue(l.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(l.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(l,v){l=mxUtils.getValue(l.style,"linejoin","miter");return"miter"==l||"miter-clip"==l}}];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(l){return"1"== mxUtils.getValue(l.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"},{val:"northsouth",dispName:"North + South"},{val:"eastwest",dispName:"East + 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"},{val:"northsouth",dispName:"North + South"},{val:"eastwest",dispName:"East + West"}]},{name:"jettySize",dispName:"Jetty Size",type:"int",min:0,defVal:"auto",allowAuto:!0,isVisible:function(l){return"orthogonalEdgeStyle"==mxUtils.getValue(l.style,mxConstants.STYLE_EDGE,null)}},{name:"segment",dispName:"Segment Size",type:"int",min:0,defVal:mxConstants.ENTITY_SEGMENT,isVisible:function(l){return"entityRelationEdgeStyle"== mxUtils.getValue(l.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(l){return"1"==mxUtils.getValue(l.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(l){return"1"==mxUtils.getValue(l.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(l){return"1"==mxUtils.getValue(l.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(l,v){v=v.editorUi.editor.graph; return 1==l.vertices.length&&0==l.edges.length&&v.isTableCell(l.vertices[0])}},{name:"rowspan",dispName:"Rowspan",type:"int",min:1,defVal:1,isVisible:function(l,v){v=v.editorUi.editor.graph;return 1==l.vertices.length&&0==l.edges.length&&v.isTableCell(l.vertices[0])}},{type:"separator"},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",getDefaultValue:function(l,v){l=v.editorUi.editor.graph.getCellStyle(1==l.vertices.length&&0==l.edges.length?l.vertices[0]:null);return"1"==mxUtils.getValue(l, "resizeLastRow","0")},isVisible:function(l,v){v=v.editorUi.editor.graph;return 1==l.vertices.length&&0==l.edges.length&&v.isTable(l.vertices[0])}},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",getDefaultValue:function(l,v){l=v.editorUi.editor.graph.getCellStyle(1==l.vertices.length&&0==l.edges.length?l.vertices[0]:null);return"1"==mxUtils.getValue(l,"resizeLast","0")},isVisible:function(l,v){v=v.editorUi.editor.graph;return 1==l.vertices.length&&0==l.edges.length&&v.isTable(l.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:"shapeInsideShape",dispName:"Text Flow Shape",type:"enum",defVal:null,enumList:[{val:null, dispName:"Automatic"},{val:"dataStorage",dispName:"Data Storage"},{val:"ellipse",dispName:"Ellipse"},{val:"hexagon",dispName:"Hexagon"},{val:"or",dispName:"Or"},{val:"parallelogram",dispName:"Parallelogram"},{val:"rhombus",dispName:"Rhombus"},{val:"step",dispName:"Step"},{val:"trapezoid",dispName:"Trapezoid"},{val:"triangle",dispName:"Triangle"},{val:"xor",dispName:"Xor"}],onChange:function(l,v){if(null!=v&&""!=v){v=l.getSelectionCells();for(var H=[],O=0;O<v.length;O++)l.model.isVertex(v[O])&&H.push(v[O]); 0<H.length&&l.setCellStyles("shapeInside","1",H)}}},{name:"shapeInsidePadding",dispName:"Text Flow Padding",type:"float",min:0,defVal:2},{name:"noLabel",dispName:"Hide Label",type:"bool",defVal:!1},{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"},{val:"northsouth",dispName:"North + South"},{val:"eastwest",dispName:"East + West"}]},{name:"portConstraintRotation",dispName:"Rotate Constraint",type:"bool",defVal:!1},{name:"connectable",dispName:"Connectable",type:"bool",getDefaultValue:function(l,v){return v.editorUi.editor.graph.isCellConnectable(0<l.vertices.length&&0==l.edges.length?l.vertices[0]:null)},isVisible:function(l, v){return 0<l.vertices.length&&0==l.edges.length}},{name:"allowArrows",dispName:"Allow Arrows",type:"bool",defVal:!0},{name:"snapToPoint",dispName:"Snap to Point",type:"bool",defVal:!1},{name:"outlineConnect",dispName:"Outline Connect",defVal:"1",type:"enum",enumList:[{val:"1",dispName:"Default"},{val:"0",dispName:"Delayed"},{val:"2",dispName:"Always"},{val:"3",dispName:"Never"}]},{name:"perimeter",dispName:"Perimeter",defVal:"none",type:"enum",enumList:[{val:"none",dispName:"None"},{val:"rectanglePerimeter", dispName:"Rectangle"},{val:"ellipsePerimeter",dispName:"Ellipse"},{val:"rhombusPerimeter",dispName:"Rhombus"},{val:"trianglePerimeter",dispName:"Triangle"},{val:"hexagonPerimeter2",dispName:"Hexagon"},{val:"lifelinePerimeter",dispName:"Lifeline"},{val:"orthogonalPerimeter",dispName:"Orthogonal"},{val:"backbonePerimeter",dispName:"Backbone"},{val:"calloutPerimeter",dispName:"Callout"},{val:"parallelogramPerimeter",dispName:"Parallelogram"},{val:"trapezoidPerimeter",dispName:"Trapezoid"},{val:"stepPerimeter", dispName:"Step"},{val:"centerPerimeter",dispName:"Center"}]},{name:"fixDash",dispName:"Fixed Dash",type:"bool",defVal:!1},{name:"container",dispName:"Container",type:"bool",getDefaultValue:function(l,v){l=0<l.vertices.length&&0==l.edges.length?l.vertices[0]:null;v=v.editorUi.editor.graph;return null!=l&&v.isSwimlane(l)},isVisible:function(l,v){return 0<l.vertices.length&&0==l.edges.length}},{name:"containerType",dispName:"Container Type",type:"enum",defVal:null,enumList:[{val:null,dispName:"Default"}, {val:"tree",dispName:"Tree"}],isVisible:function(l,v){var H=1==l.vertices.length&&0==l.edges.length?l.vertices[0]:null;v=v.editorUi.editor.graph;return null!=H&&(v.isSwimlane(H)||v.isContainer(H)||0<v.model.getChildCount(H)||null!=l.style.containerType)}},{name:"dropTarget",dispName:"Drop Target",type:"bool",getDefaultValue:function(l,v){l=1==l.vertices.length&&0==l.edges.length?l.vertices[0]:null;v=v.editorUi.editor.graph;return null!=l&&(v.isSwimlane(l)||0<v.model.getChildCount(l))},isVisible:function(l, v){return 1==l.vertices.length&&0==l.edges.length}},{name:"collapsible",dispName:"Collapsible",type:"bool",getDefaultValue:function(l,v){var H=1==l.vertices.length&&0==l.edges.length?l.vertices[0]:null;v=v.editorUi.editor.graph;return null!=H&&(v.isContainer(H)&&"0"!=l.style.collapsible||!v.isContainer(H)&&"1"==l.style.collapsible)},isVisible:function(l,v){return 1==l.vertices.length&&0==l.edges.length}},{name:"foldingIconSize",dispName:"Folding Icon Size",type:"int",min:1,getDefaultValue:function(l, v){return v.editorUi.editor.graph.expandedImage.width},isVisible:function(l,v){v=v.editorUi.editor.graph;return 1==l.vertices.length&&0==l.edges.length&&v.isCellFoldable(l.vertices[0])}},{name:"recursiveResize",dispName:"Resize Children",type:"bool",defVal:!0,isVisible:function(l,v){return 1==l.vertices.length&&0==l.edges.length&&!v.editorUi.editor.graph.isSwimlane(l.vertices[0])&&null==mxUtils.getValue(l.style,"childLayout",null)}},{name:"expand",dispName:"Expand",type:"bool",defVal:!0},{name:"contract", dispName:"Contract",type:"bool",defVal:!1},{name:"selectParentFirst",dispName:"Select Parent First",type:"bool",defVal:!1,isVisible:function(l,v){if(1!=l.vertices.length||0<l.edges.length)return!1;l=l.vertices[0];v=v.editorUi.editor.graph;return v.isSwimlane(l)||0<v.model.getChildCount(l)}},{name:"part",dispName:"Part",type:"bool",defVal:!1,isVisible:function(l,v){v=v.editorUi.editor.graph.model;return 0<l.vertices.length?v.isVertex(v.getParent(l.vertices[0])):!1}},{name:"editable",dispName:"Editable", type:"bool",defVal:!0},{name:"editIcon",dispName:"Edit Icon",type:"bool",defVal:!1},{name:"moveIcon",dispName:"Move Icon",type:"bool",defVal:!1,getDefaultValue:function(l,v){l=1==l.vertices.length&&0==l.edges.length?l.vertices[0]:null;v=v.editorUi.editor.graph;return null!=l&&null!=v.isTransparentBounds&&v.isTransparentBounds(l)}},{name:"connectIcon",dispName:"Connect Icon",type:"bool",getDefaultValue:function(l,v){return!0===Editor.showConnectHandle}},{name:"lockedGroup",dispName:"Locked Group", type:"enum",defVal:null,enumList:[{val:null,dispName:"Default"},{val:"0",dispName:"Unlocked"},{val:"1",dispName:"Locked"}],isVisible:function(l,v){return 0<l.vertices.length&&0==l.edges.length}},{name:"lockedGroupIcon",dispName:"Lock Icon",type:"enum",defVal:null,enumList:[{val:null,dispName:"Default"},{val:"0",dispName:"Disabled"},{val:"1",dispName:"Visible"}],isVisible:function(l,v){return 0<l.vertices.length&&0==l.edges.length}},{name:"metaEdit",dispName:"Edit Dialog",type:"bool",defVal:!1},{name:"backgroundOutline", dispName:"Background Outline",type:"bool",defVal:!1},{name:"movable",dispName:"Movable",type:"bool",defVal:!0},{name:"movableLabel",dispName:"Movable Label",type:"bool",defVal:!1,isVisible:function(l,v){l=0<l.vertices.length?v.editorUi.editor.graph.getCellGeometry(l.vertices[0]):null;return null!=l&&!l.relative}},{name:"autosize",dispName:"Autosize",type:"bool",defVal:!1},{name:"autosizeGrid",dispName:"Autosize Grid",type:"enum",defVal:null,enumList:[{val:null,dispName:"Default"},{val:"1",dispName:"Enabled"}, {val:"0",dispName:"Disabled"}],isVisible:function(l,v){return 0<l.vertices.length&&v.editorUi.editor.graph.isAutoSizeCell(l.vertices[0])}},{name:"fixedWidth",dispName:"Fixed Width",type:"bool",defVal:!1},{name:"resizable",dispName:"Resizable",type:"bool",defVal:!0},{name:"resizeWidth",dispName:"Resize Width",type:"bool",defVal:!1},{name:"resizeHeight",dispName:"Resize Height",type:"bool",defVal:!1},{name:"rotatable",dispName:"Rotatable",type:"bool",defVal:!0},{name:"cloneable",dispName:"Cloneable", type:"bool",defVal:!0},{name:"deletable",dispName:"Deletable",type:"bool",defVal:!0},{name:"treeFolding",dispName:"Tree Folding",type:"bool",defVal:!1},{name:"treeMoving",dispName:"Tree Moving",type:"bool",defVal:!1},{name:"pointerEvents",dispName:"Pointer Events",type:"bool",defVal:!0,isVisible:function(l,v){var H=mxUtils.getValue(l.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||v.editorUi.editor.graph.isSwimlane(l.vertices[0])||null==H||H==mxConstants.NONE||0== mxUtils.getValue(l.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValue(l.style,mxConstants.STYLE_OPACITY,100)||null!=l.style.pointerEvents}},{name:"moveCells",dispName:"Move Cells on Fold",type:"bool",defVal:!1,isVisible:function(l,v){return 0<l.vertices.length&&v.editorUi.editor.graph.isContainer(l.vertices[0])}},{name:"expandToFront",dispName:"Expand to Front",type:"bool",defVal:!1,isVisible:function(l,v){return 0<l.vertices.length&&v.editorUi.editor.graph.isContainer(l.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, the ELK shorthands\n## elkRadial, elkOrganic, elkStress, libavoid (orthogonal edge routing), parallels\n## (spread overlapping parallel edges), or a JSON string as used in Layout, Apply.\n## 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,,me@example.com,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,me@example.com,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,me@example.com,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,me@example.com,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 l=document.createElement("canvas");Editor.canvasSupported=!(!l.getContext||!l.getContext("2d"))}catch(v){}})();Editor.useCanvasForExport=!1;(function(){try{var l=document.createElement("canvas"),v=new Image;v.onload=function(){try{l.getContext("2d").drawImage(v,0,0);var H=l.toDataURL("image/png");Editor.useCanvasForExport=null!=H&&6<H.length}catch(O){}};v.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(H){}})(); Editor.jpgSupported=!1;Editor.webpSupported=!1;(function(){try{var l=document.createElement("canvas");l.width=l.height=1;var v=l.toDataURL("image/jpeg");Editor.jpgSupported=null!==v.match("image/jpeg");v=l.toDataURL("image/webp");Editor.webpSupported=null!==v.match("image/webp")}catch(H){}})();Editor.loadCompatibleCss=function(l){mxUtils.lightDarkColorSupported||mxUtils.get(l||"styles/grapheditor.css",mxUtils.bind(this,function(v){if(200<=v.getStatus()&&299>=v.getStatus()){var H=document.createElement("style"); H.type="text/css";var O=H.appendChild,S=document,V=S.createTextNode;v=v.getText().replace(/light-dark\(\s*(var\([^\)]+\)|[^,]+)\s*,\s*(var\([^\)]+\)|[^)]+)\s*\)/g,"$1");try{CSS.supports("selector(:has(*))")||(v=v.replace(/:has\(/g,":not(")+"\n.geFormatTitleContainer { overflow: hidden !important; }\n.geRuler+.geRuler { margin-top: 14px !important; }\n.geDiagramContainer { margin: 0 !important; }")}catch(Z){}O.call(H,V.call(S,v));document.head.appendChild(H)}}))};Editor.replacePlaceholders=function(l, v){var H=[];if(null!=l&&null!=v){for(var O=RegExp("{([^{}\"'=;]+)}","g"),S,V=0;S=O.exec(l);){var Z=S[0];if(2<Z.length){var ba=v(Z.substring(1,Z.length-1)),ha=Z;null!=ba&&(ha=ba);H.push(l.substring(V,S.index)+ha);V=S.index+Z.length}}H.push(l.substring(V))}return H.join("")};Editor.executeSimpleJsonPath=function(l,v){v=v.replace(/^\$\.?/,"").split(".");v=$jscomp.makeIterator(v);for(var H=v.next();!H.done;H=v.next()){var O=H.value;if(!l)return[];if(H=O.match(/([^\[]+)\[(\d+)\]/))if(O=H[1],H=parseInt(H[2]), l=l[O],Array.isArray(l)&&H<l.length)l=l[H];else return[];else l=l[O]}return void 0!==l?[l]:[]};Editor.createRoughCanvas=function(l){var v=rough.canvas({getContext:function(){return l}});v.draw=function(H){var O=H.sets||[];H=H.options||this.getDefaultOptions();for(var S=0;S<O.length;S++){var V=O[S];switch(V.type){case "path":null!=H.stroke&&this._drawToContext(l,V,H);break;case "fillPath":this._drawToContext(l,V,H);break;case "fillSketch":this.fillSketch(l,V,H)}}};v.fillSketch=function(H,O,S){var V= l.state.strokeColor,Z=l.state.strokeWidth,ba=l.state.strokeAlpha,ha=l.state.dashed,na=S.fillWeight;0>na&&(na=S.strokeWidth/2);l.setStrokeAlpha(l.state.fillAlpha);l.setStrokeColor(S.fill||"");l.setStrokeWidth(na);l.setDashed(!1);na=null!=H.root?H.root.lastChild:null;this._drawToContext(H,O,S);null!=H.root&&null!=H.root.lastChild&&H.root.lastChild!=na&&"path"==H.root.lastChild.nodeName&&H.root.lastChild.setAttribute("data-rough-fill","1");l.setDashed(ha);l.setStrokeWidth(Z);l.setStrokeColor(V);l.setStrokeAlpha(ba)}; v._drawToContext=function(H,O,S){H.begin();for(var V=0;V<O.ops.length;V++){var Z=O.ops[V],ba=Z.data;switch(Z.op){case "move":H.moveTo(ba[0],ba[1]);break;case "bcurveTo":H.curveTo(ba[0],ba[1],ba[2],ba[3],ba[4],ba[5]);break;case "lineTo":H.lineTo(ba[0],ba[1])}}H.end();"fillPath"===O.type&&S.filled?H.fill():H.stroke()};return v};(function(){function l(V,Z,ba){this.canvas=V;this.rc=Z;this.shape=ba;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin= mxUtils.bind(this,l.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,l.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,l.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=mxUtils.bind(this,l.prototype.roundrect);this.originalEllipse=this.canvas.ellipse;this.canvas.ellipse=mxUtils.bind(this,l.prototype.ellipse);this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,l.prototype.lineTo); this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,l.prototype.moveTo);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,l.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,l.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,l.prototype.arcTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,l.prototype.close);this.originalFill=this.canvas.fill; this.canvas.fill=mxUtils.bind(this,l.prototype.fill);this.originalStroke=this.canvas.stroke;this.canvas.stroke=mxUtils.bind(this,l.prototype.stroke);this.originalFillAndStroke=this.canvas.fillAndStroke;this.canvas.fillAndStroke=mxUtils.bind(this,l.prototype.fillAndStroke);this.path=[];this.passThrough=!1}l.prototype.moveOp="M";l.prototype.lineOp="L";l.prototype.quadOp="Q";l.prototype.curveOp="C";l.prototype.closeOp="Z";l.prototype.getStyle=function(V,Z){var ba=1;if(null!=this.shape.state){var ha= this.shape.state.cell.id;if(null!=ha)for(var na=0;na<ha.length;na++)ba=(ba<<5)-ba+ha.charCodeAt(na)<<0}ba={strokeWidth:this.canvas.state.strokeWidth,seed:ba,preserveVertices:!0};ha=this.rc.getDefaultOptions();ba.stroke=V?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;V=null;(ba.filled=Z)?(ba.fill=this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,V=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor): ba.fill="";ba.bowing=mxUtils.getValue(this.shape.style,"bowing",ha.bowing);ba.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",ha.hachureAngle);ba.curveFitting=mxUtils.getValue(this.shape.style,"curveFitting",ha.curveFitting);ba.roughness=mxUtils.getValue(this.shape.style,"jiggle",ha.roughness);ba.simplification=mxUtils.getValue(this.shape.style,"simplification",ha.simplification);ba.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",ha.disableMultiStroke);ba.disableMultiStrokeFill= mxUtils.getValue(this.shape.style,"disableMultiStrokeFill",ha.disableMultiStrokeFill);Z=mxUtils.getValue(this.shape.style,"hachureGap",-1);ba.hachureGap="auto"==Z?-1:Z;ba.dashGap=mxUtils.getValue(this.shape.style,"dashGap",Z);ba.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",Z);ba.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",Z);Z=mxUtils.getValue(this.shape.style,"fillWeight",-1);ba.fillWeight="auto"==Z?-1:Z;Z=mxUtils.getValue(this.shape.style,"fillStyle","auto");"dots"== Z&&(Z="auto");if("auto"==Z){var oa=mxUtils.lightDarkColorSupported?Editor.isDarkMode():mxUtils.preferDarkColor;Z=function(fa){mxUtils.isLightDarkColor(fa)&&(fa=mxUtils.parseLightDarkColor(fa),fa=oa?fa.dark:fa.light);return mxUtils.hex2rgb(fa)};na=[Z("#ffffff")];null!=this.shape.state&&na.push(Z(this.shape.state.view.graph.shapeBackgroundColor));Editor.isDarkMode()&&na.push(Z(Editor.darkColor));Z=null!=ba.fill&&(null!=V||0<=mxUtils.indexOf(na,Z(ba.fill)))?"solid":ha.fillStyle}ba.fillStyle=Z;return ba}; l.prototype.begin=function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};l.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};l.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var V=2;V<arguments.length;V+=2)this.lastX=arguments[V-1],this.lastY=arguments[V],this.path.push(this.canvas.format(this.lastX)),this.path.push(this.canvas.format(this.lastY))};l.prototype.lineTo=function(V, Z){this.passThrough?this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,V,Z),this.lastX=V,this.lastY=Z)};l.prototype.moveTo=function(V,Z){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,V,Z),this.lastX=V,this.lastY=Z,this.firstX=V,this.firstY=Z)};l.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,arguments):this.addOp(this.closeOp)};l.prototype.quadTo=function(V,Z,ba,ha){this.passThrough?this.originalQuadTo.apply(this.canvas, arguments):(this.addOp(this.quadOp,V,Z,ba,ha),this.lastX=ba,this.lastY=ha)};l.prototype.curveTo=function(V,Z,ba,ha,na,oa){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,V,Z,ba,ha,na,oa),this.lastX=na,this.lastY=oa)};l.prototype.arcTo=function(V,Z,ba,ha,na,oa,fa){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var qa=mxUtils.arcToCurves(this.lastX,this.lastY,V,Z,ba,ha,na,oa,fa);if(null!=qa)for(var ya=0;ya<qa.length;ya+=6)this.curveTo(qa[ya], qa[ya+1],qa[ya+2],qa[ya+3],qa[ya+4],qa[ya+5]);this.lastX=oa;this.lastY=fa}};l.prototype.rect=function(V,Z,ba,ha){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(V,Z,ba,ha,this.getStyle(!0,!0)))};l.prototype.ellipse=function(V,Z,ba,ha){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(V+ba/2,Z+ha/2,ba,ha,this.getStyle(!0,!0)))};l.prototype.roundrect=function(V, Z,ba,ha,na,oa){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(V+na,Z),this.lineTo(V+ba-na,Z),this.quadTo(V+ba,Z,V+ba,Z+oa),this.lineTo(V+ba,Z+ha-oa),this.quadTo(V+ba,Z+ha,V+ba-na,Z+ha),this.lineTo(V+na,Z+ha),this.quadTo(V,Z+ha,V,Z+ha-oa),this.lineTo(V,Z+oa),this.quadTo(V,Z,V+na,Z))};l.prototype.drawPath=function(V){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),V)}catch(ba){}this.passThrough=!1}else if(null!=this.nextShape){for(var Z in V)this.nextShape.options[Z]= V[Z];V.stroke!=mxConstants.NONE&&null!=V.stroke||delete this.nextShape.options.stroke;V.filled||delete this.nextShape.options.fill;this.passThrough=!0;this.rc.draw(this.nextShape);this.passThrough=!1}};l.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!1))};l.prototype.fill=function(){this.passThrough?this.originalFill.apply(this.canvas,arguments):this.drawPath(this.getStyle(!1,!0))};l.prototype.fillAndStroke=function(){this.passThrough? this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!0))};l.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo;this.canvas.close=this.originalClose;this.canvas.fill=this.originalFill;this.canvas.stroke=this.originalStroke;this.canvas.fillAndStroke=this.originalFillAndStroke; this.canvas.begin=this.originalBegin;this.canvas.end=this.originalEnd;this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(V){return new l(V,Editor.createRoughCanvas(V),this)};var v=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(V){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?v.apply(this,arguments):"comic"==mxUtils.getValue(this.style, "sketchStyle","rough")?this.createComicCanvas(V):this.createRoughCanvas(V)};var H=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(V,Z,ba,ha,na){null!=V.handJiggle&&V.handJiggle.passThrough||H.apply(this,arguments)};var O=mxShape.prototype.paint;mxShape.prototype.paint=function(V){var Z=V.addTolerance,ba=!0;null!=this.style&&(ba="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=V.handJiggle&&V.handJiggle.constructor==l&&!this.outline){V.save(); var ha=this.fill,na=this.stroke;this.stroke=this.fill=null;var oa=this.configurePointerEvents,fa=V.setStrokeColor;V.setStrokeColor=function(){};var qa=V.setFillColor;V.setFillColor=function(){};ba||null==ha||(this.configurePointerEvents=function(){});V.handJiggle.passThrough=!0;O.apply(this,arguments);V.handJiggle.passThrough=!1;V.setFillColor=qa;V.setStrokeColor=fa;this.configurePointerEvents=oa;this.stroke=na;this.fill=ha;V.restore();ba&&null!=ha&&(V.addTolerance=function(){})}O.apply(this,arguments); V.addTolerance=Z};var S=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(V,Z,ba,ha,na,oa){null!=V.handJiggle&&V.handJiggle.constructor==l?(V.handJiggle.passThrough=!0,S.apply(this,arguments),V.handJiggle.passThrough=!1):S.apply(this,arguments)}})();Editor.fastCompress=function(l){return null==l||0==l.length||"undefined"===typeof pako?l:Graph.arrayBufferToString(pako.deflateRaw(l))};Editor.fastDecompress=function(l){return null==l||0==l.length||"undefined"===typeof pako? l:pako.inflateRaw(Graph.stringToArrayBuffer(atob(l)),{to:"string"})};Editor.extractGraphModel=function(l,v,H){if(null!=l&&"undefined"!==typeof pako){var O=l.ownerDocument.getElementsByTagName("div"),S=[];if(null!=O&&0<O.length)for(var V=0;V<O.length;V++)if("mxgraph"==O[V].getAttribute("class")){S.push(O[V]);break}0<S.length&&(O=S[0].getAttribute("data-mxgraph"),null!=O?(S=JSON.parse(O),null!=S&&null!=S.xml&&(l=mxUtils.parseXml(S.xml),l=l.documentElement)):(S=S[0].getElementsByTagName("div"),0<S.length&& (O=mxUtils.getTextContent(S[0]),O=Graph.decompress(O,null,H),0<O.length&&(l=mxUtils.parseXml(O),l=l.documentElement))))}if(null!=l&&"svg"==l.nodeName)if(O=l.getAttribute("content"),null!=O&&"<"!=O.charAt(0)&&"%"!=O.charAt(0)&&(O=unescape(window.atob?atob(O):Base64.decode(cont,O))),null!=O&&"%"==O.charAt(0)&&(O=decodeURIComponent(O)),null!=O&&0<O.length)l=mxUtils.parseXml(O).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==l||v||(S=null,"diagram"==l.nodeName?S=l:"mxfile"== l.nodeName&&(O=l.getElementsByTagName("diagram"),0<O.length&&(S=O[Math.max(0,Math.min(O.length-1,urlParams.page||0))])),null!=S&&(l=Editor.parseDiagramNode(S,H)));null==l||"mxGraphModel"==l.nodeName||v&&"mxfile"==l.nodeName||(l=null);return l};Editor.parseDiagramNode=function(l,v,H){Editor.validateDiagramNode(l);var O=mxUtils.trim(mxUtils.getTextContent(l)),S=null;0<O.length?(v=Graph.decompress(O,null,v),null!=v&&0<v.length&&(S=mxUtils.parseXml(v).documentElement)):(l=mxUtils.getChildNodes(l),0<l.length&& (S=l[0],H&&(S=Editor.parseDiagramNode(S,v,!1)),v=mxUtils.createXmlDocument(),v.appendChild(v.importNode(S,!0)),S=v.documentElement));return S};Editor.getDiagramNodeXml=function(l){Editor.validateDiagramNode(l);var v=mxUtils.getNodeValue(l),H=null;0<v.length?H=Graph.decompress(v):(l=l.getElementsByTagName("mxGraphModel"),null!=l&&0<l.length&&(H=mxUtils.getXml(l[0])));return H};Editor.validateDiagramNode=function(l){if(0==mxUtils.trim(mxUtils.getTextContent(l)).length&&0==mxUtils.getChildNodes(l).length){var v= new mxCodec,H=new mxGraphModel;l.appendChild(v.encode(H))}return l};Editor.extractGraphModelFromPdf=function(l){var v=null;l=l.substring(l.indexOf(",")+1);l=window.atob&&!mxClient.IS_SF?atob(l):Base64.decode(l,!0);if("%PDF-1.7"==l.substring(0,8)){var H=l.indexOf("EmbeddedFile");if(-1<H){var O=l.indexOf("stream",H)+9;if(0<l.substring(H,O).indexOf("application#2Fvnd.jgraph.mxfile")){var S=l.indexOf("endstream",O-1);return pako.inflateRaw(Graph.stringToArrayBuffer(l.substring(O,S)),{to:"string"})}}for(H= l.indexOf("/ObjStm");0<H;){O=l.indexOf("stream",H)+9;S=l.indexOf("endstream",O-1);O=pako.inflateRaw(Graph.stringToArrayBuffer(l.substring(O,S)),{to:"string"});S=O.indexOf("/Subject <");if(0<S){H=O.substring(S+14,O.indexOf(">",S));if(null!=H){v=H;H=[];for(O=0;O<v.length;O+=2)S=v.substr(O,2),"00"!=S&&H.push(String.fromCharCode(parseInt(S,16)));v=H.join("")}break}H=l.indexOf("/ObjStm",H+1)}}if(null==v&&"%PDF-"==l.substring(0,5)){H="";S=O=0;for(var V=[],Z=null;S<l.length;){var ba=l.charCodeAt(S);S+=1; 10!=ba&&(H+=String.fromCharCode(ba));ba=="/Subject (%3Cmxfile".charCodeAt(O)?O++:O=0;if(19==O){var ha=l.indexOf("%3C%2Fmxfile%3E",S)+15;S-=9;if(ha>S){v=l.substring(S,ha);break}}10==ba&&("endobj"==H?Z=null:"obj"==H.substring(H.length-3,H.length)||"xref"==H||"trailer"==H?(Z=[],V[H.split(" ")[0]]=Z):null!=Z&&Z.push(H),H="")}}null==v&&null!=V&&(v=Editor.extractGraphModelFromXref(V));null!=v&&(v=decodeURIComponent(v.replace(/\\([\\()])/g,"$1").replace(/\\\(/g,"(").replace(/\\\)/g,")")));return v};Editor.extractGraphModelFromXref= function(l){var v=l.trailer,H=null;null!=v&&(v=/.* \/Info (\d+) (\d+) R/g.exec(v.join("\n")),null!=v&&0<v.length&&(v=l[v[1]],null!=v&&(v=/.* \/Subject (\d+) (\d+) R/g.exec(v.join("\n")),null!=v&&0<v.length&&(l=l[v[1]],null!=l&&(l=l.join("\n"),H=l.substring(1,l.length-1))))));return H};Editor.extractParserError=function(l,v){var H=null;l=null!=l?l.getElementsByTagName("parsererror"):null;null!=l&&0<l.length&&(H=v||mxResources.get("invalidChars"),v=l[0].getElementsByTagName("div"),0<v.length&&(H=mxUtils.getTextContent(v[0]))); return null!=H?mxUtils.trim(H):H};Editor.addRetryToError=function(l,v){null!=l&&(l=null!=l.error?l.error:l,null==l.retry&&(l.retry=v))};Editor.mermaidToDrawio=function(l,v,H){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(l,v,H)};Editor.configure=function(l){if(null!=l){Editor.config=l;Editor.configVersion=l.version;l.debug&&(urlParams.test="1");l.passiveScroll&&(Editor.passiveScroll=!0);l.noResizers&&(Editor.noResizers=!0);l.preserveViewState&&(Editor.preserveViewState=!0);null!= l.passThroughKeys&&(Editor.passThroughKeys=l.passThroughKeys);null!=l.keyboardShortcuts&&(Array.isArray(l.keyboardShortcuts)?Editor.keyboardShortcuts=l.keyboardShortcuts:EditorUi.debug("Configuration Error: Array expected for keyboardShortcuts"));l.suppressNewWindows&&(Editor.suppressNewWindows=!0,Editor.popupsAllowed=!1);l.useInternalClipboard&&(EditorUi.prototype.useInternalClipboard=l.useInternalClipboard);if(null!=l.customCss){var v=document.createElement("style");v.type="text/css";v.appendChild(document.createTextNode(l.customCss)); document.head.appendChild(v)}null!=l.resources&&("object"!==typeof l.resources||Array.isArray(l.resources)?EditorUi.debug("Configuration Error: Object expected for resources"):(Editor.customResources=l.resources,Editor.applyCustomResources()));null!=l.enableLocalFonts&&(Editor.enableLocalFonts=l.enableLocalFonts);null!=l.enableCustomGitLabUrl&&(Editor.enableCustomGitLabUrl=l.enableCustomGitLabUrl);null!=l.defaultFonts&&(Menus.prototype.defaultFonts=l.defaultFonts);null!=l.presetColors&&(ColorDialog.prototype.presetColors= l.presetColors);null!=l.defaultColors&&(ColorDialog.prototype.defaultColors=l.defaultColors);null!=l.colorNames&&(ColorDialog.prototype.colorNames=l.colorNames);null!=l.defaultColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=l.defaultColorSchemes);null!=l.defaultEdgeLength&&(Graph.prototype.defaultEdgeLength=l.defaultEdgeLength);null!=l.selectParentLayer&&(Graph.selectParentLayer=l.selectParentLayer);null!=l.intersectionSelect&&(Graph.intersectionSelect=l.intersectionSelect);null!=l.swimlaneSelectionEnabled&& (Graph.prototype.swimlaneSelectionEnabled=l.swimlaneSelectionEnabled);null!=l.autosaveDelay&&(DrawioFile.prototype.autosaveDelay=l.autosaveDelay);null!=l.templateFile&&(EditorUi.templateFile=l.templateFile);null!=l.enabledTemplateSections&&(Array.isArray(l.enabledTemplateSections)?EditorUi.enabledTemplateSections=l.enabledTemplateSections:EditorUi.debug("Configuration Error: Array expected for enabledTemplateSections"));null!=l.customTemplates&&(Array.isArray(l.customTemplates)?EditorUi.customTemplates= l.customTemplates:EditorUi.debug("Configuration Error: Array expected for customTemplates"));null!=l.styles&&(Array.isArray(l.styles)?Editor.styles=l.styles:EditorUi.debug("Configuration Error: Array expected for styles"));null!=l.globalVars&&(Editor.globalVars=l.globalVars);null!=l.defaultFileType&&(Editor.defaultFileType=l.defaultFileType);null!=l.compressXml&&(Editor.defaultCompressed=l.compressXml,Editor.compressXml=l.compressXml);null!=l.compressStyles&&(v=mxCodecRegistry.getCodec(mxGraphModel), null!=v&&(v.enableStyleCompression=l.compressStyles));null!=l.includeDiagram&&(Editor.defaultIncludeDiagram=l.includeDiagram);null!=l.simpleLabels&&(Editor.simpleLabels=l.simpleLabels);null!=l.optimizeHtmlLabels&&(Editor.optimizeHtmlLabels=l.optimizeHtmlLabels);null!=l.mathOutputSize&&(Editor.mathOutputSize=l.mathOutputSize);null!=l.mermaid&&("object"!==typeof l.mermaid||Array.isArray(l.mermaid)?EditorUi.debug("Configuration Error: Object expected for mermaid"):EditorUi.defaultMermaidConfig=l.mermaid); null!=l.pasteAtMousePointer&&(Editor.pasteAtMousePointer=l.pasteAtMousePointer);null!=l.fitDiagramOnLoad&&(Editor.fitDiagramOnLoad=l.fitDiagramOnLoad);null!=l.fitDiagramOnPage&&(Editor.fitDiagramOnPage=l.fitDiagramOnPage);null!=l.showLinkIcons&&(Editor.showLinkIcons=l.showLinkIcons);null!=l.showTooltipIcons&&(Editor.showTooltipIcons=l.showTooltipIcons);null!=l.showNoteIcons&&(Editor.showNoteIcons=l.showNoteIcons);null!=l.tooltipFontSize&&(v=parseInt(l.tooltipFontSize),!isNaN(v)&&0<v?Editor.tooltipFontSize= v:EditorUi.debug("Configuration Error: Int > 0 expected for tooltipFontSize"));null!=l.tooltipMaxWidth&&(v=parseInt(l.tooltipMaxWidth),!isNaN(v)&&0<=v?Editor.tooltipMaxWidth=v:EditorUi.debug("Configuration Error: Int >= 0 expected for tooltipMaxWidth"));null!=l.expandPatternsForPrint&&(Editor.expandPatternsForPrint=l.expandPatternsForPrint);null!=l.showConnectHandle&&(Editor.showConnectHandle=l.showConnectHandle);null!=l.enableInlineToolbar&&(Editor.enableInlineToolbar=l.enableInlineToolbar);null!= l.enableSizeGuides&&"undefined"!==typeof mxVertexHandler&&(mxVertexHandler.prototype.sizeGuidesEnabled=l.enableSizeGuides);null!=l.enablePositionGuides&&"undefined"!==typeof mxGuide&&(mxGuide.prototype.positionEnabled=l.enablePositionGuides);null!=l.enableDistanceGuides&&"undefined"!==typeof mxGuide&&(mxGuide.prototype.distanceEnabled=l.enableDistanceGuides);null!=l.defaultTransparentGroups&&(Editor.defaultTransparentGroups=l.defaultTransparentGroups);null!=l.oneDriveInlinePicker&&(Editor.oneDriveInlinePicker= l.oneDriveInlinePicker);null!=l.enableNativeClipboard&&(Editor.enableNativeClipboard=l.enableNativeClipboard);null!=l.enableExportUrl&&(Editor.enableExportUrl=l.enableExportUrl);null!=l.defaultAdaptiveColors?Graph.defaultAdaptiveColors=l.defaultAdaptiveColors:0==l.enableCssDarkMode&&(Graph.defaultAdaptiveColors="simple");null!=l.enableLightDarkColors&&(mxUtils.lightDarkColorSupported=l.enableLightDarkColors);null!=l.darkColor&&(Editor.darkColor=l.darkColor);null!=l.darkColorVar&&(Editor.darkColorVar= l.darkColorVar);null!=l.defaultPageBackgroundColor&&(Editor.pageBackgroundColor=l.defaultPageBackgroundColor);null!=l.defaultDarkPageBackgroundColor&&(Editor.darkPageBackgroundColor=l.defaultDarkPageBackgroundColor);null!=l.defaultGridColor&&(mxGraphView.prototype.defaultGridColor=l.defaultGridColor);null!=l.defaultDarkGridColor&&(mxGraphView.prototype.defaultDarkGridColor=l.defaultDarkGridColor);mxGraphView.prototype.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultDarkGridColor:mxGraphView.prototype.defaultGridColor; Graph.prototype.defaultPageBackgroundColor=Editor.getDefaultPageBackgroundColor();Graph.prototype.shapeBackgroundColor="light-dark(#ffffff, var("+Editor.darkColorVar+", "+Editor.darkColor+"))";null!=l.settingsName&&(Editor.configurationKey="."+l.settingsName+"-configuration",Editor.settingsKey="."+l.settingsName+"-config",mxSettings.key=Editor.settingsKey);null!=l.customFonts&&(Menus.prototype.defaultFonts=l.customFonts.concat(Menus.prototype.defaultFonts));null!=l.customPresetColors&&(ColorDialog.prototype.presetColors= l.customPresetColors.concat(ColorDialog.prototype.presetColors));null!=l.customColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=l.customColorSchemes.concat(StyleFormatPanel.prototype.defaultColorSchemes));if(null!=l.css){v=document.createElement("style");v.setAttribute("type","text/css");v.appendChild(document.createTextNode(l.css));var H=document.getElementsByTagName("script")[0];H.parentNode.insertBefore(v,H)}null!=l.expandLibraries&&(Sidebar.prototype.expandLibraries=l.expandLibraries); null!=l.appendCustomLibraries&&(Sidebar.prototype.appendCustomLibraries=l.appendCustomLibraries);null!=l.libraries&&(Sidebar.prototype.customEntries=l.libraries);null!=l.enabledLibraries&&(Array.isArray(l.enabledLibraries)?Sidebar.prototype.enabledLibraries=l.enabledLibraries:EditorUi.debug("Configuration Error: Array expected for enabledLibraries"));null!=l.defaultLibraries&&(Sidebar.prototype.defaultEntries=l.defaultLibraries);null!=l.defaultCustomLibraries&&(Editor.defaultCustomLibraries=l.defaultCustomLibraries); null!=l.defaultLanguages&&(Array.isArray(l.defaultLanguages)?Editor.defaultLanguages=l.defaultLanguages:EditorUi.debug("Configuration Error: Array expected for defaultLanguages"));null!=l.enableCustomLibraries&&(Editor.enableCustomLibraries=l.enableCustomLibraries);null!=l.inlineExtIcons&&(Editor.inlineExtIcons=l.inlineExtIcons);null!=l.defaultVertexStyle&&(Graph.prototype.defaultVertexStyle=l.defaultVertexStyle);null!=l.defaultEdgeStyle&&(Graph.prototype.defaultEdgeStyle=l.defaultEdgeStyle);null!= l.shapePicker&&(EditorUi.prototype.defaultShapePickerEntries=l.shapePicker.shapes);null!=l.defaultPageVisible&&(Graph.prototype.defaultPageVisible=l.defaultPageVisible);null!=l.defaultGridEnabled&&(Graph.prototype.defaultGridEnabled=l.defaultGridEnabled);null!=l.defaultConnectionArrowsEnabled&&(Graph.prototype.defaultConnectionArrowsEnabled=l.defaultConnectionArrowsEnabled,Graph.prototype.connectionArrowsEnabled=l.defaultConnectionArrowsEnabled);null!=l.defaultConnectable&&(Graph.prototype.defaultConnectable= l.defaultConnectable);null!=l.copyOnConnect&&(mxConnectionHandler.prototype.createTarget=l.copyOnConnect);null!=l.stopEditingOnEnter&&(mxGraph.prototype.enterStopsCellEditing=l.stopEditingOnEnter);null!=l.defaultFoldingEnabled&&(Graph.prototype.defaultFoldingEnabled=l.defaultFoldingEnabled);null!=l.foldingIconSize&&Graph.updateFoldingImages(l.foldingIconSize);null!=l.zoomWheel&&(Graph.zoomWheel=l.zoomWheel);null!=l.browserTranslate&&(Graph.browserTranslate=l.browserTranslate);null!=l.zoomFactor&& (v=parseFloat(l.zoomFactor),!isNaN(v)&&1<v?Graph.prototype.zoomFactor=v:EditorUi.debug("Configuration Error: Float > 1 expected for zoomFactor"));null!=l.defaultGridSize&&(v=parseInt(l.defaultGridSize),!isNaN(v)&&0<v?mxGraph.prototype.gridSize=v:EditorUi.debug("Configuration Error: Int > 0 expected for defaultGridSize"));null!=l.gridSteps&&(v=parseInt(l.gridSteps),!isNaN(v)&&0<v?mxGraphView.prototype.gridSteps=v:EditorUi.debug("Configuration Error: Int > 0 expected for gridSteps"));null!=l.pageFormat&& (v=parseInt(l.pageFormat.width),H=parseInt(l.pageFormat.height),!isNaN(v)&&0<v&&!isNaN(H)&&0<H?(mxGraph.prototype.defaultPageFormat=new mxRectangle(0,0,v,H),mxGraph.prototype.pageFormat=mxGraph.prototype.defaultPageFormat):EditorUi.debug("Configuration Error: {width: int, height: int} expected for pageFormat"));null!=l.thumbWidth&&(Sidebar.prototype.thumbWidth=l.thumbWidth);null!=l.thumbHeight&&(Sidebar.prototype.thumbHeight=l.thumbHeight);null!=l.emptyLibraryXml&&(EditorUi.prototype.emptyLibraryXml= l.emptyLibraryXml);null!=l.emptyDiagramXml&&(EditorUi.prototype.emptyDiagramXml=l.emptyDiagramXml);null!=l.sidebarWidth&&(EditorUi.prototype.hsplitPosition=l.sidebarWidth);null!=l.updateDefaultStyle&&(EditorUi.prototype.updateDefaultStyle=l.updateDefaultStyle);null!=l.sidebarTitles&&(Sidebar.prototype.sidebarTitles=l.sidebarTitles);null!=l.sidebarTitleSize&&(v=parseInt(l.sidebarTitleSize),!isNaN(v)&&0<v?Sidebar.prototype.sidebarTitleSize=v:EditorUi.debug("Configuration Error: Int > 0 expected for sidebarTitleSize")); null!=l.fontCss&&("string"===typeof l.fontCss?Editor.configureFontCss(l.fontCss):EditorUi.debug("Configuration Error: String expected for fontCss"));null!=l.autosaveDelay&&(v=parseInt(l.autosaveDelay),!isNaN(v)&&0<v?DrawioFile.prototype.autosaveDelay=v:EditorUi.debug("Configuration Error: Int > 0 expected for autosaveDelay"));null!=l.maxImageBytes&&(EditorUi.prototype.maxImageBytes=l.maxImageBytes);null!=l.maxImageSize&&(EditorUi.prototype.maxImageSize=l.maxImageSize);null!=l.shareCursorPosition&& (EditorUi.prototype.shareCursorPosition=l.shareCursorPosition);null!=l.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=l.showRemoteCursors);null!=l.restrictExport&&(DrawioFile.RESTRICT_EXPORT=l.restrictExport);null!=l.removeImageMetadata&&(Editor.removeImageMetadata=l.removeImageMetadata);null!=l.defaultTextStyle&&(Editor.defaultTextStyle=l.defaultTextStyle);null!=l.replaceSvgDataUris&&(Editor.replaceSvgDataUris=l.replaceSvgDataUris);null!=l.foreignObjectImages&&(Editor.foreignObjectImages= l.foreignObjectImages);null!=l.embedSvgFonts&&(Editor.embedSvgFonts=l.embedSvgFonts);null!=l.shadowColor&&(mxConstants.SHADOW_COLOR=l.shadowColor);null!=l.shadowOpacity&&(mxConstants.SHADOW_OPACITY=l.shadowOpacity);null!=l.shadowOffsetX&&(mxConstants.SHADOW_OFFSET_X=l.shadowOffsetX);null!=l.shadowOffsetY&&(mxConstants.SHADOW_OFFSET_Y=l.shadowOffsetY);null!=l.shadowBlur&&(mxConstants.SHADOW_BLUR=l.shadowBlur);null!=l.enableAnimations&&(Editor.enableAnimations=l.enableAnimations);null!=l.insertAnimations&& (Editor.insertAnimations=l.insertAnimations);null!=l.enableWindowDocking&&(Editor.enableWindowDocking=l.enableWindowDocking);null!=l.compact&&(EditorUi.prototype.defaultCompact=l.compact);null!=l.noAutoFocus&&(EditorUi.prototype.noAutoFocus=l.noAutoFocus);if(null!=l.hideMenuItems)if(Array.isArray(l.hideMenuItems))for(Menus.prototype.hiddenMenuItems={},v=0;v<l.hideMenuItems.length;v++)Menus.prototype.hiddenMenuItems[l.hideMenuItems[v]]=!0;else EditorUi.debug("Configuration Error: Array expected for hideMenuItems"); if(null!=l.hideMenus)if(Array.isArray(l.hideMenus)){var O={};for(v=0;v<l.hideMenus.length;v++)O[l.hideMenus[v]]=!0;Menus.prototype.defaultMenuItems=Menus.prototype.defaultMenuItems.filter(function(S){return!O[S]})}else EditorUi.debug("Configuration Error: Array expected for hideMenus");null!=l.enableAi&&(Editor.enableAi=l.enableAi);null!=l.enableChatGpt&&(Editor.enableAi=l.enableChatGpt);null!=l.gptApiKey&&(Editor.aiGlobals.gptApiKey=l.gptApiKey);null!=l.geminiApiKey&&(Editor.aiGlobals.geminiApiKey= l.geminiApiKey);null!=l.claudeApiKey&&(Editor.aiGlobals.claudeApiKey=l.claudeApiKey);null!=l.gptUrl&&null!=Editor.aiConfigs.gpt&&(Editor.aiConfigs.gpt.endpoint=l.gptUrl);null!=l.aiActions&&(Editor.aiActions=l.aiActions);null!=l.aiGlobals&&(Editor.aiGlobals=l.aiGlobals);null!=l.aiConfigs&&(Editor.aiConfigs=l.aiConfigs);null!=l.aiModels&&(Editor.aiModels=l.aiModels)}};Editor.applyCustomResources=function(){if(null!=Editor.customResources){var l=null!=mxClient.language?mxClient.language.toLowerCase(): null,v=null!=l?l.indexOf("-"):-1,H;for(H in Editor.customResources){var O=Editor.customResources[H];null!=O&&"object"===typeof O&&(O=(null!=l?O[l]:null)||(0<v?O[l.substring(0,v)]:null)||O.main);"string"===typeof O&&(mxResources.resources[H]=O)}}};var b=mxResources.parse;mxResources.parse=function(l){b.apply(this,arguments);Editor.applyCustomResources()};Editor.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.expandSvgPatterns= function(l){function v(ha,na){ha=ha.getAttribute("fill");if(null==ha||0!==ha.indexOf("url("))return null;ha=ha.match(/url\([^#]*#([^)"]+)\)?/);if(null==ha)return null;ha=ha[1];try{var oa=na.querySelector("#"+CSS.escape(ha));return null!=oa&&"pattern"===oa.nodeName?oa:null}catch(fa){return null}}function H(ha,na,oa){var fa,qa,ya;try{var ta=ha.getBBox()}catch(Ja){return}if(0!==ta.width&&0!==ta.height){var Ca=parseFloat(na.getAttribute("width")),la=parseFloat(na.getAttribute("height"));if(!(isNaN(Ca)|| isNaN(la)||0>=Ca||0>=la)){var ra=na.getAttribute("patternTransform");var va=qa=fa=0;var Ia=ya=1;if(null!=ra){var La=ra.match(/translate\(\s*([^,\s]+)[,\s]+([^)]+)\)/);null!=La&&(fa=parseFloat(La[1]),qa=parseFloat(La[2]));La=ra.match(/rotate\(\s*([^)]+)\)/);null!=La&&(va=parseFloat(La[1])*Math.PI/180);ra=ra.match(/scale\(\s*([^,\s)]+)(?:[,\s]+([^)]+))?\)/);null!=ra&&(ya=parseFloat(ra[1]),Ia=null!=ra[2]?parseFloat(ra[2]):ya)}var Ga=[{x:ta.x,y:ta.y},{x:ta.x+ta.width,y:ta.y},{x:ta.x+ta.width,y:ta.y+ta.height}, {x:ta.x,y:ta.y+ta.height}],Da=Infinity;ta=Infinity;La=ra=-Infinity;for(var Pa=0;Pa<Ga.length;Pa++){var Ka=Ga[Pa].x-fa;var Na=Ga[Pa].y-qa,Oa=Math.cos(-va),Fa=Math.sin(-va);var za=(Ka*Oa-Na*Fa)/ya;Ka=(Ka*Fa+Na*Oa)/Ia;Da=Math.min(Da,za);ta=Math.min(ta,Ka);ra=Math.max(ra,za);La=Math.max(La,Ka)}Da=Math.floor(Da/Ca)-1;ta=Math.floor(ta/la)-1;ra=Math.ceil(ra/Ca)+1;za=Math.ceil(La/la)+1;if(!(1E4<(ra-Da)*(za-ta))){Pa=S+ ++O;La=oa.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");La.setAttribute("id", Pa);Ga=ha.cloneNode(!0);Ga.removeAttribute("fill");Ga.removeAttribute("fill-opacity");Ga.removeAttribute("stroke");Ga.removeAttribute("stroke-width");Ga.removeAttribute("stroke-opacity");Ga.removeAttribute("style");Ga.removeAttribute("pointer-events");Ga.setAttribute("fill","black");La.appendChild(Ga);Ga=oa.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");Ga.setAttribute("clip-path","url(#"+Pa+")");Pa=ha.getAttribute("fill-opacity");null!=Pa&&Ga.setAttribute("opacity",Pa);Pa=oa.ownerDocument.createElementNS("http://www.w3.org/2000/svg", "g");Pa.setAttribute("transform","translate("+fa+","+qa+")"+(0!==va?" rotate("+180*va/Math.PI+")":"")+" scale("+ya+(Ia!==ya?","+Ia:"")+")");qa=S+ ++O;fa=oa.ownerDocument.createElementNS("http://www.w3.org/2000/svg","clipPath");fa.setAttribute("id",qa);va=oa.ownerDocument.createElementNS("http://www.w3.org/2000/svg","rect");va.setAttribute("x","0");va.setAttribute("y","0");va.setAttribute("width",Ca);va.setAttribute("height",la);fa.appendChild(va);na=na.childNodes;for(va=Da;va<ra;va++)for(ya=ta;ya< za;ya++){Ia=oa.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");Ia.setAttribute("transform","translate("+va*Ca+","+ya*la+")");Ia.setAttribute("clip-path","url(#"+qa+")");for(Da=0;Da<na.length;Da++)1===na[Da].nodeType&&Ia.appendChild(na[Da].cloneNode(!0));Pa.appendChild(Ia)}Ga.appendChild(Pa);Ca=oa.querySelector("defs");null==Ca&&(Ca=oa.ownerDocument.createElementNS("http://www.w3.org/2000/svg","defs"),oa.insertBefore(Ca,oa.firstChild));Ca.appendChild(La);Ca.appendChild(fa);ha.parentNode.insertBefore(Ga, ha.nextSibling);ha.setAttribute("fill","none");ha.style.fill=""}}}}for(var O=0,S="expand-pattern-clip-"+Editor.guid(8)+"-",V=l.querySelectorAll('[fill^="url("]'),Z=0;Z<V.length;Z++){var ba=v(V[Z],l);null!=ba&&H(V[Z],ba,l)}V=l.querySelectorAll("[style]");for(Z=0;Z<V.length;Z++)ba=V[Z].getAttribute("style"),null!=ba&&-1!==ba.indexOf("url(")&&(ba=v(V[Z],l),null!=ba&&H(V[Z],ba,l))};Editor.configureFontCss=function(l){if(null!=l){Editor.prototype.fontCss=l;var v=document.getElementsByTagName("script")[0]; if(null!=v&&null!=v.parentNode){var H=document.createElement("style");H.setAttribute("type","text/css");H.appendChild(document.createTextNode(l));v.parentNode.insertBefore(H,v);l=l.split("url(");for(H=1;H<l.length;H++){var O=l[H].indexOf(")");O=Editor.trimCssUrl(l[H].substring(0,O));var S=document.createElement("link");S.setAttribute("rel","preload");S.setAttribute("href",O);S.setAttribute("as","font");S.setAttribute("crossorigin","");v.parentNode.insertBefore(S,v)}}}};Editor.trimCssUrl=function(l){return l.replace(RegExp("^[\\s\"']+", "g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GOOGLE_FONTS_CSS2="https://fonts.googleapis.com/css2?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=20;Editor.guid=function(l){l=null!=l?l:Editor.GUID_LENGTH;for(var v=[],H=0;H<l;H++)v.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return v.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=9E4;Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;Editor.prototype.crossOriginImages=!0;var d=Editor.prototype.setGraphXml;Editor.prototype.setGraphXml=function(l){l=null!=l&&"mxlibrary"!=l.nodeName?this.extractGraphModel(l):null;if(null!=l){var v=Editor.extractParserError(l,mxResources.get("invalidOrMissingFile")); if(v)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[l],"cause",[v]),Error(mxResources.get("notADiagramFile")+" ("+v+")");if("mxGraphModel"==l.nodeName){v=l.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=v&&""!=v)v!=this.graph.currentStyle&&(H=null!=this.graph.themes?this.graph.themes[v]:mxUtils.load(STYLE_PATH+"/"+v+".xml").getDocumentElement(),null!=H&&(O=new mxCodec(H.ownerDocument),O.decode(H,this.graph.getStylesheet())));else{var H=null!=this.graph.themes? this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement();if(null!=H){var O=new mxCodec(H.ownerDocument);O.decode(H,this.graph.getStylesheet())}}this.graph.currentStyle=v;this.graph.mathEnabled="1"==urlParams.math||"1"==l.getAttribute("math");this.graph.setAdaptiveColors(l.getAttribute("adaptiveColors"));v=l.getAttribute("backgroundImage");null!=v?this.graph.setBackgroundImage(this.graph.parseBackgroundImage(v)):this.graph.setBackgroundImage(null);this.graph.useCssTransforms= !mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==l.getAttribute("shadow"),!1);if(v=l.getAttribute("extFonts"))try{for(v=v.split("|").map(function(S){S=S.split("^");return{name:S[0],url:S[1]}}),H=0;H<v.length;H++)this.graph.addExtFont(v[H].name,v[H].url)}catch(S){console.log("ExtFonts format error: "+S.message)}else null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(this.graph.extFonts=[])}d.apply(this, arguments)}else throw{message:mxResources.get("notADiagramFile")||"Invalid data",toString:function(){return this.message}};};var m=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(l,v){l=null!=l?l:!0;var H=m.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&H.setAttribute("style",this.graph.currentStyle);var O=this.graph.getBackgroundImageObject(this.graph.backgroundImage,v);null!=O&&H.setAttribute("backgroundImage",JSON.stringify(O)); H.setAttribute("math",this.graph.mathEnabled?"1":"0");H.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?H.setAttribute("adaptiveColors",this.graph.adaptiveColors):H.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(O=this.graph.extFonts.map(function(S){return S.name+"^"+S.url}),H.setAttribute("extFonts",O.join("|")));return H};Editor.prototype.isDataSvg=function(l){try{var v=mxUtils.parseXml(l).documentElement.getAttribute("content"); if(null!=v&&(null!=v&&"<"!=v.charAt(0)&&"%"!=v.charAt(0)&&(v=unescape(window.atob?atob(v):Base64.decode(cont,v))),null!=v&&"%"==v.charAt(0)&&(v=decodeURIComponent(v)),null!=v&&0<v.length)){var H=mxUtils.parseXml(v).documentElement;return"mxfile"==H.nodeName||"mxGraphModel"==H.nodeName}}catch(O){}return!1};Editor.prototype.extractGraphModel=function(l,v,H){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 t=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){t.apply(this,arguments);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()}; Editor.initMath=function(l,v){if("undefined"===typeof window.MathJax){var H=function(){O=null;Editor.mathJaxRendering=!1;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};l=null!=l?l:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var O=null;Editor.mathJaxRendering=!1;Editor.doMathJaxRender=function(Z){null!=MathJax.startup&&null!=MathJax.startup.output&&null!=MathJax.startup.output.options&&null!=MathJax.startup.output.options.linebreaks&& (MathJax.startup.output.options.linebreaks.inline=!1);try{null==O?(MathJax.typesetClear([Z]),MathJax.typeset([Z]),H()):O!=Z&&Editor.mathJaxQueue.push(Z)}catch(ba){MathJax.typesetClear([Z]),null!=ba.retry?(O=Z,Editor.mathJaxRendering=!0,ba.retry.then(function(){MathJax.typesetPromise([Z]).then(H)["catch"](function(ha){console.log("Error in MathJax.typesetPromise: "+ha.toString());H()})})["catch"](function(ha){console.log("Error in MathJax.retry: "+ha.toString());H()})):null!=window.console&&console.log("Error in MathJax.typeset: "+ ba.toString())}};window.MathJax=null!=v?v:{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 S=Editor.prototype.init;Editor.prototype.init=function(){S.apply(this,arguments);var Z=mxUtils.bind(this,function(na,oa){null!=this.graph.container&&this.graph.mathEnabled&&(Editor.mathOutputSize&&(this.graph.container.style.visibility="hidden"),Editor.MathJaxRender(this.graph.container))});this.graph.model.addListener(mxEvent.CHANGE,Z);this.graph.addListener(mxEvent.REFRESH,Z);var ba= this.graph,ha=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){null!=ha&&ha.apply(this,arguments);Editor.mathOutputSize&&null!=ba&&ba.mathEnabled&&(ba.refreshMathBounds(),null!=ba.container&&(ba.container.style.visibility=""))}};v=document.getElementsByTagName("script");if(null!=v&&0<v.length){var V=document.createElement("script");V.setAttribute("type","text/javascript");V.setAttribute("src",l);v[0].parentNode.appendChild(V)}}};Editor.containsMath=function(l){return null!=l&&(0<=l.indexOf("$")|| 0<=l.indexOf("\\(")||0<=l.indexOf("\\[")||0<=l.indexOf("\\begin{"))};(function(){var l=Graph.prototype.getPreferredSizeForCell,v=null;Graph.prototype.getPreferredSizeForCell=function(H,O,S){if(!Editor.mathOutputSize||!this.mathEnabled||"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||this.model.isEdge(H))return l.apply(this,arguments);var V=this.view.createState(H);V=null!=V?this.cellRenderer.getLabelValue(V):null;if(null==V||0===V.length||!Editor.containsMath(V))return l.apply(this, arguments);var Z=mxUtils.getSizeForString;mxUtils.getSizeForString=function(ba,ha,na,oa){null==v&&(v=document.createElement("div"),v.style.cssText="position:absolute;visibility:hidden;left:-10000px;top:-10000px;display:inline-block;",document.body.appendChild(v));v.style.fontSize=ha+"px";v.style.fontFamily=na;null!=oa&&0<oa?(v.style.width=oa+"px",v.style.whiteSpace="normal"):(v.style.width="",v.style.whiteSpace="nowrap");MathJax.typesetClear([v]);v.innerHTML=Graph.sanitizeHtml(ba);try{MathJax.typeset([v]); var fa=v.getBoundingClientRect();return new mxRectangle(0,0,fa.width,fa.height)}catch(qa){return Z.apply(this,arguments)}};try{return l.apply(this,arguments)}finally{mxUtils.getSizeForString=Z}}})();Graph.prototype.refreshMathBounds=function(){if(Editor.mathOutputSize&&this.mathEnabled){var l=this.view,v=!1;l.states.visit(mxUtils.bind(this,function(O,S){null!=S&&null!=S.text&&(O=this.cellRenderer.getLabelValue(S),"string"===typeof O&&Editor.containsMath(O)&&(S.text.updateBoundingBox(),v=!0))}));if(v){var H= null!=l.currentRoot?l.currentRoot:this.model.getRoot();H=l.getState(H);null!=H&&(H=l.getBoundingBox(H,!0,!1),l.setGraphBounds(null!=H?H:l.getEmptyBounds()),this.sizeDidChange());this.fireEvent(new mxEventObject("mathRefreshed"))}}};(function(){var l=EditorUi.prototype.initialFitDiagram;EditorUi.prototype.initialFitDiagram=function(v){l.apply(this,arguments);var H=this.editor.graph;if(Editor.mathOutputSize&&null!=H&&H.mathEnabled){var O=arguments,S=this,V=!1,Z=function(){V||(V=!0,H.removeListener(Z), H.zoomTo(1),S.resetScrollbars(),l.apply(S,O))};H.addListener("mathRefreshed",Z);Promise.resolve().then(function(){V||"undefined"===typeof MathJax||"function"!==typeof MathJax.typeset||null!=Editor.mathJaxQueue&&0<Editor.mathJaxQueue.length||Editor.mathJaxRendering||H.removeListener(Z)})}}})();Editor.prototype.csvToArray=function(l){if(0<l.length){var v="",H=[""],O=0,S=!0,V;l=$jscomp.makeIterator(l);for(V=l.next();!V.done;V=l.next())V=V.value,'"'===V?(S&&V===v&&(H[O]+=V),S=!S):","===V&&S?V=H[++O]= "":H[O]+=V,v=V;return H}return[]};Editor.prototype.getProxiedUrl=function(l){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&!this.isCorsEnabledForUrl(l)){var v=EditorUi.isVisioFilename(l);v=/\.png$/i.test(l)||/\.pdf$/i.test(l)||v;var H="t="+(new Date).getTime();l=PROXY_URL+"?url="+encodeURIComponent(l)+"&"+H+(v?"&base64=1":"")}return l};Editor.prototype.isCorsEnabledForUrl=function(l){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||l.substring(0, window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(l)||"https://raw.githubusercontent.com/"===l.substring(0,34)||"https://icons.diagrams.net/"===l.substring(0,27)||"https://fonts.googleapis.com/"===l.substring(0,29)||"https://fonts.gstatic.com/"===l.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var l=new mxUrlConverter; l.updateBaseUrl();var v=l.convert,H=this;l.convert=function(O){null!=O&&navigator.onLine&&("http://"!=O.substring(0,7)&&"https://"!=O.substring(0,8)||O.substring(0,l.baseUrl.length)==l.baseUrl||H.crossOriginImages&&H.isCorsEnabledForUrl(O)?"chrome-extension://"!=O.substring(0,19)&&(O=v.apply(this,arguments)):O=PROXY_URL+"?url="+encodeURIComponent(O));return O};return l};Editor.createSvgDataUri=function(l){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(l)))};Editor.prototype.convertImageToDataUri= function(l,v,H,O,S){try{var V=!0,Z=window.setTimeout(mxUtils.bind(this,function(){V=!1;v(l)}),this.timeout),ba=mxUtils.bind(this,function(){null!=O?this.convertImageToDataUri(l,v,H,O,!0):v(l)});if(/(\.svg)$/i.test(l)&&!S)mxUtils.get(l,mxUtils.bind(this,function(na){window.clearTimeout(Z);V&&(200>na.getStatus()||299<na.getStatus()?ba():v(Editor.createSvgDataUri(na.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(Z);V&&ba()}));else{var ha=new Image;this.crossOriginImages&&(ha.crossOrigin= "anonymous");ha.onload=function(){window.clearTimeout(Z);if(V)try{O=null!=O&&S?O:1;var na=document.createElement("canvas");na.height=ha.height*O;na.width=ha.width*O;var oa=na.getContext("2d");oa.scale(O,O);oa.drawImage(ha,0,0);v(na.toDataURL())}catch(fa){v(l)}};ha.onerror=function(){window.clearTimeout(Z);V&&(null!=H?H():v(l))};ha.src=l}}catch(na){null!=H?H():v(l)}};Editor.prototype.convertImages=function(l,v,H,O){function S(){0<V.length?V.shift()():v(l)}null==O&&(O=this.createImageUrlConverter()); var V=[],Z=H||{};H=mxUtils.bind(this,function(fa,qa){fa=l.getElementsByTagName(fa);for(var ya=0;ya<fa.length;ya++)mxUtils.bind(this,function(ta){V.push(mxUtils.bind(this,function(){try{if(null!=ta){var Ca=O.convert(ta.getAttribute(qa));if(null!=Ca&&"data:"!=Ca.substring(0,5)){var la=Z[Ca];null==la?this.convertImageToDataUri(Ca,function(ra){null!=ra&&(Z[Ca]=ra,ta.setAttribute(qa,ra));S()},null,Editor.svgRasterScale):(ta.setAttribute(qa,la),S())}else null!=Ca&&ta.setAttribute(qa,Ca),S()}}catch(ra){S()}}))})(fa[ya])}); var ba={},ha=function(){var fa=l.getElementsByTagName("defs")[0];null==fa&&(fa=l.ownerDocument,fa=null!=fa.createElementNS?fa.createElementNS(mxConstants.NS_SVG,"defs"):fa.createElement("defs"),l.insertBefore(fa,l.firstChild));return fa},na=mxUtils.bind(this,function(){for(var fa=l.getElementsByTagName("use"),qa=0;qa<fa.length;qa++)mxUtils.bind(this,function(ya){V.push(mxUtils.bind(this,function(){try{var ta=ya.getAttribute("href");null==ta&&(ta=ya.getAttribute("xlink:href"));if(null!=ta&&"#"!=ta.charAt(0)&& "data:"!=ta.substring(0,5)){var Ca=O.convert(ta),la=function(va){va=Graph.createSvgImageSymbol(ha(),ba,va,!0);null!=va&&(ya.setAttribute("href","#"+va),ya.setAttribute("xlink:href","#"+va));S()},ra=Z[Ca];null==ra?this.convertImageToDataUri(Ca,function(va){null!=va&&va!=Ca&&(Z[Ca]=va);la(va)}):la(ra)}else S()}catch(va){S()}}))})(fa[qa])}),oa=mxUtils.bind(this,function(){V.push(mxUtils.bind(this,function(){try{for(var fa=l.getElementsByTagName("image"),qa=[],ya=0;ya<fa.length;ya++)qa.push(fa[ya]);var ta= {},Ca={},la=[],ra=function(){for(var Oa=l.getElementsByTagName("use"),Fa=0;Fa<Oa.length;Fa++){var za=Oa[Fa].getAttribute("href");null==za&&(za=Oa[Fa].getAttribute("xlink:href"));null!=za&&null!=ta[za]&&(Oa[Fa].setAttribute("href","#"+ta[za]),Oa[Fa].setAttribute("xlink:href","#"+ta[za]))}},va=function(Oa,Fa){for(var za=null!=l.ownerDocument.createElementNS?l.ownerDocument.createElementNS(mxConstants.NS_SVG,"use"):l.ownerDocument.createElement("use"),Ja=Oa.attributes,Ha=0;Ha<Ja.length;Ha++){var Sa= Ja[Ha].name;"href"!=Sa&&"xlink:href"!=Sa&&"preserveAspectRatio"!=Sa&&za.setAttribute(Sa,Ja[Ha].value)}za.setAttribute("href","#"+Fa);za.setAttribute("xlink:href","#"+Fa);Oa.parentNode.replaceChild(za,Oa)};for(ya=0;ya<qa.length;ya++){var Ia=qa[ya];fa=Ia;var La=!0;if("symbol"==Ia.parentNode.nodeName)if(null==Ia.getAttribute("id")&&"mx-image-"==String(Ia.parentNode.getAttribute("id")||"").substring(0,9))fa=Ia.parentNode,La=!1;else continue;else"mx-image-"==String(Ia.getAttribute("id")||"").substring(0, 9)&&(La=!1);var Ga=Ia.getAttribute("xlink:href");if(null!=Ga&&"data:"==Ga.substring(0,5)){var Da=fa.getAttribute("preserveAspectRatio")||"";if("data:image/svg+xml"==Ga.substring(0,18)){var Pa="mx-symbol-"+mxUtils.hashCode(Ga+"|"+("none"!=Da)),Ka=l.querySelector('[id="'+Pa+'"]');if(null!=Ka&&"symbol"==Ka.nodeName){La?va(Ia,Pa):(ta["#"+fa.getAttribute("id")]=Pa,fa.parentNode.removeChild(fa));continue}}null==Ca[Ga]&&(Ca[Ga]={},la.push(Ga));null==Ca[Ga][Da]&&(Ca[Ga][Da]=[]);Ca[Ga][Da].push({node:fa,inline:La})}}ra(); var Na=function(){for(var Oa=null,Fa=null;0<la.length&&null==Oa;){Oa=la.pop();Fa=Ca[Oa];var za=0,Ja=0,Ha;for(Ha in Fa)za++,Ja=Math.max(Ja,Fa[Ha].length);2>za&&2>Ja&&(Oa=null)}if(null==Oa)S();else{var Sa=new Image;Sa.onload=function(){try{var ab=Sa.naturalWidth,Va=Sa.naturalHeight;if(0<ab&&0<Va){var db=l.ownerDocument,Ea=0,Za;for(Za in Fa)Ea++;var cb=function(Fb){return null!=db.createElementNS?db.createElementNS(mxConstants.NS_SVG,Fb):db.createElement(Fb)},$a=function(){var Fb=cb("image");Fb.setAttribute("width", ab);Fb.setAttribute("height",Va);null==Fb.setAttributeNS?Fb.setAttribute("xlink:href",Oa):Fb.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Oa);return Fb},gb=null;if(1<Ea){for(gb="mx-data-"+mxUtils.hashCode(Oa);null!=l.querySelector('[id="'+gb+'"]');)gb+="-1";var ob=$a();ob.setAttribute("id",gb);ha().appendChild(ob)}for(Za in Fa){var vb=Fa[Za];Ea=null;for(ob=0;ob<vb.length&&null==Ea;ob++)vb[ob].inline||(Ea=vb[ob].node.getAttribute("id"));if(null==Ea)for(Ea="mx-image-"+mxUtils.hashCode(Oa+"|"+Za);null!= l.querySelector('[id="'+Ea+'"]');)Ea+="-1";var rb=cb("symbol");rb.setAttribute("id",Ea);rb.setAttribute("viewBox","0 0 "+ab+" "+Va);""!=Za&&rb.setAttribute("preserveAspectRatio",Za);if(null!=gb){var wb=cb("use");wb.setAttribute("href","#"+gb);wb.setAttribute("xlink:href","#"+gb);rb.appendChild(wb)}else rb.appendChild($a());ha().appendChild(rb);for(ob=0;ob<vb.length;ob++){var Ib=vb[ob].node;vb[ob].inline?va(Ib,Ea):(Ib.getAttribute("id")!=Ea&&(ta["#"+Ib.getAttribute("id")]=Ea),Ib.parentNode.removeChild(Ib))}}ra()}}catch(Fb){}Na()}; Sa.onerror=function(){Na()};Sa.src=Oa}};Na()}catch(Oa){S()}}))});H("image","xlink:href");H("img","src");na();oa();S()};Editor.base64Encode=function(l){for(var v="",H=0,O=l.length,S,V,Z;H<O;){S=l.charCodeAt(H++)&255;if(H==O){v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(S>>2);v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((S&3)<<4);v+="==";break}V=l.charCodeAt(H++);if(H==O){v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(S>> 2);v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((S&3)<<4|(V&240)>>4);v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((V&15)<<2);v+="=";break}Z=l.charCodeAt(H++);v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(S>>2);v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((S&3)<<4|(V&240)>>4);v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((V&15)<<2|(Z&192)>>6); v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Z&63)}return v};Editor.prototype.loadUrl=function(l,v,H,O,S,V,Z,ba){try{var ha=!Z&&(O||/(\.png)($|\?)/i.test(l)||/(\.jpe?g)($|\?)/i.test(l)||/(\.gif)($|\?)/i.test(l)||/(\.pdf)($|\?)/i.test(l));S=null!=S?S:!0;var na=mxUtils.bind(this,function(){mxUtils.get(l,mxUtils.bind(this,function(oa){200<=oa.getStatus()&&299>=oa.getStatus()?null!=v&&(oa=oa.getText(),ha&&(V=null!=V?V:"data:image/png;base64,",oa=V+Editor.base64Encode(oa)), v(oa)):null!=H&&(0==oa.getStatus()?H({message:mxResources.get("accessDenied")},oa):404==oa.getStatus()?H({message:mxResources.get("fileNotFound"),code:oa.getStatus()},oa):H({message:this.getErrorMessage(oa)},oa))}),function(oa){null!=H&&H({message:mxResources.get("error")+" "+oa.getStatus()})},ha,this.timeout,function(){S&&null!=H&&H({code:App.ERROR_TIMEOUT,retry:na})},ba)});na()}catch(oa){null!=H&&H(oa)}};Editor.prototype.getErrorMessage=function(l){var v=mxResources.get("error")+" "+l.getStatus(); try{var H=l.getText(),O=JSON.parse(H);null!=O&&null!=O.error&&null!=O.error.message&&(v=O.error.message+" ("+v+")")}catch(S){}return v};Editor.prototype.absoluteCssFonts=function(l){var v=null;if(null!=l){var H=l.split("url(");if(0<H.length){v=[H[0]];l=window.location.pathname;var O=null!=l?l.lastIndexOf("/"):-1;0<=O&&(l=l.substring(0,O+1));O=document.getElementsByTagName("base");var S=null;null!=O&&0<O.length&&(S=O[0].getAttribute("href"));for(var V=1;V<H.length;V++)if(O=H[V].indexOf(")"),0<O){var Z= Editor.trimCssUrl(H[V].substring(0,O));this.graph.isRelativeUrl(Z)&&(Z=null!=S?S+Z:window.location.protocol+"//"+window.location.hostname+("/"==Z.charAt(0)?"":l)+Z);v.push('url("'+Z+'"'+H[V].substring(O))}else v.push(H[V])}else v=[l]}return null!=v?v.join(""):null};Editor.prototype.mapFontUrl=function(l,v,H){/^https?:\/\//.test(v)&&!this.isCorsEnabledForUrl(v)&&(v=PROXY_URL+"?url="+encodeURIComponent(v));H(l,v)};Editor.prototype.embedCssFonts=function(l,v){var H=l.split("url("),O=0;null==this.cachedFonts&& (this.cachedFonts=Object.create(null));var S=mxUtils.bind(this,function(){if(0==O){for(var ha=[H[0]],na=1;na<H.length;na++){var oa=H[na].indexOf(")");ha.push('url("');ha.push(this.cachedFonts[Editor.trimCssUrl(H[na].substring(0,oa))]);ha.push('"'+H[na].substring(oa))}v(ha.join(""))}});if(0<H.length){for(l=1;l<H.length;l++){var V=H[l].indexOf(")"),Z=null,ba=H[l].indexOf("format(",V);0<ba&&(Z=Editor.trimCssUrl(H[l].substring(ba+7,H[l].indexOf(")",ba))));mxUtils.bind(this,function(ha){var na=this.cachedFonts[ha]; if(null==na){var oa=[];this.cachedFonts[ha]=oa;O++;na="application/x-font-ttf";if("svg"==Z||/(\.svg)($|\?)/i.test(ha))na="image/svg+xml";else if("otf"==Z||"embedded-opentype"==Z||/(\.otf)($|\?)/i.test(ha))na="application/x-font-opentype";else if("woff"==Z||/(\.woff)($|\?)/i.test(ha))na="application/font-woff";else if("woff2"==Z||/(\.woff2)($|\?)/i.test(ha))na="application/font-woff2";else if("eot"==Z||/(\.eot)($|\?)/i.test(ha))na="application/vnd.ms-fontobject";else if("sfnt"==Z||/(\.sfnt)($|\?)/i.test(ha))na= "application/font-sfnt";var fa=mxUtils.bind(this,function(qa){this.cachedFonts[ha]=qa;O--;S();for(qa=0;qa<oa.length;qa++)oa[qa]()});this.mapFontUrl(na,ha,mxUtils.bind(this,function(qa,ya){this.loadUrl(ya,function(ta){fa(ta)},function(ta){fa(ha)},!0,null,"data:"+qa+";charset=utf-8;base64,")}))}else"string"!=typeof na&&(O++,na.push(function(){O--;S()}))})(Editor.trimCssUrl(H[l].substring(0,V)),Z)}S()}else v(l)};Editor.prototype.loadFonts=function(l){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss, mxUtils.bind(this,function(v){this.resolvedFontCss=v;null!=l&&l()})):null!=l&&l()};Editor.prototype.createGoogleFontCache=function(){var l={},v;for(v in Graph.fontMapping)Graph.isCssFontUrl(v)&&(l[v]=Graph.fontMapping[v]);return l};Editor.prototype.embedExtFonts=function(l,v){v=this.graph.getCustomFonts(v);if(0<v.length){var H=[],O=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var S=mxUtils.bind(this,function(){0==O&&this.embedCssFonts(H.join(""),l)}),V= 0;V<v.length;V++)mxUtils.bind(this,function(Z,ba){Graph.isCssFontUrl(ba)?null==this.cachedGoogleFonts[ba]?(O++,this.loadUrl(Graph.rewriteGoogleFontUrl(ba),mxUtils.bind(this,function(ha){this.cachedGoogleFonts[ba]=ha;H.push(ha+"\n");O--;S()}),mxUtils.bind(this,function(ha){O--;H.push('@import url("'+Graph.escapeCssString(ba)+'");\n');S()}))):H.push(this.cachedGoogleFonts[ba]+"\n"):H.push('@font-face {font-family: "'+Graph.escapeCssString(Z)+'";src: url("'+Graph.escapeCssString(ba)+'")}\n')})(v[V].name, v[V].url);S()}else l()};Editor.prototype.addMathCss=function(l){l=l.getElementsByTagName("defs");if(null!=l&&0<l.length)for(var v=document.getElementsByTagName("style"),H=0;H<v.length;H++){var O=mxUtils.getTextContent(v[H]);0>O.indexOf("mxPageSelector")&&0<O.indexOf("MathJax")&&l[0].appendChild(v[H].cloneNode(!0))}};Editor.prototype.addFontCss=function(l,v){v=null!=v?v:this.absoluteCssFonts(this.fontCss);if(null!=v){var H=mxUtils.getSvgDefs(l),O=v.split("\n");v=[];for(var S=[],V=0;V<O.length;V++)"@import"== O[V].substring(0,7)?v.push(O[V]):S.push(O[V]);l=l.ownerDocument;l=null!=l.createElementNS?l.createElementNS(mxConstants.NS_SVG,"style"):l.createElement("style");l.setAttribute("type","text/css");0<v.length&&(mxUtils.setTextContent(l,v.join("\n")),H.appendChild(l));0<S.length&&(l=l.cloneNode(!1),mxUtils.setTextContent(l,S.join("\n")),H.appendChild(l))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(l, v,H){var O=mxClient.IS_FF?8192:16384;return Math.min(H,Math.min(O/l,O/v))};Editor.prototype.exportToCanvas=function(l,v,H,O,S,V,Z,ba,ha,na,oa,fa,qa,ya,ta,Ca,la,ra){try{V=null!=V?V:!0;Z=null!=Z?Z:!0;fa=null!=fa?fa:this.graph;qa=null!=qa?qa:0;var va=ha?null:fa.background;va==mxConstants.NONE&&(va=null);null==va&&(va=O);null==va&&0==ha&&(va=Editor.getDefaultPageBackgroundColor());this.convertImages(fa.getSvg(null,null,qa,ya,null,Z,null,null,null,na,null,Ca,la,ra),mxUtils.bind(this,function(Ia){try{Ia.style.setProperty("-webkit-font-smoothing", "antialiased");Ia.style.setProperty("-moz-osx-font-smoothing","grayscale");var La=new Image;La.onload=mxUtils.bind(this,function(){try{var Da=function(){mxClient.IS_SF?window.setTimeout(function(){Oa.drawImage(La,0,0);l(Pa,Ia)},0):(Oa.drawImage(La,0,0),l(Pa,Ia))},Pa=document.createElement("canvas"),Ka=parseInt(Ia.getAttribute("width")),Na=parseInt(Ia.getAttribute("height"));ba=null!=ba?ba:1;null!=v&&(ba=V?Math.min(1,Math.min(3*v/(4*Na),v/Ka)):v/Ka);ba=this.getMaxCanvasScale(Ka,Na,ba);Ka=Math.ceil(ba* Ka);Na=Math.ceil(ba*Na);Pa.setAttribute("width",Ka);Pa.setAttribute("height",Na);var Oa=Pa.getContext("2d");if(null!=va){var Fa=mxUtils.getLightDarkColor(va);Oa.beginPath();Oa.rect(0,0,Ka,Na);Oa.fillStyle="dark"==Ca&&"none"!=fa.getAdaptiveColors()?Fa.dark:Fa.light;Oa.fill()}1!=ba&&Oa.scale(ba,ba);if(ta){var za=fa.view,Ja=za.scale;za.scale=1;var Ha=btoa(unescape(encodeURIComponent(za.createSvgGrid(za.gridColor))));za.scale=Ja;Ha="data:image/svg+xml;base64,"+Ha;var Sa=fa.gridSize*za.gridSteps*ba,ab= fa.getGraphBounds(),Va=za.translate.x*Ja,db=za.translate.y*Ja,Ea=Va+(ab.x-Va)/Ja-qa,Za=db+(ab.y-db)/Ja-qa,cb=new Image;cb.onload=function(){try{for(var $a=-Math.round(Sa-mxUtils.mod((Va-Ea)*ba,Sa)),gb=-Math.round(Sa-mxUtils.mod((db-Za)*ba,Sa));$a<Ka;$a+=Sa)for(var ob=gb;ob<Na;ob+=Sa)Oa.drawImage(cb,$a/ba,ob/ba);Da()}catch(vb){null!=S&&S(vb)}};cb.onerror=function($a){null!=S&&S($a)};cb.src=Ha}else Da()}catch($a){null!=S&&S($a)}});La.onerror=function(Da){null!=S&&S(Da)};na&&this.graph.addSvgShadow(Ia); this.graph.mathEnabled&&this.addMathCss(Ia);var Ga=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(Ia,this.resolvedFontCss),La.src=Editor.createSvgDataUri(mxUtils.getXml(Ia))}catch(Da){null!=S&&S(Da)}});this.embedExtFonts(mxUtils.bind(this,function(Da){try{null!=Da&&this.addFontCss(Ia,Da),this.loadFonts(Ga)}catch(Pa){null!=S&&S(Pa)}}))}catch(Da){null!=S&&S(Da)}}),H,oa)}catch(Ia){null!=S&&S(Ia)}};Editor.crcTable=[];for(var n=0;256>n;n++)for(var z=n,D=0;8>D;D++)z=1==(z& 1)?3988292384^z>>>1:z>>>1,Editor.crcTable[n]=z;Editor.updateCRC=function(l,v,H,O){for(var S=0;S<O;S++)l=Editor.crcTable[(l^v.charCodeAt(H+S))&255]^l>>>8;return l};Editor.crc32=function(l){for(var v=-1,H=0;H<l.length;H++)v=v>>>8^Editor.crcTable[(v^l.charCodeAt(H))&255];return(v^-1)>>>0};Editor.writeGraphModelToPng=function(l,v,H,O,S){function V(oa,fa){var qa=ha;ha+=fa;return oa.substring(qa,ha)}function Z(oa){oa=V(oa,4);return oa.charCodeAt(3)+(oa.charCodeAt(2)<<8)+(oa.charCodeAt(1)<<16)+(oa.charCodeAt(0)<< 24)}function ba(oa){return String.fromCharCode(oa>>24&255,oa>>16&255,oa>>8&255,oa&255)}l=l.substring(l.indexOf(",")+1);l=window.atob?atob(l):Base64.decode(l,!0);var ha=0;if(V(l,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=S&&S();else if(V(l,4),"IHDR"!=V(l,4))null!=S&&S();else{V(l,17);S=l.substring(0,ha);do{var na=Z(l);if("IDAT"==V(l,4)){S=l.substring(0,ha-8);"pHYs"==v&&"dpi"==H?(H=Math.round(O/.0254),H=ba(H)+ba(H)+String.fromCharCode(1)):H=H+String.fromCharCode(0)+("zTXt"== v?String.fromCharCode(0):"")+O;O=4294967295;O=Editor.updateCRC(O,v,0,4);O=Editor.updateCRC(O,H,0,H.length);S+=ba(H.length)+v+H+ba(O^4294967295);S+=l.substring(ha-8,l.length);break}S+=l.substring(ha-8,ha-4+na);V(l,na);V(l,4)}while(na);return"data:image/png;base64,"+(window.btoa?btoa(S):Base64.encode(S,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var N=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(l,v){N.apply(this, arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var F=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){F.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(l,v,H){var O=null;if(null!=H)return null;null!=l.editor.graph.getModel().getParent(v)?O=v.getId():null!=l.currentPage&&(O=l.currentPage.getId());return O}); if(null!=window.StyleFormatPanel){var P=Format.prototype.init;Format.prototype.init=function(){P.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var T=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?T.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(l){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme|| "min"==Editor.currentTheme};var c=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(l){l=c.apply(this,arguments);var v=this.editorUi,H=v.editor.graph;if(H.isEnabled()){var O=v.getCurrentFile();null!=O&&O.isAutosaveOptional()&&l.appendChild(this.createOption(mxResources.get("autosave"),function(){return v.editor.autosave},function(V){v.editor.setAutosave(V);v.editor.autosave&&O.isModified()&&O.fileChanged()},{install:function(V){this.listener=function(){V(v.editor.autosave)}; v.editor.addListener("autosaveChanged",this.listener)},destroy:function(){v.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&H.isEnabled()&&"undefined"!==typeof MathJax){var S=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return H.mathEnabled},function(V){v.actions.get("mathematicalTypesetting").funct()},{install:function(V){this.listener=function(){V(H.mathEnabled)};v.addListener("mathEnabledChanged",this.listener)},destroy:function(){v.removeListener(this.listener)}}); l.appendChild(S);(!v.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&S.appendChild(v.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return l};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"footerColor", dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(l,v){return 0<mxUtils.getValue(l.style,"footerSize",0)}}];mxCellRenderer.defaultShapes.ellipse.prototype.customProperties=[{name:"centerRadius",dispName:"Center Radius",type:"float",min:0,defVal:0},{name:"centerColor",dispName:"Center Color",type:"color",defVal:null,primary:!0,isVisible:function(l,v){return 0<mxUtils.getValue(l.style,"centerRadius",0)}}];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(l){return"0"==mxUtils.getValue(l.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:20,isVisible:function(l){return"1"==mxUtils.getValue(l.style, "fixedSize","0")}}];mxCellRenderer.defaultShapes.hexagon.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.25,isVisible:function(l){return"0"==mxUtils.getValue(l.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:25,isVisible:function(l){return"1"==mxUtils.getValue(l.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},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!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},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.cylinder.prototype.customProperties=[{name:"boundedLbl", dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.cylinder3.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.umlState.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];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},{name:"boundedLbl",dispName:"Bounded Label",type:"bool", defVal:!1}];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.note2.prototype.customProperties=[{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];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.wedgeCallout.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"tipX",dispName:"Tip X",type:"float",min:-100,max:100,defVal:-.25},{name:"tipY",dispName:"Tip Y",type:"float",min:-100,max:100,defVal:1},{name:"base",dispName:"Callout Width",type:"float",min:0,defVal:20}];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"}]},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];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:"footerSize", dispName:"Footer Size",type:"float",min:0,defVal:0},{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},{name:"fixedHeader",dispName:"Fixed Header",type:"bool",defVal:!0,getDefaultValue:function(l,v){l=mxCellRenderer.defaultShapes[mxUtils.getValue(l.style,"shape","")];return null!= l&&null!=l.prototype.fixedHeaderDefault?l.prototype.fixedHeaderDefault?"1":"0":"1"}}];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},{name:"footerSize",dispName:"Footer Size",type:"float",min:0,defVal:0},{name:"footerColor",dispName:"Footer Color",type:"color",defVal:null,primary:!0,isVisible:function(l,v){return 0<mxUtils.getValue(l.style,"footerSize",0)}}];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},{name:"boundedLbl",dispName:"Bounded Label",type:"bool",defVal:!1}];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},{name:"lifelineMirror",dispName:"Mirror Head",type:"bool",defVal:!1}];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 f=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var l=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&0<l.cells.length&& this.container.appendChild(this.addStyles(this.createPanel()));f.apply(this,arguments);null!=l.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),l.customProperties,l))};var k=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(l){var v=this.editorUi.getSelectionState();1==v.cells.length?this.addActions(l,["copyStyle","pasteStyle"]):1<=v.cells.length&&this.addActions(l,["pasteStyle","pasteData"]);k.apply(this,arguments);return l}; EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(l,v,H,O){function S(Oa,Fa,za,Ja,Ha){if(null!=za.valueChanged)za.valueChanged(Fa,Ha,H,fa);else{qa.getModel().beginUpdate();try{Ha=[];var Sa=[];if(null!=za.index){for(var ab=[],Va=za.parentRow.nextSibling;Va&&Va.getAttribute("data-pName")==Oa;)ab.push(Va.getAttribute("data-pValue")),Va=Va.nextSibling;za.index<ab.length?null!=Ja?ab.splice(Ja,1):ab[za.index]=Fa:ab.push(Fa);null!=za.size&&ab.length>za.size&&(ab= ab.slice(0,za.size));Fa=ab.join(",");null!=za.countProperty&&(qa.setCellStyles(za.countProperty,ab.length,qa.getSelectionCells()),Ha.push(za.countProperty),Sa.push(ab.length))}qa.setCellStyles(Oa,Fa,qa.getSelectionCells());Ha.push(Oa);Sa.push(Fa);if(null!=za.dependentProps)for(Oa=0;Oa<za.dependentProps.length;Oa++){var db=za.dependentPropsDefVal[Oa],Ea=za.dependentPropsVals[Oa];if(Ea.length>Fa)Ea=Ea.slice(0,Fa);else for(var Za=Ea.length;Za<Fa;Za++)Ea.push(db);Ea=Ea.join(",");qa.setCellStyles(za.dependentProps[Oa], Ea,qa.getSelectionCells());Ha.push(za.dependentProps[Oa]);Sa.push(Ea)}if("function"==typeof za.onChange)za.onChange(qa,Fa);fa.editorUi.fireEvent(new mxEventObject("styleChanged","keys",Ha,"values",Sa,"cells",qa.getSelectionCells()))}finally{qa.getModel().endUpdate()}}}function V(Oa,Fa){Fa.style.left="0px";Fa.style.top="0px";Fa.style.position="relative";Fa.style.right="0px";Fa.style.bottom="0px";Fa.style.width="100%";Fa.style.maxWidth="100%";Fa.style.maxHeight="100%";Fa.style.textAlign="left"}function Z(Oa, Fa,za){function Ja(Sa){if(null==Sa||Sa==mxConstants.NONE)Ha.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==Sa)Ha.style.background="";else{var ab=mxUtils.getLightDarkColor(Sa);mxUtils.isLightDarkColor(Sa)&&ab.light!=ab.dark?Ha.style.background="linear-gradient(to right bottom, "+ab.cssText+" 50%, "+mxUtils.invertLightDarkColor(ab).cssText+" 50.3%)":Ha.style.background=Sa}}var Ha=document.createElement("div");Ha.style.width="32px";Ha.style.height="8px";Ha.style.margin= "2px";Ha.style.borderStyle="solid";Ha.style.borderWidth="1px";Ja(Fa);btn=mxUtils.button("",mxUtils.bind(fa,function(Sa){this.editorUi.pickColor(Fa,function(ab){S(Oa,ab,za);Ja(ab)});mxEvent.consume(Sa)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(Ha);return btn}function ba(Oa,Fa,za,Ja,Ha,Sa,ab){null!=Fa&&(Fa=Fa.split(","),ya.push({name:Oa,values:Fa,type:za,defVal:Ja,countProperty:Ha,parentRow:Sa,isDeletable:!0, flipBkg:ab}));btn=mxUtils.button("+",mxUtils.bind(fa,function(Va){for(var db=Sa,Ea=0;null!=db.nextSibling;)if(db.nextSibling.getAttribute("data-pName")==Oa)db=db.nextSibling,Ea++;else break;var Za={type:za,parentRow:Sa,index:Ea,isDeletable:!0,defVal:Ja,countProperty:Ha};Ea=oa(Oa,"",Za,0==Ea%2,ab);S(Oa,Ja,Za);db.parentNode.insertBefore(Ea,db.nextSibling);mxEvent.consume(Va)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function ha(Oa,Fa,za,Ja,Ha,Sa,ab){if(0< Ha){var Va=Array(Ha);Fa=null!=Fa?Fa.split(","):[];for(var db=0;db<Ha;db++)Va[db]=null!=Fa[db]?Fa[db]:null!=Ja?Ja:"";ya.push({name:Oa,values:Va,type:za,defVal:Ja,parentRow:Sa,flipBkg:ab,size:Ha})}return document.createElement("div")}function na(Oa,Fa,za){var Ja=document.createElement("input");Ja.type="checkbox";Ja.checked="1"==Fa;mxEvent.addListener(Ja,"change",function(){S(Oa,Ja.checked?"1":"0",za,null,Ja)});return Ja}function oa(Oa,Fa,za,Ja,Ha){var Sa=za.dispName,ab=za.type,Va=document.createElement("tr"); Va.className="gePropRow"+(Ha?"Dark":"")+(Ja?"Alt":"")+" gePropNonHeaderRow";Va.setAttribute("data-pName",Oa);Va.setAttribute("data-pValue",Fa);Ja=!1;null!=za.index&&(Va.setAttribute("data-index",za.index),Sa=(null!=Sa?Sa:"")+"["+za.index+"]",Ja=!0);var db=document.createElement("td");db.className="gePropRowCell";Sa=mxResources.get(Sa,null,Sa);mxUtils.write(db,Sa);db.setAttribute("title",Sa);Ja&&(db.style.textAlign="right");Va.appendChild(db);db=document.createElement("td");db.className="gePropRowCell"; db.setAttribute("title",null!=Fa?mxUtils.safeDecodeURIComponent(Fa):mxResources.get("none"));mxEvent.addListener(db,"click",mxUtils.bind(fa,function($a){!mxUtils.isAncestorNode(Va,document.activeElement)&&mxUtils.isAncestorNode(Va.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume($a))}));if("color"==ab)db.appendChild(Z(Oa,Fa,za));else if("bool"==ab||"boolean"==ab)db.appendChild(na(Oa,Fa,za));else if("enum"== ab){var Ea=za.enumList;db.innerHTML="";var Za=document.createElement("div");Za.className="gePropValue";db.appendChild(Za);for(Ha=0;Ha<Ea.length;Ha++)if(Sa=Ea[Ha],Sa.val==Fa){mxUtils.write(Za,mxResources.get(Sa.dispName,null,Sa.dispName));break}mxEvent.addListener(db,"click",mxUtils.bind(fa,function($a){var gb=mxEvent.getSource($a);if(!(gb!=db&&gb!=Za||mxEvent.isConsumed($a))){Za.innerHTML="";var ob=document.createElement("select"),vb=null;V(db,ob);ob.style.boxSizing="border-box";ob.style.height="100%"; ob.style.padding="0";ob.style.margin="0";ob.style.border="0";for($a=0;$a<Ea.length;$a++){gb=Ea[$a];var rb=document.createElement("option");rb.value=mxUtils.htmlEntities(gb.val);mxUtils.write(rb,mxResources.get(gb.dispName,null,gb.dispName));ob.appendChild(rb);null==gb.val&&(rb.value="null",vb=rb)}ob.value=null==Fa&&null!=vb?"null":Fa;Za.appendChild(ob);mxEvent.addListener(ob,"change",function(){var wb=mxUtils.htmlEntities(ob.value);if(ob[ob.selectedIndex]==vb||"null"==wb.value)wb=null;S(Oa,wb,za)}); ob.focus();mxEvent.addListener(ob,"blur",function(){Za.innerHTML="";for(var wb=ob[ob.selectedIndex]==vb||"null"==ob.value?null:ob.value,Ib=0;Ib<Ea.length;Ib++){var Fb=Ea[Ib];if(Fb.val==wb){mxUtils.write(Za,mxResources.get(Fb.dispName,null,Fb.dispName));break}}})}}))}else if("dynamicArr"==ab)db.appendChild(ba(Oa,Fa,za.subType,za.subDefVal,za.countProperty,Va,Ha));else if("staticArr"==ab)db.appendChild(ha(Oa,Fa,za.subType,za.subDefVal,za.size,Va,Ha));else if("readOnly"==ab)Ha=document.createElement("input"), Ha.setAttribute("readonly",""),Ha.value=Fa,Ha.style.borderWidth="0px","id"==Oa||"shape"==Oa?(Va.firstChild.innerHTML="",Va.firstChild.setAttribute("colspan","2"),Ha.style.flexGrow="1",Ha.style.marginLeft="4px",Ha.style.textAlign="id"==Oa?"center":"left",Ha.setAttribute("title",Fa),Sa=document.createElement("div"),mxUtils.write(Sa,mxResources.get(Oa)+":"),Sa.style.display="inline-flex",Sa.style.alignItems="center",Sa.style.width="100%",Sa.appendChild(Ha),Va.firstChild.appendChild(Sa)):(Ha.style.width= "96px",db.appendChild(Ha));else{db.innerHTML="";var cb=document.createElement("div");cb.className="gePropValue";db.appendChild(cb);cb.innerHTML=mxUtils.htmlEntities(mxUtils.safeDecodeURIComponent(Fa));mxEvent.addListener(db,"click",mxUtils.bind(fa,function($a){function gb(){var rb=vb.value,wb=ab;rb=0==rb.trim().length&&"string"!=wb&&"numbers"!=wb?za.allowAuto?"auto":0:rb;za.allowAuto&&(null!=rb.trim&&"auto"==rb.trim().toLowerCase()?(rb="auto",wb="string"):(rb=parseFloat(rb),rb=isNaN(rb)?0:rb));null!= za.min&&rb<za.min?rb=za.min:null!=za.max&&rb>za.max&&(rb=za.max);var Ib=null;try{Ib="numbers"==wb?rb.match(/\d*\.?\d+/g).map(Number).join(" "):"auto"===rb&&za.allowAuto&&"auto"==za.defVal?null:encodeURIComponent(("int"==wb?parseInt(rb):rb)+"")}catch(Fb){}S(Oa,Ib,za,null,vb)}var ob=mxEvent.getSource($a);if(!(ob!=db&&ob!=cb||mxEvent.isConsumed($a))){cb.innerHTML="";var vb=document.createElement("input");V(cb,vb);vb.value=mxUtils.safeDecodeURIComponent(Fa);vb.className="gePropEditor";"int"!=ab&&"float"!= ab||za.allowAuto||(vb.type="number",vb.step="int"==ab?"1":"any",null!=za.min&&(vb.min=parseFloat(za.min)),null!=za.max&&(vb.max=parseFloat(za.max)));cb.appendChild(vb);mxEvent.addListener(vb,"keypress",function(rb){13==rb.keyCode&&gb()});vb.focus();mxEvent.addListener(vb,"blur",function(){gb()})}}))}za.isDeletable&&(Ha=mxUtils.button("-",mxUtils.bind(fa,function($a){S(Oa,"",za,za.index);mxEvent.consume($a)})),Ha.style.height="16px",Ha.style.width="25px",Ha.style.float="right",Ha.className="geColorBtn", db.appendChild(Ha));Va.appendChild(db);return Va}var fa=this,qa=this.editorUi.editor.graph,ya=[],ta=document.createElement("table");ta.className="geProperties geFullWidthElement";var Ca=document.createElement("tr");Ca.className="gePropHeader";var la=document.createElement("th");la.className="gePropHeaderCell";la.style.paddingLeft="16px";la.style.backgroundRepeat="no-repeat";la.style.backgroundPosition="-2px 50%";la.style.backgroundSize="20px";mxUtils.write(la,mxResources.get("property"));Ca.style.cursor= "pointer";var ra=function(){var Oa=ta.querySelectorAll(".gePropNonHeaderRow");if(fa.editorUi.propertiesCollapsed){la.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var Fa="none";for(var za=l.childNodes.length-1;0<=za;za--)try{var Ja=l.childNodes[za],Ha=Ja.nodeName.toUpperCase();"INPUT"!=Ha&&"SELECT"!=Ha||l.removeChild(Ja)}catch(Sa){}}else la.style.backgroundImage="url('"+Editor.arrowDownImage+"')",Fa="";for(za=0;za<Oa.length;za++)Oa[za].style.display=Fa};mxEvent.addListener(Ca,"click", function(){fa.editorUi.propertiesCollapsed=!fa.editorUi.propertiesCollapsed;ra()});Ca.appendChild(la);var va=document.createElement("th");va.className="gePropHeaderCell";va.style.paddingLeft="4px";mxUtils.write(va,mxResources.get("value"));Ca.appendChild(va);ta.appendChild(Ca);var Ia=va=!1;Ca=null;1==H.vertices.length&&0==H.edges.length?Ca=H.vertices[0].id:0==H.vertices.length&&1==H.edges.length&&(Ca=H.edges[0].id);null==Ca||O||(ta.appendChild(oa("id",mxUtils.htmlEntities(Ca),{dispName:"id",type:"readOnly"}, !0,!1)),null!=H.style&&null!=H.style.shape&&ta.appendChild(oa("shape",mxUtils.htmlEntities(H.style.shape),{dispName:"shape",type:"readOnly"},!0,!1)));for(var La in v)if(O=v[La],("function"!=typeof O.isVisible||O.isVisible(H,this))&&!O.primary){var Ga=null!=O.getValue?O.getValue(H,this):null!=H.style[La]?mxUtils.htmlEntities(H.style[La]+""):null!=O.getDefaultValue?O.getDefaultValue(H,this):O.defVal;if("separator"==O.type)Ia=!Ia;else{if("staticArr"==O.type)O.size=parseInt(H.style[O.sizeProperty]||v[O.sizeProperty].defVal)|| 0;else if(null!=O.dependentProps){var Da=O.dependentProps,Pa=[],Ka=[];for(Ca=0;Ca<Da.length;Ca++)if(null!=v[Da[Ca]]){var Na=H.style[Da[Ca]];Ka.push(v[Da[Ca]].subDefVal);Pa.push(null!=Na?Na.split(","):[])}O.dependentPropsDefVal=Ka;O.dependentPropsVals=Pa}ta.appendChild(oa(La,Ga,O,va,Ia));va=!va}}for(Ca=0;Ca<ya.length;Ca++)for(O=ya[Ca],v=O.parentRow,La=0;La<O.values.length;La++)va=oa(O.name,O.values[La],{type:O.type,parentRow:O.parentRow,isDeletable:O.isDeletable,index:La,defVal:O.defVal,countProperty:O.countProperty, size:O.size},0==La%2,O.flipBkg),v.parentNode.insertBefore(va,v.nextSibling),v=va;l.appendChild(ta);ra();return l};StyleFormatPanel.prototype.addStyles=function(l){if(null!=this.defaultColorSchemes){var v=this.editorUi,H=v.editor.graph,O=document.createElement("div");O.style.padding="6px 20px 0 24px";l.appendChild(O);var S=document.createElement("div");S.className="geSwitcher";S.style.padding="4px 18px 6px 0px";for(var V=[],Z=0;Z<this.defaultColorSchemes.length;Z++){var ba=document.createElement("div"); ba.className="geSwitcherDot";mxUtils.bind(this,function(qa){mxEvent.addListener(ba,"click",mxUtils.bind(this,function(){ha(qa)}))})(Z);V.push(ba);S.appendChild(ba)}var ha=mxUtils.bind(this,function(qa){null!=V[qa]&&(null!=this.format.currentScheme&&null!=V[this.format.currentScheme]&&(V[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=qa,na(this.defaultColorSchemes[this.format.currentScheme]),V[this.format.currentScheme].style.background="#84d7ff")}),na=mxUtils.bind(this, function(qa){var ya=mxUtils.clone(H.defaultVertexStyle);ya[mxConstants.STYLE_STROKECOLOR]=null!=ya[mxConstants.STYLE_STROKECOLOR]?ya[mxConstants.STYLE_STROKECOLOR]:"default";ya[mxConstants.STYLE_FILLCOLOR]=null!=ya[mxConstants.STYLE_FILLCOLOR]?ya[mxConstants.STYLE_FILLCOLOR]:"default";ya[mxConstants.STYLE_FONTCOLOR]=null!=ya[mxConstants.STYLE_FONTCOLOR]?ya[mxConstants.STYLE_FONTCOLOR]:"default";H.replaceDefaultColors(new mxCell,ya);var ta=mxUtils.bind(this,function(la){var ra=mxUtils.button("",mxUtils.bind(this, function(La){H.getModel().beginUpdate();try{for(var Ga=v.getSelectionState().cells,Da=H.getModel(),Pa=[],Ka=0<Ga.length,Na=0;Na<Ga.length;Na++){var Oa=Da.isVertex(Ga[Na])&&Da.isEdge(Da.getParent(Ga[Na])),Fa=H.getCellStyle(Ga[Na]),za=null!=Fa&&"image"==Fa.shape,Ja=H.getCellGeometry(Ga[Na]);Pa.push({isLabel:za||Oa&&(null==Ja||0>=Ja.width||0>=Ja.height)});Oa||za||(Ka=!1)}for(Na=0;Na<Ga.length;Na++){var Ha=Pa[Na];if(Ka||!Ha.isLabel){var Sa=Ha.isLabel?mxConstants.STYLE_LABEL_BACKGROUNDCOLOR:mxConstants.STYLE_FILLCOLOR, ab=Ha.isLabel?mxConstants.STYLE_LABEL_BORDERCOLOR:mxConstants.STYLE_STROKECOLOR,Va=Da.getStyle(Ga[Na]);null!=Va&&"string"!==typeof Va&&(Va=String(Va));null!=la?(mxEvent.isShiftDown(La)||(Va=""==la.fill||null==la.fill?mxUtils.setStyle(Va,Sa,null):mxUtils.setStyle(Va,Sa,la.fill),Ha.isLabel||(Va=""==la.gradient||null==la.gradient?mxUtils.setStyle(Va,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(Va,mxConstants.STYLE_GRADIENTCOLOR,la.gradient)),mxEvent.isControlDown(La)||mxClient.IS_MAC&&mxEvent.isMetaDown(La)|| !Da.isVertex(Ga[Na])||(Va=""==la.font||null==la.font?mxUtils.setStyle(Va,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(Va,mxConstants.STYLE_FONTCOLOR,la.font))),mxEvent.isAltDown(La)||(Va=""==la.stroke||null==la.stroke?mxUtils.setStyle(Va,ab,null):mxUtils.setStyle(Va,ab,la.stroke))):(Va=mxUtils.setStyle(Va,Sa,null),Va=mxUtils.setStyle(Va,ab,null),Ha.isLabel||(Va=mxUtils.setStyle(Va,mxConstants.STYLE_GRADIENTCOLOR,null)),Da.isVertex(Ga[Na])&&(Va=mxUtils.setStyle(Va,mxConstants.STYLE_FONTCOLOR, null)));Da.setStyle(Ga[Na],Va)}}}finally{H.getModel().endUpdate()}}));ra.className="geStyleButton";ra.style.width="36px";ra.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";ra.style.margin="0px 6px 6px 0px";if(null!=la){var va="1px solid";null!=la.border&&(va=la.border);if(null!=la.gradient)ra.style.backgroundImage="linear-gradient("+mxUtils.getLightDarkColor(la.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(la.gradient).cssText+" 100%)";else if(la.fill==mxConstants.NONE)ra.style.background= "url('"+Dialog.prototype.noColorImage+"')";else if(null==la.fill||""==la.fill)ra.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(ya,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var Ia=mxUtils.getLightDarkColor(la.fill);ra.style.backgroundImage="linear-gradient(to right bottom, "+Ia.cssText+" 50%, "+Ia.light+" 50.3%)"}null==la.stroke||la.stroke==mxConstants.NONE?ra.style.border=va+" transparent":""==la.stroke?ra.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(ya, mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(Ia=mxUtils.getLightDarkColor(la.stroke),ra.style.border=va+" "+Ia.cssText,ra.style.borderRightColor=Ia.light,ra.style.borderBottomColor=ra.style.borderRightColor);null!=la.title&&ra.setAttribute("title",la.title)}else va=mxUtils.getValue(ya,mxConstants.STYLE_FILLCOLOR,"#ffffff"),Ia=mxUtils.getValue(ya,mxConstants.STYLE_STROKECOLOR,"#000000"),ra.style.backgroundColor=va,ra.style.border="1px solid "+Ia;ra.style.borderRadius="0";O.appendChild(ra);null!= la&&null!=la.gradient&&(va=ra.cloneNode(!1),va.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(la.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(la.gradient).light+") 100%)",va.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",va.style.backgroundColor="transparent",O.appendChild(va),va.style.marginLeft="-42px",mxEvent.addListener(va,"click",function(){ra.click()}))});O.innerText="";if(null!=qa)for(var Ca=0;Ca<qa.length;Ca++)0<Ca&& 0==mxUtils.mod(Ca,4)&&mxUtils.br(O),ta(qa[Ca])});null==this.format.currentScheme?ha(Math.min(V.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):ha(this.format.currentScheme);Z=10>=this.defaultColorSchemes.length?43:23;var oa=document.createElement("div");oa.className="geButton";oa.style.cssText="position:absolute;left:0px;bottom:"+Z+"px;width:20px;background-image:url("+Editor.chevronLeftImage+");";mxEvent.addListener(oa,"click",mxUtils.bind(this,function(){ha(mxUtils.mod(this.format.currentScheme- 1,this.defaultColorSchemes.length))}));var fa=document.createElement("div");fa.className="geButton";fa.style.cssText="position:absolute;left:186px;bottom:"+Z+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(l.appendChild(oa),l.appendChild(fa));mxEvent.addListener(fa,"click",mxUtils.bind(this,function(){ha(mxUtils.mod(this.format.currentScheme+1,this.defaultColorSchemes.length))}));na(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&& l.appendChild(S)}return l}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements=Object.create(null);Graph.isGoogleFontUrl=function(l){return l.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||l.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(l){return Graph.isGoogleFontUrl(l)}; Graph.rewriteGoogleFontUrl=function(l){null!=l&&l.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(l=Editor.GOOGLE_FONTS_CSS2+l.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return l};Graph.escapeCssString=function(l){return null!=l?String(l).replace(/[\x00-\x1f\x7f"\\]/g,function(v){return"\\"+v.charCodeAt(0).toString(16)+" "}):l};Graph.createFontElement=function(l,v){var H=Graph.fontMapping[v];null==H&&Graph.isCssFontUrl(v)?(l=document.createElement("link"),l.setAttribute("rel", "stylesheet"),l.setAttribute("type","text/css"),l.setAttribute("charset","UTF-8"),l.setAttribute("href",Graph.rewriteGoogleFontUrl(v))):(null==H&&(H='@font-face {\nfont-family: "'+Graph.escapeCssString(l)+'";\nsrc: url("'+Graph.escapeCssString(v)+'");\n}'),l=document.createElement("style"),mxUtils.write(l,H));return l};Graph.addRecentCustomFont=function(l,v){};Graph.addFont=function(l,v,H,O){if(null!=l&&0<l.length&&null!=v&&0<v.length){O=null!=O?O:Graph.customFontElements;var S=l.toLowerCase();if("helvetica"!= S&&"arial"!=l&&"sans-serif"!=S){var V=O[S];null!=V&&V.url!=v&&(null!=V.elt.parentNode&&V.elt.parentNode.removeChild(V.elt),V=null);null==V?(V=v,"http:"==v.substring(0,5)&&(V=PROXY_URL+"?url="+encodeURIComponent(v)),V={name:l,url:v,elt:Graph.createFontElement(l,V)},O[S]=V,v=O==Graph.customFontElements?document.getElementsByTagName("head")[0]:null,null!=H&&("link"==V.elt.nodeName.toLowerCase()?(V.elt.onload=H,V.elt.onerror=H):H()),null!=v&&v.appendChild(V.elt)):null!=H&&H()}else null!=H&&H()}else null!= H&&H();return l};Graph.getFontUrl=function(l,v){l=Graph.customFontElements[l.toLowerCase()];null!=l&&(v=l.url);return v};Graph.processFontAttributes=function(l){l=l.getElementsByTagName("*");for(var v=0;v<l.length;v++){var H=l[v].getAttribute("data-font-src");if(null!=H){var O="FONT"==l[v].nodeName.toUpperCase()?l[v].getAttribute("face"):l[v].style.fontFamily;null!=O&&Graph.addFont(O,H)}}};Graph.processFontStyle=function(l){if(null!=l){var v=mxUtils.getValue(l,"fontSource",null);if(null!=v){var H= mxUtils.getValue(l,mxConstants.STYLE_FONTFAMILY,null);if(null!=H)try{Graph.addFont(H,decodeURIComponent(v))}catch(O){}}}return l};Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;mxConnectionHandler.prototype.createTarget="1"==urlParams.sketch;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 q=Graph.prototype.init;Graph.prototype.init=function(){function l(S){v=S}q.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var v=null;mxEvent.addListener(this.container,"mouseenter",l);mxEvent.addListener(this.container,"mousemove",l);mxEvent.addListener(this.container,"mouseleave",function(S){v=null});this.isMouseInsertPoint=function(){return null!= v};var H=this.getInsertPoint;this.getInsertPoint=function(S){return null==v||S?H.apply(this,arguments):this.getPointForEvent(v)};var O=this.layoutManager.getLayout;this.layoutManager.getLayout=function(S){var V=this.graph.getCellStyle(S);if(null!=V&&"rack"==V.childLayout){var Z=new mxStackLayout(this.graph,!1);Z.gridSize=null!=V.rackUnitSize?parseFloat(V.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;Z.marginLeft=V.marginLeft||0;Z.marginRight=V.marginRight||0;Z.marginTop= V.marginTop||0;Z.marginBottom=V.marginBottom||0;Z.allowGaps=V.allowGaps||0;Z.horizontal="1"==mxUtils.getValue(V,"horizontalRack","0");Z.resizeParent=!1;Z.fill=!0;return Z}return O.apply(this,arguments)};this.updateGlobalUrlVariables()};var y=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(l,v){return Graph.processFontStyle(y.apply(this,arguments))};var A=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(l,v,H,O,S,V,Z,ba,ha, na,oa,fa){A.apply(this,arguments);Graph.processFontAttributes(fa)};var E=mxText.prototype.redraw;mxText.prototype.redraw=function(){E.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(l,v,H,O){function S(){for(var Ca=ba.getSelectionCells(),la=[],ra=0;ra<Ca.length;ra++)ba.isCellVisible(Ca[ra])&&la.push(Ca[ra]);ba.setSelectionCells(la)}function V(Ca){ba.setHiddenTags(Ca?[]:ha.slice());S();ba.refresh()} function Z(Ca,la){oa.innerText="";if(0<Ca.length){var ra=document.createElement("table");ra.setAttribute("cellpadding","2");ra.style.boxSizing="border-box";ra.style.tableLayout="fixed";ra.style.width="100%";var va=document.createElement("tbody");if(null!=Ca&&0<Ca.length)for(var Ia=0;Ia<Ca.length;Ia++)(function(La){function Ga(){var Fa=ba.getCellsForTags([La],null,null,!0);ba.isEnabled()?ba.setSelectionCells(Fa):ba.highlightCells(Fa,null,null,70)}var Da=0>mxUtils.indexOf(ba.hiddenTags,La),Pa=document.createElement("tr"), Ka=document.createElement("td");Ka.style.align="center";Ka.style.width="16px";var Na=document.createElement("img");Na.setAttribute("src",Da?Editor.visibleImage:Editor.hiddenImage);Na.setAttribute("title",mxResources.get(Da?"hideIt":"show",[La])+"\n"+mxResources.get("shiftClickShowOnly",[La]));mxUtils.setOpacity(Na,Da?75:25);Na.className="geAdaptiveAsset";Na.style.verticalAlign="middle";Na.style.cursor="pointer";Na.style.width="16px";if(v||Editor.isDarkMode())Na.style.filter="invert(100%)";Ka.appendChild(Na); mxEvent.addListener(Na,"click",function(Fa){if(mxEvent.isShiftDown(Fa)){for(var za=[],Ja=0;Ja<ha.length;Ja++)ha[Ja]!==La&&za.push(ha[Ja]);var Ha=0<za.length;for(Ja=0;Ja<za.length;Ja++)if(0>mxUtils.indexOf(ba.hiddenTags,za[Ja])){Ha=!1;break}Ha&&0>mxUtils.indexOf(ba.hiddenTags,La)?ba.setHiddenTags([]):ba.setHiddenTags(za)}else ba.toggleHiddenTag(La);S();ba.refresh();mxEvent.consume(Fa)});Pa.appendChild(Ka);Ka=document.createElement("td");Ka.style.align="center";Ka.style.width="16px";Na=document.createElement("img"); Na.setAttribute("src",Editor.selectImage);Na.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Na,Da?75:25);Na.className="geAdaptiveAsset";Na.style.verticalAlign="middle";Na.style.cursor="pointer";Na.style.width="16px";if(v||Editor.isDarkMode())Na.style.filter="invert(100%)";mxEvent.addListener(Na,"click",function(Fa){V(!0);Ga();mxEvent.consume(Fa)});Ka.appendChild(Na);Pa.appendChild(Ka);Ka=document.createElement("td");Ka.style.overflow="hidden";Ka.style.whiteSpace="nowrap";Ka.style.textOverflow= "ellipsis";Ka.style.verticalAlign="middle";Ka.style.cursor="pointer";Ka.setAttribute("title",La);a=document.createElement("a");mxUtils.write(a,La);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,Da?100:40);Ka.appendChild(a);mxEvent.addListener(Ka,"click",function(Fa){if(mxEvent.isShiftDown(Fa))V(!0),Ga();else if(Da&&0<ba.hiddenTags.length)V(!0);else{var za=ha.slice(),Ja=mxUtils.indexOf(za,La);za.splice(Ja,1);ba.setHiddenTags(za);S();ba.refresh()}mxEvent.consume(Fa)}); Pa.appendChild(Ka);if(ba.isEnabled()){Ka=document.createElement("td");Ka.style.verticalAlign="middle";Ka.style.textAlign="center";Ka.style.width="18px";if(null==la){Ka.style.align="center";Ka.style.width="16px";Na=document.createElement("img");Na.setAttribute("src",Editor.trashImage);Na.setAttribute("title",mxResources.get("removeIt",[La]));mxUtils.setOpacity(Na,Da?75:25);Na.className="geAdaptiveAsset";Na.style.verticalAlign="middle";Na.style.cursor="pointer";Na.style.width="16px";if(v||Editor.isDarkMode())Na.style.filter= "invert(100%)";mxEvent.addListener(Na,"click",function(Fa){var za=mxUtils.indexOf(ha,La);0<=za&&ha.splice(za,1);ba.removeTagsForCells(ba.model.getDescendants(ba.model.getRoot()),[La]);ba.refresh();mxEvent.consume(Fa)});Ka.appendChild(Na)}else{var Oa=document.createElement("input");Oa.setAttribute("type","checkbox");Oa.style.margin="0px";Oa.defaultChecked=null!=la&&0<=mxUtils.indexOf(la,La);Oa.checked=Oa.defaultChecked;Oa.style.background="transparent";Oa.setAttribute("title",mxResources.get(Oa.defaultChecked? "removeIt":"add",[La]));mxEvent.addListener(Oa,"change",function(Fa){Oa.checked?ba.addTagsForCells(ba.getSelectionCells(),[La]):ba.removeTagsForCells(ba.getSelectionCells(),[La]);mxEvent.consume(Fa)});Ka.appendChild(Oa)}Pa.appendChild(Ka)}va.appendChild(Pa)})(Ca[Ia]);ra.appendChild(va);oa.appendChild(ra)}}var ba=this,ha=ba.hiddenTags.slice(),na=document.createElement("div");na.style.userSelect="none";na.style.overflow="hidden";na.style.padding="10px";na.style.height="100%";var oa=document.createElement("div"); oa.style.position="absolute";oa.style.boxSizing="border-box";oa.style.userSelect="none";oa.style.overflow="auto";oa.style.padding="3px";oa.style.left="0px";oa.style.right="0px";oa.style.top="0px";oa.style.bottom="0px";na.appendChild(oa);ba.addListener(mxEvent.ROOT,function(){ha=ba.hiddenTags.slice()});var fa=mxUtils.bind(this,function(Ca,la){if(l()){Ca=ba.getAllTags();for(la=0;la<Ca.length;la++)0>mxUtils.indexOf(ha,Ca[la])&&ha.push(Ca[la]);ha.sort();ba.isSelectionEmpty()?Z(ha):Z(ha,ba.getCommonTagsForCells(ba.getSelectionCells()))}}); ba.selectionModel.addListener(mxEvent.CHANGE,fa);ba.model.addListener(mxEvent.CHANGE,fa);ba.addListener(mxEvent.REFRESH,fa);var qa=document.createElement("div");qa.className="geToolbarContainer geDialogToolbar";qa.style.position="absolute";qa.style.display="flex";qa.style.bottom="0px";qa.style.left="0px";qa.style.right="0px";qa.style.height="32px";qa.style.overflow="hidden";qa.style.padding="3px 4px 4px 4px";qa.style.borderWidth="1px 0px 0px 0px";qa.style.borderStyle="solid";qa.style.whiteSpace="nowrap"; if(ba.isEnabled()){oa.style.bottom="32px";var ya=document.createElement("a");ya.className="geButton";var ta=ya.cloneNode(!1);ta.style.backgroundImage="url("+Editor.visibleImage+")";ta.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(ta,"click",function(Ca){ba.setHiddenTags([]);mxEvent.isShiftDown(Ca)||(ha=ba.hiddenTags.slice());S();ba.refresh();mxEvent.consume(Ca)});qa.appendChild(ta);null!=H&&(ya=ya.cloneNode(!1),ya.style.backgroundImage="url("+Editor.plusImage+")",ya.setAttribute("title", mxResources.get("add")),mxEvent.addListener(ya,"click",function(Ca){H(ha,function(la){ha=la;fa()});mxEvent.consume(Ca)}),qa.appendChild(ya));na.appendChild(qa)}null!=O&&qa.appendChild(O);return{div:na,refresh:fa}};Graph.prototype.getCustomFonts=funct