You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4288 lines
2.1 MiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

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/math/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.2.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.5/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()}(this,(function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),s||(s=function(e,t){return new e(...t)});const u=R(Array.prototype.forEach),m=R(Array.prototype.lastIndexOf),p=R(Array.prototype.pop),f=R(Array.prototype.push),d=R(Array.prototype.splice),h=R(String.prototype.toLowerCase),g=R(String.prototype.toString),T=R(String.prototype.match),y=R(String.prototype.replace),E=R(String.prototype.indexOf),A=R(String.prototype.trim),_=R(Object.prototype.hasOwnProperty),S=R(RegExp.prototype.test),b=(N=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(N,t)});var N;function R(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return c(e,t,o)}}function w(e,o){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;t&&t(e,null);let i=o.length;for(;i--;){let t=o[i];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[i]=e),t=e)}e[t]=!0}return e}function O(e){for(let t=0;t<e.length;t++){_(e,t)||(e[t]=null)}return e}function D(t){const n=l(null);for(const[o,r]of e(t)){_(t,o)&&(Array.isArray(r)?n[o]=O(r):r&&"object"==typeof r&&r.constructor===Object?n[o]=D(r):n[o]=r)}return n}function v(e,t){for(;null!==e;){const n=r(e,t);if(n){if(n.get)return R(n.get);if("function"==typeof n.value)return R(n.value)}e=o(e)}return function(){return null}}const L=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),C=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),x=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),M=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),k=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=i(["#text"]),z=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),P=i(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),H=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),W=a(/<%[\w\W]*|[\w\W]*%>/gm),G=a(/\$\{[\w\W]*/gm),Y=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),j=a(/^aria-[\-\w]+$/),X=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=a(/^(?:\w+script|data):/i),$=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var Z=Object.freeze({__proto__:null,ARIA_ATTR:j,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:V,DATA_ATTR:Y,DOCTYPE_NAME:K,ERB_EXPR:W,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:B,TMPLIT_EXPR:G});const J=1,Q=3,ee=7,te=8,ne=9,oe=function(){return"undefined"==typeof window?null:window};var re=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oe();const o=e=>t(e);if(o.version="3.2.5",o.removed=[],!n||!n.document||n.document.nodeType!==ne||!n.Element)return o.isSupported=!1,o;let{document:r}=n;const a=r,c=a.currentScript,{DocumentFragment:s,HTMLTemplateElement:N,Node:R,Element:O,NodeFilter:B,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:G,DOMParser:Y,trustedTypes:j}=n,q=O.prototype,$=v(q,"cloneNode"),V=v(q,"remove"),re=v(q,"nextSibling"),ie=v(q,"childNodes"),ae=v(q,"parentNode");if("function"==typeof N){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let le,ce="";const{implementation:se,createNodeIterator:ue,createDocumentFragment:me,getElementsByTagName:pe}=r,{importNode:fe}=a;let de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};o.isSupported="function"==typeof e&&"function"==typeof ae&&se&&void 0!==se.createHTMLDocument;const{MUSTACHE_EXPR:he,ERB_EXPR:ge,TMPLIT_EXPR:Te,DATA_ATTR:ye,ARIA_ATTR:Ee,IS_SCRIPT_OR_DATA:Ae,ATTR_WHITESPACE:_e,CUSTOM_ELEMENT:Se}=Z;let{IS_ALLOWED_URI:be}=Z,Ne=null;const Re=w({},[...L,...C,...x,...M,...U]);let we=null;const Oe=w({},[...z,...P,...H,...F]);let De=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ve=null,Le=null,Ce=!0,xe=!0,Ie=!1,Me=!0,ke=!1,Ue=!0,ze=!1,Pe=!1,He=!1,Fe=!1,Be=!1,We=!1,Ge=!0,Ye=!1,je=!0,Xe=!1,qe={},$e=null;const Ke=w({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ve=null;const Ze=w({},["audio","video","img","source","image","track"]);let Je=null;const Qe=w({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let ot=nt,rt=!1,it=null;const at=w({},[et,tt,nt],g);let lt=w({},["mi","mo","mn","ms","mtext"]),ct=w({},["annotation-xml"]);const st=w({},["title","style","font","a","script"]);let ut=null;const mt=["application/xhtml+xml","text/html"];let pt=null,ft=null;const dt=r.createElement("form"),ht=function(e){return e instanceof RegExp||e instanceof Function},gt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ft||ft!==e){if(e&&"object"==typeof e||(e={}),e=D(e),ut=-1===mt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,pt="application/xhtml+xml"===ut?g:h,Ne=_(e,"ALLOWED_TAGS")?w({},e.ALLOWED_TAGS,pt):Re,we=_(e,"ALLOWED_ATTR")?w({},e.ALLOWED_ATTR,pt):Oe,it=_(e,"ALLOWED_NAMESPACES")?w({},e.ALLOWED_NAMESPACES,g):at,Je=_(e,"ADD_URI_SAFE_ATTR")?w(D(Qe),e.ADD_URI_SAFE_ATTR,pt):Qe,Ve=_(e,"ADD_DATA_URI_TAGS")?w(D(Ze),e.ADD_DATA_URI_TAGS,pt):Ze,$e=_(e,"FORBID_CONTENTS")?w({},e.FORBID_CONTENTS,pt):Ke,ve=_(e,"FORBID_TAGS")?w({},e.FORBID_TAGS,pt):{},Le=_(e,"FORBID_ATTR")?w({},e.FORBID_ATTR,pt):{},qe=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,xe=!1!==e.ALLOW_DATA_ATTR,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ke=e.SAFE_FOR_TEMPLATES||!1,Ue=!1!==e.SAFE_FOR_XML,ze=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,Be=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ge=!1!==e.SANITIZE_DOM,Ye=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,Xe=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||X,ot=e.NAMESPACE||nt,lt=e.MATHML_TEXT_INTEGRATION_POINTS||lt,ct=e.HTML_INTEGRATION_POINTS||ct,De=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(De.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(De.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(De.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ke&&(xe=!1),Be&&(Fe=!0),qe&&(Ne=w({},U),we=[],!0===qe.html&&(w(Ne,L),w(we,z)),!0===qe.svg&&(w(Ne,C),w(we,P),w(we,F)),!0===qe.svgFilters&&(w(Ne,x),w(we,P),w(we,F)),!0===qe.mathMl&&(w(Ne,M),w(we,H),w(we,F))),e.ADD_TAGS&&(Ne===Re&&(Ne=D(Ne)),w(Ne,e.ADD_TAGS,pt)),e.ADD_ATTR&&(we===Oe&&(we=D(we)),w(we,e.ADD_ATTR,pt)),e.ADD_URI_SAFE_ATTR&&w(Je,e.ADD_URI_SAFE_ATTR,pt),e.FORBID_CONTENTS&&($e===Ke&&($e=D($e)),w($e,e.FORBID_CONTENTS,pt)),je&&(Ne["#text"]=!0),ze&&w(Ne,["html","head","body"]),Ne.table&&(w(Ne,["tbody"]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw b('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');le=e.TRUSTED_TYPES_POLICY,ce=le.createHTML("")}else void 0===le&&(le=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(j,c)),null!==le&&"string"==typeof ce&&(ce=le.createHTML(""));i&&i(e),ft=e}},Tt=w({},[...C,...x,...I]),yt=w({},[...M,...k]),Et=function(e){f(o.removed,{element:e});try{ae(e).removeChild(e)}catch(t){V(e)}},At=function(e,t){try{f(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Fe||Be)try{Et(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},_t=function(e){let t=null,n=null;if(He)e="<remove></remove>"+e;else{const t=T(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ut&&ot===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=le?le.createHTML(e):e;if(ot===nt)try{t=(new Y).parseFromString(o,ut)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(ot,"template",null);try{t.documentElement.innerHTML=rt?ce:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ot===nt?pe.call(t,ze?"html":"body")[0]:ze?t.documentElement:i},St=function(e){return ue.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},bt=function(e){return e instanceof G&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof W)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Nt=function(e){return"function"==typeof R&&e instanceof R};function Rt(e,t,n){u(e,(e=>{e.call(o,t,n,ft)}))}const wt=function(e){let t=null;if(Rt(de.beforeSanitizeElements,e,null),bt(e))return Et(e),!0;const n=pt(e.nodeName);if(Rt(de.uponSanitizeElement,e,{tagName:n,allowedTags:Ne}),e.hasChildNodes()&&!Nt(e.firstElementChild)&&S(/<[/\w!]/g,e.innerHTML)&&S(/<[/\w!]/g,e.textContent))return Et(e),!0;if(e.nodeType===ee)return Et(e),!0;if(Ue&&e.nodeType===te&&S(/<[/\w]/g,e.data))return Et(e),!0;if(!Ne[n]||ve[n]){if(!ve[n]&&Dt(n)){if(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n))return!1;if(De.tagNameCheck instanceof Function&&De.tagNameCheck(n))return!1}if(je&&!$e[n]){const t=ae(e)||e.parentNode,n=ie(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o){const r=$(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,re(e))}}}return Et(e),!0}return e instanceof O&&!function(e){let t=ae(e);t&&t.tagName||(t={namespaceURI:ot,tagName:"template"});const n=h(e.tagName),o=h(t.tagName);return!!it[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===o||lt[o]):Boolean(Tt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&ct[o]:Boolean(yt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!ct[o])&&!(t.namespaceURI===et&&!lt[o])&&!yt[n]&&(st[n]||!Tt[n]):!("application/xhtml+xml"!==ut||!it[e.namespaceURI]))}(e)?(Et(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,e.innerHTML)?(ke&&e.nodeType===Q&&(t=e.textContent,u([he,ge,Te],(e=>{t=y(t,e," ")})),e.textContent!==t&&(f(o.removed,{element:e.cloneNode()}),e.textContent=t)),Rt(de.afterSanitizeElements,e,null),!1):(Et(e),!0)},Ot=function(e,t,n){if(Ge&&("id"===t||"name"===t)&&(n in r||n in dt))return!1;if(xe&&!Le[t]&&S(ye,t));else if(Ce&&S(Ee,t));else if(!we[t]||Le[t]){if(!(Dt(e)&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,e)||De.tagNameCheck instanceof Function&&De.tagNameCheck(e))&&(De.attributeNameCheck instanceof RegExp&&S(De.attributeNameCheck,t)||De.attributeNameCheck instanceof Function&&De.attributeNameCheck(t))||"is"===t&&De.allowCustomizedBuiltInElements&&(De.tagNameCheck instanceof RegExp&&S(De.tagNameCheck,n)||De.tagNameCheck instanceof Function&&De.tagNameCheck(n))))return!1}else if(Je[t]);else if(S(be,y(n,_e,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!Ve[e]){if(Ie&&!S(Ae,y(n,_e,"")));else if(n)return!1}else;return!0},Dt=function(e){return"annotation-xml"!==e&&T(e,Se)},vt=function(e){Rt(de.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||bt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=pt(a);let m="value"===a?c:A(c);if(n.attrName=s,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,Rt(de.uponSanitizeAttribute,e,n),m=n.attrValue,!Ye||"id"!==s&&"name"!==s||(At(a,e),m="user-content-"+m),Ue&&S(/((--!?|])>)|<\/(style|title)/i,m)){At(a,e);continue}if(n.forceKeepAttr)continue;if(At(a,e),!n.keepAttr)continue;if(!Me&&S(/\/>/i,m)){At(a,e);continue}ke&&u([he,ge,Te],(e=>{m=y(m,e," ")}));const f=pt(e.nodeName);if(Ot(f,s,m)){if(le&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(f,s)){case"TrustedHTML":m=le.createHTML(m);break;case"TrustedScriptURL":m=le.createScriptURL(m)}try{l?e.setAttributeNS(l,a,m):e.setAttribute(a,m),bt(e)?Et(e):p(o.removed)}catch(e){}}}Rt(de.afterSanitizeAttributes,e,null)},Lt=function e(t){let n=null;const o=St(t);for(Rt(de.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)Rt(de.uponSanitizeShadowNode,n,null),wt(n),vt(n),n.content instanceof s&&e(n.content);Rt(de.afterSanitizeShadowDOM,t,null)};return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,i=null,l=null;if(rt=!e,rt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Nt(e)){if("function"!=typeof e.toString)throw b("toString is not a function");if("string"!=typeof(e=e.toString()))throw b("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Pe||gt(t),o.removed=[],"string"==typeof e&&(Xe=!1),Xe){if(e.nodeName){const t=pt(e.nodeName);if(!Ne[t]||ve[t])throw b("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof R)n=_t("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),r.nodeType===J&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!Fe&&!ke&&!ze&&-1===e.indexOf("<"))return le&&We?le.createHTML(e):e;if(n=_t(e),!n)return Fe?null:We?ce:""}n&&He&&Et(n.firstChild);const c=St(Xe?e:n);for(;i=c.nextNode();)wt(i),vt(i),i.content instanceof s&&Lt(i.content);if(Xe)return e;if(Fe){if(Be)for(l=me.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(we.shadowroot||we.shadowrootmode)&&(l=fe.call(a,l,!0)),l}let m=ze?n.outerHTML:n.innerHTML;return ze&&Ne["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(K,n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),ke&&u([he,ge,Te],(e=>{m=y(m,e," ")})),le&&We?le.createHTML(m):m},o.setConfig=function(){gt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Pe=!0},o.clearConfig=function(){ft=null,Pe=!1},o.isValidAttribute=function(e,t,n){ft||gt({});const o=pt(e),r=pt(t);return Ot(o,r,n)},o.addHook=function(e,t){"function"==typeof t&&f(de[e],t)},o.removeHook=function(e,t){if(void 0!==t){const n=m(de[e],t);return-1===n?void 0:d(de[e],n,1)[0]}return p(de[e])},o.removeHooks=function(e){de[e]=[]},o.removeAllHooks=function(){de={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},o}();return re}));
/*! pako 2.1.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={})}(this,(function(t){"use strict";function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=256,n=286,i=30,r=15,s=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),o=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=new Array(576);e(d);var _=new Array(60);e(_);var f=new Array(512);e(f);var u=new Array(256);e(u);var c=new Array(29);e(c);var w,m,b,g=new Array(i);function p(t,e,a,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function v(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(g);var k=function(t){return t<256?f[t]:f[256+(t>>>7)]},y=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},x=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,y(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},z=function(t,e,a){x(t,a[2*e],a[2*e+1])},A=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},E=function(t,e,a){var n,i,s=new Array(16),o=0;for(n=1;n<=r;n++)o=o+a[n-1]<<1,s[n]=o;for(i=0;i<=e;i++){var l=t[2*i+1];0!==l&&(t[2*i]=A(s[l]++,l))}},R=function(t){var e;for(e=0;e<n;e++)t.dyn_ltree[2*e]=0;for(e=0;e<i;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},Z=function(t){t.bi_valid>8?y(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},S=function(t,e,a,n){var i=2*e,r=2*a;return t[i]<t[r]||t[i]===t[r]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],i=a<<1;i<=t.heap_len&&(i<t.heap_len&&S(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!S(e,n,t.heap[i],t.depth));)t.heap[a]=t.heap[i],a=i,i<<=1;t.heap[a]=n},D=function(t,e,n){var i,r,l,h,d=0;if(0!==t.sym_next)do{i=255&t.pending_buf[t.sym_buf+d++],i+=(255&t.pending_buf[t.sym_buf+d++])<<8,r=t.pending_buf[t.sym_buf+d++],0===i?z(t,r,e):(l=u[r],z(t,l+a+1,e),0!==(h=s[l])&&(r-=c[l],x(t,r,h)),i--,l=k(i),z(t,l,n),0!==(h=o[l])&&(i-=g[l],x(t,i,h)))}while(d<t.sym_next);z(t,256,e)},T=function(t,e){var a,n,i,s=e.dyn_tree,o=e.stat_desc.static_tree,l=e.stat_desc.has_stree,h=e.stat_desc.elems,d=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<h;a++)0!==s[2*a]?(t.heap[++t.heap_len]=d=a,t.depth[a]=0):s[2*a+1]=0;for(;t.heap_len<2;)s[2*(i=t.heap[++t.heap_len]=d<2?++d:0)]=1,t.depth[i]=0,t.opt_len--,l&&(t.static_len-=o[2*i+1]);for(e.max_code=d,a=t.heap_len>>1;a>=1;a--)U(t,s,a);i=h;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,s[2*i]=s[2*a]+s[2*n],t.depth[i]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,s[2*a+1]=s[2*n+1]=i,t.heap[1]=i++,U(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,i,s,o,l,h=e.dyn_tree,d=e.max_code,_=e.stat_desc.static_tree,f=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,w=e.stat_desc.max_length,m=0;for(s=0;s<=r;s++)t.bl_count[s]=0;for(h[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=h[2*h[2*(n=t.heap[a])+1]+1]+1)>w&&(s=w,m++),h[2*n+1]=s,n>d||(t.bl_count[s]++,o=0,n>=c&&(o=u[n-c]),l=h[2*n],t.opt_len+=l*(s+o),f&&(t.static_len+=l*(_[2*n+1]+o)));if(0!==m){do{for(s=w-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[w]--,m-=2}while(m>0);for(s=w;0!==s;s--)for(n=t.bl_count[s];0!==n;)(i=t.heap[--a])>d||(h[2*i+1]!==s&&(t.opt_len+=(s-h[2*i+1])*h[2*i],h[2*i+1]=s),n--)}}(t,e),E(s,d,t.bl_count)},O=function(t,e,a){var n,i,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)i=s,s=e[2*(n+1)+1],++o<l&&i===s||(o<h?t.bl_tree[2*i]+=o:0!==i?(i!==r&&t.bl_tree[2*i]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,r=i,0===s?(l=138,h=3):i===s?(l=6,h=3):(l=7,h=4))},I=function(t,e,a){var n,i,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),n=0;n<=a;n++)if(i=s,s=e[2*(n+1)+1],!(++o<l&&i===s)){if(o<h)do{z(t,i,t.bl_tree)}while(0!=--o);else 0!==i?(i!==r&&(z(t,i,t.bl_tree),o--),z(t,16,t.bl_tree),x(t,o-3,2)):o<=10?(z(t,17,t.bl_tree),x(t,o-3,3)):(z(t,18,t.bl_tree),x(t,o-11,7));o=0,r=i,0===s?(l=138,h=3):i===s?(l=6,h=3):(l=7,h=4)}},F=!1,L=function(t,e,a,n){x(t,0+(n?1:0),3),Z(t),y(t,a),y(t,~a),a&&t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a},N=function(t,e,n,i){var r,s,o=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<a;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),T(t,t.l_desc),T(t,t.d_desc),o=function(t){var e;for(O(t,t.dyn_ltree,t.l_desc.max_code),O(t,t.dyn_dtree,t.d_desc.max_code),T(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=r&&(r=s)):r=s=n+5,n+4<=r&&-1!==e?L(t,e,n,i):4===t.strategy||s===r?(x(t,2+(i?1:0),3),D(t,d,_)):(x(t,4+(i?1:0),3),function(t,e,a,n){var i;for(x(t,e-257,5),x(t,a-1,5),x(t,n-4,4),i=0;i<n;i++)x(t,t.bl_tree[2*h[i]+1],3);I(t,t.dyn_ltree,e-1),I(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),D(t,t.dyn_ltree,t.dyn_dtree)),R(t),i&&Z(t)},B={_tr_init:function(t){F||(!function(){var t,e,a,h,v,k=new Array(16);for(a=0,h=0;h<28;h++)for(c[h]=a,t=0;t<1<<s[h];t++)u[a++]=h;for(u[a-1]=h,v=0,h=0;h<16;h++)for(g[h]=v,t=0;t<1<<o[h];t++)f[v++]=h;for(v>>=7;h<i;h++)for(g[h]=v<<7,t=0;t<1<<o[h]-7;t++)f[256+v++]=h;for(e=0;e<=r;e++)k[e]=0;for(t=0;t<=143;)d[2*t+1]=8,t++,k[8]++;for(;t<=255;)d[2*t+1]=9,t++,k[9]++;for(;t<=279;)d[2*t+1]=7,t++,k[7]++;for(;t<=287;)d[2*t+1]=8,t++,k[8]++;for(E(d,287,k),t=0;t<i;t++)_[2*t+1]=5,_[2*t]=A(t,5);w=new p(d,s,257,n,r),m=new p(_,o,0,i,r),b=new p(new Array(0),l,0,19,7)}(),F=!0),t.l_desc=new v(t.dyn_ltree,w),t.d_desc=new v(t.dyn_dtree,m),t.bl_desc=new v(t.bl_tree,b),t.bi_buf=0,t.bi_valid=0,R(t)},_tr_stored_block:L,_tr_flush_block:N,_tr_tally:function(t,e,n){return t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(u[n]+a+1)]++,t.dyn_dtree[2*k(e)]++),t.sym_next===t.sym_end},_tr_align:function(t){x(t,2,3),z(t,256,d),function(t){16===t.bi_valid?(y(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},C=function(t,e,a,n){for(var i=65535&t|0,r=t>>>16&65535|0,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{r=r+(i=i+e[n++]|0)|0}while(--s);i%=65521,r%=65521}return i|r<<16|0},M=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),H=function(t,e,a,n){var i=M,r=n+a;t^=-1;for(var s=n;s<r;s++)t=t>>>8^i[255&(t^e[s])];return-1^t},j={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},K={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},P=B._tr_init,Y=B._tr_stored_block,G=B._tr_flush_block,X=B._tr_tally,W=B._tr_align,q=K.Z_NO_FLUSH,J=K.Z_PARTIAL_FLUSH,Q=K.Z_FULL_FLUSH,V=K.Z_FINISH,$=K.Z_BLOCK,tt=K.Z_OK,et=K.Z_STREAM_END,at=K.Z_STREAM_ERROR,nt=K.Z_DATA_ERROR,it=K.Z_BUF_ERROR,rt=K.Z_DEFAULT_COMPRESSION,st=K.Z_FILTERED,ot=K.Z_HUFFMAN_ONLY,lt=K.Z_RLE,ht=K.Z_FIXED,dt=K.Z_DEFAULT_STRATEGY,_t=K.Z_UNKNOWN,ft=K.Z_DEFLATED,ut=258,ct=262,wt=42,mt=113,bt=666,gt=function(t,e){return t.msg=j[e],e},pt=function(t){return 2*t-(t>4?9:0)},vt=function(t){for(var e=t.length;--e>=0;)t[e]=0},kt=function(t){var e,a,n,i=t.w_size;n=e=t.hash_size;do{a=t.head[--n],t.head[n]=a>=i?a-i:0}while(--e);n=e=i;do{a=t.prev[--n],t.prev[n]=a>=i?a-i:0}while(--e)},yt=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},xt=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},zt=function(t,e){G(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,xt(t.strm)},At=function(t,e){t.pending_buf[t.pending++]=e},Et=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Rt=function(t,e,a,n){var i=t.avail_in;return i>n&&(i=n),0===i?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),a),1===t.state.wrap?t.adler=C(t.adler,e,i,a):2===t.state.wrap&&(t.adler=H(t.adler,e,i,a)),t.next_in+=i,t.total_in+=i,i)},Zt=function(t,e){var a,n,i=t.max_chain_length,r=t.strstart,s=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-ct?t.strstart-(t.w_size-ct):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+ut,u=h[r+s-1],c=h[r+s];t.prev_length>=t.good_match&&(i>>=2),o>t.lookahead&&(o=t.lookahead);do{if(h[(a=e)+s]===c&&h[a+s-1]===u&&h[a]===h[r]&&h[++a]===h[r+1]){r+=2,a++;do{}while(h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&r<f);if(n=ut-(f-r),r=f-ut,n>s){if(t.match_start=e,s=n,n>=o)break;u=h[r+s-1],c=h[r+s]}}}while((e=_[e&d])>l&&0!=--i);return s<=t.lookahead?s:t.lookahead},St=function(t){var e,a,n,i=t.w_size;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=i+(i-ct)&&(t.window.set(t.window.subarray(i,i+i-a),0),t.match_start-=i,t.strstart-=i,t.block_start-=i,t.insert>t.strstart&&(t.insert=t.strstart),kt(t),a+=i),0===t.strm.avail_in)break;if(e=Rt(t.strm,t.window,t.strstart+t.lookahead,a),t.lookahead+=e,t.lookahead+t.insert>=3)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=yt(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=yt(t,t.ins_h,t.window[n+3-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<ct&&0!==t.strm.avail_in)},Ut=function(t,e){var a,n,i,r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,s=0,o=t.strm.avail_in;do{if(a=65535,i=t.bi_valid+42>>3,t.strm.avail_out<i)break;if(i=t.strm.avail_out-i,a>(n=t.strstart-t.block_start)+t.strm.avail_in&&(a=n+t.strm.avail_in),a>i&&(a=i),a<r&&(0===a&&e!==V||e===q||a!==n+t.strm.avail_in))break;s=e===V&&a===n+t.strm.avail_in?1:0,Y(t,0,0,s),t.pending_buf[t.pending-4]=a,t.pending_buf[t.pending-3]=a>>8,t.pending_buf[t.pending-2]=~a,t.pending_buf[t.pending-1]=~a>>8,xt(t.strm),n&&(n>a&&(n=a),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+n),t.strm.next_out),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n,t.block_start+=n,a-=n),a&&(Rt(t.strm,t.strm.output,t.strm.next_out,a),t.strm.next_out+=a,t.strm.avail_out-=a,t.strm.total_out+=a)}while(0===s);return(o-=t.strm.avail_in)&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),s?4:e!==q&&e!==V&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(i=t.window_size-t.strstart,t.strm.avail_in>i&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,i+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),i>t.strm.avail_in&&(i=t.strm.avail_in),i&&(Rt(t.strm,t.window,t.strstart,i),t.strstart+=i,t.insert+=i>t.w_size-t.insert?t.w_size-t.insert:i),t.high_water<t.strstart&&(t.high_water=t.strstart),i=t.bi_valid+42>>3,r=(i=t.pending_buf_size-i>65535?65535:t.pending_buf_size-i)>t.w_size?t.w_size:i,((n=t.strstart-t.block_start)>=r||(n||e===V)&&e!==q&&0===t.strm.avail_in&&n<=i)&&(a=n>i?i:n,s=e===V&&0===t.strm.avail_in&&a===n?1:0,Y(t,t.block_start,a,s),t.block_start+=a,xt(t.strm)),s?3:1)},Dt=function(t,e){for(var a,n;;){if(t.lookahead<ct){if(St(t),t.lookahead<ct&&e===q)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-ct&&(t.match_length=Zt(t,a)),t.match_length>=3)if(n=X(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=yt(t,t.ins_h,t.window[t.strstart+1]);else n=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(zt(t,!1),0===t.strm.avail_out)?1:2},Tt=function(t,e){for(var a,n,i;;){if(t.lookahead<ct){if(St(t),t.lookahead<ct&&e===q)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-ct&&(t.match_length=Zt(t,a),t.match_length<=5&&(t.strategy===st||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=X(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(zt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=X(t,0,t.window[t.strstart-1]))&&zt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=X(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(zt(t,!1),0===t.strm.avail_out)?1:2};function Ot(t,e,a,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=i}var It=[new Ot(0,0,0,0,Ut),new Ot(4,4,8,4,Dt),new Ot(4,5,16,8,Dt),new Ot(4,6,32,32,Dt),new Ot(4,4,16,16,Tt),new Ot(8,16,32,32,Tt),new Ot(8,16,128,128,Tt),new Ot(8,32,128,256,Tt),new Ot(32,128,258,1024,Tt),new Ot(32,258,258,4096,Tt)];function Ft(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ft,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),vt(this.dyn_ltree),vt(this.dyn_dtree),vt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),vt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),vt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Lt=function(t){if(!t)return 1;var e=t.state;return!e||e.strm!==t||e.status!==wt&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&e.status!==mt&&e.status!==bt?1:0},Nt=function(t){if(Lt(t))return gt(t,at);t.total_in=t.total_out=0,t.data_type=_t;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?wt:mt,t.adler=2===e.wrap?0:1,e.last_flush=-2,P(e),tt},Bt=function(t){var e,a=Nt(t);return a===tt&&((e=t.state).window_size=2*e.w_size,vt(e.head),e.max_lazy_match=It[e.level].max_lazy,e.good_match=It[e.level].good_length,e.nice_match=It[e.level].nice_length,e.max_chain_length=It[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},Ct=function(t,e,a,n,i,r){if(!t)return at;var s=1;if(e===rt&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>9||a!==ft||n<8||n>15||e<0||e>9||r<0||r>ht||8===n&&1!==s)return gt(t,at);8===n&&(n=9);var o=new Ft;return t.state=o,o.strm=t,o.status=wt,o.wrap=s,o.gzhead=null,o.w_bits=n,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<i+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=3*(o.lit_bufsize-1),o.level=e,o.strategy=r,o.method=a,Bt(t)},Mt={deflateInit:function(t,e){return Ct(t,e,ft,15,8,dt)},deflateInit2:Ct,deflateReset:Bt,deflateResetKeep:Nt,deflateSetHeader:function(t,e){return Lt(t)||2!==t.state.wrap?at:(t.state.gzhead=e,tt)},deflate:function(t,e){if(Lt(t)||e>$||e<0)return t?gt(t,at):at;var a=t.state;if(!t.output||0!==t.avail_in&&!t.input||a.status===bt&&e!==V)return gt(t,0===t.avail_out?it:at);var n=a.last_flush;if(a.last_flush=e,0!==a.pending){if(xt(t),0===t.avail_out)return a.last_flush=-1,tt}else if(0===t.avail_in&&pt(e)<=pt(n)&&e!==V)return gt(t,it);if(a.status===bt&&0!==t.avail_in)return gt(t,it);if(a.status===wt&&0===a.wrap&&(a.status=mt),a.status===wt){var i=ft+(a.w_bits-8<<4)<<8;if(i|=(a.strategy>=ot||a.level<2?0:a.level<6?1:6===a.level?2:3)<<6,0!==a.strstart&&(i|=32),Et(a,i+=31-i%31),0!==a.strstart&&(Et(a,t.adler>>>16),Et(a,65535&t.adler)),t.adler=1,a.status=mt,xt(t),0!==a.pending)return a.last_flush=-1,tt}if(57===a.status)if(t.adler=0,At(a,31),At(a,139),At(a,8),a.gzhead)At(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),At(a,255&a.gzhead.time),At(a,a.gzhead.time>>8&255),At(a,a.gzhead.time>>16&255),At(a,a.gzhead.time>>24&255),At(a,9===a.level?2:a.strategy>=ot||a.level<2?4:0),At(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(At(a,255&a.gzhead.extra.length),At(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(t.adler=H(t.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(At(a,0),At(a,0),At(a,0),At(a,0),At(a,0),At(a,9===a.level?2:a.strategy>=ot||a.level<2?4:0),At(a,3),a.status=mt,xt(t),0!==a.pending)return a.last_flush=-1,tt;if(69===a.status){if(a.gzhead.extra){for(var r=a.pending,s=(65535&a.gzhead.extra.length)-a.gzindex;a.pending+s>a.pending_buf_size;){var o=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+o),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>r&&(t.adler=H(t.adler,a.pending_buf,a.pending-r,r)),a.gzindex+=o,xt(t),0!==a.pending)return a.last_flush=-1,tt;r=0,s-=o}var l=new Uint8Array(a.gzhead.extra);a.pending_buf.set(l.subarray(a.gzindex,a.gzindex+s),a.pending),a.pending+=s,a.gzhead.hcrc&&a.pending>r&&(t.adler=H(t.adler,a.pending_buf,a.pending-r,r)),a.gzindex=0}a.status=73}if(73===a.status){if(a.gzhead.name){var h,d=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>d&&(t.adler=H(t.adler,a.pending_buf,a.pending-d,d)),xt(t),0!==a.pending)return a.last_flush=-1,tt;d=0}h=a.gzindex<a.gzhead.name.length?255&a.gzhead.name.charCodeAt(a.gzindex++):0,At(a,h)}while(0!==h);a.gzhead.hcrc&&a.pending>d&&(t.adler=H(t.adler,a.pending_buf,a.pending-d,d)),a.gzindex=0}a.status=91}if(91===a.status){if(a.gzhead.comment){var _,f=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>f&&(t.adler=H(t.adler,a.pending_buf,a.pending-f,f)),xt(t),0!==a.pending)return a.last_flush=-1,tt;f=0}_=a.gzindex<a.gzhead.comment.length?255&a.gzhead.comment.charCodeAt(a.gzindex++):0,At(a,_)}while(0!==_);a.gzhead.hcrc&&a.pending>f&&(t.adler=H(t.adler,a.pending_buf,a.pending-f,f))}a.status=103}if(103===a.status){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(xt(t),0!==a.pending))return a.last_flush=-1,tt;At(a,255&t.adler),At(a,t.adler>>8&255),t.adler=0}if(a.status=mt,xt(t),0!==a.pending)return a.last_flush=-1,tt}if(0!==t.avail_in||0!==a.lookahead||e!==q&&a.status!==bt){var u=0===a.level?Ut(a,e):a.strategy===ot?function(t,e){for(var a;;){if(0===t.lookahead&&(St(t),0===t.lookahead)){if(e===q)return 1;break}if(t.match_length=0,a=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(zt(t,!1),0===t.strm.avail_out)?1:2}(a,e):a.strategy===lt?function(t,e){for(var a,n,i,r,s=t.window;;){if(t.lookahead<=ut){if(St(t),t.lookahead<=ut&&e===q)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[i=t.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){r=t.strstart+ut;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<r);t.match_length=ut-(r-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=X(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=X(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(zt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(zt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(zt(t,!1),0===t.strm.avail_out)?1:2}(a,e):It[a.level].func(a,e);if(3!==u&&4!==u||(a.status=bt),1===u||3===u)return 0===t.avail_out&&(a.last_flush=-1),tt;if(2===u&&(e===J?W(a):e!==$&&(Y(a,0,0,!1),e===Q&&(vt(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),xt(t),0===t.avail_out))return a.last_flush=-1,tt}return e!==V?tt:a.wrap<=0?et:(2===a.wrap?(At(a,255&t.adler),At(a,t.adler>>8&255),At(a,t.adler>>16&255),At(a,t.adler>>24&255),At(a,255&t.total_in),At(a,t.total_in>>8&255),At(a,t.total_in>>16&255),At(a,t.total_in>>24&255)):(Et(a,t.adler>>>16),Et(a,65535&t.adler)),xt(t),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?tt:et)},deflateEnd:function(t){if(Lt(t))return at;var e=t.state.status;return t.state=null,e===mt?gt(t,nt):tt},deflateSetDictionary:function(t,e){var a=e.length;if(Lt(t))return at;var n=t.state,i=n.wrap;if(2===i||1===i&&n.status!==wt||n.lookahead)return at;if(1===i&&(t.adler=C(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===i&&(vt(n.head),n.strstart=0,n.block_start=0,n.insert=0);var r=new Uint8Array(n.w_size);r.set(e.subarray(a-n.w_size,a),0),e=r,a=n.w_size}var s=t.avail_in,o=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,St(n);n.lookahead>=3;){var h=n.strstart,d=n.lookahead-2;do{n.ins_h=yt(n,n.ins_h,n.window[h+3-1]),n.prev[h&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=h,h++}while(--d);n.strstart=h,n.lookahead=2,St(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=o,t.input=l,t.avail_in=s,n.wrap=i,tt},deflateInfo:"pako deflate (from Nodeca project)"};function Ht(t){return Ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ht(t)}var jt=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},Kt=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var a=e.shift();if(a){if("object"!==Ht(a))throw new TypeError(a+"must be non-object");for(var n in a)jt(a,n)&&(t[n]=a[n])}}return t},Pt=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var i=new Uint8Array(e),r=0,s=0,o=t.length;r<o;r++){var l=t[r];i.set(l,s),s+=l.length}return i},Yt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Yt=!1}for(var Gt=new Uint8Array(256),Xt=0;Xt<256;Xt++)Gt[Xt]=Xt>=252?6:Xt>=248?5:Xt>=240?4:Xt>=224?3:Xt>=192?2:1;Gt[254]=Gt[254]=1;var Wt=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);var e,a,n,i,r,s=t.length,o=0;for(i=0;i<s;i++)55296==(64512&(a=t.charCodeAt(i)))&&i+1<s&&56320==(64512&(n=t.charCodeAt(i+1)))&&(a=65536+(a-55296<<10)+(n-56320),i++),o+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(o),r=0,i=0;r<o;i++)55296==(64512&(a=t.charCodeAt(i)))&&i+1<s&&56320==(64512&(n=t.charCodeAt(i+1)))&&(a=65536+(a-55296<<10)+(n-56320),i++),a<128?e[r++]=a:a<2048?(e[r++]=192|a>>>6,e[r++]=128|63&a):a<65536?(e[r++]=224|a>>>12,e[r++]=128|a>>>6&63,e[r++]=128|63&a):(e[r++]=240|a>>>18,e[r++]=128|a>>>12&63,e[r++]=128|a>>>6&63,e[r++]=128|63&a);return e},qt=function(t,e){var a,n,i=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));var r=new Array(2*i);for(n=0,a=0;a<i;){var s=t[a++];if(s<128)r[n++]=s;else{var o=Gt[s];if(o>4)r[n++]=65533,a+=o-1;else{for(s&=2===o?31:3===o?15:7;o>1&&a<i;)s=s<<6|63&t[a++],o--;o>1?r[n++]=65533:s<65536?r[n++]=s:(s-=65536,r[n++]=55296|s>>10&1023,r[n++]=56320|1023&s)}}}return function(t,e){if(e<65534&&t.subarray&&Yt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));for(var a="",n=0;n<e;n++)a+=String.fromCharCode(t[n]);return a}(r,n)},Jt=function(t,e){(e=e||t.length)>t.length&&(e=t.length);for(var a=e-1;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Gt[t[a]]>e?a:e};var Qt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Vt=Object.prototype.toString,$t=K.Z_NO_FLUSH,te=K.Z_SYNC_FLUSH,ee=K.Z_FULL_FLUSH,ae=K.Z_FINISH,ne=K.Z_OK,ie=K.Z_STREAM_END,re=K.Z_DEFAULT_COMPRESSION,se=K.Z_DEFAULT_STRATEGY,oe=K.Z_DEFLATED;function le(t){this.options=Kt({level:re,method:oe,chunkSize:16384,windowBits:15,memLevel:8,strategy:se},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qt,this.strm.avail_out=0;var a=Mt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==ne)throw new Error(j[a]);if(e.header&&Mt.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(n="string"==typeof e.dictionary?Wt(e.dictionary):"[object ArrayBuffer]"===Vt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(a=Mt.deflateSetDictionary(this.strm,n))!==ne)throw new Error(j[a]);this._dict_set=!0}}function he(t,e){var a=new le(e);if(a.push(t,!0),a.err)throw a.msg||j[a.err];return a.result}le.prototype.push=function(t,e){var a,n,i=this.strm,r=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?ae:$t,"string"==typeof t?i.input=Wt(t):"[object ArrayBuffer]"===Vt.call(t)?i.input=new Uint8Array(t):i.input=t,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),(n===te||n===ee)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if((a=Mt.deflate(i,n))===ie)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),a=Mt.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===ne;if(0!==i.avail_out){if(n>0&&i.next_out>0)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},le.prototype.onData=function(t){this.chunks.push(t)},le.prototype.onEnd=function(t){t===ne&&(this.result=Pt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var de={Deflate:le,deflate:he,deflateRaw:function(t,e){return(e=e||{}).raw=!0,he(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,he(t,e)},constants:K},_e=16209,fe=function(t,e){var a,n,i,r,s,o,l,h,d,_,f,u,c,w,m,b,g,p,v,k,y,x,z,A,E=t.state;a=t.next_in,z=t.input,n=a+(t.avail_in-5),i=t.next_out,A=t.output,r=i-(e-t.avail_out),s=i+(t.avail_out-257),o=E.dmax,l=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,u=E.bits,c=E.lencode,w=E.distcode,m=(1<<E.lenbits)-1,b=(1<<E.distbits)-1;t:do{u<15&&(f+=z[a++]<<u,u+=8,f+=z[a++]<<u,u+=8),g=c[f&m];e:for(;;){if(f>>>=p=g>>>24,u-=p,0===(p=g>>>16&255))A[i++]=65535&g;else{if(!(16&p)){if(0==(64&p)){g=c[(65535&g)+(f&(1<<p)-1)];continue e}if(32&p){E.mode=16191;break t}t.msg="invalid literal/length code",E.mode=_e;break t}v=65535&g,(p&=15)&&(u<p&&(f+=z[a++]<<u,u+=8),v+=f&(1<<p)-1,f>>>=p,u-=p),u<15&&(f+=z[a++]<<u,u+=8,f+=z[a++]<<u,u+=8),g=w[f&b];a:for(;;){if(f>>>=p=g>>>24,u-=p,!(16&(p=g>>>16&255))){if(0==(64&p)){g=w[(65535&g)+(f&(1<<p)-1)];continue a}t.msg="invalid distance code",E.mode=_e;break t}if(k=65535&g,u<(p&=15)&&(f+=z[a++]<<u,(u+=8)<p&&(f+=z[a++]<<u,u+=8)),(k+=f&(1<<p)-1)>o){t.msg="invalid distance too far back",E.mode=_e;break t}if(f>>>=p,u-=p,k>(p=i-r)){if((p=k-p)>h&&E.sane){t.msg="invalid distance too far back",E.mode=_e;break t}if(y=0,x=_,0===d){if(y+=l-p,p<v){v-=p;do{A[i++]=_[y++]}while(--p);y=i-k,x=A}}else if(d<p){if(y+=l+d-p,(p-=d)<v){v-=p;do{A[i++]=_[y++]}while(--p);if(y=0,d<v){v-=p=d;do{A[i++]=_[y++]}while(--p);y=i-k,x=A}}}else if(y+=d-p,p<v){v-=p;do{A[i++]=_[y++]}while(--p);y=i-k,x=A}for(;v>2;)A[i++]=x[y++],A[i++]=x[y++],A[i++]=x[y++],v-=3;v&&(A[i++]=x[y++],v>1&&(A[i++]=x[y++]))}else{y=i-k;do{A[i++]=A[y++],A[i++]=A[y++],A[i++]=A[y++],v-=3}while(v>2);v&&(A[i++]=A[y++],v>1&&(A[i++]=A[y++]))}break}}break}}while(a<n&&i<s);a-=v=u>>3,f&=(1<<(u-=v<<3))-1,t.next_in=a,t.next_out=i,t.avail_in=a<n?n-a+5:5-(a-n),t.avail_out=i<s?s-i+257:257-(i-s),E.hold=f,E.bits=u},ue=15,ce=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),we=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),me=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),be=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),ge=function(t,e,a,n,i,r,s,o){var l,h,d,_,f,u,c,w,m,b=o.bits,g=0,p=0,v=0,k=0,y=0,x=0,z=0,A=0,E=0,R=0,Z=null,S=new Uint16Array(16),U=new Uint16Array(16),D=null;for(g=0;g<=ue;g++)S[g]=0;for(p=0;p<n;p++)S[e[a+p]]++;for(y=b,k=ue;k>=1&&0===S[k];k--);if(y>k&&(y=k),0===k)return i[r++]=20971520,i[r++]=20971520,o.bits=1,0;for(v=1;v<k&&0===S[v];v++);for(y<v&&(y=v),A=1,g=1;g<=ue;g++)if(A<<=1,(A-=S[g])<0)return-1;if(A>0&&(0===t||1!==k))return-1;for(U[1]=0,g=1;g<ue;g++)U[g+1]=U[g]+S[g];for(p=0;p<n;p++)0!==e[a+p]&&(s[U[e[a+p]]++]=p);if(0===t?(Z=D=s,u=20):1===t?(Z=ce,D=we,u=257):(Z=me,D=be,u=0),R=0,p=0,g=v,f=r,x=y,z=0,d=-1,_=(E=1<<y)-1,1===t&&E>852||2===t&&E>592)return 1;for(;;){c=g-z,s[p]+1<u?(w=0,m=s[p]):s[p]>=u?(w=D[s[p]-u],m=Z[s[p]-u]):(w=96,m=0),l=1<<g-z,v=h=1<<x;do{i[f+(R>>z)+(h-=l)]=c<<24|w<<16|m|0}while(0!==h);for(l=1<<g-1;R&l;)l>>=1;if(0!==l?(R&=l-1,R+=l):R=0,p++,0==--S[g]){if(g===k)break;g=e[a+s[p]]}if(g>y&&(R&_)!==d){for(0===z&&(z=y),f+=v,A=1<<(x=g-z);x+z<k&&!((A-=S[x+z])<=0);)x++,A<<=1;if(E+=1<<x,1===t&&E>852||2===t&&E>592)return 1;i[d=R&_]=y<<24|x<<16|f-r|0}}return 0!==R&&(i[f+R]=g-z<<24|64<<16|0),o.bits=y,0},pe=K.Z_FINISH,ve=K.Z_BLOCK,ke=K.Z_TREES,ye=K.Z_OK,xe=K.Z_STREAM_END,ze=K.Z_NEED_DICT,Ae=K.Z_STREAM_ERROR,Ee=K.Z_DATA_ERROR,Re=K.Z_MEM_ERROR,Ze=K.Z_BUF_ERROR,Se=K.Z_DEFLATED,Ue=16180,De=16190,Te=16191,Oe=16192,Ie=16194,Fe=16199,Le=16200,Ne=16206,Be=16209,Ce=function(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)};function Me(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var He,je,Ke=function(t){if(!t)return 1;var e=t.state;return!e||e.strm!==t||e.mode<Ue||e.mode>16211?1:0},Pe=function(t){if(Ke(t))return Ae;var e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=Ue,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,ye},Ye=function(t){if(Ke(t))return Ae;var e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Pe(t)},Ge=function(t,e){var a;if(Ke(t))return Ae;var n=t.state;return e<0?(a=0,e=-e):(a=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?Ae:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=a,n.wbits=e,Ye(t))},Xe=function(t,e){if(!t)return Ae;var a=new Me;t.state=a,a.strm=t,a.window=null,a.mode=Ue;var n=Ge(t,e);return n!==ye&&(t.state=null),n},We=!0,qe=function(t){if(We){He=new Int32Array(512),je=new Int32Array(32);for(var e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ge(1,t.lens,0,288,He,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ge(2,t.lens,0,32,je,0,t.work,{bits:5}),We=!1}t.lencode=He,t.lenbits=9,t.distcode=je,t.distbits=5},Je=function(t,e,a,n){var i,r=t.state;return null===r.window&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new Uint8Array(r.wsize)),n>=r.wsize?(r.window.set(e.subarray(a-r.wsize,a),0),r.wnext=0,r.whave=r.wsize):((i=r.wsize-r.wnext)>n&&(i=n),r.window.set(e.subarray(a-n,a-n+i),r.wnext),(n-=i)?(r.window.set(e.subarray(a-n,a),0),r.wnext=n,r.whave=r.wsize):(r.wnext+=i,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=i))),0},Qe={inflateReset:Ye,inflateReset2:Ge,inflateResetKeep:Pe,inflateInit:function(t){return Xe(t,15)},inflateInit2:Xe,inflate:function(t,e){var a,n,i,r,s,o,l,h,d,_,f,u,c,w,m,b,g,p,v,k,y,x,z,A,E=0,R=new Uint8Array(4),Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ke(t)||!t.output||!t.input&&0!==t.avail_in)return Ae;(a=t.state).mode===Te&&(a.mode=Oe),s=t.next_out,i=t.output,l=t.avail_out,r=t.next_in,n=t.input,o=t.avail_in,h=a.hold,d=a.bits,_=o,f=l,x=ye;t:for(;;)switch(a.mode){case Ue:if(0===a.wrap){a.mode=Oe;break}for(;d<16;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(2&a.wrap&&35615===h){0===a.wbits&&(a.wbits=15),a.check=0,R[0]=255&h,R[1]=h>>>8&255,a.check=H(a.check,R,2,0),h=0,d=0,a.mode=16181;break}if(a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=Be;break}if((15&h)!==Se){t.msg="unknown compression method",a.mode=Be;break}if(d-=4,y=8+(15&(h>>>=4)),0===a.wbits&&(a.wbits=y),y>15||y>a.wbits){t.msg="invalid window size",a.mode=Be;break}a.dmax=1<<a.wbits,a.flags=0,t.adler=a.check=1,a.mode=512&h?16189:Te,h=0,d=0;break;case 16181:for(;d<16;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(a.flags=h,(255&a.flags)!==Se){t.msg="unknown compression method",a.mode=Be;break}if(57344&a.flags){t.msg="unknown header flags set",a.mode=Be;break}a.head&&(a.head.text=h>>8&1),512&a.flags&&4&a.wrap&&(R[0]=255&h,R[1]=h>>>8&255,a.check=H(a.check,R,2,0)),h=0,d=0,a.mode=16182;case 16182:for(;d<32;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.head&&(a.head.time=h),512&a.flags&&4&a.wrap&&(R[0]=255&h,R[1]=h>>>8&255,R[2]=h>>>16&255,R[3]=h>>>24&255,a.check=H(a.check,R,4,0)),h=0,d=0,a.mode=16183;case 16183:for(;d<16;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.head&&(a.head.xflags=255&h,a.head.os=h>>8),512&a.flags&&4&a.wrap&&(R[0]=255&h,R[1]=h>>>8&255,a.check=H(a.check,R,2,0)),h=0,d=0,a.mode=16184;case 16184:if(1024&a.flags){for(;d<16;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.length=h,a.head&&(a.head.extra_len=h),512&a.flags&&4&a.wrap&&(R[0]=255&h,R[1]=h>>>8&255,a.check=H(a.check,R,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=16185;case 16185:if(1024&a.flags&&((u=a.length)>o&&(u=o),u&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(n.subarray(r,r+u),y)),512&a.flags&&4&a.wrap&&(a.check=H(a.check,n,u,r)),o-=u,r+=u,a.length-=u),a.length))break t;a.length=0,a.mode=16186;case 16186:if(2048&a.flags){if(0===o)break t;u=0;do{y=n[r+u++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&u<o);if(512&a.flags&&4&a.wrap&&(a.check=H(a.check,n,u,r)),o-=u,r+=u,y)break t}else a.head&&(a.head.name=null);a.length=0,a.mode=16187;case 16187:if(4096&a.flags){if(0===o)break t;u=0;do{y=n[r+u++],a.head&&y&&a.length<65536&&(a.head.comment+=String.fromCharCode(y))}while(y&&u<o);if(512&a.flags&&4&a.wrap&&(a.check=H(a.check,n,u,r)),o-=u,r+=u,y)break t}else a.head&&(a.head.comment=null);a.mode=16188;case 16188:if(512&a.flags){for(;d<16;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(4&a.wrap&&h!==(65535&a.check)){t.msg="header crc mismatch",a.mode=Be;break}h=0,d=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=Te;break;case 16189:for(;d<32;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}t.adler=a.check=Ce(h),h=0,d=0,a.mode=De;case De:if(0===a.havedict)return t.next_out=s,t.avail_out=l,t.next_in=r,t.avail_in=o,a.hold=h,a.bits=d,ze;t.adler=a.check=1,a.mode=Te;case Te:if(e===ve||e===ke)break t;case Oe:if(a.last){h>>>=7&d,d-=7&d,a.mode=Ne;break}for(;d<3;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}switch(a.last=1&h,d-=1,3&(h>>>=1)){case 0:a.mode=16193;break;case 1:if(qe(a),a.mode=Fe,e===ke){h>>>=2,d-=2;break t}break;case 2:a.mode=16196;break;case 3:t.msg="invalid block type",a.mode=Be}h>>>=2,d-=2;break;case 16193:for(h>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if((65535&h)!=(h>>>16^65535)){t.msg="invalid stored block lengths",a.mode=Be;break}if(a.length=65535&h,h=0,d=0,a.mode=Ie,e===ke)break t;case Ie:a.mode=16195;case 16195:if(u=a.length){if(u>o&&(u=o),u>l&&(u=l),0===u)break t;i.set(n.subarray(r,r+u),s),o-=u,r+=u,l-=u,s+=u,a.length-=u;break}a.mode=Te;break;case 16196:for(;d<14;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(a.nlen=257+(31&h),h>>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=Be;break}a.have=0,a.mode=16197;case 16197:for(;a.have<a.ncode;){for(;d<3;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.lens[Z[a.have++]]=7&h,h>>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,z={bits:a.lenbits},x=ge(0,a.lens,0,19,a.lencode,0,a.work,z),a.lenbits=z.bits,x){t.msg="invalid code lengths set",a.mode=Be;break}a.have=0,a.mode=16198;case 16198:for(;a.have<a.nlen+a.ndist;){for(;b=(E=a.lencode[h&(1<<a.lenbits)-1])>>>16&255,g=65535&E,!((m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(g<16)h>>>=m,d-=m,a.lens[a.have++]=g;else{if(16===g){for(A=m+2;d<A;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(h>>>=m,d-=m,0===a.have){t.msg="invalid bit length repeat",a.mode=Be;break}y=a.lens[a.have-1],u=3+(3&h),h>>>=2,d-=2}else if(17===g){for(A=m+3;d<A;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}d-=m,y=0,u=3+(7&(h>>>=m)),h>>>=3,d-=3}else{for(A=m+7;d<A;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}d-=m,y=0,u=11+(127&(h>>>=m)),h>>>=7,d-=7}if(a.have+u>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=Be;break}for(;u--;)a.lens[a.have++]=y}}if(a.mode===Be)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=Be;break}if(a.lenbits=9,z={bits:a.lenbits},x=ge(1,a.lens,0,a.nlen,a.lencode,0,a.work,z),a.lenbits=z.bits,x){t.msg="invalid literal/lengths set",a.mode=Be;break}if(a.distbits=6,a.distcode=a.distdyn,z={bits:a.distbits},x=ge(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,z),a.distbits=z.bits,x){t.msg="invalid distances set",a.mode=Be;break}if(a.mode=Fe,e===ke)break t;case Fe:a.mode=Le;case Le:if(o>=6&&l>=258){t.next_out=s,t.avail_out=l,t.next_in=r,t.avail_in=o,a.hold=h,a.bits=d,fe(t,f),s=t.next_out,i=t.output,l=t.avail_out,r=t.next_in,n=t.input,o=t.avail_in,h=a.hold,d=a.bits,a.mode===Te&&(a.back=-1);break}for(a.back=0;b=(E=a.lencode[h&(1<<a.lenbits)-1])>>>16&255,g=65535&E,!((m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(b&&0==(240&b)){for(p=m,v=b,k=g;b=(E=a.lencode[k+((h&(1<<p+v)-1)>>p)])>>>16&255,g=65535&E,!(p+(m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,a.length=g,0===b){a.mode=16205;break}if(32&b){a.back=-1,a.mode=Te;break}if(64&b){t.msg="invalid literal/length code",a.mode=Be;break}a.extra=15&b,a.mode=16201;case 16201:if(a.extra){for(A=a.extra;d<A;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.length+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=16202;case 16202:for(;b=(E=a.distcode[h&(1<<a.distbits)-1])>>>16&255,g=65535&E,!((m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(0==(240&b)){for(p=m,v=b,k=g;b=(E=a.distcode[k+((h&(1<<p+v)-1)>>p)])>>>16&255,g=65535&E,!(p+(m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,64&b){t.msg="invalid distance code",a.mode=Be;break}a.offset=g,a.extra=15&b,a.mode=16203;case 16203:if(a.extra){for(A=a.extra;d<A;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}a.offset+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=Be;break}a.mode=16204;case 16204:if(0===l)break t;if(u=f-l,a.offset>u){if((u=a.offset-u)>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=Be;break}u>a.wnext?(u-=a.wnext,c=a.wsize-u):c=a.wnext-u,u>a.length&&(u=a.length),w=a.window}else w=i,c=s-a.offset,u=a.length;u>l&&(u=l),l-=u,a.length-=u;do{i[s++]=w[c++]}while(--u);0===a.length&&(a.mode=Le);break;case 16205:if(0===l)break t;i[s++]=a.length,l--,a.mode=Le;break;case Ne:if(a.wrap){for(;d<32;){if(0===o)break t;o--,h|=n[r++]<<d,d+=8}if(f-=l,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?H(a.check,i,f,s-f):C(a.check,i,f,s-f)),f=l,4&a.wrap&&(a.flags?h:Ce(h))!==a.check){t.msg="incorrect data check",a.mode=Be;break}h=0,d=0}a.mode=16207;case 16207:if(a.wrap&&a.flags){for(;d<32;){if(0===o)break t;o--,h+=n[r++]<<d,d+=8}if(4&a.wrap&&h!==(4294967295&a.total)){t.msg="incorrect length check",a.mode=Be;break}h=0,d=0}a.mode=16208;case 16208:x=xe;break t;case Be:x=Ee;break t;case 16210:return Re;default:return Ae}return t.next_out=s,t.avail_out=l,t.next_in=r,t.avail_in=o,a.hold=h,a.bits=d,(a.wsize||f!==t.avail_out&&a.mode<Be&&(a.mode<Ne||e!==pe))&&Je(t,t.output,t.next_out,f-t.avail_out),_-=t.avail_in,f-=t.avail_out,t.total_in+=_,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?H(a.check,i,f,t.next_out-f):C(a.check,i,f,t.next_out-f)),t.data_type=a.bits+(a.last?64:0)+(a.mode===Te?128:0)+(a.mode===Fe||a.mode===Ie?256:0),(0===_&&0===f||e===pe)&&x===ye&&(x=Ze),x},inflateEnd:function(t){if(Ke(t))return Ae;var e=t.state;return e.window&&(e.window=null),t.state=null,ye},inflateGetHeader:function(t,e){if(Ke(t))return Ae;var a=t.state;return 0==(2&a.wrap)?Ae:(a.head=e,e.done=!1,ye)},inflateSetDictionary:function(t,e){var a,n=e.length;return Ke(t)||0!==(a=t.state).wrap&&a.mode!==De?Ae:a.mode===De&&C(1,e,n,0)!==a.check?Ee:Je(t,e,n,n)?(a.mode=16210,Re):(a.havedict=1,ye)},inflateInfo:"pako inflate (from Nodeca project)"};var Ve=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},$e=Object.prototype.toString,ta=K.Z_NO_FLUSH,ea=K.Z_FINISH,aa=K.Z_OK,na=K.Z_STREAM_END,ia=K.Z_NEED_DICT,ra=K.Z_STREAM_ERROR,sa=K.Z_DATA_ERROR,oa=K.Z_MEM_ERROR;function la(t){this.options=Kt({chunkSize:65536,windowBits:15,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qt,this.strm.avail_out=0;var a=Qe.inflateInit2(this.strm,e.windowBits);if(a!==aa)throw new Error(j[a]);if(this.header=new Ve,Qe.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Wt(e.dictionary):"[object ArrayBuffer]"===$e.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Qe.inflateSetDictionary(this.strm,e.dictionary))!==aa))throw new Error(j[a])}function ha(t,e){var a=new la(e);if(a.push(t),a.err)throw a.msg||j[a.err];return a.result}la.prototype.push=function(t,e){var a,n,i,r=this.strm,s=this.options.chunkSize,o=this.options.dictionary;if(this.ended)return!1;for(n=e===~~e?e:!0===e?ea:ta,"[object ArrayBuffer]"===$e.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(s),r.next_out=0,r.avail_out=s),(a=Qe.inflate(r,n))===ia&&o&&((a=Qe.inflateSetDictionary(r,o))===aa?a=Qe.inflate(r,n):a===sa&&(a=ia));r.avail_in>0&&a===na&&r.state.wrap>0&&0!==t[r.next_in];)Qe.inflateReset(r),a=Qe.inflate(r,n);switch(a){case ra:case sa:case ia:case oa:return this.onEnd(a),this.ended=!0,!1}if(i=r.avail_out,r.next_out&&(0===r.avail_out||a===na))if("string"===this.options.to){var l=Jt(r.output,r.next_out),h=r.next_out-l,d=qt(r.output,l);r.next_out=h,r.avail_out=s-h,h&&r.output.set(r.output.subarray(l,l+h),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(a!==aa||0!==i){if(a===na)return a=Qe.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},la.prototype.onData=function(t){this.chunks.push(t)},la.prototype.onEnd=function(t){t===aa&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Pt(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var da={Inflate:la,inflate:ha,inflateRaw:function(t,e){return(e=e||{}).raw=!0,ha(t,e)},ungzip:ha,constants:K},_a=de.Deflate,fa=de.deflate,ua=de.deflateRaw,ca=de.gzip,wa=da.Inflate,ma=da.inflate,ba=da.inflateRaw,ga=da.ungzip,pa=K,va={Deflate:_a,deflate:fa,deflateRaw:ua,gzip:ca,Inflate:wa,inflate:ma,inflateRaw:ba,ungzip:ga,constants:pa};t.Deflate=_a,t.Inflate=wa,t.constants=pa,t.default=va,t.deflate=fa,t.deflateRaw=ua,t.gzip=ca,t.inflate=ma,t.inflateRaw=ba,t.ungzip=ga,Object.defineProperty(t,"__esModule",{value:!0})}));
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+o}}}function e(t,e){return t[0]===e[0]&&t[1]===e[1]}function s(s,n,o,a=1){const h=o,r=Math.max(n,.1),i=s[0]&&s[0][0]&&"number"==typeof s[0][0]?[s]:s,c=[0,0];if(h)for(const e of i)t(e,c,h);const l=function(t,s,n){const o=[];for(const s of t){const t=[...s];e(t[0],t[t.length-1])||t.push([t[0][0],t[0][1]]),t.length>2&&o.push(t)}const a=[];s=Math.max(s,.1);const h=[];for(const t of o)for(let e=0;e<t.length-1;e++){const s=t[e],n=t[e+1];if(s[1]!==n[1]){const t=Math.min(s[1],n[1]);h.push({ymin:t,ymax:Math.max(s[1],n[1]),x:t===s[1]?s[0]:n[0],islope:(n[0]-s[0])/(n[1]-s[1])})}}if(h.sort(((t,e)=>t.ymin<e.ymin?-1:t.ymin>e.ymin?1:t.x<e.x?-1:t.x>e.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax))),!h.length)return a;let r=[],i=h[0].ymin,c=0;for(;r.length||h.length;){if(h.length){let t=-1;for(let e=0;e<h.length&&!(h[e].ymin>i);e++)t=e;h.splice(0,t+1).forEach((t=>{r.push({s:i,edge:t})}))}if(r=r.filter((t=>!(t.edge.ymax<=i))),r.sort(((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x))),(1!==n||c%s==0)&&r.length>1)for(let t=0;t<r.length;t+=2){const e=t+1;if(e>=r.length)break;const s=r[t].edge,n=r[e].edge;a.push([[Math.round(s.x),i],[Math.round(n.x),i]])}i+=n,r.forEach((t=>{t.edge.x=t.edge.x+n*t.edge.islope})),c++}return a}(i,r,a);if(h){for(const e of i)t(e,c,-h);!function(e,s,n){const o=[];e.forEach((t=>o.push(...t))),t(o,s,n)}(l,c,-h)}return l}function n(t,e){var n;const o=e.hachureAngle+90;let a=e.hachureGap;a<0&&(a=4*e.strokeWidth),a=Math.round(Math.max(a,.1));let h=1;return e.roughness>=1&&((null===(n=e.randomizer)||void 0===n?void 0:n.next())||Math.random())>.7&&(h=a),s(t,a,o,h||1)}class o{constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){const s=n(t,e);return{type:"fillSketch",ops:this.renderLines(s,e)}}renderLines(t,e){const s=[];for(const n of t)s.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],e));return s}}function a(t){const e=t[0],s=t[1];return Math.sqrt(Math.pow(e[0]-s[0],2)+Math.pow(e[1]-s[1],2))}class h extends o{fillPolygons(t,e){let s=e.hachureGap;s<0&&(s=4*e.strokeWidth),s=Math.max(s,.1);const o=n(t,Object.assign({},e,{hachureGap:s})),h=Math.PI/180*e.hachureAngle,r=[],i=.5*s*Math.cos(h),c=.5*s*Math.sin(h);for(const[t,e]of o)a([t,e])&&r.push([[t[0]-i,t[1]+c],[...e]],[[t[0]+i,t[1]-c],[...e]]);return{type:"fillSketch",ops:this.renderLines(r,e)}}}class r extends o{fillPolygons(t,e){const s=this._fillPolygons(t,e),n=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),o=this._fillPolygons(t,n);return s.ops=s.ops.concat(o.ops),s}}class i{constructor(t){this.helper=t}fillPolygons(t,e){const s=n(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(s,e)}dotsOnLines(t,e){const s=[];let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);let o=e.fillWeight;o<0&&(o=e.strokeWidth/2);const h=n/4;for(const r of t){const t=a(r),i=t/n,c=Math.ceil(i)-1,l=t-c*n,u=(r[0][0]+r[1][0])/2-n/4,p=Math.min(r[0][1],r[1][1]);for(let t=0;t<c;t++){const a=p+l+t*n,r=u-h+2*Math.random()*h,i=a-h+2*Math.random()*h,c=this.helper.ellipse(r,i,o,o,e);s.push(...c.ops)}}return{type:"fillSketch",ops:s}}}class c{constructor(t){this.helper=t}fillPolygons(t,e){const s=n(t,e);return{type:"fillSketch",ops:this.dashedLine(s,e)}}dashedLine(t,e){const s=e.dashOffset<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashOffset,n=e.dashGap<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashGap,o=[];return t.forEach((t=>{const h=a(t),r=Math.floor(h/(s+n)),i=(h+n-r*(s+n))/2;let c=t[0],l=t[1];c[0]>l[0]&&(c=t[1],l=t[0]);const u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let t=0;t<r;t++){const a=t*(s+n),h=a+s,r=[c[0]+a*Math.cos(u)+i*Math.cos(u),c[1]+a*Math.sin(u)+i*Math.sin(u)],l=[c[0]+h*Math.cos(u)+i*Math.cos(u),c[1]+h*Math.sin(u)+i*Math.sin(u)];o.push(...this.helper.doubleLineOps(r[0],r[1],l[0],l[1],e))}})),o}}class l{constructor(t){this.helper=t}fillPolygons(t,e){const s=e.hachureGap<0?4*e.strokeWidth:e.hachureGap,o=e.zigzagOffset<0?s:e.zigzagOffset,a=n(t,e=Object.assign({},e,{hachureGap:s+o}));return{type:"fillSketch",ops:this.zigzagLines(a,o,e)}}zigzagLines(t,e,s){const n=[];return t.forEach((t=>{const o=a(t),h=Math.round(o/(2*e));let r=t[0],i=t[1];r[0]>i[0]&&(r=t[1],i=t[0]);const c=Math.atan((i[1]-r[1])/(i[0]-r[0]));for(let t=0;t<h;t++){const o=2*t*e,a=2*(t+1)*e,h=Math.sqrt(2*Math.pow(e,2)),i=[r[0]+o*Math.cos(c),r[1]+o*Math.sin(c)],l=[r[0]+a*Math.cos(c),r[1]+a*Math.sin(c)],u=[i[0]+h*Math.cos(c+Math.PI/4),i[1]+h*Math.sin(c+Math.PI/4)];n.push(...this.helper.doubleLineOps(i[0],i[1],u[0],u[1],s),...this.helper.doubleLineOps(u[0],u[1],l[0],l[1],s))}})),n}}const u={};class p{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const f=0,d=1,g=2,M={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function k(t,e){return t.type===e}function b(t){const e=[],s=function(t){const e=new Array;for(;""!==t;)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:f,text:RegExp.$1},t=t.substr(RegExp.$1.length);else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:d,text:`${parseFloat(RegExp.$1)}`},t=t.substr(RegExp.$1.length)}return e[e.length]={type:g,text:""},e}(t);let n="BOD",o=0,a=s[o];for(;!k(a,g);){let h=0;const r=[];if("BOD"===n){if("M"!==a.text&&"m"!==a.text)return b("M0,0"+t);o++,h=M[a.text],n=a.text}else k(a,d)?h=M[n]:(o++,h=M[a.text],n=a.text);if(!(o+h<s.length))throw new Error("Path data ended short");for(let t=o;t<o+h;t++){const e=s[t];if(!k(e,d))throw new Error("Param not a number: "+n+","+e.text);r[r.length]=+e.text}if("number"!=typeof M[n])throw new Error("Bad segment: "+n);{const t={key:n,data:r};e.push(t),o+=h,a=s[o],"M"===n&&(n="L"),"m"===n&&(n="l")}}return e}function y(t){let e=0,s=0,n=0,o=0;const a=[];for(const{key:h,data:r}of t)switch(h){case"M":a.push({key:"M",data:[...r]}),[e,s]=r,[n,o]=r;break;case"m":e+=r[0],s+=r[1],a.push({key:"M",data:[e,s]}),n=e,o=s;break;case"L":a.push({key:"L",data:[...r]}),[e,s]=r;break;case"l":e+=r[0],s+=r[1],a.push({key:"L",data:[e,s]});break;case"C":a.push({key:"C",data:[...r]}),e=r[4],s=r[5];break;case"c":{const t=r.map(((t,n)=>n%2?t+s:t+e));a.push({key:"C",data:t}),e=t[4],s=t[5];break}case"Q":a.push({key:"Q",data:[...r]}),e=r[2],s=r[3];break;case"q":{const t=r.map(((t,n)=>n%2?t+s:t+e));a.push({key:"Q",data:t}),e=t[2],s=t[3];break}case"A":a.push({key:"A",data:[...r]}),e=r[5],s=r[6];break;case"a":e+=r[5],s+=r[6],a.push({key:"A",data:[r[0],r[1],r[2],r[3],r[4],e,s]});break;case"H":a.push({key:"H",data:[...r]}),e=r[0];break;case"h":e+=r[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...r]}),s=r[0];break;case"v":s+=r[0],a.push({key:"V",data:[s]});break;case"S":a.push({key:"S",data:[...r]}),e=r[2],s=r[3];break;case"s":{const t=r.map(((t,n)=>n%2?t+s:t+e));a.push({key:"S",data:t}),e=t[2],s=t[3];break}case"T":a.push({key:"T",data:[...r]}),e=r[0],s=r[1];break;case"t":e+=r[0],s+=r[1],a.push({key:"T",data:[e,s]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,s=o}return a}function m(t){const e=[];let s="",n=0,o=0,a=0,h=0,r=0,i=0;for(const{key:c,data:l}of t){switch(c){case"M":e.push({key:"M",data:[...l]}),[n,o]=l,[a,h]=l;break;case"C":e.push({key:"C",data:[...l]}),n=l[4],o=l[5],r=l[2],i=l[3];break;case"L":e.push({key:"L",data:[...l]}),[n,o]=l;break;case"H":n=l[0],e.push({key:"L",data:[n,o]});break;case"V":o=l[0],e.push({key:"L",data:[n,o]});break;case"S":{let t=0,a=0;"C"===s||"S"===s?(t=n+(n-r),a=o+(o-i)):(t=n,a=o),e.push({key:"C",data:[t,a,...l]}),r=l[0],i=l[1],n=l[2],o=l[3];break}case"T":{const[t,a]=l;let h=0,c=0;"Q"===s||"T"===s?(h=n+(n-r),c=o+(o-i)):(h=n,c=o);const u=n+2*(h-n)/3,p=o+2*(c-o)/3,f=t+2*(h-t)/3,d=a+2*(c-a)/3;e.push({key:"C",data:[u,p,f,d,t,a]}),r=h,i=c,n=t,o=a;break}case"Q":{const[t,s,a,h]=l,c=n+2*(t-n)/3,u=o+2*(s-o)/3,p=a+2*(t-a)/3,f=h+2*(s-h)/3;e.push({key:"C",data:[c,u,p,f,a,h]}),r=t,i=s,n=a,o=h;break}case"A":{const t=Math.abs(l[0]),s=Math.abs(l[1]),a=l[2],h=l[3],r=l[4],i=l[5],c=l[6];if(0===t||0===s)e.push({key:"C",data:[n,o,i,c,i,c]}),n=i,o=c;else if(n!==i||o!==c){x(n,o,i,c,t,s,a,h,r).forEach((function(t){e.push({key:"C",data:t})})),n=i,o=c}break}case"Z":e.push({key:"Z",data:[]}),n=a,o=h}s=c}return e}function w(t,e,s){return[t*Math.cos(s)-e*Math.sin(s),t*Math.sin(s)+e*Math.cos(s)]}function x(t,e,s,n,o,a,h,r,i,c){const l=(u=h,Math.PI*u/180);var u;let p=[],f=0,d=0,g=0,M=0;if(c)[f,d,g,M]=c;else{[t,e]=w(t,e,-l),[s,n]=w(s,n,-l);const h=(t-s)/2,c=(e-n)/2;let u=h*h/(o*o)+c*c/(a*a);u>1&&(u=Math.sqrt(u),o*=u,a*=u);const p=o*o,k=a*a,b=p*k-p*c*c-k*h*h,y=p*c*c+k*h*h,m=(r===i?-1:1)*Math.sqrt(Math.abs(b/y));g=m*o*c/a+(t+s)/2,M=m*-a*h/o+(e+n)/2,f=Math.asin(parseFloat(((e-M)/a).toFixed(9))),d=Math.asin(parseFloat(((n-M)/a).toFixed(9))),t<g&&(f=Math.PI-f),s<g&&(d=Math.PI-d),f<0&&(f=2*Math.PI+f),d<0&&(d=2*Math.PI+d),i&&f>d&&(f-=2*Math.PI),!i&&d>f&&(d-=2*Math.PI)}let k=d-f;if(Math.abs(k)>120*Math.PI/180){const t=d,e=s,r=n;d=i&&d>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,p=x(s=g+o*Math.cos(d),n=M+a*Math.sin(d),e,r,o,a,h,0,i,[d,t,g,M])}k=d-f;const b=Math.cos(f),y=Math.sin(f),m=Math.cos(d),P=Math.sin(d),v=Math.tan(k/4),S=4/3*o*v,O=4/3*a*v,L=[t,e],T=[t+S*y,e-O*b],D=[s+S*P,n-O*m],A=[s,n];if(T[0]=2*L[0]-T[0],T[1]=2*L[1]-T[1],c)return[T,D,A].concat(p);{p=[T,D,A].concat(p);const t=[];for(let e=0;e<p.length;e+=3){const s=w(p[e][0],p[e][1],l),n=w(p[e+1][0],p[e+1][1],l),o=w(p[e+2][0],p[e+2][1],l);t.push([s[0],s[1],n[0],n[1],o[0],o[1]])}return t}}const P={randOffset:function(t,e){return G(t,e)},randOffsetWithRange:function(t,e,s){return E(t,e,s)},ellipse:function(t,e,s,n,o){const a=T(s,n,o);return D(t,e,o,a).opset},doubleLineOps:function(t,e,s,n,o){return $(t,e,s,n,o,!0)}};function v(t,e,s,n,o){return{type:"path",ops:$(t,e,s,n,o)}}function S(t,e,s){const n=(t||[]).length;if(n>2){const o=[];for(let e=0;e<n-1;e++)o.push(...$(t[e][0],t[e][1],t[e+1][0],t[e+1][1],s));return e&&o.push(...$(t[n-1][0],t[n-1][1],t[0][0],t[0][1],s)),{type:"path",ops:o}}return 2===n?v(t[0][0],t[0][1],t[1][0],t[1][1],s):{type:"path",ops:[]}}function O(t,e,s,n,o){return function(t,e){return S(t,!0,e)}([[t,e],[t+s,e],[t+s,e+n],[t,e+n]],o)}function L(t,e){if(t.length){const s="number"==typeof t[0][0]?[t]:t,n=j(s[0],1*(1+.2*e.roughness),e),o=e.disableMultiStroke?[]:j(s[0],1.5*(1+.22*e.roughness),z(e));for(let t=1;t<s.length;t++){const a=s[t];if(a.length){const t=j(a,1*(1+.2*e.roughness),e),s=e.disableMultiStroke?[]:j(a,1.5*(1+.22*e.roughness),z(e));for(const e of t)"move"!==e.op&&n.push(e);for(const t of s)"move"!==t.op&&o.push(t)}}return{type:"path",ops:n.concat(o)}}return{type:"path",ops:[]}}function T(t,e,s){const n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),o=Math.ceil(Math.max(s.curveStepCount,s.curveStepCount/Math.sqrt(200)*n)),a=2*Math.PI/o;let h=Math.abs(t/2),r=Math.abs(e/2);const i=1-s.curveFitting;return h+=G(h*i,s),r+=G(r*i,s),{increment:a,rx:h,ry:r}}function D(t,e,s,n){const[o,a]=F(n.increment,t,e,n.rx,n.ry,1,n.increment*E(.1,E(.4,1,s),s),s);let h=q(o,null,s);if(!s.disableMultiStroke&&0!==s.roughness){const[o]=F(n.increment,t,e,n.rx,n.ry,1.5,0,s),a=q(o,null,s);h=h.concat(a)}return{estimatedPoints:a,opset:{type:"path",ops:h}}}function A(t,e,s,n,o,a,h,r,i){const c=t,l=e;let u=Math.abs(s/2),p=Math.abs(n/2);u+=G(.01*u,i),p+=G(.01*p,i);let f=o,d=a;for(;f<0;)f+=2*Math.PI,d+=2*Math.PI;d-f>2*Math.PI&&(f=0,d=2*Math.PI);const g=2*Math.PI/i.curveStepCount,M=Math.min(g/2,(d-f)/2),k=V(M,c,l,u,p,f,d,1,i);if(!i.disableMultiStroke){const t=V(M,c,l,u,p,f,d,1.5,i);k.push(...t)}return h&&(r?k.push(...$(c,l,c+u*Math.cos(f),l+p*Math.sin(f),i),...$(c,l,c+u*Math.cos(d),l+p*Math.sin(d),i)):k.push({op:"lineTo",data:[c,l]},{op:"lineTo",data:[c+u*Math.cos(f),l+p*Math.sin(f)]})),{type:"path",ops:k}}function _(t,e){const s=m(y(b(t))),n=[];let o=[0,0],a=[0,0];for(const{key:t,data:h}of s)switch(t){case"M":a=[h[0],h[1]],o=[h[0],h[1]];break;case"L":n.push(...$(a[0],a[1],h[0],h[1],e)),a=[h[0],h[1]];break;case"C":{const[t,s,o,r,i,c]=h;n.push(...Z(t,s,o,r,i,c,a,e)),a=[i,c];break}case"Z":n.push(...$(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]]}return{type:"path",ops:n}}function I(t,e){const s=[];for(const n of t)if(n.length){const t=e.maxRandomnessOffset||0,o=n.length;if(o>2){s.push({op:"move",data:[n[0][0]+G(t,e),n[0][1]+G(t,e)]});for(let a=1;a<o;a++)s.push({op:"lineTo",data:[n[a][0]+G(t,e),n[a][1]+G(t,e)]})}}return{type:"fillPath",ops:s}}function C(t,e){return function(t,e){let s=t.fillStyle||"hachure";if(!u[s])switch(s){case"zigzag":u[s]||(u[s]=new h(e));break;case"cross-hatch":u[s]||(u[s]=new r(e));break;case"dots":u[s]||(u[s]=new i(e));break;case"dashed":u[s]||(u[s]=new c(e));break;case"zigzag-line":u[s]||(u[s]=new l(e));break;default:s="hachure",u[s]||(u[s]=new o(e))}return u[s]}(e,P).fillPolygons(t,e)}function z(t){const e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}function W(t){return t.randomizer||(t.randomizer=new p(t.seed||0)),t.randomizer.next()}function E(t,e,s,n=1){return s.roughness*n*(W(s)*(e-t)+t)}function G(t,e,s=1){return E(-t,t,e,s)}function $(t,e,s,n,o,a=!1){const h=a?o.disableMultiStrokeFill:o.disableMultiStroke,r=R(t,e,s,n,o,!0,!1);if(h)return r;const i=R(t,e,s,n,o,!0,!0);return r.concat(i)}function R(t,e,s,n,o,a,h){const r=Math.pow(t-s,2)+Math.pow(e-n,2),i=Math.sqrt(r);let c=1;c=i<200?1:i>500?.4:-.0016668*i+1.233334;let l=o.maxRandomnessOffset||0;l*l*100>r&&(l=i/10);const u=l/2,p=.2+.2*W(o);let f=o.bowing*o.maxRandomnessOffset*(n-e)/200,d=o.bowing*o.maxRandomnessOffset*(t-s)/200;f=G(f,o,c),d=G(d,o,c);const g=[],M=()=>G(u,o,c),k=()=>G(l,o,c),b=o.preserveVertices;return a&&(h?g.push({op:"move",data:[t+(b?0:M()),e+(b?0:M())]}):g.push({op:"move",data:[t+(b?0:G(l,o,c)),e+(b?0:G(l,o,c))]})),h?g.push({op:"bcurveTo",data:[f+t+(s-t)*p+M(),d+e+(n-e)*p+M(),f+t+2*(s-t)*p+M(),d+e+2*(n-e)*p+M(),s+(b?0:M()),n+(b?0:M())]}):g.push({op:"bcurveTo",data:[f+t+(s-t)*p+k(),d+e+(n-e)*p+k(),f+t+2*(s-t)*p+k(),d+e+2*(n-e)*p+k(),s+(b?0:k()),n+(b?0:k())]}),g}function j(t,e,s){if(!t.length)return[];const n=[];n.push([t[0][0]+G(e,s),t[0][1]+G(e,s)]),n.push([t[0][0]+G(e,s),t[0][1]+G(e,s)]);for(let o=1;o<t.length;o++)n.push([t[o][0]+G(e,s),t[o][1]+G(e,s)]),o===t.length-1&&n.push([t[o][0]+G(e,s),t[o][1]+G(e,s)]);return q(n,null,s)}function q(t,e,s){const n=t.length,o=[];if(n>3){const a=[],h=1-s.curveTightness;o.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+2<n;e++){const s=t[e];a[0]=[s[0],s[1]],a[1]=[s[0]+(h*t[e+1][0]-h*t[e-1][0])/6,s[1]+(h*t[e+1][1]-h*t[e-1][1])/6],a[2]=[t[e+1][0]+(h*t[e][0]-h*t[e+2][0])/6,t[e+1][1]+(h*t[e][1]-h*t[e+2][1])/6],a[3]=[t[e+1][0],t[e+1][1]],o.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(e&&2===e.length){const t=s.maxRandomnessOffset;o.push({op:"lineTo",data:[e[0]+G(t,s),e[1]+G(t,s)]})}}else 3===n?(o.push({op:"move",data:[t[1][0],t[1][1]]}),o.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):2===n&&o.push(...R(t[0][0],t[0][1],t[1][0],t[1][1],s,!0,!0));return o}function F(t,e,s,n,o,a,h,r){const i=[],c=[];if(0===r.roughness){t/=4,c.push([e+n*Math.cos(-t),s+o*Math.sin(-t)]);for(let a=0;a<=2*Math.PI;a+=t){const t=[e+n*Math.cos(a),s+o*Math.sin(a)];i.push(t),c.push(t)}c.push([e+n*Math.cos(0),s+o*Math.sin(0)]),c.push([e+n*Math.cos(t),s+o*Math.sin(t)])}else{const l=G(.5,r)-Math.PI/2;c.push([G(a,r)+e+.9*n*Math.cos(l-t),G(a,r)+s+.9*o*Math.sin(l-t)]);const u=2*Math.PI+l-.01;for(let h=l;h<u;h+=t){const t=[G(a,r)+e+n*Math.cos(h),G(a,r)+s+o*Math.sin(h)];i.push(t),c.push(t)}c.push([G(a,r)+e+n*Math.cos(l+2*Math.PI+.5*h),G(a,r)+s+o*Math.sin(l+2*Math.PI+.5*h)]),c.push([G(a,r)+e+.98*n*Math.cos(l+h),G(a,r)+s+.98*o*Math.sin(l+h)]),c.push([G(a,r)+e+.9*n*Math.cos(l+.5*h),G(a,r)+s+.9*o*Math.sin(l+.5*h)])}return[c,i]}function V(t,e,s,n,o,a,h,r,i){const c=a+G(.1,i),l=[];l.push([G(r,i)+e+.9*n*Math.cos(c-t),G(r,i)+s+.9*o*Math.sin(c-t)]);for(let a=c;a<=h;a+=t)l.push([G(r,i)+e+n*Math.cos(a),G(r,i)+s+o*Math.sin(a)]);return l.push([e+n*Math.cos(h),s+o*Math.sin(h)]),l.push([e+n*Math.cos(h),s+o*Math.sin(h)]),q(l,null,i)}function Z(t,e,s,n,o,a,h,r){const i=[],c=[r.maxRandomnessOffset||1,(r.maxRandomnessOffset||1)+.3];let l=[0,0];const u=r.disableMultiStroke?1:2,p=r.preserveVertices;for(let f=0;f<u;f++)0===f?i.push({op:"move",data:[h[0],h[1]]}):i.push({op:"move",data:[h[0]+(p?0:G(c[0],r)),h[1]+(p?0:G(c[0],r))]}),l=p?[o,a]:[o+G(c[f],r),a+G(c[f],r)],i.push({op:"bcurveTo",data:[t+G(c[f],r),e+G(c[f],r),s+G(c[f],r),n+G(c[f],r),l[0],l[1]]});return i}function Q(t){return[...t]}function H(t,e=0){const s=t.length;if(s<3)throw new Error("A curve must have at least three points.");const n=[];if(3===s)n.push(Q(t[0]),Q(t[1]),Q(t[2]),Q(t[2]));else{const s=[];s.push(t[0],t[0]);for(let e=1;e<t.length;e++)s.push(t[e]),e===t.length-1&&s.push(t[e]);const o=[],a=1-e;n.push(Q(s[0]));for(let t=1;t+2<s.length;t++){const e=s[t];o[0]=[e[0],e[1]],o[1]=[e[0]+(a*s[t+1][0]-a*s[t-1][0])/6,e[1]+(a*s[t+1][1]-a*s[t-1][1])/6],o[2]=[s[t+1][0]+(a*s[t][0]-a*s[t+2][0])/6,s[t+1][1]+(a*s[t][1]-a*s[t+2][1])/6],o[3]=[s[t+1][0],s[t+1][1]],n.push(o[1],o[2],o[3])}}return n}function N(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function B(t,e,s){const n=N(e,s);if(0===n)return N(t,e);let o=((t[0]-e[0])*(s[0]-e[0])+(t[1]-e[1])*(s[1]-e[1]))/n;return o=Math.max(0,Math.min(1,o)),N(t,J(e,s,o))}function J(t,e,s){return[t[0]+(e[0]-t[0])*s,t[1]+(e[1]-t[1])*s]}function K(t,e,s,n){const o=n||[];if(function(t,e){const s=t[e+0],n=t[e+1],o=t[e+2],a=t[e+3];let h=3*n[0]-2*s[0]-a[0];h*=h;let r=3*n[1]-2*s[1]-a[1];r*=r;let i=3*o[0]-2*a[0]-s[0];i*=i;let c=3*o[1]-2*a[1]-s[1];return c*=c,h<i&&(h=i),r<c&&(r=c),h+r}(t,e)<s){const s=t[e+0];if(o.length){(a=o[o.length-1],h=s,Math.sqrt(N(a,h)))>1&&o.push(s)}else o.push(s);o.push(t[e+3])}else{const n=.5,a=t[e+0],h=t[e+1],r=t[e+2],i=t[e+3],c=J(a,h,n),l=J(h,r,n),u=J(r,i,n),p=J(c,l,n),f=J(l,u,n),d=J(p,f,n);K([a,c,p,d],0,s,o),K([d,f,u,i],0,s,o)}var a,h;return o}function U(t,e){return X(t,0,t.length,e)}function X(t,e,s,n,o){const a=o||[],h=t[e],r=t[s-1];let i=0,c=1;for(let n=e+1;n<s-1;++n){const e=B(t[n],h,r);e>i&&(i=e,c=n)}return Math.sqrt(i)>n?(X(t,e,c+1,n,a),X(t,c,s,n,a)):(a.length||a.push(h),a.push(r)),a}function Y(t,e=.15,s){const n=[],o=(t.length-1)/3;for(let s=0;s<o;s++){K(t,3*s,e,n)}return s&&s>0?X(n,0,n.length,s):n}const tt="none";class et{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,s){return{shape:t,sets:e||[],options:s||this.defaultOptions}}line(t,e,s,n,o){const a=this._o(o);return this._d("line",[v(t,e,s,n,a)],a)}rectangle(t,e,s,n,o){const a=this._o(o),h=[],r=O(t,e,s,n,a);if(a.fill){const o=[[t,e],[t+s,e],[t+s,e+n],[t,e+n]];"solid"===a.fillStyle?h.push(I([o],a)):h.push(C([o],a))}return a.stroke!==tt&&h.push(r),this._d("rectangle",h,a)}ellipse(t,e,s,n,o){const a=this._o(o),h=[],r=T(s,n,a),i=D(t,e,a,r);if(a.fill)if("solid"===a.fillStyle){const s=D(t,e,a,r).opset;s.type="fillPath",h.push(s)}else h.push(C([i.estimatedPoints],a));return a.stroke!==tt&&h.push(i.opset),this._d("ellipse",h,a)}circle(t,e,s,n){const o=this.ellipse(t,e,s,s,n);return o.shape="circle",o}linearPath(t,e){const s=this._o(e);return this._d("linearPath",[S(t,!1,s)],s)}arc(t,e,s,n,o,a,h=!1,r){const i=this._o(r),c=[],l=A(t,e,s,n,o,a,h,!0,i);if(h&&i.fill)if("solid"===i.fillStyle){const h=Object.assign({},i);h.disableMultiStroke=!0;const r=A(t,e,s,n,o,a,!0,!1,h);r.type="fillPath",c.push(r)}else c.push(function(t,e,s,n,o,a,h){const r=t,i=e;let c=Math.abs(s/2),l=Math.abs(n/2);c+=G(.01*c,h),l+=G(.01*l,h);let u=o,p=a;for(;u<0;)u+=2*Math.PI,p+=2*Math.PI;p-u>2*Math.PI&&(u=0,p=2*Math.PI);const f=(p-u)/h.curveStepCount,d=[];for(let t=u;t<=p;t+=f)d.push([r+c*Math.cos(t),i+l*Math.sin(t)]);return d.push([r+c*Math.cos(p),i+l*Math.sin(p)]),d.push([r,i]),C([d],h)}(t,e,s,n,o,a,i));return i.stroke!==tt&&c.push(l),this._d("arc",c,i)}curve(t,e){const s=this._o(e),n=[],o=L(t,s);if(s.fill&&s.fill!==tt)if("solid"===s.fillStyle){const e=L(t,Object.assign(Object.assign({},s),{disableMultiStroke:!0,roughness:s.roughness?s.roughness+s.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else{const e=[],o=t;if(o.length){const t="number"==typeof o[0][0]?[o]:o;for(const n of t)n.length<3?e.push(...n):3===n.length?e.push(...Y(H([n[0],n[0],n[1],n[2]]),10,(1+s.roughness)/2)):e.push(...Y(H(n),10,(1+s.roughness)/2))}e.length&&n.push(C([e],s))}return s.stroke!==tt&&n.push(o),this._d("curve",n,s)}polygon(t,e){const s=this._o(e),n=[],o=S(t,!0,s);return s.fill&&("solid"===s.fillStyle?n.push(I([t],s)):n.push(C([t],s))),s.stroke!==tt&&n.push(o),this._d("polygon",n,s)}path(t,e){const s=this._o(e),n=[];if(!t)return this._d("path",n,s);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const o=s.fill&&"transparent"!==s.fill&&s.fill!==tt,a=s.stroke!==tt,h=!!(s.simplification&&s.simplification<1),r=function(t,e,s){const n=m(y(b(t))),o=[];let a=[],h=[0,0],r=[];const i=()=>{r.length>=4&&a.push(...Y(r,e)),r=[]},c=()=>{i(),a.length&&(o.push(a),a=[])};for(const{key:t,data:e}of n)switch(t){case"M":c(),h=[e[0],e[1]],a.push(h);break;case"L":i(),a.push([e[0],e[1]]);break;case"C":if(!r.length){const t=a.length?a[a.length-1]:h;r.push([t[0],t[1]])}r.push([e[0],e[1]]),r.push([e[2],e[3]]),r.push([e[4],e[5]]);break;case"Z":i(),a.push([h[0],h[1]])}if(c(),!s)return o;const l=[];for(const t of o){const e=U(t,s);e.length&&l.push(e)}return l}(t,1,h?4-4*(s.simplification||1):(1+s.roughness)/2),i=_(t,s);if(o)if("solid"===s.fillStyle)if(1===r.length){const e=_(t,Object.assign(Object.assign({},s),{disableMultiStroke:!0,roughness:s.roughness?s.roughness+s.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else n.push(I(r,s));else n.push(C(r,s));return a&&(h?r.forEach((t=>{n.push(S(t,!1,s))})):n.push(i)),this._d("path",n,s)}opsToPath(t,e){let s="";for(const n of t.ops){const t="number"==typeof e&&e>=0?n.data.map((t=>+t.toFixed(e))):n.data;switch(n.op){case"move":s+=`M${t[0]} ${t[1]} `;break;case"bcurveTo":s+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case"lineTo":s+=`L${t[0]} ${t[1]} `}}return s.trim()}toPaths(t){const e=t.sets||[],s=t.options||this.defaultOptions,n=[];for(const t of e){let e=null;switch(t.type){case"path":e={d:this.opsToPath(t),stroke:s.stroke,strokeWidth:s.strokeWidth,fill:tt};break;case"fillPath":e={d:this.opsToPath(t),stroke:tt,strokeWidth:0,fill:s.fill||tt};break;case"fillSketch":e=this.fillSketch(t,s)}e&&n.push(e)}return n}fillSketch(t,e){let s=e.fillWeight;return s<0&&(s=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||tt,strokeWidth:s,fill:tt}}_mergedShape(t){return t.filter(((t,e)=>0===e||"move"!==t.op))}}class st{constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new et(e)}draw(t){const e=t.sets||[],s=t.options||this.getDefaultOptions(),n=this.ctx,o=t.options.fixedDecimalPlaceDigits;for(const a of e)switch(a.type){case"path":n.save(),n.strokeStyle="none"===s.stroke?"transparent":s.stroke,n.lineWidth=s.strokeWidth,s.strokeLineDash&&n.setLineDash(s.strokeLineDash),s.strokeLineDashOffset&&(n.lineDashOffset=s.strokeLineDashOffset),this._drawToContext(n,a,o),n.restore();break;case"fillPath":{n.save(),n.fillStyle=s.fill||"";const e="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(n,a,o,e),n.restore();break}case"fillSketch":this.fillSketch(n,a,s)}}fillSketch(t,e,s){let n=s.fillWeight;n<0&&(n=s.strokeWidth/2),t.save(),s.fillLineDash&&t.setLineDash(s.fillLineDash),s.fillLineDashOffset&&(t.lineDashOffset=s.fillLineDashOffset),t.strokeStyle=s.fill||"",t.lineWidth=n,this._drawToContext(t,e,s.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,s,n="nonzero"){t.beginPath();for(const n of e.ops){const e="number"==typeof s&&s>=0?n.data.map((t=>+t.toFixed(s))):n.data;switch(n.op){case"move":t.moveTo(e[0],e[1]);break;case"bcurveTo":t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]);break;case"lineTo":t.lineTo(e[0],e[1])}}"fillPath"===e.type?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,s,n,o){const a=this.gen.line(t,e,s,n,o);return this.draw(a),a}rectangle(t,e,s,n,o){const a=this.gen.rectangle(t,e,s,n,o);return this.draw(a),a}ellipse(t,e,s,n,o){const a=this.gen.ellipse(t,e,s,n,o);return this.draw(a),a}circle(t,e,s,n){const o=this.gen.circle(t,e,s,n);return this.draw(o),o}linearPath(t,e){const s=this.gen.linearPath(t,e);return this.draw(s),s}polygon(t,e){const s=this.gen.polygon(t,e);return this.draw(s),s}arc(t,e,s,n,o,a,h=!1,r){const i=this.gen.arc(t,e,s,n,o,a,h,r);return this.draw(i),i}curve(t,e){const s=this.gen.curve(t,e);return this.draw(s),s}path(t,e){const s=this.gen.path(t,e);return this.draw(s),s}}const nt="http://www.w3.org/2000/svg";class ot{constructor(t,e){this.svg=t,this.gen=new et(e)}draw(t){const e=t.sets||[],s=t.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,o=n.createElementNS(nt,"g"),a=t.options.fixedDecimalPlaceDigits;for(const h of e){let e=null;switch(h.type){case"path":e=n.createElementNS(nt,"path"),e.setAttribute("d",this.opsToPath(h,a)),e.setAttribute("stroke",s.stroke),e.setAttribute("stroke-width",s.strokeWidth+""),e.setAttribute("fill","none"),s.strokeLineDash&&e.setAttribute("stroke-dasharray",s.strokeLineDash.join(" ").trim()),s.strokeLineDashOffset&&e.setAttribute("stroke-dashoffset",`${s.strokeLineDashOffset}`);break;case"fillPath":e=n.createElementNS(nt,"path"),e.setAttribute("d",this.opsToPath(h,a)),e.setAttribute("stroke","none"),e.setAttribute("stroke-width","0"),e.setAttribute("fill",s.fill||""),"curve"!==t.shape&&"polygon"!==t.shape||e.setAttribute("fill-rule","evenodd");break;case"fillSketch":e=this.fillSketch(n,h,s)}e&&o.appendChild(e)}return o}fillSketch(t,e,s){let n=s.fillWeight;n<0&&(n=s.strokeWidth/2);const o=t.createElementNS(nt,"path");return o.setAttribute("d",this.opsToPath(e,s.fixedDecimalPlaceDigits)),o.setAttribute("stroke",s.fill||""),o.setAttribute("stroke-width",n+""),o.setAttribute("fill","none"),s.fillLineDash&&o.setAttribute("stroke-dasharray",s.fillLineDash.join(" ").trim()),s.fillLineDashOffset&&o.setAttribute("stroke-dashoffset",`${s.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,e){return this.gen.opsToPath(t,e)}line(t,e,s,n,o){const a=this.gen.line(t,e,s,n,o);return this.draw(a)}rectangle(t,e,s,n,o){const a=this.gen.rectangle(t,e,s,n,o);return this.draw(a)}ellipse(t,e,s,n,o){const a=this.gen.ellipse(t,e,s,n,o);return this.draw(a)}circle(t,e,s,n){const o=this.gen.circle(t,e,s,n);return this.draw(o)}linearPath(t,e){const s=this.gen.linearPath(t,e);return this.draw(s)}polygon(t,e){const s=this.gen.polygon(t,e);return this.draw(s)}arc(t,e,s,n,o,a,h=!1,r){const i=this.gen.arc(t,e,s,n,o,a,h,r);return this.draw(i)}curve(t,e){const s=this.gen.curve(t,e);return this.draw(s)}path(t,e){const s=this.gen.path(t,e);return this.draw(s)}}return{canvas:(t,e)=>new st(t,e),svg:(t,e)=>new ot(t,e),generator:t=>new et(t),newSeed:()=>et.newSeed()}}();
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);128>d?b+=String.fromCharCode(d):
(127<d&&2048>d?b+=String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),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);128>d?(b+=String.fromCharCode(d),c++):191<d&&224>d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3)}return b}};window.urlParams=window.urlParams||{};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.PLANT_URL=window.PLANT_URL||"https://plant-aws.diagrams.net";window.DRAW_MATH_URL=window.DRAW_MATH_URL||"math/es5";window.VSS_CONVERT_URL=window.VSS_CONVERT_URL||"https://convert.diagrams.net/VsdConverter/api/converter";
window.EMF_CONVERT_URL=window.EMF_CONVERT_URL||"https://convert.diagrams.net/emf2png/convertEMF";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||window.DRAWIO_SERVER_URL+"notifications";
window.RT_WEBSOCKET_URL=window.RT_WEBSOCKET_URL||"wss://"+("test.draw.io"==window.location.hostname?"app.diagrams.net":window.location.hostname)+"/rt";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.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",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");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&&isLocalStorage)try{var a=localStorage.getItem("1"==urlParams.sketch?".sketch-config":".drawio-config"),b=!1;null!=a&&(b=JSON.parse(a).showStartScreen);0==b&&null==urlParams.splash&&(urlParams.splash="0")}catch(d){}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;if("test.draw.io"!=a){var 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="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"],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:"28.0.7",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),
IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:/Apple Computer, Inc/.test(navigator.vendor),
IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2<navigator.maxTouchPoints,IS_WEBVIEW:/((iPhone|iPod|iPad).*AppleWebKit(?!.*Version)|; wv)/i.test(navigator.userAgent),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:-1<navigator.userAgent.toLowerCase().indexOf("firefox"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&
0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||
"[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:mxClient.IS_IE?navigator.userLanguage: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_IE)&&!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.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,6}|rgba?\([^)]+\)|var\([^)]+\)|[a-zA-Z]+)\s*,\s*(#[0-9a-fA-F]{3,6}|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(){return mxClient.IS_IE&&
(null==document.documentMode||9>document.documentMode)?function(a){return null!=a?a.currentStyle:null}: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);d&&(a[c]=a[c].substring(1,a[c].length-1));b&&(a[c]=mxUtils.htmlEntities(a[c]));if(d||0<=a[c].indexOf(" "))a[c]='"'+a[c]+'"'}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},setPrefixedStyle:function(){var a=null;mxClient.IS_OT?a="O":mxClient.IS_SF||mxClient.IS_GC?a="Webkit":mxClient.IS_MT?a="Moz":mxClient.IS_IE&&
9<=document.documentMode&&10>document.documentMode&&(a="ms");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 mxClient.IS_IE&&(null==document.documentMode||10>document.documentMode)?mxUtils.importNodeImplementation(a,b,c):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(a.replace(/&#([0-9a-fA-F]+);/g,""),"text/xml"));return c},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,"&amp;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");if(null==c||c)a=a.replace(/"/g,"&quot;"),a=a.replace(/'/g,"&#39;");if(null==b||b)a=a.replace(/\n/g,"&#xa;");if(null==d||d)a=a.replace(/\t/g,"&#x9;");return a},decodeHtml:function(a){var b=document.createElement("textarea");b.innerHTML=a;return b.value},getXml:function(a,
b){var c="";mxClient.IS_IE||mxClient.IS_IE11?c=mxUtils.getPrettyXml(a,"","",""):null!=window.XMLSerializer?c=(new XMLSerializer).serializeToString(a):null!=a.xml&&(c=a.xml.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n"));return c.replace(/\n/g,b||"&#xa;")},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.getTextContent(a),0<a.length&&f.push(c+"\x3c!--"+a+"--\x3e"+d);else if(a.nodeType==mxConstants.NODETYPE_TEXT)a=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.getTextContent(a),0<a.length&&f.push(c+"<![CDATA["+a+"]]"+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(g[k].value);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(){return mxClient.IS_IE?function(a){return null!=a?a.innerHTML:""}:function(a){return null!=a?(new XMLSerializer).serializeToString(a):""}}(),getOuterHtml:function(){return mxClient.IS_IE?function(a){if(null!=a){if(null!=a.outerHTML)return a.outerHTML;var b=[];b.push("<"+a.nodeName);var c=a.attributes;if(null!=c)for(var d=0;d<c.length;d++){var e=c[d].value;null!=e&&0<e.length&&(b.push(" "),b.push(c[d].nodeName),
b.push('="'),b.push(e),b.push('"'))}0==a.innerHTML.length?b.push("/>"):(b.push(">"),b.push(a.innerHTML),b.push("</"+a.nodeName+">"));return b.join("")}return""}: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){mxClient.IS_IE?b.onreadystatechange=function(){4==b.readyState&&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)},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?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(m){return Math.round(b/100*(255-m)+m*(1-b/100))}function e(m){return Math.round(Math.max(0,Math.min(255,m)))}c=null!=c?c:180;b=null!=b?b:93;var f=0,g=0,k=0;if("transparent"==a.toLowerCase())return a;k=mxUtils.parseColor(a);if(null==k)return a;f=k.r;g=k.g;k=k.b;f=d(f);g=d(g);k=d(k);a=[1,0,0,0,1,0,0,0,1];var l=Math.cos(c*Math.PI/180);c=Math.sin(c*Math.PI/180);a[0]=.2126+.7874*l-.2126*c;a[1]=.7152-.7152*l-.7152*c;a[2]=.0722-.0722*l+.9278*c;a[3]=.2126-.2126*
l+.143*c;a[4]=.7152+(1-.7152)*l+.14*c;a[5]=.0722-.0722*l-.283*c;a[6]=.2126-.2126*l-.7874*c;a[7]=.7152-.7152*l+.7152*c;a[8]=.0722+.9278*l+.0722*c;c=e(a[0]*f+a[1]*g+a[2]*k);l=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|l<<8|f).toString(16).slice(1)},addAlphaToColor:function(a,b){null!=b&&null!=a&&"transparent"!=a&&(a=mxUtils.parseColor(a),a="rgba("+a.r+","+a.g+","+a.b+","+b+")");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((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 C=-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-C+a);A[y+3]=Number(u-v+b);A[y+4]=Number(t+a);A[y+5]=Number(u+b);q=t+C;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);(32<=e||9==e||10==e||13==e)&&65535!=e&&65534!=e||(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)},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 0<=g&&1>=g&&0<=e&&1>=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){mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?a.style.filter=100<=b?"":"alpha(opacity="+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()}}},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);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):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: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);if(null==a||0==a.length)d&&(a=b+"="+c+";");else if(a.substring(0,b.length+1)==b+"="){var e=a.indexOf(";");a=d?b+"="+c+(0>e?";":a.substring(e)):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||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)},getSizeForString:function(a,b,c,d,e){b=null!=b?b:mxConstants.DEFAULT_FONTSIZE;c=null!=c?c:mxConstants.DEFAULT_FONTFAMILY;var f=document.createElement("div");f.style.fontFamily=c;f.style.fontSize=Math.round(b)+"px";f.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?b*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*mxSvgCanvas2D.prototype.lineHeightCorrection;null!=e&&((e&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(f.style.fontWeight="bold"),(e&mxConstants.FONT_ITALIC)==
mxConstants.FONT_ITALIC&&(f.style.fontStyle="italic"),b=[],(e&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.push("underline"),(e&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&b.push("line-through"),0<b.length&&(f.style.textDecoration=b.join(" ")));f.style.position="absolute";f.style.visibility="hidden";f.style.display="inline-block";f.style.zoom="1";null!=d?(f.style.width=d+"px",f.style.whiteSpace="normal"):f.style.whiteSpace="nowrap";f.innerHTML=a;document.body.appendChild(f);
a=new mxRectangle(0,0,f.offsetWidth,f.offsetHeight);document.body.removeChild(f);return a},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();9==document.documentMode&&b.writeln('\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=9"><![endif]--\x3e');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));if(mxClient.IS_IE||11==document.documentMode){d="<html><head>";
g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)d+=g[c].outerHTML;d+="<style>";for(c=0;c<document.styleSheets.length;c++)try{d+=document.styleSheets[c].cssText}catch(m){}d=d+'</style></head><body style="margin:0px;"><div style="position:absolute;overflow:hidden;width:'+(e+"px;height:"+f+'px;"><div style="position:relative;left:'+k+"px;top:"+l+'px;">')+a.container.innerHTML;b.writeln(d+"</div></div></body><html>");b.close()}else{b.writeln("<html><head>");g=document.getElementsByTagName("base");
for(c=0;c<g.length;c++)b.writeln(mxUtils.getOuterHtml(g[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,"&nbsp;");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,"&nbsp;"),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"),mxClient.IS_IE?c.style.cssText="float:right":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},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:mxClient.IS_IE?2: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_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_SWIMLANE_LINE:"swimlaneLine",
STYLE_SWIMLANE_HEAD:"swimlaneHead",STYLE_SWIMLANE_BODY:"swimlaneBody",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_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_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,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();mxClient.IS_IE&&(this.evt.returnValue=!0);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?!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,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",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",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.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.buttons.style.top="5px";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.nodeType==mxConstants.NODETYPE_TEXT&&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){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)&&"http://"!=a.substring(0,7)&&"file://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&"//"!=a.substring(0,2)};
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);mxUtils.fit(this.div)};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();a.beforePaint(b);a.paint(b);a.afterPaint(b);b.restore();a.node=d;b.root=c}};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,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){a==mxConstants.NONE&&(a=null);this.state.fillStyle=a};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.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=null;this.styleEnabled=null!=b?b:!1;b=this.adaptiveColors=null;if(a.ownerDocument!=document){for(;null!=a&&"svg"!=a.nodeName;)a=a.parentNode;b=a}null!=b&&(0<b.getElementsByTagName("defs").length&&(this.defs=b.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=b.firstChild?b.insertBefore(this.defs,b.firstChild):b.appendChild(this.defs)),
this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D);
(function(){mxSvgCanvas2D.prototype.useDomParser=!mxClient.IS_IE&&"function"===typeof DOMParser&&"function"===typeof XMLSerializer;if(mxSvgCanvas2D.prototype.useDomParser)try{var a=(new DOMParser).parseFromString("test text","text/html");mxSvgCanvas2D.prototype.useDomParser=null!=a}catch(b){mxSvgCanvas2D.prototype.useDomParser=!1}mxSvgCanvas2D.prototype.useAbsoluteIds=!mxClient.IS_CHROMEAPP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&0<document.getElementsByTagName("base").length})();
mxSvgCanvas2D.prototype.node=null;mxSvgCanvas2D.prototype.matchHtmlAlignment=!0;mxSvgCanvas2D.prototype.textEnabled=!0;mxSvgCanvas2D.prototype.foEnabled=!0;mxSvgCanvas2D.prototype.foAltText="[Object]";mxSvgCanvas2D.prototype.foOffset=0;mxSvgCanvas2D.prototype.textOffset=0;mxSvgCanvas2D.prototype.imageOffset=0;mxSvgCanvas2D.prototype.strokeTolerance=0;mxSvgCanvas2D.prototype.minStrokeWidth=1;mxSvgCanvas2D.prototype.refCount=0;mxSvgCanvas2D.prototype.lineHeightCorrection=1;
mxSvgCanvas2D.prototype.pointerEventsValue="all";mxSvgCanvas2D.prototype.fontMetricsPadding=10;mxSvgCanvas2D.prototype.foreignObjectPadding=2;mxSvgCanvas2D.prototype.cacheOffsetSize=!0;mxSvgCanvas2D.prototype.allowConvertHtmlToSvg=!1;mxSvgCanvas2D.prototype.setCssText=function(a,b){null!=a&&a.setAttribute("style",b)};mxSvgCanvas2D.prototype.getLightDarkColor=function(a){return mxUtils.getLightDarkColor(a,null,null,"simple"==this.adaptiveColors)};mxSvgCanvas2D.prototype.format=function(a){return parseFloat(parseFloat(a).toFixed(2))};
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.createAlternateContent=function(a,b,c,d,e,f,g,k,l,m,n,p,q){a=this.getAlternateText(a,b,c,d,e,f,g,k,l,m,n,p,q);d=this.state;return null!=a&&0<d.fontSize?(k=k==mxConstants.ALIGN_TOP?1:k==mxConstants.ALIGN_BOTTOM?0:.3,e=g==mxConstants.ALIGN_RIGHT?"end":g==mxConstants.ALIGN_LEFT?"start":"middle",g=this.createElement("text"),g.setAttribute("x",Math.round(b+d.dx)),g.setAttribute("y",Math.round(c+d.dy+k*d.fontSize)),g.setAttribute("fill",d.fontColor||"black"),g.setAttribute("font-family",
mxUtils.parseCssFontFamily(d.fontFamily)),g.setAttribute("font-size",Math.round(d.fontSize)+"px"),"start"!=e&&g.setAttribute("text-anchor",e),(d.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&g.setAttribute("font-weight","bold"),(d.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&g.setAttribute("font-style","italic"),b=[],(d.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.push("underline"),(d.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&
b.push("line-through"),0<b.length&&g.setAttribute("text-decoration",b.join(" ")),mxUtils.write(g,a),g):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){return("mx-pattern-"+a+"-"+b+"-"+c).toLowerCase().replace(/^[^a-z]+|[^\w:.-]+/gi,"_")};
mxSvgCanvas2D.prototype.getFillPattern=function(a,b,c,d){c=this.getLightDarkColor(c);var e=this.createFillPatternId(a,b,c.cssText),f=this.fillPatterns[e];if(null==f){var g=this.root.ownerSVGElement,k=0,l=e+"-"+k;if(null!=g)for(f=g.ownerDocument.getElementById(l);null!=f&&f.ownerSVGElement!=g;)l=e+"-"+k++,f=g.ownerDocument.getElementById(l);else l="id"+ ++this.refCount;if(null==f){switch(a){case "hatch":f=this.createHatchPattern(b,c,d);break;case "dots":f=this.createDotsPattern(b,c,d);break;case "cross-hatch":f=
this.createCrossHatchPattern(b,c,d);break;case "dashed":f=this.createDashedPattern(b,c,d);break;case "zigzag":case "zigzag-line":f=this.createZigZagLinePattern(b,c,d);break;default:return null}f.setAttribute("id",l);null!=this.defs?this.defs.appendChild(f):g.appendChild(f)}this.fillPatterns[e]=f}return f.getAttribute("id")};
mxSvgCanvas2D.prototype.createHatchPattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1","0");e.setAttribute("x2","0");e.setAttribute("y2",c);e.setAttribute("stroke",b.light);e.style.stroke=
b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);return d};
mxSvgCanvas2D.prototype.createDashedPattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("line");e.setAttribute("x1","0");e.setAttribute("y1",c/4);e.setAttribute("x2","0");e.setAttribute("y2",3*c/4);e.setAttribute("stroke",b.light);e.style.stroke=
b.cssText;e.setAttribute("stroke-width",a);d.appendChild(e);return d};
mxSvgCanvas2D.prototype.createZigZagLinePattern=function(a,b,c){a=1.5*a*c;c=this.format((10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("path"),f=c/4,g=3*c/4;e.setAttribute("d","M "+f+" 0 L "+g+" 0 L "+f+" "+c+" L "+g+" "+c);e.setAttribute("stroke",b.light);e.style.stroke=b.cssText;
e.setAttribute("stroke-width",a);e.setAttribute("fill","none");d.appendChild(e);return d};
mxSvgCanvas2D.prototype.createCrossHatchPattern=function(a,b,c){a=.5*a*c;c=this.format(1.5*(10+a)*c);var d=this.createElement("pattern");d.setAttribute("patternUnits","userSpaceOnUse");d.setAttribute("width",c);d.setAttribute("height",c);d.setAttribute("x","0");d.setAttribute("y","0");d.setAttribute("patternTransform","rotate(45)");var e=this.createElement("rect");e.setAttribute("x",0);e.setAttribute("y",0);e.setAttribute("width",c);e.setAttribute("height",c);e.setAttribute("stroke",b.light);e.style.stroke=
b.cssText;e.setAttribute("stroke-width",a);e.setAttribute("fill","none");d.appendChild(e);return d};
mxSvgCanvas2D.prototype.createDotsPattern=function(a,b,c){a=this.format((10+a)*c);c=this.createElement("pattern");c.setAttribute("patternUnits","userSpaceOnUse");c.setAttribute("width",a);c.setAttribute("height",a);c.setAttribute("x","0");c.setAttribute("y","0");var d=this.createElement("circle");d.setAttribute("cx",a/2);d.setAttribute("cy",a/2);d.setAttribute("r",a/4);d.setAttribute("stroke","none");d.setAttribute("fill",b.light);d.style.fill=b.cssText;c.appendChild(d);return c};
mxSvgCanvas2D.prototype.addTitle=function(a){if(null!=a&&null!=this.title){var b=this.createElement("title");mxUtils.write(b,this.title);a.appendChild(b)}return a};
mxSvgCanvas2D.prototype.addNode=function(a,b){var c=this.addTitle(this.node),d=this.state;if(null!=c){if("path"==c.nodeName)if(null!=this.path&&0<this.path.length)c.setAttribute("d",this.path.join(" "));else return;a&&null!=d.fillColor?this.updateFill():this.styleEnabled||("ellipse"==c.nodeName&&mxClient.IS_FF?c.setAttribute("fill","transparent"):c.setAttribute("fill","none"),a=!1);b&&null!=d.strokeColor?this.updateStroke():this.styleEnabled||c.setAttribute("stroke","none");null!=d.transform&&0<d.transform.length&&
c.setAttribute("transform",d.transform);this.pointerEvents?c.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||c.setAttribute("pointer-events","none");0<this.strokeTolerance&&(!a||null==d.fillColor||!mxShape.forceFilledPointerEvents&&!this.pointerEvents&&null==this.originalRoot)&&this.addTolerance(c);("rect"!=c.nodeName&&"path"!=c.nodeName&&"ellipse"!=c.nodeName||"none"!=c.getAttribute("fill")&&"transparent"!=c.getAttribute("fill")||"none"!=c.getAttribute("stroke")||
"none"!=c.getAttribute("pointer-events"))&&this.root.appendChild(c);this.node=null}};mxSvgCanvas2D.prototype.getShadowFilter=function(){var a=this.state,b=a.shadowStyle;if(1!=a.scale){var c=b.split("(");if(0<c.length){var d=c[1].split(" ");3<d.length&&(b=function(e){return Math.round(parseFloat(d[e])*a.scale*100)/100+"px"},b=c[0]+"("+b(0)+" "+b(1)+" "+b(2)+" "+d.slice(3).join(" ")+(2<c.length?"("+c.slice(2).join("("):""))}}return b};mxSvgCanvas2D.prototype.addTolerance=function(a){this.root.appendChild(this.createTolerance(a))};
mxSvgCanvas2D.prototype.updateFill=function(){var a=this.state;(1>a.alpha||1>a.fillAlpha)&&this.node.setAttribute("fill-opacity",a.alpha*a.fillAlpha);var b=!1;if(null!=a.fillColor)if(null!=a.gradientColor&&a.gradientColor!=mxConstants.NONE){b=!0;var c=this.getSvgGradient(String(a.fillColor),String(a.gradientColor),a.gradientFillAlpha,a.gradientAlpha,a.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");c="url("+d+"#"+c+
")"}else c="url(#"+c+")";d=c}else c=this.getLightDarkColor(String(a.fillColor).toLowerCase()),d=c.light,c=c.cssText;a=null==a.fillStyle||"auto"==a.fillStyle||"solid"==a.fillStyle?null:this.getFillPattern(a.fillStyle,this.getCurrentStrokeWidth(),c,a.scale);b||null==a?(this.node.setAttribute("fill",d),this.node.style.fill=c):this.root.ownerDocument==document&&this.useAbsoluteIds?(d=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),this.node.setAttribute("fill","url("+d+"#"+a+")")):this.node.setAttribute("fill",
"url(#"+a+")")};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))};
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){e=this.converter.convert(e);f=null!=f?f:!0;g=null!=g?g:!1;k=null!=k?k:!1;var m=this.state;a+=m.dx;b+=m.dy;var n=this.createElement("image");n.setAttribute("x",this.format(a*m.scale)+this.imageOffset);n.setAttribute("y",this.format(b*m.scale)+this.imageOffset);n.setAttribute("width",this.format(c*m.scale));n.setAttribute("height",this.format(d*m.scale));null==n.setAttributeNS?n.setAttribute("xlink:href",e):n.setAttributeNS(mxConstants.NS_XLINK,
"xlink:href",e);f||n.setAttribute("preserveAspectRatio","none");(1>m.alpha||1>m.fillAlpha)&&n.setAttribute("opacity",m.alpha*m.fillAlpha);e=this.state.transform||"";if(g||k){var p=f=1,q=0,r=0;g&&(f=-1,q=-c-2*a);k&&(p=-1,r=-d-2*b);e+="scale("+f+","+p+")translate("+q*m.scale+","+r*m.scale+")"}0<e.length&&n.setAttribute("transform",e);this.pointerEvents||n.setAttribute("pointer-events","none");null!=l&&this.processClipPath(n,l,new mxRectangle(a,b,c,d));this.root.appendChild(n)};
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(/&amp;/g,"&amp;amp;").replace(/&#60;/g,"&amp;lt;").replace(/&#62;/g,"&amp;gt;").replace(/&lt;/g,"&amp;lt;").replace(/&gt;/g,"&amp;gt;").replace(/</g,"&lt;").replace(/>/g,"&gt;");a=b.value.replace(/&/g,"&amp;").replace(/&amp;lt;/g,"&lt;").replace(/&amp;gt;/g,"&gt;").replace(/&amp;amp;/g,
"&amp;").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(mxClient.IS_IE||mxClient.IS_IE11||!document.createElementNS)return mxUtils.isNode(a)&&(a="<div><div>"+mxUtils.getXml(a)+"</div></div>"),mxUtils.parseXml('<div xmlns="http://www.w3.org/1999/xhtml">'+a+"</div>").documentElement;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};mxSvgCanvas2D.prototype.updateText=function(a,b,c,d,e,f,g,k,l,m,n,p){null!=p&&null!=p.firstChild&&(null!=p.firstChild.firstChild&&"foreignObject"==p.firstChild.firstChild.nodeName?this.updateTextNodes(a,b,c,d,e,f,g,k,l,m,n,p.firstChild):"g"==p.nodeName&&this.plainText(a,b,c,d,"",e,f,g,k,l,m,n,null,p.firstChild))};
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,"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,C,B){a+=this.state.dx;b+=this.state.dy;var x=p.firstChild;"title"==x.nodeName&&(x=x.nextSibling);C+="color: "+this.getLightDarkColor(this.state.fontColor).light+"; ";C+=null!=u?"background-color: "+u.light+"; ":"";C+=null!=v?"border-color: "+v.light+"; ":"";var D=x.firstChild,E=D.firstChild,I=(this.rotateHtml?this.state.rotation:0)+(null!=m?m:0),F=(0!=this.foOffset?"translate("+this.foOffset+" "+this.foOffset+")":"")+(1!=q?"scale("+q+")":
"");this.setCssText(E.firstChild,B);this.setCssText(E,C);x.setAttribute("width",Math.ceil(1/Math.min(1,q)*100)+"%");x.setAttribute("height",Math.ceil(1/Math.min(1,q)*100)+"%");A=Math.round(b+A);0>A?(x.setAttribute("y",A),z+="padding-top: 0; "):(x.removeAttribute("y"),z+="padding-top: "+A+"px; ");this.setCssText(D,z+"margin-left: "+Math.round(a+y)+"px;");F+=0!=I?"rotate("+I+" "+a+" "+b+")":"";""!=F?p.setAttribute("transform",F):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){k=null!=k&&"vertical-"==k.substring(0,9);q="box-sizing: border-box; font-size: 0; ";q=k?q+("text-align: "+(d==mxConstants.ALIGN_TOP?"left":d==mxConstants.ALIGN_BOTTOM?"right":"center")+"; "):q+("text-align: "+(c==mxConstants.ALIGN_LEFT?"left":c==mxConstants.ALIGN_RIGHT?"right":"center")+"; ");var t=mxUtils.getAlignmentAsPoint(c,d);c="overflow: hidden; ";var u="width: 1px; ",v="height: 1px; ",y=t.x*a;t=t.y*b;g?(u="width: "+Math.round(a)+
"px; ",q+="max-height: "+Math.round(b)+"px; ",t=0):"fill"==f?(u="width: "+Math.round(a)+"px; ",v="height: "+Math.round(b)+"px; ",p+="width: 100%; height: 100%; ",q+="width: "+Math.round(a-2)+"px; "+v):"width"==f?(u="width: "+Math.round(a-2)+"px; ",p+="width: 100%; ",q+=u,t=0,0<b&&(q+="max-height: "+Math.round(b)+"px; ")):"block"==f?(u="width: "+Math.round(a-2)+"px; ",p+="width: 100%; ",c="",t=0,q+=u,"middle"==d&&(q+="max-height: "+Math.round(b)+"px; ")):(c="",k?y=0:t=0);d="";null!=l&&(d+="background-color: "+
l+"; ");null!=m&&(d+="border-width: 1px; border-style: solid; border-color: inherit; border: 1px solid "+m+"; ");""==c||g?p+=d:q+=d;e&&(k&&0<b||!k&&0<a)?(p+="white-space: normal; word-wrap: "+mxConstants.WORD_WRAP+"; ",k?v="height: "+Math.round(b)+"px; ":u="width: "+Math.round(a)+"px; ",""!=c&&"fill"!=f&&(k?y=0:t=0)):(p+="white-space: nowrap; ",""==c&&"block"!=f&&(y=0));r(y,t,n+u+v,q+c,p,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&&(b+="text-decoration: "+c.join(" ")+"; ");return b};
mxSvgCanvas2D.prototype.convertHtmlToSvg=function(a,b,c,d){var e=!0;if(null!=a){d=null!=d?d:1;for(var f=0,g=0;g<a.childNodes.length&&e;g++){var k=this.createElement("tspan"),l=a.childNodes[g],m=0;l.nodeType==mxConstants.NODETYPE_TEXT?mxUtils.write(k,l.nodeValue):""!=l.style.backgroundColor||"SUP"!=l.nodeName&&"SUB"!=l.nodeName&&"B"!=l.nodeName&&"I"!=l.nodeName&&"SPAN"!=l.nodeName&&"FONT"!=l.nodeName&&"STRIKE"!=l.nodeName&&"U"!=l.nodeName?e=!1:(""!=l.style.cssText&&(k.style.cssText=l.style.cssText),
""!=l.style.color&&(e=mxUtils.getLightDarkColor(l.style.color),k.setAttribute("fill",e.light),k.style.fill=e.cssText,k.style.color=""),e=k.style.fontSize||"","SUP"==l.nodeName||"SUB"==l.nodeName?(""==e&&(k.style.fontSize="smaller",d=1.2),"SUP"==l.nodeName&&0==c.y?c.y=-.25:"SUB"==l.nodeName&&(c.y=Math.max(c.y,.25)),m="SUP"==l.nodeName?-.45:.25):"I"==l.nodeName?k.setAttribute("font-style","italic"):"B"==l.nodeName?k.setAttribute("font-weight","bold"):"STRIKE"==l.nodeName?k.setAttribute("text-decoration",
"line-through"):"U"==l.nodeName&&k.setAttribute("text-decoration","underline"),"px"==e.slice(-2)&&(k.style.fontSize=parseFloat(e)*d/this.state.fontSize+"em"),e=this.convertHtmlToSvg(l,k,c,d));l=m;0==f&&0==l||k.setAttribute("dy",l-f+"em");f=l;b.appendChild(k)}}return e};
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);this.allowConvertHtmlToSvg&&this.convertHtmlToSvg(r.firstChild.firstChild,t,u)?(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)):(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){n=null!=n?n:0;k=this.state;var t=k.fontSize,u=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&&(u+="rotate("+n+","+this.format(a*k.scale)+","+this.format(b*k.scale)+")");null!=p&&"vertical-"!=p.substring(0,9)&&r.setAttribute("direction",p);n=f==mxConstants.ALIGN_RIGHT?
"end":f==mxConstants.ALIGN_CENTER?"middle":"start";"start"!=n&&r.setAttribute("text-anchor",n);0<u.length&&r.setAttribute("transform",u);1>k.alpha&&r.setAttribute("opacity",k.alpha);p=e.split("\n");u=Math.round(t*mxConstants.LINE_HEIGHT);var v=t+(p.length-1)*u;n=b+t-1;if(g==mxConstants.ALIGN_MIDDLE)if("fill"==l)n-=d/2;else{var y=(this.matchHtmlAlignment&&m&&0<d?Math.min(v,d):v)/2;n-=y}else g==mxConstants.ALIGN_BOTTOM&&("fill"==l?n-=d:(y=this.matchHtmlAlignment&&m&&0<d?Math.min(v,d):v,n-=y+1));if(null!=
q)q.setAttribute("x",this.format(a*k.scale)+this.textOffset),q.setAttribute("y",this.format(n*k.scale)+this.textOffset),r.appendChild(q),this.root.appendChild(r),r.setAttribute("font-size",t*k.scale+"px");else if(null!=r.parentNode)r.firstChild.setAttribute("x",this.format(a*k.scale)+this.textOffset),r.firstChild.setAttribute("y",this.format(n*k.scale)+this.textOffset),r.setAttribute("font-size",t*k.scale+"px");else{this.styleEnabled&&t==mxConstants.DEFAULT_FONTSIZE||r.setAttribute("font-size",t*
k.scale+"px");for(q=0;q<p.length;q++)0<p[q].length&&0<mxUtils.trim(p[q]).length&&(t=this.createElement("text"),t.setAttribute("x",this.format(a*k.scale)+this.textOffset),t.setAttribute("y",this.format(n*k.scale)+this.textOffset),mxUtils.write(t,p[q]),r.appendChild(t)),n+=u;this.root.appendChild(r);this.addTextBackground(r,e,a,b,c,"fill"==l?d:v,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.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(" "))};
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();var p=mxClient.IS_IE&&
mxClient.IS_SVG;n=new mxRectangle(n.x,n.y+(p?0:1),n.width,n.height+(p?1:0))}catch(q){}if(null==n||0==n.width||0==n.height)n=document.createElement("div"),n.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?m.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,n.style.fontSize=m.fontSize+"px",n.style.fontFamily=mxUtils.parseCssFontFamily(m.fontFamily),n.style.whiteSpace="nowrap",n.style.position="absolute",n.style.visibility="hidden",n.style.display="inline-block",n.style.zoom="1",(m.fontStyle&
mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(n.style.fontWeight="bold"),(m.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(n.style.fontStyle="italic"),b=mxUtils.htmlEntities(b,!1),n.innerHTML=b.replace(/\n/g,"<br/>"),document.body.appendChild(n),e=n.offsetWidth,f=n.offsetHeight,n.parentNode.removeChild(n),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&&(b=this.createElement("rect"),c=null!=m.fontBackgroundColor&&m.fontBackgroundColor!=mxConstants.NONE?this.getLightDarkColor(m.fontBackgroundColor):null,d=null!=m.fontBorderColor&&m.fontBorderColor!=mxConstants.NONE?this.getLightDarkColor(m.fontBorderColor):null,b.setAttribute("fill",null!=c?c.light:"none"),b.setAttribute("stroke",null!=d?d.light:"none"),b.setAttribute("x",Math.floor(n.x-1)),b.setAttribute("y",Math.floor(n.y-1)),b.setAttribute("width",Math.ceil(n.width+
2)),b.setAttribute("height",Math.ceil(n.height)),null!=c&&(b.style.fill=c.cssText),d&&(b.style.stroke=d.cssText),m=null!=m.fontBorderColor?Math.max(1,this.format(m.scale)):0,b.setAttribute("stroke-width",m),this.root.ownerDocument==document&&1==mxUtils.mod(m,2)&&b.setAttribute("transform","translate(0.5, 0.5)"),a.insertBefore(b,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.guideX=null;mxGuide.prototype.guideY=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.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,x,D){var E=!1;D&&Math.abs(B-C)<t?(b.y=B-a.getCenterY(),t=Math.abs(B-C),E=!0):D||(Math.abs(B-A)<t?(b.y=B-a.y,t=Math.abs(B-A),E=!0):Math.abs(B-z)<t&&(b.y=B-a.y-a.height,t=Math.abs(B-z),E=!0));E&&(p=x,q=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())));
n=n||E};var e=function(B,x,D){var E=!1;D&&Math.abs(B-y)<r?(b.x=B-a.getCenterX(),r=Math.abs(B-y),E=!0):D||(Math.abs(B-u)<r?(b.x=B-a.x,r=Math.abs(B-u),E=!0):Math.abs(B-v)<r&&(b.x=B-a.x-a.width,r=Math.abs(B-v),E=!0));E&&(l=x,m=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())));k=k||E},f=this.graph.getView().scale;f*=this.getGuideTolerance(c);var g=a.clone();g.x+=
b.x;g.y+=b.y;var k=!1,l=null,m=null,n=!1,p=null,q=null,r=f,t=f,u=g.x,v=g.x+g.width,y=g.getCenterX(),A=g.y,z=g.y+g.height,C=g.getCenterY();for(f=0;f<this.states.length;f++)g=this.states[f],null==g||this.isStateIgnored(g)||(this.horizontal&&(e.call(this,g.getCenterX(),g,!0),e.call(this,g.x,g,!1),e.call(this,g.x+g.width,g,!1),null==g.cell&&e.call(this,g.getCenterX(),g,!1)),this.vertical&&(d.call(this,g.getCenterY(),g,!0),d.call(this,g.y,g,!1),d.call(this,g.y+g.height,g,!1),null==g.cell&&d.call(this,
g.getCenterY(),g,!1)));this.graph.snapDelta(b,a,!c,k,n);b=this.getDelta(a,l,b.x,p,b.y);c=this.graph.container;k||null==this.guideX?null!=this.guideX&&(e=d=null,null!=l&&null!=a&&(d=Math.min(a.y+b.y-this.graph.panDy,l.y),e=Math.max(a.y+a.height+b.y-this.graph.panDy,l.y+l.height)),this.guideX.points=null!=d&&null!=e?[new mxPoint(m,d),new mxPoint(m,e)]:[new mxPoint(m,-this.graph.panDy),new mxPoint(m,c.scrollHeight-3-this.graph.panDy)],this.guideX.stroke=this.getGuideColor(l,!0),this.guideX.node.style.visibility=
"visible",this.guideX.redraw()):this.guideX.node.style.visibility="hidden";n||null==this.guideY?null!=this.guideY&&(e=d=null,null!=p&&null!=a&&(d=Math.min(a.x+b.x-this.graph.panDx,p.x),e=Math.max(a.x+a.width+b.x-this.graph.panDx,p.x+p.width)),this.guideY.points=null!=d&&null!=e?[new mxPoint(d,q),new mxPoint(e,q)]:[new mxPoint(-this.graph.panDx,q),new mxPoint(c.scrollWidth-3-this.graph.panDx,q)],this.guideY.stroke=this.getGuideColor(p,!1),this.guideY.node.style.visibility="visible",this.guideY.redraw()):
this.guideY.node.style.visibility="hidden"}return 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){null!=this.guideX&&(this.guideX.node.style.visibility=a?"visible":"hidden");null!=this.guideY&&(this.guideY.node.style.visibility=a?"visible":"hidden")};mxGuide.prototype.destroy=function(){null!=this.guideX&&(this.guideX.destroy(),this.guideX=null);null!=this.guideY&&(this.guideY.destroy(),this.guideY=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;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));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,this.fillStyle);this.strokeOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_STROKE_OPACITY,this.strokeOpacity);this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke);this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth);this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing);this.startSize=mxUtils.getNumber(this.style,
mxConstants.STYLE_STARTSIZE,this.startSize);this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize);this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow);this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow);this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation);this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction);this.flipH=1==mxUtils.getValue(this.style,
mxConstants.STYLE_FLIPH,0);this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0);null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV);if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)a=this.flipH,this.flipH=this.flipV,this.flipV=a;this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow);this.isDashed=
1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed);this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded);this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass);this.fill==mxConstants.NONE&&(this.fill=null);this.gradient==mxConstants.NONE&&(this.gradient=null);this.stroke==mxConstants.NONE&&(this.stroke=null)}};mxShape.prototype.setCursor=function(a){null==a&&(a="");this.cursor=a;null!=this.node&&(this.node.style.cursor=a)};
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){if("stroke"==d)d=b.stroke;else if("fill"==d)d=b.fill;else if("font"==d&&null!=b.style)d=mxUtils.getValue(b.style,mxConstants.STYLE_FONTCOLOR,"black");else if(null!=b.style&&!mxUtils.isValidColor(d)){a=c.getAttribute("default");var f=mxUtils.getValue(b.style,d);null==f&&(b=null!=b&&null!=b.state?b.state.cell.style:null,f=null==a||null!=b&&(0<=b.indexOf(";"+d+"=")||b.substring(0,d.length+1)==d+"=")?mxConstants.NONE:a);"default"==f&&(f=null!=e?"fillcolor"==
c.nodeName?e.shapeBackgroundColor:e.shapeForegroundColor:"#ffffff");d=f}return d};
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:{},addStencil:function(a,b){mxStencilRegistry.stencils[a]=b},getStencil:function(a){return mxStencilRegistry.stencils[a]}},mxMarker={markers:[],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.paintForeground=function(a,b,c,d,e){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))};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()};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_CURVED]?this.paintLine(a,b,this.isRounded):this.paintCurvedLine(a,b);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()};
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.strokewidth;this.outline&&(c=Math.max(1,mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth)));var d=this.getStartArrowWidth()+c,e=this.getEndArrowWidth()+c,f=this.outline?this.getEdgeWidth()+c:this.getEdgeWidth(),g=this.isOpenEnded(),k=this.isMarkerStart(),l=this.isMarkerEnd(),m=g?0:this.arrowSpacing+c/2,n=this.startSize+c;c=this.endSize+c;var p=this.isArrowRounded(),q=b[b.length-1],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=f*A;var C=-f*v,B=[];p?a.setLineJoin("round"):2<b.length&&a.setMiterLimit(1.42);a.begin();r=v;t=A;if(k&&!g)this.paintMarker(a,b[0].x,b[0].y,v,A,n,d,f,m,!0);else{var x=b[0].x+u/2+m*v,D=b[0].y+C/2+m*A,E=b[0].x-u/2+m*v,I=b[0].y-C/2+m*A;g?(a.moveTo(x,D),B.push(function(){a.lineTo(E,I)})):(a.moveTo(E,I),a.lineTo(x,D))}var F=D=x=0;for(u=0;u<b.length-2;u++)if(C=mxUtils.relativeCcw(b[u].x,b[u].y,b[u+1].x,b[u+1].y,b[u+2].x,b[u+2].y),x=b[u+2].x-
b[u+1].x,D=b[u+2].y-b[u+1].y,F=Math.sqrt(x*x+D*D),0!=F){y=x/F;z=D/F;F=Math.max(Math.sqrt((v*y+A*z+1)/2),.04);x=v+y;D=A+z;var H=Math.sqrt(x*x+D*D);if(0!=H){x/=H;D/=H;H=Math.max(F,Math.min(this.strokewidth/200+.04,.35));F=0!=C&&p?Math.max(.1,H):Math.max(F,.06);var K=b[u+1].x+D*f/2/F,G=b[u+1].y-x*f/2/F;D=b[u+1].x-D*f/2/F;x=b[u+1].y+x*f/2/F;0!=C&&p?-1==C?(C=D+z*f,F=x-y*f,a.lineTo(D+A*f,x-v*f),a.quadTo(K,G,C,F),function(L,M){B.push(function(){a.lineTo(L,M)})}(D,x)):(a.lineTo(K,G),function(L,M){var O=K-
A*f,P=G+v*f,Q=K-z*f,R=G+y*f;B.push(function(){a.quadTo(L,M,O,P)});B.push(function(){a.lineTo(Q,R)})}(D,x)):(a.lineTo(K,G),function(L,M){B.push(function(){a.lineTo(L,M)})}(D,x));v=y;A=z}}u=f*z;C=-f*y;if(l&&!g)this.paintMarker(a,q.x,q.y,-v,-A,c,e,f,m,!1);else{a.lineTo(q.x-m*y+u/2,q.y-m*z+C/2);var J=q.x-m*y-u/2,N=q.y-m*z-C/2;g?(a.moveTo(J,N),B.splice(0,0,function(){a.moveTo(J,N)})):a.lineTo(J,N)}for(u=B.length-1;0<=u;u--)B[u]();g?(a.end(),a.stroke()):(a.close(),a.fillAndStroke());a.setShadow(!1);a.setMiterLimit(4);
p&&a.setLineJoin("flat");2<b.length&&(a.setMiterLimit(4),k&&!g&&(a.begin(),this.paintMarker(a,b[0].x,b[0].y,r,t,n,d,f,m,!0),a.stroke(),a.end()),l&&!g&&(a.begin(),this.paintMarker(a,q.x,q.y,-v,-A,c,e,f,m,!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.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,C){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=C;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=8!=document.documentMode||mxClient.IS_EM?3:4;mxText.prototype.lastValue=null;mxText.prototype.cacheEnabled=!0;mxText.prototype.isHtmlAllowed=function(){return 8!=document.documentMode||mxClient.IS_EM};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.visible&&this.checkBounds()&&this.cacheEnabled&&this.lastValue==this.value&&(mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML))if("DIV"==this.node.nodeName)mxClient.IS_SVG?this.redrawHtmlShapeWithCss3():(this.updateSize(this.node,null==this.state||null==this.state.view.textDiv),mxClient.IS_IE&&(null==document.documentMode||8>=document.documentMode)?this.updateHtmlFilter():this.updateHtmlTransform());else{var 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)}else 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.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.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{c=null!=this.state?this.state.view.textDiv:null;if(null==this.offsetWidth||null==this.offsetHeight)null!=c&&(this.updateFont(c),this.updateSize(c,!1),this.updateInnerHtml(c),a=c),e=a,8!=document.documentMode||mxClient.IS_EM?null!=e.firstChild&&"DIV"==e.firstChild.nodeName&&(e=e.firstChild):(d=Math.round(this.bounds.width/this.scale),this.wrap&&0<d?(a.style.wordWrap=mxConstants.WORD_WRAP,a.style.whiteSpace=
"normal","break-word"!=a.style.wordWrap&&(a=e.getElementsByTagName("div"),0<a.length&&(e=a[a.length-1]),c=e.offsetWidth+2,a=this.node.getElementsByTagName("div"),this.clipped&&(c=Math.min(d,c)),1<a.length&&(a[a.length-2].style.width=c+"px"))):a.style.whiteSpace="nowrap"),this.offsetWidth=e.offsetWidth+this.textWidthPadding,this.offsetHeight=e.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.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="display: inline-block; font-size: "+this.size+"px; font-family: "+this.family+"; color: "+this.color+"; line-height: "+(mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT)+"; 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&&(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,null==this.state||null==this.state.view.textDiv);this.offsetHeight=this.offsetWidth=null;mxClient.IS_IE&&(null==document.documentMode||8>=document.documentMode)?this.updateHtmlFilter():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,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>",mxClient.IS_IE11&&this.fixFlexboxForIe11(this.node));this.node.firstChild.firstChild.setAttribute("style",m);this.node.firstChild.setAttribute("style",
l)}))};mxText.prototype.fixFlexboxForIe11=function(a){for(var b=a.querySelectorAll('div[style*="display: flex; justify-content: flex-end;"]'),c=0;c<b.length;c++)b[c].style.justifyContent="flex-start",b[c].style.flexDirection="row-reverse";if(!this.wrap)for(b=a.querySelectorAll('div[style*="display: flex; justify-content: center;"]'),a=-window.innerWidth,c=0;c<b.length;c++)b[c].style.marginLeft=a+"px",b[c].style.marginRight=a+"px"};
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>&nbsp;</div>");b=this.replaceLinefeeds?b.replace(/\n/g,"<br/>"):b;a.innerHTML='<div style="display:inline-block;_display:inline;">'+b+"</div>"}};
mxText.prototype.updateHtmlFilter=function(){var a=this.node.style,b=this.margin.x,c=this.margin.y,d=this.scale;mxUtils.setOpacity(this.node,this.opacity);var e=0,f=null!=this.state?this.state.view.textDiv:null,g=this.node;if(null!=f){f.style.overflow="";f.style.height="";f.style.width="";this.updateFont(f);this.updateSize(f,!1);this.updateInnerHtml(f);var k=Math.round(this.bounds.width/this.scale);if(this.wrap&&0<k){f.style.whiteSpace="normal";f.style.wordWrap=mxConstants.WORD_WRAP;var l=k;this.clipped&&
(l=Math.min(l,this.bounds.width));f.style.width=l+"px"}else f.style.whiteSpace="nowrap";g=f;null!=g.firstChild&&"DIV"==g.firstChild.nodeName&&(g=g.firstChild,this.wrap&&"break-word"==f.style.wordWrap&&(g.style.width="100%"));!this.clipped&&this.wrap&&0<k&&(l=g.offsetWidth+this.textWidthPadding,f.style.width=l+"px");e=g.offsetHeight+2}else null!=g.firstChild&&"DIV"==g.firstChild.nodeName&&(g=g.firstChild,e=g.offsetHeight);l=g.offsetWidth+this.textWidthPadding;this.clipped&&(e=Math.min(e,this.bounds.height));
k=this.bounds.width/d;f=this.bounds.height/d;"fill"==this.overflow?(e=f,l=k):"width"==this.overflow&&(e=g.scrollHeight,l=k);this.offsetWidth=l;this.offsetHeight=e;"fill"!=this.overflow&&"width"!=this.overflow&&(this.clipped&&(l=Math.min(k,l)),k=l,this.wrap&&(a.width=Math.round(k)+"px"));f=e*d;k*=d;var m=this.getTextRotation()*(Math.PI/180);l=parseFloat(parseFloat(Math.cos(m)).toFixed(8));e=parseFloat(parseFloat(Math.sin(-m)).toFixed(8));m%=2*Math.PI;0>m&&(m+=2*Math.PI);m%=Math.PI;m>Math.PI/2&&(m=
Math.PI-m);g=Math.cos(m);var n=Math.sin(-m);b=k*-(b+.5);c=f*-(c+.5);0!=m&&(m="progid:DXImageTransform.Microsoft.Matrix(M11="+l+", M12="+e+", M21="+-e+", M22="+l+", sizingMethod='auto expand')",a.filter=null!=a.filter&&0<a.filter.length?a.filter+(" "+m):m);a.zoom=d;a.left=Math.round(this.bounds.x+((k-k*g+f*n)/2-l*b-e*c)-k/2)+"px";a.top=Math.round(this.bounds.y+((f-f*g+k*n)/2+e*b-l*c)-f/2)+"px"};
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=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");a.textDecoration=b.join(" ");a.textAlign=this.align==mxConstants.ALIGN_CENTER?"center":this.align==mxConstants.ALIGN_RIGHT?"right":"left"};
mxText.prototype.updateSize=function(a,b){var c=Math.max(0,Math.round(this.bounds.width/this.scale)),d=Math.max(0,Math.round(this.bounds.height/this.scale)),e=a.style;this.clipped?(e.overflow="hidden",e.maxHeight=d+"px",e.maxWidth=c+"px"):"fill"==this.overflow?(e.width=c+1+"px",e.height=d+1+"px",e.overflow="hidden"):"width"==this.overflow?(e.width=c+1+"px",e.maxHeight=d+1+"px",e.overflow="hidden"):"block"==this.overflow&&(e.width=c+1+"px");if(this.wrap&&0<c){if(e.wordWrap=mxConstants.WORD_WRAP,e.whiteSpace=
"normal",e.width=c+"px",b&&"fill"!=this.overflow&&"width"!=this.overflow){b=a;null!=b.firstChild&&"DIV"==b.firstChild.nodeName&&(b=b.firstChild,"break-word"==a.style.wordWrap&&(b.style.width="100%"));d=b.offsetWidth;if(0==d){var f=a.parentNode;a.style.visibility="hidden";document.body.appendChild(a);d=b.offsetWidth;a.style.visibility="";f.appendChild(a)}d+=3;this.clipped&&(d=Math.min(d,c));e.width=d+"px"}}else e.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!1};mxImageShape.prototype.getImageDataUri=function(){return this.image};mxImageShape.prototype.configurePointerEvents=function(a){};
mxImageShape.prototype.paintVertexShape=function(a,b,c,d,e){null!=this.image?(null!=this.imageBackground&&(a.setFillColor(this.imageBackground),a.setStrokeColor(this.imageBorder),a.rect(b,c,d,e),a.fillAndStroke()),a.image(b,c,d,e,this.getImageDataUri(),this.preserveImageAspect,!1,!1,this.clipPath),null!=this.imageBorder&&(a.setShadow(!1),a.setStrokeColor(this.imageBorder),a.rect(b,c,d,e),a.stroke())):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.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.getLabelBounds=function(a){var b=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),c=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0);a=new mxRectangle(a.x,a.y,a.width,a.height);var d=this.isHorizontal(),e=this.getTitleSize(),f=this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH;d=d==!f;b=!d&&b!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST);c=d&&c!=(this.direction==mxConstants.DIRECTION_SOUTH||
this.direction==mxConstants.DIRECTION_WEST);if(f){e=Math.min(a.width,e*this.scale);if(b||c)a.x+=a.width-e;a.width=e}else{e=Math.min(a.height,e*this.scale);if(b||c)a.y+=a.height-e;a.height=e}return a};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=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);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.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;if(this.graph.isSwimlane(a)){var k=this.graph.getCellStyle(a),l=mxUtils.getNumber(k,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);k=1==mxUtils.getValue(k,mxConstants.STYLE_HORIZONTAL,
!0);null!=b&&(l=k?Math.min(l,b.height):Math.min(l,b.width));c==k&&(e-=l);k?g+=l:f+=l}d.beginUpdate();try{l=0;k=null;for(var m=0,n=null,p=this.getLayoutCells(a),q=0;q<p.length;q++){var r=p[q],t=d.getGeometry(r);if(null!=t){t=t.clone();null!=this.wrap&&null!=k&&(c&&k.x+k.width+t.width+2*this.spacing>this.wrap||!c&&k.y+k.height+t.height+2*this.spacing>this.wrap)&&(k=null,c?g+=l+this.spacing:f+=l+this.spacing,l=0);l=Math.max(l,c?t.height:t.width);var u=0;if(!this.borderCollapse){var v=this.graph.getCellStyle(r);
u=mxUtils.getNumber(v,mxConstants.STYLE_STROKEWIDTH,1)}if(null!=k){var y=m+this.spacing+Math.floor(u/2);c?t.x=this.snap((this.allowGaps?Math.max(y,t.x):y)-this.marginLeft)+this.marginLeft:t.y=this.snap((this.allowGaps?Math.max(y,t.y):y)-this.marginTop)+this.marginTop}else this.keepFirstLocation||(c?t.x=this.allowGaps&&t.x>f?Math.max(this.snap(t.x-this.marginLeft)+this.marginLeft,f):f:t.y=this.allowGaps&&t.y>g?Math.max(this.snap(t.y-this.marginTop)+this.marginTop,g):g);c?t.y=g:t.x=f;this.fill&&null!=
e&&(c?t.height=e:t.width=e);c?t.width=this.snap(t.width):t.height=this.snap(t.height);this.setChildGeometry(r,t);n=r;k=t;m=c?k.x+k.width+Math.floor(u/2):k.y+k.height+Math.floor(u/2)}}this.resizeParent&&null!=b&&null!=k&&!this.graph.isCellCollapsed(a)?this.updateParentGeometry(a,b,k):this.resizeLast&&null!=b&&null!=k&&null!=n&&(c?k.width=b.width-k.x-this.spacing-this.marginRight-this.marginLeft:k.height=b.height-k.y-this.spacing-this.marginBottom,this.setChildGeometry(n,k))}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=b.clone();d?(c=c.x+c.width+this.marginRight+this.border,f.width=this.resizeParentMax?Math.max(f.width,c):c):(c=c.y+c.height+this.marginBottom+this.border,f.height=this.resizeParentMax?Math.max(f.height,c):c);b.x==f.x&&b.y==f.y&&b.width==f.width&&b.height==f.height||e.setGeometry(a,f)};
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 C=0,B=0;for(z=0;z<y.length;z++)for(var x=0;x<r.length;x++)y[z]>r[x]&&C++,y[z]<r[x]&&B++;for(z=0;z<A.length;z++)for(x=0;x<t.length;x++)A[z]>t[x]&&C++,A[z]<t[x]&&B++;if(B<C||B==C&&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 C=A;A=z;z=C}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={});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&&this.offset.equals(a.offset))};
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 transform: scale(0.7);\n transform-origin: 0 0;\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(G,J){J.init(G.view.getDrawPane())});this.printControls&&(this.graph.cellRenderer.initControl=function(G,J,N,L){J.dialect=G.view.graph.dialect;J.init(G.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)),C=Math.max(1,Math.ceil((r.height+this.y0)/A));this.pageCount=z*C;var B=null;l&&(null==this.pendingCss&&(this.pageFormatClass={},this.pendingCss=""),B=mxUtils.htmlEntities("gePageFormat-"+String(f.width).replace(/\./g,"_")+"-"+String(f.height).replace(/\./g,"_")),null==this.pageFormatClass[B]&&
(this.pageFormatClass[B]=!0,this.pendingCss+=this.getPageClassCss(B,f)));var x=mxUtils.bind(this,function(G){null!=this.borderColor&&(G.style.borderColor=this.borderColor,G.style.borderStyle="solid",G.style.borderWidth="1px");G.style.background=this.backgroundColor;null!=B?G.classList.add(B):(G.style.width=f.width+"px",G.style.height=f.height+"px");p.body.appendChild(G)}),D=this.getCoverPages(m,n);if(null!=D)for(var E=0;E<D.length;E++)x(D[E],!0);var I=this.getAppendices(m,n);for(E=0;E<C;E++){var F=
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 H=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 K=new mxRectangle(H,F,y,A);this.addGraphFragment(-H,-F,this.scale,g,c,K);null!=e&&0==E&&0==a&&c.setAttribute("id",e);x(c,!0)}}if(null!=I)for(E=0;E<I.length;E++)x(I[E],E<I.length-1);b&&!d&&this.closeDocument();this.wnd.focus()}catch(G){null!=
c&&null!=c.parentNode&&c.parentNode.removeChild(c),null!=window.console&&console.error(G)}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>");mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",a);a.writeln('<style type="text/css">');a.writeln(this.defaultCss);var 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 C=this.getBackgroundImage();null!=C&&(z=new mxRectangle(Math.round(a*A+C.x),Math.round(b*A+C.y),C.width-1,C.height-1),z=new mxImageShape(z,C.src),z.dialect=this.graph.dialect)}if(this.clipping){var B=
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),x=this;this.graph.cellRenderer.redraw=function(E,I,F){if(null!=E){var H=y.get(E.cell);if(null!=H&&(H=g.getBoundingBox(H,!1),null!=H&&0<H.width&&0<H.height&&!mxUtils.intersects(B,H))||!x.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(B,a)||(z=null))}null!=z&&(z.init(g.backgroundPane),
this.drawBackgroundImage(z));a=null;try{var D=[this.getRoot()];a=new mxTemporaryCellStates(g,c,D,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(Math.round(b.x)/c),this.gridSteps),f=mxUtils.mod(c-mxUtils.mod(Math.round(b.x),c),c),g=mxUtils.mod(Math.ceil(Math.round(b.y)/c),this.gridSteps),k=mxUtils.mod(c-mxUtils.mod(Math.round(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){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=this.styles[e],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.shape.stencil.computeAspect(this.style,b.x,b.y,b.width,b.height);b.x=c.x;b.y=c.y;b.width=this.shape.stencil.w0*c.width;b.height=this.shape.stencil.h0*c.height}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]=this.absolutePoints[b].clone()}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(f){this.graph.stopEditing(!1);mxEvent.consume(f)}));mxEvent.addListener(a,"blur",mxUtils.bind(this,function(f){this.blurEnabled&&this.focusLost(f)}));var b=this.graph.container.scrollTop,c=this.graph.container.scrollLeft;mxEvent.addListener(a,"keydown",mxUtils.bind(this,function(f){b=this.graph.container.scrollTop;c=this.graph.container.scrollLeft;mxEvent.isConsumed(f)||(this.isStopEditingEvent(f)?
(this.graph.stopEditing(!1),mxEvent.consume(f)):27==f.keyCode&&(this.graph.stopEditing(this.isCancelEditingKeyEvent(f)),mxEvent.consume(f)))}));var d=mxUtils.bind(this,function(f){null!=this.editingCell&&this.clearOnChange&&a.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||8!=f.keyCode&&46!=f.keyCode)&&(this.clearOnChange=!1,a.innerText="")});mxEvent.addListener(a,"keypress",d);mxEvent.addListener(a,"paste",d);d=mxUtils.bind(this,function(f){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,mxClient.IS_IE11||mxClient.IS_IE?"keyup":"input",d);mxEvent.addListener(a,"cut",d);mxEvent.addListener(a,"paste",d);d=mxClient.IS_IE11||mxClient.IS_IE?
"keydown":"input";var e=mxUtils.bind(this,function(f){null!=this.editingCell&&this.autoSize&&!mxEvent.isConsumed(f)&&(null!=this.resizeThread&&window.clearTimeout(this.resizeThread),this.resizeThread=window.setTimeout(mxUtils.bind(this,function(){this.resizeThread=null;this.resize()}),0))});mxEvent.addListener(a,d,e);mxEvent.addListener(window,"resize",e);mxEvent.addListener(a,"cut",e);mxEvent.addListener(a,"paste",e)};
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])if(this.graph.isWrapping(a.cell)&&(2<=this.bounds.width||2<=this.bounds.height)&&(null==a.text||null==a.text.node||0==a.text.node.getElementsByTagName("text").length)){var 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);if(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");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?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={};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.redraw()})}};
mxCellRenderer.prototype.redrawControl=function(a,b){var c=a.view.graph.getFoldingImage(a);if(null!=a.control&&null!=c){c=this.getControlBounds(a,c.width,c.height);var d=this.legacyControlPosition?mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0):a.shape.getTextRotation(),e=a.view.scale;if(b||a.control.scale!=e||!a.control.bounds.equals(c)||a.control.rotation!=d)a.control.rotation=d,a.control.bounds=c,a.control.scale=e,a.control.redraw()}};
mxCellRenderer.prototype.getControlBounds=function(a,b,c){if(null!=a.control){var d=a.view.scale,e=a.getCenterX(),f=a.getCenterY();if(!a.view.graph.getModel().isEdge(a.cell)&&(e=a.x+b*d,f=a.y+c*d,null!=a.shape)){var g=a.shape.getShapeRotation();if(this.legacyControlPosition)g=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0);else if(a.shape.isPaintBoundsInverted()){var k=(a.width-a.height)/2;e+=k;f-=k}0!=g&&(k=mxUtils.toRadians(g),g=Math.cos(k),k=Math.sin(k),f=mxUtils.getRotatedPoint(new mxPoint(e,
f),g,k,new mxPoint(a.getCenterX(),a.getCenterY())),e=f.x,f=f.y)}return a.view.graph.getModel().isEdge(a.cell),new mxRectangle(Math.round(e-b/2*d),Math.round(f-c/2*d),Math.round(b*d),Math.round(c*d))}return null};
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&&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,(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);b=mxEdgeStyle.scaleCellState(b,a.view.scale);var g=mxEdgeStyle.scaleCellState(c,a.view.scale);c=[];var k=0<e.length?e[0]:null,l=!0,m=f[0];null==m&&null!=b?m=new mxPoint(a.view.getRoutingCenterX(b),a.view.getRoutingCenterY(b)):null!=m&&(m=m.clone());var n=f.length-1;if(null!=d&&0<d.length){for(var p=
[],q=0;q<d.length;q++){var r=a.view.transformControlPoint(a,d[q],!0);null!=r&&p.push(r)}if(0==p.length)return;null!=m&&null!=p[0]&&(1>Math.abs(p[0].x-m.x)&&(p[0].x=m.x),1>Math.abs(p[0].y-m.y)&&(p[0].y=m.y));r=f[n];null!=r&&null!=p[p.length-1]&&(1>Math.abs(p[p.length-1].x-r.x)&&(p[p.length-1].x=r.x),1>Math.abs(p[p.length-1].y-r.y)&&(p[p.length-1].y=r.y));d=p[0];var t=b,u=f[0],v=d;null!=u&&(t=null);for(q=0;2>q;q++){var y=null!=u&&u.x==v.x,A=null!=u&&u.y==v.y,z=null!=t&&v.y>=t.y&&v.y<=t.y+t.height,C=
null!=t&&v.x>=t.x&&v.x<=t.x+t.width;t=A||null==u&&z;v=y||null==u&&C;if(0!=q||!(t&&v||y&&A)){if(null!=u&&!A&&!y&&(z||C)){l=z?!1:!0;break}if(v||t){l=t;1==q&&(l=0==p.length%2?t:v);break}}t=g;u=f[n];null!=u&&(t=null);v=p[p.length-1];y&&A&&(p=p.slice(1))}l&&(null!=f[0]&&f[0].y!=d.y||null==f[0]&&null!=b&&(d.y<b.y||d.y>b.y+b.height))?c.push(new mxPoint(m.x,d.y)):!l&&(null!=f[0]&&f[0].x!=d.x||null==f[0]&&null!=b&&(d.x<b.x||d.x>b.x+b.width))&&c.push(new mxPoint(d.x,m.y));l?m.y=d.y:m.x=d.x;for(q=0;q<p.length;q++)l=
!l,d=p[q],l?m.y=d.y:m.x=d.x,c.push(m.clone())}else d=m,l=!0;m=f[n];null==m&&null!=g&&(m=new mxPoint(a.view.getRoutingCenterX(g),a.view.getRoutingCenterY(g)));null!=m&&null!=d&&(l&&(null!=f[n]&&f[n].y!=d.y||null==f[n]&&null!=g&&(d.y<g.y||d.y>g.y+g.height))?c.push(new mxPoint(m.x,d.y)):!l&&(null!=f[n]&&f[n].x!=d.x||null==f[n]&&null!=g&&(d.x<g.x||d.x>g.x+g.width))&&c.push(new mxPoint(d.x,m.y)));if(null==f[0]&&null!=b)for(;0<c.length&&null!=c[0]&&mxUtils.contains(b,c[0].x,c[0].y);)c.splice(0,1);if(null==
f[n]&&null!=g)for(;0<c.length&&null!=c[c.length-1]&&mxUtils.contains(g,c[c.length-1].x,c[c.length-1].y);)c.splice(c.length-1,1);for(q=0;q<c.length;q++)if(f=c[q],f.x=Math.round(f.x*a.view.scale*10)/10,f.y=Math.round(f.y*a.view.scale*10)/10,null==k||1<=Math.abs(k.x-f.x)||Math.abs(k.y-f.y)>=Math.max(1,a.view.scale))e.push(f),k=f;null!=r&&null!=e[e.length-1]&&1>=Math.abs(r.x-e[e.length-1].x)&&1>=Math.abs(r.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-r.x)&&
(e[e.length-1].x=r.x),1>Math.abs(e[e.length-1].y-r.y)&&(e[e.length-1].y=r.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=a.view.graph,g=null==l?!1:f.getModel().isEdge(l.cell),k=null==m?!1:f.getModel().isEdge(m.cell);f=mxEdgeStyle.scalePointArray(a.absolutePoints,a.view.scale);var l=mxEdgeStyle.scaleCellState(b,a.view.scale),m=mxEdgeStyle.scaleCellState(c,a.view.scale),n=f[0],p=f[f.length-1],q=null!=l?l.x:n.x,r=null!=l?l.y:n.y,t=null!=l?l.width:1,u=null!=l?l.height:1,v=null!=m?m.x:p.x,y=null!=
m?m.y:p.y,A=null!=m?m.width:1,z=null!=m?m.height:1;f=mxEdgeStyle.getJettySize(a,!0);var C=mxEdgeStyle.getJettySize(a,!1);null!=l&&m==l&&(f=C=Math.max(f,C));var B=C+f,x=!1;if(null!=n&&null!=p){x=p.x-n.x;var D=p.y-n.y;x=x*x+D*D<B*B}if(x||mxEdgeStyle.orthPointsFallback&&null!=d&&0<d.length||g||k)mxEdgeStyle.SegmentConnector(a,b,c,d,e);else if(c=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL],null!=l&&(c[0]=mxUtils.getPortConstraints(l,a,!0,mxConstants.DIRECTION_MASK_ALL),b=mxUtils.getValue(l.style,
mxConstants.STYLE_ROTATION,0),0!=b&&(b=mxUtils.getBoundingBox(new mxRectangle(q,r,t,u),b),q=b.x,r=b.y,t=b.width,u=b.height)),null!=m&&(c[1]=mxUtils.getPortConstraints(m,a,!1,mxConstants.DIRECTION_MASK_ALL),b=mxUtils.getValue(m.style,mxConstants.STYLE_ROTATION,0),0!=b&&(b=mxUtils.getBoundingBox(new mxRectangle(v,y,A,z),b),v=b.x,y=b.y,A=b.width,z=b.height)),0!=t&&0!=u&&0!=A&&0!=z){b=[0,0];q=[[q,r,t,u],[v,y,A,z]];C=[f,C];for(x=0;2>x;x++)mxEdgeStyle.limits[x][1]=q[x][0]-C[x],mxEdgeStyle.limits[x][2]=
q[x][1]-C[x],mxEdgeStyle.limits[x][4]=q[x][0]+q[x][2]+C[x],mxEdgeStyle.limits[x][8]=q[x][1]+q[x][3]+C[x];C=q[0][1]+q[0][3]/2;r=q[1][1]+q[1][3]/2;x=q[0][0]+q[0][2]/2-(q[1][0]+q[1][2]/2);D=C-r;C=0;0>x?C=0>D?2:1:0>=D&&(C=3,0==x&&(C=2));r=null;null!=l&&(r=n);l=[[.5,.5],[.5,.5]];for(x=0;2>x;x++)null!=r&&(l[x][0]=(r.x-q[x][0])/q[x][2],1>=Math.abs(r.x-q[x][0])?b[x]=mxConstants.DIRECTION_MASK_WEST:1>=Math.abs(r.x-q[x][0]-q[x][2])&&(b[x]=mxConstants.DIRECTION_MASK_EAST),l[x][1]=(r.y-q[x][1])/q[x][3],1>=Math.abs(r.y-
q[x][1])?b[x]=mxConstants.DIRECTION_MASK_NORTH:1>=Math.abs(r.y-q[x][1]-q[x][3])&&(b[x]=mxConstants.DIRECTION_MASK_SOUTH)),r=null,null!=m&&(r=p);x=q[0][1]-(q[1][1]+q[1][3]);p=q[0][0]-(q[1][0]+q[1][2]);r=q[1][1]-(q[0][1]+q[0][3]);t=q[1][0]-(q[0][0]+q[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(p-B,0);mxEdgeStyle.vertexSeperations[2]=Math.max(x-B,0);mxEdgeStyle.vertexSeperations[4]=Math.max(r-B,0);mxEdgeStyle.vertexSeperations[3]=Math.max(t-B,0);B=[];m=[];n=[];m[0]=p>=t?mxConstants.DIRECTION_MASK_WEST:
mxConstants.DIRECTION_MASK_EAST;n[0]=x>=r?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH;m[1]=mxUtils.reversePortConstraints(m[0]);n[1]=mxUtils.reversePortConstraints(n[0]);p=p>=t?p:t;r=x>=r?x:r;t=[[0,0],[0,0]];u=!1;for(x=0;2>x;x++)0==b[x]&&(0==(m[x]&c[x])&&(m[x]=mxUtils.reversePortConstraints(m[x])),0==(n[x]&c[x])&&(n[x]=mxUtils.reversePortConstraints(n[x])),t[x][0]=n[x],t[x][1]=m[x]);0<r&&0<p&&(0<(m[0]&c[0])&&0<(n[1]&c[1])?(t[0][0]=m[0],t[0][1]=n[0],t[1][0]=n[1],t[1][1]=m[1],
u=!0):0<(n[0]&c[0])&&0<(m[1]&c[1])&&(t[0][0]=n[0],t[0][1]=m[0],t[1][0]=m[1],t[1][1]=n[1],u=!0));0<r&&!u&&(t[0][0]=n[0],t[0][1]=m[0],t[1][0]=n[1],t[1][1]=m[1],u=!0);0<p&&!u&&(t[0][0]=m[0],t[0][1]=n[0],t[1][0]=m[1],t[1][1]=n[1]);for(x=0;2>x;x++)0==b[x]&&(0==(t[x][0]&c[x])&&(t[x][0]=t[x][1]),B[x]=t[x][0]&c[x],B[x]|=(t[x][1]&c[x])<<8,B[x]|=(t[1-x][x]&c[x])<<16,B[x]|=(t[1-x][1-x]&c[x])<<24,0==(B[x]&15)&&(B[x]<<=8),0==(B[x]&3840)&&(B[x]=B[x]&15|B[x]>>8),0==(B[x]&983040)&&(B[x]=B[x]&65535|(B[x]&251658240)>>
8),b[x]=B[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];B=b[1]==mxConstants.DIRECTION_MASK_EAST?3:b[1];c-=C;B-=C;1>c&&(c+=4);1>B&&(B+=4);c=mxEdgeStyle.routePatterns[c-1][B-1];mxEdgeStyle.wayPoints1[0][0]=q[0][0];mxEdgeStyle.wayPoints1[0][1]=q[0][1];switch(b[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=
f;mxEdgeStyle.wayPoints1[0][1]+=l[0][1]*q[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=l[0][0]*q[0][2];mxEdgeStyle.wayPoints1[0][1]+=q[0][3]+f;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=q[0][2]+f;mxEdgeStyle.wayPoints1[0][1]+=l[0][1]*q[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=l[0][0]*q[0][2],mxEdgeStyle.wayPoints1[0][1]-=f}f=0;m=B=0<(b[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?
0:1;for(x=0;x<c.length;x++)n=c[x]&15,u=n==mxConstants.DIRECTION_MASK_EAST?3:n,u+=C,4<u&&(u-=4),p=mxEdgeStyle.dirVectors[u-1],n=0<u%2?0:1,n!=B&&(f++,mxEdgeStyle.wayPoints1[f][0]=mxEdgeStyle.wayPoints1[f-1][0],mxEdgeStyle.wayPoints1[f][1]=mxEdgeStyle.wayPoints1[f-1][1]),v=0<(c[x]&mxEdgeStyle.TARGET_MASK),y=0<(c[x]&mxEdgeStyle.SOURCE_MASK),r=(c[x]&mxEdgeStyle.SIDE_MASK)>>5,r<<=C,15<r&&(r>>=4),t=0<(c[x]&mxEdgeStyle.CENTER_MASK),(y||v)&&9>r?(u=y?0:1,r=t&&0==n?q[u][0]+l[u][0]*q[u][2]:t?q[u][1]+l[u][1]*
q[u][3]:mxEdgeStyle.limits[u][r],0==n?(r=(r-mxEdgeStyle.wayPoints1[f][0])*p[0],0<r&&(mxEdgeStyle.wayPoints1[f][0]+=p[0]*r)):(r=(r-mxEdgeStyle.wayPoints1[f][1])*p[1],0<r&&(mxEdgeStyle.wayPoints1[f][1]+=p[1]*r))):t&&(mxEdgeStyle.wayPoints1[f][0]+=p[0]*Math.abs(mxEdgeStyle.vertexSeperations[u]/2),mxEdgeStyle.wayPoints1[f][1]+=p[1]*Math.abs(mxEdgeStyle.vertexSeperations[u]/2)),0<f&&mxEdgeStyle.wayPoints1[f][n]==mxEdgeStyle.wayPoints1[f-1][n]?f--:B=n;for(x=0;x<=f&&(x!=f||((0<(b[1]&(mxConstants.DIRECTION_MASK_EAST|
mxConstants.DIRECTION_MASK_WEST))?0:1)==m?0:1)==(f+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:[],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();var c=null;null==this.canvas||null!=this.textDiv||8!=document.documentMode||mxClient.IS_EM||(this.placeholder=document.createElement("div"),this.placeholder.style.position="absolute",this.placeholder.style.width=this.canvas.clientWidth+"px",this.placeholder.style.height=this.canvas.clientHeight+
"px",this.canvas.parentNode.appendChild(this.placeholder),c=this.drawPane.style.display,this.canvas.style.display="none",this.textDiv=document.createElement("div"),this.textDiv.style.position="absolute",this.textDiv.style.whiteSpace="nowrap",this.textDiv.style.visibility="hidden",this.textDiv.style.display="inline-block",this.textDiv.style.zoom="1",document.body.appendChild(this.textDiv));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();null!=c&&(this.canvas.style.display=c,this.textDiv.parentNode.removeChild(this.textDiv),null!=this.placeholder&&this.placeholder.parentNode.removeChild(this.placeholder),this.textDiv=null);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);null!=this.graph.model.getTerminal(a.cell,!0)&&null==c||null==c&&null==b.getTerminalPoint(!0)||null!=this.graph.model.getTerminal(a.cell,!1)&&null==d||null==d&&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.shape.stencil.computeAspect(a.style,a.x,a.y,a.width,a.height);a.setRect(c.x,c.y,a.shape.stencil.w0*c.width,a.shape.stencil.h0*c.height)}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=this.updateBoundsFromStencil(d);f(a,c,d,b,e);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((d/2-m-a)/d*-2,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_IE||mxClient.IS_IE11||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);if(mxClient.IS_IE||mxClient.IS_IE11)b.style.overflow="hidden";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.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.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()}));mxClient.IS_IE&&(mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})),mxEvent.addListener(a,"selectstart",mxUtils.bind(this,function(b){return this.isEditing()||
!this.isMouseDown&&!mxEvent.isShiftDown(b)})))};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&&!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)};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.view.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||!mxClient.IS_IE&&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.ceil(d.height/f.height)+1:0,k=a?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]?(n[q].points=r,n[q].redraw()):(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;l=
l.clone();c&&(l.x=Math.round(l.x+n.x-b-p.x-g),l.y=Math.round(l.y+n.y-b-p.y-d));l.width=Math.round(n.width+2*b+p.x+g+e+p.width);l.height=Math.round(n.height+2*b+p.y+d+f+p.height);this.model.setGeometry(a[k],l);this.moveCells(m,b+p.x-n.x+g,b+p.y-n.y+d)}}}}}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);for(e=0;e<a.length;e++){for(var f=this.getAllEdges([a[e]]),g=mxUtils.bind(this,function(l,m){var n=this.model.getGeometry(l);if(null!=n){for(var p=this.model.getTerminal(l,m),q=!1,r=p;null!=r;){if(a[e]==r){q=!0;break}r=this.model.getParent(r)}q&&(n=n.clone(),q=this.view.getState(l),null!=q&&null!=q.absolutePoints?
(p=q.absolutePoints,r=m?0:p.length-1,n.setTerminalPoint(new mxPoint(p[r].x/b-c.x-q.origin.x,p[r].y/b-c.y-q.origin.y),m)):(p=this.view.getState(p),null!=p&&n.setTerminalPoint(new mxPoint(p.getCenterX()/b-c.x,p.getCenterY()/b-c.y),m)),this.model.setGeometry(l,n),this.model.setTerminal(l,null,m))}}),k=0;k<f.length;k++)d.get(f[k])||(d.put(f[k],!0),g(f[k],!0),g(f[k],!1));this.model.remove(a[e])}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]);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.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);null==b||null==c||this.isCellCollapsed(b)||(a=this.getCellGeometry(a),null!=a&&!a.relative&&(c.width<a.x+a.width||c.height<a.y+a.height)&&(c=c.clone(),c.width=Math.max(c.width,a.x+a.width),c.height=Math.max(c.height,a.y+a.height),this.cellsResized([b],[c],!1)))}};
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.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){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=new mxPoint(e.getCenterX(),e.getCenterY()),g=a.style[mxConstants.STYLE_DIRECTION],k=0;null!=g&&1==mxUtils.getValue(a.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(g==mxConstants.DIRECTION_NORTH?k+=270:g==mxConstants.DIRECTION_WEST?k+=180:g==mxConstants.DIRECTION_SOUTH&&(k+=90),g!=mxConstants.DIRECTION_NORTH&&g!=mxConstants.DIRECTION_SOUTH||e.rotate90());
d=this.view.scale;d=new mxPoint(e.x+b.point.x*e.width+b.dx*d,e.y+b.point.y*e.height+b.dy*d);var l=a.style[mxConstants.STYLE_ROTATION]||0;if(b.perimeter)0!=k&&(g=e=0,90==k?g=1:180==k?e=-1:270==k&&(g=-1),d=mxUtils.getRotatedPoint(d,e,g,f)),d=this.view.getPerimeterPoint(a,d,!1);else if(l+=k,this.getModel().isVertex(a.cell)){k=1==a.style[mxConstants.STYLE_FLIPH];b=1==a.style[mxConstants.STYLE_FLIPV];null!=a.shape&&null!=a.shape.stencil&&(k=1==mxUtils.getValue(a.style,"stencilFlipH",0)||k,b=1==mxUtils.getValue(a.style,
"stencilFlipV",0)||b);if(g==mxConstants.DIRECTION_NORTH||g==mxConstants.DIRECTION_SOUTH)a=k,k=b,b=a;k&&(d.x=2*e.getCenterX()-d.x);b&&(d.y=2*e.getCenterY()-d.y)}0!=l&&null!=d&&(a=mxUtils.toRadians(l),e=Math.cos(a),g=Math.sin(a),d=mxUtils.getRotatedPoint(d,e,g,f))}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&&(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){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(mxClient.IS_IE?c.setAttribute("transform","translate("+a+","+b+")"):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){this.zoom(a/this.view.scale,b)};
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){b=null!=b?b:this.centerZoom;var d=Math.round(this.view.scale*a*100)/100;null!=c&&(d=Math.round(d*c)/c);c=this.view.getState(this.getSelectionCell());a=d/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=d,this.scrollRectToVisible(a)||(this.view.revalidate(),this.view.setScale(d));else if(c=mxUtils.hasScrollbars(this.container),b&&!c){c=this.container.offsetWidth;var e=this.container.offsetHeight;
1<a?(a=(a-1)/(2*d),c*=-a,e*=-a):(a=(1/a-1)/(2*this.view.scale),c*=a,e*=a);this.view.scaleAndTranslate(d,this.view.translate.x+c,this.view.translate.y+e)}else{var f=this.view.translate.x,g=this.view.translate.y,k=this.container.scrollLeft,l=this.container.scrollTop;this.view.setScale(d);c&&(e=c=0,b&&(c=this.container.offsetWidth*(a-1)/2,e=this.container.offsetHeight*(a-1)/2),this.container.scrollLeft=(this.view.translate.x-f)*this.view.scale+Math.round(k*a+c),this.container.scrollTop=(this.view.translate.y-
g)*this.view.scale+Math.round(l*a+e))}};
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){return"wrap"==this.getCurrentCellStyle(a)[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.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.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||mxClient.IS_IE11||mxClient.IS_IE&&mxClient.IS_SVG||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=mxClient.IS_IE11?.9:.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=mxClient.IS_IE11?Math.max(1,this.source.view.scale):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(mxClient.IS_IE11?4: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",mxClient.IS_IE11?"12":"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.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)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.graph.getView().getBounds(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=mxClient.IS_IE?20: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();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});return this.graph.view.getCellStates(b.filterDescendants(c,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.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.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.graph.getView().getBounds(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++)c=this.graph.view.getState(a[b]),null==c||l.get(c)||l.put(c,!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)&&(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.maxLivePreview>=this.cellCount&&!this.livePreviewActive&&this.allowLivePreview?this.cloning&&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));g=f.visibleSourceState;l=f.visibleTargetState;var m=
c[e][1].absolutePoints;null!=m&&(null!=g&&this.isCellMoving(g.cell)?f.view.updateFixedTerminalPoint(f,g,!0,this.graph.getConnectionConstraint(f,g,!0)):(g=m[0],f.setAbsoluteTerminalPoint(new mxPoint(g.x+a,g.y+b),!0),g=null),null!=l&&this.isCellMoving(l.cell)?f.view.updateFixedTerminalPoint(f,l,!1,this.graph.getConnectionConstraint(f,l,!1)):(l=m[m.length-1],f.setAbsoluteTerminalPoint(new mxPoint(l.x+a,l.y+b),!1),l=null));f.view.updatePoints(f,k,g,l);f.view.updateFloatingTerminalPoints(f,g,l);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);this.currentFocus=a;this.currentFocusArea=new mxRectangle(a.x,a.y,a.width,a.height);for(var b=0;b<this.constraints.length;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),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}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&&(!mxClient.IS_IE||10<=document.documentMode)&&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&&(!mxClient.IS_IE||10<=document.documentMode)&&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};mxRubberband.prototype.update=function(a,b){this.currentX=a;this.currentY=b;this.repaint()};
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&&(mxClient.IS_IE||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())||(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?this.rotationShape.node.style.display="":c==mxEvent.LABEL_HANDLE?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;4<d?(r+=c,r=e?this.graph.snap(r/f)*f:Math.round(r/f)*f):3>d&&(a+=c,a=e?this.graph.snap(a/f)*f:Math.round(a/f)*f);if(0==d||
3==d||5==d)p+=b,p=e?this.graph.snap(p/f)*f:Math.round(p/f)*f;else if(2==d||4==d||7==d)q+=b,q=e?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)));l&&(e+=e-m,c+=c-n,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){var b=this.state.getVisibleTerminalState(!0),c=this.state.getVisibleTerminalState(!1),d=this.graph.getCellGeometry(this.state.cell);return(null!=d?this.graph.view.getEdgeStyle(this.state,d.points,b,c):null)!=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(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(a)};
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)for(a=0;a<this.customHandles.length;a++)this.customHandles[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=Math.round(a.x/c-d.x);a.y=Math.round(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.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.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(){null!=this.state&&(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.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=Math.round(a.x/c-d.x-e.x);a.y=Math.round(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.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&&(0==Math.round(c.x-f.x)&&(c.x=a.x,f.x=a.x),0==Math.round(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))}}};
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),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}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);mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()}))}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:[],aliases:[],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=[];this.objects=[]}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){if(null!=this.duplicates[a])throw Error(this.duplicates[a]);return 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={},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.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));for(var d in b){var e=d,f=b[e];null==f||this.isExcluded(b,e,f,!0)||(mxUtils.isInteger(e)&&(e=null),this.encodeValue(a,b,e,f,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){throw Error(f.message+" "+b.nodeName+(null!=d?" as "+d:""));}}};
mxObjectCodec.prototype.getFieldTemplate=function(a,b,c){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)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.encodeObject=function(b,c,d){var e=b.document.createElement("root");b.encodeCell(c.getRoot(),e);d.appendChild(e)};a.decodeChild=function(b,c,d){"root"==c.nodeName?this.decodeRoot(b,c,d):mxObjectCodec.prototype.decodeChild.apply(this,arguments)};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,f){b.raw=f;return b};$jscomp.arrayIteratorImpl=function(b){var f=0;return function(){return f<b.length?{done:!1,value:b[f++]}:{done:!0}}};$jscomp.arrayIterator=function(b){return{next:$jscomp.arrayIteratorImpl(b)}};$jscomp.makeIterator=function(b){var f="undefined"!=typeof Symbol&&Symbol.iterator&&b[Symbol.iterator];return f?f.call(b):$jscomp.arrayIterator(b)};
Editor=function(b,f,l,u,y){mxEventSource.call(this);this.chromeless=null!=b?b:this.chromeless;this.initStencilRegistry();this.graph=u||this.createGraph(f,l);this.editable=null!=y?y:!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(q,B){this.status=q;this.statusFunction=B;this.fireEvent(new mxEventObject("statusChanged"))};
this.getStatus=function(){return this.status};this.graphChangeListener=function(q,B){q=null!=B?B.getProperty("edit"):null;null!=q&&q.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(f){}})();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.sparklesImage="data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KDTwhLS0gVXBsb2FkZWQgdG86IFNWRyBSZXBvLCB3d3cuc3ZncmVwby5jb20sIFRyYW5zZm9ybWVkIGJ5OiBTVkcgUmVwbyBNaXhlciBUb29scyAtLT4KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgZmlsbD0iI2ZjZmY0NyIgZGF0YS1kYXJrcmVhZGVyLWlubGluZS1maWxsPSIiIHN0eWxlPSItLWRhcmtyZWFkZXItaW5saW5lLWZpbGw6ICNkNmQ4NTA7IC0tZGFya3JlYWRlci1pbmxpbmUtc3Ryb2tlOiAjZDZkODUwOyIgc3Ryb2tlPSIjZmNmZjQ3IiBkYXRhLWRhcmtyZWFkZXItaW5saW5lLXN0cm9rZT0iIj4KDTxnIGlkPSJTVkdSZXBvX2JnQ2FycmllciIgc3Ryb2tlLXdpZHRoPSIwIi8+Cg08ZyBpZD0iU1ZHUmVwb190cmFjZXJDYXJyaWVyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KDTxnIGlkPSJTVkdSZXBvX2ljb25DYXJyaWVyIj4KDTxwYXRoIGQ9Ik0yNTkuOTIsMjYyLjkxLDIxNi40LDE0OS43N2E5LDksMCwwLDAtMTYuOCwwTDE1Ni4wOCwyNjIuOTFhOSw5LDAsMCwxLTUuMTcsNS4xN0wzNy43NywzMTEuNmE5LDksMCwwLDAsMCwxNi44bDExMy4xNCw0My41MmE5LDksMCwwLDEsNS4xNyw1LjE3TDE5OS42LDQ5MC4yM2E5LDksMCwwLDAsMTYuOCwwbDQzLjUyLTExMy4xNGE5LDksMCwwLDEsNS4xNy01LjE3TDM3OC4yMywzMjguNGE5LDksMCwwLDAsMC0xNi44TDI2NS4wOSwyNjguMDhBOSw5LDAsMCwxLDI1OS45MiwyNjIuOTFaIiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIxOS45NjgiIGRhdGEtZGFya3JlYWRlci1pbmxpbmUtc3Ryb2tlPSIiIHN0eWxlPSItLWRhcmtyZWFkZXItaW5saW5lLXN0cm9rZTogIzE4MWExYjsiLz4KDTxwb2x5Z29uIHBvaW50cz0iMTA4IDY4IDg4IDE2IDY4IDY4IDE2IDg4IDY4IDEwOCA4OCAxNjAgMTA4IDEwOCAxNjAgODggMTA4IDY4IiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIxOS45NjgiIGRhdGEtZGFya3JlYWRlci1pbmxpbmUtc3Ryb2tlPSIiIHN0eWxlPSItLWRhcmtyZWFkZXItaW5saW5lLXN0cm9rZTogIzE4MWExYjsiLz4KDTxwb2x5Z29uIHBvaW50cz0iNDI2LjY3IDExNy4zMyA0MDAgNDggMzczLjMzIDExNy4zMyAzMDQgMTQ0IDM3My4zMyAxNzAuNjcgNDAwIDI0MCA0MjYuNjcgMTcwLjY3IDQ5NiAxNDQgNDI2LjY3IDExNy4zMyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMTkuOTY4IiBkYXRhLWRhcmtyZWFkZXItaW5saW5lLXN0cm9rZT0iIiBzdHlsZT0iLS1kYXJrcmVhZGVyLWlubGluZS1zdHJva2U6ICMxODFhMWI7Ii8+Cg08L2c+Cg08L3N2Zz4=";
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.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.doubleArrowUpImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJtMjk2LTIyNC01Ni01NiAyNDAtMjQwIDI0MCAyNDAtNTYgNTYtMTg0LTE4My0xODQgMTgzWm0wLTI0MC01Ni01NiAyNDAtMjQwIDI0MCAyNDAtNTYgNTYtMTg0LTE4My0xODQgMTgzWiIvPjwvc3ZnPg==";Editor.doubleArrowDownImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNDgwLTIwMCAyNDAtNDQwbDU2LTU2IDE4NCAxODMgMTg0LTE4MyA1NiA1Ni0yNDAgMjQwWm0wLTI0MEwyNDAtNjgwbDU2LTU2IDE4NCAxODMgMTg0LTE4MyA1NiA1Ni0yNDAgMjQwWiIvPjwvc3ZnPg==";
Editor.roughFillStyles=[{val:"auto",dispName:"Auto"},{val:"hachure",dispName:"Hachure"},{val:"solid",dispName:"Solid"},{val:"zigzag",dispName:"ZigZag"},{val:"cross-hatch",dispName:"Cross Hatch"},{val:"dashed",dispName:"Dashed"},{val:"zigzag-line",dispName:"ZigZag Line"}];
Editor.fillStyles=[{val:"auto",dispName:"Auto"},{val:"hatch",dispName:"Hatch"},{val:"solid",dispName:"Solid"},{val:"dots",dispName:"Dots"},{val:"cross-hatch",dispName:"Cross Hatch"},{val:"dashed",dispName:"Dashed"},{val:"zigzag-line",dispName:"ZigZag Line"}];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.popupsAllowed=null!=window.urlParams?"1"!=urlParams.noDevice:!0;Editor.simpleLabels=!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.fontSizeUnit="px";Editor.transitionDelay=.1;Editor.pageSizeUnit=mxConstants.INCHES;Editor.isDarkMode=function(){return Editor.darkMode};
Editor.isPngDataUrl=function(b){return null!=b&&"data:image/png;"==b.substring(0,15)};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.convertHtmlToText=function(b){if(null!=b){var f=document.createElement("div");f.innerHTML=Graph.sanitizeHtml(b);return mxUtils.extractTextWithWhitespace(f.childNodes)}return null};
Editor.extractGraphModelFromPng=function(b){var f=null;try{var l=b.substring(b.indexOf(",")+1),u=window.atob&&!mxClient.IS_SF?atob(l):Base64.decode(l,!0);EditorUi.parsePng(u,mxUtils.bind(this,function(y,q,B){y=u.substring(y+8,y+8+B);"zTXt"==q?(B=y.indexOf(String.fromCharCode(0)),"mxGraphModel"==y.substring(0,B)&&(y=pako.inflateRaw(Graph.stringToArrayBuffer(y.substring(B+2)),{to:"string"}).replace(/\+/g," "),null!=y&&0<y.length&&(f=y))):"tEXt"==q&&(y=y.split(String.fromCharCode(0)),1<y.length&&("mxGraphModel"==
y[0]||"mxfile"==y[0])&&(f=y[1]));if(null!=f||"IDAT"==q)return!0}))}catch(y){}null!=f&&"%"==f.charAt(0)&&(f=decodeURIComponent(f));null!=f&&"%"==f.charAt(0)&&(f=decodeURIComponent(f));return f};
Editor.soundex=function(b){if(null==b||0==b.length)return"";var f=[],l=1;f[0]=b[0].toUpperCase();for(var u=1,y=b.length;u<y;u++){var q=b[u].toUpperCase().charCodeAt(0)-65;if(0<=q&&25>=q&&"0"!="01230120022455012603010202"[q]&&("01230120022455012603010202"[q]!=f[l-1]&&(f[l]="01230120022455012603010202"[q],l++),3<l))break}if(3>=l)for(;3>=l;)f[l]="0",l++;return f.join("")};
Editor.selectFilename=function(b){var f=b.value.lastIndexOf(".");if(0<f){var l=b.value.substring(f+1);"drawio"!=l&&0<=mxUtils.indexOf(["png","svg","html","xml","pdf"],l)&&(l=b.value.lastIndexOf(".drawio.",f),0<l&&(f=l))}f=0<f?f:b.value.length;Editor.selectSubstring(b,0,f)};
Editor.selectSubstring=function(b,f,l){b.focus();"undefined"!=typeof b.selectionStart?(b.selectionStart=f,b.selectionEnd=l):document.selection&&document.selection.createRange&&(b.select(),b=document.selection.createRange(),b.collapse(!0),b.moveEnd("character",l),b.moveStart("character",f),b.select())};
Editor.toUnit=function(b,f){return f==mxConstants.INCHES?Math.round(100*b/mxConstants.PIXELS_PER_INCH)/100:f==mxConstants.MILLIMETERS?Math.round(100*b/mxConstants.PIXELS_PER_MM)/100:f==mxConstants.METERS?Math.round(1E3*b/(1E3*mxConstants.PIXELS_PER_MM))/1E3:Math.round(b)};
Editor.fromUnit=function(b,f){return f==mxConstants.INCHES?Math.round(b*mxConstants.PIXELS_PER_INCH):f==mxConstants.MILLIMETERS?Math.round(b*mxConstants.PIXELS_PER_MM):f==mxConstants.METERS?Math.round(b*mxConstants.PIXELS_PER_MM*1E3):Math.round(b)};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,f,l,u){f=null!=f?"?title="+encodeURIComponent(f):"";l?f+=(0<f.length?"&":"?")+"lightbox=1":null!=urlParams.ui&&(f+=(0<f.length?"&":"?")+"ui="+urlParams.ui);null!=u&&(f+=(0<f.length?"&":"?")+"page-id="+u);if(!navigator.standalone&&"undefined"!==typeof window.postMessage&&(null==document.documentMode||10<=document.documentMode)){var y=null,q=mxUtils.bind(this,function(B){"ready"==B.data&&B.source==y&&(mxEvent.removeListener(window,"message",q),y.postMessage(b,"*"))});
mxEvent.addListener(window,"message",q);y=this.graph.openLink(this.getEditBlankUrl(f+(0<f.length?"&":"?")+"client=1"),null,!0)}else this.graph.openLink(this.getEditBlankUrl(f)+"#R"+encodeURIComponent(b))};
Editor.prototype.createGraph=function(b,f){b=new Graph(null,f,null,null,b);b.transparentBackground=!1;var l=b.isCssTransformsSupported,u=this;b.isCssTransformsSupported=function(){return l.apply(this,arguments)&&(!u.chromeless||!mxClient.IS_SF)};this.chromeless||(b.isBlankLink=function(y){return!this.isExternalProtocol(y)});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(!0);this.graph.setConnectable(!0);this.graph.foldingEnabled=!0;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){var f=b.getAttribute("grid");if(null==f||""==f)f=this.graph.defaultGridEnabled?"1":"0";this.graph.gridEnabled="0"!=f&&(!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"));this.graph.setConnectable("0"!=b.getAttribute("connect"));this.graph.connectionArrowsEnabled=
"0"!=b.getAttribute("arrows");this.graph.foldingEnabled="0"!=b.getAttribute("fold");this.isChromelessView()&&this.graph.foldingEnabled&&(this.graph.foldingEnabled="1"==urlParams.nav,this.graph.cellRenderer.forceControlClickHandler=this.graph.foldingEnabled);f=parseFloat(b.getAttribute("pageScale"));!isNaN(f)&&0<f?this.graph.pageScale=f:this.graph.pageScale=mxGraph.prototype.pageScale;this.graph.isLightboxView()||this.graph.isViewer()?this.graph.pageVisible=!1:(f=b.getAttribute("page"),this.graph.pageVisible=
null!=f?"0"!=f:this.graph.defaultPageVisible);this.graph.pageBreaksVisible=this.graph.pageVisible;this.graph.preferPageSize=this.graph.pageBreaksVisible;f=parseFloat(b.getAttribute("pageWidth"));var l=parseFloat(b.getAttribute("pageHeight"));isNaN(f)||isNaN(l)||(this.graph.pageFormat=new mxRectangle(0,0,f,l));b=b.getAttribute("background");this.graph.background=null!=b&&0<b.length?b:null};
Editor.prototype.setGraphXml=function(b){if(null!=b){var f=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(),f.decode(b,this.graph.getModel())}finally{this.graph.model.endUpdate()}}else if("root"==b.nodeName){this.resetGraph();var l=f.document.createElement("mxGraphModel");l.appendChild(b);f.decode(l,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 f=new mxCodec(mxUtils.createXmlDocument());b=f.encode(this.graph.getModel());f.document.appendChild(b)}else b=this.graph.encodeCells(mxUtils.sortCells(this.graph.model.getTopmostCells(this.graph.getSelectionCells())));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",
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",this.graph.connectionHandler.isEnabled()?"1":"0");b.setAttribute("arrows",this.graph.connectionArrowsEnabled?"1":"0");b.setAttribute("fold",this.graph.foldingEnabled?"1":"0");b.setAttribute("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,f=new mxUndoManager;this.undoListener=function(u,y){f.undoableEditHappened(y.getProperty("edit"))};var l=mxUtils.bind(this,function(u,y){this.undoListener.apply(this,arguments)});b.getModel().addListener(mxEvent.UNDO,l);b.getView().addListener(mxEvent.UNDO,l);l=function(u,y){u=y.getProperty("edit").changes;u=b.getSelectionCellsForChanges(u);y=!1;if(0<u.length){for(var q=[],B=0;B<u.length;B++)null!=b.view.getState(u[B])&&(q.push(u[B]),
y||(b.scrollCellToVisible(u[B]),y=!0));b.setSelectionCells(q)}};f.addListener(mxEvent.UNDO,l);f.addListener(mxEvent.REDO,l);return f};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,f,l,u,y,q,B,H,S,E,Q){this.editorUi=b;null==this.bg&&(this.bg=b.createDiv("geBackground"));y&&document.body.appendChild(this.bg);y=b.createDiv(S?"geTransDialog":"geDialog");y.style.width=l+60+"px";y.style.height=u+60+"px";"1"!=urlParams.embedInline||Editor.inlineFullscreen||null==b.embedViewport||(y.style.left=b.embedViewport.x+b.embedViewport.width/2+"px",y.style.top=b.embedViewport.y+b.embedViewport.height/2+"px");y.appendChild(f);document.body.appendChild(y);if(q&&(f=document.createElement("div"),
f.className="geButton",f.setAttribute("title",mxResources.get("close")),f.style.backgroundImage="url("+Editor.crossImage+")",f.style.position="absolute",f.style.top="0px",f.style.right="0px",mxEvent.addListener(f,"click",mxUtils.bind(this,function(){b.hideDialog(!0)})),y.appendChild(f),!Q)){var c=!1;mxEvent.addGestureListeners(this.bg,mxUtils.bind(this,function(g){c=!0}),null,mxUtils.bind(this,function(g){c&&(b.hideDialog(!0),c=!1)}))}this.onDialogClose=B;this.container=y;null!=E&&this.addResizeHandler(E);
b.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.prototype.noColorImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC";
Dialog.prototype.closeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAQMAAADaX5RTAAAABlBMVEV7mr3///+wksspAAAAAnRSTlP/AOW3MEoAAAAdSURBVAgdY9jXwCDDwNDRwHCwgeExmASygSL7GgB12QiqNHZZIwAAAABJRU5ErkJggg==";Dialog.prototype.clearImage="data:image/gif;base64,R0lGODlhDQAKAIABAMDAwP///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OUIzOEM1NzI4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUIzOEM1NzM4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5QjM4QzU3MDg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5QjM4QzU3MTg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAAEALAAAAAANAAoAAAIXTGCJebD9jEOTqRlttXdrB32PJ2ncyRQAOw==";
Dialog.prototype.getDocumentSize=function(){return mxUtils.getDocumentSize()};Dialog.prototype.getPosition=function(b,f){return new mxPoint(b,f)};
Dialog.prototype.addResizeHandler=function(b){var f=document.createElement("img");f.setAttribute("src",mxWindow.prototype.resizeImage);f.style.cursor="nwse-resize";f.style.position="absolute";f.style.bottom="0px";f.style.right="0px";f.style.zIndex="2";var l=null,u=null,y=null,q=null,B=mxUtils.bind(this,function(E){l=mxEvent.getClientX(E);u=mxEvent.getClientY(E);y=parseInt(this.container.style.width);q=parseInt(this.container.style.height);mxEvent.addGestureListeners(document,null,H,S);mxEvent.consume(E)}),
H=mxUtils.bind(this,function(E){if(null!=l&&null!=u){var Q=mxEvent.getClientX(E)-l,c=mxEvent.getClientY(E)-u;this.container.style.width=Math.max(b.width,y+2*Q)+"px";this.container.style.height=Math.max(b.height,q+2*c)+"px";mxEvent.consume(E)}}),S=mxUtils.bind(this,function(E){null!=l&&null!=u&&(u=l=null,mxEvent.removeGestureListeners(document,null,H,S),mxEvent.consume(E))});mxEvent.addGestureListeners(f,B,H,S);this.container.appendChild(f)};
Dialog.prototype.close=function(b,f){if(null!=this.onDialogClose){if(0==this.onDialogClose(b,f))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,f,l,u,y,q,B,H,S,E,Q){S=null!=S?S:!0;var c=document.createElement("div");c.style.textAlign="center";if(null!=f){var g=document.createElement("div");g.style.padding="0px";g.style.margin="0px";g.style.fontSize="18px";g.style.paddingBottom="16px";g.style.marginBottom="10px";g.style.borderBottom="1px solid #c0c0c0";g.style.color="gray";g.style.whiteSpace="nowrap";g.style.textOverflow="ellipsis";g.style.overflow="hidden";mxUtils.write(g,f);g.setAttribute("title",f);c.appendChild(g)}f=
document.createElement("div");f.style.lineHeight="1.2em";f.style.padding="6px";"string"===typeof l&&(l=l.replace(/\n/g,"<br/>"));f.innerHTML=Graph.sanitizeHtml(l);c.appendChild(f);l=document.createElement("div");l.style.marginTop="12px";l.style.textAlign="center";null!=q&&(f=mxUtils.button(mxResources.get("tryAgain"),function(){b.hideDialog();q()}),f.className="geBtn",l.appendChild(f),l.style.textAlign="center");null!=E&&(E=mxUtils.button(E,function(){null!=Q&&Q()}),E.className="geBtn",l.appendChild(E));
var m=mxUtils.button(u,function(){S&&b.hideDialog();null!=y&&y()});m.className="geBtn";l.appendChild(m);null!=B&&(u=mxUtils.button(B,function(){S&&b.hideDialog();null!=H&&H()}),u.className="geBtn gePrimaryBtn",l.appendChild(u));this.init=function(){m.focus()};c.appendChild(l);this.container=c},PrintDialog=function(b,f,l,u){this.create(b,f,l,u)};
PrintDialog.prototype.create=function(b){function f(m){var n=B.checked||E.checked,x=parseInt(c.value)/100;isNaN(x)&&(x=1,c.value="100%");mxClient.IS_SF&&(x*=.75);var F=l.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,I=1/l.pageScale;if(n){var M=B.checked?1:parseInt(Q.value);isNaN(M)||(I=mxUtils.getScaleForPageCount(M,l,F))}var L=M=0;F=mxRectangle.fromRectangle(F);F.width=Math.ceil(F.width*x);F.height=Math.ceil(F.height*x);I*=x;!n&&l.pageVisible?(x=l.getPageLayout(),M-=x.x*F.width,L-=x.y*F.height):
n=!0;n=PrintDialog.createPrintPreview(l,I,F,0,M,L,n);n.open();m&&PrintDialog.printPreview(n)}var l=b.editor.graph,u=document.createElement("table");u.style.width="100%";u.style.height="100%";var y=document.createElement("tbody");var q=document.createElement("tr");var B=document.createElement("input");B.setAttribute("type","checkbox");var H=document.createElement("td");H.setAttribute("colspan","2");H.style.fontSize="10pt";H.appendChild(B);var S=document.createElement("span");mxUtils.write(S," "+mxResources.get("fitPage"));
H.appendChild(S);mxEvent.addListener(S,"click",function(m){B.checked=!B.checked;E.checked=!B.checked;mxEvent.consume(m)});mxEvent.addListener(B,"change",function(){E.checked=!B.checked});q.appendChild(H);y.appendChild(q);q=q.cloneNode(!1);var E=document.createElement("input");E.setAttribute("type","checkbox");H=document.createElement("td");H.style.fontSize="10pt";H.appendChild(E);S=document.createElement("span");mxUtils.write(S," "+mxResources.get("posterPrint")+":");H.appendChild(S);mxEvent.addListener(S,
"click",function(m){E.checked=!E.checked;B.checked=!E.checked;mxEvent.consume(m)});q.appendChild(H);var Q=document.createElement("input");Q.setAttribute("value","1");Q.setAttribute("type","number");Q.setAttribute("min","1");Q.setAttribute("size","4");Q.setAttribute("disabled","disabled");Q.style.width="50px";H=document.createElement("td");H.style.fontSize="10pt";H.appendChild(Q);mxUtils.write(H," "+mxResources.get("pages")+" (max)");q.appendChild(H);y.appendChild(q);mxEvent.addListener(E,"change",
function(){E.checked?Q.removeAttribute("disabled"):Q.setAttribute("disabled","disabled");B.checked=!E.checked});q=q.cloneNode(!1);H=document.createElement("td");mxUtils.write(H,mxResources.get("pageScale")+":");q.appendChild(H);H=document.createElement("td");var c=document.createElement("input");c.setAttribute("value","100 %");c.setAttribute("size","5");c.style.width="50px";H.appendChild(c);q.appendChild(H);y.appendChild(q);q=document.createElement("tr");H=document.createElement("td");H.colSpan=2;
H.style.paddingTop="20px";H.setAttribute("align","right");S=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});S.className="geBtn";b.editor.cancelFirst&&H.appendChild(S);if(PrintDialog.previewEnabled){var g=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();f(!1)});g.className="geBtn";H.appendChild(g)}g=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();f(!0)});g.className="geBtn gePrimaryBtn";H.appendChild(g);b.editor.cancelFirst||
H.appendChild(S);q.appendChild(H);y.appendChild(q);u.appendChild(y);this.container=u};PrintDialog.printPreview=function(b){try{null!=b.wnd&&window.setTimeout(function(){b.wnd.focus();b.wnd.print();b.wnd.close()},500)}catch(f){}};
PrintDialog.createPrintPreview=function(b,f,l,u,y,q,B){f=new mxPrintPreview(b,f,l,u,y,q);f.title=mxResources.get("preview");f.addPageCss=!mxClient.IS_SF;f.printBackgroundImage=!0;f.autoOrigin=B;B=b.background;if(null==B||""==B||B==mxConstants.NONE)B="#ffffff";f.backgroundColor=B;var H=f.isTextLabel;f.isTextLabel=function(E){return"geHint"==!E.className&&H.apply(this,arguments)};var S=f.getLinkForCellState;f.getLinkForCellState=function(E){return b.getAbsoluteUrl(S.apply(this,arguments))};return f};
PrintDialog.previewEnabled=!0;
var PageSetupDialog=function(b){function f(){var x=c;null!=x&&null!=x.originalSrc&&(x=b.createImageForPageLink(x.originalSrc,null));null!=x&&null!=x.src?(Q.style.backgroundImage="url("+x.src+")",Q.style.display="inline-block"):(Q.style.backgroundImage="",Q.style.display="none");Q.style.backgroundColor="";null!=g&&g!=mxConstants.NONE&&(Q.style.backgroundColor=g,Q.style.display="inline-block")}var l=b.editor.graph,u=document.createElement("table");u.style.width="100%";u.style.height="100%";var y=document.createElement("tbody");
var q=document.createElement("tr");var B=document.createElement("td");B.style.verticalAlign="top";B.style.fontSize="10pt";mxUtils.write(B,mxResources.get("paperSize")+":");q.appendChild(B);B=document.createElement("td");B.style.verticalAlign="top";B.style.fontSize="10pt";var H=PageSetupDialog.addPageFormatPanel(B,"pagesetupdialog",l.pageFormat);q.appendChild(B);y.appendChild(q);q=document.createElement("tr");B=document.createElement("td");mxUtils.write(B,mxResources.get("gridSize")+":");q.appendChild(B);
B=document.createElement("td");B.style.whiteSpace="nowrap";var S=document.createElement("input");S.setAttribute("type","number");S.setAttribute("min","0");S.style.width="40px";S.style.marginLeft="6px";S.value=l.getGridSize();B.appendChild(S);mxEvent.addListener(S,"change",function(){var x=parseInt(S.value);S.value=Math.max(1,isNaN(x)?l.getGridSize():x)});q.appendChild(B);y.appendChild(q);q=document.createElement("tr");B=document.createElement("td");mxUtils.write(B,mxResources.get("background")+":");
q.appendChild(B);B=document.createElement("td");var E=document.createElement("button");E.className="geBtn";E.style.margin="0px";mxUtils.write(E,mxResources.get("change")+"...");var Q=document.createElement("div");Q.style.display="inline-block";Q.style.verticalAlign="middle";Q.style.backgroundPosition="center center";Q.style.backgroundRepeat="no-repeat";Q.style.backgroundSize="contain";Q.style.border="1px solid lightGray";Q.style.borderRadius="4px";Q.style.marginRight="14px";Q.style.height="32px";
Q.style.width="64px";Q.style.cursor="pointer";Q.style.padding="4px";var c=l.backgroundImage,g=l.background,m=l.shadowVisible,n=function(x){b.showBackgroundImageDialog(function(F,I,M,L){I||(null!=F&&null!=F.src&&Graph.isPageLink(F.src)&&(F={originalSrc:F.src}),c=F,m=L);g=M;f()},c,g,!0);mxEvent.consume(x)};mxEvent.addListener(E,"click",n);mxEvent.addListener(Q,"click",n);f();B.appendChild(Q);B.appendChild(E);q.appendChild(B);y.appendChild(q);q=document.createElement("tr");B=document.createElement("td");
B.colSpan=2;B.style.paddingTop="16px";B.setAttribute("align","right");E=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});E.className="geBtn";b.editor.cancelFirst&&B.appendChild(E);n=mxUtils.button(mxResources.get("apply"),function(){b.hideDialog();var x=parseInt(S.value);isNaN(x)||l.gridSize===x||l.setGridSize(x);x=new ChangePageSetup(b,g,c,H.get());x.ignoreColor=l.background==g;x.ignoreImage=(null!=l.backgroundImage?l.backgroundImage.src:null)===(null!=c?c.src:null);null!=m&&
(x.shadowVisible=m);l.pageFormat.width==x.previousFormat.width&&l.pageFormat.height==x.previousFormat.height&&x.ignoreColor&&x.ignoreImage&&x.shadowVisible==l.shadowVisible||l.model.execute(x)});n.className="geBtn gePrimaryBtn";B.appendChild(n);b.editor.cancelFirst||B.appendChild(E);q.appendChild(B);y.appendChild(q);u.appendChild(y);this.container=u};
PageSetupDialog.addPageFormatPanel=function(b,f,l,u){f="format-"+f;var y=document.createElement("input");y.setAttribute("name",f);y.setAttribute("type","radio");y.setAttribute("value","portrait");var q=document.createElement("input");q.setAttribute("name",f);q.setAttribute("type","radio");q.setAttribute("value","landscape");var B=document.createElement("select");B.style.position="relative";B.style.marginBottom="4px";B.style.borderRadius="4px";B.style.borderWidth="1px";B.style.borderStyle="solid";
B.style.boxSizing="border-box";B.style.padding="2px";B.style.width="210px";var H=document.createElement("div");H.style.whiteSpace="nowrap";H.style.marginLeft="4px";H.style.width="210px";H.style.height="24px";y.style.marginRight="6px";H.appendChild(y);f=document.createElement("span");f.style.maxWidth="100px";mxUtils.write(f,mxResources.get("portrait"));H.appendChild(f);q.style.marginLeft="10px";q.style.marginRight="6px";H.appendChild(q);var S=document.createElement("span");S.style.width="100px";mxUtils.write(S,
mxResources.get("landscape"));H.appendChild(S);var E=document.createElement("div");E.style.whiteSpace="nowrap";E.style.marginLeft="4px";E.style.fontSize="12px";E.style.width="210px";E.style.height="24px";var Q=document.createElement("input");Q.setAttribute("size","7");Q.setAttribute("title",mxResources.get("width"));Q.style.textAlign="right";E.appendChild(Q);mxUtils.write(E," x ");var c=document.createElement("input");c.setAttribute("size","7");c.setAttribute("title",mxResources.get("height"));c.style.textAlign=
"right";E.appendChild(c);var g=document.createElement("select");g.style.marginLeft="4px";g.style.maxWidth="78px";g.style.width="78px";for(var m=[{label:mxResources.get("points"),unit:mxConstants.POINTS},{label:mxResources.get("inches"),unit:mxConstants.INCHES},{label:mxResources.get("millimeters"),unit:mxConstants.MILLIMETERS}],n=0;n<m.length;n++){var x=document.createElement("option");x.setAttribute("value",m[n].unit);mxUtils.write(x,m[n].label);g.appendChild(x)}g.value=Editor.pageSizeUnit;E.appendChild(g);
H.style.display="none";E.style.display="none";var F={},I=PageSetupDialog.getFormats();for(n=0;n<I.length;n++)m=I[n],F[m.key]=m,x=document.createElement("option"),x.setAttribute("value",m.key),mxUtils.write(x,m.title),B.appendChild(x);var M=function(){B.value="custom";for(var K=0;K<I.length;K++){var aa=I[K];null!=aa.format&&("a4"==aa.key?826==l.width?(l=mxRectangle.fromRectangle(l),l.width=827):826==l.height&&(l=mxRectangle.fromRectangle(l),l.height=827):"a5"==aa.key&&(584==l.width?(l=mxRectangle.fromRectangle(l),
l.width=583):584==l.height&&(l=mxRectangle.fromRectangle(l),l.height=583)),l.width==aa.format.width&&l.height==aa.format.height?(B.value=aa.key,y.setAttribute("checked","checked"),y.defaultChecked=!0,y.checked=!0,q.removeAttribute("checked"),q.defaultChecked=!1,q.checked=!1,detected=!0):l.width==aa.format.height&&l.height==aa.format.width&&(B.value=aa.key,y.removeAttribute("checked"),y.defaultChecked=!1,y.checked=!1,q.setAttribute("checked","checked"),q.defaultChecked=!0,detected=q.checked=!0))}"custom"==
B.value?(Q.value=Editor.toUnit(l.width,g.value),c.value=Editor.toUnit(l.height,g.value),y.setAttribute("checked","checked"),B.value="custom",H.style.display="none",E.style.display=""):(H.style.display="",E.style.display="none")};M();b.appendChild(B);mxUtils.br(b);b.appendChild(H);b.appendChild(E);var L=function(K,aa){K=F[B.value];null!=K.format?(Q.value=Editor.toUnit(q.checked?K.format.height:K.format.width,g.value),c.value=Editor.toUnit(q.checked?K.format.width:K.format.height,g.value),E.style.display=
"none",H.style.display=""):(H.style.display="none",E.style.display="");K=parseFloat(Q.value);if(isNaN(K)||0>=K)Q.value=Editor.toUnit(l.width,g.value);K=parseFloat(c.value);if(isNaN(K)||0>=K)c.value=Editor.toUnit(l.height,g.value);K=new mxRectangle(0,0,Math.floor(Editor.fromUnit(parseFloat(Q.value),g.value)),Math.floor(Editor.fromUnit(parseFloat(c.value),g.value)));aa||K.width==l.width&&K.height==l.height||(l=K,null!=u&&u(l))};mxEvent.addListener(f,"click",function(K){y.checked=!0;L(K);mxEvent.consume(K)});
mxEvent.addListener(S,"click",function(K){q.checked=!0;L(K);mxEvent.consume(K)});mxEvent.addListener(Q,"blur",L);mxEvent.addListener(Q,"click",L);mxEvent.addListener(c,"blur",L);mxEvent.addListener(c,"click",L);mxEvent.addListener(q,"change",L);mxEvent.addListener(y,"change",L);mxEvent.addListener(B,"change",function(K){L(K,"custom"==B.value);mxEvent.consume(K)});mxEvent.addListener(g,"change",function(K){Q.value=Editor.toUnit(Editor.fromUnit(Q.value,Editor.pageSizeUnit),g.value);c.value=Editor.toUnit(Editor.fromUnit(c.value,
Editor.pageSizeUnit),g.value);Editor.pageSizeUnit=g.value;L(K,!0);mxEvent.consume(K)});L(null,!0);return{set:function(K){l=K;M(null,null,!0)},get:function(){return l},widthInput:Q,heightInput:c}};
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,f,l,u,y,q,B,H,S,E,Q){S=null!=S?S:!0;var c=document.createElement("div"),g=document.createElement("div");g.style.width="100%";g.style.display="grid";g.style.gap="5px 8px";g.style.gridAutoColumns="auto 1fr";g.style.boxSizing="border-box";g.style.padding="3px";var m=document.createElement("div");m.style.display="inline-flex";m.style.alignItems="center";m.style.justifyContent="flex-end";m.style.minWidth="0";var n=document.createElement("div");n.style.display="inline-block";
n.style.textOverflow="ellipsis";n.style.whiteSpace="nowrap";n.style.overflow="hidden";n.style.fontSize="10pt";n.style.padding="2px 0";n.setAttribute("title",y||mxResources.get("filename"));mxUtils.write(n,(y||mxResources.get("filename"))+":");m.appendChild(n);g.appendChild(m);var x=document.createElement("input");x.setAttribute("value",f||"");x.style.flexGrow="1";var F=mxUtils.button(l,function(){if(null==q||q(x.value))S&&b.hideDialog(),u(x.value)});F.className="geBtn gePrimaryBtn";this.init=function(){if(null!=
y||null==B)if(null!=Q?Editor.selectFilename(x):(x.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?x.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var I=g.parentNode;if(null!=I){var M=null;mxEvent.addListener(I,"dragleave",function(L){null!=M&&(M.style.backgroundColor="",M=null);L.stopPropagation();L.preventDefault()});mxEvent.addListener(I,"dragover",mxUtils.bind(this,function(L){null==M&&(!mxClient.IS_IE||10<document.documentMode)&&(M=x,M.style.backgroundColor=
"#ebf2f9");L.stopPropagation();L.preventDefault()}));mxEvent.addListener(I,"drop",mxUtils.bind(this,function(L){null!=M&&(M.style.backgroundColor="",M=null);0<=mxUtils.indexOf(L.dataTransfer.types,"text/uri-list")&&(x.value=decodeURIComponent(L.dataTransfer.getData("text/uri-list")),F.click());L.stopPropagation();L.preventDefault()}))}}};m=document.createElement("div");m.style.display="inline-flex";m.style.alignItems="center";m.style.gap="4px";m.style.whiteSpace="nowrap";m.appendChild(x);g.appendChild(m);
null==y&&null!=B||null==Q||null==b.editor.diagramFileTypes||(m=document.createElement("div"),m.style.display="inline-flex",m.style.alignItems="center",m.style.textOverflow="ellipsis",m.style.justifyContent="flex-end",m.style.fontSize="10pt",mxUtils.write(m,mxResources.get("type")+":"),g.appendChild(m),m=document.createElement("div"),m.style.display="inline-flex",m.style.alignItems="center",m.style.whiteSpace="nowrap",g.appendChild(m),f=FilenameDialog.createFileTypes(b,x,b.editor.diagramFileTypes),
f.style.width="100%",m.appendChild(f));null!=B&&g.appendChild(B);row=document.createElement("div");row.style.gridColumn="1 / span 2";row.style.paddingTop=null!=Q?"6px":"14px";row.style.whiteSpace="nowrap";row.style.display="inline-flex";row.style.alignItems="center";row.style.justifyContent="flex-end";row.setAttribute("align","right");m=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog();null!=E&&E()});m.className="geBtn";null==H||b.isOffline()||row.appendChild(b.createHelpIcon(H));
b.editor.cancelFirst&&row.appendChild(m);mxEvent.addListener(x,"keypress",function(I){13==I.keyCode&&F.click()});row.appendChild(F);b.editor.cancelFirst||row.appendChild(m);g.appendChild(row);c.appendChild(g);this.container=c};FilenameDialog.filenameHelpLink=null;
FilenameDialog.createFileTypes=function(b,f,l){var u=document.createElement("select");for(b=0;b<l.length;b++){var y=document.createElement("option");y.setAttribute("value",b);mxUtils.write(y,mxResources.get(l[b].description)+" (."+l[b].extension+")");u.appendChild(y)}mxEvent.addListener(u,"change",function(q){q=l[u.value].extension;var B=f.value.lastIndexOf(".drawio.");B=0<B?B:f.value.lastIndexOf(".");"drawio"!=q&&(q="drawio."+q);f.value=0<B?f.value.substring(0,B+1)+q:f.value+"."+q;"createEvent"in
document?(q=document.createEvent("HTMLEvents"),q.initEvent("change",!1,!0),f.dispatchEvent(q)):f.fireEvent("onchange")});b=function(q){q=f.value.toLowerCase();for(var B=0,H=0;H<l.length;H++){var S=l[H].extension,E=null;"drawio"!=S&&(E=S,S=".drawio."+S);if(q.substring(q.length-S.length-1)=="."+S||null!=E&&q.substring(q.length-E.length-1)=="."+E){B=H;break}}u.value=B};mxEvent.addListener(f,"change",b);mxEvent.addListener(f,"keyup",b);b();return u};
var WrapperWindow=function(b,f,l,u,y,q,B,H){H=null!=H?H:document.createElement("div");this.window=new mxWindow(f,H,l,u,y,q,!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);B(H)};
(function(){mxGraphView.prototype.validateBackgroundPage=function(){var B=this.graph;if(null!=B.container&&!B.transparentBackground){if(B.pageVisible){var H=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var S=B.container.firstChild;null!=S&&S.nodeType!=mxConstants.NODETYPE_ELEMENT;)S=S.nextSibling;null!=S&&(this.backgroundPageShape=this.createBackgroundPageShape(H),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,
this.backgroundPageShape.init(B.container),S.style.position="absolute",B.container.insertBefore(this.backgroundPageShape.node,S),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(E){B.dblClick(E)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(E){B.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(E))}),mxUtils.bind(this,function(E){null!=
B.tooltipHandler&&B.tooltipHandler.isHideOnHover()&&B.tooltipHandler.hide();B.isMouseDown&&!mxEvent.isConsumed(E)&&B.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(E))}),mxUtils.bind(this,function(E){B.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(E))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=H,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null);this.validateBackgroundStyles()}};
mxGraphView.prototype.validateBackgroundStyles=function(B,H,S){var E=this.graph;B=null!=B?B:1;var Q=mxUtils.getLightDarkColor(null==E.background||E.background==mxConstants.NONE?E.defaultPageBackgroundColor:E.background).cssText,c=mxUtils.getLightDarkColor(E.defaultPageBorderColor).cssText,g=null!=Q&&this.gridColor!=Q.toLowerCase()?this.gridColor:"#ffffff",m="none",n="";"simple"==E.getAdaptiveColors()&&E.background!=mxConstants.NONE&&null!=E.background&&(Q=E.background);if(E.isGridEnabled()||E.gridVisible){n=
10;mxClient.IS_SVG?(m=unescape(encodeURIComponent(this.createSvgGrid(g,B))),m=window.btoa?btoa(m):Base64.encode(m,!0),m="url(data:image/svg+xml;base64,"+m+")",n=E.gridSize*this.scale*this.gridSteps*B):m="url("+this.gridImage+")";var x=g=0;H=null!=H?H-this.translate.x*this.scale:0;S=null!=S?S-this.translate.y*this.scale:0;var F=E.gridSize*this.scale*this.gridSteps,I=H%F;F=S%F;null!=E.view.backgroundPageShape&&(x=this.getBackgroundPageBounds(),g=1+x.x,x=1+x.y);n=-Math.round(n-mxUtils.mod(this.translate.x*
this.scale-g+H,n)+I*B)+"px "+-Math.round(n-mxUtils.mod(this.translate.y*this.scale-x+S,n)+F*B)+"px"}B=E.view.canvas;null!=B.ownerSVGElement&&(B=B.ownerSVGElement);g=!Editor.isDarkMode()&&E.enableDiagramBackground;null!=E.view.backgroundPageShape?(E.view.backgroundPageShape.node.style.backgroundPosition=n,E.view.backgroundPageShape.node.style.backgroundImage=m,E.view.backgroundPageShape.node.style.backgroundColor=Q,E.view.backgroundPageShape.node.style.borderColor=c,E.view.backgroundPageShape.node.style.colorScheme=
"none"==E.getAdaptiveColors()?"light":"",B.style.backgroundImage="none",B.style.backgroundColor="",E.container.style.backgroundColor=g?E.diagramBackgroundColor:""):(B.style.backgroundPosition=n,B.style.backgroundImage=m,"1"==urlParams.transparent?E.container.style.background="transparent":!g||null!=E.background&&E.background!=mxConstants.NONE?B.style.backgroundColor=Q:(B.style.backgroundColor=E.diagramBackgroundColor,E.container.style.backgroundColor=""))};mxGraphView.prototype.createSvgGrid=function(B,
H){for(var S=this.graph.gridSize*this.scale*(null!=H?H:1);S<this.minGridSize;)S*=2;H=this.gridSteps*S;for(var E=[],Q=1;Q<this.gridSteps;Q++){var c=Q*S;E.push("M 0 "+c+" L "+H+" "+c+" M "+c+" 0 L "+c+" "+H)}B=mxUtils.getLightDarkColor(B);S="color-scheme: light dark;";mxClient.IS_SF&&(S="color-scheme: "+("none"!=this.graph.getAdaptiveColors()&&Editor.isDarkMode()?"dark":"light"));return'<svg style="'+S+'" width="'+H+'" height="'+H+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+
H+'" height="'+H+'" patternUnits="userSpaceOnUse"><path d="'+E.join(" ")+'" fill="none" style="stroke:'+mxUtils.htmlEntities(B.cssText)+';" stroke="'+B.light+'" opacity="0.2" stroke-width="1"/><path d="M '+H+" 0 L 0 0 0 "+H+'" fill="none" style="stroke:'+mxUtils.htmlEntities(B.cssText)+';" stroke="'+B.light+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var b=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(B,H){b.apply(this,arguments);
if(null!=this.shiftPreview1){var S=this.view.canvas;null!=S.ownerSVGElement&&(S=S.ownerSVGElement);var E=this.gridSize*this.view.scale*this.view.gridSteps;E=-Math.round(E-mxUtils.mod(this.view.translate.x*this.view.scale+B,E))+"px "+-Math.round(E-mxUtils.mod(this.view.translate.y*this.view.scale+H,E))+"px";S.style.backgroundPosition=E}};mxGraph.prototype.updatePageBreaks=function(B,H,S){var E=this.view.scale,Q=this.view.translate,c=this.pageFormat,g=E*this.pageScale,m=this.view.getBackgroundPageBounds();
H=m.width;S=m.height;var n=new mxRectangle(E*Q.x,E*Q.y,c.width*g,c.height*g),x=(B=B&&Math.min(n.width,n.height)>this.minPageBreakDist)?Math.ceil(S/n.height)-1:0,F=B?Math.ceil(H/n.width)-1:0,I=m.x+H,M=m.y+S;null==this.horizontalPageBreaks&&0<x&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<F&&(this.verticalPageBreaks=[]);B=mxUtils.bind(this,function(L){if(null!=L){for(var K=L==this.horizontalPageBreaks?x:F,aa=0;aa<=K;aa++){var ja=L==this.horizontalPageBreaks?[new mxPoint(Math.round(m.x),
Math.round(m.y+(aa+1)*n.height)),new mxPoint(Math.round(I),Math.round(m.y+(aa+1)*n.height))]:[new mxPoint(Math.round(m.x+(aa+1)*n.width),Math.round(m.y)),new mxPoint(Math.round(m.x+(aa+1)*n.width),Math.round(M))];null!=L[aa]?(L[aa].points=ja,L[aa].redraw()):(ja=new mxPolyline(ja,this.pageBreakColor),ja.dialect=this.dialect,ja.isDashed=this.pageBreakDashed,ja.pointerEvents=!1,ja.init(this.view.backgroundPane),ja.redraw(),L[aa]=ja)}for(aa=K;aa<L.length;aa++)null!=L[aa]&&L[aa].destroy();L.splice(K,L.length-
K)}});B(this.horizontalPageBreaks);B(this.verticalPageBreaks)};var f=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(B,H,S){for(var E=0;E<H.length;E++){if(this.graph.isTableCell(H[E])||this.graph.isTableRow(H[E]))return!1;if(this.graph.getModel().isVertex(H[E])){var Q=this.graph.getCellGeometry(H[E]);if(null!=Q&&Q.relative)return!1}}return f.apply(this,arguments)};var l=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=
function(){var B=l.apply(this,arguments);B.intersects=mxUtils.bind(this,function(H,S){return this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(B,arguments)});return B};mxGraphView.prototype.createBackgroundPageShape=function(B){return new mxRectangleShape(B,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var B=this.getGraphBounds(),H=0<B.width?B.x/this.scale-this.translate.x:0,S=0<B.height?B.y/this.scale-this.translate.y:0,E=this.graph.pageFormat,
Q=this.graph.pageScale,c=E.width*Q;E=E.height*Q;Q=Math.floor(Math.min(0,H)/c);var g=Math.floor(Math.min(0,S)/E);return new mxRectangle(this.scale*(this.translate.x+Q*c),this.scale*(this.translate.y+g*E),this.scale*(Math.ceil(Math.max(1,H+B.width/this.scale)/c)-Q)*c,this.scale*(Math.ceil(Math.max(1,S+B.height/this.scale)/E)-g)*E)};var u=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(B,H){u.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||
this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=B+"px",this.view.backgroundPageShape.node.style.marginTop=H+"px")};var y=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(B,H,S,E,Q,c){var g=y.apply(this,arguments);null==c||c||mxEvent.addListener(g,"mousedown",function(m){mxEvent.consume(m)});return g};var q=mxGraphHandler.prototype.isPropagateSelectionCell;mxGraphHandler.prototype.isPropagateSelectionCell=
function(B,H,S){var E=this.graph.model.getParent(B);if(H){var Q=this.graph.model.isEdge(B)?null:this.graph.getCellGeometry(B);Q=!this.graph.model.isEdge(E)&&!this.graph.isSiblingSelected(B)&&(null!=Q&&Q.relative||!this.graph.isContainer(E)||this.graph.isPart(B))}else if(Q=q.apply(this,arguments),this.graph.isTableCell(B)||this.graph.isTableRow(B))Q=E,this.graph.isTable(Q)||(Q=this.graph.model.getParent(Q)),Q=!this.graph.selectionCellsHandler.isHandled(Q)||this.graph.isCellSelected(Q)&&this.graph.isToggleEvent(S.getEvent())||
this.graph.isCellSelected(B)&&!this.graph.isToggleEvent(S.getEvent())||this.graph.isTableCell(B)&&this.graph.isCellSelected(E);return Q};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(B){B=B.getCell();for(var H=this.graph.getModel(),S=H.getParent(B),E=this.graph.view.getState(S),Q=this.graph.isCellSelected(B);null!=E&&(H.isVertex(S)||H.isEdge(S));){var c=this.graph.isCellSelected(S);Q=Q||c;if(c||!Q&&(this.graph.isTableCell(B)||this.graph.isTableRow(B)))B=S;S=H.getParent(S)}return B}})();EditorUi=function(b,f,l){mxEventSource.call(this);this.destroyFunctions=[];this.editor=b||new Editor;this.container=f||document.body;var u=this,y=this.editor.graph;y.lightbox=l;var q=y.getGraphBounds;y.getGraphBounds=function(){var Y=q.apply(this,arguments),da=this.backgroundImage;if(null!=da&&null!=da.width&&null!=da.height){var ha=this.view.translate,Z=this.view.scale;Y=mxRectangle.fromRectangle(Y);Y.add(new mxRectangle((ha.x+da.x)*Z,(ha.y+da.y)*Z,da.width*Z,da.height*Z))}return Y};y.useCssTransforms&&
(this.lazyZoomDelay=0);this.selectionStateListener=mxUtils.bind(this,function(Y,da){this.clearSelectionState()});y.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionStateListener);y.getModel().addListener(mxEvent.CHANGE,this.selectionStateListener);y.addListener(mxEvent.EDITING_STARTED,this.selectionStateListener);y.addListener(mxEvent.EDITING_STOPPED,this.selectionStateListener);y.getView().addListener("unitChanged",this.selectionStateListener);if(this.editor.chromeless&&!this.editor.editable){y.isEnabled=
function(){return!1};y.panningHandler.isForcePanningEvent=function(Y){for(var da=Y.getSource();null!=da&&da!=y.container;){if("foreignObject"===da.nodeName||"text"===da.nodeName)return!1;da=da.parentNode}return!mxEvent.isPopupTrigger(Y.getEvent())};var B=y.panningHandler.start;y.panningHandler.start=function(){B.apply(this,arguments);mxUtils.clearSelection()}}this.actions=new Actions(this);this.menus=this.createMenus();if(!y.standalone){var H=!1,S=!1;this.setDefaultStyle=function(Y){try{y.getModel().isEdge(Y)?
S=y.pasteEdgeStyle=!1:H=!1;var da=y.getCellStyle(Y,!1),ha=[],Z=[],k;for(k in da)ha.push(da[k]),Z.push(k);y.getModel().isEdge(Y)?y.currentEdgeStyle={}:y.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",Z,"values",ha,"cells",[Y],"force",!0));y.getModel().isEdge(Y)?S=y.pasteEdgeStyle=!0:H=!0}catch(v){this.handleError(v)}};this.clearDefaultStyle=function(){y.currentEdgeStyle=mxUtils.clone(y.defaultEdgeStyle);y.currentVertexStyle=mxUtils.clone(y.defaultVertexStyle);H=S=y.pasteEdgeStyle=
!1;this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};y.addListener("cellsInserted",function(Y,da){y.pasteCellStyles(y.includeDescendants(da.getProperty("cells")))});y.addListener("textInserted",function(Y,da){y.pasteCellStyles(da.getProperty("cells"))});this.createDivs();this.createUi();this.refresh();var E=mxUtils.bind(this,function(Y){null==Y&&(Y=window.event);return y.isEditing()||null!=Y&&this.isSelectionAllowed(Y)});this.container!=document.body||this.editor.chromeless&&
!this.editor.editable||(this.menubarContainer.onselectstart=E,this.menubarContainer.onmousedown=E,this.toolbarContainer.onselectstart=E,this.toolbarContainer.onmousedown=E,this.diagramContainer.onselectstart=E,this.diagramContainer.onmousedown=E,this.sidebarContainer.onselectstart=E,this.sidebarContainer.onmousedown=E,this.formatContainer.onselectstart=E,this.formatContainer.onmousedown=E,null!=this.tabContainer&&(this.tabContainer.onselectstart=E),mxClient.IS_IOS&&(f=function(){var Y=null;if(/iP(hone|od|ad)/.test(navigator.platform)){var da=
navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);try{Y=[parseInt(da[1],10),parseInt(da[2],10),parseInt(da[3]||0,10)]}catch(ha){}}return Y}(),null!=f&&16<=f[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?(f=function(Y){if(null!=Y){var da=mxEvent.getSource(Y);if("A"==da.nodeName)for(;null!=da;){if("geHint"==da.className)return!0;da=da.parentNode}}return E(Y)},mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",f):this.diagramContainer.oncontextmenu=f):y.panningHandler.usePopupTrigger=!1;y.init(this.diagramContainer);mxClient.IS_SVG&&null!=y.view.getDrawPane()&&
(f=y.view.getDrawPane().ownerSVGElement,null!=f&&(f.style.position="absolute"));this.hoverIcons=this.createHoverIcons();if(null!=y.graphHandler){var Q=y.graphHandler.start;y.graphHandler.start=function(){null!=u.hoverIcons&&u.hoverIcons.reset();Q.apply(this,arguments)}}mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(Y){var da=mxUtils.getOffset(this.diagramContainer);0<mxEvent.getClientX(Y)-da.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(Y)-da.y-this.diagramContainer.clientHeight?
this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var c=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(Y,da){return u.isSpaceDown()||c.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(Y){16==Y.which?this.shiftDown=!0:32!=Y.which||y.isEditing()?mxEvent.isConsumed(Y)||27!=Y.keyCode||this.hideDialog(null,!0):(this.spaceDown=!0,this.hoverIcons.reset(),y.container.style.cursor="move",y.isEditing()||
mxEvent.getSource(Y)!=y.container||mxEvent.consume(Y))});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(Y){y.container.style.cursor="";this.shiftDown=this.spaceDown=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var g=y.panningHandler.isForcePanningEvent;y.panningHandler.isForcePanningEvent=function(Y){return g.apply(this,arguments)||u.isSpaceDown()||mxEvent.isMouseEvent(Y.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(Y.getEvent()))&&
(!mxEvent.isControlDown(Y.getEvent())&&mxEvent.isRightMouseButton(Y.getEvent())||mxEvent.isMiddleMouseButton(Y.getEvent()))};var m=y.cellEditor.isStopEditingEvent;y.cellEditor.isStopEditingEvent=function(Y){return m.apply(this,arguments)||13==Y.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(Y)||mxClient.IS_MAC&&mxEvent.isMetaDown(Y)||mxClient.IS_SF&&mxEvent.isShiftDown(Y))};var n=y.isZoomWheelEvent;y.isZoomWheelEvent=function(){return u.isSpaceDown()||n.apply(this,arguments)};var x=mxUtils.bind(this,
function(){if(null!=this.toolbar)for(var Y=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,da=this.toolbar.container.firstChild;null!=da;){var ha=da.getAttribute("data-min-width");null!=ha&&parseInt(ha)>Y?da.style.display="none":da.style.display="";da=da.nextSibling}}),F=!1,I=null,M=null,L=null,K=mxUtils.bind(this,function(){if(null!=this.toolbar&&F!=y.cellEditor.isContentEditing()){for(var Y=this.toolbar.container.firstChild,da=[];null!=Y;){var ha=Y.nextSibling;
Y.parentNode.removeChild(Y);da.push(Y);Y=ha}Y=this.toolbar.fontMenu;ha=this.toolbar.sizeMenu;if(null==L)this.toolbar.createTextToolbar();else{for(var Z=0;Z<L.length;Z++)this.toolbar.container.appendChild(L[Z]);this.toolbar.fontMenu=I;this.toolbar.sizeMenu=M}F=y.cellEditor.isContentEditing();I=Y;M=ha;L=da;x()}});this.addListener("languageChanged",mxUtils.bind(this,function(){this.destroyWindows(!0);this.descriptorChanged();this.updateStatusAgain();K()}));this.addListener("currentThemeChanged",x);mxEvent.addListener(window,
"resize",x);x();y.isTouchPopupMenuEnabled=function(){return null==u.dialog};var aa=y.cellEditor.startEditing;y.cellEditor.startEditing=function(){aa.apply(this,arguments);K();if(y.cellEditor.isContentEditing()){var Y=!1,da=function(){Y||(Y=!0,window.setTimeout(function(){var ha=y.getSelectedEditingElement();null!=ha&&(ha=mxUtils.getCurrentStyle(ha),null!=ha&&null!=u.toolbar&&(u.toolbar.setFontName(mxUtils.getCssFontFamily(ha.fontFamily)),u.toolbar.setFontSize(parseInt(ha.fontSize))));Y=!1},0))};mxEvent.addListener(y.cellEditor.textarea,
"input",da);mxEvent.addListener(y.cellEditor.textarea,"touchend",da);mxEvent.addListener(y.cellEditor.textarea,"mouseup",da);mxEvent.addListener(y.cellEditor.textarea,"keyup",da);da()}};var ja=y.cellEditor.stopEditing;y.cellEditor.stopEditing=function(Y,da){try{ja.apply(this,arguments),K()}catch(ha){u.handleError(ha)}};y.container.setAttribute("tabindex","0");y.container.style.cursor="default";if(window.self===window.top&&null!=y.container.parentNode)try{y.container.focus()}catch(Y){}var ca=y.fireMouseEvent;
y.fireMouseEvent=function(Y,da,ha){try{Y==mxEvent.MOUSE_DOWN&&this.container.focus(),ca.apply(this,arguments)}catch(Z){u.handleError(Z)}};var ba=y.foldCells;y.foldCells=function(Y,da,ha,Z,k){try{ba.apply(this,arguments)}catch(v){u.handleError(v)}};y.popupMenuHandler.autoExpand=!0;null!=this.menus&&(y.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(Y,da,ha){this.menus.createPopupMenu(Y,da,ha)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(Y){y.popupMenuHandler.hideMenu()}));
this.keyHandler=this.createKeyHandler(b);this.getKeyHandler=function(){return keyHandler};y.connectionHandler.addListener(mxEvent.CONNECT,function(Y,da){var ha=[da.getProperty("cell")];da.getProperty("terminalInserted")&&(ha.push(da.getProperty("terminal")),window.setTimeout(function(){null!=u.hoverIcons&&u.hoverIcons.update(y.view.getState(ha[ha.length-1]))},0));y.pasteCellStyles(ha)});this.addListener("styleChanged",mxUtils.bind(this,function(Y,da){Y=da.getProperty("force");(this.updateDefaultStyle||
Y)&&y.copyCellStyles(da.getProperty("cells"),da.getProperty("keys"),da.getProperty("values"),y.currentVertexStyle,y.currentEdgeStyle,H,S);null!=this.toolbar&&(this.toolbar.setFontName(y.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(y.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&("orthogonalEdgeStyle"==y.currentEdgeStyle.edgeStyle&&"1"==y.currentEdgeStyle.curved?this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,
Format.curvedImage.src):"straight"==y.currentEdgeStyle.edgeStyle||"none"==y.currentEdgeStyle.edgeStyle||null==y.currentEdgeStyle.edgeStyle?this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.straightImage.src):"entityRelationEdgeStyle"==y.currentEdgeStyle.edgeStyle?this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.entityImage.src):"elbowEdgeStyle"==y.currentEdgeStyle.edgeStyle?"vertical"==y.currentEdgeStyle.elbow?this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.verticalElbowImage.src):
this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.horizontalElbowImage.src):"isometricEdgeStyle"==y.currentEdgeStyle.edgeStyle?"vertical"==y.currentEdgeStyle.elbow?this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.verticalIsometricImage.src):this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.horizontalIsometricImage.src):this.toolbar.setMenuIcon(this.toolbar.edgeStyleMenu,Format.orthogonalImage.src)),null!=this.toolbar.edgeShapeMenu&&("link"==y.currentEdgeStyle.shape?this.toolbar.setMenuIcon(this.toolbar.edgeShapeMenu,
Format.linkEdgeImage.src):"flexArrow"==y.currentEdgeStyle.shape?this.toolbar.setMenuIcon(this.toolbar.edgeShapeMenu,Format.arrowImage.src):"arrow"==y.currentEdgeStyle.shape?this.toolbar.setMenuIcon(this.toolbar.edgeShapeMenu,Format.simpleArrowImage.src):"filledEdge"==y.currentEdgeStyle.shape?this.toolbar.setMenuIcon(this.toolbar.edgeShapeMenu,Format.filledEdgeImage.src):"pipe"==y.currentEdgeStyle.shape?this.toolbar.setMenuIcon(this.toolbar.edgeShapeMenu,Format.pipeEdgeImage.src):"wire"==y.currentEdgeStyle.shape?
this.toolbar.setMenuIcon(this.toolbar.edgeShapeMenu,Format.wireEdgeImage.src):this.toolbar.setMenuIcon(this.toolbar.edgeShapeMenu,Format.connectionImage.src)))}));null!=this.toolbar&&(b=mxUtils.bind(this,function(){var Y=y.currentVertexStyle.fontFamily||"Helvetica",da=String(y.currentVertexStyle.fontSize||"12"),ha=y.getView().getState(y.getSelectionCell());null!=ha&&(Y=ha.style[mxConstants.STYLE_FONTFAMILY]||Y,da=ha.style[mxConstants.STYLE_FONTSIZE]||da,10<Y.length&&(Y=Y.substring(0,8)+"..."));this.toolbar.setFontName(Y);
this.toolbar.setFontSize(da)}),y.getSelectionModel().addListener(mxEvent.CHANGE,b),y.getModel().addListener(mxEvent.CHANGE,b));y.addListener(mxEvent.CELLS_ADDED,function(Y,da){Y=da.getProperty("cells");da=da.getProperty("parent");null!=da&&y.getModel().isLayer(da)&&!y.isCellVisible(da)&&null!=Y&&0<Y.length&&y.getModel().setVisible(da,!0)});Graph.selectParentLayer&&y.selectionModel.addListener(mxEvent.CHANGE,function(){if(y.isEnabled()&&!y.isSelectionEmpty()){var Y=y.getLayerForCells(y.getSelectionCells());
null!=Y&&y.setDefaultParent(Y)}});this.gestureHandler=mxUtils.bind(this,function(Y){null!=this.currentMenu&&mxEvent.getSource(Y)!=this.currentMenu.div&&this.hideCurrentMenu()});mxEvent.addGestureListeners(document,this.gestureHandler);var oa=null;this.resizeHandler=mxUtils.bind(this,function(){null!=oa&&window.clearTimeout(oa);oa=window.setTimeout(mxUtils.bind(this,function(){oa=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(){y.view.validateBackground()}));
this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){y.view.validateBackground()}));y.addListener("gridSizeChanged",mxUtils.bind(this,function(){y.isGridEnabled()&&y.view.validateBackground()}));this.editor.resetGraph()}this.init();y.standalone||this.open()};EditorUi.compactUi=!0;
EditorUi.parsePng=function(b,f,l){function u(H,S){var E=q;q+=S;return H.substring(E,q)}function y(H){H=u(H,4);return H.charCodeAt(3)+(H.charCodeAt(2)<<8)+(H.charCodeAt(1)<<16)+(H.charCodeAt(0)<<24)}var q=0;if(u(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=l&&l();else if(u(b,4),"IHDR"!=u(b,4))null!=l&&l();else{u(b,17);do{l=y(b);var B=u(b,4);if(null!=f&&f(q-8,B,l))break;value=u(b,l);u(b,4);if("IEND"==B)break}while(l)}};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"]?220:230);EditorUi.prototype.hsplitPosition=screen.width<=Editor.smallScreenWidth?0:EditorUi.prototype.defaultSidebarWidth;EditorUi.prototype.allowAnimation=!0;EditorUi.prototype.lightboxMaxFitScale=2;EditorUi.prototype.lightboxVerticalDivider=4;
EditorUi.prototype.hsplitClickEnabled=!1;EditorUi.prototype.updateDefaultStyle=!1;EditorUi.prototype.spaceDown=!1;EditorUi.prototype.shiftDown=!1;
EditorUi.prototype.init=function(){var b=this.editor.graph;if(!b.standalone){"0"!=urlParams["shape-picker"]&&this.installShapePicker();mxEvent.addListener(b.container,"scroll",mxUtils.bind(this,function(){b.tooltipHandler.hide();null!=b.connectionHandler&&null!=b.connectionHandler.constraintHandler&&b.connectionHandler.constraintHandler.reset()}));b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){b.tooltipHandler.hide();var u=b.getRubberband();null!=u&&u.cancel()}));mxEvent.addListener(b.container,
"keydown",mxUtils.bind(this,function(u){this.onKeyDown(u)}));mxEvent.addListener(b.container,"keypress",mxUtils.bind(this,function(u){this.onKeyPress(u)}));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 f=b.setDefaultParent,l=this;this.editor.graph.setDefaultParent=function(){f.apply(this,
arguments);l.updateActionStates()};b.showLinkDialog=mxUtils.bind(l,l.showLinkDialog);b.editLink=l.actions.get("editLink").funct;this.updateActionStates();this.initClipboard();this.initCanvas();null!=this.format&&this.format.init()}};EditorUi.prototype.clearSelectionState=function(){this.selectionState=null};EditorUi.prototype.getSelectionState=function(){null==this.selectionState&&(this.selectionState=this.createSelectionState());return this.selectionState};
EditorUi.prototype.createSelectionState=function(){for(var b=this.editor.graph,f=b.getSelectionCells(),l=this.initSelectionState(),u=!0,y=0;y<f.length;y++){var q=b.getCurrentCellStyle(f[y]);"0"!=mxUtils.getValue(q,mxConstants.STYLE_EDITABLE,"1")&&(this.updateSelectionStateForCell(l,f[y],f,u),u=!1)}this.updateSelectionStateForTableCells(l);if(Editor.enableCustomProperties&&null!=this.format){l.customProperties={};b=l.vertices;f=l.edges;for(y=0;y<b.length;y++)this.findCommonProperties(b[y],l.customProperties,
0==y,l);for(y=0;y<f.length;y++)this.findCommonProperties(f[y],l.customProperties,0==b.length&&0==y,l)}return l};
EditorUi.prototype.findCommonProperties=function(b,f,l,u){if(null!=f){var y=mxUtils.bind(this,function(B){if(null!=B)if(l)for(var H=0;H<B.length;H++){if("function"!==typeof B[H].isVisible||B[H].isVisible(u,this.format))f[B[H].name]=B[H]}else for(var S in f){var E=!1;for(H=0;H<B.length;H++)if(B[H].name==S&&B[H].type==f[S].type){E=!0;break}E||delete f[S]}}),q=this.editor.graph.view.getState(b);null!=q&&null!=q.shape&&(q.shape.commonCustomPropAdded||(q.shape.commonCustomPropAdded=!0,q.shape.customProperties=
q.shape.customProperties||[],q.cell.vertex?Array.prototype.push.apply(q.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(q.shape.customProperties,Editor.commonEdgeProperties)),y(q.shape.customProperties));b=b.getAttribute("customProperties");if(null!=b)try{y(JSON.parse(b))}catch(B){}}};
EditorUi.prototype.initSelectionState=function(){return{vertices:[],edges:[],cells:[],x:null,y:null,width:null,height:null,style:{},containsImage:!1,containsLabel:!1,fill:!0,glass:!0,html:!0,rounded:!0,autoSize:!1,image:!1,shadow:!0,lineJumps:!0,resizable:!0,table:!1,cell:!1,row:!1,movable:!0,rotatable:!0,stroke:!0,swimlane:!1,unlocked:this.editor.graph.isEnabled(),connections:!1}};
EditorUi.prototype.updateSelectionStateForTableCells=function(b){if(1<b.cells.length&&b.cell){var f=mxUtils.sortCells(b.cells),l=this.editor.graph.model,u=l.getParent(f[0]),y=l.getParent(u);if(null!=u&&null!=y){for(var q=u.getIndex(f[0]),B=y.getIndex(u),H=null,S=1,E=1,Q=0,c=B<y.getChildCount()-1?l.getChildAt(l.getChildAt(y,B+1),q):null;Q<f.length-1;){var g=f[++Q];null==c||c!=g||null!=H&&S!=H||(H=S,S=0,E++,u=l.getParent(c),c=B+E<y.getChildCount()?l.getChildAt(l.getChildAt(y,B+E),q):null);var m=this.editor.graph.view.getState(g);
if(g==l.getChildAt(u,q+S)&&null!=m&&1==mxUtils.getValue(m.style,"colspan",1)&&1==mxUtils.getValue(m.style,"rowspan",1))S++;else break}Q==E*S-1&&(b.mergeCell=f[0],b.colspan=S,b.rowspan=E)}}};EditorUi.prototype.windowResized=function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.editor.graph.sizeDidChange()}),0)};
EditorUi.prototype.createTimeout=function(b,f,l){var u=!0,y=null,q=mxUtils.bind(this,function(H){y.clear()&&(u=!1,H=null!=H?H:{code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.createTimeout(b,f,l)})},null!=l?l(H):this.handleError(H))}),B=window.setTimeout(q,null!=b?b:this.timeout);y={clear:function(){window.clearTimeout(B);return u},isAlive:function(){return u}};null!=f&&this.tryAndHandle(mxUtils.bind(this,function(){f(y)}),q);return y};
EditorUi.prototype.tryAndHandle=function(b,f){try{b()}catch(l){null!=f?f(l):this.handleError(l)}};
EditorUi.prototype.removeUserDefinedDarkColors=function(b,f,l){var u=this.editor.graph;b=null!=b?b:u.getSelectionCells();var y=Graph.colorStyles,q=document.createElement("div");u.model.beginUpdate();try{for(var B=0;B<b.length;B++)if(u.model.isEdge(b[B])||u.model.isVertex(b[B])){var H=u.getCellStyle(b[B],!1);if(null!=H)for(var S=0;S<y.length;S++)try{var E=H[y[S]];if(mxUtils.isLightDarkColor(E)){var Q=mxUtils.getLightDarkColor(E);u.setCellStyles(y[S],Q.light,[b[B]])}}catch(g){}f&&u.isHtmlLabel(b[B])&&
"0"!=mxUtils.getValue(H,"html","0")&&(q.innerHTML=Graph.sanitizeHtml(u.getLabel(b[B])),Graph.addLightDarkColors(q,null,null,function(g,m,n){return mxUtils.isLightDarkColor(n)?(n=mxUtils.getLightDarkColor(n),g.style.setProperty(m,n.light),!0):!1})&&u.cellLabelChanged(b[B],q.innerHTML))}if(l&&mxUtils.isLightDarkColor(u.background)){Q=mxUtils.getLightDarkColor(u.background);var c=new ChangePageSetup(this,Q.light);c.ignoreImage=!0;u.model.execute(c)}}finally{u.model.endUpdate()}return b};
EditorUi.prototype.updateSelectionStateForCell=function(b,f,l,u){l=this.editor.graph;b.cells.push(f);if(l.getModel().isVertex(f)){b.connections=0<l.model.getEdgeCount(f);b.unlocked=b.unlocked&&!l.isCellLocked(f);b.resizable=b.resizable&&l.isCellResizable(f);b.rotatable=b.rotatable&&l.isCellRotatable(f);b.movable=b.movable&&l.isCellMovable(f)&&!l.isTableRow(f)&&!l.isTableCell(f);b.swimlane=b.swimlane||l.isSwimlane(f);b.table=b.table||l.isTable(f);b.cell=b.cell||l.isTableCell(f);b.row=b.row||l.isTableRow(f);
b.vertices.push(f);var y=l.getCellGeometry(f);if(null!=y&&(0<y.width?null==b.width?b.width=y.width:b.width!=y.width&&(b.width=""):b.containsLabel=!0,0<y.height?null==b.height?b.height=y.height:b.height!=y.height&&(b.height=""):b.containsLabel=!0,!y.relative||null!=y.offset)){var q=y.relative?y.offset.x:y.x;y=y.relative?y.offset.y:y.y;null==b.x?b.x=q:b.x!=q&&(b.x="");null==b.y?b.y=y:b.y!=y&&(b.y="")}}else l.getModel().isEdge(f)&&(b.edges.push(f),b.connections=!0,b.resizable=!1,b.rotatable=!1,b.movable=
!1);q=l.view.getState(f);null!=q&&(b.html=b.html&&l.isHtmlLabel(f),b.autoSize=b.autoSize||l.isAutoSizeState(q),b.glass=b.glass&&l.isGlassState(q),b.rounded=b.rounded&&l.isRoundedState(q),b.lineJumps=b.lineJumps&&l.isLineJumpState(q),b.image=b.image||l.isImageState(q),b.shadow=b.shadow&&l.isShadowState(q),b.fill=b.fill&&l.isFillState(q),b.gradient=b.fill&&l.isGradientState(q),b.stroke=b.stroke&&l.isStrokeState(q),f=mxUtils.getValue(q.style,mxConstants.STYLE_SHAPE,null),b.containsImage=b.containsImage||
"image"==f,l.mergeStyle(q.style,b.style,u))};
EditorUi.prototype.installShapePicker=function(){var b=this.editor.graph,f=this;b.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(S,E){"mouseDown"==E.getProperty("eventName")&&f.hideShapePicker()}));var l=mxUtils.bind(this,function(){f.hideShapePicker(!0)});b.addListener("wheel",l);b.addListener(mxEvent.ESCAPE,l);b.view.addListener(mxEvent.SCALE,l);b.view.addListener(mxEvent.SCALE_AND_TRANSLATE,l);b.getSelectionModel().addListener(mxEvent.CHANGE,l);var u=b.popupMenuHandler.isMenuShowing;
b.popupMenuHandler.isMenuShowing=function(){return u.apply(this,arguments)||null!=f.shapePicker||null!=f.currentMenu};var y=b.dblClick;b.dblClick=function(S,E){if(this.isEnabled())if(null!=E||null==f.sidebar||mxEvent.isShiftDown(S)||b.isCellLocked(b.getDefaultParent()))y.apply(this,arguments);else{var Q=mxUtils.convertPoint(this.container,mxEvent.getClientX(S),mxEvent.getClientY(S));mxEvent.consume(S);window.setTimeout(mxUtils.bind(this,function(){f.showShapePicker(Q.x,Q.y)}),30)}};if(null!=this.hoverIcons){this.hoverIcons.addListener("reset",
l);var q=this.hoverIcons.drag;this.hoverIcons.drag=function(){f.hideShapePicker();q.apply(this,arguments)};var B=this.hoverIcons.execute;this.hoverIcons.execute=function(S,E,Q){var c=Q.getEvent();this.graph.isCloneEvent(c)||mxEvent.isShiftDown(c)?B.apply(this,arguments):this.graph.connectVertex(S.cell,E,this.graph.defaultEdgeLength,c,null,null,mxUtils.bind(this,function(g,m,n){var x=b.getCompositeParent(S.cell);g=b.getCellGeometry(x);for(Q.consume();null!=x&&b.model.isVertex(x)&&null!=g&&g.relative;)cell=
x,x=b.model.getParent(cell),g=b.getCellGeometry(x);window.setTimeout(mxUtils.bind(this,function(){f.showShapePicker(Q.getGraphX(),Q.getGraphY(),x,mxUtils.bind(this,function(F){n(F);null!=f.hoverIcons&&f.hoverIcons.update(b.view.getState(F))}),E)}),30)}),mxUtils.bind(this,function(g){this.graph.selectCellsForConnectVertex(g,c,this)}))};var H=null;this.hoverIcons.addListener("focus",mxUtils.bind(this,function(S,E){null!=H&&window.clearTimeout(H);H=window.setTimeout(mxUtils.bind(this,function(){var Q=
E.getProperty("arrow"),c=E.getProperty("direction"),g=E.getProperty("event");Q=Q.getBoundingClientRect();var m=mxUtils.getOffset(b.container),n=b.container.scrollLeft+Q.x-m.x;m=b.container.scrollTop+Q.y-m.y;var x=b.getCompositeParent(null!=this.hoverIcons.currentState?this.hoverIcons.currentState.cell:null),F=f.showShapePicker(n,m,x,mxUtils.bind(this,function(I){null!=I&&b.connectVertex(x,c,b.defaultEdgeLength,g,!0,!1,function(M,L,K){K(I);null!=f.hoverIcons&&f.hoverIcons.update(b.view.getState(I))},
function(M){b.selectCellsForConnectVertex(M)},g,this.hoverIcons)}),c,!0);null!=F&&(this.centerShapePicker(F,Q,n,m,c),mxUtils.setOpacity(F,30),mxEvent.addListener(F,"mouseenter",function(){mxUtils.setOpacity(F,100)}),mxEvent.addListener(F,"mouseleave",function(){f.hideShapePicker()}))}),Editor.shapePickerHoverDelay)}));this.hoverIcons.addListener("blur",mxUtils.bind(this,function(S,E){null!=H&&window.clearTimeout(H)}))}};
EditorUi.prototype.centerShapePicker=function(b,f,l,u,y){if(y==mxConstants.DIRECTION_EAST||y==mxConstants.DIRECTION_WEST)b.style.width="40px";var q=b.getBoundingClientRect();y==mxConstants.DIRECTION_NORTH?(l-=q.width/2-10,u-=q.height+6):y==mxConstants.DIRECTION_SOUTH?(l-=q.width/2-10,u+=f.height+6):y==mxConstants.DIRECTION_WEST?(l-=q.width+6,u-=q.height/2-10):y==mxConstants.DIRECTION_EAST&&(l+=f.width+6,u-=q.height/2-10);b.style.left=l+"px";b.style.top=u+"px"};
EditorUi.prototype.showShapePicker=function(b,f,l,u,y,q,B,H,S){var E=null;this.editor.graph.freehand.isDrawing()||(H=H||null==l,E=this.createShapePicker(b,f,l,u,y,mxUtils.bind(this,function(){this.hideShapePicker()}),this.getCellsForShapePicker(l,q,H),q,B,H,S),null!=E&&(null==this.hoverIcons||q||this.hoverIcons.reset(),b=this.editor.graph,b.popupMenuHandler.hideMenu(),b.tooltipHandler.hideTooltip(),this.hideCurrentMenu(),this.hideShapePicker(),this.shapePickerCallback=u,this.shapePicker=E));return E};
EditorUi.prototype.createShapePicker=function(b,f,l,u,y,q,B,H,S,E,Q){Q=null!=Q?Q:!0;var c=this.editor.graph,g=null;S=null!=S?S:function(x){x=x[0];var F=0,I=0,M=x.geometry;null!=M&&(c.model.isEdge(x)&&(x=M.getTerminalPoint(!1),M=new mxRectangle(0,0,x.x,x.y)),F=M.width/2,I=M.height/2);return new mxPoint(c.snap(Math.round(b/c.view.scale)-c.view.translate.x-F),c.snap(Math.round(f/c.view.scale)-c.view.translate.y-I))};if(null!=B&&0<B.length){var m=this;c=this.editor.graph;g=document.createElement("div");
y=c.view.getState(l);var n=null==l||null!=y&&c.isTransparentState(y)?null:c.copyStyle(l);g.className="geShapePicker";g.setAttribute("title",mxResources.get("sidebarTooltip"));g.style.left=Math.round(b)+"px";g.style.top=Math.round(f)+"px";mxClient.IS_POINTER&&(g.style.touchAction="none");H||mxUtils.setPrefixedStyle(g.style,"transform","translate(-22px,-22px)");c.container.appendChild(g);y=mxUtils.bind(this,function(x){var F=document.createElement("a");g.appendChild(F);null!=n&&"1"!=urlParams.sketch?
this.sidebar.graph.pasteStyle(n,[x]):this.sidebar.graph.pasteCellStyles([x],c.currentVertexStyle,c.currentEdgeStyle);var I=x.geometry;c.model.isEdge(x)&&(I=I.getTerminalPoint(!1),I=new mxRectangle(0,0,I.x,I.y));null!=I&&(I=this.sidebar.createVertexTemplateFromCells([x],I.width,I.height,"",!0,!1,null,!1,mxUtils.bind(this,function(M){if(!mxEvent.isAltDown(M)||1!=c.getSelectionCount()){if(!mxEvent.isShiftDown(M)||null==l&&c.isSelectionEmpty()){var L=c.cloneCell(x);if(null!=u)u(L);else{var K=S([L]);c.model.isEdge(L)?
L.geometry.translate(K.x,K.y):(L.geometry.x=K.x,L.geometry.y=K.y);c.model.beginUpdate();try{c.addCell(L),c.model.isVertex(L)&&c.isAutoSizeCell(L)&&c.updateCellSize(L)}finally{c.model.endUpdate()}c.setSelectionCell(L);c.scrollCellToVisible(L);Q&&c.startEditing(L);null!=m.hoverIcons&&m.hoverIcons.update(c.view.getState(L))}}else L=c.getEditableCells(null!=l?[l]:c.getSelectionCells()),c.updateShapes(x,L);null!=q&&q(M);mxEvent.consume(M)}}),25,25,null,null,l),I.style.display="flex",I.style.alignItems=
"center",I.style.justifyContent="center",F.appendChild(I))});for(E=0;E<(H?Math.min(B.length,4):B.length);E++)y(B[E]);B=g.offsetTop+g.clientHeight-(c.container.scrollTop+c.container.offsetHeight);0<B&&(g.style.top=Math.max(c.container.scrollTop+22,f-B)+"px");B=g.offsetLeft+g.clientWidth-(c.container.scrollLeft+c.container.offsetWidth);0<B&&(g.style.left=Math.max(c.container.scrollLeft+22,b-B)+"px")}return g};
EditorUi.prototype.getCellsForShapePicker=function(b,f,l){var u=this.editor.graph,y=mxUtils.bind(this,function(q,B,H,S){return u.createVertex(null,null,S||"",0,0,B||120,H||60,q,!1)});f=mxUtils.bind(this,function(q,B,H){q=new mxCell(H||"",new mxGeometry(0,0,u.defaultEdgeLength+20,0),q);q.geometry.setTerminalPoint(new mxPoint(0,0),!0);q.geometry.setTerminalPoint(new mxPoint(q.geometry.width,null!=B?B:0),!1);q.geometry.points=null!=B?[new mxPoint(q.geometry.width/2,B)]:[];q.geometry.relative=!0;q.edge=
!0;return q});if(null!=b)try{b=u.cloneCell(b),u.model.isVertex(b)&&null!=b.geometry&&(b.geometry.x=0,b.geometry.y=0)}catch(q){b=null}null==b&&(b=y(u.appendFontSize("text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;",u.vertexFontSize),40,20,"Text"),u.model.isVertex(b)&&u.isAutoSizeCell(b)&&Graph.createOffscreenGraph(u.getStylesheet()).updateCellSize(b));b=[b,y("whiteSpace=wrap;html=1;"),y("ellipse;whiteSpace=wrap;html=1;",80,80),y("rhombus;whiteSpace=wrap;html=1;",
80,80),y("rounded=1;whiteSpace=wrap;html=1;"),y("shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;"),y("shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,60),y("shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;",120,80),y("shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;",120,80),y("shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;"),y("triangle;whiteSpace=wrap;html=1;",
60,80),y("shape=document;whiteSpace=wrap;html=1;boundedLbl=1;",120,80),y("shape=tape;whiteSpace=wrap;html=1;",120,100),y("ellipse;shape=cloud;whiteSpace=wrap;html=1;",120,80),y("shape=singleArrow;whiteSpace=wrap;html=1;arrowWidth=0.4;arrowSize=0.4;",80,60),y("shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;rotatable=0;perimeter=centerPerimeter;snapToPoint=1;",20,20)];l&&(b=b.concat([f("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;"),f("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;startArrow=classic;endSize=8;startSize=8;"),
f("edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;"),f("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,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 f=this.editor.graph;if(9==b.which&&f.isEnabled()&&!mxEvent.isControlDown(b)){if(f.isEditing())if(mxEvent.isAltDown(b))f.stopEditing(!1);else try{var l=f.cellEditor.isContentEditing()&&f.cellEditor.isTextSelected();if(window.getSelection&&f.cellEditor.isContentEditing()&&!l&&!mxClient.IS_IE&&!mxClient.IS_IE11){var u=window.getSelection(),y=0<u.rangeCount?u.getRangeAt(0).commonAncestorContainer:null;l=null!=y&&("LI"==y.nodeName||null!=y.parentNode&&"LI"==
y.parentNode.nodeName)}l?document.execCommand(mxEvent.isShiftDown(b)?"outdent":"indent",!1,null):mxEvent.isShiftDown(b)?f.stopEditing(!1):f.cellEditor.insertTab(f.cellEditor.isContentEditing()?null:4)}catch(q){}else mxEvent.isAltDown(b)?f.selectParentCell():f.selectCell(!mxEvent.isShiftDown(b));mxEvent.consume(b)}};
EditorUi.prototype.onKeyPress=function(b){var f=this.editor.graph;!this.isImmediateEditingEvent(b)||f.isEditing()||f.isSelectionEmpty()||0===b.which||27===b.which||mxEvent.isAltDown(b)||mxEvent.isControlDown(b)||mxEvent.isMetaDown(b)||(f.escape(),f.startEditing(null,String.fromCharCode(b.which)))};EditorUi.prototype.isImmediateEditingEvent=function(b){return!0};
EditorUi.prototype.updateCssForMarker=function(b,f,l,u,y){l=this.getImageForMarker(u,y,l);b.innerHTML="";null==l?b.innerHTML=mxUtils.htmlEntities(mxResources.get("none")):(u=document.createElement("img"),u.setAttribute("src",l),"end"==f&&mxUtils.setPrefixedStyle(u.style,"transform","scaleX(-1)"),b.appendChild(u))};
EditorUi.prototype.getImageForMarker=function(b,f,l){return"flexArrow"==l?null!=b&&b!=mxConstants.NONE?Format.blockMarkerImage.src:null:b==mxConstants.ARROW_CLASSIC?"1"!=f?Format.classicMarkerImage.src:Format.classicFilledMarkerImage.src:b==mxConstants.ARROW_CLASSIC_THIN?"1"!=f?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"!=f?Format.blockMarkerImage.src:Format.blockFilledMarkerImage.src:b==mxConstants.ARROW_BLOCK_THIN?"1"!=f?Format.blockThinMarkerImage.src:Format.blockThinFilledMarkerImage.src:b==mxConstants.ARROW_OVAL?"1"!=f?Format.ovalMarkerImage.src:Format.ovalFilledMarkerImage.src:b==mxConstants.ARROW_DIAMOND?"1"!=f?Format.diamondMarkerImage.src:Format.diamondFilledMarkerImage.src:b==mxConstants.ARROW_DIAMOND_THIN?"1"!=f?Format.diamondThinMarkerImage.src:Format.diamondThinFilledMarkerImage.src:"doubleBlock"==
b?"1"!=f?Format.doubleBlockMarkerImage.src:Format.doubleBlockFilledMarkerImage.src:"box"==b?Format.boxMarkerImage.src:"halfCircle"==b?Format.halfCircleMarkerImage.src:"openAsync"==b?Format.openAsyncFilledMarkerImage.src:"async"==b?"1"!=f?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.createMenus=function(){return null};
EditorUi.prototype.updatePasteActionStates=function(){var b=this.editor.graph,f=this.actions.get("paste"),l=this.actions.get("pasteHere");f.setEnabled(this.editor.graph.cellEditor.isContentEditing()||(null!=navigator.clipboard||!mxClipboard.isEmpty())&&b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()));l.setEnabled(f.isEnabled())};
EditorUi.prototype.initClipboard=function(){var b=this,f=mxClipboard.cut;mxClipboard.cut=function(q){q.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):f.apply(this,arguments);b.updatePasteActionStates()};mxClipboard.copy=function(q){var B=null;if(q.cellEditor.isContentEditing())document.execCommand("copy",!1,null);else{B=B||q.getSelectionCells();B=q.getExportableCells(q.model.getTopmostCells(B));for(var H={},S=q.createCellLookup(B),E=q.cloneCells(B,null,H),Q=new mxGraphModel,c=Q.getChildAt(Q.getRoot(),
0),g=0;g<E.length;g++){Q.add(c,E[g]);var m=q.view.getState(B[g]);if(null!=m){var n=q.getCellGeometry(E[g]);null!=n&&n.relative&&!Q.isEdge(B[g])&&null==S[mxObjectIdentity.get(Q.getParent(B[g]))]&&(n.offset=null,n.relative=!1,n.x=m.x/m.view.scale-m.view.translate.x,n.y=m.y/m.view.scale-m.view.translate.y)}}q.updateCustomLinks(q.createCellMapping(H,S),E);mxClipboard.insertCount=1;mxClipboard.setCells(E)}b.updatePasteActionStates();return B};var l=mxClipboard.paste;mxClipboard.paste=function(q){var B=
null;q.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):B=l.apply(this,arguments);b.updatePasteActionStates();return B};var u=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){u.apply(this,arguments);b.updatePasteActionStates()};var y=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(q,B){y.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 U=this.graph.getPageLayout(),X=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+U.x*X.width),this.scale*(this.translate.y+U.y*X.height),this.scale*U.width*X.width,
this.scale*U.height*X.height)};b.getPreferredPageSize=function(U,X,fa){U=this.getPageLayout();X=this.getPageSize();return new mxRectangle(0,0,U.width*X.width,U.height*X.height)};var f=null,l=this;if(this.editor.isChromelessView()){this.chromelessResize=f=mxUtils.bind(this,function(U,X,fa,na){if(null!=b.container&&!b.isViewer()){fa=null!=fa?fa:0;na=null!=na?na:0;var la=b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds(),qa=mxUtils.hasScrollbars(b.container),ya=b.view.translate,wa=b.view.scale,
Ja=mxRectangle.fromRectangle(la);Ja.x=Ja.x/wa-ya.x;Ja.y=Ja.y/wa-ya.y;Ja.width/=wa;Ja.height/=wa;ya=b.container.scrollTop;var Aa=b.container.scrollLeft,Ba=8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)Ba+=3;var Ga=b.container.offsetWidth-Ba;Ba=b.container.offsetHeight-Ba;U=U?Math.max(.3,Math.min(X||1,Ga/Ja.width)):wa;X=(Ga-U*Ja.width)/2/U;var Ma=0==this.lightboxVerticalDivider?0:(Ba-U*Ja.height)/this.lightboxVerticalDivider/U;qa&&(X=Math.max(X,0),Ma=Math.max(Ma,
0));if(qa||la.width<Ga||la.height<Ba)b.view.scaleAndTranslate(U,Math.floor(X-Ja.x),Math.floor(Ma-Ja.y)),b.container.scrollTop=ya*U/wa,b.container.scrollLeft=Aa*U/wa;else if(0!=fa||0!=na)la=b.view.translate,b.view.setTranslate(Math.floor(la.x+fa/wa),Math.floor(la.y+na/wa))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var u=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",u);this.destroyFunctions.push(function(){mxEvent.removeListener(window,
"resize",u)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(U){b.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(U){b.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){var y=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position=
"fixed";this.chromelessToolbar.style.overflow="hidden";this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace="nowrap";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left=b.isViewer()?"0":"50%";mxClient.IS_IE||mxClient.IS_IE11?(this.chromelessToolbar.style.backgroundColor="#ffffff",this.chromelessToolbar.style.border="3px solid black"):this.chromelessToolbar.style.backgroundColor="#000000";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,
"borderRadius","16px");mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out");var q=mxUtils.bind(this,function(){var U=mxUtils.getCurrentStyle(b.container);b.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=U?parseInt(U["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",q);q();var B=0;q=mxUtils.bind(this,function(U,X,fa){B++;
var na=document.createElement("span");na.style.paddingLeft="8px";na.style.paddingRight="8px";na.style.cursor="pointer";mxEvent.addListener(na,"click",U);null!=fa&&na.setAttribute("title",fa);U=document.createElement("img");U.setAttribute("border","0");U.setAttribute("src",X);U.style.width="36px";U.style.filter="invert(100%)";na.appendChild(U);this.chromelessToolbar.appendChild(na);return na});if(null!=y.backBtn){var H=Graph.sanitizeLink(y.backBtn.url);null!=H&&q(mxUtils.bind(this,function(U){window.location.href=
H;mxEvent.consume(U)}),Editor.backImage,mxResources.get("back",null,"Back"))}if(this.isPagesEnabled()){var S=q(mxUtils.bind(this,function(U){this.actions.get("previousPage").funct();mxEvent.consume(U)}),Editor.chevronLeftImage,mxResources.get("previousPage")),E=document.createElement("div");E.style.fontFamily=Editor.defaultHtmlFont;E.style.display="inline-block";E.style.verticalAlign="top";E.style.fontWeight="bold";E.style.marginTop="8px";E.style.fontSize="14px";E.style.cursor="default";E.style.color=
mxClient.IS_IE||mxClient.IS_IE11?"#000000":"#ffffff";this.chromelessToolbar.appendChild(E);var Q=q(mxUtils.bind(this,function(U){this.actions.get("nextPage").funct();mxEvent.consume(U)}),Editor.chevronRightImage,mxResources.get("nextPage")),c=mxUtils.bind(this,function(){if(null!=this.pages&&1<this.pages.length&&null!=this.currentPage){E.innerText="";var U=mxUtils.indexOf(this.pages,this.currentPage);mxUtils.write(E,U+1+" / "+this.pages.length);E.setAttribute("title",mxResources.get("currentPage")+
": "+this.currentPage.getName());S.setAttribute("title",mxResources.get("previousPage")+": "+this.pages[mxUtils.mod(U-1,this.pages.length)].getName());Q.setAttribute("title",mxResources.get("nextPage")+": "+this.pages[mxUtils.mod(U+1,this.pages.length)].getName())}});S.style.paddingLeft="0px";S.style.paddingRight="4px";Q.style.paddingLeft="4px";Q.style.paddingRight="0px";var g=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(Q.style.display="",S.style.display=
"",E.style.display="inline-block"):(Q.style.display="none",S.style.display="none",E.style.display="none");c()});if(null!=this.menus){var m=this.menus.get("pages");null!=m&&mxEvent.addListener(E,"click",mxUtils.bind(this,function(U){var X=new mxPopupMenu(m.funct);X.smartSeparators=!0;X.showDisabled=!0;X.autoExpand=!0;X.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(X,arguments);X.destroy()});var fa=mxUtils.getOffset(E);X.popup(fa.x,fa.y+E.offsetHeight,null,U);mxEvent.addListener(X.div,
"mouseleave",mxUtils.bind(this,function(){X.hideMenu()}))}))}this.editor.addListener("resetGraphView",g);this.editor.addListener("pageSelected",c)}q(mxUtils.bind(this,function(U){this.actions.get("zoomOut").funct();mxEvent.consume(U)}),Editor.zoomOutImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");q(mxUtils.bind(this,function(U){this.actions.get("zoomIn").funct();mxEvent.consume(U)}),Editor.zoomInImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");q(mxUtils.bind(this,function(U){b.isLightboxView()?
(1==b.view.scale?this.lightboxFit():b.zoomTo(1),this.chromelessResize(!1)):this.chromelessResize(!0);mxEvent.consume(U)}),Editor.zoomFitImage,mxResources.get("fit"));var n=null,x=null,F=mxUtils.bind(this,function(U){null!=n&&(window.clearTimeout(n),n=null);null!=x&&(window.clearTimeout(x),x=null);n=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);n=null;x=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";x=null}),
600)}),U||200)}),I=mxUtils.bind(this,function(U){null!=n&&(window.clearTimeout(n),n=null);null!=x&&(window.clearTimeout(x),x=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,U||30)});if("1"==urlParams.layers){this.layersDialog=null;var M=q(mxUtils.bind(this,function(U){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 X=M.getBoundingClientRect();mxUtils.setPrefixedStyle(this.layersDialog.style,"borderRadius","5px");this.layersDialog.style.position="fixed";this.layersDialog.style.fontFamily=Editor.defaultHtmlFont;this.layersDialog.style.width="160px";this.layersDialog.style.padding="4px 2px 4px 2px";this.layersDialog.style.left=
X.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";mxClient.IS_IE||mxClient.IS_IE11?(this.layersDialog.style.backgroundColor="#ffffff",this.layersDialog.style.border="2px solid black",this.layersDialog.style.color="#000000"):(this.layersDialog.style.backgroundColor="#000000",this.layersDialog.style.color="#ffffff",mxUtils.setOpacity(this.layersDialog,80));X=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=
X.zIndex;document.body.appendChild(this.layersDialog);this.editor.fireEvent(new mxEventObject("layersDialogShown"))}mxEvent.consume(U)}),Editor.layersImage,mxResources.get("layers")),L=b.getModel();L.addListener(mxEvent.CHANGE,function(){M.style.display=1<L.getChildCount(L.root)?"":"none"})}("1"!=urlParams.openInSameWin||navigator.standalone)&&this.addChromelessToolbarItems(q);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||q(mxUtils.bind(this,function(U){if(null!=this.editor.editButtonFunc)this.editor.editButtonFunc();
else if("_blank"==this.editor.editButtonLink){var X=null!=this.currentPage?this.currentPage.getId():null;this.editor.editAsNew(this.getEditBlankXml(),null,null,X)}else b.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(U)}),Editor.editImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(g=0;g<this.lightboxToolbarActions.length;g++){var K=this.lightboxToolbarActions[g];K.elem=q(K.fn,K.icon,K.tooltip)}if(null!=y.refreshBtn){var aa=null==y.refreshBtn.url?null:Graph.sanitizeLink(y.refreshBtn.url);
q(mxUtils.bind(this,function(U){null!=aa?window.location.href=aa:window.location.reload();mxEvent.consume(U)}),Editor.refreshImage,mxResources.get("refresh",null,"Refresh"))}null!=y.fullscreenBtn&&window.self!==window.top&&q(mxUtils.bind(this,function(U){y.fullscreenBtn.url?b.openLink(y.fullscreenBtn.url):b.openLink(window.location.href);mxEvent.consume(U)}),Editor.fullscreenImage,mxResources.get("openInNewWindow",null,"Open in New Window"));!y.noCloseBtn&&(y.closeBtn&&window.self===window.top||b.lightbox&&
("1"==urlParams.close||this.container!=document.body))&&q(mxUtils.bind(this,function(U){"1"==urlParams.close||y.closeBtn?window.close():(this.destroy(),mxEvent.consume(U))}),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(U){mxEvent.isTouchEvent(U)||(mxEvent.isShiftDown(U)||I(30),F())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(U){mxEvent.consume(U)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(U){b.tooltipHandler.resetTimer();b.tooltipHandler.hideTooltip();mxEvent.isShiftDown(U)?F():I(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(U){mxEvent.isShiftDown(U)?
F():I(100);mxEvent.consume(U)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(U){mxEvent.isTouchEvent(U)||I(30)}));var ja=b.getTolerance();b.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(U,X){this.startX=X.getGraphX();this.startY=X.getGraphY();this.scrollLeft=b.container.scrollLeft;this.scrollTop=b.container.scrollTop},mouseMove:function(U,X){},mouseUp:function(U,X){mxEvent.isTouchEvent(X.getEvent())&&Math.abs(this.scrollLeft-
b.container.scrollLeft)<ja&&Math.abs(this.scrollTop-b.container.scrollTop)<ja&&Math.abs(this.startX-X.getGraphX())<ja&&Math.abs(this.startY-X.getGraphY())<ja&&(0<parseFloat(l.chromelessToolbar.style.opacity||0)?F():I(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var ca=b.view.validate,ba=new mxPoint,oa=!1,Y=null;b.view.validate=function(){if(null!=b.container&&mxUtils.hasScrollbars(b.container)){if(null!=l.currentPage&&Y!=l.currentPage){Y=l.currentPage;
oa=!0;var U=b.getBoundingBoxFromGeometry(b.model.getCells(),!0,null,!0);null==U&&(U=new mxRectangle(b.view.translate.x*b.view.scale,b.view.translate.y*b.view.scale));U=b.getPageLayout(U,ba,1);var X=b.getDefaultTranslate(U);this.x0=U.x;this.y0=U.y;if(X.x!=this.translate.x||X.y!=this.translate.y)this.invalidate(),this.translate.x=X.x,this.translate.y=X.y}X=b.getPagePadding();var fa=b.getPageSize();U=X.x-(this.x0||0)*fa.width;X=X.y-(this.y0||0)*fa.height;if(this.translate.x!=U||this.translate.y!=X)this.invalidate(),
this.translate.x=U,this.translate.y=X}ca.apply(this,arguments)};if(!b.isViewer()){var da=b.sizeDidChange;b.sizeDidChange=function(){var U=oa;oa=!1;if(null!=this.container&&mxUtils.hasScrollbars(this.container)){this.updateMinimumSize();if(!this.autoTranslate){var X=this.getPageLayout(),fa=this.getDefaultTranslate(X),na=this.view.translate.x,la=this.view.translate.y;if(fa.x!=na||fa.y!=la){this.view.x0=X.x;this.view.y0=X.y;this.autoTranslate=!0;this.view.setTranslate(fa.x,fa.y);this.autoTranslate=!1;
U||(this.container.scrollLeft+=Math.round((fa.x-na)*this.view.scale),this.container.scrollTop+=Math.round((fa.y-la)*this.view.scale));return}}da.apply(this,arguments)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}var ha=b.view.getBackgroundPane(),Z=b.view.getDrawPane();b.cumulativeZoomFactor=1;var k=null,v=null,J=null,N=null,T=null,V=function(U){null!=k&&window.clearTimeout(k);0<=U&&window.setTimeout(function(){if(!b.isMouseDown||N)k=window.setTimeout(mxUtils.bind(this,
function(){b.isFastZoomEnabled()&&(null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node&&(mxUtils.setPrefixedStyle(b.view.backgroundPageShape.node.style,"transform-origin",null),mxUtils.setPrefixedStyle(b.view.backgroundPageShape.node.style,"transform",null)),Z.style.transformOrigin="",ha.style.transformOrigin="",mxClient.IS_SF?(Z.style.transform="scale(1)",ha.style.transform="scale(1)",window.setTimeout(function(){Z.style.transform="";ha.style.transform=""},0)):(Z.style.transform=
"",ha.style.transform=""),b.view.getDecoratorPane().style.opacity="",b.view.getOverlayPane().style.opacity="");var X=new mxPoint(b.container.scrollLeft,b.container.scrollTop),fa=mxUtils.getOffset(b.container),na=b.view.scale,la=0,qa=0;null!=v&&(la=b.container.offsetWidth/2-v.x+fa.x,qa=b.container.offsetHeight/2-v.y+fa.y);b.zoom(b.cumulativeZoomFactor,null,b.isFastZoomEnabled()?20:null);b.view.scale!=na&&(null!=J&&(la+=X.x-J.x,qa+=X.y-J.y),null!=f&&l.chromelessResize(!1,null,la*(b.cumulativeZoomFactor-
1),qa*(b.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(b.container)||0==la&&0==qa||(b.container.scrollLeft-=la*(b.cumulativeZoomFactor-1),b.container.scrollTop-=qa*(b.cumulativeZoomFactor-1)));null!=T&&Z.setAttribute("filter",T);b.cumulativeZoomFactor=1;T=N=v=J=k=null}),null!=U?U:b.isFastZoomEnabled()?l.wheelZoomDelay:l.lazyZoomDelay)},0)};b.lazyZoom=function(U,X,fa,na){na=null!=na?na:this.zoomFactor;(X=X||!b.scrollbars)&&(v=new mxPoint(b.container.offsetLeft+b.container.clientWidth/2,b.container.offsetTop+
b.container.clientHeight/2));U?.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=na,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/=na,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*
100)/100/this.view.scale);this.cumulativeZoomFactor=Math.max(.05,Math.min(this.view.scale*this.cumulativeZoomFactor,160))/this.view.scale;if(b.isFastZoomEnabled()){null==T&&""!=Z.getAttribute("filter")&&(T=Z.getAttribute("filter"),Z.removeAttribute("filter"));J=new mxPoint(b.container.scrollLeft,b.container.scrollTop);U=Math.round(Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100*20)/(20*this.view.scale);na=X||null==v?b.container.scrollLeft+b.container.clientWidth/2:v.x+b.container.scrollLeft-
b.container.offsetLeft;var la=X||null==v?b.container.scrollTop+b.container.clientHeight/2:v.y+b.container.scrollTop-b.container.offsetTop;Z.style.transformOrigin=na+"px "+la+"px";Z.style.transform="scale("+U+")";ha.style.transformOrigin=na+"px "+la+"px";ha.style.transform="scale("+U+")";null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(na=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(na.style,"transform-origin",(X||null==v?b.container.clientWidth/2+b.container.scrollLeft-
na.offsetLeft+"px":v.x+b.container.scrollLeft-na.offsetLeft-b.container.offsetLeft+"px")+" "+(X||null==v?b.container.clientHeight/2+b.container.scrollTop-na.offsetTop+"px":v.y+b.container.scrollTop-na.offsetTop-b.container.offsetTop+"px")),mxUtils.setPrefixedStyle(na.style,"transform","scale("+U+")")):b.view.validateBackgroundStyles(U,na,la);b.view.getDecoratorPane().style.opacity="0";b.view.getOverlayPane().style.opacity="0";null!=l.hoverIcons&&l.hoverIcons.reset();b.fireEvent(new mxEventObject("zoomPreview",
"factor",U))}V(b.isFastZoomEnabled()?fa:0)};mxEvent.addGestureListeners(b.container,function(U){null!=k&&window.clearTimeout(k)},null,function(U){1!=b.cumulativeZoomFactor&&V(0)});mxEvent.addListener(b.container,"scroll",function(U){null==k||b.isMouseDown||1==b.cumulativeZoomFactor||V(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,function(U,X,fa,na,la){b.fireEvent(new mxEventObject("wheel"));if(null==this.dialogs||0==this.dialogs.length)if(!b.scrollbars&&!fa&&b.isScrollWheelEvent(U))fa=b.view.getTranslate(),
na=40/b.view.scale,mxEvent.isShiftDown(U)?b.view.setTranslate(fa.x+(X?-na:na),fa.y):b.view.setTranslate(fa.x,fa.y+(X?na:-na));else if(fa||b.isZoomWheelEvent(U))for(var qa=mxEvent.getSource(U);null!=qa;){if(qa==b.container)return b.tooltipHandler.hideTooltip(),v=null!=na&&null!=la?new mxPoint(na,la):new mxPoint(mxEvent.getClientX(U),mxEvent.getClientY(U)),N=fa,fa=b.zoomFactor,na=null,U.ctrlKey&&null!=U.deltaY&&40>Math.abs(U.deltaY)&&Math.round(U.deltaY)!=U.deltaY?fa=1+Math.abs(U.deltaY)/20*(fa-1):
null!=U.movementY&&"pointermove"==U.type&&(fa=1+Math.max(1,Math.abs(U.movementY))/20*(fa-1),na=-1),b.lazyZoom(X,null,na,fa),mxEvent.consume(U),!1;qa=qa.parentNode}}),b.container);b.panningHandler.zoomGraph=function(U){b.cumulativeZoomFactor=U.scale;b.lazyZoom(0<U.scale,!0);mxEvent.consume(U)}};EditorUi.prototype.addChromelessToolbarItems=function(b){b(mxUtils.bind(this,function(f){this.actions.get("print").funct();mxEvent.consume(f)}),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 f=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.formatContainer.style,"transition","width "+f+"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*f)},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 f=urlParams.border,l=60;null!=f&&(l=parseInt(f));this.editor.graph.maxFitScale=this.lightboxMaxFitScale;this.editor.graph.fit(l,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,f){try{var l=mxUtils.parseXml(b);this.editor.setGraphXml(l.documentElement);this.editor.setModified(!1);this.editor.undoManager.clear();null!=f&&(this.editor.setFilename(f),this.updateDocumentTitle())}catch(u){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+u.message)}}))}catch(b){}this.editor.graph.view.validate();this.editor.graph.sizeDidChange();
this.editor.fireEvent(new mxEventObject("resetGraphView"))};EditorUi.prototype.showPrintDialog=function(b,f){this.showDialog((new PrintDialog(this,b,f)).container,300,180,!0,!0)};EditorUi.prototype.showPopupMenu=function(b,f,l,u){this.editor.graph.popupMenuHandler.hideMenu();var y=new mxPopupMenu(b);y.smartSeparators=!0;y.showDisabled=!0;y.autoExpand=!0;y.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(y,arguments);y.destroy()});y.popup(f,l,null,u);this.setCurrentMenu(y)};
EditorUi.prototype.setCurrentMenu=function(b,f){this.currentMenuElt=f;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.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 f=b.cellEditor.textarea.innerHTML;document.execCommand("undo",!1,null);f==b.cellEditor.textarea.innerHTML&&(b.stopEditing(!0),this.editor.undoManager.undo())}else this.editor.undoManager.undo()}catch(l){}};
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,f){this.replaceDiagramData(xUtils.getXml(f))};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 f=0<b.indexOf("?")?1:0,l;for(l in urlParams)b=0==f?b+"?":b+"&",b+=l+"="+urlParams[l],f++;return b};
EditorUi.prototype.setScrollbars=function(b){var f=this.editor.graph,l=f.container.style.overflow;f.scrollbars=b;this.editor.updateGraphComponents();l!=f.container.style.overflow&&(f.container.scrollTop=0,f.container.scrollLeft=0,f.view.scaleAndTranslate(1,0,0),this.resetScrollbars());this.fireEvent(new mxEventObject("scrollbarsChanged"))};
EditorUi.prototype.fitDiagramToWindow=function(){var b=this.editor.graph,f=b.isSelectionEmpty()?mxRectangle.fromRectangle(b.getGraphBounds()):b.getBoundingBox(b.getSelectionCells()),l=b.view.translate,u=b.view.scale;f.x=f.x/u-l.x;f.y=f.y/u-l.y;f.width/=u;f.height/=u;null!=b.backgroundImage&&f.add(new mxRectangle(0,0,b.backgroundImage.width,b.backgroundImage.height));0==f.width||0==f.height?(b.zoomTo(1),this.resetScrollbars()):(l=Editor.fitWindowBorders,null!=l&&(f.x-=l.x,f.y-=l.y,f.width+=l.width+
l.x,f.height+=l.height+l.y),b.fitWindow(f))};EditorUi.prototype.hasScrollbars=function(){return this.editor.graph.scrollbars};
EditorUi.prototype.resetScrollbars=function(){var b=this.editor.graph,f=b.container;if(!this.editor.extendCanvas)f.scrollTop=0,f.scrollLeft=0,mxUtils.hasScrollbars(f)||b.view.setTranslate(0,0);else if(!this.editor.isChromelessView())if(mxUtils.hasScrollbars(f))if(b.pageVisible){var l=b.getPagePadding();f.scrollTop=Math.floor(l.y);f.scrollLeft=Math.floor(Math.min(l.x,(f.scrollWidth-f.clientWidth)/2));l=b.getGraphBounds();0<l.width&&0<l.height&&(l.x>f.scrollLeft+.9*f.clientWidth&&(f.scrollLeft=Math.min(l.x+
l.width-f.clientWidth,l.x-10)),l.y>f.scrollTop+.9*f.clientHeight&&(f.scrollTop=Math.min(l.y+l.height-f.clientHeight,l.y-10)))}else if(l=b.getGraphBounds(),0==l.width&&0==l.height)f.scrollLeft=(f.scrollWidth-f.clientWidth)/2,f.scrollTop=(f.scrollHeight-f.clientHeight)/2;else{var u=Math.max(l.height,b.scrollTileSize.height*b.view.scale);f.scrollLeft=Math.floor(Math.max(0,l.x-Math.max(0,(f.clientWidth-Math.max(l.width,b.scrollTileSize.width*b.view.scale))/2)));f.scrollTop=Math.floor(Math.max(0,l.y-Math.max(20,
(f.clientHeight-u)/4)))}else{l=mxRectangle.fromRectangle(b.pageVisible?b.view.getBackgroundPageBounds():b.getGraphBounds());u=b.view.translate;var y=b.view.scale;l.x=l.x/y-u.x;l.y=l.y/y-u.y;l.width/=y;l.height/=y;b.view.setTranslate(Math.floor(Math.max(0,(f.clientWidth-l.width)/2)-l.x+2),Math.floor((b.pageVisible?0:Math.max(0,(f.clientHeight-l.height)/4))-l.y+1))}};
EditorUi.prototype.setPageVisible=function(b){var f=this.editor.graph,l=mxUtils.hasScrollbars(f.container),u=0,y=0;l&&(u=f.view.translate.x*f.view.scale-f.container.scrollLeft,y=f.view.translate.y*f.view.scale-f.container.scrollTop);f.pageVisible=b;f.pageBreaksVisible=b;f.preferPageSize=b;f.view.validateBackground();if(l){var q=f.getSelectionCells();f.clearSelection();f.setSelectionCells(q)}f.sizeDidChange();l&&(f.container.scrollLeft=f.view.translate.x*f.view.scale-u,f.container.scrollTop=f.view.translate.y*
f.view.scale-y);f.defaultPageVisible=b;this.fireEvent(new mxEventObject("pageViewChanged"))};
EditorUi.prototype.installResizeHandler=function(b,f,l){f&&(b.window.setSize=function(y,q){if(!this.minimized){var B=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;y=Math.min(y,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.getX());q=Math.min(q,B-this.getY())}mxWindow.prototype.setSize.apply(this,arguments)});b.window.setLocation=function(y,q){var B=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth,
H=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,S=parseInt(this.div.style.width),E=parseInt(this.div.style.height);y=Math.max(0,Math.min(y,B-S));q=Math.max(0,Math.min(q,H-E));this.getX()==y&&this.getY()==q||mxWindow.prototype.setLocation.apply(this,arguments);f&&!this.minimized&&this.setSize(S,E)};var u=mxUtils.bind(this,function(){var y=b.window.getX(),q=b.window.getY();b.window.setLocation(y,q)});mxEvent.addListener(window,"resize",u);b.destroy=function(){mxEvent.removeListener(window,
"resize",u);b.window.destroy();null!=l&&l()}};function ChangeGridColor(b,f){this.ui=b;this.color=f}ChangeGridColor.prototype.execute=function(){var b=this.ui.editor.graph.view.gridColor;this.ui.setGridColor(this.color);this.color=b};function ChangePageSetup(b,f,l,u,y){this.ui=b;this.previousColor=this.color=f;this.previousImage=this.image=l;this.previousFormat=this.format=u;this.previousPageScale=this.pageScale=y;this.ignoreImage=this.ignoreColor=!1}
ChangePageSetup.prototype.execute=function(){var b=this.ui.editor.graph;if(!this.ignoreColor){this.color=this.previousColor;var f=b.background;this.ui.setBackgroundColor(this.previousColor);this.previousColor=f}if(!this.ignoreImage){this.image=this.previousImage;f=b.backgroundImage;var l=this.previousImage;null!=l&&Graph.isPageLink(l.src)&&(l=this.ui.createImageForPageLink(l.src,this.ui.currentPage));this.ui.setBackgroundImage(l);this.previousImage=f}null!=this.previousFormat&&(this.format=this.previousFormat,
f=b.pageFormat,this.previousFormat.width!=f.width||this.previousFormat.height!=f.height)&&(this.ui.setPageFormat(this.previousFormat),this.previousFormat=f);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,f){f=null!=f?f:"1"==urlParams.sketch;this.editor.graph.pageFormat=b;f||(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,f){f=null!=f?f:Editor.isDarkMode();var l=this.editor.graph;f?l.view.defaultDarkGridColor=b:l.view.defaultGridColor=b;l.view.gridColor="light-dark("+l.view.defaultGridColor+", "+l.view.defaultDarkGridColor+")";l.view.validateBackground();this.fireEvent(new mxEventObject("gridColorChanged"))};
EditorUi.prototype.addUndoListener=function(){var b=this.editor.undoManager,f=mxUtils.bind(this,function(){this.updateActionStates()});b.addListener(mxEvent.ADD,f);b.addListener(mxEvent.UNDO,f);b.addListener(mxEvent.REDO,f);b.addListener(mxEvent.CLEAR,f);var l=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){l.apply(this,arguments);f()};var u=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(y,q){u.apply(this,arguments);
f()};f()};
EditorUi.prototype.updateActionStates=function(){for(var b=this.editor.graph,f=this.getSelectionState(),l=b.isEnabled()&&!b.isCellLocked(b.getDefaultParent()),u=!this.editor.chromeless||this.editor.editable,y="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(" "),q=0;q<y.length;q++)this.actions.get(y[q]).setEnabled(0<
f.cells.length);this.actions.get("grid").setEnabled(u);this.actions.get("undo").setEnabled(this.canUndo()&&u);this.actions.get("redo").setEnabled(this.canRedo()&&u);this.actions.get("swap").setEnabled(2==f.cells.length&&2==f.vertices.length);this.actions.get("pasteSize").setEnabled(null!=this.copiedSize&&0<f.vertices.length);this.actions.get("pasteData").setEnabled(null!=this.copiedValue&&0<f.cells.length);this.actions.get("setAsDefaultStyle").setEnabled(1==b.getSelectionCount());this.actions.get("lockUnlock").setEnabled(!b.isSelectionEmpty());
this.actions.get("bringForward").setEnabled(1==f.cells.length);this.actions.get("sendBackward").setEnabled(1==f.cells.length);this.actions.get("rotation").setEnabled(1==f.vertices.length);this.actions.get("wordWrap").setEnabled(1==f.vertices.length);this.actions.get("autosize").setEnabled(0<f.vertices.length);this.actions.get("copySize").setEnabled(1==f.vertices.length);this.actions.get("clearWaypoints").setEnabled(f.connections);this.actions.get("clearAnchors").setEnabled(f.connections);this.actions.get("curved").setEnabled(0<
f.edges.length);this.actions.get("turn").setEnabled(0<f.cells.length);this.actions.get("group").setEnabled(1<f.cells.length||1==f.vertices.length&&0==b.model.getChildCount(f.cells[0])&&!b.isContainer(f.vertices[0]));this.actions.get("ungroup").setEnabled(!f.row&&!f.cell&&!f.table&&0<f.vertices.length&&(b.isContainer(f.vertices[0])||0<b.getModel().getChildCount(f.vertices[0])));this.actions.get("removeFromGroup").setEnabled(1==f.cells.length&&b.getModel().isVertex(b.getModel().getParent(f.cells[0])));
this.actions.get("collapsible").setEnabled(1==f.vertices.length&&(0<b.model.getChildCount(f.vertices[0])||b.isContainer(f.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==f.cells.length&&b.isValidRoot(f.cells[0]));this.actions.get("copyData").setEnabled(1==f.cells.length);this.actions.get("copyAsText").setEnabled(1==f.cells.length);this.actions.get("editLink").setEnabled(1==
f.cells.length);this.actions.get("editStyle").setEnabled(0<f.cells.length);this.actions.get("editTooltip").setEnabled(1==f.cells.length);this.actions.get("openLink").setEnabled(1==f.cells.length&&null!=b.getLinkForCell(f.cells[0]));this.actions.get("guides").setEnabled(b.isEnabled());this.actions.get("selectVertices").setEnabled(l);this.actions.get("selectEdges").setEnabled(l);this.actions.get("selectAll").setEnabled(l);this.actions.get("selectNone").setEnabled(l);u=1==f.vertices.length&&b.isCellFoldable(f.vertices[0]);
this.actions.get("expand").setEnabled(u);this.actions.get("collapse").setEnabled(u);this.menus.get("navigation").setEnabled(0<f.cells.length||null!=b.view.currentRoot);this.menus.get("layout").setEnabled(l);this.menus.get("insert").setEnabled(l);this.menus.get("direction").setEnabled(f.unlocked&&1==f.vertices.length);this.menus.get("distribute").setEnabled(f.unlocked&&1<f.vertices.length);this.menus.get("align").setEnabled(f.unlocked&&0<f.cells.length);this.updatePasteActionStates()};
EditorUi.prototype.zeroOffset=new mxPoint(0,0);EditorUi.prototype.getDiagramContainerOffset=function(){return this.zeroOffset};EditorUi.prototype.refresh=function(b){var f=this.sidebarContainer.style.width,l=this.formatContainer.style.width;this.sidebarContainer.style.width=this.hsplitPosition+"px";this.formatContainer.style.width=null!=this.format&&0<this.formatWidth?"":"0";(b||f!=this.sidebarContainer.style.width||l!=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||!this.formatEnabled?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()})))};
EditorUi.prototype.createStatusContainer=function(){var b=document.createElement("a");b.className="geStatus";mxEvent.addListener(b,"click",mxUtils.bind(this,function(f){var l=mxEvent.getSource(f);if(l!=b)for(;l.parentNode!=b;)l=l.parentNode;if("A"!=l.nodeName){var u=l.getAttribute("data-action");if("statusFunction"==u&&null!=this.editor.statusFunction)this.editor.statusFunction();else if(null!=u)l=this.actions.get(u),null!=l&&l.funct();else{u=l.getAttribute("data-title");var y=l.getAttribute("data-message");
null!=u&&null!=y?this.showError(u,y):(l=l.getAttribute("data-link"),null!=l&&this.editor.graph.openLink(l))}mxEvent.consume(f)}}));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 f=0;f<b.length;f++)(function(l){mxUtils.setOpacity(l,0);mxUtils.setPrefixedStyle(l.style,"transform","scaleX(0)");mxUtils.setPrefixedStyle(l.style,
"transition","all 0.2s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(l,100);mxUtils.setPrefixedStyle(l.style,"transform","scaleX(1)");mxUtils.setPrefixedStyle(l.style,"transition","all 1s ease");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(l.style,"transform","scaleX(0)");mxUtils.setOpacity(l,0);window.setTimeout(mxUtils.bind(this,function(){null!=l.parentNode&&l.parentNode.removeChild(l)}),1E3)}),Editor.updateStatusInterval/2)}),0)})(b[f])};
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 f=document.createElement("div");f.className="geStatusDiv";f.setAttribute("title",b);f.innerText=b;return f};
EditorUi.prototype.createToolbar=function(b){return new Toolbar(this,b)};EditorUi.prototype.createSidebar=function(b){return new Sidebar(this,b)};EditorUi.prototype.createFormat=function(b){return new Format(this,b)};EditorUi.prototype.createDiv=function(b){var f=document.createElement("div");f.className=b;return f};
EditorUi.prototype.addSplitHandler=function(b,f,l,u){function y(c){if(null!=B){var g=new mxPoint(mxEvent.getClientX(c),mxEvent.getClientY(c));u(Math.max(0,H+(f?g.x-B.x:B.y-g.y)-l));mxEvent.consume(c);H!=Q()&&(S=!0,E=null)}}function q(c){y(c);B=H=null}var B=null,H=null,S=!0,E=null;mxClient.IS_POINTER&&(b.style.touchAction="none");var Q=mxUtils.bind(this,function(){var c=parseInt(f?b.offsetLeft:b.offsetTop);f||(c+=l);return c});mxEvent.addGestureListeners(b,function(c){B=new mxPoint(mxEvent.getClientX(c),
mxEvent.getClientY(c));H=Q();S=!1;mxEvent.consume(c)});mxEvent.addListener(b,"click",mxUtils.bind(this,function(c){if(!S&&this.hsplitClickEnabled){var g=null!=E?E-l:0;E=Q();u(g);mxEvent.consume(c)}}));mxEvent.addGestureListeners(document,null,y,q);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,y,q)})};
EditorUi.prototype.prompt=function(b,f,l){b=new FilenameDialog(this,f,mxResources.get("apply"),function(u){l(parseFloat(u))},b);this.showDialog(b.container,300,80,!0,!0);b.init()};
EditorUi.prototype.handleError=function(b,f,l,u,y){b=null!=b&&null!=b.error?b.error:b;if(null!=b||null!=f){y=mxUtils.htmlEntities(mxResources.get("unknownError"));var q=mxResources.get("ok");f=null!=f?f:mxResources.get("error");null!=b&&null!=b.message&&(y=mxUtils.htmlEntities(b.message));this.showError(f,y,q,l,null,null,null,null,null,null,null,null,u?l:null)}else null!=l&&l()};
EditorUi.prototype.showError=function(b,f,l,u,y,q,B,H,S,E,Q,c,g){b=new ErrorDialog(this,b,f,l||mxResources.get("ok"),u,y,q,B,c,H,S);f=Math.ceil(null!=f?f.length/50:1);this.showDialog(b.container,E||340,Q||100+20*f,!0,!1,g);b.init()};EditorUi.prototype.showDialog=function(b,f,l,u,y,q,B,H,S,E){this.editor.graph.tooltipHandler.resetTimer();this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,b,f,l,u,y,q,B,H,S,E);this.dialogs.push(this.dialog)};
EditorUi.prototype.hideDialog=function(b,f,l){var u=null;if(null!=this.dialogs&&0<this.dialogs.length)for(var y=this.dialogs.length-1;0<=y;y--)if(!this.dialogs[y].closing){u=this.dialogs[y];break}null==u||null!=l&&l!=this.dialog.container.firstChild||(u.closing=!0,0==u.close(b,f)?delete u.closing:(delete u.closing,b=mxUtils.lastIndexOf(this.dialogs,u),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",u)),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 f=b.getSelectionCells(),l=new mxDictionary,u=[],y=0;y<f.length;y++){var q=b.isTableCell(f[y])?b.model.getParent(f[y]):f[y];null==q||l.get(q)||(l.put(q,!0),u.push(q))}b.setSelectionCells(b.duplicateCells(u,!1))}catch(B){this.handleError(B)}};
EditorUi.prototype.pickColor=function(b,f,l,u,y){var q=this.editor.graph,B=q.cellEditor.saveSelection(),H=(y?240:290)+17*(Math.ceil(ColorDialog.prototype.presetColors.length/12)+Math.ceil(ColorDialog.prototype.defaultColors.length/12));b=new ColorDialog(this,b,function(S){q.cellEditor.restoreSelection(B);f(S)},function(){q.cellEditor.restoreSelection(B)},l,u,y);this.showDialog(b.container,230,H,!0,!1);b.init()};
EditorUi.prototype.openFile=function(){window.openFile=new OpenFile(mxUtils.bind(this,function(b){this.hideDialog(b)}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:320,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null})};
EditorUi.prototype.base64ToBlob=function(b,f){f=f||"";b=atob(b);for(var l=b.length,u=Math.ceil(l/1024),y=Array(u),q=0;q<u;++q){for(var B=1024*q,H=Math.min(B+1024,l),S=Array(H-B),E=0;B<H;++E,++B)S[E]=b[B].charCodeAt(0);y[q]=new Uint8Array(S)}return new Blob(y,{type:f})};
EditorUi.prototype.extractGraphModelFromHtml=function(b){var f=null;try{var l=b.indexOf("&lt;mxGraphModel ");if(0<=l){var u=b.lastIndexOf("&lt;/mxGraphModel&gt;");u>l&&(f=b.substring(l,u+21).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}}catch(y){}return f};
EditorUi.prototype.extractGraphModelFromEvent=function(b){var f=null,l=null;null!=b&&(b=null!=b.dataTransfer?b.dataTransfer:b.clipboardData,null!=b&&(l=0<=mxUtils.indexOf(b.types,"text/html")?b.getData("text/html"):null,0<=mxUtils.indexOf(b.types,"text/plain")&&(null==l||0==l.length)&&(l=b.getData("text/plain")),null!=l&&(l=Graph.zapGremlins(mxUtils.trim(l)),b=this.extractGraphModelFromHtml(l),null!=b&&(l=b))));null!=l&&this.isCompatibleString(l)&&(f=l);return f};
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(f){this.save(f)}),null,mxUtils.bind(this,function(f){if(null!=f&&0<f.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 f=mxUtils.getXml(this.editor.getGraphXml());try{if(Editor.useLocalStorage){if(null!=localStorage.getItem(b)&&!mxUtils.confirm(mxResources.get("replaceIt",[b])))return;localStorage.setItem(b,f);this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("saved"))+" "+new Date)}))}else if(f.length<MAX_REQUEST_SIZE)(new mxXmlRequest(SAVE_URL,
"filename="+encodeURIComponent(b)+"&xml="+encodeURIComponent(f))).simulate(document,"_blank");else{mxUtils.alert(mxResources.get("drawingTooLarge"));mxUtils.popup(f);return}this.editor.setModified(!1);this.editor.setFilename(b);this.updateDocumentTitle()}catch(l){this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("errorSavingFile")))}))}}};
EditorUi.prototype.executeLayouts=function(b,f){this.executeLayout(mxUtils.bind(this,function(){var l=new mxCompositeLayout(this.editor.graph,b),u=this.editor.graph.getSelectionCells();l.execute(this.editor.graph.getDefaultParent(),0==u.length?null:u)}),!0,f)};
EditorUi.prototype.executeLayout=function(b,f,l){var u=this.editor.graph;u.getModel().beginUpdate();try{b()}catch(y){throw y;}finally{this.allowAnimation&&f&&u.isEnabled()?(b=new mxMorphing(u),b.addListener(mxEvent.DONE,mxUtils.bind(this,function(){u.getModel().endUpdate();null!=l&&l()})),b.startAnimation()):(u.getModel().endUpdate(),null!=l&&l())}};
EditorUi.prototype.showImageDialog=function(b,f,l,u){u=this.editor.graph.cellEditor;var y=u.saveSelection(),q=mxUtils.prompt(b,f);u.restoreSelection(y);if(null!=q&&0<q.length){var B=new Image;B.onload=function(){l(q,B.width,B.height)};B.onerror=function(){l(null);mxUtils.alert(mxResources.get("fileNotFound"))};B.src=q}else l(null)};EditorUi.prototype.showLinkDialog=function(b,f,l){b=new LinkDialog(this,b,f,l);this.showDialog(b.container,420,90,!0,!0);b.init()};
EditorUi.prototype.showDataDialog=function(b){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,220)),b.init())};
EditorUi.prototype.showBackgroundImageDialog=function(b,f){b=null!=b?b:mxUtils.bind(this,function(u){u=new ChangePageSetup(this,null,u);u.ignoreColor=!0;this.editor.graph.model.execute(u)});var l=mxUtils.prompt(mxResources.get("backgroundImage"),null!=f?f.src:"");null!=l&&0<l.length?(f=new Image,f.onload=function(){b(new mxImage(l,f.width,f.height),!1)},f.onerror=function(){b(null,!0);mxUtils.alert(mxResources.get("fileNotFound"))},f.src=l):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,f,l){mxUtils.confirm(b)?null!=f&&f():null!=l&&l()};EditorUi.prototype.createOutline=function(b){var f=new mxOutline(this.editor.graph);mxEvent.addListener(window,"resize",function(){f.update(!1)});return f};
EditorUi.prototype.altShiftActions={65:"connectionArrows",82:"clearWaypoints",76:"editLink",79:"connectionPoints",81:"editConnectionPoints",84:"editTooltip",86:"pasteSize",70:"copySize",66:"copyData",69:"pasteData"};EditorUi.prototype.ctrlAltShiftActions={70:"bringForward",66:"sendBackward",88:"copyAsSvg"};EditorUi.prototype.ctrlAltActions={88:"copyAsImage"};
EditorUi.prototype.createKeyHandler=function(b){function f(c,g,m){if(!u.isSelectionEmpty()&&u.isEnabled()){g=null!=g?g:1;var n=u.getCompositeParents(u.getSelectionCells()),x=0<n.length?n[0]:null;if(null!=x)if(m){u.getModel().beginUpdate();try{for(x=0;x<n.length;x++)if(u.getModel().isVertex(n[x])&&u.isCellResizable(n[x])){var F=u.getCellGeometry(n[x]);null!=F&&(F=F.clone(),37==c?F.width=Math.max(0,F.width-g):38==c?F.height=Math.max(0,F.height-g):39==c?F.width+=g:40==c&&(F.height+=g),u.getModel().setGeometry(n[x],
F))}}finally{u.getModel().endUpdate()}}else{F=u.model.getParent(x);var I=u.getView().scale;m=null;1==u.getSelectionCount()&&u.model.isVertex(x)&&null!=u.layoutManager&&!u.isCellLocked(x)&&(m=u.layoutManager.getLayout(F));if(null!=m&&m.constructor==mxStackLayout)g=F.getIndex(x),37==c||38==c?u.model.add(F,x,Math.max(0,g-1)):(39==c||40==c)&&u.model.add(F,x,Math.min(u.model.getChildCount(F),g+1));else{var M=u.graphHandler;null!=M&&(null==M.first&&M.start(x,0,0,u.getMovableCells(n)),null!=M.first&&(x=
n=0,37==c?n=-g:38==c?x=-g:39==c?n=g:40==c&&(x=g),M.currentDx+=n*I,M.currentDy+=x*I,M.checkPreview(),M.updatePreview()),null!=B&&window.clearTimeout(B),B=window.setTimeout(function(){if(null!=M.first){var L=M.roundLength(M.currentDx/I),K=M.roundLength(M.currentDy/I);M.moveCells(M.cells,L,K);M.reset()}},400))}}}}var l=this,u=this.editor.graph,y=new mxKeyHandler(u),q=y.isEventIgnored;y.isEventIgnored=function(c){return!(mxEvent.isShiftDown(c)&&9==c.keyCode)&&(!this.isControlDown(c)||mxEvent.isShiftDown(c)||
90!=c.keyCode&&89!=c.keyCode&&188!=c.keyCode&&190!=c.keyCode&&85!=c.keyCode&&83!=c.keyCode)&&(66!=c.keyCode&&73!=c.keyCode||!this.isControlDown(c)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&(109!=c.keyCode&&107!=c.keyCode||!this.isControlDown(c)&&!mxEvent.isShiftDown(c)||!this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&q.apply(this,arguments)};y.isEnabledForEvent=function(c){return!mxEvent.isConsumed(c)&&this.isGraphEvent(c)&&this.isEnabled()&&
(null==l.dialogs||0==l.dialogs.length)};y.isControlDown=function(c){return mxEvent.isControlDown(c)||mxClient.IS_MAC&&c.metaKey};var B=null,H={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},S=y.getFunction;mxKeyHandler.prototype.getFunction=function(c){if(u.isEnabled()){var g=null;mxEvent.isShiftDown(c)&&this.isControlDown(c)&&mxEvent.isAltDown(c)?g=l.actions.get(l.ctrlAltShiftActions[c.keyCode]):mxEvent.isShiftDown(c)&&mxEvent.isAltDown(c)?
g=l.actions.get(l.altShiftActions[c.keyCode]):this.isControlDown(c)&&mxEvent.isAltDown(c)&&(g=l.actions.get(l.ctrlAltActions[c.keyCode]));if(null!=g)return g.funct;if("/"==c.key&&!this.isControlDown(c)&&!mxEvent.isAltDown(c))return function(){var m=document.getElementById("geOmniSearch");null!=m&&30<m.clientWidth&&m.focus()};if(null!=H[c.keyCode]&&!u.isSelectionEmpty())if(!this.isControlDown(c)&&mxEvent.isShiftDown(c)&&mxEvent.isAltDown(c)){if(u.model.isVertex(u.getSelectionCell()))return function(){var m=
u.connectVertex(u.getSelectionCell(),H[c.keyCode],u.defaultEdgeLength,c,!0);null!=m&&0<m.length&&(1==m.length&&u.model.isEdge(m[0])?u.setSelectionCell(u.model.getTerminal(m[0],!1)):u.setSelectionCell(m[m.length-1]),u.scrollCellToVisible(u.getSelectionCell()),null!=l.hoverIcons&&l.hoverIcons.update(u.view.getState(u.getSelectionCell())))}}else return this.isControlDown(c)?function(){f(c.keyCode,mxEvent.isShiftDown(c)?u.gridSize:null,!0)}:function(){f(c.keyCode,mxEvent.isShiftDown(c)?u.gridSize:null)}}return S.apply(this,
arguments)};y.bindAction=mxUtils.bind(this,function(c,g,m,n){var x=this.actions.get(m);null!=x&&(m=function(){x.isEnabled()&&x.funct.apply(this,arguments)},g?n?y.bindControlShiftKey(c,m):y.bindControlKey(c,m):n?y.bindShiftKey(c,m):y.bindKey(c,m))});var E=this,Q=y.escape;y.escape=function(c){Q.apply(this,arguments)};y.enter=function(){};y.bindControlShiftKey(36,function(){u.exitGroup()});y.bindControlShiftKey(35,function(){u.enterGroup()});y.bindShiftKey(36,function(){u.home()});y.bindKey(35,function(){u.refresh()});
y.bindAction(80,!0,"print");y.bindAction(107,!0,"zoomIn");y.bindAction(109,!0,"zoomOut");y.bindAction(61,!0,"zoomIn");y.bindAction(187,!0,"zoomIn");y.bindAction(222,!0,"zoomIn");y.bindAction(173,!0,"zoomOut");y.bindAction(189,!0,"zoomOut");if(!this.editor.chromeless||this.editor.editable)y.bindAction(79,!0,"outline",!0),y.bindControlKey(36,function(){u.isEnabled()&&u.foldCells(!0)}),y.bindControlKey(35,function(){u.isEnabled()&&u.foldCells(!1)}),y.bindControlKey(13,function(){E.ctrlEnter()}),y.bindAction(8,
!1,"delete"),y.bindAction(8,!0,"deleteAll"),y.bindAction(8,!1,"deleteLabels",!0),y.bindAction(46,!1,"delete"),y.bindAction(46,!0,"deleteAll"),y.bindAction(46,!1,"deleteLabels",!0),y.bindAction(36,!1,"resetView"),y.bindAction(72,!0,"fitWindow",!0),y.bindAction(74,!0,"fitPage"),y.bindAction(74,!0,"fitTwoPages",!0),y.bindAction(48,!0,"customZoom"),y.bindAction(82,!0,"turn"),y.bindAction(82,!0,"clearDefaultStyle",!0),y.bindAction(83,!0,"save"),y.bindAction(83,!0,"saveAs",!0),y.bindAction(65,!0,"selectAll"),
y.bindAction(65,!0,"selectNone",!0),y.bindAction(73,!0,"selectVertices",!0),y.bindAction(69,!0,"selectEdges",!0),y.bindAction(69,!0,"editStyle"),y.bindAction(66,!0,"bold"),y.bindAction(66,!0,"toBack",!0),y.bindAction(70,!0,"toFront",!0),y.bindAction(68,!0,"duplicate"),y.bindAction(68,!0,"setAsDefaultStyle",!0),y.bindAction(90,!0,"undo"),y.bindAction(90,!0,"redo",!0),y.bindAction(89,!0,"redo"),y.bindAction(89,!0,"autosize",!0),y.bindAction(88,!0,"cut"),y.bindAction(67,!0,"copy"),y.bindAction(86,!0,
"paste"),y.bindAction(71,!0,"group"),y.bindAction(77,!0,"editData"),y.bindAction(71,!0,"grid",!0),y.bindAction(73,!0,"italic"),y.bindAction(76,!0,"lockUnlock"),y.bindAction(76,!0,"layers",!0),y.bindAction(80,!0,"format",!0),y.bindAction(85,!0,"underline"),y.bindAction(85,!0,"ungroup",!0),y.bindAction(109,!0,"decreaseFontSize",!0),y.bindAction(107,!0,"increaseFontSize",!0),y.bindAction(219,!0,"decreaseFontSize",!0),y.bindAction(221,!0,"increaseFontSize",!0),y.bindAction(190,!0,"superscript"),y.bindAction(188,
!0,"subscript"),y.bindAction(13,!1,"keyPressEnter"),y.bindKey(113,function(){u.isEnabled()&&u.startEditingAtCell()});return y};EditorUi.prototype.createMenuElement=function(b,f,l){var u=document.createElement("a");this.addMenuHandler(u,f,l);mxUtils.write(u,b);u.className="geItem";return u};
EditorUi.prototype.addMenuHandler=function(b,f,l,u){if(null!=f){var y=null,q=!0,B=mxUtils.bind(this,function(H){null!=l&&l(H);if(!mxEvent.isConsumed(H)&&q&&(null==b.enabled||b.enabled)){this.editor.graph.popupMenuHandler.hideMenu();var S=new mxPopupMenu(f);S.smartSeparators=!0;S.showDisabled=!0;S.autoExpand=!0;S.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(S,arguments);this.resetCurrentMenu();y=null;S.destroy()});this.menus.autoPopup||null==this.currentMenu||this.hideCurrentMenu();
var E=mxUtils.getOffset(b);S.popup(E.x,E.y+b.offsetHeight,null,H);this.setCurrentMenu(S,b);y=S}u||mxEvent.consume(H)});mxEvent.addListener(b,"mousemove",mxUtils.bind(this,function(H){if(this.menus.autoPopup&&null!=this.currentMenu&&this.currentMenuElt!=b&&null!=this.currentMenuElt){var S=this.currentMenuElt;this.hideCurrentMenu();S.parentNode==b.parentNode&&"INPUT"!=b.nodeName&&B(H)}}));mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(H){!this.menus.autoPopup&&
null!=this.currentMenu&&this.currentMenuElt!=b&&mxEvent.isMouseEvent(H)&&this.hideCurrentMenu();q=null==this.currentMenu;"INPUT"!=mxEvent.getSource(H).nodeName?H.preventDefault():H.stopPropagation()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(H){B(H);q=!0}));u&&(mxEvent.addListener(b,"focus",mxUtils.bind(this,function(H){B(H);q=!0})),mxEvent.addListener(b,"blur",mxUtils.bind(this,function(H){this.currentMenu==y&&this.hideCurrentMenu()})),mxEvent.addListener(b,"keyup",mxUtils.bind(this,
function(H){this.hideCurrentMenu();13!=H.keyCode&&27!=H.keyCode&&(B(H),q=!0)})))}};
EditorUi.prototype.addShapePicker=function(b,f){var l=this.editor.graph;mxEvent.addListener(b,"click",mxUtils.bind(this,function(u){if(this.isShapePickerVisible())this.hideShapePicker();else{var y=mxUtils.getOffset(b);Editor.inlineFullscreen||null==this.embedViewport?f?(y.x-=this.diagramContainer.offsetLeft+30,y.y=b.offsetHeight-2):(y.x+=16+b.offsetHeight+this.sketchPickerMenuElt.offsetWidth/2,y.y+=20):(y.x=0,y.y=b.offsetTop);this.showShapePicker(Math.max(this.diagramContainer.scrollLeft+Math.max(24,
y.x)),this.diagramContainer.scrollTop+y.y,null,null,null,null,mxUtils.bind(this,function(q){return l.getCenterInsertPoint(l.getBoundingBoxFromGeometry(q,!0))}),f,!1)}mxEvent.consume(u)}))};
EditorUi.prototype.createZoomInput=function(b){var f=document.createElement("input");f.className="geButton geZoomInput";f.style.backgroundImage="url("+Editor.thinExpandImage+")";f.setAttribute("type","text");f.setAttribute("value","100%");var l=this.menus.get("viewZoom");this.dependsOnLanguage(mxUtils.bind(this,function(){f.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)")}));(b||mxClient.IS_TOUCH)&&f.setAttribute("readonly","true");var u=!1;mxEvent.addGestureListeners(f,mxUtils.bind(this,
function(y){u=!1;mxClient.IS_TOUCH||mxEvent.getSource(y)!=f||document.activeElement==f||(f.focus(),mxClient.IS_GC||mxClient.IS_FF?f.select():document.execCommand("selectAll",!1,null),u=!0)}),mxUtils.bind(this,function(y){mxEvent.getSource(y)==f&&u&&mxEvent.consume(y)}),mxUtils.bind(this,function(y){u&&(mxEvent.consume(y),u=!1)}));this.addMenuHandler(f,l.funct);mxUtils.bind(this,function(y){mxEvent.addListener(y,"click",mxUtils.bind(this,function(B){mxEvent.isAltDown(B)?(this.hideCurrentMenu(),this.actions.get("customZoom").funct(),
mxEvent.consume(B)):mxEvent.isShiftDown(B)&&(this.hideCurrentMenu(),this.actions.get("smartFit").funct(),mxEvent.consume(B))}));var q=mxUtils.bind(this,function(B,H,S){f.value=Math.round(100*this.editor.graph.view.scale*(null!=S?S:1))+"%";document.activeElement==f&&this.editor.graph.container.focus()});mxEvent.addListener(f,"keydown",mxUtils.bind(this,function(B){if(27==B.keyCode||13==B.keyCode||9==B.keyCode)27==B.keyCode||isNaN(parseInt(f.value))?q():this.editor.graph.zoomTo(parseInt(f.value)/100),
this.hideCurrentMenu(),mxEvent.consume(B)}));this.editor.graph.view.addListener(mxEvent.EVENT_SCALE,q);this.editor.addListener("resetGraphView",q);this.editor.addListener("pageSelected",q);mxEvent.addListener(f,"blur",q);this.editor.graph.addListener("zoomPreview",mxUtils.bind(this,function(B,H){q(B,H,H.getProperty("factor"))}))})(f);return f};
EditorUi.prototype.createHelpIcon=function(b,f){f=document.createElement("img");f.setAttribute("src",Editor.helpImage);f.setAttribute("title",mxResources.get("help")+" ("+b+")");f.className="geHelpIcon";mxEvent.addGestureListeners(f,mxUtils.bind(this,function(l){this.hideCurrentMenu();this.openLink(b);mxEvent.consume(l)}));return f};
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.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.sidebar&&(this.sidebar.destroy(),this.sidebar=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 f=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.hsplit,this.chromelessToolbar,this.layersDialog];for(b=0;b<f.length;b++)null!=f[b]&&null!=f[b].parentNode&&f[b].parentNode.removeChild(f[b])};(function(){var b=[["nbsp","160"],["shy","173"]],f=mxUtils.parseXml;mxUtils.parseXml=function(u){for(var y=0;y<b.length;y++)u=u.replace(new RegExp("&"+b[y][0]+";","g"),"&#"+b[y][1]+";");return f(u)};var l=mxUtils.getSizeForString;mxUtils.getSizeForString=function(u,y,q,B){return l(Graph.sanitizeHtml(u),y,q,B)}})();
Date.prototype.toISOString||function(){function b(f){f=String(f);1===f.length&&(f="0"+f);return f}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,f=function(u){return"function"===typeof u||"[object Function]"===b.call(u)},l=Math.pow(2,53)-1;return function(u){var y=Object(u);if(null==u)throw new TypeError("Array.from requires an array-like object - not null or undefined");var q=1<arguments.length?arguments[1]:void 0,B;if("undefined"!==typeof q){if(!f(q))throw new TypeError("Array.from: when provided, the second argument must be a function");2<arguments.length&&(B=
arguments[2])}var H=Number(y.length);H=isNaN(H)?0:0!==H&&isFinite(H)?(0<H?1:-1)*Math.floor(Math.abs(H)):H;H=Math.min(Math.max(H,0),l);for(var S=f(this)?Object(new this(H)):Array(H),E=0,Q;E<H;)Q=y[E],S[E]=q?"undefined"===typeof B?q(Q,E):q.call(B,Q,E):Q,E+=1;S.length=H;return S}}());mxConstants.SHADOW_OPACITY=.25;mxConstants.SHADOWCOLOR="#000000";mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxCodec.allowlist="mxStylesheet Array mxGraphModel mxCell mxGeometry mxRectangle mxPoint mxChildChange mxRootChange mxTerminalChange mxValueChange mxStyleChange mxGeometryChange mxCollapseChange mxVisibleChange mxCellAttributeChange".split(" ");
mxGraph.prototype.pageBreakColor="#c0c0c0";mxGraph.prototype.pageScale=1;(function(){try{if(null!=navigator&&null!=navigator.language){var b=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===b||"en-ca"===b||"es-mx"===b?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(f){}})();mxText.prototype.baseSpacingTop=5;mxText.prototype.baseSpacingBottom=1;mxGraphModel.prototype.ignoreRelativeEdgeParent=!1;mxGraphView.prototype.gridImage="data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=";
mxGraphView.prototype.gridSteps=4;mxGraphView.prototype.minGridSize=4;mxGraphView.prototype.defaultGridColor="#d0d0d0";mxGraphView.prototype.defaultDarkGridColor="#424242";mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultGridColor;mxGraphView.prototype.unit=mxConstants.POINTS;mxGraphView.prototype.setUnit=function(b){this.unit!=b&&(this.unit=b,this.graph.refresh(),this.fireEvent(new mxEventObject("unitChanged","unit",b)))};mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]";
mxShape.prototype.getConstraints=function(b,f,l){return null};mxImageShape.prototype.getImageDataUri=function(){var b=String(this.image);if("data:image/svg+xml;base64,"==b.substring(0,26)&&null!=this.style&&"1"==mxUtils.getValue(this.style,"clipSvg","0")){if(null==this.clippedSvg||this.clippedImage!=b)this.clippedSvg=Graph.clipSvgDataUri(b),this.clippedImage=b;b=this.clippedSvg}return b};
(function(){var b=mxStencil.prototype.parseColor;mxStencil.prototype.parseColor=function(f,l,u,y,q){return"default"==y&&null!=q?"fillcolor"==u.nodeName?q.shapeBackgroundColor:q.shapeForegroundColor:b.apply(this,arguments)}})();(function(){var b=mxResources.get;mxResources.get=function(f,l,u){null==u&&(u=f);return b.apply(this,[f,l,u])}})();
(function(){var b=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(f,l,u,y,q,B,H,S){var E=b.apply(this,arguments);if(null!=l){var Q=E.getElementsByTagName("img");0<Q.length&&(Q[0].className="geButton")}return E}})();
Graph=function(b,f,l,u,y,q){mxGraph.call(this,b,f,l,u);this.themes=y||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);this.standalone=null!=q?q:!1;b=this.baseUrl;f=b.indexOf("//");this.domainPathUrl=this.domainUrl="";0<f&&(f=b.indexOf("/",f+2),0<f&&(this.domainUrl=b.substring(0,f)),f=b.lastIndexOf("/"),0<f&&(this.domainPathUrl=b.substring(0,f+1)));this.isHtmlLabel=function(k){k=this.getCurrentCellStyle(k);
return null!=k?"1"==k.html||"wrap"==k[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.immediateHandling){var B=null,H=null,S=null,E=null,Q=!1,c=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(k,v){if("mouseDown"==v.getProperty("eventName")&&this.isEnabled()){k=v.getProperty("event");var J=k.getState();v=this.view.scale;if(!mxEvent.isAltDown(k.getEvent())&&null!=J&&(c=this.isCellSelected(J.cell),!this.panningHandler.isActive()&&!mxEvent.isControlDown(k.getEvent()))){var N=this.selectionCellsHandler.getHandler(J.cell);
if(null==N||null==N.getHandleForEvent(k)){var T=new mxRectangle(k.getGraphX()-1,k.getGraphY()-1),V=mxEvent.isTouchEvent(k.getEvent())?mxShape.prototype.svgStrokeTolerance-1:(mxShape.prototype.svgStrokeTolerance+2)/2;N=V+2;T.grow(V);if(this.isTableCell(J.cell)&&this.isCellMovable(J.cell)&&!this.isCellSelected(J.cell)&&!(mxUtils.contains(J,k.getGraphX()-N,k.getGraphY()-N)&&mxUtils.contains(J,k.getGraphX()-N,k.getGraphY()+N)&&mxUtils.contains(J,k.getGraphX()+N,k.getGraphY()+N)&&mxUtils.contains(J,k.getGraphX()+
N,k.getGraphY()-N))){var U=this.model.getParent(J.cell);N=this.model.getParent(U);if(!this.isCellSelected(N)){V*=v;var X=2*V;if(this.model.getChildAt(N,0)!=U&&mxUtils.intersects(T,new mxRectangle(J.x,J.y-V,J.width,X))||this.model.getChildAt(U,0)!=J.cell&&mxUtils.intersects(T,new mxRectangle(J.x-V,J.y,X,J.height))||mxUtils.intersects(T,new mxRectangle(J.x,J.y+J.height-V,J.width,X))||mxUtils.intersects(T,new mxRectangle(J.x+J.width-V,J.y,X,J.height)))U=this.selectionCellsHandler.isHandled(N),this.selectCellForEvent(N,
k.getEvent()),N=this.selectionCellsHandler.getHandler(N),null!=N&&(V=N.getHandleForEvent(k),null!=V&&(N.start(k.getGraphX(),k.getGraphY(),V),N.blockDelayedSelection=!U,k.consume()))}}for(;!k.isConsumed()&&null!=J&&(this.isTableCell(J.cell)||this.isTableRow(J.cell)||this.isTable(J.cell));)this.isSwimlane(J.cell)&&this.isCellMovable(J.cell)&&(N=this.getActualStartSize(J.cell),(0<N.x||0<N.width)&&mxUtils.intersects(T,new mxRectangle(J.x+(N.x-N.width-1)*v+(0==N.x?J.width:0),J.y,1,J.height))||(0<N.y||
0<N.height)&&mxUtils.intersects(T,new mxRectangle(J.x,J.y+(N.y-N.height-1)*v+(0==N.y?J.height:0),J.width,1)))&&(this.selectCellForEvent(J.cell,k.getEvent()),N=this.selectionCellsHandler.getHandler(J.cell),null!=N&&null!=N.customHandles&&(V=mxEvent.CUSTOM_HANDLE-N.customHandles.length+1,N.start(k.getGraphX(),k.getGraphY(),V),k.consume())),J=this.view.getState(this.model.getParent(J.cell))}}}}));this.addListener(mxEvent.CONSUME_MOUSE_EVENT,mxUtils.bind(this,function(k,v){if("mouseDown"==v.getProperty("eventName")&&
this.isEnabled()){k=v.getProperty("event");var J=k.getState();mxEvent.isAltDown(k.getEvent())||mxEvent.isControlDown(v)||mxEvent.isShiftDown(v)||c||null==J||!this.model.isEdge(J.cell)||(B=new mxPoint(k.getGraphX(),k.getGraphY()),Q=this.isCellSelected(J.cell),S=J,H=k,null!=J.text&&null!=J.text.boundingBox&&mxUtils.contains(J.text.boundingBox,k.getGraphX(),k.getGraphY())?E=mxEvent.LABEL_HANDLE:(v=this.selectionCellsHandler.getHandler(J.cell),null!=v&&null!=v.bends&&0<v.bends.length&&(E=v.getHandleForEvent(k))))}}));
this.addMouseListener({mouseDown:function(k,v){},mouseMove:mxUtils.bind(this,function(k,v){k=this.selectionCellsHandler.handlers.map;for(var J in k)if(null!=k[J].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isAltDown(v.getEvent())){var N=this.tolerance;if(null!=B&&null!=S&&null!=H){if(J=S,null!=E||Math.abs(B.x-v.getGraphX())>N||Math.abs(B.y-v.getGraphY())>N){var T=null;mxEvent.isShiftDown(v.getEvent())||(T=this.selectionCellsHandler.getHandler(J.cell));if(null!=T&&null!=
T.bends&&0<T.bends.length){T.redrawHandles();var V=null!=E?E:T.getHandleForEvent(H),U=this.view.getEdgeStyle(J),X=U==mxEdgeStyle.EntityRelation;N=J.absolutePoints;Q||(V=E);V!=mxEvent.LABEL_HANDLE&&null!=N&&(V=E,null==V&&(k=new mxRectangle(B.x,B.y),k.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(k,N[0].x,N[0].y)?V=0:mxUtils.contains(k,N[N.length-1].x,N[N.length-1].y)?V=T.bends.length-1:null!=N&&(null==U&&null==V||U==mxEdgeStyle.SegmentConnector||U==mxEdgeStyle.OrthConnector)&&
(null!=U&&(2==N.length||3==N.length&&(0==Math.round(N[0].x-N[1].x)&&0==Math.round(N[1].x-N[2].x)||0==Math.round(N[0].y-N[1].y)&&0==Math.round(N[1].y-N[2].y)))?V=2:(V=mxUtils.findNearestSegment(J,B.x,B.y),V=null==U?mxEvent.VIRTUAL_HANDLE-V:V+1))),null==V&&(V=mxEvent.VIRTUAL_HANDLE));k=V==mxEvent.LABEL_HANDLE||0==V||V==T.bends.length-1;if(!X&&(null!=J.visibleSourceState||null!=J.visibleTargetState)||k)T.start(v.getGraphX(),v.getGraphX(),V),v.consume(),this.graphHandler.reset()}null!=T&&(this.selectionCellsHandler.isHandlerActive(T)?
this.isCellSelected(J.cell)||(this.selectionCellsHandler.handlers.put(J.cell,T),this.selectCellForEvent(J.cell,v.getEvent())):this.isCellSelected(J.cell)||T.destroy());Q=!1;B=H=S=E=null}}else if(J=v.getState(),null!=J&&this.isCellEditable(J.cell)){k=this.model.getParent(J.cell);T=null;if(this.model.isEdge(J.cell)&&!this.isCellSelected(J.cell)&&!mxEvent.isAltDown(v.getEvent())&&!mxEvent.isShiftDown(v.getEvent())&&!this.isAncestorSelected(J.cell)&&(this.isSwimlane(k)||this.model.isLayer(k)||this.getCurrentRoot()==
k)){if(k=new mxRectangle(v.getGraphX(),v.getGraphY()),k.grow(mxEdgeHandler.prototype.handleImage.width/2),N=J.absolutePoints,null!=N)null!=J.text&&null!=J.text.boundingBox&&mxUtils.contains(J.text.boundingBox,v.getGraphX(),v.getGraphY())?T="move":mxUtils.contains(k,N[0].x,N[0].y)||mxUtils.contains(k,N[N.length-1].x,N[N.length-1].y)?T="pointer":(U=this.view.getEdgeStyle(J),U==mxEdgeStyle.EntityRelation||null==J.visibleSourceState&&null==J.visibleTargetState||(T="crosshair",U!=mxEdgeStyle.SegmentConnector&&
U!=mxEdgeStyle.OrthConnector))||(v=mxUtils.findNearestSegment(J,v.getGraphX(),v.getGraphY()),v<N.length-1&&0<=v&&(T=0==Math.round(N[v].x-N[v+1].x)?"col-resize":"row-resize"))}else if(!mxEvent.isControlDown(v.getEvent())){N=mxShape.prototype.svgStrokeTolerance/2;k=new mxRectangle(v.getGraphX(),v.getGraphY());k.grow(N);if(this.isTableCell(J.cell)&&this.isCellMovable(J.cell)&&(v=this.model.getParent(J.cell),N=this.model.getParent(v),!this.isCellSelected(N)))if(mxUtils.intersects(k,new mxRectangle(J.x,
J.y-2,J.width,4))&&this.model.getChildAt(N,0)!=v||mxUtils.intersects(k,new mxRectangle(J.x,J.y+J.height-2,J.width,4)))T="row-resize";else if(mxUtils.intersects(k,new mxRectangle(J.x-2,J.y,4,J.height))&&this.model.getChildAt(v,0)!=J.cell||mxUtils.intersects(k,new mxRectangle(J.x+J.width-2,J.y,4,J.height)))T="col-resize";for(v=J;null==T&&null!=v&&(this.isTableCell(v.cell)||this.isTableRow(v.cell)||this.isTable(v.cell));)this.isSwimlane(v.cell)&&this.isCellMovable(v.cell)&&(N=this.getActualStartSize(v.cell),
V=this.view.scale,(0<N.x||0<N.width)&&mxUtils.intersects(k,new mxRectangle(v.x+(N.x-N.width-1)*V+(0==N.x?v.width*V:0),v.y,1,v.height))?T="col-resize":(0<N.y||0<N.height)&&mxUtils.intersects(k,new mxRectangle(v.x,v.y+(N.y-N.height-1)*V+(0==N.y?v.height:0),v.width,1))&&(T="row-resize")),v=this.view.getState(this.model.getParent(v.cell))}null!=T&&J.setCursor(T)}}}),mouseUp:mxUtils.bind(this,function(k,v){E=B=H=S=null})})}this.cellRenderer.minSvgStrokeWidth=.1;var g=document.createElement("div");this.cellRenderer.getLabelValue=
function(k){var v=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);k.view.graph.isHtmlLabel(k.cell)&&("0"==mxUtils.getValue(k.style,"html","0")?v=mxUtils.htmlEntities(v,!1):(k.lastLabelValue!=v&&(k.lastLabelValue=v,k.lastSanitizedLabelValue=Graph.sanitizeHtml(v),g.innerHTML=k.lastSanitizedLabelValue,Graph.addLightDarkColors(g,null,"simple"==k.view.graph.getAdaptiveColors())&&(k.lastSanitizedLabelValue=g.innerHTML)),v=k.lastSanitizedLabelValue));return v};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);
this.setDropEnabled(!0);this.setPanning(!0);this.setTooltips(!0);this.setAllowLoops(!0);this.allowAutoPanning=!0;this.constrainChildren=this.resetEdgesOnConnect=!1;this.constrainRelativeChildren=!0;this.graphHandler.scrollOnMove=!1;this.graphHandler.scaleGrid=!0;this.connectionHandler.setCreateTarget(!1);this.connectionHandler.insertBeforeSource=!0;this.connectionHandler.isValidSource=function(k,v){return!1};this.alternateEdgeStyle="vertical";null==u&&this.loadStylesheet();var m=this.graphHandler.getGuideStates;
this.graphHandler.getGuideStates=function(){var k=m.apply(this,arguments);if(this.graph.pageVisible){var v=[],J=this.graph.pageFormat,N=this.graph.pageScale,T=J.width*N;J=J.height*N;N=this.graph.view.translate;for(var V=this.graph.view.scale,U=this.graph.getPageLayout(),X=0;X<U.width;X++)v.push(new mxRectangle(((U.x+X)*T+N.x)*V,(U.y*J+N.y)*V,T*V,J*V));for(X=1;X<U.height;X++)v.push(new mxRectangle((U.x*T+N.x)*V,((U.y+X)*J+N.y)*V,T*V,J*V));k=v.concat(k)}return k};mxDragSource.prototype.dragElementZIndex=
mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=function(k,v){return null==k.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(k){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};var n=this.graphHandler.getCells;this.graphHandler.getCells=function(k){for(var v=n.apply(this,arguments),J=new mxDictionary,N=[],T=0;T<v.length;T++){var V=
this.graph.isTableCell(k)&&this.graph.isTableCell(v[T])&&this.graph.isCellSelected(v[T])?this.graph.model.getParent(v[T]):this.graph.isTableRow(k)&&this.graph.isTableRow(v[T])&&this.graph.isCellSelected(v[T])?v[T]:this.graph.getCompositeParent(v[T]);null==V||J.get(V)||(J.put(V,!0),N.push(V))}return N};var x=this.graphHandler.start;this.graphHandler.start=function(k,v,J,N){var T=!1;this.graph.isTableCell(k)&&(this.graph.isCellSelected(k)?T=!0:k=this.graph.model.getParent(k));T||this.graph.isTableRow(k)&&
this.graph.isCellSelected(k)||(k=this.graph.getCompositeParent(k));x.apply(this,arguments)};this.connectionHandler.createTargetVertex=function(k,v){v=this.graph.getCompositeParent(v);return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};this.connectionHandler.insertEdge=function(k,v,J,N,T,V){var U=mxConnectionHandler.prototype.insertEdge.apply(this,arguments);null!=N&&this.graph.applyNewEdgeStyle(N,[U]);return U};var F=new mxRubberband(this);this.getRubberband=function(){return F};
var I=(new Date).getTime(),M=0,L=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var k=this.currentState;L.apply(this,arguments);k!=this.currentState?(I=(new Date).getTime(),M=0):M=(new Date).getTime()-I};var K=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(k){return mxEvent.isShiftDown(k.getEvent())&&mxEvent.isAltDown(k.getEvent())?!1:null!=this.currentState&&k.getState()==this.currentState&&2E3<M||(null==this.currentState||
"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&K.apply(this,arguments)};var aa=this.isToggleEvent;this.isToggleEvent=function(k){return aa.apply(this,arguments)||mxEvent.isShiftDown(k)};var ja=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(ja=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=
ja)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(k){return mxEvent.isMouseEvent(k.getEvent())};var ca=this.click;this.click=function(k){var v=null==k.state&&null!=k.sourceState&&this.isCellLocked(this.getLayerForCell(k.sourceState.cell));if(this.isEnabled()&&!v||k.isConsumed())return ca.apply(this,arguments);var J=v?k.sourceState.cell:k.getCell();if(null!=J){var N=this.getClickableLinkForCell(J);null!=N?this.isCustomLink(N)?this.customLinkClicked(N,J):this.openLink(N):
v&&this.clearSelection()}};this.tooltipHandler.getStateForEvent=function(k){return k.sourceState};var ba=this.tooltipHandler.show;this.tooltipHandler.show=function(){ba.apply(this,arguments);if(null!=this.div)for(var k=this.div.getElementsByTagName("a"),v=0;v<k.length;v++)null!=k[v].getAttribute("href")&&null==k[v].getAttribute("target")&&k[v].setAttribute("target","_blank")};this.tooltipHandler.getStateForEvent=function(k){return k.sourceState};this.getCursorForMouseEvent=function(k){var v=null==
k.state&&null!=k.sourceState&&this.isCellLocked(k.sourceState.cell);return this.getCursorForCell(v?k.sourceState.cell:k.getCell())};var oa=this.getCursorForCell;this.getCursorForCell=function(k){if(!this.isEnabled()||this.isCellLocked(k)){if(null!=this.getClickableLinkForCell(k))return"pointer";if(this.isCellLocked(k))return"default"}return oa.apply(this,arguments)};this.selectRegion=function(k,v){var J=mxEvent.isAltDown(v)?k:null;k=this.getCells(k.x,k.y,k.width,k.height,null,null,J,null,!0);if(this.isToggleEvent(v))for(J=
0;J<k.length;J++)this.selectCellForEvent(k[J],v);else this.selectCellsForEvent(k,v);return k};var Y=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(k,v,J){return this.graph.isCellSelected(k)?!1:Y.apply(this,arguments)};var da=this.updateMouseEvent;this.updateMouseEvent=function(k){k=da.apply(this,arguments);null!=k.state&&this.isCellLocked(this.getLayerForCell(k.getCell()))&&(null==this.getLinkForCell(k.getCell())?k.state=this.view.getState(this.getCellAt(k.getGraphX(),
k.getGraphY(),null,null,null,mxUtils.bind(this,function(v,J,N){return k.state==v||this.isCellLocked(this.getLayerForCell(v.cell))&&null==this.getLinkForCell(v.cell)}))):k.state=null);return k};var ha=this.isCellSelectable;this.isCellSelectable=function(k){return ha.apply(this,arguments)&&!this.isCellLocked(this.getLayerForCell(k))};this.isCellLocked=function(k){for(;null!=k;){if("1"==mxUtils.getValue(this.getCurrentCellStyle(k),"locked","0"))return!0;k=this.model.getParent(k)}return!1};var Z=null;
this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(k,v){"mouseDown"==v.getProperty("eventName")&&(k=v.getProperty("event").getState(),Z=null==k||this.isSelectionEmpty()||this.isCellSelected(k.cell)?null:this.getSelectionCells())}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(k,v){if(!mxEvent.isMultiTouchEvent(v)){k=v.getProperty("event");var J=v.getProperty("cell");null==J?(k=mxUtils.convertPoint(this.container,mxEvent.getClientX(k),mxEvent.getClientY(k)),F.start(k.x,
k.y)):null!=Z?this.addSelectionCells(Z):1<this.getSelectionCount()&&this.isCellSelected(J)&&this.removeSelectionCell(J);Z=null;v.consume()}}));this.connectionHandler.selectCells=function(k,v){this.graph.setSelectionCell(v||k)};this.connectionHandler.constraintHandler.isStateIgnored=function(k,v){var J=k.view.graph;return v&&(J.isCellSelected(k.cell)||J.isTableRow(k.cell)&&J.selectionCellsHandler.isHandled(J.model.getParent(k.cell)))};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,
function(){var k=this.connectionHandler.constraintHandler;null!=k.currentFocus&&k.isStateIgnored(k.currentFocus,!0)&&(k.currentFocus=null,k.constraints=null,k.destroyIcons());k.destroyFocusHighlight()}));Graph.touchStyle&&this.initTouch()}this.currentTranslate=new mxPoint(0,0)};Graph.touchStyle=mxClient.IS_TOUCH||mxClient.IS_FF&&mxClient.IS_WIN||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints||null==window.urlParams||"1"==urlParams.touch;
Graph.fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList&&(null==window.urlParams||"0"!=urlParams.filesupport);Graph.translateDiagram="1"==urlParams["translate-diagram"];Graph.diagramLanguage=null!=urlParams["diagram-language"]?urlParams["diagram-language"]:mxClient.language;Graph.lineJumpsEnabled=!0;Graph.defaultJumpSize=6;Graph.zoomWheel=!1;Graph.selectParentLayer=!1;Graph.minTableColumnWidth=20;Graph.minTableRowHeight=20;Graph.foreignObjectWarningText="Text is not SVG - cannot display";
Graph.foreignObjectWarningLink="https://www.drawio.com/doc/faq/svg-export-text-problems";Graph.xmlDeclaration='<?xml version="1.0" encoding="UTF-8"?>';Graph.svgDoctype='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">';Graph.svgFileComment="\x3c!-- Do not edit this file with editors other than draw.io --\x3e";
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".split(" ");
Graph.edgeStyles="edgeStyle elbow jumpStyle jumpSize startArrow startFill startSize endArrow endFill endSize flowAnimation flowAnimationDirection flowAnimationTimingFunction flowAnimationDuration sourcePerimeterSpacing targetPerimeterSpacing curved linecap linejoin".split(" ");Graph.cellStyleGroups=[["startArrow","startFill","endArrow","endFill"],["startSize","endSize"],["sourcePerimeterSpacing","targetPerimeterSpacing"],["fillColor","gradientColor","gradientDirection"]];
Graph.cellStyles=mxUtils.addItems(mxUtils.addItems(mxUtils.addItems("rounded shadow glass dashed dashPattern comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification sketchStyle pointerEvents opacity strokeColor strokeWidth align verticalAlign spacingLeft spacingRight spacingTop spacingBottom spacing arcSize absoluteArcSize comicStyle swimlaneFillColor shadowOffsetX shadowOffsetY shadowBlur shadowColor shadowOpacity".split(" "),Graph.textStyles),
Graph.edgeStyles),Graph.cellStyleGroups);Graph.layoutNames="mxHierarchicalLayout mxCircleLayout mxCompactTreeLayout mxEdgeLabelLayout mxFastOrganicLayout mxParallelEdgeLayout mxPartitionLayout mxRadialTreeLayout mxStackLayout".split(" ");Graph.backupStyleAttribute="data-mx-given-colors";Graph.newColorPlaceholder="rgba(0, 0, 0, 0)";Graph.newBackgroundPlaceholder="rgb(0, 0, 0)";Graph.defaultAdaptiveColors=window.mxIsElectron||"0"==urlParams.contrast?"simple":"auto";
Graph.getDefaultAdaptiveColorsKey=function(){return"auto"==Graph.defaultAdaptiveColors?"automatic":Graph.defaultAdaptiveColors};
Graph.createOffscreenGraph=function(b){var f=new Graph(document.createElement("div"));f.stylesheet.styles=mxUtils.clone(b.styles);f.resetViewOnRootChange=!1;f.setConnectable(!1);f.gridEnabled=!1;f.autoScroll=!1;f.setTooltips(!1);f.setEnabled(!1);f.container.style.visibility="hidden";f.container.style.position="absolute";f.container.style.overflow="hidden";f.container.style.height="1px";f.container.style.width="1px";return f};
Graph.createSvgImage=function(b,f,l,u,y){l=unescape(encodeURIComponent(Graph.svgDoctype+'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+b+'px" height="'+f+'px" '+(null!=u&&null!=y?'viewBox="0 0 '+u+" "+y+'" ':"")+'version="1.1" style="color-scheme: light dark;">'+l+"</svg>"));return new mxImage("data:image/svg+xml;base64,"+(window.btoa?btoa(l):Base64.encode(l,!0)),b,f)};
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.createSvgNode=function(b,f,l,u,y){var q=mxUtils.createXmlDocument(),B=null!=q.createElementNS?q.createElementNS(mxConstants.NS_SVG,"svg"):q.createElement("svg");null!=y&&B.setAttribute("style","background: "+y.light+"; background-color: "+y.cssText+";");null==q.createElementNS?(B.setAttribute("xmlns",mxConstants.NS_SVG),B.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):B.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);B.setAttribute("version","1.1");B.setAttribute("width",
l+"px");B.setAttribute("height",u+"px");B.setAttribute("viewBox",b+" "+f+" "+l+" "+u);q.appendChild(B);return B};
Graph.htmlToPng=function(b,f,l,u,y,q){y=null!=y?y:"";q=null!=q?q:Editor.htmlRasterScale;var B=document.createElement("canvas");B.width=f*q;B.height=l*q;var H=document.createElement("img");H.onload=mxUtils.bind(this,function(){try{var E=B.getContext("2d");E.scale(q,q);E.drawImage(H,0,0);u(B.toDataURL())}catch(Q){u(null)}});var S=mxUtils.createXmlDocument();S=null!=S.createElementNS?S.createElementNS(mxConstants.NS_SVG,"svg"):S.createElement("svg");b=(new mxSvgCanvas2D(S)).convertHtml(b);H.onerror=
function(E){u(null)};H.src="data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="'+f+'" height="'+l+'">'+(""!=y?'<defs xmlns="http://www.w3.org/2000/svg"><style type="text/css">'+y+"</style></defs>":"")+'<foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">'+b+"</div></foreignObject></svg>")};
Graph.addLightDarkColors=function(b,f,l,u){function y(g,m,n){return null!=u?u(g,m,n):mxUtils.isValidColor(n)?(null==B&&null!=f&&(B={}),null!=B&&(B[m]=g.style.getPropertyValue(m)),n=mxUtils.getLightDarkColor(n,null,null,l),g.style.setProperty(m,n.cssText),!0):!1}for(var q=b.getElementsByTagName("*"),B=null,H=!1,S=0;S<q.length;S++)if(q[S]!=b&&null!=q[S].style){B=null;for(var E=0;E<q[S].style.length;E++){var Q=q[S].style.item(E),c=q[S].style.getPropertyValue(Q);H=y(q[S],Q,c)||H}"FONT"==q[S].nodeName&&
""==q[S].style.getPropertyValue("color")&&(c=q[S].getAttribute("color"),H=y(q[S],"color",c)||H);null!=f&&null!=B&&q[S].setAttribute(f,JSON.stringify(B))}return H};Graph.removeLightDarkColors=function(b,f){b=b.getElementsByTagName("*");for(var l=!1,u=0;u<b.length;u++)try{var y=b[u].getAttribute(f);if(null!=y){b[u].removeAttribute(f);var q=JSON.parse(y),B;for(B in q){var H=q[B];""==H?(b[u].style[B]=null,""==b[u].getAttribute("style")&&b[u].removeAttribute("style")):b[u].style[B]=H;l=!0}}}catch(S){}return l};
Graph.getGivenColor=function(b,f){var l=null;if(b.nodeType==mxConstants.NODETYPE_ELEMENT){try{var u=b.getAttribute(Graph.backupStyleAttribute);if(null!=u){var y=JSON.parse(u);null!=y&&null!=y[f]&&("color"==f&&"FONT"==b.nodeName&&""==y[f]&&null!=b.getAttribute("color")?l=b.getAttribute("color"):""!=y[f]&&(l=y[f]))}}catch(q){}null==l&&""!=b.style[f]&&(l=b.style[f])}return l};
Graph.setTextColor=function(b,f,l){for(var u=l?Graph.newColorPlaceholder:Graph.newBackgroundPlaceholder,y=l?"color":"background-color",q=b.getElementsByTagName("*"),B=[],H=0;H<q.length;H++)B.push({node:q[H],value:q[H].style[y]});document.execCommand(l?"forecolor":"backcolor",!1,u);b=b.getElementsByTagName("*");for(H=0;H<b.length;H++){if(H<B.length&&B[H].node==b[H]&&B[H].value!=b[H].style[y]&&""==b[H].style[y])try{if(q=b[H].getAttribute(Graph.backupStyleAttribute),null!=q){var S=JSON.parse(q);S[y]=
"";b[H].setAttribute(Graph.backupStyleAttribute,JSON.stringify(S))}}catch(E){}if(l&&b[H].getAttribute("color")==u||b[H].style[y]==u){l&&b[H].getAttribute("color")==u&&b[H].removeAttribute("color");b[H].style[y]=f!=mxConstants.NONE?mxUtils.getLightDarkColor(f).cssText:null;try{q=b[H].getAttribute(Graph.backupStyleAttribute),S=null!=q?JSON.parse(q):{},S[y]=f!=mxConstants.NONE?f:"",b[H].setAttribute(Graph.backupStyleAttribute,JSON.stringify(S))}catch(E){}if(l&&mxClient.IS_FF){f=b[H];l=f.firstChild;if(null!=
l&&"A"==l.nodeName&&null==l.nextSibling&&null!=l.firstChild){f.parentNode.insertBefore(l,f);for(u=l.firstChild;null!=u;)y=u.nextSibling,f.appendChild(u),u=y;l.appendChild(f)}break}}}};Graph.zapGremlins=function(b){return mxUtils.zapGremlins(b)};Graph.stringToBytes=function(b){for(var f=Array(b.length),l=0;l<b.length;l++)f[l]=b.charCodeAt(l);return f};Graph.bytesToString=function(b){for(var f=Array(b.length),l=0;l<b.length;l++)f[l]=String.fromCharCode(b[l]);return f.join("")};
Graph.base64EncodeUnicode=function(b){return btoa(encodeURIComponent(b).replace(/%([0-9A-F]{2})/g,function(f,l){return String.fromCharCode(parseInt(l,16))}))};Graph.base64DecodeUnicode=function(b){return decodeURIComponent(Array.prototype.map.call(atob(b),function(f){return"%"+("00"+f.charCodeAt(0).toString(16)).slice(-2)}).join(""))};Graph.compressNode=function(b,f){b=mxUtils.getXml(b);return Graph.compress(f?b:Graph.zapGremlins(b))};
Graph.arrayBufferToString=function(b){var f="";b=new Uint8Array(b);for(var l=b.byteLength,u=0;u<l;u++)f+=String.fromCharCode(b[u]);return f};Graph.stringToArrayBuffer=function(b){return Uint8Array.from(b,function(f){return f.charCodeAt(0)})};
Graph.arrayBufferIndexOfString=function(b,f,l){var u=f.charCodeAt(0),y=1,q=-1;for(l=l||0;l<b.byteLength;l++)if(b[l]==u){q=l;break}for(l=q+1;-1<q&&l<b.byteLength&&l<q+f.length-1;l++){if(b[l]!=f.charCodeAt(y))return Graph.arrayBufferIndexOfString(b,f,q+1);y++}return y==f.length-1?q:-1};Graph.compress=function(b,f){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=f?pako.deflate(encodeURIComponent(b)):pako.deflateRaw(encodeURIComponent(b));return btoa(Graph.arrayBufferToString(new Uint8Array(b)))};
Graph.decompress=function(b,f,l){if(null==b||0==b.length||"undefined"===typeof pako)return b;b=Graph.stringToArrayBuffer(atob(b));f=decodeURIComponent(f?pako.inflate(b,{to:"string"}):pako.inflateRaw(b,{to:"string"}));return l?f:Graph.zapGremlins(f)};
Graph.fadeNodes=function(b,f,l,u,y){y=null!=y?y:1E3;Graph.setTransitionForNodes(b,null);Graph.setOpacityForNodes(b,f);window.setTimeout(function(){Graph.setTransitionForNodes(b,"all "+y+"ms ease-in-out");Graph.setOpacityForNodes(b,l);window.setTimeout(function(){Graph.setTransitionForNodes(b,null);null!=u&&u()},y)},0)};
Graph.exploreFromCell=function(b,f,l){pageSize=null!=l&&null!=l.pageSize?l.pageSize:8;minSize=null!=l&&null!=l.minSize?l.minSize:180;(function(u,y){function q(c){c.view.states.visit(function(g,m){null!=m.shape&&c.model.isEdge(c.model.getParent(m.cell))?m.shape.node.parentNode.appendChild(m.shape.node):null!=m.text&&c.model.isEdge(m.cell)&&m.text.node.parentNode.appendChild(m.text.node)})}function B(c,g){if(c.getModel().isVertex(g)){var m=c.container.offsetWidth/2,n=c.container.offsetHeight/2;c.rootCell=
g.referenceCell||g;c.getModel().beginUpdate();try{pageSize=null!=l&&null!=l.pageSize?l.pageSize:8+Math.max(0,Math.floor(Math.min(c.container.offsetWidth-800/120,c.container.offsetHeight-600)/30));for(var x=g.referenceCell||g,F=u.model.getCell(x.sourceCellId),I=u.getEdges(F,null,!0,!0,!1,!0),M=[],L=0;L<I.length;L++)null!=I[L].getTerminal(!0)&&null!=I[L].getTerminal(!1)&&u.isCellVisible(I[L])&&!u.isEdgeIgnored(I[L])&&u.isCellVisible(I[L].getTerminal(!0))&&u.isCellVisible(I[L].getTerminal(!1))&&u.isCellVisible(u.getLayerForCell(I[L]))&&
M.push(I[L]);M=I=M;if(null!=g.startIndex||0<pageSize&&I.length>pageSize){var K=g.startIndex||0;M=I.slice(Math.max(0,K),Math.min(I.length,K+pageSize))}M=u.getOpposites(M,F).concat(M);var aa=c.cloneCells(M);for(L=0;L<M.length;L++)if(aa[L].sourceCellId=M[L].id,c.model.isEdge(aa[L]))for(aa[L].geometry.x=0,aa[L].geometry.y=0,aa[L].geometry.points=null,aa[L].setStyle(aa[L].getStyle()+";curved=1;noEdgeStyle=1;entryX=none;entryY=none;exitX=none;exitY=none;labelBackgroundColor=#ffffffe0;textOpacity=100;"),
aa[L].setTerminal(x,null==aa[L].getTerminal(!0)),F=0;F<aa[L].getChildCount();F++){var ja=aa[L].getChildAt(F);null!=ja.geometry&&ja.geometry.relative&&(ja.setStyle(ja.getStyle()+";labelBackgroundColor=#ffffffe0;textOpacity=100;"),ja.geometry.offset=new mxPoint(0,0),ja.geometry.y=0,ja.geometry.x=.5>ja.geometry.x?-.8:.5<ja.geometry.x?.8:0)}if(0<g.startIndex){var ca=c.createVertex(null,null,mxResources.get("previousPage")+" ("+Math.ceil((g.startIndex||0)/pageSize)+"/"+Math.ceil(I.length/pageSize)+")",
0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");ca.referenceCell=x;ca.startIndex=Math.max(0,(g.startIndex||0)-pageSize);aa.splice(0,0,ca)}if(I.length>(g.startIndex||0)+pageSize){var ba=c.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((g.startIndex||0)/pageSize)+2)+"/"+Math.ceil(I.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");ba.referenceCell=x;ba.startIndex=(g.startIndex||0)+pageSize;aa.splice(0,0,ba)}for(var oa in c.getModel().cells){var Y=
c.getModel().getCell(oa);Y!=c.rootCell&&!c.getModel().isAncestor(c.rootCell,Y)&&c.getModel().isVertex(Y)&&c.removeCells([Y])}c.addCells(aa);var da=c.getModel().getGeometry(c.rootCell);null!=da&&(da=da.clone(),da.x=m-da.width/2,da.y=n-da.height/3,c.getModel().setGeometry(c.rootCell,da));g=[];for(oa in c.getModel().cells)Y=c.getModel().getCell(oa),Y!=c.rootCell&&c.getModel().isVertex(Y)&&c.getModel().getParent(Y)==c.getDefaultParent()&&(g.push(Y),da=c.getModel().getGeometry(Y),null!=da&&(da.x=m-da.width/
2,da.y=n-da.height/2));var ha=g.length,Z=2*Math.PI/ha,k=Math.max(minSize,Math.min(c.container.offsetWidth/2-40,c.container.offsetHeight/2-80));for(m=0;m<ha;m++)da=c.getModel().getGeometry(g[m]),null!=da&&(da=da.clone(),da.x+=k*Math.sin(m*Z),da.y+=k*Math.cos(m*Z),c.getModel().setGeometry(g[m],da))}finally{c.getModel().endUpdate()}}}var H=document.createElement("div");H.style.position="absolute";H.style.display="block";H.style.overflow="auto";H.style.width="100%";H.style.height="100%";H.style.left=
"0px";H.style.top="0px";H.style.zIndex=2;H.style.background=u.background==mxConstants.NONE||null==u.background?"light-dark(#ffffff,"+Editor.darkColor+")":u.background;var S=document.createElement("img");S.setAttribute("src",Editor.closeBlackImage);S.style.position="absolute";S.style.cursor="pointer";S.style.right="10px";S.style.top="10px";H.appendChild(S);var E=document.createElement("div");E.style.position="absolute";E.style.cursor="pointer";E.style.right="38px";E.style.top="14px";E.style.textAlign=
"right";E.style.verticalAlign="top";mxUtils.write(E,mxResources.get("close"));H.appendChild(E);document.body.appendChild(H);var Q=function(c){27==c.keyCode&&S.click()};mxEvent.addListener(document,"keydown",Q);(function(c){var g=new Graph(c);g.keepEdgesInBackground=!0;g.isCellResizable=function(){return!1};g.isCellRotatable=function(){return!1};g.getCursorForCell=function(M){return this.model.isVertex(M)?"pointer":null};g.getFoldingImage=function(){return null};var m=function(){mxEvent.removeListener(document,
"keydown",Q);c.parentNode.removeChild(c);u.scrollCellToVisible(y)};mxEvent.addListener(S,"click",m);mxEvent.addListener(E,"click",m);g.setEnabled(!1);var n=g.click;g.click=function(M){var L=M.getCell(),K=null!=L?null!=L.referenceCell?L.referenceCell:L:null;null!=L&&0<g.getEdges(K).length?B(g,L):n.apply(this,arguments)};m=g.container.offsetWidth/2;var x=g.container.offsetHeight/3;g.model.beginUpdate();var F=g.importCells([y])[0];F.sourceCellId=y.id;F.geometry.x=m-F.geometry.width/2;F.geometry.y=x-
F.geometry.height/2;g.model.endUpdate();var I=!1;g.getModel().addListener(mxEvent.CHANGE,function(M,L){I||(M=L.getProperty("edit").changes,mxText.prototype.enableBoundingBox=!1,g.labelsVisible=!1,I=!0,mxEffects.animateChanges(g,M,function(){var K=new mxParallelEdgeLayout(g);K.spacing=60;var aa=K.layout;K.layout=function(ja){K.spacing=Math.min(60,Math.max(30,60-5*ja.length));aa.apply(this,arguments)};K.execute(g.getDefaultParent());mxText.prototype.enableBoundingBox=!0;g.labelsVisible=!0;g.tooltipHandler.hide();
g.refresh();q(g);I=!1}))});B(g,F)})(H)})(b,f)};Graph.removeKeys=function(b,f){for(var l in b)f(l)&&delete b[l]};Graph.setTransitionForNodes=function(b,f){for(var l=0;l<b.length;l++)mxUtils.setPrefixedStyle(b[l].style,"transition",f)};Graph.setOpacityForNodes=function(b,f){for(var l=0;l<b.length;l++)b[l].style.opacity=f};
Graph.removePasteFormatting=function(b,f){for(;null!=b;){null!=b.firstChild&&Graph.removePasteFormatting(b.firstChild,!0);var l=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 u=Graph.createTabNode(4);b.parentNode.replaceChild(u,b);b=u}if("P"==b.nodeName&&"p1"==b.className){for(;null!=b.firstChild;)b.parentNode.insertBefore(b.firstChild,b);null!=l&&"P"==l.nodeName&&"p1"==
l.className&&b.parentNode.insertBefore(b.ownerDocument.createElement("br"),b);b.parentNode.removeChild(b)}!f&&null!=b.innerHTML&&0<=b.innerHTML.indexOf("\t")&&(u=Graph.createTabNode(4),b.innerHTML=b.innerHTML.replace(/\t/g,u.outerHTML))}b=l}};Graph.createTabNode=function(b){var f="\t";if(null!=b)for(f="";0<b;)f+=" ",b--;b=document.createElement("span");b.style.whiteSpace="pre";b.appendChild(document.createTextNode(f));return b};Graph.sanitizeHtml=function(b,f){return Graph.domPurify(b,!1)};
Graph.sanitizeLink=function(b){if(null==b)return null;var f=document.createElement("a");f.setAttribute("href",b);Graph.sanitizeNode(f);return f.getAttribute("href")};Graph.sanitizeNode=function(b){return Graph.domPurify(b,!0)};DOMPurify.addHook("afterSanitizeAttributes",function(b){"use"==b.nodeName&&(null!=b.getAttribute("xlink:href")&&!b.getAttribute("xlink:href").startsWith("#")||null!=b.getAttribute("href")&&!b.getAttribute("href").startsWith("#"))&&b.remove()});
Graph.domPurify=function(b,f){window.DOM_PURIFY_CONFIG.IN_PLACE=f;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 f=document.createElement("div");f.style.position="absolute";f.style.visibility="hidden";var l=decodeURIComponent(escape(atob(b.substring(26)))),u=l.indexOf("<svg");if(0<=u){f.innerHTML=Graph.sanitizeHtml(l.substring(u));var y=f.getElementsByTagName("svg");if(0<y.length){document.body.appendChild(f);try{u=l=1;var q=y[0].getAttribute("width"),B=y[0].getAttribute("height");q=null!=q&&"%"!=q.charAt(q.length-
1)?parseFloat(q):NaN;B=null!=B&&"%"!=B.charAt(B.length-1)?parseFloat(B):NaN;var H=y[0].getAttribute("viewBox");if(null!=H&&!isNaN(q)&&!isNaN(B)){var S=H.split(" ");4<=H.length&&(l=parseFloat(S[2])/q,u=parseFloat(S[3])/B,new mxRectangle(parseFloat(S[0]),parseFloat(S[1]),parseFloat(S[2]),parseFloat(S[3])))}var E=y[0].getBBox();if(0<E.width&&0<E.height){q=0;var Q=y[0].querySelectorAll("[stroke-width]");for(B=0;B<Q.length;B++)q=Math.max(q,parseFloat(Q[B].getAttribute("stroke-width")));E=new mxRectangle(E.x,
E.y,E.width,E.height);E.grow(q/2);f.getElementsByTagName("svg")[0].setAttribute("viewBox",E.x+" "+E.y+" "+E.width+" "+E.height);f.getElementsByTagName("svg")[0].setAttribute("width",E.width/l);f.getElementsByTagName("svg")[0].setAttribute("height",E.height/u)}}catch(c){}finally{document.body.removeChild(f)}b=Editor.createSvgDataUri(mxUtils.getXml(y[0]))}}}catch(c){}return b};
Graph.createRemoveIcon=function(b,f){var l=document.createElement("img");l.setAttribute("src",Dialog.prototype.clearImage);l.setAttribute("title",b);l.setAttribute("width","13");l.setAttribute("height","10");l.style.marginLeft="4px";l.style.marginBottom="-1px";l.style.cursor="pointer";mxEvent.addListener(l,"click",f);return l};Graph.isPageLink=function(b){return null!=b&&"data:page/id,"==b.substring(0,13)};
Graph.rewritePageLinks=function(b,f){function l(y,q){var B=y.getAttribute(q);if(null!=B){Graph.isPageLink(B)&&(B="#"+B.substring(B.indexOf(":")+1));var H=q;f&&"xlink:href"==q&&(y.removeAttribute(q),H="href");y.setAttribute(H,B)}}b=b.getElementsByTagName("a");if(null!=b)for(var u=0;u<b.length;u++)l(b[u],"href"),l(b[u],"xlink:href")};Graph.isLink=function(b){return null!=b&&b.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g)};
mxUtils.extend(Graph,mxGraph);Graph.prototype.minFitScale=null;Graph.prototype.maxFitScale=null;Graph.prototype.linkPolicy="frame"==urlParams.target?"blank":urlParams.target||"auto";Graph.prototype.linkTarget="frame"==urlParams.target?"_self":"_blank";Graph.prototype.linkRelation="nofollow noopener noreferrer";Graph.prototype.defaultScrollbars=!0;Graph.prototype.defaultPageVisible=!0;Graph.prototype.defaultGridEnabled="0"!=urlParams.grid;Graph.prototype.lightbox=!1;
Graph.prototype.diagramBackgroundColor="#f0f0f0";Graph.prototype.enableDiagramBackground=!1;Graph.prototype.defaultPageBackgroundColor="1"==urlParams.embedInline?"transparent":"light-dark(#ffffff, "+Editor.darkColor+")";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"];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(l,u){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var y=l.view.graph.tolerance,q=!0,B=null,H=mxUtils.bind(this,function(Q){q=!0;B=new mxPoint(mxEvent.getClientX(Q),mxEvent.getClientY(Q))}),S=mxUtils.bind(this,function(Q){q=q&&null!=B&&Math.abs(B.x-mxEvent.getClientX(Q))<y&&Math.abs(B.y-mxEvent.getClientY(Q))<y}),E=mxUtils.bind(this,function(Q){if(q)for(var c=mxEvent.getSource(Q);null!=
c&&c!=u.node;){if("a"==c.nodeName.toLowerCase()){l.view.graph.labelLinkClicked(l,c,Q);break}c=c.parentNode}});mxEvent.addGestureListeners(u.node,H,S,E);mxEvent.addListener(u.node,"click",function(Q){mxEvent.consume(Q)})};if(null!=this.tooltipHandler){var f=this.tooltipHandler.init;this.tooltipHandler.init=function(){f.apply(this,arguments);null!=this.div&&mxEvent.addListener(this.div,"click",mxUtils.bind(this,function(l){var u=mxEvent.getSource(l);"A"==u.nodeName&&(u=u.getAttribute("href"),null!=
u&&this.graph.isCustomLink(u)&&(mxEvent.isTouchEvent(l)||!mxEvent.isPopupTrigger(l))&&this.graph.customLinkClicked(u)&&mxEvent.consume(l))}))}}this.initLayoutManager()};
(function(){Graph.prototype.useCssTransforms=!1;Graph.prototype.currentScale=1;Graph.prototype.currentTranslate=new mxPoint(0,0);Graph.prototype.pasteEdgeStyle=!1;Graph.prototype.isFillState=function(B){var H=mxUtils.getValue(B.style,mxConstants.STYLE_SHAPE,null);return!this.isSpecialColor(B.style[mxConstants.STYLE_FILLCOLOR])&&"1"!=mxUtils.getValue(B.style,"lineShape",null)&&(this.model.isVertex(B.cell)||"arrow"==H||"pipe"==H||"wire"==H||"filledEdge"==H||"flexArrow"==H||"mxgraph.arrows2.wedgeArrow"==
H)};Graph.prototype.isGradientState=function(B){var H=mxUtils.getValue(B.style,mxConstants.STYLE_SHAPE,null);return this.isFillState(B)&&"wire"!=H&&"pipe"!=H};Graph.prototype.isStrokeState=function(B){return!0};Graph.prototype.getTextColor=function(B,H){for(var S=H?"color":"background-color",E=B==this.cellEditor.textarea&&H?"default":Graph.getGivenColor(B,S);null==E&&null!=B&&B!=this.cellEditor.textarea.parentNode;)E=B==this.cellEditor.textarea&&H?"default":Graph.getGivenColor(B,S),B=B.parentNode;
if("rgba(0, 0, 0, 0)"==E||"transparent"==E)E=mxConstants.NONE;return E};Graph.prototype.isSpecialColor=function(B){return 0<=mxUtils.indexOf([mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_FILLCOLOR,"inherit","swimlane","indicated"],B)};Graph.prototype.isGlassState=function(B){B=mxUtils.getValue(B.style,mxConstants.STYLE_SHAPE,null);return"label"==B||"rectangle"==B||"internalStorage"==B||"ext"==B||"umlLifeline"==B||"swimlane"==B||"process"==B};Graph.prototype.isRoundedState=function(B){return null!=
B.shape?B.shape.isRoundable():0<=mxUtils.indexOf(this.roundableShapes,mxUtils.getValue(B.style,mxConstants.STYLE_SHAPE,null))};Graph.prototype.isLineJumpState=function(B){var H=mxUtils.getValue(B.style,mxConstants.STYLE_SHAPE,null);return!mxUtils.getValue(B.style,mxConstants.STYLE_CURVED,!1)&&("connector"==H||"filledEdge"==H||"wire"==H)};Graph.prototype.isAutoSizeState=function(B){return"1"==mxUtils.getValue(B.style,mxConstants.STYLE_AUTOSIZE,null)};Graph.prototype.isImageState=function(B){return null!=
mxUtils.getValue(B.style,mxConstants.STYLE_IMAGE,null)};Graph.prototype.isShadowState=function(B){return!0};Graph.prototype.getVerticesAndEdges=function(B,H){B=null!=B?B:!0;H=null!=H?H:!0;var S=this.model;return S.filterDescendants(function(E){return B&&S.isVertex(E)||H&&S.isEdge(E)},S.getRoot())};Graph.prototype.applyNewEdgeStyle=function(B,H,S){B=this.getCellStyle(B).newEdgeStyle;if(null!=B){this.model.beginUpdate();try{var E=JSON.parse(B),Q;for(Q in E)this.setCellStyles(Q,E[Q],H),"edgeStyle"==
Q&&"elbowEdgeStyle"==E[Q]&&null!=S&&this.setCellStyles("elbow",S==mxConstants.DIRECTION_SOUTH||S==mxConstants.DIRECTION_NOTH?"vertical":"horizontal",H)}finally{this.model.endUpdate()}}};Graph.prototype.getCommonStyle=function(B){for(var H={},S=0;S<B.length;S++){var E=this.view.getState(B[S]);null!=E&&this.mergeStyle(E.style,H,0==S)}return H};Graph.prototype.mergeStyle=function(B,H,S){if(null!=B){var E={},Q;for(Q in B){var c=B[Q];null!=c&&(E[Q]=!0,null==H[Q]&&S?H[Q]=c:H[Q]!=c&&delete H[Q])}for(Q in H)E[Q]||
delete H[Q]}};Graph.prototype.getStartEditingCell=function(B,H){H=this.getCellStyle(B);H=parseInt(mxUtils.getValue(H,mxConstants.STYLE_STARTSIZE,0));this.isTable(B)&&(!this.isSwimlane(B)||0==H)&&""==this.getLabel(B)&&0<this.model.getChildCount(B)&&(B=this.model.getChildAt(B,0),H=this.getCellStyle(B),H=parseInt(mxUtils.getValue(H,mxConstants.STYLE_STARTSIZE,0)));if(this.isTableRow(B)&&(!this.isSwimlane(B)||0==H)&&""==this.getLabel(B)&&0<this.model.getChildCount(B))for(H=0;H<this.model.getChildCount(B);H++){var S=
this.model.getChildAt(B,H);if(this.isCellEditable(S)){B=S;break}}return B};Graph.prototype.copyStyle=function(B){return this.getCellStyle(B,!1)};Graph.prototype.pasteStyle=function(B,H,S,E){null!=B&&(E||(S=null!=S?S:Graph.cellStyles,Graph.removeKeys(B,function(Q){return 0>mxUtils.indexOf(S,Q)})),this.updateCellStyles(B,H))};Graph.prototype.copyCellStyles=function(B,H,S,E,Q,c,g){var m=!1,n=!1;if(0<B.length)for(var x=0;x<B.length&&(m=this.getModel().isVertex(B[x])||m,!(n=this.getModel().isEdge(B[x])||
n)||!m);x++);else n=m=!0;m=m&&!c;n=n&&!g;for(x=0;x<H.length;x++)if(B=0<=mxUtils.indexOf(Graph.textStyles,H[x]),"strokeColor"!=H[x]||null!=S[x]&&"none"!=S[x])if(0<=mxUtils.indexOf(Graph.cellStyles,H[x])||"shape"==H[x])if("shape"!=H[x]&&(m||B)&&(null==S[x]?delete E[H[x]]:E[H[x]]=S[x]),n||B)null==S[x]?delete Q[H[x]]:Q[H[x]]=S[x]};Graph.prototype.includeDescendants=function(B){for(var H=[],S=0;S<B.length;S++)H=H.concat(this.model.getDescendants(B[S]));return H};Graph.prototype.pasteCellStyles=function(B,
H,S,E,Q){H=null!=H?H:this.currentVertexStyle;S=null!=S?S:this.currentEdgeStyle;Q=null!=Q?Q:this.pasteEdgeStyle;this.model.beginUpdate();try{for(var c=0;c<B.length;c++){var g=B[c],m=this.model.getStyle(g),n=!1;null!=g.style&&(pairs=g.style.split(";"),n=n||0<=mxUtils.indexOf(pairs,"text"));if(n)var x=Graph.textStyles;else if(x=Graph.cellStyles.slice(),!E)for(var F=null!=m?m.split(";"):[],I=0;I<F.length;I++){var M=F[I],L=M.indexOf("=");if(0<=L){var K=M.substring(0,L),aa=mxUtils.indexOf(x,K);0<=aa&&x.splice(aa,
1);for(n=0;n<Graph.cellStyleGroups.length;n++){var ja=Graph.cellStyleGroups[n];if(0<=mxUtils.indexOf(ja,K))for(var ca=0;ca<ja.length;ca++){var ba=mxUtils.indexOf(x,ja[ca]);0<=ba&&x.splice(ba,1)}}}}var oa=this.model.isEdge(g);n=oa?S:H;for(I=0;I<x.length;I++){K=x[I];var Y=n[K];null!=Y&&("edgeStyle"!=K||Q)&&(oa||!oa&&0>mxUtils.indexOf(Graph.edgeStyles,K))&&(m=mxUtils.setStyle(m,K,Y),"fontFamily"==K&&null==n.fontSource&&(m=mxUtils.setStyle(m,"fontSource",null)),oa&&"rounded"==K&&"1"==Y&&null==n.curved&&
(m=mxUtils.setStyle(m,"curved",null)))}Editor.simpleLabels&&(m=mxUtils.setStyle(mxUtils.setStyle(m,"html",null),"whiteSpace",null));this.model.setStyle(g,m)}}finally{this.model.endUpdate()}return B};Graph.prototype.updateCellStyles=function(B,H){this.model.beginUpdate();try{for(var S=0;S<H.length;S++)if(this.model.isVertex(H[S])||this.model.isEdge(H[S])){var E=this.getCellStyle(H[S],!1),Q=E[mxConstants.STYLE_PERIMETER],c=!1;for(m in B){var g=B[m];if(E[m]!=g){if(m==mxConstants.STYLE_SHAPE&&"umlLifeline"==
E[m]&&"umlLifeline"!=g){c=!0;var m="participant"}this.setCellStyles(m,g,[H[S]])}}c&&this.setCellStyles(mxConstants.STYLE_PERIMETER,Q,[H[S]])}}finally{this.model.endUpdate()}};Graph.prototype.isFastZoomEnabled=function(){return"nocss"!=urlParams.zoom&&!mxClient.NO_FO&&!mxClient.IS_EDGE&&!this.useCssTransforms&&(this.isCssTransformsSupported()||mxClient.IS_IOS)};Graph.prototype.isCssTransformsSupported=function(){return this.dialect==mxConstants.DIALECT_SVG&&!mxClient.NO_FO&&(!this.lightbox||!mxClient.IS_SF)};
Graph.prototype.getCellAt=function(B,H,S,E,Q,c){this.useCssTransforms&&(B=B/this.currentScale-this.currentTranslate.x,H=H/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(B,H,S,E,Q,c){E=null!=E?E:!0;Q=null!=Q?Q:!0;null==S&&(S=this.getCurrentRoot(),null==S&&(S=this.getModel().getRoot()));if(null!=S)for(var g=this.model.getChildCount(S)-1;0<=g;g--){var m=this.model.getChildAt(S,g),n=this.getScaledCellAt(B,H,m,E,Q,
c);if(null!=n)return n;if(this.isCellVisible(m)&&(Q&&this.model.isEdge(m)||E&&this.model.isVertex(m))&&(n=this.view.getState(m),null!=n&&(null==c||!c(n,B,H))&&this.intersects(n,B,H)))return m}return null};Graph.prototype.isRecursiveVertexResize=function(B){return!this.isSwimlane(B.cell)&&0<this.model.getChildCount(B.cell)&&!this.isCellCollapsed(B.cell)&&"1"==mxUtils.getValue(B.style,"recursiveResize","1")&&null==mxUtils.getValue(B.style,"childLayout",null)};Graph.prototype.getAbsoluteParent=function(B){for(var H=
this.getCellGeometry(B);null!=H&&H.relative;)B=this.getModel().getParent(B),H=this.getCellGeometry(B);return B};Graph.prototype.isPart=function(B){return"1"==mxUtils.getValue(this.getCurrentCellStyle(B),"part","0")||this.isTableCell(B)||this.isTableRow(B)};Graph.prototype.getCompositeParents=function(B){for(var H=new mxDictionary,S=[],E=0;E<B.length;E++){var Q=this.getCompositeParent(B[E]);this.isTableCell(Q)&&(Q=this.graph.model.getParent(Q));this.isTableRow(Q)&&(Q=this.graph.model.getParent(Q));
null==Q||H.get(Q)||(H.put(Q,!0),S.push(Q))}return S};Graph.prototype.getReferenceTerminal=function(B){if(null!=B){var H=this.getCellGeometry(B);null!=H&&H.relative&&(B=this.model.getParent(B))}null!=B&&this.model.isEdge(B)&&(B=this.model.getParent(B));null!=B&&(B=this.getCompositeParent(B));return B};Graph.prototype.getCompositeParent=function(B){for(;this.isPart(B);){var H=this.model.getParent(B);if(!this.model.isVertex(H))break;B=H}return B};Graph.prototype.filterSelectionCells=function(B){var H=
this.getSelectionCells();if(null!=B){for(var S=[],E=0;E<H.length;E++)B(H[E])||S.push(H[E]);H=S}return H};var b=mxGraph.prototype.scrollRectToVisible;Graph.prototype.scrollRectToVisible=function(B){if(this.useCssTransforms){var H=this.currentScale,S=this.currentTranslate;B=new mxRectangle((B.x+2*S.x)*H-S.x,(B.y+2*S.y)*H-S.y,B.width*H,B.height*H)}b.apply(this,arguments)};mxCellHighlight.prototype.getStrokeWidth=function(B){B=this.strokeWidth;this.graph.useCssTransforms&&(B/=this.graph.currentScale);
return B};mxGraphView.prototype.getGraphBounds=function(){var B=this.graphBounds;if(this.graph.useCssTransforms){var H=this.graph.currentTranslate,S=this.graph.currentScale;B=new mxRectangle((B.x+H.x)*S,(B.y+H.y)*S,B.width*S,B.height*S)}return B};mxGraphView.prototype.viewStateChanged=function(){this.graph.useCssTransforms?this.validate():this.revalidate();this.graph.sizeDidChange()};var f=mxGraphView.prototype.validate;mxGraphView.prototype.validate=function(B){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);f.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 l=mxGraph.prototype.getCellsForGroup;Graph.prototype.getCellsForGroup=function(B){B=l.apply(this,arguments);for(var H=[],S=
0;S<B.length;S++)this.isTableRow(B[S])||this.isTableCell(B[S])||H.push(B[S]);return H};var u=mxGraph.prototype.getCellsForUngroup;Graph.prototype.getCellsForUngroup=function(B){B=u.apply(this,arguments);for(var H=[],S=0;S<B.length;S++)this.isTable(B[S])||this.isTableRow(B[S])||this.isTableCell(B[S])||H.push(B[S]);return H};Graph.prototype.updateCssTransform=function(){var B=this.view.getDrawPane();if(null!=B)if(B=B.parentNode,this.useCssTransforms){var H=B.getAttribute("transform");B.setAttribute("transformOrigin",
"0 0");var S=Math.round(100*this.currentScale)/100;B.setAttribute("transform","scale("+S+","+S+")translate("+Math.round(100*this.currentTranslate.x)/100+","+Math.round(100*this.currentTranslate.y)/100+")");H!=B.getAttribute("transform")&&this.fireEvent(new mxEventObject("cssTransformChanged"),"transform",B.getAttribute("transform"))}else B.removeAttribute("transformOrigin"),B.removeAttribute("transform")};var y=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=
function(){var B=this.graph.useCssTransforms,H=this.scale,S=this.translate;B&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate);y.apply(this,arguments);B&&(this.scale=H,this.translate=S)};var q=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(B,H,S){var E=this.useCssTransforms,Q=this.view.scale,c=this.view.translate;E&&(this.view.scale=1,this.view.translate=new mxPoint(0,0),this.useCssTransforms=!1);q.apply(this,arguments);E&&(this.view.scale=
Q,this.view.translate=c,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.isViewer=function(){return!1};
Graph.prototype.labelLinkClicked=function(b,f,l){var u=f.getAttribute("href");u!=Graph.sanitizeLink(u)&&Graph.sanitizeNode(f);if(null!=u&&!this.isCustomLink(u)&&(mxEvent.isLeftMouseButton(l)&&!mxEvent.isPopupTrigger(l)||mxEvent.isTouchEvent(l))){if(!this.isEnabled()||this.isCellLocked(b.cell))b=this.isBlankLink(u)?this.linkTarget:"_top",this.openLink(this.getAbsoluteUrl(u),b);mxEvent.consume(l)}};
Graph.prototype.openLink=function(b,f,l){var u=window;try{if(b=Graph.sanitizeLink(b),null!=b)if("_self"==f&&window!=window.top)window.location.href=b;else if(b.substring(0,this.baseUrl.length)!=this.baseUrl||"#"!=b.charAt(this.baseUrl.length)||"_top"!=f||window!=window.top||navigator.standalone)u=window.open(b,null!=f?f:"_blank",l?null:"noopener,noreferrer"),null==u||l||(u.opener=null);else{var y=b.split("#")[1];window.location.hash=="#"+y&&(window.location.hash="");window.location.hash=y}}catch(q){}return u};
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,f){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,f){var l=this.graph.model.getParent(b);if(!this.graph.isCellCollapsed(b)&&(f!=mxEvent.BEGIN_UPDATE||this.hasLayout(l,f))){b=this.graph.getCellStyle(b);if("stackLayout"==b.childLayout)return f=new mxStackLayout(this.graph,!0),f.resizeParentMax="1"==mxUtils.getValue(b,"resizeParentMax",
"1"),f.horizontal="1"==mxUtils.getValue(b,"horizontalStack","1"),f.resizeParent="1"==mxUtils.getValue(b,"resizeParent","1"),f.resizeLast="1"==mxUtils.getValue(b,"resizeLast","0"),f.spacing=b.stackSpacing||f.spacing,f.border=b.stackBorder||f.border,f.marginLeft=b.marginLeft||0,f.marginRight=b.marginRight||0,f.marginTop=b.marginTop||0,f.marginBottom=b.marginBottom||0,f.allowGaps=b.allowGaps||0,f.fill=!0,f.allowGaps&&(f.gridSize=parseFloat(mxUtils.getValue(b,"stackUnitSize",20))),f;if("treeLayout"==
b.childLayout)return f=new mxCompactTreeLayout(this.graph),f.horizontal="1"==mxUtils.getValue(b,"horizontalTree","1"),f.resizeParent="1"==mxUtils.getValue(b,"resizeParent","1"),f.sortEdges="1"==mxUtils.getValue(b,"sortEdges","0"),f.groupPadding=mxUtils.getValue(b,"parentPadding",20),f.levelDistance=mxUtils.getValue(b,"treeLevelDistance",30),f.maintainParentLocation=!0,f.edgeRouting=!1,f.resetEdges=!1,f;if("flowLayout"==b.childLayout)return f=new mxHierarchicalLayout(this.graph,mxUtils.getValue(b,
"flowOrientation",mxConstants.DIRECTION_EAST)),f.resizeParent="1"==mxUtils.getValue(b,"resizeParent","1"),f.parentBorder=mxUtils.getValue(b,"parentPadding",20),f.maintainParentLocation=!0,f.intraCellSpacing=mxUtils.getValue(b,"intraCellSpacing",mxHierarchicalLayout.prototype.intraCellSpacing),f.interRankCellSpacing=mxUtils.getValue(b,"interRankCellSpacing",mxHierarchicalLayout.prototype.interRankCellSpacing),f.interHierarchySpacing=mxUtils.getValue(b,"interHierarchySpacing",mxHierarchicalLayout.prototype.interHierarchySpacing),
f.parallelEdgeSpacing=mxUtils.getValue(b,"parallelEdgeSpacing",mxHierarchicalLayout.prototype.parallelEdgeSpacing),f;if("circleLayout"==b.childLayout)return new mxCircleLayout(this.graph);if("organicLayout"==b.childLayout)return new mxFastOrganicLayout(this.graph);if("tableLayout"==b.childLayout)return new TableLayout(this.graph);if(null!=b.childLayout&&"["==String(b.childLayout).charAt(0))try{return new mxCompositeLayout(this.graph,this.graph.createLayouts(JSON.parse(b.childLayout)))}catch(u){null!=
window.console&&console.error(u)}}return null}};
Graph.prototype.createLayouts=function(b){for(var f=[],l=0;l<b.length;l++)if(0<=mxUtils.indexOf(Graph.layoutNames,b[l].layout)){var u="mxOrgChartLayout"==b[l].layout&&null!=b[l].config?new window[b[l].layout](this,b[l].config.branchOptimizer):new window[b[l].layout](this);if(null!=b[l].config)for(var y in b[l].config)if("mxOrgChartLayout"!=b[l].layout||"branchOptimizer"!=y)u[y]=b[l].config[y];f.push(u)}else throw Error(mxResources.get("invalidCallFnNotFound",[b[l].layout]));return f};
Graph.prototype.getDataForCells=function(b,f){for(var l=[],u=0;u<b.length;u++){var y={};y.id=b[u].id;var q=null!=b[u].value?b[u].value.attributes:null;this.isReplacePlaceholders(b[u])&&f&&(y.value=this.getLabel(b[u]));if(null!=q)for(var B=0;B<q.length;B++)y[q[B].nodeName]=q[B].nodeValue;else y.label=this.convertValueToString(b[u]);l.push(y)}return l};
Graph.prototype.getNodesForCells=function(b){for(var f=[],l=0;l<b.length;l++){var u=this.view.getState(b[l]);if(null!=u){for(var y=this.cellRenderer.getShapesForState(u),q=0;q<y.length;q++)null!=y[q]&&null!=y[q].node&&f.push(y[q].node);null!=u.control&&null!=u.control.node&&f.push(u.control.node)}}return f};
Graph.prototype.createWipeAnimations=function(b,f){for(var l=[],u=0;u<b.length;u++){var y=this.view.getState(b[u]);null!=y&&null!=y.shape&&(this.model.isEdge(y.cell)&&null!=y.absolutePoints&&1<y.absolutePoints.length?l.push(this.createEdgeWipeAnimation(y,f)):this.model.isVertex(y.cell)&&null!=y.shape.bounds&&l.push(this.createVertexWipeAnimation(y,f)))}return l};
Graph.prototype.createEdgeWipeAnimation=function(b,f){var l=b.absolutePoints.slice(),u=b.segments,y=b.length,q=l.length;return{execute:mxUtils.bind(this,function(B,H){if(null!=b.shape){var S=[l[0]];H=B/H;f||(H=1-H);for(var E=y*H,Q=1;Q<q;Q++)if(E<=u[Q-1]){S.push(new mxPoint(l[Q-1].x+(l[Q].x-l[Q-1].x)*E/u[Q-1],l[Q-1].y+(l[Q].y-l[Q-1].y)*E/u[Q-1]));break}else E-=u[Q-1],S.push(l[Q]);b.shape.points=S;b.shape.redraw();0==B&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1);null!=b.text&&null!=
b.text.node&&(b.text.node.style.opacity=H)}}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.points=l,b.shape.redraw(),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),f?1:0))})}};
Graph.prototype.createVertexWipeAnimation=function(b,f){var l=new mxRectangle.fromRectangle(b.shape.bounds);return{execute:mxUtils.bind(this,function(u,y){null!=b.shape&&(y=u/y,f||(y=1-y),b.shape.bounds=new mxRectangle(l.x,l.y,l.width*y,l.height),b.shape.redraw(),0==u&&Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),1),null!=b.text&&null!=b.text.node&&(b.text.node.style.opacity=y))}),stop:mxUtils.bind(this,function(){null!=b.shape&&(b.shape.bounds=l,b.shape.redraw(),null!=b.text&&null!=b.text.node&&
(b.text.node.style.opacity=""),Graph.setOpacityForNodes(this.getNodesForCells([b.cell]),f?1:0))})}};Graph.prototype.executeAnimations=function(b,f,l,u){l=null!=l?l:30;u=null!=u?u:30;var y=null,q=0,B=mxUtils.bind(this,function(){if(q==l||this.stoppingCustomActions){window.clearInterval(y);for(var H=0;H<b.length;H++)b[H].stop();null!=f&&f()}else for(H=0;H<b.length;H++)b[H].execute(q,l);q++});y=window.setInterval(B,u);B()};
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,f,l){b=null!=b?b:this.getGraphBounds();f=null!=f?f:this.view.translate;l=null!=l?l:this.view.scale;var u=this.getPageSize();if(0==b.width||0==b.height)return new mxRectangle(0,0,1,1);var y=Math.floor(Math.ceil(b.x/l-f.x)/u.width),q=Math.floor(Math.ceil(b.y/l-f.y)/u.height);return new mxRectangle(y,q,Math.ceil((Math.floor((b.x+b.width)/l)-f.x)/u.width)-y,Math.ceil((Math.floor((b.y+b.height)/l)-f.y)/u.height)-q)};
Graph.prototype.getDefaultTranslate=function(b){var f=this.getPagePadding(),l=this.getPageSize();return new mxPoint(f.x-b.x*l.width,f.y-b.y*l.height)};Graph.prototype.updateMinimumSize=function(){var b=this.getPageLayout(),f=this.getPagePadding(),l=this.getPageSize(),u=Math.ceil(2*f.x+b.width*l.width);b=Math.ceil(2*f.y+b.height*l.height);if(null==this.minimumGraphSize||this.minimumGraphSize.width!=u||this.minimumGraphSize.height!=b)this.minimumGraphSize=new mxRectangle(0,0,u,b)};
Graph.prototype.sanitizeHtml=function(b,f){return Graph.sanitizeHtml(b,f)};Graph.prototype.updatePlaceholders=function(){var b=!1,f;for(f in this.model.cells){var l=this.model.cells[f];this.isReplacePlaceholders(l)&&(this.view.invalidate(l,!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 f=!1;null!=b&&(b=this.getCurrentCellStyle(b),f="1"==mxUtils.getValue(b,"ignoreEdge","0"));return f};
Graph.prototype.isSplitTarget=function(b,f,l){return!this.model.isEdge(f[0])&&!mxEvent.isAltDown(l)&&!mxEvent.isShiftDown(l)&&!this.isCellLocked(this.getLayerForCell(b))&&mxGraph.prototype.isSplitTarget.apply(this,arguments)};Graph.prototype.getLabel=function(b){var f=mxGraph.prototype.getLabel.apply(this,arguments);null!=f&&this.isReplacePlaceholders(b)&&null==b.getAttribute("placeholder")&&(f=this.replacePlaceholders(b,f));return f};
Graph.prototype.isLabelMovable=function(b){var f=this.getCurrentCellStyle(b);return!this.isCellLocked(b)&&(this.model.isEdge(b)&&this.edgeLabelsMovable||this.model.isVertex(b)&&(this.vertexLabelsMovable||"1"==mxUtils.getValue(f,"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 f=this.getLinkForCell(b);if(null!=f)return f;b=this.model.getParent(b)}while(null!=b);return null};Graph.prototype.getGlobalVariable=function(b){var f=null;"date"==b?f=(new Date).toLocaleDateString():"time"==b?f=(new Date).toLocaleTimeString():"timestamp"==b?f=(new Date).toLocaleString():"date{"==b.substring(0,5)&&(b=b.substring(5,b.length-1),f=this.formatDate(new Date,b));return f};
Graph.prototype.formatDate=function(b,f,l){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 u=this.dateFormatCache,y=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,q=/[^-+\dA-Z]/g,B=function(I,M){I=String(I);for(M=M||2;I.length<M;)I="0"+I;return I};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(b)||
/\d/.test(b)||(f=b,b=void 0);b=b?new Date(b):new Date;if(isNaN(b))throw SyntaxError("invalid date");f=String(u.masks[f]||f||u.masks["default"]);"UTC:"==f.slice(0,4)&&(f=f.slice(4),l=!0);var H=l?"getUTC":"get",S=b[H+"Date"](),E=b[H+"Day"](),Q=b[H+"Month"](),c=b[H+"FullYear"](),g=b[H+"Hours"](),m=b[H+"Minutes"](),n=b[H+"Seconds"]();H=b[H+"Milliseconds"]();var x=l?0:b.getTimezoneOffset(),F={d:S,dd:B(S),ddd:u.i18n.dayNames[E],dddd:u.i18n.dayNames[E+7],m:Q+1,mm:B(Q+1),mmm:u.i18n.monthNames[Q],mmmm:u.i18n.monthNames[Q+
12],yy:String(c).slice(2),yyyy:c,h:g%12||12,hh:B(g%12||12),H:g,HH:B(g),M:m,MM:B(m),s:n,ss:B(n),l:B(H,3),L:B(99<H?Math.round(H/10):H),t:12>g?"a":"p",tt:12>g?"am":"pm",T:12>g?"A":"P",TT:12>g?"AM":"PM",Z:l?"UTC":(String(b).match(y)||[""]).pop().replace(q,""),o:(0<x?"-":"+")+B(100*Math.floor(Math.abs(x)/60)+Math.abs(x)%60,4),S:["th","st","nd","rd"][3<S%10?0:(10!=S%100-S%10)*S%10]};return f.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(I){return I in F?F[I]:I.slice(1,
I.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 f=null;if(0<b.length){f=this.getLayerForCell(b[0]);for(var l=1;l<b.length;l++)if(!this.model.isAncestor(f,b[l])){f=null;break}}return f};
Graph.prototype.createLayersDialog=function(b,f){var l=document.createElement("div");l.style.position="absolute";for(var u=this.getModel(),y=u.getChildCount(u.root),q=0;q<y;q++)mxUtils.bind(this,function(B){function H(){u.isVisible(B)?(Q.setAttribute("src",Editor.visibleImage),mxUtils.setOpacity(E,75)):(Q.setAttribute("src",Editor.hiddenImage),mxUtils.setOpacity(E,25))}var S=this.convertValueToString(B)||mxResources.get("background")||"Background",E=document.createElement("div");E.style.overflow=
"hidden";E.style.textOverflow="ellipsis";E.style.padding="2px";E.style.whiteSpace="nowrap";E.style.cursor="pointer";E.setAttribute("title",mxResources.get(u.isVisible(B)?"hideIt":"show",[S]));var Q=document.createElement("img");Q.setAttribute("draggable","false");Q.setAttribute("align","absmiddle");Q.setAttribute("border","0");Q.style.position="relative";Q.style.width="16px";Q.style.padding="0px 6px 0 4px";f&&(Q.style.filter="invert(100%)",Q.style.top="-2px");E.appendChild(Q);mxUtils.write(E,S);l.appendChild(E);
mxEvent.addListener(E,"click",function(){u.setVisible(B,!u.isVisible(B));H();null!=b&&b(B)});H()})(u.getChildAt(u.root,q));return l};
Graph.prototype.replacePlaceholders=function(b,f,l,u){u=[];if(null!=f){for(var y=0;match=this.placeholderPattern.exec(f);){var q=match[0];if(2<q.length&&"%label%"!=q&&"%tooltip%"!=q){var B=null;if(match.index>y&&"%"==f.charAt(match.index-1))B=q.substring(1);else{var H=q.substring(1,q.length-1),S={mm:mxConstants.MILLIMETERS,"in":mxConstants.INCHES,m:mxConstants.METERS,current:this.view.unit};if("id"==H)B=b.id;else if("width"===H.substring(0,5)&&this.model.isVertex(b)){var E=this.getCellGeometry(b);
null!=E&&(B=E.width,5<H.length&&(B=Editor.toUnit(B,S[H.substring(6)])))}else if("height"==H.substring(0,6)&&this.model.isVertex(b))E=this.getCellGeometry(b),null!=E&&(B=E.height,6<H.length&&(B=Editor.toUnit(B,S[H.substring(7)])));else if("length"==H.substring(0,6)){for(E=b;null!=E&&!this.model.isEdge(E);)E=this.model.getParent(E);E=this.view.getState(E);null!=E&&(B=Math.round(E.length/this.view.scale),6<H.length&&(B=Editor.toUnit(B,S[H.substring(7)])))}else if(0>H.indexOf("{"))for(S=b;null==B&&null!=
S;)null!=S.value&&"object"==typeof S.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(B=S.getAttribute(H+"_"+Graph.diagramLanguage)),null==B&&(B=S.hasAttribute(H)?null!=S.getAttribute(H)?S.getAttribute(H):"":null)),S=this.model.getParent(S);null==B&&(B=this.getGlobalVariable(H));null==B&&null!=l&&(B=l[H])}u.push(f.substring(y,match.index)+(null!=B?B:q));y=match.index+q.length}}u.push(f.substring(y))}return u.join("")};
Graph.prototype.restoreSelection=function(b){if(null!=b&&0<b.length){for(var f=[],l=0;l<b.length;l++){var u=this.model.getCell(b[l].id);null!=u&&f.push(u)}this.setSelectionCells(f)}else this.clearSelection()};Graph.prototype.selectCellForEvent=function(b,f){mxEvent.isShiftDown(f)&&!this.isSelectionEmpty()&&this.selectTableRange(this.getSelectionCell(),b)||mxGraph.prototype.selectCellForEvent.apply(this,arguments)};
Graph.prototype.selectTableRange=function(b,f){var l=!1;if(this.isTableCell(b)&&this.isTableCell(f)){var u=this.model.getParent(b),y=this.model.getParent(u),q=this.model.getParent(f);if(y==this.model.getParent(q)){b=u.getIndex(b);u=y.getIndex(u);var B=q.getIndex(f),H=y.getIndex(q);q=Math.max(u,H);f=Math.min(b,B);b=Math.max(b,B);B=[];for(u=Math.min(u,H);u<=q;u++){H=this.model.getChildAt(y,u);for(var S=f;S<=b;S++)B.push(this.model.getChildAt(H,S))}0<B.length&&(1<B.length||1<this.getSelectionCount()||
!this.isCellSelected(B[0]))&&(this.setSelectionCells(B),l=!0)}}return l};
Graph.prototype.snapCellsToGrid=function(b,f){this.getModel().beginUpdate();try{for(var l=0;l<b.length;l++){var u=b[l],y=this.getCellGeometry(u);if(null!=y){y=y.clone();if(this.getModel().isVertex(u))y.x=Math.round(y.x/f)*f,y.y=Math.round(y.y/f)*f,y.width=Math.round(y.width/f)*f,y.height=Math.round(y.height/f)*f;else if(this.getModel().isEdge(u)&&null!=y.points)for(var q=0;q<y.points.length;q++)y.points[q].x=Math.round(y.points[q].x/f)*f,y.points[q].y=Math.round(y.points[q].y/f)*f;this.getModel().setGeometry(u,
y)}}}finally{this.getModel().endUpdate()}};Graph.prototype.removeChildCells=function(b){this.model.beginUpdate();try{for(var f=this.model.getChildCount(b);0<=f;f--)this.model.remove(this.model.getChildAt(b,f))}finally{this.model.endUpdate()}};
Graph.prototype.updateShapes=function(b,f,l){this.model.beginUpdate();try{var u=this.model.getStyle(b),y=l?this.stylesheet.getCellStyle(u,{},!1):null;null!=y&&null==y[mxConstants.STYLE_SHAPE]&&(this.model.isVertex(b)?y[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultVertexStyle()[mxConstants.STYLE_SHAPE]:this.model.isEdge(b)&&(y[mxConstants.STYLE_SHAPE]=this.stylesheet.getDefaultEdgeStyle()[mxConstants.STYLE_SHAPE]));for(var q=0;q<f.length;q++){if(this.model.isVertex(b)&&this.model.isVertex(f[q])||
this.model.isEdge(b)&&this.model.isEdge(f[q]))if(l){var B=this.model.getStyle(f[q]);if(null!=B){var H=B.split(";");0<H.length&&0>H[0].indexOf("=")&&(H=H.slice(1));this.model.setStyle(f[q],H.join(";"))}this.setCellStyles(mxConstants.STYLE_PERIMETER,null,[f[q]]);this.setCellStyles("points",null,[f[q]]);this.pasteStyle(y,[f[q]],null,!0)}else y=this.copyStyle(f[q]),this.model.setStyle(f[q],u),this.pasteStyle(y,[f[q]]);"1"==mxUtils.getValue(this.getCellStyle(f[q],!1),"composite","0")&&this.removeChildCells(f[q])}}finally{this.model.endUpdate()}};
Graph.prototype.selectCellsForConnectVertex=function(b,f,l){2==b.length&&this.model.isVertex(b[1])?(this.setSelectionCell(b[1]),this.scrollCellToVisible(b[1]),null!=l&&(mxEvent.isTouchEvent(f)?l.update(l.getState(this.view.getState(b[1]))):l.reset())):this.setSelectionCells(b)};Graph.prototype.isCloneConnectSource=function(b){var f=null;null!=this.layoutManager&&(f=this.layoutManager.getLayout(this.model.getParent(b)));return this.isTableRow(b)||this.isTableCell(b)||null!=f&&f.constructor==mxStackLayout};
Graph.prototype.insertEdgeBeforeCell=function(b,f){for(var l=f;null!=l.parent&&null!=l.geometry&&l.geometry.relative&&l.parent!=b.parent;)l=this.model.getParent(l);null!=l&&null!=l.parent&&l.parent==b.parent&&(f=l.parent.getIndex(l),this.model.add(l.parent,b,f))};
Graph.prototype.connectVertex=function(b,f,l,u,y,q,B,H){q=q?q:!1;if(b.geometry.relative&&this.model.isEdge(b.parent))return[];for(;b.geometry.relative&&this.model.isVertex(b.parent);)b=b.parent;var S=this.isCloneConnectSource(b),E=S?b:this.getCompositeParent(b),Q=b.geometry.relative&&null!=b.parent.geometry?new mxPoint(b.parent.geometry.width*b.geometry.x,b.parent.geometry.height*b.geometry.y):new mxPoint(E.geometry.x,E.geometry.y);f==mxConstants.DIRECTION_NORTH?(Q.x+=E.geometry.width/2,Q.y-=l):f==
mxConstants.DIRECTION_SOUTH?(Q.x+=E.geometry.width/2,Q.y+=E.geometry.height+l):(Q.x=f==mxConstants.DIRECTION_WEST?Q.x-l:Q.x+(E.geometry.width+l),Q.y+=E.geometry.height/2);var c=this.view.getState(this.model.getParent(b));l=this.view.scale;var g=this.view.translate;E=g.x*l;g=g.y*l;null!=c&&this.model.isVertex(c.cell)&&(E=c.x,g=c.y);this.model.isVertex(b.parent)&&b.geometry.relative&&(Q.x+=b.parent.geometry.x,Q.y+=b.parent.geometry.y);q=q?null:(new mxRectangle(E+Q.x*l,g+Q.y*l)).grow(40*l);q=null!=q?
this.getCells(0,0,0,0,null,null,q,null,!0):null;c=this.view.getState(b);var m=null,n=null;if(null!=q){q=q.reverse();for(var x=0;x<q.length;x++)if(!this.isCellLocked(q[x])&&!this.model.isEdge(q[x])&&q[x]!=b)if(!this.model.isAncestor(b,q[x])&&this.isContainer(q[x])&&(null==m||q[x]==this.model.getParent(b)))m=q[x];else if(null==n&&this.isCellConnectable(q[x])&&!this.model.isAncestor(q[x],b)&&!this.isSwimlane(q[x])){var F=this.view.getState(q[x]);null==c||null==F||mxUtils.intersects(c,F)||(n=q[x])}}var I=
!mxEvent.isShiftDown(u)||mxEvent.isControlDown(u)||y;I&&("1"!=urlParams.sketch||y)&&(f==mxConstants.DIRECTION_NORTH?Q.y-=b.geometry.height/2:f==mxConstants.DIRECTION_SOUTH?Q.y+=b.geometry.height/2:Q.x=f==mxConstants.DIRECTION_WEST?Q.x-b.geometry.width/2:Q.x+b.geometry.width/2);var M=[],L=n;n=m;y=mxUtils.bind(this,function(K){if(null==B||null!=K||null==n&&S){this.model.beginUpdate();try{if(null==L&&I){var aa=this.getAbsoluteParent(null!=K?K:b);aa=S?b:this.getCompositeParent(aa);L=null!=K?K:this.duplicateCells([aa],
!1)[0];null!=K&&this.addCells([L],this.model.getParent(b),null,null,null,!0);var ja=this.getCellGeometry(L);null!=ja&&(null!=K&&"1"==urlParams.sketch&&(f==mxConstants.DIRECTION_NORTH?Q.y-=ja.height/2:f==mxConstants.DIRECTION_SOUTH?Q.y+=ja.height/2:Q.x=f==mxConstants.DIRECTION_WEST?Q.x-ja.width/2:Q.x+ja.width/2),ja.x=Q.x-ja.width/2,ja.y=Q.y-ja.height/2);null!=m?(this.addCells([L],m,null,null,null,!0),n=null):I&&!S&&this.addCells([L],this.getDefaultParent(),null,null,null,!0)}var ca=mxEvent.isControlDown(u)&&
mxEvent.isShiftDown(u)&&I||null==n&&S?null:this.insertEdge(this.model.getParent(b),null,"",b,L,this.createCurrentEdgeStyle());null!=ca&&(M.push(ca),this.applyNewEdgeStyle(b,[ca],f),this.connectionHandler.insertBeforeSource&&this.insertEdgeBeforeCell(ca,b));if(null==n&&null!=L&&null!=b.parent&&S&&f==mxConstants.DIRECTION_WEST){var ba=b.parent.getIndex(b);this.model.add(b.parent,L,ba)}null==n&&null!=L&&M.push(L);null==L&&null!=ca&&ca.geometry.setTerminalPoint(Q,!1);null!=ca&&this.fireEvent(new mxEventObject("cellsInserted",
"cells",[ca]))}finally{this.model.endUpdate()}}if(null!=H)H(M);else return M});if(null==B||null!=L||!I||null==n&&S)return y(L);B(E+Q.x*l,g+Q.y*l,y)};
Graph.prototype.getIndexableText=function(b){b=null!=b?b:this.model.getDescendants(this.model.root);for(var f=document.createElement("div"),l=[],u,y=0;y<b.length;y++)if(u=b[y],this.model.isVertex(u)||this.model.isEdge(u))this.isHtmlLabel(u)?(f.innerHTML=Graph.sanitizeHtml(this.getLabel(u)),u=mxUtils.extractTextWithWhitespace([f])):u=this.getLabel(u),u=mxUtils.trim(u.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<u.length&&l.push(u);return l.join(" ")};
Graph.prototype.convertValueToString=function(b){var f=this.model.getValue(b);if(null!=f&&"object"==typeof f){var l=null;if(this.isReplacePlaceholders(b)&&null!=b.getAttribute("placeholder")){f=b.getAttribute("placeholder");for(var u=b;null==l&&null!=u;)null!=u.value&&"object"==typeof u.value&&(l=u.hasAttribute(f)?null!=u.getAttribute(f)?u.getAttribute(f):"":null),u=this.model.getParent(u)}else l=null,Graph.translateDiagram&&null!=Graph.diagramLanguage&&(l=f.getAttribute("label_"+Graph.diagramLanguage)),
null==l&&(l=f.getAttribute("label")||"");return l||""}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,f){return null!=b.value&&"object"==typeof b.value?(b=b.value.getAttribute("link"),f||(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,f){return this.updateHorizontalStyle(b,this.replaceDefaultColors(b,mxGraph.prototype.postProcessCellStyle.apply(this,arguments)))};
Graph.prototype.updateHorizontalStyle=function(b,f){if(null!=b&&null!=f&&null!=this.layoutManager){var l=this.model.getParent(b);this.model.isVertex(l)&&this.isCellCollapsed(b)&&(b=this.layoutManager.getLayout(l),null!=b&&b.constructor==mxStackLayout&&(f[mxConstants.STYLE_HORIZONTAL]=!b.horizontal))}return f};
Graph.prototype.replaceDefaultColors=function(b,f){if(null!=f&&null!=this.shapeBackgroundColor&&null!=this.shapeForegroundColor){b=this.shapeBackgroundColor;var l=this.shapeForegroundColor;this.replaceDefaultColor(f,mxConstants.STYLE_FONTCOLOR,l);this.replaceDefaultColor(f,mxConstants.STYLE_FILLCOLOR,b);this.replaceDefaultColor(f,mxConstants.STYLE_GRADIENTCOLOR,l);this.replaceDefaultColor(f,mxConstants.STYLE_STROKECOLOR,l);this.replaceDefaultColor(f,mxConstants.STYLE_IMAGE_BORDER,l);this.replaceDefaultColor(f,
mxConstants.STYLE_IMAGE_BACKGROUND,b);this.replaceDefaultColor(f,mxConstants.STYLE_LABEL_BORDERCOLOR,l);this.replaceDefaultColor(f,mxConstants.STYLE_SWIMLANE_FILLCOLOR,b);this.replaceDefaultColor(f,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,b)}return f};Graph.prototype.replaceDefaultColor=function(b,f,l){null!=b&&null!=l&&"none"!=l&&""!=l&&"default"==b[f]&&(b[f]=this.getDefaultColor(b,f,l))};
Graph.prototype.getDefaultColor=function(b,f,l){f="default"+f.charAt(0).toUpperCase()+f.substring(1);"invert"==b[f]&&(b=mxUtils.getLightDarkColor(l),l="light-dark("+b.dark+", "+b.light+")");return l};
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,f,l){if(null!=b&&null!=f&&null!=this.layoutManager&&null!=f.alternateBounds){var u=this.layoutManager.getLayout(this.model.getParent(b));null!=u&&u.constructor==mxStackLayout&&(u.horizontal?f.alternateBounds.height=0:f.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)};
Graph.prototype.moveCellsTo=function(b,f){if(null!=b&&null!=f){for(var l=!0,u=0;u<b.length&&l;u++)l=l&&this.model.isEdge(b[u]);u=null;if(1==b.length&&l){var y=this.getCellGeometry(b[0]);null!=y&&(u=y.getTerminalPoint(!0))}u=null!=u?u:this.getBoundingBoxFromGeometry(b,l);null!=u&&(l=Math.round(this.snap(f.x)),f=Math.round(this.snap(f.y)),this.cellsMoved(b,l-u.x,f-u.y))}};Graph.prototype.isMoveCellsEvent=function(b,f){return mxEvent.isShiftDown(b)||"1"==mxUtils.getValue(f.style,"moveCells","0")};
Graph.prototype.foldCells=function(b,f,l,u,y){f=null!=f?f:!1;null==l&&(l=this.getFoldableCells(this.getSelectionCells(),b));if(null!=l){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var q=0;q<l.length;q++){var B=this.view.getState(l[q]),H=this.getCellGeometry(l[q]);if(null!=B&&null!=H){var S=0,E=0;if(H.alternateBounds)S=H.width-H.alternateBounds.width,E=H.height-H.alternateBounds.height;else{var Q=this.useCssTransforms?1:this.view.scale;
S=Math.round(H.width-B.width/Q);E=Math.round(H.height-B.height/Q)}if(0!=E||0!=S){var c=this.model.getParent(l[q]),g=this.layoutManager.getLayout(c);null==g?null!=y&&this.isMoveCellsEvent(y,B)&&this.moveSiblings(B,c,S,E):null!=y&&mxEvent.isAltDown(y)||g.constructor!=mxStackLayout||g.resizeLast||this.resizeParentStacks(c,g,S,E)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(l)}};
Graph.prototype.moveSiblings=function(b,f,l,u){this.model.beginUpdate();try{var y=this.getCellsBeyond(b.x,b.y,f,!0,!0);for(f=0;f<y.length;f++)if(y[f]!=b.cell){var q=this.view.getState(y[f]),B=this.getCellGeometry(y[f]);null!=q&&null!=B&&(B=B.clone(),B.translate(Math.round(l*Math.max(0,Math.min(1,(q.x-b.x)/b.width))),Math.round(u*Math.max(0,Math.min(1,(q.y-b.y)/b.height)))),this.model.setGeometry(y[f],B))}}finally{this.model.endUpdate()}};
Graph.prototype.resizeParentStacks=function(b,f,l,u){if(null!=this.layoutManager&&null!=f&&f.constructor==mxStackLayout&&!f.resizeLast){this.model.beginUpdate();try{for(var y=f.horizontal;null!=b&&null!=f&&f.constructor==mxStackLayout&&f.horizontal==y&&!f.resizeLast;){var q=this.getCellGeometry(b),B=this.view.getState(b);null!=B&&null!=q&&(q=q.clone(),f.horizontal?q.width+=l+Math.min(0,B.width/this.view.scale-q.width):q.height+=u+Math.min(0,B.height/this.view.scale-q.height),this.model.setGeometry(b,
q));b=this.model.getParent(b);f=this.layoutManager.getLayout(b)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(b){var f=this.getCurrentCellStyle(b);return this.isSwimlane(b)?"0"!=f.container:"1"==f.container};Graph.prototype.isCellConnectable=function(b){var f=this.getCurrentCellStyle(b);return!this.isCellLocked(this.getLayerForCell(b))&&(null!=f.connectable?"0"!=f.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments))};
Graph.prototype.isLabelMovable=function(b){var f=this.getCurrentCellStyle(b);return null!=f.movableLabel?"0"!=f.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,f,l){l=l||this.getDefaultParent();this.isCellLocked(l)||mxGraph.prototype.selectCells.apply(this,arguments)};
Graph.prototype.getSwimlaneAt=function(b,f,l){var u=mxGraph.prototype.getSwimlaneAt.apply(this,arguments);this.isCellLocked(u)&&(u=null);return u};Graph.prototype.isCellFoldable=function(b){var f=this.getCurrentCellStyle(b);return this.foldingEnabled&&"0"!=mxUtils.getValue(f,mxConstants.STYLE_RESIZABLE,"1")&&("1"==f.treeFolding||!this.isCellLocked(b)&&(this.isContainer(b)&&"0"!=f.collapsible||!this.isContainer(b)&&"1"==f.collapsible))};
Graph.prototype.reset=function(){this.isEditing()&&this.stopEditing(!0);this.escape();this.isSelectionEmpty()||this.clearSelection()};Graph.prototype.zoom=function(b,f){b=Math.max(.01,Math.min(this.view.scale*b,160))/this.view.scale;mxGraph.prototype.zoom.apply(this,arguments)};Graph.prototype.zoomIn=function(){.15>this.view.scale?this.zoom((this.view.scale+.01)/this.view.scale):this.zoom(Math.round(this.view.scale*this.zoomFactor*20)/20/this.view.scale)};
Graph.prototype.zoomOut=function(){.15>=this.view.scale?this.zoom((this.view.scale-.01)/this.view.scale):this.zoom(Math.round(1/this.zoomFactor*this.view.scale*20)/20/this.view.scale)};
Graph.prototype.fitPages=function(b,f){var l=1;null==b&&(l=this.getPageLayout(),b=l.width,l=l.height);var u=this.pageScale,y=this.pageFormat,q=this.container.clientHeight-10;b=(this.container.clientWidth-10)/(b*y.width)/u;this.zoomTo(Math.floor(20*(f?b:Math.min(b,q/(l*y.height)/u)))/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),f||(this.container.scrollTop=Math.min(b.y*
this.view.scale,(this.container.scrollHeight-this.container.clientHeight)/2)))};
Graph.prototype.fitWindow=function(b,f){f=null!=f?f:10;var l=this.container.clientWidth-f,u=this.container.clientHeight-f;this.zoomTo(Math.floor(20*Math.min(l/b.width,u/b.height))/20);mxUtils.hasScrollbars(this.container)&&window.setTimeout(mxUtils.bind(this,function(){var y=this.view.translate;this.container.scrollLeft=(b.x+y.x)*this.view.scale-Math.max((l-b.width*this.view.scale)/2+f/2,0);this.container.scrollTop=(b.y+y.y)*this.view.scale-Math.max((u-b.height*this.view.scale)/2+f/2,0)}),0)};
Graph.prototype.convertValueToTooltip=function(b){var f=null;mxUtils.isNode(b.value)&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(f=b.value.getAttribute("tooltip_"+Graph.diagramLanguage)),null==f&&(f=b.value.getAttribute("tooltip")),null!=f&&(null!=f&&this.isReplacePlaceholders(b)&&(f=this.replacePlaceholders(b,f)),f=Graph.sanitizeHtml(f)));return f};
Graph.prototype.getTooltipForCell=function(b){var f="";if(mxUtils.isNode(b.value)&&(f=this.convertValueToTooltip(b),null==f)){var l=this.builtInProperties;b=b.value.attributes;var u=[];f="";this.isEnabled()&&(l.push("linkTarget"),l.push("link"));for(var y=0;y<b.length;y++)(Graph.translateDiagram&&"label"==b[y].nodeName||0>mxUtils.indexOf(l,b[y].nodeName))&&0<b[y].nodeValue.length&&u.push({name:b[y].nodeName,value:b[y].nodeValue});u.sort(function(q,B){return q.name<B.name?-1:q.name>B.name?1:0});for(y=
0;y<u.length;y++)"link"==u[y].name&&this.isCustomLink(u[y].value)||(f+=("link"!=u[y].name?"<b>"+mxUtils.htmlEntities(u[y].name)+":</b> ":"")+mxUtils.htmlEntities(u[y].value)+"\n");0<f.length&&(f=f.substring(0,f.length-1),mxClient.IS_SVG&&(f='<div style="max-width:360px;text-overflow:ellipsis;overflow:hidden;">'+f+"</div>"))}return f};
Graph.prototype.addFlowAnimationToNode=function(b,f,l,u){if(null!=b&&null!=u){var y=b.getAttribute("stroke-dasharray");if(""==y||null==y){var q=String(mxUtils.getValue(f,mxConstants.STYLE_DASH_PATTERN,"8")).split(" ");y=1==mxUtils.getValue(f,mxConstants.STYLE_FIX_DASH,!1)||null==f.dashPattern?1:mxUtils.getNumber(f,mxConstants.STYLE_STROKEWIDTH,1);if(0<q.length)for(var B=0;B<q.length;B++)q[B]=Math.round(Number(q[B])*l*y*100)/100;b.setAttribute("stroke-dasharray",q.join(" "))}else q=y.split(" ");if(0<
q.length){for(B=y=0;B<q.length;B++){var H=parseFloat(q[B]);isNaN(H)||(y+=parseFloat(q[B]))}0!=q.length%2&&(y*=2);l=Math.round(y/l/16*parseInt(mxUtils.getValue(f,"flowAnimationDuration",500)));q=mxUtils.getValue(f,"flowAnimationTimingFunction","linear");f=mxUtils.getValue(f,"flowAnimationDirection","normal");b.style.animation=u+" "+l+"ms "+mxUtils.htmlEntities(q)+" infinite "+mxUtils.htmlEntities(f);b.style.strokeDashoffset=y}}};
Graph.prototype.addFlowAnimationStyle=function(){var b=document.getElementsByTagName("head")[0];if(null!=b&&null==this.flowAnimationId){this.flowAnimationId="ge-flow-animation-"+Editor.guid();var f=document.createElement("style");f.innerHTML=this.createFlowAnimationCss(this.flowAnimationId);b.appendChild(f)}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,f){return Graph.compress(b,f)};Graph.prototype.decompress=function(b,f){return Graph.decompress(b,f)};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(l){null!=l.relatedTarget&&
mxEvent.getSource(l)==this.graph.container&&this.setDisplay("none")}));this.graph.addListener(mxEvent.START_EDITING,mxUtils.bind(this,function(l){this.reset()}));var b=this.graph.click;this.graph.click=mxUtils.bind(this,function(l){b.apply(this.graph,arguments);null==this.currentState||this.graph.isCellSelected(this.currentState.cell)||!mxEvent.isTouchEvent(l.getEvent())||this.graph.model.isVertex(l.getCell())||this.reset()});var f=!1;this.graph.addMouseListener({mouseDown:mxUtils.bind(this,function(l,
u){f=!1;l=u.getEvent();this.isResetEvent(l)?this.reset():this.isActive()||(u=this.getState(u.getState()),null==u&&mxEvent.isTouchEvent(l)||this.update(u));this.setDisplay("none")}),mouseMove:mxUtils.bind(this,function(l,u){l=u.getEvent();this.isResetEvent(l)?this.reset():this.graph.isMouseDown||mxEvent.isTouchEvent(l)||this.update(this.getState(u.getState()),u.getGraphX(),u.getGraphY());null!=this.graph.connectionHandler&&null!=this.graph.connectionHandler.shape&&(f=!0)}),mouseUp:mxUtils.bind(this,
function(l,u){l=u.getEvent();mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(l),mxEvent.getClientY(l));this.isResetEvent(l)?this.reset():this.isActive()&&!f&&null!=this.mouseDownPoint?this.click(this.currentState,this.getDirection(),u):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(u.getGraphX(),u.getGraphY())))):mxEvent.isTouchEvent(l)||null!=
this.bbox&&mxUtils.contains(this.bbox,u.getGraphX(),u.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(l)||this.reset();f=!1;this.resetActiveArrow()})})};HoverIcons.prototype.isResetEvent=function(b,f){return mxEvent.isAltDown(b)||null==this.activeArrow&&mxEvent.isShiftDown(b)||mxEvent.isPopupTrigger(b)&&!this.graph.isCloneEvent(b)};
HoverIcons.prototype.createArrow=function(b,f,l){var u=null;u=mxUtils.createImage(b.src);u.style.width=b.width+"px";u.style.height=b.height+"px";u.style.padding=this.tolerance+"px";null!=f&&u.setAttribute("title",f);u.style.position="absolute";u.style.cursor=this.cssCursor;mxEvent.addGestureListeners(u,mxUtils.bind(this,function(y){null==this.currentState||this.isResetEvent(y)||(this.mouseDownPoint=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(y),mxEvent.getClientY(y)),this.drag(y,
this.mouseDownPoint.x,this.mouseDownPoint.y),this.activeArrow=u,this.setDisplay("none"),mxEvent.consume(y))}));mxEvent.redirectMouseEvents(u,this.graph,this.currentState);mxEvent.addListener(u,"mouseenter",mxUtils.bind(this,function(y){mxEvent.isMouseEvent(y)&&(null!=this.activeArrow&&this.activeArrow!=u&&mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.graph.connectionHandler.constraintHandler.reset(),mxUtils.setOpacity(u,100),this.activeArrow=u,this.fireEvent(new mxEventObject("focus",
"arrow",u,"direction",l,"event",y)))}));mxEvent.addListener(u,"mouseleave",mxUtils.bind(this,function(y){mxEvent.isMouseEvent(y)&&this.fireEvent(new mxEventObject("blur","arrow",u,"direction",l,"event",y));this.graph.isMouseDown||this.resetActiveArrow()}));return u};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 f=0;f<this.elts.length;f++)null!=this.elts[f]&&b(this.elts[f])};HoverIcons.prototype.removeNodes=function(){this.visitNodes(function(b){null!=b.parentNode&&b.parentNode.removeChild(b)})};
HoverIcons.prototype.setDisplay=function(b){this.visitNodes(function(f){f.style.display=b})};HoverIcons.prototype.isActive=function(){return null!=this.activeArrow&&null!=this.currentState};
HoverIcons.prototype.drag=function(b,f,l){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);null!=this.currentState&&(this.graph.connectionHandler.start(this.currentState,f,l),this.graph.isMouseTrigger=mxEvent.isMouseEvent(b),this.graph.isMouseDown=!0,f=this.graph.selectionCellsHandler.getHandler(this.currentState.cell),null!=f&&f.setHandlesVisible(!1),f=this.graph.connectionHandler.edgeState,null!=b&&mxEvent.isShiftDown(b)&&mxEvent.isControlDown(b)&&null!=f&&"orthogonalEdgeStyle"===
mxUtils.getValue(f.style,mxConstants.STYLE_EDGE,null)&&(b=this.getDirection(),f.cell.style=mxUtils.setStyle(f.cell.style,"sourcePortConstraint",b),f.style.sourcePortConstraint=b))};HoverIcons.prototype.getStateAt=function(b,f,l){return this.graph.view.getState(this.graph.getCellAt(f,l))};
HoverIcons.prototype.click=function(b,f,l){var u=l.getEvent(),y=l.getGraphX(),q=l.getGraphY();y=this.getStateAt(b,y,q);null==y||!this.graph.model.isEdge(y.cell)||this.graph.isCloneEvent(u)||y.getVisibleTerminalState(!0)!=b&&y.getVisibleTerminalState(!1)!=b?null!=b&&this.execute(b,f,l):(this.graph.setSelectionCell(y.cell),this.reset());l.consume()};
HoverIcons.prototype.execute=function(b,f,l){l=l.getEvent();this.graph.selectCellsForConnectVertex(this.graph.connectVertex(b.cell,f,this.graph.defaultEdgeLength,l,this.graph.isCloneEvent(l),this.graph.isCloneEvent(l)),l,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 f=this.graph.selectionCellsHandler.getHandler(this.currentState.cell);this.graph.isTableRow(this.currentState.cell)&&(f=this.graph.selectionCellsHandler.getHandler(this.graph.model.getParent(this.currentState.cell)));var l=null;null!=f&&(b.x-=f.horizontalOffset/2,b.y-=f.verticalOffset/2,b.width+=f.horizontalOffset,b.height+=f.verticalOffset,null!=f.rotationShape&&null!=f.rotationShape.node&&"hidden"!=f.rotationShape.node.style.visibility&&"none"!=f.rotationShape.node.style.display&&null!=f.rotationShape.boundingBox&&
(l=f.rotationShape.boundingBox));f=mxUtils.bind(this,function(H,S,E){if(null!=l){var Q=new mxRectangle(S,E,H.clientWidth,H.clientHeight);mxUtils.intersects(Q,l)&&(H==this.arrowUp?E-=Q.y+Q.height-l.y:H==this.arrowRight?S+=l.x+l.width-Q.x:H==this.arrowDown?E+=l.y+l.height-Q.y:H==this.arrowLeft&&(S-=Q.x+Q.width-l.x))}H.style.left=S+"px";H.style.top=E+"px";mxUtils.setOpacity(H,this.inactiveOpacity)});f(this.arrowUp,Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance),Math.round(b.y-
this.triangleUp.height-this.tolerance));f(this.arrowRight,Math.round(b.x+b.width-this.tolerance),Math.round(this.currentState.getCenterY()-this.triangleRight.height/2-this.tolerance));f(this.arrowDown,parseInt(this.arrowUp.style.left),Math.round(b.y+b.height-this.tolerance));f(this.arrowLeft,Math.round(b.x-this.triangleLeft.width-this.tolerance),parseInt(this.arrowRight.style.top));if(this.checkCollisions){f=this.graph.getCellAt(b.x+b.width+this.triangleRight.width/2,this.currentState.getCenterY());
var u=this.graph.getCellAt(b.x-this.triangleLeft.width/2,this.currentState.getCenterY()),y=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!=f&&f==u&&u==y&&y==b&&(b=y=u=f=null);var q=this.graph.getCellGeometry(this.currentState.cell),B=mxUtils.bind(this,function(H,S){var E=this.graph.model.isVertex(H)&&this.graph.getCellGeometry(H);null==H||this.graph.model.isAncestor(H,
this.currentState.cell)||this.graph.isSwimlane(H)||!(null==E||null==q||E.height<3*q.height&&E.width<3*q.width)?S.style.visibility="visible":S.style.visibility="hidden"});B(f,this.arrowRight);B(u,this.arrowLeft);B(y,this.arrowUp);B(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(f){null!=f.parentNode&&(f=new mxRectangle(f.offsetLeft,f.offsetTop,f.offsetWidth,f.offsetHeight),null==b?b=f:b.add(f))});return b};
HoverIcons.prototype.getState=function(b){if(null!=b)if(b=b.cell,this.graph.getModel().contains(b)){if(this.graph.getModel().isVertex(b)&&!this.graph.isCellConnectable(b)){var f=this.graph.getModel().getParent(b);this.graph.getModel().isVertex(f)&&this.graph.isCellConnectable(f)&&(b=f)}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,f,l){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 u=null;this.prev!=b||this.isActive()?(this.startTime=(new Date).getTime(),this.prev=b,u=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,f,l))}),this.updateDelay+10))):null!=this.startTime&&(u=(new Date).getTime()-this.startTime);this.setDisplay("");null!=this.currentState&&this.currentState!=b&&u<this.activationDelay&&null!=this.bbox&&!mxUtils.contains(this.bbox,f,l)?this.reset(!1):(null!=this.currentState||u>this.activationDelay)&&this.currentState!=b&&(u>this.updateDelay&&null!=
b||null==this.bbox||null==f||null==l||!mxUtils.contains(this.bbox,f,l))&&(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&&(this.graph.container.appendChild(this.arrowUp),this.graph.container.appendChild(this.arrowDown));this.graph.container.appendChild(this.arrowRight);this.graph.container.appendChild(this.arrowLeft);this.currentState=b};
Graph.prototype.removeTextStyleForCell=function(b,f){var l=this.getCurrentCellStyle(b),u=!1;this.getModel().beginUpdate();try{if("1"==mxUtils.getValue(l,"html","0")){var y=this.convertValueToString(b);"0"!=mxUtils.getValue(l,"nl2Br","1")&&(y=y.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));y=Editor.convertHtmlToText(y);this.cellLabelChanged(b,y);u=!0}f&&(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 u};Graph.prototype.createParent=function(b,f,l,u,y){b=this.cloneCell(b);for(var q=0;q<l;q++){var B=this.cloneCell(f),H=this.getCellGeometry(B);null!=H&&(H.x+=q*u,H.y+=q*y);b.insert(B)}return b};
Graph.prototype.createTable=function(b,f,l,u,y,q,B,H,S){l=null!=l?l:60;u=null!=u?u:40;q=null!=q?q:30;H=null!=H?H:"shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;strokeColor=inherit;top=0;left=0;bottom=0;right=0;collapsible=0;dropTarget=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;";S=null!=S?S:"shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;strokeColor=inherit;overflow=hidden;fillColor=none;top=0;left=0;bottom=0;right=0;pointerEvents=1;";return this.createParent(this.createVertex(null,
null,null!=y?y:"",0,0,f*l,b*u+(null!=y?q:0),null!=B?B:"shape=table;startSize="+(null!=y?q:"0")+";container=1;collapsible=0;childLayout=tableLayout;"),this.createParent(this.createVertex(null,null,"",0,0,f*l,u,H),this.createVertex(null,null,"",0,0,l,u,S),f,l,0),b,0,u)};
Graph.prototype.setTableValues=function(b,f,l){for(var u=this.model.getChildCells(b,!0),y=0;y<u.length;y++)if(null!=l&&(u[y].value=l[y]),null!=f)for(var q=this.model.getChildCells(u[y],!0),B=0;B<q.length;B++)null!=f[y][B]&&(q[B].value=f[y][B]);return b};
Graph.prototype.createCrossFunctionalSwimlane=function(b,f,l,u,y,q,B,H,S){l=null!=l?l:120;u=null!=u?u:120;B=null!=B?B:"shape=tableRow;horizontal=0;swimlaneHead=0;swimlaneBody=0;top=0;left=0;strokeColor=inherit;bottom=0;right=0;dropTarget=0;fontStyle=0;fillColor=none;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;startSize=40;collapsible=0;recursiveResize=0;expand=0;";H=null!=H?H:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;strokeColor=inherit;connectable=0;fillColor=none;startSize=40;collapsible=0;recursiveResize=0;expand=0;";
S=null!=S?S:"swimlane;swimlaneHead=0;swimlaneBody=0;fontStyle=0;connectable=0;strokeColor=inherit;fillColor=none;startSize=0;collapsible=0;recursiveResize=0;expand=0;";y=this.createVertex(null,null,null!=y?y:"",0,0,f*l,b*u,null!=q?q:"shape=table;childLayout=tableLayout;"+(null==y?"startSize=0;fillColor=none;":"startSize=40;")+"collapsible=0;recursiveResize=0;expand=0;");q=mxUtils.getValue(this.getCellStyle(y),mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE);y.geometry.width+=q;y.geometry.height+=
q;B=this.createVertex(null,null,"",0,q,f*l+q,u,B);y.insert(this.createParent(B,this.createVertex(null,null,"",q,0,l,u,H),f,l,0));return 1<b?(B.geometry.y=u+q,this.createParent(y,this.createParent(B,this.createVertex(null,null,"",q,0,l,u,S),f,l,0),b-1,0,u)):y};
Graph.prototype.visitTableCells=function(b,f){var l=null,u=this.model.getChildCells(b,!0);b=this.getActualStartSize(b,!0);for(var y=0;y<u.length;y++){for(var q=this.getActualStartSize(u[y],!0),B=this.model.getChildCells(u[y],!0),H=this.getCellStyle(u[y],!0),S=null,E=[],Q=0;Q<B.length;Q++){var c=this.getCellGeometry(B[Q]),g={cell:B[Q],rospan:1,colspan:1,row:y,col:Q,geo:c};c=null!=c.alternateBounds?c.alternateBounds:c;g.point=new mxPoint(c.width+(null!=S?S.point.x:b.x+q.x),c.height+(null!=l&&null!=
l[0]?l[0].point.y:b.y+q.y));g.actual=g;null!=l&&null!=l[Q]&&1<l[Q].rowspan?(g.rowspan=l[Q].rowspan-1,g.colspan=l[Q].colspan,g.actual=l[Q].actual):null!=S&&1<S.colspan?(g.rowspan=S.rowspan,g.colspan=S.colspan-1,g.actual=S.actual):(S=this.getCurrentCellStyle(B[Q],!0),null!=S&&(g.rowspan=parseInt(S.rowspan||1),g.colspan=parseInt(S.colspan||1)));S=1==mxUtils.getValue(H,mxConstants.STYLE_SWIMLANE_HEAD,1)&&mxUtils.getValue(H,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE;f(g,B.length,
u.length,b.x+(S?q.x:0),b.y+(S?q.y:0));E.push(g);S=g}l=E}};Graph.prototype.getTableLines=function(b,f,l){var u=[],y=[];(f||l)&&this.visitTableCells(b,mxUtils.bind(this,function(q,B,H,S,E){f&&q.row<H-1&&(null==u[q.row]&&(u[q.row]=[new mxPoint(S,q.point.y)]),1<q.rowspan&&u[q.row].push(null),u[q.row].push(q.point));l&&q.col<B-1&&(null==y[q.col]&&(y[q.col]=[new mxPoint(q.point.x,E)]),1<q.colspan&&y[q.col].push(null),y[q.col].push(q.point))}));return u.concat(y)};
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,f,l){l=null!=l?l:!0;var u=this.getModel();u.beginUpdate();try{var y=this.getCellGeometry(b);if(null!=y){y=y.clone();y.height+=f;u.setGeometry(b,y);var q=u.getParent(b),B=u.getChildCells(q,!0);if(!l){var H=mxUtils.indexOf(B,b);if(H<B.length-1){var S=B[H+1],E=this.getCellGeometry(S);null!=E&&(E=E.clone(),E.y+=f,E.height-=f,u.setGeometry(S,E))}}var Q=this.getCellGeometry(q);null!=Q&&(l||(l=b==B[B.length-1]),l&&(Q=Q.clone(),Q.height+=f,u.setGeometry(q,Q)))}}finally{u.endUpdate()}};
Graph.prototype.setTableColumnWidth=function(b,f,l){l=null!=l?l:!1;var u=this.getModel(),y=u.getParent(b),q=u.getParent(y),B=u.getChildCells(y,!0);b=mxUtils.indexOf(B,b);var H=b==B.length-1;u.beginUpdate();try{for(var S=u.getChildCells(q,!0),E=0;E<S.length;E++){y=S[E];B=u.getChildCells(y,!0);var Q=B[b],c=this.getCellGeometry(Q);null!=c&&(c=c.clone(),c.width+=f,null!=c.alternateBounds&&(c.alternateBounds.width+=f),u.setGeometry(Q,c));b<B.length-1&&(Q=B[b+1],c=this.getCellGeometry(Q),null!=c&&(c=c.clone(),
c.x+=f,l||(c.width-=f,null!=c.alternateBounds&&(c.alternateBounds.width-=f)),u.setGeometry(Q,c)))}if(H||l){var g=this.getCellGeometry(q);null!=g&&(g=g.clone(),g.width+=f,u.setGeometry(q,g))}null!=this.layoutManager&&this.layoutManager.executeLayout(q)}finally{u.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,f){for(var l=0,u=0;u<b.length;u++)if(!this.isVertexIgnored(b[u])){var y=this.graph.getCellGeometry(b[u]);null!=y&&(l+=f?y.width:y.height)}return l};
TableLayout.prototype.getRowLayout=function(b,f){var l=this.graph.model.getChildCells(b,!0),u=this.graph.getActualStartSize(b,!0);b=this.getSize(l,!0);f=f-u.x-u.width;var y=[];u=u.x;for(var q=0;q<l.length;q++){var B=this.graph.getCellGeometry(l[q]);null!=B&&(u+=(null!=B.alternateBounds?B.alternateBounds.width:B.width)*f/b,y.push(Math.round(u)))}return y};
TableLayout.prototype.layoutRow=function(b,f,l,u){var y=this.graph.getModel(),q=y.getChildCells(b,!0);b=this.graph.getActualStartSize(b,!0);var B=b.x,H=0;null!=f&&(f=f.slice(),f.splice(0,0,b.x));for(var S=0;S<q.length;S++){var E=this.graph.getCellGeometry(q[S]);null!=E&&(E=E.clone(),E.y=b.y,E.height=l-b.y-b.height,null!=f?(E.x=f[S],E.width=f[S+1]-E.x,S==q.length-1&&S<f.length-2&&(E.width=u-E.x-b.x-b.width)):(E.x=B,B+=E.width,S==q.length-1?E.width=u-b.x-b.width-H:H+=E.width),E.alternateBounds=new mxRectangle(0,
0,E.width,E.height),y.setGeometry(q[S],E))}return H};
TableLayout.prototype.execute=function(b){if(null!=b){var f=this.graph.getActualStartSize(b,!0),l=this.graph.getCellGeometry(b),u=this.graph.getCellStyle(b),y="1"==mxUtils.getValue(u,"resizeLastRow","0"),q="1"==mxUtils.getValue(u,"resizeLast","0");u="1"==mxUtils.getValue(u,"fixedRows","0");var B=this.graph.getModel(),H=0;B.beginUpdate();try{for(var S=l.height-f.y-f.height,E=l.width-f.x-f.width,Q=B.getChildCells(b,!0),c=0;c<Q.length;c++)B.setVisible(Q[c],!0);var g=this.getSize(Q,!1);if(0<S&&0<E&&0<
Q.length&&0<g){if(y){var m=this.graph.getCellGeometry(Q[Q.length-1]);null!=m&&(m=m.clone(),m.height=S-g+m.height,B.setGeometry(Q[Q.length-1],m))}var n=q?null:this.getRowLayout(Q[0],E),x=[],F=f.y;for(c=0;c<Q.length;c++)m=this.graph.getCellGeometry(Q[c]),null!=m&&(m=m.clone(),m.x=f.x,m.width=E,m.y=Math.round(F),F=y||u?F+m.height:F+m.height/g*S,m.height=Math.round(F)-m.y,B.setGeometry(Q[c],m)),H=Math.max(H,this.layoutRow(Q[c],n,m.height,E,x));u&&S<g&&(l=l.clone(),l.height=F+f.height,B.setGeometry(b,
l));q&&E<H+Graph.minTableColumnWidth&&(l=l.clone(),l.width=H+f.width+f.x+Graph.minTableColumnWidth,B.setGeometry(b,l));this.graph.visitTableCells(b,mxUtils.bind(this,function(I){B.setVisible(I.cell,I.actual.cell==I.cell);if(I.actual.cell!=I.cell){if(I.actual.row==I.row){var M=null!=I.geo.alternateBounds?I.geo.alternateBounds:I.geo;I.actual.geo.width+=M.width}I.actual.col==I.col&&(M=null!=I.geo.alternateBounds?I.geo.alternateBounds:I.geo,I.actual.geo.height+=M.height)}}))}else for(c=0;c<Q.length;c++)B.setVisible(Q[c],
!1)}finally{B.endUpdate()}}};
(function(){var b=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){b.apply(this,arguments);this.validEdges=[]};var f=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(c,g){g=null!=g?g:!0;var m=this.getState(c);null!=m&&g&&this.graph.model.isEdge(m.cell)&&null!=m.style&&1!=m.style[mxConstants.STYLE_CURVED]&&!m.invalid&&this.updateLineJumps(m)&&this.graph.cellRenderer.redraw(m,!1,this.isRendering());m=f.apply(this,
arguments);null!=m&&g&&this.graph.model.isEdge(m.cell)&&null!=m.style&&1!=m.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(m);return m};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 g=null!=this.node?this.node.getElementsByTagName("path"):null;if(null!=
g)for(var m=null,n=0;n<g.length;n++)if("hidden"!=g[n].getAttribute("visibility")){if(!(null!=m&&m!=g[n].getAttribute("d")||null!=c&&0!=--c))return g[n]}else null==m&&(m=g[n].getAttribute("d"));return null};mxShape.prototype.addFlowAnimationToShape=function(){null!=this.state&&this.state.view.graph.addFlowAnimationToNode(this.getFlowAnimationPath(),this.state.style,this.state.view.scale,this.state.view.graph.addFlowAnimationStyle())};var l=mxShape.prototype.paint;mxShape.prototype.paint=function(c){l.apply(this,
arguments);this.isFlowAnimationEnabled()&&this.addFlowAnimationToShape()};var u=mxShape.prototype.createSvgCanvas;mxShape.prototype.createSvgCanvas=function(c){c=u.apply(this,arguments);null!=this.state&&(c.adaptiveColors=this.state.view.graph.getAdaptiveColors());return c};var y=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(c,g){return y.apply(this,arguments)||null!=c.routedPoints&&null!=g.routedPoints&&!mxUtils.equalPoints(g.routedPoints,c.routedPoints)};
var q=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(c){q.apply(this,arguments);this.graph.model.isEdge(c.cell)&&1!=c.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(c)};mxGraphView.prototype.updateLineJumps=function(c){var g=c.absolutePoints;if(Graph.lineJumpsEnabled){var m=null!=c.routedPoints,n=null;if(null!=g&&null!=this.validEdges&&"none"!==mxUtils.getValue(c.style,"jumpStyle","none")){var x=function(Z,k,v){var J=new mxPoint(k,v);J.type=Z;n.push(J);
J=null!=c.routedPoints?c.routedPoints[n.length-1]:null;return null==J||J.type!=Z||J.x!=k||J.y!=v},F=.5*this.scale;m=!1;n=[];for(var I=0;I<g.length-1;I++){for(var M=g[I+1],L=g[I],K=[],aa=g[I+2];I<g.length-2&&mxUtils.ptSegDistSq(L.x,L.y,aa.x,aa.y,M.x,M.y)<1*this.scale*this.scale;)M=aa,I++,aa=g[I+2];m=x(0,L.x,L.y)||m;for(var ja=0;ja<this.validEdges.length;ja++){var ca=this.validEdges[ja],ba=ca.absolutePoints;if(null!=ba&&mxUtils.intersects(c,ca)&&"1"!=ca.style.noJump){var oa=null;for(ca=0;ca<ba.length-
1;ca++){var Y=ba[ca+1],da=ba[ca];for(aa=ba[ca+2];ca<ba.length-2&&mxUtils.ptSegDistSq(da.x,da.y,aa.x,aa.y,Y.x,Y.y)<1*this.scale*this.scale;)Y=aa,ca++,aa=ba[ca+2];var ha=mxUtils.intersection(L.x,L.y,M.x,M.y,da.x,da.y,Y.x,Y.y);if(null!=ha&&(Math.abs(ha.x-L.x)>F||Math.abs(ha.y-L.y)>F)&&(Math.abs(ha.x-M.x)>F||Math.abs(ha.y-M.y)>F)&&(null==oa||mxUtils.ptLineDist(L.x,L.y,M.x,M.y,oa.x,oa.y)>F||mxUtils.ptLineDist(L.x,L.y,M.x,M.y,da.x,da.y)>F)&&(null==aa||mxUtils.ptLineDist(L.x,L.y,M.x,M.y,aa.x,aa.y)>F||mxUtils.ptLineDist(L.x,
L.y,M.x,M.y,Y.x,Y.y)>F)){aa=ha.x-L.x;oa=ha.y-L.y;ha={distSq:aa*aa+oa*oa,x:ha.x,y:ha.y};for(aa=0;aa<K.length;aa++)if(K[aa].distSq>ha.distSq){K.splice(aa,0,ha);ha=null;break}null==ha||0!=K.length&&K[K.length-1].x===ha.x&&K[K.length-1].y===ha.y||K.push(ha)}oa=da}}}for(ca=0;ca<K.length;ca++)m=x(1,K[ca].x,K[ca].y)||m}ha=g[g.length-1];m=x(0,ha.x,ha.y)||m}c.routedPoints=n;return m}return!1};var B=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(c,g,m){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)B.apply(this,arguments);else{var n=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,x=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,F=mxUtils.getValue(this.style,"jumpStyle","none"),I=!0,M=null,L=null,K=[],aa=null;c.begin();for(var ja=0;ja<this.state.routedPoints.length;ja++){var ca=
this.state.routedPoints[ja],ba=new mxPoint(ca.x/this.scale,ca.y/this.scale);0==ja?ba=g[0]:ja==this.state.routedPoints.length-1&&(ba=g[g.length-1]);var oa=!1;if(null!=M&&1==ca.type){var Y=this.state.routedPoints[ja+1];ca=Y.x/this.scale-ba.x;Y=Y.y/this.scale-ba.y;ca=ca*ca+Y*Y;null==aa&&(aa=new mxPoint(ba.x-M.x,ba.y-M.y),L=Math.sqrt(aa.x*aa.x+aa.y*aa.y),0<L?(aa.x=aa.x*x/L,aa.y=aa.y*x/L):aa=null);ca>x*x&&0<L&&(ca=M.x-ba.x,Y=M.y-ba.y,ca=ca*ca+Y*Y,ca>x*x&&(oa=new mxPoint(ba.x-aa.x,ba.y-aa.y),ca=new mxPoint(ba.x+
aa.x,ba.y+aa.y),K.push(oa),this.addPoints(c,K,m,n,!1,null,I),K=0>Math.round(aa.x)||0==Math.round(aa.x)&&0>=Math.round(aa.y)?1:-1,I=!1,"sharp"==F?(c.lineTo(oa.x-aa.y*K,oa.y+aa.x*K),c.lineTo(ca.x-aa.y*K,ca.y+aa.x*K),c.lineTo(ca.x,ca.y)):"line"==F?(c.moveTo(oa.x+aa.y*K,oa.y-aa.x*K),c.lineTo(oa.x-aa.y*K,oa.y+aa.x*K),c.moveTo(ca.x-aa.y*K,ca.y+aa.x*K),c.lineTo(ca.x+aa.y*K,ca.y-aa.x*K),c.moveTo(ca.x,ca.y)):"arc"==F?(K*=1.3,c.curveTo(oa.x-aa.y*K,oa.y+aa.x*K,ca.x-aa.y*K,ca.y+aa.x*K,ca.x,ca.y)):(c.moveTo(ca.x,
ca.y),I=!0),K=[ca],oa=!0))}else aa=null;oa||(K.push(ba),M=ba)}this.addPoints(c,K,m,n,!1,null,I);c.stroke()}};var H=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=function(c,g,m,n){return null!=g&&"centerPerimeter"==g.style[mxConstants.STYLE_PERIMETER]?new mxPoint(g.getCenterX(),g.getCenterY()):H.apply(this,arguments)};var S=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(c,g,m,n){if(null==g||null==
c||"1"!=g.style.snapToPoint&&"1"!=c.style.snapToPoint)S.apply(this,arguments);else{g=this.getTerminalPort(c,g,n);var x=this.getNextPoint(c,m,n),F=this.graph.isOrthogonal(c),I=mxUtils.toRadians(Number(g.style[mxConstants.STYLE_ROTATION]||"0")),M=new mxPoint(g.getCenterX(),g.getCenterY());if(0!=I){var L=Math.cos(-I),K=Math.sin(-I);x=mxUtils.getRotatedPoint(x,L,K,M)}L=parseFloat(c.style[mxConstants.STYLE_PERIMETER_SPACING]||0);L+=parseFloat(c.style[n?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||
0);x=this.getPerimeterPoint(g,x,0==I&&F,L);0!=I&&(L=Math.cos(I),K=Math.sin(I),x=mxUtils.getRotatedPoint(x,L,K,M));c.setAbsoluteTerminalPoint(this.snapToAnchorPoint(c,g,m,n,x),n)}};mxGraphView.prototype.snapToAnchorPoint=function(c,g,m,n,x){if(null!=g&&null!=c){c=this.graph.getAllConnectionConstraints(g);n=m=null;if(null!=c)for(var F=0;F<c.length;F++){var I=this.graph.getConnectionPoint(g,c[F]);if(null!=I){var M=(I.x-x.x)*(I.x-x.x)+(I.y-x.y)*(I.y-x.y);if(null==n||M<n)m=I,n=M}}null!=m&&(x=m)}return x};
var E=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(c,g,m){var n=E.apply(this,arguments);"1"==c.getAttribute("placeholders")&&null!=m.state&&(n=m.state.view.graph.replacePlaceholders(m.state.cell,n));return n};var Q=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(c){if(null!=c.style&&"undefined"!==typeof pako){var g=mxUtils.getValue(c.style,mxConstants.STYLE_SHAPE,null);if(null!=g&&"string"===typeof g&&"stencil("==g.substring(0,
8))try{var m=g.substring(8,g.length-1),n=mxUtils.parseXml(Graph.decompress(m));return new mxShape(new mxStencil(n.documentElement))}catch(x){null!=window.console&&console.log("Error in shape: "+x)}}return Q.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[];mxStencilRegistry.filesLoaded={};mxStencilRegistry.isFileLoaded=function(b){return!mxClient.IS_FF&&mxStencilRegistry.filesLoaded[b]};
mxStencilRegistry.setFileLoaded=function(b){mxStencilRegistry.filesLoaded[b]=!0};
mxStencilRegistry.getStencil=function(b){var f=mxStencilRegistry.stencils[b];if(null==f&&null==mxCellRenderer.defaultShapes[b]&&mxStencilRegistry.dynamicLoading){var l=mxStencilRegistry.getBasenameForStencil(b);if(null!=l){f=mxStencilRegistry.libraries[l];if(null!=f){if(null==mxStencilRegistry.packages[l]){for(var u=0;u<f.length;u++){var y=f[u];if(!mxStencilRegistry.isFileLoaded(y))if(mxStencilRegistry.setFileLoaded(y),".xml"==y.toLowerCase().substring(y.length-4,y.length))mxStencilRegistry.loadStencilSet(y,
null);else if(".js"==y.toLowerCase().substring(y.length-3,y.length))try{if(mxStencilRegistry.allowEval){var q=mxUtils.load(y);null!=q&&200<=q.getStatus()&&299>=q.getStatus()&&eval.call(window,q.getText())}}catch(B){null!=window.console&&console.log("error in getStencil:",b,l,f,y,B)}}mxStencilRegistry.packages[l]=1}}else l=l.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+l+".xml",null);f=mxStencilRegistry.stencils[b]}}return f};
mxStencilRegistry.getBasenameForStencil=function(b){var f=null;if(null!=b&&"string"===typeof b&&(b=b.split("."),0<b.length&&"mxgraph"==b[0])){f=b[1];for(var l=2;l<b.length-1;l++)f+="/"+b[l]}return f};
mxStencilRegistry.loadStencilSet=function(b,f,l,u){var y=mxStencilRegistry.packages[b];if(null!=l&&l||null==y){var q=!1;if(null==y)try{if(u){mxStencilRegistry.loadStencil(b,mxUtils.bind(this,function(B){null!=B&&null!=B.documentElement&&(mxStencilRegistry.packages[b]=B,q=!0,mxStencilRegistry.parseStencilSet(B.documentElement,f,q))}));return}y=mxStencilRegistry.loadStencil(b);mxStencilRegistry.packages[b]=y;q=!0}catch(B){null!=window.console&&console.log("error in loadStencilSet:",b,B)}null!=y&&null!=
y.documentElement&&mxStencilRegistry.parseStencilSet(y.documentElement,f,q)}};mxStencilRegistry.loadStencil=function(b,f){if(null!=f)mxUtils.get(b,mxUtils.bind(this,function(l){f(200<=l.getStatus()&&299>=l.getStatus()?l.getXml():null)}),mxUtils.bind(this,function(l){f(null)}));else return mxUtils.load(b).getXml()};mxStencilRegistry.parseStencilSets=function(b){for(var f=0;f<b.length;f++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(b[f]).documentElement)};
mxStencilRegistry.parseStencilSet=function(b,f,l){if("stencils"==b.nodeName)for(var u=b.firstChild;null!=u;)"shapes"==u.nodeName&&mxStencilRegistry.parseStencilSet(u,f,l),u=u.nextSibling;else{l=null!=l?l:!0;u=b.firstChild;var y="";b=b.getAttribute("name");for(null!=b&&(y=b+".");null!=u;){if(u.nodeType==mxConstants.NODETYPE_ELEMENT&&(b=u.getAttribute("name"),null!=b)){y=y.toLowerCase();var q=b.replace(/ /g,"_");l&&mxStencilRegistry.addStencil(y+q.toLowerCase(),new mxStencil(u));if(null!=f){var B=u.getAttribute("w"),
H=u.getAttribute("h");B=null==B?80:parseInt(B,10);H=null==H?80:parseInt(H,10);f(y,q,b,B,H)}}u=u.nextSibling}}};
"undefined"!==typeof mxVertexHandler&&function(){function b(){var C=document.createElement("div");C.className="geHint";C.style.whiteSpace="nowrap";C.style.position="absolute";return C}function f(C,P){switch(P){case mxConstants.POINTS:return C;case mxConstants.MILLIMETERS:return(C/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.METERS:return(C/(1E3*mxConstants.PIXELS_PER_MM)).toFixed(4);case mxConstants.INCHES:return(C/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(C){return!mxEvent.isAltDown(C)||mxEvent.isShiftDown(C)};var l=mxGraphLayout.prototype.isVertexIgnored;mxGraphLayout.prototype.isVertexIgnored=function(C){return l.apply(this,arguments)||this.graph.isTableRow(C)||this.graph.isTableCell(C)};var u=mxGraphLayout.prototype.isEdgeIgnored;mxGraphLayout.prototype.isEdgeIgnored=
function(C){return u.apply(this,arguments)||this.graph.isEdgeIgnored(C)};var y=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(C){return this.graph.isCloneEvent(C)!=y.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var C=new mxEllipse(null,this.highlightColor,this.highlightColor,0);C.opacity=mxConstants.HIGHLIGHT_OPACITY;return C};mxConnectionHandler.prototype.livePreview=!0;mxConnectionHandler.prototype.cursor=
"crosshair";mxConnectionHandler.prototype.createEdgeState=function(C){C=this.graph.createCurrentEdgeStyle();C=this.graph.createEdge(null,null,null,null,null,C);C=new mxCellState(this.graph.view,C,this.graph.getCellStyle(C));for(var P in this.graph.currentEdgeStyle)C.style[P]=this.graph.currentEdgeStyle[P];if(null!=this.previous){var R=this.previous.style.newEdgeStyle;if(null!=R)try{var W=JSON.parse(R);for(P in W)C.style[P]=W[P]}catch(ia){}}C.style=this.graph.postProcessCellStyle(C.cell,C.style);return C};
var q=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var C=q.apply(this,arguments);C.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return C};mxConnectionHandler.prototype.updatePreview=function(C){};var B=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var C=B.apply(this,arguments),P=C.getCell;C.getCell=mxUtils.bind(this,function(R){var W=P.apply(this,arguments);this.error=null;return W});
return C};Graph.prototype.defaultVertexStyle={};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.createCurrentEdgeStyle=function(){for(var C="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";",P="shape curved rounded comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification comicStyle jumpStyle jumpSize".split(" "),R=0;R<P.length;R++)null!=
this.currentEdgeStyle[P[R]]&&(C+=P[R]+"="+this.currentEdgeStyle[P[R]]+";");null!=this.currentEdgeStyle.orthogonalLoop?C+="orthogonalLoop="+this.currentEdgeStyle.orthogonalLoop+";":null!=Graph.prototype.defaultEdgeStyle.orthogonalLoop&&(C+="orthogonalLoop="+Graph.prototype.defaultEdgeStyle.orthogonalLoop+";");null!=this.currentEdgeStyle.jettySize?C+="jettySize="+this.currentEdgeStyle.jettySize+";":null!=Graph.prototype.defaultEdgeStyle.jettySize&&(C+="jettySize="+Graph.prototype.defaultEdgeStyle.jettySize+
";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(C+="elbow="+this.currentEdgeStyle.elbow+";");return C=null!=this.currentEdgeStyle.html?C+("html="+this.currentEdgeStyle.html+";"):C+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var C=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=
C&&(new mxCodec(C.ownerDocument)).decode(C,this.getStylesheet())};Graph.prototype.createCellLookup=function(C,P){P=null!=P?P:{};for(var R=0;R<C.length;R++){var W=C[R];P[mxObjectIdentity.get(W)]=W.getId();for(var ia=this.model.getChildCount(W),ka=0;ka<ia;ka++)this.createCellLookup([this.model.getChildAt(W,ka)],P)}return P};Graph.prototype.createCellMapping=function(C,P,R){R=null!=R?R:{};for(var W in C){var ia=P[W];null==R[ia]&&(R[ia]=C[W].getId()||"")}return R};Graph.prototype.importGraphModel=function(C,
P,R,W){P=null!=P?P:0;R=null!=R?R:0;var ia=new mxCodec(C.ownerDocument),ka=new mxGraphModel;ia.decode(C,ka);C=[];ia={};var pa={},xa=ka.getChildren(this.cloneCell(ka.root,this.isCloneInvalidEdges(),ia));if(null!=xa){var ta=this.createCellLookup([ka.root]);xa=xa.slice();this.model.beginUpdate();try{if(1!=xa.length||this.isCellLocked(this.getDefaultParent()))for(ka=0;ka<xa.length;ka++)ua=this.model.getChildren(this.moveCells([xa[ka]],P,R,!1,this.model.getRoot())[0]),null!=ua&&(C=C.concat(ua));else{var ua=
ka.getChildren(xa[0]);null!=ua&&(C=this.moveCells(ua,P,R,!1,this.getDefaultParent()),pa[ka.getChildAt(ka.root,0).getId()]=this.getDefaultParent().getId())}if(null!=C&&(this.createCellMapping(ia,ta,pa),this.updateCustomLinks(pa,C),W)){this.isGridEnabled()&&(P=this.snap(P),R=this.snap(R));var Ia=this.getBoundingBoxFromGeometry(C,!0);null!=Ia&&this.moveCells(C,P-Ia.x,R-Ia.y)}}finally{this.model.endUpdate()}}return C};Graph.prototype.encodeCells=function(C){for(var P={},R=this.cloneCells(C,null,P),W=
new mxDictionary,ia=0;ia<C.length;ia++)W.put(C[ia],!0);var ka=new mxCodec,pa=new mxGraphModel,xa=pa.getChildAt(pa.getRoot(),0);for(ia=0;ia<R.length;ia++){pa.add(xa,R[ia]);var ta=this.view.getState(C[ia]);if(null!=ta){var ua=this.getCellGeometry(R[ia]);null!=ua&&ua.relative&&!this.model.isEdge(C[ia])&&null==W.get(this.model.getParent(C[ia]))&&(ua.offset=null,ua.relative=!1,ua.x=ta.x/ta.view.scale-ta.view.translate.x,ua.y=ta.y/ta.view.scale-ta.view.translate.y)}}this.updateCustomLinks(this.createCellMapping(P,
this.createCellLookup(C)),R);return ka.encode(pa)};Graph.prototype.isSwimlane=function(C,P){var R=null;null==C||this.model.isEdge(C)||this.model.getParent(C)==this.model.getRoot()||(R=this.getCurrentCellStyle(C,P)[mxConstants.STYLE_SHAPE]);return R==mxConstants.SHAPE_SWIMLANE||"table"==R||"tableRow"==R};var H=Graph.prototype.isCellEditable;Graph.prototype.isCellEditable=function(C){return null!=C&&H.apply(this,arguments)?this.isTableCell(C)||this.isTableRow(C)?this.isCellEditable(this.model.getParent(C)):
!0:!1};var S=Graph.prototype.isCellMovable;Graph.prototype.isCellMovable=function(C){return null!=C&&S.apply(this,arguments)?this.isTableCell(C)||this.isTableRow(C)?this.isCellMovable(this.model.getParent(C)):!0:!1};var E=Graph.prototype.isExtendParent;Graph.prototype.isExtendParent=function(C){var P=this.model.getParent(C);if(null!=P){var R=this.getCurrentCellStyle(P);if(null!=R.expand)return"0"!=R.expand}return E.apply(this,arguments)&&(null==P||!this.isTable(P))};var Q=Graph.prototype.splitEdge;
Graph.prototype.splitEdge=function(C,P,R,W,ia,ka,pa,xa){null==xa&&(xa=this.model.getParent(C),this.isTable(xa)||this.isTableRow(xa))&&(xa=this.getCellAt(ka,pa,null,!0,!1));R=null;this.model.beginUpdate();try{R=Q.apply(this,[C,P,R,W,ia,ka,pa,xa]);this.model.setValue(R,"");var ta=this.getChildCells(R,!0);for(P=0;P<ta.length;P++){var ua=this.getCellGeometry(ta[P]);null!=ua&&ua.relative&&0<ua.x&&this.model.remove(ta[P])}var Ia=this.getChildCells(C,!0);for(P=0;P<Ia.length;P++)ua=this.getCellGeometry(Ia[P]),
null!=ua&&ua.relative&&0>=ua.x&&this.model.remove(Ia[P]);var Va=this.model.getTerminal(R,!1);if(null!=Va){var Wa=this.getCurrentCellStyle(Va);null!=Wa&&"1"==Wa.snapToPoint&&(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[C]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[C]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[R]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[R]))}}finally{this.model.endUpdate()}return R};var c=Graph.prototype.selectCell;Graph.prototype.selectCell=function(C,
P,R){if(P||R)c.apply(this,arguments);else{var W=this.getSelectionCell(),ia=null,ka=[],pa=mxUtils.bind(this,function(xa){if(null!=this.view.getState(xa)&&(this.model.isVertex(xa)||this.model.isEdge(xa)))if(ka.push(xa),xa==W)ia=ka.length-1;else if(C&&null==W&&0<ka.length||null!=ia&&C&&ka.length>ia||!C&&0<ia)return;for(var ta=0;ta<this.model.getChildCount(xa);ta++)pa(this.model.getChildAt(xa,ta))});pa(this.model.root);0<ka.length&&(ia=null!=ia?mxUtils.mod(ia+(C?1:-1),ka.length):0,this.setSelectionCell(ka[ia]))}};
Graph.prototype.swapShapes=function(C,P){if(this.model.isVertex(C)&&this.model.isVertex(P)&&2==this.getMovableCells([C,P]).length){var R=this.getCellGeometry(C),W=this.getCellGeometry(P);if(null!=R&&null!=W){var ia=R.clone(),ka=W.clone();this.model.beginUpdate();try{ia.x=W.getCenterX()-R.width/2,ia.y=W.getCenterY()-R.height/2,ka.x=R.getCenterX()-W.width/2,ka.y=R.getCenterY()-W.height/2,this.model.setGeometry(C,ia),this.model.setGeometry(P,ka)}finally{this.model.endUpdate()}}}};var g=Graph.prototype.moveCells;
Graph.prototype.moveCells=function(C,P,R,W,ia,ka,pa){pa=null!=pa?pa:{};if(this.isTable(ia)){for(var xa=[],ta=0;ta<C.length;ta++)this.isTable(C[ta])?xa=xa.concat(this.model.getChildCells(C[ta],!0).reverse()):xa.push(C[ta]);C=xa}this.model.beginUpdate();try{xa=[];for(ta=0;ta<C.length;ta++)if(null!=ia&&this.isTableRow(C[ta])){var ua=this.model.getParent(C[ta]),Ia=this.getCellGeometry(C[ta]);this.isTable(ua)&&xa.push(ua);if(null!=ua&&null!=Ia&&this.isTable(ua)&&this.isTable(ia)&&(W||ua!=ia)){if(!W){var Va=
this.getCellGeometry(ua);null!=Va&&(Va=Va.clone(),Va.height-=Ia.height,this.model.setGeometry(ua,Va))}Va=this.getCellGeometry(ia);null!=Va&&(Va=Va.clone(),Va.height+=Ia.height,this.model.setGeometry(ia,Va));var Wa=this.model.getChildCells(ia,!0);if(0<Wa.length){C[ta]=W?this.cloneCell(C[ta]):C[ta];var Ta=this.model.getChildCells(C[ta],!0),ab=this.model.getChildCells(Wa[0],!0),Pa=ab.length-Ta.length;if(0<Pa)for(var Sa=0;Sa<Pa;Sa++){var gb=this.cloneCell(Ta[Ta.length-1]);null!=gb&&(gb.value="",this.model.add(C[ta],
gb))}else if(0>Pa)for(Sa=0;Sa>Pa;Sa--)this.model.remove(Ta[Ta.length+Sa-1]);Ta=this.model.getChildCells(C[ta],!0);for(Sa=0;Sa<ab.length;Sa++){var fb=this.getCellGeometry(ab[Sa]),cb=this.getCellGeometry(Ta[Sa]);null!=fb&&null!=cb&&(cb=cb.clone(),cb.width=fb.width,this.model.setGeometry(Ta[Sa],cb))}}}}var eb=g.apply(this,arguments);for(ta=0;ta<xa.length;ta++)!W&&this.model.contains(xa[ta])&&0==this.model.getChildCount(xa[ta])&&this.model.remove(xa[ta]);W&&this.updateCustomLinks(this.createCellMapping(pa,
this.createCellLookup(C)),eb)}finally{this.model.endUpdate()}return eb};var m=Graph.prototype.removeCells;Graph.prototype.removeCells=function(C,P){var R=[];this.model.beginUpdate();try{for(var W=0;W<C.length;W++)if(this.isTableCell(C[W])){var ia=this.model.getParent(C[W]),ka=this.model.getParent(ia);1==this.model.getChildCount(ia)&&1==this.model.getChildCount(ka)?0>mxUtils.indexOf(C,ka)&&0>mxUtils.indexOf(R,ka)&&R.push(ka):this.labelChanged(C[W],"")}else{if(this.isTableRow(C[W])&&(ka=this.model.getParent(C[W]),
0>mxUtils.indexOf(C,ka)&&0>mxUtils.indexOf(R,ka))){for(var pa=this.model.getChildCells(ka,!0),xa=0,ta=0;ta<pa.length;ta++)0<=mxUtils.indexOf(C,pa[ta])&&xa++;xa==pa.length&&R.push(ka)}R.push(C[W])}R=m.apply(this,[R,P])}finally{this.model.endUpdate()}return R};Graph.prototype.updateCustomLinks=function(C,P,R){R=null!=R?R:new Graph;for(var W=0;W<P.length;W++)null!=P[W]&&R.updateCustomLinksForCell(C,P[W],R)};Graph.prototype.updateCustomLinksForCell=function(C,P){this.doUpdateCustomLinksForCell(C,P);for(var R=
this.model.getChildCount(P),W=0;W<R;W++)this.updateCustomLinksForCell(C,this.model.getChildAt(P,W))};Graph.prototype.doUpdateCustomLinksForCell=function(C,P){};Graph.prototype.getAllConnectionConstraints=function(C,P){if(null!=C){P=mxUtils.getValue(C.style,"points",null);if(null!=P){C=[];try{var R=JSON.parse(P);for(P=0;P<R.length;P++){var W=R[P];C.push(new mxConnectionConstraint(new mxPoint(W[0],W[1]),2<W.length?"0"!=W[2]:!0,null,3<W.length?W[3]:0,4<W.length?W[4]:0))}}catch(ka){}return C}if(null!=
C.shape&&null!=C.shape.bounds){W=C.shape.direction;P=C.shape.bounds;var ia=C.shape.scale;R=P.width/ia;P=P.height/ia;if(W==mxConstants.DIRECTION_NORTH||W==mxConstants.DIRECTION_SOUTH)W=R,R=P,P=W;P=C.shape.getConstraints(C.style,R,P);if(null!=P)return P;if(null!=C.shape.stencil&&null!=C.shape.stencil.constraints)return C.shape.stencil.constraints;if(null!=C.shape.constraints)return C.shape.constraints}}return null};Graph.prototype.flipEdge=function(C){if(null!=C){var P=this.getCurrentCellStyle(C);P=
mxUtils.getValue(P,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,P,[C])}};Graph.prototype.isValidRoot=function(C){for(var P=this.model.getChildCount(C),R=0,W=0;W<P;W++){var ia=this.model.getChildAt(C,W);this.model.isVertex(ia)&&(ia=this.getCellGeometry(ia),null==ia||ia.relative||R++)}return 0<R||this.isContainer(C)};Graph.prototype.isValidDropTarget=function(C,P,
R){for(var W=this.getCurrentCellStyle(C),ia=!0,ka=!0,pa=0;pa<P.length&&ka;pa++)ia=ia&&this.isTable(P[pa]),ka=ka&&this.isTableRow(P[pa]);return!this.isCellLocked(C)&&(this.isTargetShape(C,P,R)||("1"!=mxUtils.getValue(W,"part","0")||this.isContainer(C))&&"0"!=mxUtils.getValue(W,"dropTarget","1")&&(mxGraph.prototype.isValidDropTarget.apply(this,arguments)||this.isContainer(C))&&!this.isTableRow(C)&&(!this.isTable(C)||ka||ia))};Graph.prototype.createGroupCell=function(){var C=mxGraph.prototype.createGroupCell.apply(this,
arguments);C.setStyle("group");return C};Graph.prototype.isExtendParentsOnAdd=function(C){var P=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(P&&null!=C&&null!=this.layoutManager){var R=this.model.getParent(C);null!=R&&(R=this.layoutManager.getLayout(R),null!=R&&R.constructor==mxStackLayout&&(P=!1))}return P};Graph.prototype.getPreferredSizeForCell=function(C,P,R){R=null!=R?R:this.gridEnabled;var W=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=W&&(W.width+=
10,W.height+=4,R&&(W.width=this.snap(W.width),W.height=this.snap(W.height)));return W};Graph.prototype.turnShapes=function(C,P){var R=this.getModel(),W=[];R.beginUpdate();try{for(var ia=0;ia<C.length;ia++){var ka=C[ia];if(R.isEdge(ka)){var pa=R.getTerminal(ka,!0),xa=R.getTerminal(ka,!1);R.setTerminal(ka,xa,!0);R.setTerminal(ka,pa,!1);var ta=R.getGeometry(ka);if(null!=ta){ta=ta.clone();null!=ta.points&&ta.points.reverse();var ua=ta.getTerminalPoint(!0),Ia=ta.getTerminalPoint(!1);ta.setTerminalPoint(ua,
!1);ta.setTerminalPoint(Ia,!0);R.setGeometry(ka,ta);var Va=this.view.getState(ka),Wa=this.view.getState(pa),Ta=this.view.getState(xa);if(null!=Va){var ab=null!=Wa?this.getConnectionConstraint(Va,Wa,!0):null,Pa=null!=Ta?this.getConnectionConstraint(Va,Ta,!1):null;this.setConnectionConstraint(ka,pa,!0,Pa);this.setConnectionConstraint(ka,xa,!1,ab);var Sa=mxUtils.getValue(Va.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,mxUtils.getValue(Va.style,
mxConstants.STYLE_TARGET_PERIMETER_SPACING),[ka]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,Sa,[ka])}W.push(ka)}}else if(R.isVertex(ka)&&(ta=this.getCellGeometry(ka),null!=ta)){if(!(this.isTable(ka)||this.isTableRow(ka)||this.isTableCell(ka)||this.isSwimlane(ka))){ta=ta.clone();ta.x+=ta.width/2-ta.height/2;ta.y+=ta.height/2-ta.width/2;var gb=ta.width;ta.width=ta.height;ta.height=gb;R.setGeometry(ka,ta)}var fb=this.view.getState(ka);if(null!=fb){var cb=[mxConstants.DIRECTION_EAST,
mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_NORTH],eb=mxUtils.getValue(fb.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);this.setCellStyles(mxConstants.STYLE_DIRECTION,cb[mxUtils.mod(mxUtils.indexOf(cb,eb)+(P?-1:1),cb.length)],[ka])}W.push(ka)}}}finally{R.endUpdate()}return W};Graph.prototype.stencilHasPlaceholders=function(C){if(null!=C&&null!=C.fgNode)for(C=C.fgNode.firstChild;null!=C;){if("text"==C.nodeName&&"1"==C.getAttribute("placeholders"))return!0;
C=C.nextSibling}return!1};var n=Graph.prototype.processChange;Graph.prototype.processChange=function(C){if(C instanceof mxGeometryChange&&(this.isTableCell(C.cell)||this.isTableRow(C.cell))&&(null==C.previous&&null!=C.geometry||null!=C.previous&&!C.previous.equals(C.geometry))){var P=C.cell;this.isTableCell(P)&&(P=this.model.getParent(P));this.isTableRow(P)&&(P=this.model.getParent(P));var R=this.view.getState(P);null!=R&&null!=R.shape&&(this.view.invalidate(P),R.shape.bounds=null)}n.apply(this,arguments);
C instanceof mxValueChange&&null!=C.cell&&null!=C.cell.value&&"object"==typeof C.cell.value&&this.invalidateDescendantsWithPlaceholders(C.cell)};Graph.prototype.invalidateDescendantsWithPlaceholders=function(C){C=this.model.getDescendants(C);if(0<C.length)for(var P=0;P<C.length;P++){var R=this.view.getState(C[P]);null!=R&&null!=R.shape&&null!=R.shape.stencil&&this.stencilHasPlaceholders(R.shape.stencil)?this.removeStateForCell(C[P]):this.isReplacePlaceholders(C[P])&&this.view.invalidate(C[P],!1,!1)}};
Graph.prototype.replaceElement=function(C,P){P=C.ownerDocument.createElement(null!=P?P:"span");for(var R=Array.prototype.slice.call(C.attributes);attr=R.pop();)P.setAttribute(attr.nodeName,attr.nodeValue);P.innerHTML=C.innerHTML;C.parentNode.replaceChild(P,C)};Graph.prototype.processElements=function(C,P){if(null!=C){C=C.getElementsByTagName("*");for(var R=0;R<C.length;R++)null!=C[R]&&P(C[R])}};Graph.prototype.updateLabelElements=function(C,P,R){C=null!=C?C:this.getSelectionCells();for(var W=document.createElement("div"),
ia=0;ia<C.length;ia++){var ka=this.getCurrentCellStyle(C[ia]);if(null!=ka&&"1"==ka.html&&(ka=this.convertValueToString(C[ia]),null!=ka&&0<ka.length)){W.innerHTML=Graph.sanitizeHtml(ka);for(var pa=W.getElementsByTagName(null!=R?R:"*"),xa=0;xa<pa.length;xa++)P(pa[xa]);W.innerHTML!=ka&&this.cellLabelChanged(C[ia],W.innerHTML)}}};Graph.prototype.cellLabelChanged=function(C,P,R){P=Graph.zapGremlins(P);this.model.beginUpdate();try{if(null!=C.value&&"object"==typeof C.value){if(this.isReplacePlaceholders(C)&&
null!=C.getAttribute("placeholder"))for(var W=C.getAttribute("placeholder"),ia=C;null!=ia;){if(ia==this.model.getRoot()||null!=ia.value&&"object"==typeof ia.value&&ia.hasAttribute(W)){this.setAttributeForCell(ia,W,P);break}ia=this.model.getParent(ia)}var ka=C.value.cloneNode(!0);Graph.translateDiagram&&null!=Graph.diagramLanguage&&ka.hasAttribute("label_"+Graph.diagramLanguage)?ka.setAttribute("label_"+Graph.diagramLanguage,P):ka.setAttribute("label",P);P=ka}mxGraph.prototype.cellLabelChanged.apply(this,
arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(C){if(null!=C){for(var P=new mxDictionary,R=0;R<C.length;R++)P.put(C[R],!0);var W=[];for(R=0;R<C.length;R++){var ia=this.model.getParent(C[R]);null==ia||P.get(ia)||(P.put(ia,!0),W.push(ia))}for(R=0;R<W.length;R++)if(ia=this.view.getState(W[R]),null!=ia&&(this.model.isEdge(ia.cell)||this.model.isVertex(ia.cell))&&this.isCellDeletable(ia.cell)&&this.isTransparentState(ia)){for(var ka=!0,pa=0;pa<this.model.getChildCount(ia.cell)&&
ka;pa++)P.get(this.model.getChildAt(ia.cell,pa))||(ka=!1);ka&&C.push(ia.cell)}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(C){for(var P=[],R=0;R<C.length;R++)this.isCellDeletable(C[R])&&this.isTransparentState(this.view.getState(C[R]))&&P.push(C[R]);C=P;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(C,P){this.setAttributeForCell(C,"link",P)};Graph.prototype.setTooltipForCell=function(C,
P){var R="tooltip";Graph.translateDiagram&&null!=Graph.diagramLanguage&&mxUtils.isNode(C.value)&&C.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(R="tooltip_"+Graph.diagramLanguage);this.setAttributeForCell(C,R,P)};Graph.prototype.getAttributeForCell=function(C,P,R){C=null!=C.value&&"object"===typeof C.value?C.value.getAttribute(P):null;return null!=C?C:R};Graph.prototype.setAttributeForCell=function(C,P,R){if(null!=C.value&&"object"==typeof C.value)var W=C.value.cloneNode(!0);else W=mxUtils.createXmlDocument().createElement("UserObject"),
W.setAttribute("label",C.value||"");null!=R?W.setAttribute(P,R):W.removeAttribute(P);this.model.setValue(C,W)};Graph.prototype.isTargetShape=function(C,P,R){C=mxUtils.getValue(this.getCurrentCellStyle(C),mxConstants.STYLE_SHAPE,"");for(R=0;R<P.length;R++){var W=mxUtils.getValue(this.getCurrentCellStyle(P[R]),"targetShapes","").split(",");if(0<=mxUtils.indexOf(W,C))return!0}return!1};var x=Graph.prototype.getDropTarget;Graph.prototype.getDropTarget=function(C,P,R,W){if(mxEvent.isAltDown(P))return null;
for(var ia=0;ia<C.length;ia++){var ka=this.model.getParent(C[ia]);if(this.model.isEdge(ka)&&0>mxUtils.indexOf(C,ka))return null}ka=x.apply(this,arguments);var pa=!0;for(ia=0;ia<C.length&&pa;ia++)pa=pa&&this.isTableRow(C[ia]);pa&&(this.isTableCell(ka)&&(ka=this.model.getParent(ka)),this.isTableRow(ka)&&(ka=this.model.getParent(ka)),this.isTable(ka)||(ka=null));return ka};Graph.prototype.click=function(C){mxGraph.prototype.click.call(this,C);this.firstClickState=C.getState();this.firstClickSource=C.getSource()};
Graph.prototype.dblClick=function(C,P){this.isEnabled()&&(P=this.insertTextForEvent(C,P),mxGraph.prototype.dblClick.call(this,C,P))};Graph.prototype.insertTextForEvent=function(C,P){var R=mxUtils.convertPoint(this.container,mxEvent.getClientX(C),mxEvent.getClientY(C));if(null!=C&&!this.model.isVertex(P)){var W=this.model.isEdge(P)?this.view.getState(P):null,ia=mxEvent.getSource(C);this.firstClickState!=W||this.firstClickSource!=ia||null!=W&&null!=W.text&&null!=W.text.node&&null!=W.text.boundingBox&&
(mxUtils.contains(W.text.boundingBox,R.x,R.y)||mxUtils.isAncestorNode(W.text.node,mxEvent.getSource(C)))||(null!=W||this.isCellLocked(this.getDefaultParent()))&&(null==W||this.isCellLocked(W.cell))||!(null!=W||mxClient.IS_SVG&&ia==this.view.getCanvas().ownerSVGElement)||(null==W&&(W=this.view.getState(this.getCellAt(R.x,R.y))),P=this.addText(R.x,R.y,W))}return P};Graph.prototype.getInsertPoint=function(){var C=this.getGridSize(),P=this.container.scrollLeft/this.view.scale-this.view.translate.x,R=
this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible){var W=this.getPageLayout(),ia=this.getPageSize();P=Math.max(P,W.x*ia.width);R=Math.max(R,W.y*ia.height)}return new mxPoint(this.snap(P+C),this.snap(R+C))};Graph.prototype.getFreeInsertPoint=function(){var C=this.view,P=this.getGraphBounds(),R=this.getInsertPoint(),W=this.snap(Math.round(Math.max(R.x,P.x/C.scale-C.translate.x+(0==P.width?2*this.gridSize:0))));C=this.snap(Math.round(Math.max(R.y,(P.y+P.height)/C.scale-
C.translate.y+2*this.gridSize)));return new mxPoint(W,C)};Graph.prototype.getCenterInsertPoint=function(C){C=null!=C?C: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-C.width/2)),this.snap(Math.round((this.container.scrollTop+this.container.clientHeight/2)/this.view.scale-this.view.translate.y-C.height/2))):new mxPoint(this.snap(Math.round(this.container.clientWidth/
2/this.view.scale-this.view.translate.x-C.width/2)),this.snap(Math.round(this.container.clientHeight/2/this.view.scale-this.view.translate.y-C.height/2)))};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.appendFontSize=function(C,P){C=null!=C?C:"";null!=P&&(0<C.length&&";"!=C.charAt(C.length-1)&&(C+=";"),C+="fontSize="+P+";");return C};Graph.prototype.addText=function(C,P,R){var W=new mxCell;W.value="Text";W.geometry=new mxGeometry(0,0,0,0);W.vertex=!0;if(null!=R&&this.model.isEdge(R.cell)){W.style=
"edgeLabel;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",this.edgeFontSize);W.geometry.relative=!0;W.connectable=!1;var ia=this.view.getRelativePoint(R,C,P);W.geometry.x=Math.round(1E4*ia.x)/1E4;W.geometry.y=Math.round(ia.y);W.geometry.offset=new mxPoint(0,0);ia=this.view.getPoint(R,W.geometry);var ka=this.view.scale;W.geometry.offset=new mxPoint(Math.round((C-ia.x)/ka),Math.round((P-ia.y)/ka))}else ia=this.view.translate,W.style="text;"+this.appendFontSize("html=1;align=center;verticalAlign=middle;resizable=0;points=[];",
this.vertexFontSize),W.geometry.width=40,W.geometry.height=20,W.geometry.x=Math.round(C/this.view.scale)-ia.x-(null!=R?R.origin.x:0),W.geometry.y=Math.round(P/this.view.scale)-ia.y-(null!=R?R.origin.y:0),W.style+="autosize=1;";this.getModel().beginUpdate();try{this.addCells([W],null!=R?R.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[W])),this.autoSizeCell(W)}finally{this.getModel().endUpdate()}return W};Graph.prototype.addClickHandler=function(C,P,R){var W=mxUtils.bind(this,
function(){var ta=this.container.getElementsByTagName("a");if(null!=ta)for(var ua=0;ua<ta.length;ua++){var Ia=this.getAbsoluteUrl(ta[ua].getAttribute("href"));null!=Ia&&(ta[ua].setAttribute("rel",this.linkRelation),ta[ua].setAttribute("href",Ia),null!=P&&mxEvent.addGestureListeners(ta[ua],null,null,P))}});this.model.addListener(mxEvent.CHANGE,W);W();var ia=this.container.style.cursor,ka=this.getTolerance(),pa=this,xa={currentState:null,currentLink:null,currentTarget:null,highlight:null!=C&&""!=C&&
C!=mxConstants.NONE?new mxCellHighlight(pa,C,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(ta){var ua=ta.sourceState;if(null==ua||null==pa.getLinkForCell(ua.cell))ta=pa.getCellAt(ta.getGraphX(),ta.getGraphY(),null,null,null,function(Ia,Va,Wa){return null==pa.getLinkForCell(Ia.cell)}),ua=null==ua||pa.model.isAncestor(ta,ua.cell)?pa.view.getState(ta):null;ua!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=ua,null!=this.currentState&&this.activate(this.currentState))},
mouseDown:function(ta,ua){this.startX=ua.getGraphX();this.startY=ua.getGraphY();this.scrollLeft=pa.container.scrollLeft;this.scrollTop=pa.container.scrollTop;null==this.currentLink&&"auto"==pa.container.style.overflow&&(pa.container.style.cursor="move");this.updateCurrentState(ua)},mouseMove:function(ta,ua){if(pa.isMouseDown)null!=this.currentLink&&(ta=Math.abs(this.startX-ua.getGraphX()),ua=Math.abs(this.startY-ua.getGraphY()),(ta>ka||ua>ka)&&this.clear());else{for(ta=ua.getSource();null!=ta&&"a"!=
ta.nodeName.toLowerCase();)ta=ta.parentNode;null!=ta?this.clear():(null!=pa.tooltipHandler&&null!=this.currentLink&&null!=this.currentState&&pa.tooltipHandler.reset(ua,!0,this.currentState),(null==this.currentState||ua.getState()!=this.currentState&&null!=ua.sourceState||!pa.intersects(this.currentState,ua.getGraphX(),ua.getGraphY()))&&this.updateCurrentState(ua))}},mouseUp:function(ta,ua){var Ia=ua.getSource();for(ta=ua.getEvent();null!=Ia&&"a"!=Ia.nodeName.toLowerCase();)Ia=Ia.parentNode;null==
Ia&&Math.abs(this.scrollLeft-pa.container.scrollLeft)<ka&&Math.abs(this.scrollTop-pa.container.scrollTop)<ka&&(null==ua.sourceState||!ua.isSource(ua.sourceState.control))&&((mxEvent.isLeftMouseButton(ta)||mxEvent.isMiddleMouseButton(ta))&&!mxEvent.isPopupTrigger(ta)||mxEvent.isTouchEvent(ta))&&(null!=this.currentLink?(Ia=pa.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&Ia||null==P||P(ta,this.currentLink,null!=this.currentState?this.currentState.cell:null),mxEvent.isConsumed(ta)||
(ta=null!=this.currentTarget?this.currentTarget:mxEvent.isMiddleMouseButton(ta)?"_blank":Ia?pa.linkTarget:"_top",pa.openLink(this.currentLink,ta),ua.consume())):null!=R&&!ua.isConsumed()&&Math.abs(this.scrollLeft-pa.container.scrollLeft)<ka&&Math.abs(this.scrollTop-pa.container.scrollTop)<ka&&Math.abs(this.startX-ua.getGraphX())<ka&&Math.abs(this.startY-ua.getGraphY())<ka&&R(ua.getEvent()));this.clear()},activate:function(ta){this.currentLink=pa.getAbsoluteUrl(pa.getLinkForCell(ta.cell));null!=this.currentLink&&
(this.currentTarget=pa.getLinkTargetForCell(ta.cell),pa.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(ta))},clear:function(){null!=pa.container&&(pa.container.style.cursor=ia);this.currentLink=this.currentState=this.currentTarget=null;null!=this.highlight&&this.highlight.hide();null!=pa.tooltipHandler&&pa.tooltipHandler.hide()}};pa.click=function(ta){};pa.addMouseListener(xa);mxEvent.addListener(document,"mouseleave",function(ta){xa.clear()})};Graph.prototype.duplicateCells=
function(C,P){C=null!=C?C:this.getSelectionCells();P=null!=P?P:!0;for(var R=0;R<C.length;R++)this.isTableCell(C[R])&&(C[R]=this.model.getParent(C[R]));C=this.model.getTopmostCells(C);var W=this.getModel(),ia=this.gridSize,ka=[];W.beginUpdate();try{var pa={},xa=this.createCellLookup(C),ta=this.cloneCells(C,!1,pa,!0);for(R=0;R<C.length;R++){var ua=W.getParent(C[R]);if(null!=ua){var Ia=this.moveCells([ta[R]],ia,ia,!1)[0];ka.push(Ia);if(P)W.add(ua,ta[R]);else{var Va=ua.getIndex(C[R]);W.add(ua,ta[R],Va+
1)}if(this.isTable(ua)){var Wa=this.getCellGeometry(ta[R]),Ta=this.getCellGeometry(ua);null!=Wa&&null!=Ta&&(Ta=Ta.clone(),Ta.height+=Wa.height,W.setGeometry(ua,Ta))}}else ka.push(ta[R])}this.updateCustomLinks(this.createCellMapping(pa,xa),ta,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",ta))}finally{W.endUpdate()}return ka};Graph.prototype.insertImage=function(C,P,R){if(null!=C&&null!=this.cellEditor.textarea){for(var W=this.cellEditor.textarea.getElementsByTagName("img"),ia=
[],ka=0;ka<W.length;ka++)ia.push(W[ka]);document.execCommand("insertimage",!1,C);C=this.cellEditor.textarea.getElementsByTagName("img");if(C.length==ia.length+1)for(ka=C.length-1;0<=ka;ka--)if(0==ka||C[ka]!=ia[ka-1]){C[ka].setAttribute("width",P);C[ka].setAttribute("height",R);break}}};Graph.prototype.insertLink=function(C){if(null!=this.cellEditor.textarea)if(0==C.length)document.execCommand("unlink",!1);else if(mxClient.IS_FF){for(var P=this.cellEditor.textarea.getElementsByTagName("a"),R=[],W=
0;W<P.length;W++)R.push(P[W]);document.execCommand("createlink",!1,mxUtils.trim(C));P=this.cellEditor.textarea.getElementsByTagName("a");if(P.length==R.length+1)for(W=P.length-1;0<=W;W--)if(P[W]!=R[W-1]){for(P=P[W].getElementsByTagName("a");0<P.length;){for(R=P[0].parentNode;null!=P[0].firstChild;)R.insertBefore(P[0].firstChild,P[0]);R.removeChild(P[0])}break}}else document.execCommand("createlink",!1,mxUtils.trim(C))};Graph.prototype.isCellResizable=function(C){var P=mxGraph.prototype.isCellResizable.apply(this,
arguments),R=this.getCurrentCellStyle(C);return!this.isTableCell(C)&&!this.isTableRow(C)&&(P||"0"!=mxUtils.getValue(R,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==R[mxConstants.STYLE_WHITE_SPACE])};Graph.prototype.distributeCells=function(C,P,R){null==P&&(P=this.getSelectionCells());if(null!=P&&1<P.length){for(var W=[],ia=null,ka=null,pa=0,xa=0;xa<P.length;xa++)if(this.getModel().isVertex(P[xa])){var ta=this.view.getState(P[xa]);if(null!=ta){var ua=C?ta.getCenterX():ta.getCenterY();ia=null!=ia?Math.max(ia,
ua):ua;ka=null!=ka?Math.min(ka,ua):ua;R&&(pa+=C?ta.width:ta.height);W.push(ta)}}if(2<W.length){W.sort(function(ab,Pa){return C?ab.x-Pa.x:ab.y-Pa.y});R&&(pa-=C?W[0].width/2+W[W.length-1].width/2:W[0].height/2+W[W.length-1].height/2);ta=this.view.translate;ua=this.view.scale;ka=ka/ua-(C?ta.x:ta.y);ia=ia/ua-(C?ta.x:ta.y);this.getModel().beginUpdate();try{var Ia=(ia-ka-pa)/(W.length-1),Va=ka+(R?C?W[0].width/2:W[0].height/2:0);for(xa=1;xa<W.length-1;xa++){var Wa=this.view.getState(this.model.getParent(W[xa].cell)),
Ta=this.getCellGeometry(W[xa].cell);Va+=Ia;null!=Ta&&null!=Wa&&(Ta=Ta.clone(),C?Ta.x=Math.round(Va-(R?0:Ta.width/2))-Wa.origin.x:Ta.y=Math.round(Va-(R?0:Ta.height/2))-Wa.origin.y,this.getModel().setGeometry(W[xa].cell,Ta));R&&(Va+=C?W[xa].width:W[xa].height)}}finally{this.getModel().endUpdate()}}}return P};Graph.prototype.isCloneEvent=function(C){return mxClient.IS_MAC&&mxEvent.isMetaDown(C)||mxEvent.isControlDown(C)};Graph.prototype.createSvgImageExport=function(C){C=new mxImageExport;C.addCellData=
function(R,W,ia){W.setAttribute("data-cell-id",R.id);if(ia)if(mxUtils.isNode(R.value))for(ia=0;ia<R.value.attributes.length;ia++){var ka=R.value.attributes[ia];W.setAttribute("data-cell-"+ka.name,ka.value)}else if("object"===typeof R.value)for(ka in R.value)W.setAttribute("data-cell-"+ka,R.value[ka]);else null!=R.value&&W.setAttribute("data-cell-value",R.value);return W};var P=C.visitStatesRecursive;C.visitStatesRecursive=function(R,W,ia){if(null!=R){var ka=W.root,pa=W.root.ownerDocument;W.root=this.addCellData(R.cell,
null!=pa.createElementNS?pa.createElementNS(mxConstants.NS_SVG,"g"):pa.createElement("g"),Editor.addSvgMetadata);ka.appendChild(W.root);P.apply(this,arguments);W.root=ka}};C.getLinkForCellState=mxUtils.bind(this,function(R,W){return this.getLinkForCell(R.cell)});C.getTitleForCellState=mxUtils.bind(this,function(R,W){return Editor.convertHtmlToText(this.convertValueToTooltip(R.cell))});return C};Graph.prototype.parseBackgroundImage=function(C){var P=null;null!=C&&0<C.length&&(C=JSON.parse(C),P=new mxImage(C.src,
C.width,C.height));return P};Graph.prototype.getBackgroundImageObject=function(C){return C};Graph.prototype.getSvg=function(C,P,R,W,ia,ka,pa,xa,ta,ua,Ia,Va,Wa,Ta,ab,Pa){var Sa=null;if(null!=Ta)for(Sa=new mxDictionary,Ia=0;Ia<Ta.length;Ia++)Sa.put(Ta[Ia],!0);Ta=this.useCssTransforms;var gb=this.enableFlowAnimation;this.enableFlowAnimation=!1;Ta&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{P=null!=P?P:1;R=null!=R?R:0;ia=null!=ia?ia:!0;ka=null!=ka?ka:!0;pa=null!=pa?pa:
!0;ua=null!=ua?ua:!1;var fb="page"==Wa?this.view.getBackgroundPageBounds():ka&&null==Sa||W||"diagram"==Wa?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells()),cb=this.backgroundImage,eb=this.view.translate,lb=this.view.scale;"diagram"==Wa&&null!=cb&&null!=cb.width&&null!=cb.height&&(fb=mxRectangle.fromRectangle(fb),fb.add(new mxRectangle((eb.x+cb.x)*lb,(eb.y+cb.y)*lb,cb.width*lb,cb.height*lb)));if(null==fb)throw Error(mxResources.get("drawingEmpty"));W=P/lb;var kb=Math.max(1,Math.ceil(fb.width*
W)+2*R)+(ua&&0==R?5:0),ob=Math.max(1,Math.ceil(fb.height*W)+2*R)+(ua&&0==R?5:0);ia=ia?-.5:0;var hb=mxUtils.getLightDarkColor(C),pb=Graph.createSvgNode(ia,ia,kb,ob,hb),sb=pb.ownerDocument;if(null!=C){var ib=mxUtils.createElementNs(sb,mxConstants.NS_SVG,"rect");ib.setAttribute("fill",hb.light);ib.style.fill=hb.cssText;ib.setAttribute("width","100%");ib.setAttribute("height","100%");ib.setAttribute("x","0");ib.setAttribute("y","0");pb.appendChild(ib)}var mb=mxUtils.createElementNs(sb,mxConstants.NS_SVG,
"g");pb.appendChild(mb);var nb=this.createSvgCanvas(mb);nb.translate(Math.floor(R/P-fb.x/lb),Math.floor(R/P-fb.y/lb));nb.idPrefix="drawio-svg-"+Editor.guid();var qb=document.createElement("div"),ub=nb.getAlternateText;nb.getAlternateText=function(bb,yb,tb,xb,vb,rb,Db,Fb,d,p,A,t,z){if(null!=rb&&0<this.state.fontSize)try{mxUtils.isNode(rb)?rb=rb.innerText:(qb.innerHTML=rb,rb=mxUtils.extractTextWithWhitespace(qb.childNodes));for(var D=Math.ceil(2*xb/this.state.fontSize),G=[],ea=0,O=0;(0==D||ea<D)&&O<
rb.length;){var sa=rb.charCodeAt(O);if(10==sa||13==sa){if(0<ea)break}else G.push(rb.charAt(O)),255>sa&&ea++;O++}G.length<rb.length&&1<rb.length-G.length&&(rb=mxUtils.trim(G.join(""))+"...");return rb}catch(ma){return ub.apply(this,arguments)}else return ub.apply(this,arguments)};null!=cb&&null!=cb.width&&null!=cb.height&&(C=lb/P,ia=new mxRectangle((cb.x+eb.x)*C,(cb.y+eb.y)*C,cb.width*C,cb.height*C),mxUtils.intersects(fb,ia)&&nb.image(cb.x+eb.x,cb.y+eb.y,cb.width,cb.height,cb.src,!0));nb.scale(W);
nb.textEnabled=pa;xa=null!=xa?xa:this.createSvgImageExport();var zb=xa.getLinkForCellState;xa.getLinkForCellState=function(bb,yb){var tb=bb.view.graph.getAbsoluteUrl(zb.apply(this,arguments));return null==tb||bb.view.graph.isCustomLink(tb)?null:tb};xa.getLinkTargetForCellState=function(bb,yb){return bb.view.graph.getLinkTargetForCell(bb.cell)};var Cb=xa.drawCellState,Ab=null,Bb=mxUtils.bind(this,function(){if(null==Ab){Ab="ge-flow-animation-"+Editor.guid();var bb=null!=sb.createElementNS?sb.createElementNS(mxConstants.NS_SVG,
"style"):sb.createElement("style");bb.innerHTML=this.createFlowAnimationCss(Ab);sb.getElementsByTagName("defs")[0].appendChild(bb)}return Ab});xa.drawCellState=function(bb,yb){for(var tb=bb.view.graph,xb=null!=Sa?Sa.get(bb.cell):tb.isCellSelected(bb.cell),vb=tb.model.getParent(bb.cell);!(ka&&null==Sa||xb)&&null!=vb;)xb=null!=Sa?Sa.get(vb):tb.isCellSelected(vb),vb=tb.model.getParent(vb);if(null!=bb.shape)try{var rb=bb.shape.isFlowAnimationEnabled,Db=bb.shape.addFlowAnimationToShape;bb.shape.isFlowAnimationEnabled=
function(){return gb&&tb.model.isEdge(bb.cell)&&"1"==mxUtils.getValue(bb.style,"flowAnimation","0")};bb.shape.addFlowAnimationToShape=function(){tb.addFlowAnimationToNode(this.getFlowAnimationPath(),bb.style,P,Bb())};if(ka&&null==Sa||xb)tb.view.redrawEnumerationState(bb),Cb.apply(this,arguments),this.doDrawShape(bb.secondLabel,yb)}finally{bb.shape.isFlowAnimationEnabled=rb,bb.shape.addFlowAnimationToShape=Db}};var wb=null!=this.view.currentRoot?this.view.currentRoot:this.model.root;xa.drawState(this.getView().getState(wb),
nb);this.addForeignObjectWarning(nb,pb);Pa?this.disableSvgLinks(pb):this.updateSvgLinks(pb,ta,!0);return pb}finally{this.enableFlowAnimation=gb,Ta&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.addForeignObjectWarning=function(C,P){if("0"!=urlParams["svg-warning"]&&0<P.getElementsByTagName("foreignObject").length){var R=C.createElement("switch"),W=C.createElement("g");W.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var ia=
C.createElement("a");ia.setAttribute("transform","translate(0,-5)");null==ia.setAttributeNS||P.ownerDocument!=document&&null==document.documentMode?(ia.setAttribute("xlink:href",Graph.foreignObjectWarningLink),ia.setAttribute("target","_blank")):(ia.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Graph.foreignObjectWarningLink),ia.setAttributeNS(mxConstants.NS_XLINK,"target","_blank"));C=C.createElement("text");C.setAttribute("text-anchor","middle");C.setAttribute("font-size","10px");C.setAttribute("x",
"50%");C.setAttribute("y","100%");mxUtils.write(C,Graph.foreignObjectWarningText);R.appendChild(W);ia.appendChild(C);R.appendChild(ia);P.appendChild(R)}};Graph.prototype.disableSvgLinks=function(C,P){C=C.getElementsByTagName("a");for(var R=0;R<C.length;R++){var W=C[R].getAttribute("href");null==W&&(W=C[R].getAttribute("xlink:href"));null!=W&&(C[R].style.pointerEvents="none",C[R].setAttribute("href",""));P&&P(C[R])}};Graph.prototype.updateSvgLinks=function(C,P,R){C=C.getElementsByTagName("a");for(var W=
0;W<C.length;W++)if(null==C[W].getAttribute("target")){var ia=C[W].getAttribute("href");null==ia&&(ia=C[W].getAttribute("xlink:href"));null!=ia&&(null!=P&&/^https?:\/\//.test(ia)?C[W].setAttribute("target",P):R&&this.isCustomLink(ia)&&C[W].setAttribute("href","javascript:void(0);"))}};Graph.prototype.createSvgCanvas=function(C){C=new mxSvgCanvas2D(C);C.minStrokeWidth=this.cellRenderer.minSvgStrokeWidth;C.adaptiveColors=this.getAdaptiveColors();C.pointerEvents=!0;return C};Graph.prototype.getSelectedElement=
function(){var C=null;if(window.getSelection){var P=window.getSelection();P.getRangeAt&&P.rangeCount&&(C=P.getRangeAt(0).commonAncestorContainer)}else document.selection&&(C=document.selection.createRange().parentElement());return C};Graph.prototype.getSelectedEditingElement=function(){var C=null;if(null!=this.cellEditor.textarea)for(C=this.getSelectedElement();null!=C&&C.nodeType!=mxConstants.NODETYPE_ELEMENT;)C=C.parentNode;return C};Graph.prototype.getParentByName=function(C,P,R){for(;null!=C&&
C.nodeName!=P;){if(C==R)return null;C=C.parentNode}return C};Graph.prototype.getParentByNames=function(C,P,R){for(;null!=C&&!(0<=mxUtils.indexOf(P,C.nodeName));){if(C==R)return null;C=C.parentNode}return C};Graph.prototype.selectNode=function(C){var P=null;if(window.getSelection){if(P=window.getSelection(),P.getRangeAt&&P.rangeCount){var R=document.createRange();R.selectNode(C);P.removeAllRanges();P.addRange(R)}}else(P=document.selection)&&"Control"!=P.type&&(C=P.createRange(),C.collapse(!0),R=P.createRange(),
R.setEndPoint("StartToStart",C),R.select())};Graph.prototype.flipEdgePoints=function(C,P,R){var W=this.getCellGeometry(C);if(null!=W){W=W.clone();if(null!=W.points)for(var ia=0;ia<W.points.length;ia++)P?W.points[ia].x=R+(R-W.points[ia].x):W.points[ia].y=R+(R-W.points[ia].y);ia=function(ka){null!=ka&&(P?ka.x=R+(R-ka.x):ka.y=R+(R-ka.y))};ia(W.getTerminalPoint(!0));ia(W.getTerminalPoint(!1));this.model.setGeometry(C,W)}};Graph.prototype.flipChildren=function(C,P,R){this.model.beginUpdate();try{for(var W=
this.model.getChildCount(C),ia=0;ia<W;ia++){var ka=this.model.getChildAt(C,ia);if(this.model.isEdge(ka))this.flipEdgePoints(ka,P,R);else{var pa=this.getCellGeometry(ka);null!=pa&&(pa=pa.clone(),P?pa.x=R+(R-pa.x-pa.width):pa.y=R+(R-pa.y-pa.height),this.model.setGeometry(ka,pa))}}}finally{this.model.endUpdate()}};Graph.prototype.flipCells=function(C,P){this.model.beginUpdate();try{C=this.model.getTopmostCells(C);for(var R=[],W=0;W<C.length;W++)if(this.model.isEdge(C[W])){var ia=this.view.getState(C[W]);
null!=ia&&this.flipEdgePoints(C[W],P,(P?ia.getCenterX():ia.getCenterY())/this.view.scale-(P?ia.origin.x:ia.origin.y)-(P?this.view.translate.x:this.view.translate.y))}else{var ka=this.getCellGeometry(C[W]);null!=ka&&this.flipChildren(C[W],P,P?ka.getCenterX()-ka.x:ka.getCenterY()-ka.y);R.push(C[W])}this.toggleCellStyles(P?mxConstants.STYLE_FLIPH:mxConstants.STYLE_FLIPV,!1,R)}finally{this.model.endUpdate()}};Graph.prototype.deleteCells=function(C,P){var R=null;if(null!=C&&0<C.length){this.model.beginUpdate();
try{for(var W=0;W<C.length;W++){var ia=this.model.getParent(C[W]);if(this.isTable(ia)){var ka=this.getCellGeometry(C[W]),pa=this.getCellGeometry(ia);null!=ka&&null!=pa&&(pa=pa.clone(),pa.height-=ka.height,this.model.setGeometry(ia,pa))}}var xa=this.selectParentAfterDelete?this.model.getParents(C):null;this.removeCells(C,P)}finally{this.model.endUpdate()}if(null!=xa)for(R=[],W=0;W<xa.length;W++)this.model.contains(xa[W])&&(this.model.isVertex(xa[W])||this.model.isEdge(xa[W]))&&R.push(xa[W])}return R};
Graph.prototype.insertTableColumn=function(C,P){var R=this.getModel();R.beginUpdate();try{var W=C,ia=0;if(this.isTableCell(C)){var ka=R.getParent(C);W=R.getParent(ka);ia=mxUtils.indexOf(R.getChildCells(ka,!0),C)}else this.isTableRow(C)?W=R.getParent(C):C=R.getChildCells(W,!0)[0],P||(ia=R.getChildCells(C,!0).length-1);var pa=R.getChildCells(W,!0),xa=Graph.minTableColumnWidth;for(C=0;C<pa.length;C++){var ta=R.getChildCells(pa[C],!0)[ia],ua=R.cloneCell(ta,!1);null==ua&&(ua=this.createVertex());var Ia=
this.getCellGeometry(ua);ua.value=null;ua.style=mxUtils.setStyle(mxUtils.setStyle(ua.style,"rowspan",null),"colspan",null);if(null!=Ia){null!=Ia.alternateBounds&&(Ia.width=Ia.alternateBounds.width,Ia.height=Ia.alternateBounds.height,Ia.alternateBounds=null);xa=Ia.width;var Va=this.getCellGeometry(pa[C]);null!=Va&&(Ia.height=Va.height)}R.add(pa[C],ua,ia+(P?0:1))}var Wa=this.getCellGeometry(W);null!=Wa&&(Wa=Wa.clone(),Wa.width+=xa,R.setGeometry(W,Wa))}finally{R.endUpdate()}};Graph.prototype.deleteLane=
function(C){var P=this.getModel();P.beginUpdate();try{var R=null;R="stackLayout"==this.getCurrentCellStyle(C).childLayout?C:P.getParent(C);var W=P.getChildCells(R,!0);0==W.length?P.remove(R):(R==C&&(C=W[W.length-1]),P.remove(C))}finally{P.endUpdate()}};Graph.prototype.insertLane=function(C,P){var R=this.getModel();R.beginUpdate();try{var W=null;if("stackLayout"==this.getCurrentCellStyle(C).childLayout){W=C;var ia=R.getChildCells(W,!0);C=ia[P?0:ia.length-1]}else W=R.getParent(C);var ka=W.getIndex(C);
C=R.cloneCell(C,!1);C.value=null;R.add(W,C,ka+(P?0:1))}finally{R.endUpdate()}};Graph.prototype.insertTableRow=function(C,P){var R=this.getModel();R.beginUpdate();try{var W=C,ia=C;if(this.isTableCell(C))ia=R.getParent(C),W=R.getParent(ia);else if(this.isTableRow(C))W=R.getParent(C);else{var ka=R.getChildCells(W,!0);ia=ka[P?0:ka.length-1]}var pa=R.getChildCells(ia,!0),xa=W.getIndex(ia);ia=R.cloneCell(ia,!1);ia.value=null;var ta=this.getCellGeometry(ia);if(null!=ta){for(ka=0;ka<pa.length;ka++){C=R.cloneCell(pa[ka],
!1);C.value=null;C.style=mxUtils.setStyle(mxUtils.setStyle(C.style,"rowspan",null),"colspan",null);var ua=this.getCellGeometry(C);null!=ua&&(null!=ua.alternateBounds&&(ua.width=ua.alternateBounds.width,ua.height=ua.alternateBounds.height,ua.alternateBounds=null),ua.height=ta.height);ia.insert(C)}R.add(W,ia,xa+(P?0:1));var Ia=this.getCellGeometry(W);null!=Ia&&(Ia=Ia.clone(),Ia.height+=ta.height,R.setGeometry(W,Ia))}}finally{R.endUpdate()}};Graph.prototype.deleteTableColumn=function(C){var P=this.getModel();
P.beginUpdate();try{var R=C,W=C;this.isTableCell(C)&&(W=P.getParent(C));this.isTableRow(W)&&(R=P.getParent(W));var ia=P.getChildCells(R,!0);if(0==ia.length)P.remove(R);else{this.isTableRow(W)||(W=ia[0]);var ka=P.getChildCells(W,!0);if(1>=ka.length)P.remove(R);else{var pa=ka.length-1;this.isTableCell(C)&&(pa=mxUtils.indexOf(ka,C));for(W=C=0;W<ia.length;W++){var xa=P.getChildCells(ia[W],!0)[pa];P.remove(xa);var ta=this.getCellGeometry(xa);null!=ta&&(C=Math.max(C,ta.width))}var ua=this.getCellGeometry(R);
null!=ua&&(ua=ua.clone(),ua.width-=C,P.setGeometry(R,ua))}}}finally{P.endUpdate()}};Graph.prototype.deleteTableRow=function(C){var P=this.getModel();P.beginUpdate();try{var R=C,W=C;this.isTableCell(C)&&(C=W=P.getParent(C));this.isTableRow(C)&&(R=P.getParent(W));var ia=P.getChildCells(R,!0);if(1>=ia.length)P.remove(R);else{this.isTableRow(W)||(W=ia[ia.length-1]);P.remove(W);C=0;var ka=this.getCellGeometry(W);null!=ka&&(C=ka.height);var pa=this.getCellGeometry(R);null!=pa&&(pa=pa.clone(),pa.height-=
C,P.setGeometry(R,pa))}}finally{P.endUpdate()}};Graph.prototype.insertRow=function(C,P){for(var R=C.tBodies[0],W=R.rows[0].cells,ia=C=0;ia<W.length;ia++){var ka=W[ia].getAttribute("colspan");C+=null!=ka?parseInt(ka):1}P=R.insertRow(P);for(ia=0;ia<C;ia++)mxUtils.br(P.insertCell(-1));return P.cells[0]};Graph.prototype.deleteRow=function(C,P){C.tBodies[0].deleteRow(P)};Graph.prototype.insertColumn=function(C,P){var R=C.tHead;if(null!=R)for(var W=0;W<R.rows.length;W++){var ia=document.createElement("th");
R.rows[W].appendChild(ia);mxUtils.br(ia)}C=C.tBodies[0];for(R=0;R<C.rows.length;R++)W=C.rows[R].insertCell(P),mxUtils.br(W);return C.rows[0].cells[0<=P?P:C.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(C,P){if(0<=P){C=C.tBodies[0].rows;for(var R=0;R<C.length;R++)C[R].cells.length>P&&C[R].deleteCell(P)}};Graph.prototype.pasteHtmlAtCaret=function(C){if(window.getSelection){var P=window.getSelection();if(P.getRangeAt&&P.rangeCount){P=P.getRangeAt(0);P.deleteContents();var R=document.createElement("div");
R.innerHTML=C;C=document.createDocumentFragment();for(var W;W=R.firstChild;)lastNode=C.appendChild(W);P.insertNode(C)}}else(P=document.selection)&&"Control"!=P.type&&P.createRange().pasteHTML(C)};Graph.prototype.createLinkForHint=function(C,P,R){function W(ka,pa){ka.length>pa&&(ka=ka.substring(0,Math.round(pa/2))+"..."+ka.substring(ka.length-Math.round(pa/4)));return ka}C=null!=C?C:"javascript:void(0);";if(null==P||0==P.length)P=this.isCustomLink(C)?this.getLinkTitle(C):C;var ia=document.createElement("a");
ia.setAttribute("rel",this.linkRelation);ia.setAttribute("href",this.getAbsoluteUrl(C));ia.setAttribute("title",W(this.isCustomLink(C)?this.getLinkTitle(C):C,80));null!=this.linkTarget&&ia.setAttribute("target",this.linkTarget);mxUtils.write(ia,W(P,40));this.isCustomLink(C)&&mxEvent.addListener(ia,"click",mxUtils.bind(this,function(ka){this.customLinkClicked(C,R);mxEvent.consume(ka)}));return ia};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=
this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(ka,pa){this.popupMenuHandler.hideMenu()});var C=this.updateMouseEvent;this.updateMouseEvent=function(ka){ka=C.apply(this,arguments);if(mxEvent.isTouchEvent(ka.getEvent())&&null==ka.getState()){var pa=this.getCellAt(ka.graphX,ka.graphY);null!=pa&&this.isSwimlane(pa)&&this.hitsSwimlaneContent(pa,ka.graphX,ka.graphY)||(ka.state=this.view.getState(pa),null!=ka.state&&null!=ka.state.shape&&(this.container.style.cursor=
ka.state.shape.node.style.cursor))}null==ka.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return ka};var P=!1,R=!1,W=!1,ia=this.fireMouseEvent;this.fireMouseEvent=function(ka,pa,xa){ka==mxEvent.MOUSE_DOWN&&(pa=this.updateMouseEvent(pa),P=this.isCellSelected(pa.getCell()),R=this.isSelectionEmpty(),W=this.popupMenuHandler.isMenuShowing());ia.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(ka,pa){if(null!=this.freehand&&!this.freehand.isDrawing()){var xa=
mxEvent.isMouseEvent(pa.getEvent());this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==pa.getState()||!pa.isSource(pa.getState().control))&&(this.popupMenuHandler.popupTrigger||!W&&!xa&&(R&&null==pa.getCell()&&this.isSelectionEmpty()||P&&this.isCellSelected(pa.getCell())));xa=!P||xa?null:mxUtils.bind(this,function(ta){window.setTimeout(mxUtils.bind(this,function(){if(!this.isEditing()&&this.isTouchPopupMenuEnabled()){var ua=mxUtils.getScrollOrigin();this.popupMenuHandler.popup(pa.getX()+
ua.x+1,pa.getY()+ua.y+1,ta,pa.getEvent())}}),300)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,[ka,pa,xa])}})};Graph.prototype.isTouchPopupMenuEnabled=function(){return!0};mxCellEditor.prototype.isContentEditing=function(){var C=this.graph.view.getState(this.editingCell);return null!=C&&1==C.style.html};mxCellEditor.prototype.isTableSelected=function(){return null!=this.graph.getParentByName(this.graph.getSelectedElement(),"TABLE",this.textarea)};mxCellEditor.prototype.isTextSelected=
function(){var C="";window.getSelection?C=window.getSelection():document.getSelection?C=document.getSelection():document.selection&&(C=document.selection.createRange().text);return""!=C};mxCellEditor.prototype.insertTab=function(C){var P=this.textarea.ownerDocument.defaultView.getSelection(),R=P.getRangeAt(0);C=Graph.createTabNode(C);R.insertNode(C);R.setStartAfter(C);R.setEndAfter(C);P.removeAllRanges();P.addRange(R)};mxCellEditor.prototype.alignText=function(C,P){var R=this.graph.getView().getState(this.editingCell);
if(null!=R){R=mxUtils.getValue(R.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);var W=null!=R&&"vertical-"==R.substring(0,9),ia=null!=P&&mxEvent.isShiftDown(P);if(ia||null!=window.getSelection&&null!=window.getSelection().containsNode){var ka=!0;this.graph.processElements(this.textarea,function(pa){ia||W||window.getSelection().containsNode(pa,!0)?(pa.removeAttribute("align"),pa.style.textAlign=null):ka=!1});(ka||W)&&this.graph.cellEditor.setAlign(C)}W||document.execCommand("justify"+
C.toLowerCase(),!1,null)}};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var C=window.getSelection();if(C.getRangeAt&&C.rangeCount){for(var P=[],R=0,W=C.rangeCount;R<W;++R)P.push(C.getRangeAt(R));return P}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=function(C){try{if(C)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var P=0,R=C.length;P<
R;++P)sel.addRange(C[P])}else document.selection&&C.select&&C.select()}catch(W){}};var F=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(C){null!=C.text&&(C.text.replaceLinefeeds="0"!=mxUtils.getValue(C.style,"nl2Br","1"));F.apply(this,arguments)};var I=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(C,P){this.isKeepFocusEvent(C)||!mxEvent.isAltDown(C.getEvent())?I.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=
function(C){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var M=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(C,P){C=this.graph.getStartEditingCell(C,P);M.apply(this,arguments);var R=this.graph.view.getState(C);this.textarea.className=null!=R&&1==R.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";this.textarea.style.colorScheme="none"==this.graph.getAdaptiveColors()?
"light":"";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(C)};mxCellEditor.prototype.toggleViewMode=function(){var C=this.graph.view.getState(this.editingCell);if(null!=C){var P=null!=C&&"0"!=mxUtils.getValue(C.style,"nl2Br","1"),R=this.saveSelection();if(this.codeViewMode){Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);xa=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<xa.length&&"\n"==xa.charAt(xa.length-1)&&(xa=xa.substring(0,
xa.length-1));xa=Graph.sanitizeHtml(P?xa.replace(/\n/g,"<br/>"):xa,!0);this.textarea.className="mxCellEditor geContentEditable";ta=mxUtils.getValue(C.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);P=mxUtils.getValue(C.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);var W=mxUtils.getValue(C.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),ia=(mxUtils.getValue(C.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,ka=(mxUtils.getValue(C.style,
mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,pa=[];(mxUtils.getValue(C.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&pa.push("underline");(mxUtils.getValue(C.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&pa.push("line-through");this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(ta*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=
Math.round(ta)+"px";this.textarea.style.textDecoration=pa.join(" ");this.textarea.style.fontWeight=ia?"bold":"normal";this.textarea.style.fontStyle=ka?"italic":"";this.textarea.style.fontFamily=P;this.textarea.style.textAlign=W;this.textarea.style.padding="0px";this.textarea.innerHTML!=xa&&(this.textarea.innerHTML=xa,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 xa=mxUtils.htmlEntities(this.textarea.innerHTML);8!=document.documentMode&&(xa=mxUtils.replaceTrailingNewlines(xa,"<div><br></div>"));xa=Graph.sanitizeHtml(P?xa.replace(/\n/g,"").replace(/&lt;br\s*.?&gt;/g,"<br>"):xa,!0);this.textarea.className=
"mxCellEditor mxPlainTextEditor";var ta=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(ta*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(ta)+"px";this.textarea.style.textDecoration="";this.textarea.style.fontWeight="normal";this.textarea.style.fontStyle="";this.textarea.style.fontFamily=mxConstants.DEFAULT_FONTFAMILY;this.textarea.style.textAlign="left";this.textarea.style.width="";this.textarea.style.padding=
"2px";this.textarea.innerHTML!=xa&&(this.textarea.innerHTML=xa);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=R;this.resize()}};var L=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(C,P){if(null!=this.textarea)if(C=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=C){var R=C.view.scale;this.bounds=mxRectangle.fromRectangle(C);if(0==this.bounds.width&&
0==this.bounds.height){this.bounds.width=160*R;this.bounds.height=60*R;var W=null!=C.text?C.text.margin:null;null==W&&(W=mxUtils.getAlignmentAsPoint(mxUtils.getValue(C.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(C.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));this.bounds.x+=W.x*this.bounds.width;this.bounds.y+=W.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/R)+"px";this.textarea.style.height=Math.round((this.bounds.height-
4)/R)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/R)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*R);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/R)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*
R);this.textarea.style.left=Math.round(this.bounds.x)+"px";this.textarea.style.top=Math.round(this.bounds.y)+"px";mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+R+","+R+")")}else this.textarea.style.height="",this.textarea.style.overflow="",L.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(C,P){if("0"==mxUtils.getValue(C.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);
var R=this.graph.getEditingValue(C.cell,P);"1"==mxUtils.getValue(C.style,"nl2Br","1")&&(R=R.replace(/\n/g,"<br/>"));return Graph.sanitizeHtml(R,!0)};mxCellEditorSetEditingValue=mxCellEditor.prototype.setEditingValue;mxCellEditor.prototype.setEditingValue=function(C,P){mxCellEditorSetEditingValue.apply(this,arguments);"1"==mxUtils.getValue(C.style,"html","0")&&Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors())};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;
mxCellEditor.prototype.getCurrentValue=function(C){if("0"==mxUtils.getValue(C.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);Graph.removeLightDarkColors(this.textarea,Graph.backupStyleAttribute);var P=Graph.sanitizeHtml(this.textarea.innerHTML,!0);"1"==mxUtils.getValue(C.style,"nl2Br","1")?(P=P.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"),0<P.length&&("<br/>"==P.substring(P.length-5)||"<br>"==P.substring(P.length-4))&&(P=P.substring(0,P.lastIndexOf("<br"))+"<div><br/></div>")):
P=P.replace(/\r\n/g,"").replace(/\n/g,"");return P};var K=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(C){this.codeViewMode&&this.toggleViewMode();K.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(C){}};var aa=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(C,P){this.graph.getModel().beginUpdate();try{aa.apply(this,arguments),""==P&&this.graph.isCellDeletable(C.cell)&&
0==this.graph.model.getChildCount(C.cell)&&this.graph.isTransparentState(C)&&this.graph.removeCells([C.cell],!1)}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(C){C=mxUtils.getValue(C.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);C==mxConstants.NONE&&(C=null);return C};mxCellEditor.prototype.getBorderColor=function(C){C=mxUtils.getValue(C.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null);C==mxConstants.NONE&&(C=null);return C};mxCellEditor.prototype.getMinimumSize=
function(C){var P=this.graph.getView().scale;return new mxRectangle(0,0,null==C.text?30:C.text.size*P+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget;mxGraphHandler.prototype.isValidDropTarget=function(C,P){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(P.getEvent)};mxGraphView.prototype.formatUnitText=function(C){return C?f(C,this.unit):C};mxGraphHandler.prototype.updateHint=function(C){if(null!=this.pBounds&&(null!=this.shape||
this.livePreviewActive)){null==this.hint&&(this.hint=b(),this.graph.container.appendChild(this.hint));var P=this.graph.view.translate,R=this.graph.view.scale;C=this.roundLength((this.bounds.x+this.currentDx)/R-P.x);P=this.roundLength((this.bounds.y+this.currentDy)/R-P.y);R=this.graph.view.unit;this.hint.innerHTML=f(C,R)+", "+f(P,R);this.hint.style.left=this.pBounds.x+this.currentDx+Math.round((this.pBounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.pBounds.y+this.currentDy+this.pBounds.height+
Editor.hintOffset+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(null!=this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint),this.hint=null)};var ja=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(C,P){ja.apply(this,arguments);var R=this.graph.getCellStyle(C);if(null==R.childLayout){var W=this.graph.model.getParent(C),ia=null!=W?this.graph.getCellGeometry(W):null;if(null!=ia&&(R=this.graph.getCellStyle(W),"stackLayout"==R.childLayout)){var ka=
parseFloat(mxUtils.getValue(R,"stackBorder",mxStackLayout.prototype.border));R="1"==mxUtils.getValue(R,"horizontalStack","1");var pa=this.graph.getActualStartSize(W);ia=ia.clone();R?ia.height=P.height+pa.y+pa.height+2*ka:ia.width=P.width+pa.x+pa.width+2*ka;this.graph.model.setGeometry(W,ia)}}};var ca=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function C(xa){R.get(xa)||(R.put(xa,!0),ia.push(xa))}for(var P=ca.apply(this,
arguments),R=new mxDictionary,W=this.graph.model,ia=[],ka=0;ka<P.length;ka++){var pa=P[ka];this.graph.isTableCell(pa)?C(W.getParent(W.getParent(pa))):this.graph.isTableRow(pa)&&C(W.getParent(pa));C(pa)}return ia};var ba=mxConnectionHandler.prototype.isStartEvent;mxConnectionHandler.prototype.isStartEvent=function(C){return ba.apply(this,arguments)&&!mxEvent.isControlDown(C.getEvent())&&!mxEvent.isShiftDown(C.getEvent())};var oa=mxVertexHandler.prototype.isGhostPreview;mxVertexHandler.prototype.isGhostPreview=
function(){return oa.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 Y=mxVertexHandler.prototype.createParentHighlightShape;mxVertexHandler.prototype.createParentHighlightShape=function(C){var P=Y.apply(this,arguments);P.stroke="#C0C0C0";P.strokewidth=1;return P};var da=mxEdgeHandler.prototype.createParentHighlightShape;mxEdgeHandler.prototype.createParentHighlightShape=
function(C){var P=da.apply(this,arguments);P.stroke="#C0C0C0";P.strokewidth=1;return P};mxVertexHandler.prototype.rotationHandleVSpacing=-12;mxVertexHandler.prototype.getRotationHandlePosition=function(){var C=this.getHandlePadding();return new mxPoint(this.bounds.x+this.bounds.width-this.rotationHandleVSpacing+C.x/2,this.bounds.y+this.rotationHandleVSpacing-C.y/2)};mxVertexHandler.prototype.isRecursiveResize=function(C,P){return this.graph.isRecursiveVertexResize(C)&&!mxEvent.isAltDown(P.getEvent())};
mxVertexHandler.prototype.isCenteredEvent=function(C,P){return mxEvent.isControlDown(P.getEvent())||mxEvent.isMetaDown(P.getEvent())};var ha=mxVertexHandler.prototype.isRotationHandleVisible;mxVertexHandler.prototype.isRotationHandleVisible=function(){return ha.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.getSizerBounds=function(){return this.graph.isTableCell(this.state.cell)?
this.graph.view.getState(this.graph.model.getParent(this.graph.model.getParent(this.state.cell))):this.bounds};var Z=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){return Z.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var k=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(C){return C.tableHandle||k.apply(this,arguments)&&
(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};mxVertexHandler.prototype.getSelectionBorderInset=function(){var C=0;this.graph.isTableRow(this.state.cell)?C=1:this.graph.isTableCell(this.state.cell)&&(C=2);return C};var v=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=function(){return v.apply(this,arguments).grow(-this.getSelectionBorderInset())};var J=null,N=mxVertexHandler.prototype.createCustomHandles;
mxVertexHandler.prototype.createCustomHandles=function(){null==J&&(J=mxCellRenderer.defaultShapes.tableLine);var C=N.apply(this,arguments);if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)){var P=function(ab,Pa,Sa){for(var gb=[],fb=0;fb<ab.length;fb++){var cb=ab[fb];gb.push(null==cb?null:new mxPoint((ta+cb.x+Pa)*ka,(ua+cb.y+Sa)*ka))}return gb},R=this,W=this.graph,ia=W.model,ka=W.view.scale,pa=this.state,xa=this.selectionBorder,ta=this.state.origin.x+W.view.translate.x,
ua=this.state.origin.y+W.view.translate.y;null==C&&(C=[]);var Ia=W.view.getCellStates(ia.getChildCells(this.state.cell,!0));if(0<Ia.length){var Va=ia.getChildCells(Ia[0].cell,!0),Wa=W.getTableLines(this.state.cell,!1,!0),Ta=W.getTableLines(this.state.cell,!0,!1);for(ia=0;ia<Ia.length;ia++)mxUtils.bind(this,function(ab){var Pa=Ia[ab],Sa=null;if(W.isCellMovable(Pa.cell)){Sa=ab<Ia.length-1?Ia[ab+1]:null;Sa=null!=Sa?W.getCellGeometry(Sa.cell):null;var gb=null!=Sa&&null!=Sa.alternateBounds?Sa.alternateBounds:
Sa;Sa=null!=Ta[ab]?new J(Ta[ab],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!1);Sa.isDashed=xa.isDashed;Sa.svgStrokeTolerance++;Sa=new mxHandle(Pa,"row-resize",null,Sa);Sa.tableHandle=!0;var fb=0;Sa.shape.node.parentNode.insertBefore(Sa.shape.node,Sa.shape.node.parentNode.firstChild);Sa.redraw=function(){if(null!=this.shape){this.shape.stroke=0==fb?mxConstants.NONE:xa.stroke;if(this.shape.constructor==J)this.shape.line=P(Ta[ab],0,fb),this.shape.updateBoundsFromLine();else{var eb=
W.getActualStartSize(pa.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height+fb*ka;this.shape.bounds.x=pa.x+(ab==Ia.length-1?0:eb.x*ka);this.shape.bounds.width=pa.width-(ab==Ia.length-1?0:eb.width+eb.x+ka)}this.shape.redraw()}};var cb=!1;Sa.setPosition=function(eb,lb,kb){fb=Math.max(Graph.minTableRowHeight-eb.height,lb.y-eb.y-eb.height);cb=mxEvent.isShiftDown(kb.getEvent());null!=gb&&cb&&(fb=Math.min(fb,gb.height-Graph.minTableRowHeight))};Sa.execute=function(eb){if(0!=
fb)W.setTableRowHeight(this.state.cell,fb,!cb);else if(!R.blockDelayedSelection){var lb=W.getCellAt(eb.getGraphX(),eb.getGraphY())||pa.cell;W.graphHandler.selectCellForEvent(lb,eb)}fb=0};Sa.reset=function(){fb=0}}C.push(Sa)})(ia);for(ia=0;ia<Va.length;ia++)mxUtils.bind(this,function(ab){var Pa=W.view.getState(Va[ab]),Sa=W.getCellGeometry(Va[ab]),gb=null!=Sa.alternateBounds?Sa.alternateBounds:Sa;null==Pa&&(Pa=new mxCellState(W.view,Va[ab],W.getCellStyle(Va[ab])),Pa.x=pa.x+Sa.x*ka,Pa.y=pa.y+Sa.y*ka,
Pa.width=gb.width*ka,Pa.height=gb.height*ka,Pa.updateCachedBounds());Sa=ab<Va.length-1?Va[ab+1]:null;Sa=null!=Sa?W.getCellGeometry(Sa):null;var fb=null!=Sa&&null!=Sa.alternateBounds?Sa.alternateBounds:Sa;Sa=null!=Wa[ab]?new J(Wa[ab],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!0);Sa.isDashed=xa.isDashed;Sa.svgStrokeTolerance++;Pa=new mxHandle(Pa,"col-resize",null,Sa);Pa.tableHandle=!0;var cb=0;Pa.shape.node.parentNode.insertBefore(Pa.shape.node,Pa.shape.node.parentNode.firstChild);
Pa.redraw=function(){if(null!=this.shape){this.shape.stroke=0==cb?mxConstants.NONE:xa.stroke;if(this.shape.constructor==J)this.shape.line=P(Wa[ab],cb,0),this.shape.updateBoundsFromLine();else{var lb=W.getActualStartSize(pa.cell,!0);this.shape.bounds.width=1;this.shape.bounds.x=this.state.x+(gb.width+cb)*ka;this.shape.bounds.y=pa.y+(ab==Va.length-1?0:lb.y*ka);this.shape.bounds.height=pa.height-(ab==Va.length-1?0:(lb.height+lb.y)*ka)}this.shape.redraw()}};var eb=!1;Pa.setPosition=function(lb,kb,ob){cb=
Math.max(Graph.minTableColumnWidth-gb.width,kb.x-lb.x-gb.width);eb=mxEvent.isShiftDown(ob.getEvent());null==fb||eb||(cb=Math.min(cb,fb.width-Graph.minTableColumnWidth))};Pa.execute=function(lb){if(0!=cb)W.setTableColumnWidth(this.state.cell,cb,eb);else if(!R.blockDelayedSelection){var kb=W.getCellAt(lb.getGraphX(),lb.getGraphY())||pa.cell;W.graphHandler.selectCellForEvent(kb,lb)}cb=0};Pa.positionChanged=function(){};Pa.reset=function(){cb=0};C.push(Pa)})(ia)}}return null!=C?C.reverse():null};var T=
mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(C){T.apply(this,arguments);if(null!=this.moveHandles)for(var P=0;P<this.moveHandles.length;P++)null!=this.moveHandles[P]&&(this.moveHandles[P].node.style.visibility=C?"":"hidden");if(null!=this.cornerHandles)for(P=0;P<this.cornerHandles.length;P++)this.cornerHandles[P].node.style.visibility=C?"":"hidden"};mxVertexHandler.prototype.isMoveHandlesVisible=function(){return this.graph.isTable(this.state.cell)&&
this.graph.isCellMovable(this.state.cell)};mxVertexHandler.prototype.refreshMoveHandles=function(){var C=this.isMoveHandlesVisible();C&&null==this.moveHandles?this.moveHandles=this.createMoveHandles():C||null==this.moveHandles||this.destroyMoveHandles();if(C&&null==this.moveHandles){for(C=0;C<this.moveHandles.length;C++)null!=this.moveHandles[C]&&this.moveHandles[C].parentNode.removeChild(this.moveHandles[C]);this.moveHandles=null}};mxVertexHandler.prototype.createMoveHandles=function(){for(var C=
this.graph,P=C.model,R=[],W=0;W<P.getChildCount(this.state.cell);W++)mxUtils.bind(this,function(ia){if(null!=ia&&P.isVertex(ia.cell)&&C.isCellMovable(ia.cell)){var ka=new mxRectangle(0,0,this.rowHandleImage.width,this.rowHandleImage.height);ka=new mxImageShape(ka,this.rowHandleImage.src);ka.rowState=ia;ka.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;ka.init(this.graph.getView().getOverlayPane());ka.node.style.cursor="move";mxEvent.addGestureListeners(ka.node,
mxUtils.bind(this,function(pa){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);!this.graph.isToggleEvent(pa)&&this.graph.isCellSelected(ia.cell)||this.graph.selectCellForEvent(ia.cell,pa);mxEvent.isPopupTrigger(pa)||(this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(pa),mxEvent.getClientY(pa),this.graph.getSelectionCells()),this.graph.graphHandler.cellWasClicked=!0,this.graph.isMouseTrigger=mxEvent.isMouseEvent(pa),this.graph.isMouseDown=!0);mxEvent.consume(pa)}),
null,mxUtils.bind(this,function(pa){mxEvent.isPopupTrigger(pa)&&(this.graph.popupMenuHandler.popup(mxEvent.getClientX(pa),mxEvent.getClientY(pa),ia.cell,pa),mxEvent.consume(pa))}));R.push(ka)}else R.push(null)})(this.graph.view.getState(P.getChildAt(this.state.cell,W)));return R};mxVertexHandler.prototype.destroyMoveHandles=function(){if(null!=this.moveHandles){for(var C=0;C<this.moveHandles.length;C++)null!=this.moveHandles[C]&&this.moveHandles[C].destroy();this.moveHandles=null}};mxVertexHandler.prototype.destroyCornerHandles=
function(){if(null!=this.cornerHandles){for(var C=0;C<this.cornerHandles.length;C++)null!=this.cornerHandles[C]&&null!=this.cornerHandles[C].node&&null!=this.cornerHandles[C].node.parentNode&&this.cornerHandles[C].node.parentNode.removeChild(this.cornerHandles[C].node);this.cornerHandles=null}};var V=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){V.apply(this,arguments);this.destroyMoveHandles();this.destroyCornerHandles();if(this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell))this.refreshMoveHandles();
else if(1==this.graph.getSelectionCount()&&this.graph.isCellMovable(this.state.cell)&&(this.graph.isTableCell(this.state.cell)||this.graph.isTableRow(this.state.cell))){this.cornerHandles=[];for(var C=0;4>C;C++){var P=new mxRectangleShape(new mxRectangle(0,0,6,6),"#ffffff",mxConstants.HANDLE_STROKECOLOR);P.dialect=mxConstants.DIALECT_SVG;P.init(this.graph.view.getOverlayPane());this.cornerHandles.push(P)}}this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&this.refreshMoveHandles();
C=this.graph.getLinkForCell(this.state.cell);P=this.graph.getLinksForState(this.state);this.updateLinkHint(C,P)};var U=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var C=new mxPoint(0,0),P=this.tolerance,R=this.state.style.shape;null==mxCellRenderer.defaultShapes[R]&&mxStencilRegistry.getStencil(R);R=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==this.state.cell;if(!R&&null!=this.customHandles)for(var W=0;W<this.customHandles.length;W++)if(null!=
this.customHandles[W]&&null!=this.customHandles[W].shape&&null!=this.customHandles[W].shape.bounds){var ia=this.customHandles[W].shape.bounds,ka=ia.getCenterX(),pa=ia.getCenterY();if(Math.abs(this.state.x-ka)<ia.width/2||Math.abs(this.state.y-pa)<ia.height/2||Math.abs(this.state.x+this.state.width-ka)<ia.width/2||Math.abs(this.state.y+this.state.height-pa)<ia.height/2){R=!0;break}}R&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(P/=2,this.graph.isTable(this.state.cell)&&(P+=7),C.x=
this.sizers[0].bounds.width+P,C.y=this.sizers[0].bounds.height+P):C=U.apply(this,arguments);return C};mxVertexHandler.prototype.updateHint=function(C){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+"&deg;";else{C=this.state.view.scale;var P=this.state.view.unit;this.hint.innerHTML=f(this.roundLength(this.bounds.width/C),P)+" x "+f(this.roundLength(this.bounds.height/
C),P)}C=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0");null==C&&(C=this.bounds);this.hint.style.left=C.x+Math.round((C.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=C.y+C.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 X=mxEdgeHandler.prototype.refresh;mxEdgeHandler.prototype.refresh=function(){X.apply(this,arguments);var C=this.graph.getLinkForCell(this.state.cell),P=this.graph.getLinksForState(this.state);this.updateLinkHint(C,P)};var fa=mxEdgeHandler.prototype.mouseMove;mxEdgeHandler.prototype.mouseMove=function(C,P){fa.apply(this,arguments);null!=this.linkHint&&"none"!=this.linkHint.style.display&&null!=this.graph.graphHandler&&null!=this.graph.graphHandler.first&&(this.linkHint.style.display="none")};
var na=mxEdgeHandler.prototype.mouseUp;mxEdgeHandler.prototype.mouseUp=function(C,P){na.apply(this,arguments);null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(C,P,R){null==this.hint&&(this.hint=b(),this.state.view.graph.container.appendChild(this.hint));var W=this.graph.view.translate,ia=this.graph.view.scale,ka=this.roundLength(P.x/ia-W.x);W=this.roundLength(P.y/ia-W.y);var pa=
this.graph.view.unit;this.hint.innerHTML=f(ka,pa)+", "+f(W,pa);this.hint.style.visibility="visible";null!=R&&(R.view.updateEdgeBounds(R),this.hint.innerHTML+=" ("+(pa==mxConstants.POINTS?Math.round(R.length/ia):f(R.length/ia,pa))+")");if(this.isSource||this.isTarget)null!=this.constraintHandler&&null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(R=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*R.x)+"%, "+Math.round(100*
R.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(C.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(C.getGraphY(),P.y)+Editor.hintOffset+"px";null!=this.linkHint&&(this.linkHint.style.display="none")};Graph.prototype.expandedImage=Graph.createSvgImage(9,9,'<defs><linearGradient id="grad1" x1="50%" y1="0%" x2="50%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 2 4.5 L 7 4.5 z" stroke="#000"/>');
Graph.prototype.collapsedImage=Graph.createSvgImage(9,9,'<defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs><rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/><path d="M 4.5 2 L 4.5 7 M 2 4.5 L 7 4.5 z" stroke="#000"/>');mxEdgeHandler.prototype.removeHint=mxVertexHandler.prototype.removeHint;HoverIcons.prototype.mainHandle=
Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.endMainHandle=Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="6" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>');HoverIcons.prototype.secondaryHandle=Graph.createSvgImage(16,16,'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>');HoverIcons.prototype.fixedHandle=Graph.createSvgImage(22,22,'<circle cx="11" cy="11" r="6" stroke="#fff" fill="#01bd22"/><path d="m 8 8 L 14 14M 8 14 L 14 8" stroke="#fff"/>');
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);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;mxEdgeHandler.prototype.isAddVirtualBendEvent=
function(C){return!mxEvent.isShiftDown(C.getEvent())};mxEdgeHandler.prototype.isCustomHandleEvent=function(C){return!mxEvent.isShiftDown(C.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(C){return mxEvent.isMouseEvent(C.getEvent())?
4:this.graph.getTolerance()};mxPanningHandler.prototype.isPanningTrigger=function(C){var P=C.getEvent();return null==C.getState()&&!mxEvent.isMouseEvent(P)||mxEvent.isPopupTrigger(P)&&(null==C.getState()||mxEvent.isControlDown(P)||mxEvent.isShiftDown(P))}}else mxPanningHandler.prototype.isPanningTrigger=function(C){var P=C.getEvent();return mxEvent.isLeftMouseButton(P)&&(this.useLeftButtonForPanning&&null==C.getState()||mxEvent.isControlDown(P)&&!mxEvent.isShiftDown(P))||this.usePopupTrigger&&mxEvent.isPopupTrigger(P)};
mxRubberband.prototype.isSpaceEvent=function(C){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&(mxEvent.isControlDown(C.getEvent())||mxEvent.isMetaDown(C.getEvent()))&&mxEvent.isShiftDown(C.getEvent())&&mxEvent.isAltDown(C.getEvent())};mxRubberband.prototype.cancelled=!1;mxRubberband.prototype.cancel=function(){this.isActive()&&(this.cancelled=!0,this.reset())};mxRubberband.prototype.mouseUp=function(C,P){if(this.cancelled)this.cancelled=!1,P.consume();else{var R=
null!=this.div&&"none"!=this.div.style.display,W=null,ia=null,ka=C=null;null!=this.first&&null!=this.currentX&&null!=this.currentY&&(W=this.first.x,ia=this.first.y,C=(this.currentX-W)/this.graph.view.scale,ka=(this.currentY-ia)/this.graph.view.scale,mxEvent.isAltDown(P.getEvent())||(C=this.graph.snap(C),ka=this.graph.snap(ka),this.graph.isGridEnabled()||(Math.abs(C)<this.graph.tolerance&&(C=0),Math.abs(ka)<this.graph.tolerance&&(ka=0))));this.reset();if(R){if(this.isSpaceEvent(P)){this.graph.model.beginUpdate();
try{var pa=this.graph.getCellsBeyond(W,ia,this.graph.getDefaultParent(),!0,!0);for(R=0;R<pa.length;R++)if(this.graph.isCellMovable(pa[R])){var xa=this.graph.view.getState(pa[R]),ta=this.graph.getCellGeometry(pa[R]);null!=xa&&null!=ta&&(ta=ta.clone(),ta.translate(C,ka),this.graph.model.setGeometry(pa[R],ta))}}finally{this.graph.model.endUpdate()}}else pa=new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(pa,P.getEvent());P.consume()}}};mxRubberband.prototype.mouseMove=function(C,
P){if(!P.isConsumed()&&null!=this.first){var R=mxUtils.getScrollOrigin(this.graph.container);C=mxUtils.getOffset(this.graph.container);R.x-=C.x;R.y-=C.y;C=P.getX()+R.x;R=P.getY()+R.y;var W=this.first.x-C,ia=this.first.y-R,ka=this.graph.tolerance;if(null!=this.div||Math.abs(W)>ka||Math.abs(ia)>ka)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(C,R),this.isSpaceEvent(P)?(C=this.x+this.width,R=this.y+this.height,W=this.graph.view.scale,mxEvent.isAltDown(P.getEvent())||
(this.width=this.graph.snap(this.width/W)*W,this.height=this.graph.snap(this.height/W)*W,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=C-this.width),this.y<this.first.y&&(this.y=R-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor="white",this.div.style.left=this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=
this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+"px",this.secondDiv.style.width=this.graph.container.clientWidth+"px",this.secondDiv.style.height=Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=0>=this.height?"1px 0px 0px 0px":"1px 0px 1px 0px"):
(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null)),P.consume()}};var la=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);la.apply(this,arguments)};var qa=(new Date).getTime(),ya=0,wa=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=
function(C,P,R,W){wa.apply(this,arguments);R!=this.currentTerminalState?(qa=(new Date).getTime(),ya=0):ya=(new Date).getTime()-qa;this.currentTerminalState=R};var Ja=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(C){return mxEvent.isShiftDown(C.getEvent())&&mxEvent.isAltDown(C.getEvent())?!1:null!=this.currentTerminalState&&C.getState()==this.currentTerminalState&&2E3<ya||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,
"outlineConnect","1"))&&Ja.apply(this,arguments)};mxEdgeHandler.prototype.createHandleShape=function(C,P,R){P=null!=C&&0==C;var W=this.state.getVisibleTerminalState(P);C=null!=C&&null!=this.state.absolutePoints&&(0==C||C>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==C)?this.graph.getConnectionConstraint(this.state,W,P):null;R=null!=(null!=C?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(P),C):null)?R?this.endFixedHandleImage:this.fixedHandleImage:
null!=C&&null!=W?R?this.endTerminalHandleImage:this.terminalHandleImage:R?this.endHandleImage:this.handleImage;if(null!=R)return R=new mxImageShape(new mxRectangle(0,0,R.width,R.height),R.src),R.preserveImageAspect=!1,R;R=mxConstants.HANDLE_SIZE;this.preferHtml&&--R;return new mxRectangleShape(new mxRectangle(0,0,R,R),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var Aa=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(C,P,R,W){W=P==mxEvent.ROTATION_HANDLE?
HoverIcons.prototype.rotationHandle:P==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:W;return Aa.apply(this,arguments)};var Ba=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(C){if(null!=C&&1==C.length){var P=this.graph.getModel(),R=P.getParent(C[0]),W=this.graph.getCellGeometry(C[0]);if(P.isEdge(R)&&null!=W&&W.relative&&(P=this.graph.view.getState(C[0]),null!=P&&2>P.width&&2>P.height&&null!=P.text&&null!=P.text.boundingBox))return mxRectangle.fromRectangle(P.text.boundingBox)}return Ba.apply(this,
arguments)};var Ga=mxGraphHandler.prototype.getGuideStates;mxGraphHandler.prototype.getGuideStates=function(){for(var C=Ga.apply(this,arguments),P=[],R=0;R<C.length;R++)"1"!=mxUtils.getValue(C[R].style,"part","0")&&P.push(C[R]);return P};var Ma=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(C){var P=this.graph.getModel(),R=P.getParent(C.cell),W=this.graph.getCellGeometry(C.cell);return P.isEdge(R)&&null!=W&&W.relative&&2>C.width&&2>C.height&&null!=
C.text&&null!=C.text.boundingBox?(P=C.text.unrotatedBoundingBox||C.text.boundingBox,new mxRectangle(Math.round(P.x),Math.round(P.y),Math.round(P.width),Math.round(P.height))):Ma.apply(this,arguments)};var ra=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(C,P){var R=this.graph.getModel(),W=R.getParent(this.state.cell),ia=this.graph.getCellGeometry(this.state.cell);(this.getHandleForEvent(P)==mxEvent.ROTATION_HANDLE||!R.isEdge(W)||null==ia||!ia.relative||null==this.state||
2<=this.state.width||2<=this.state.height)&&ra.apply(this,arguments)};mxVertexHandler.prototype.rotateClick=function(){var C=mxUtils.getValue(this.state.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),P=mxUtils.getValue(this.state.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);this.state.view.graph.model.isVertex(this.state.cell)&&C==mxConstants.NONE&&P==mxConstants.NONE?(C=mxUtils.mod(mxUtils.getValue(this.state.style,mxConstants.STYLE_ROTATION,0)+90,360),this.state.view.graph.setCellStyles(mxConstants.STYLE_ROTATION,
C,[this.state.cell])):this.state.view.graph.turnShapes([this.state.cell])};var Ca=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(C,P){Ca.apply(this,arguments);null!=this.graph.graphHandler.first&&(null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none"),null!=this.linkHint&&"none"!=this.linkHint.style.display&&(this.linkHint.style.display="none"))};var Da=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=
function(C,P){Da.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.linkHint&&"none"==this.linkHint.style.display&&1==this.graph.getSelectionCount()&&(this.linkHint.style.display="");this.blockDelayedSelection=null};mxVertexHandler.prototype.updateLinkHint=function(C,P){try{if(null==C&&(null==P||0==P.length))null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),
this.linkHint=null);else if(null!=C||null!=P&&0<P.length){var R=document.createElement("img");R.className="geAdaptiveAsset";R.setAttribute("src",Editor.editImage);R.setAttribute("title",mxResources.get("editLink"));R.setAttribute("width","14");R.setAttribute("height","14");R.style.paddingLeft="8px";R.style.marginLeft="auto";R.style.marginBottom="-1px";R.style.cursor="pointer";var W=R.cloneNode(!0);W.setAttribute("src",Editor.trashImage);W.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));
W.style.paddingLeft="4px";W.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!=C){var ia=document.createElement("div");
ia.style.display="flex";ia.style.alignItems="center";ia.appendChild(this.graph.createLinkForHint(C,null,this.state.cell));this.linkHint.appendChild(ia);if(this.graph.isEnabled()&&"function"===typeof this.graph.editLink&&!this.graph.isCellLocked(this.state.cell)){var ka=R.cloneNode(!0);ia.appendChild(ka);mxEvent.addListener(ka,"click",mxUtils.bind(this,function(xa){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();mxEvent.consume(xa)}));var pa=W.cloneNode(!0);ia.appendChild(pa);mxEvent.addListener(pa,
"click",mxUtils.bind(this,function(xa){this.graph.setLinkForCell(this.state.cell,null);mxEvent.consume(xa)}))}}if(null!=P)for(ia=0;ia<P.length;ia++)mxUtils.bind(this,function(xa,ta){var ua=document.createElement("div");ua.style.display="flex";ua.style.alignItems="center";ua.style.marginTop=null!=C||0<ta?"6px":"0px";ua.appendChild(this.graph.createLinkForHint(xa.getAttribute("href"),mxUtils.getTextContent(xa),this.state.cell));var Ia=R.cloneNode(!0);ua.appendChild(Ia);var Va=mxUtils.bind(this,function(Wa){var Ta=
document.createElement("div");Ta.innerHTML=Graph.sanitizeHtml(this.graph.getLabel(this.state.cell));var ab=Ta.getElementsByTagName("a")[ta];if(null!=ab){if(null==Wa||""==Wa){for(Wa=ab.cloneNode(!0).firstChild;null!=Wa;)ab.parentNode.insertBefore(Wa.cloneNode(!0),ab),Wa=Wa.nextSibling;ab.parentNode.removeChild(ab)}else ab.setAttribute("href",Wa);this.graph.labelChanged(this.state.cell,Ta.innerHTML)}});mxEvent.addListener(Ia,"click",mxUtils.bind(this,function(Wa){this.graph.showLinkDialog(xa.getAttribute("href")||
"",mxResources.get("ok"),Va);mxEvent.consume(Wa)}));Ia=W.cloneNode(!0);ua.appendChild(Ia);mxEvent.addListener(Ia,"click",mxUtils.bind(this,function(Wa){Va();mxEvent.consume(Wa)}));this.linkHint.appendChild(ua)})(P[ia],ia)}null!=this.linkHint&&Graph.sanitizeNode(this.linkHint)}catch(xa){}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var va=mxEdgeHandler.prototype.createConstraintHandler;mxEdgeHandler.prototype.createConstraintHandler=function(){var C=va.apply(this,
arguments);C.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});return C};var Na=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){Na.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var Oa=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){if(null!=this.moveHandles)for(var C=0;C<this.moveHandles.length;C++)null!=
this.moveHandles[C]&&(this.moveHandles[C].bounds.x=Math.round(this.moveHandles[C].rowState.x+this.moveHandles[C].rowState.width-this.moveHandles[C].bounds.width/2),this.moveHandles[C].bounds.y=Math.round(this.moveHandles[C].rowState.y+(this.moveHandles[C].rowState.height-this.moveHandles[C].bounds.height)/2),this.moveHandles[C].redraw());if(null!=this.cornerHandles){C=this.getSelectionBorderInset();var P=this.cornerHandles,R=P[0].bounds.height/2;P[0].bounds.x=this.state.x-P[0].bounds.width/2+C;P[0].bounds.y=
this.state.y-R+C;P[0].redraw();P[1].bounds.x=P[0].bounds.x+this.state.width-2*C;P[1].bounds.y=P[0].bounds.y;P[1].redraw();P[2].bounds.x=P[0].bounds.x;P[2].bounds.y=this.state.y+this.state.height-2*C;P[2].redraw();P[3].bounds.x=P[1].bounds.x;P[3].bounds.y=P[2].bounds.y;P[3].redraw();for(C=0;C<this.cornerHandles.length;C++)this.cornerHandles[C].node.style.display=1==this.graph.getSelectionCount()?"":"none"}null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.setAttribute("title",
mxResources.get("rotateTooltip")),this.rotationShape.node.style.display=null!=this.moveHandles||1!=this.graph.getSelectionCount()||null!=this.index&&this.index!=mxEvent.ROTATION_HANDLE?"none":"");Oa.apply(this);null!=this.state&&null!=this.linkHint&&(C=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),P=new mxRectangle(this.state.x,this.state.y-22,this.state.width+24,this.state.height+22),R=mxUtils.getBoundingBox(P,this.state.style[mxConstants.STYLE_ROTATION]||"0",C),C=null!=R?mxUtils.getBoundingBox(this.state,
this.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,P=null!=this.state.text?this.state.text.boundingBox:null,null==R&&(R=this.state),R=R.y+R.height,null!=P&&(R=Math.max(R,P.y+P.height)),this.linkHint.style.left=C.x+C.width/2+"px",this.linkHint.style.top=Math.round(R+this.verticalOffset/2+Editor.hintOffset)+"px",this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":"")};var Qa=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){Qa.apply(this,arguments);
this.destroyMoveHandles();this.destroyCornerHandles();null!=this.linkHint&&(null!=this.linkHint.parentNode&&this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getSelectionModel().removeListener(this.changeHandler),this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var Ra=mxEdgeHandler.prototype.redrawHandles;
mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(Ra.apply(this),null!=this.state&&null!=this.linkHint)){var C=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(C=new mxRectangle(C.x,C.y,C.width,C.height),C.add(this.state.text.bounds));this.linkHint.style.left=C.x+C.width/2+"px";this.linkHint.style.top=Math.round(C.y+C.height+Editor.hintOffset)+"px";this.linkHint.style.display=1<this.graph.getSelectionCount()?"none":""}};var za=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=
function(){za.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var Ea=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Ea.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function b(d,p,A){mxShape.call(this);this.line=d;this.stroke=p;this.strokewidth=null!=A?A:1;this.updateBoundsFromLine()}function f(){mxSwimlane.call(this)}function l(){mxSwimlane.call(this)}function u(){mxCylinder.call(this)}function y(){mxConnector.call(this)}function q(){mxCylinder.call(this)}function B(){mxActor.call(this)}function H(){mxCylinder.call(this)}function S(){mxCylinder.call(this)}function E(){mxCylinder.call(this)}function Q(){mxCylinder.call(this)}function c(){mxShape.call(this)}
function g(){mxShape.call(this)}function m(d,p,A,t){mxShape.call(this);this.bounds=d;this.fill=p;this.stroke=A;this.strokewidth=null!=t?t:1}function n(){mxActor.call(this)}function x(){mxCylinder.call(this)}function F(){mxCylinder.call(this)}function I(){mxActor.call(this)}function M(){mxActor.call(this)}function L(){mxActor.call(this)}function K(){mxActor.call(this)}function aa(){mxActor.call(this)}function ja(){mxActor.call(this)}function ca(){mxActor.call(this)}function ba(d,p){this.canvas=d;this.canvas.setLineJoin("round");
this.canvas.setLineCap("round");this.defaultVariation=p;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,ba.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,ba.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,ba.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,ba.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=
mxUtils.bind(this,ba.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,ba.prototype.arcTo)}function oa(){mxRectangleShape.call(this)}function Y(){mxRectangleShape.call(this)}function da(){mxActor.call(this)}function ha(){mxActor.call(this)}function Z(){mxActor.call(this)}function k(){mxRectangleShape.call(this)}function v(){mxRectangleShape.call(this)}function J(){mxCylinder.call(this)}function N(){mxShape.call(this)}function T(){mxShape.call(this)}function V(){mxEllipse.call(this)}
function U(){mxShape.call(this)}function X(){mxShape.call(this)}function fa(){mxRectangleShape.call(this)}function na(){mxShape.call(this)}function la(){mxShape.call(this)}function qa(){mxShape.call(this)}function ya(){mxShape.call(this)}function wa(){mxShape.call(this)}function Ja(){mxCylinder.call(this)}function Aa(){mxCylinder.call(this)}function Ba(){mxRectangleShape.call(this)}function Ga(){mxDoubleEllipse.call(this)}function Ma(){mxDoubleEllipse.call(this)}function ra(){mxArrowConnector.call(this);
this.spacing=0}function Ca(){mxArrowConnector.call(this);this.spacing=0}function Da(){mxActor.call(this)}function va(){mxRectangleShape.call(this)}function Na(){mxActor.call(this)}function Oa(){mxActor.call(this)}function Qa(){mxActor.call(this)}function Ra(){mxActor.call(this)}function za(){mxActor.call(this)}function Ea(){mxActor.call(this)}function C(){mxActor.call(this)}function P(){mxActor.call(this)}function R(){mxActor.call(this)}function W(){mxActor.call(this)}function ia(){mxEllipse.call(this)}
function ka(){mxEllipse.call(this)}function pa(){mxEllipse.call(this)}function xa(){mxRhombus.call(this)}function ta(){mxEllipse.call(this)}function ua(){mxEllipse.call(this)}function Ia(){mxEllipse.call(this)}function Va(){mxEllipse.call(this)}function Wa(){mxActor.call(this)}function Ta(){mxActor.call(this)}function ab(){mxActor.call(this)}function Pa(d,p,A,t){mxShape.call(this);this.bounds=d;this.fill=p;this.stroke=A;this.strokewidth=null!=t?t:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=
!0;this.indent=2;this.rectOutline="single"}function Sa(){mxConnector.call(this)}function gb(){mxConnector.call(this)}function fb(d,p,A,t,z,D,G,ea,O,sa){G+=O;var ma=t.clone();t.x-=z*(2*G+O);t.y-=D*(2*G+O);z*=G+O;D*=G+O;return function(){d.ellipse(ma.x-z-G,ma.y-D-G,2*G,2*G);sa?d.fillAndStroke():d.stroke()}}mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var d=null;if(null!=this.line)for(var p=0;p<this.line.length;p++){var A=this.line[p];null!=A&&(A=new mxRectangle(A.x,A.y,this.strokewidth,
this.strokewidth),null==d?d=A:d.add(A))}this.bounds=null!=d?d:new mxRectangle};b.prototype.paintVertexShape=function(d,p,A,t,z){this.paintTableLine(d,this.line,0,0)};b.prototype.paintTableLine=function(d,p,A,t){if(null!=p){var z=null;d.begin();for(var D=0;D<p.length;D++){var G=p[D];null!=G&&(null==z?d.moveTo(G.x+A,G.y+t):null!=z&&d.lineTo(G.x+A,G.y+t));z=G}d.end();d.stroke()}};b.prototype.intersectsRectangle=function(d){var p=!1;if(mxShape.prototype.intersectsRectangle.apply(this,arguments)&&null!=
this.line)for(var A=null,t=0;t<this.line.length&&!p;t++){var z=this.line[t];null!=z&&null!=A&&(p=mxUtils.rectangleIntersectsSegment(d,A,z));A=z}return p};mxCellRenderer.registerShape("tableLine",b);mxUtils.extend(f,mxSwimlane);f.prototype.getLabelBounds=function(d){return 0==this.getTitleSize()?mxShape.prototype.getLabelBounds.apply(this,arguments):mxSwimlane.prototype.getLabelBounds.apply(this,arguments)};f.prototype.paintVertexShape=function(d,p,A,t,z){var D=null!=this.state?this.state.view.graph.isCellCollapsed(this.state.cell):
!1,G=this.isHorizontal(),ea=this.getTitleSize();0==ea||this.outline?Ia.prototype.paintVertexShape.apply(this,arguments):(mxSwimlane.prototype.paintVertexShape.apply(this,arguments),d.translate(-p,-A));D||this.outline||!(G&&ea<z||!G&&ea<t)||this.paintForeground(d,p,A,t,z)};f.prototype.paintForeground=function(d,p,A,t,z){if(null!=this.state){var D=this.flipH,G=this.flipV;if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var ea=D;D=G;G=ea}d.rotate(-this.getShapeRotation(),
D,G,p+t/2,A+z/2);s=this.scale;p=this.bounds.x/s;A=this.bounds.y/s;t=this.bounds.width/s;z=this.bounds.height/s;this.paintTableForeground(d,p,A,t,z)}};f.prototype.paintTableForeground=function(d,p,A,t,z){t=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(z=0;z<t.length;z++)b.prototype.paintTableLine(d,t[z],p,A)};f.prototype.configurePointerEvents=function(d){0==this.getTitleSize()?
d.pointerEvents=!1:mxSwimlane.prototype.configurePointerEvents.apply(this,arguments)};mxCellRenderer.registerShape("table",f);mxUtils.extend(l,f);l.prototype.paintForeground=function(){};mxCellRenderer.registerShape("tableRow",l);mxUtils.extend(u,mxCylinder);u.prototype.size=20;u.prototype.darkOpacity=0;u.prototype.darkOpacity2=0;u.prototype.paintVertexShape=function(d,p,A,t,z){var D=Math.max(0,Math.min(t,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),G=Math.max(-1,Math.min(1,
parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),ea=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));d.translate(p,A);d.begin();d.moveTo(0,0);d.lineTo(t-D,0);d.lineTo(t,D);d.lineTo(t,z);d.lineTo(D,z);d.lineTo(0,z-D);d.lineTo(0,0);d.close();d.end();d.fillAndStroke();this.outline||(d.setShadow(!1),0!=G&&(d.setFillAlpha(Math.abs(G)),d.setFillColor(0>G?"#FFFFFF":"#000000"),d.begin(),d.moveTo(0,0),d.lineTo(t-D,0),d.lineTo(t,D),
d.lineTo(D,D),d.close(),d.fill()),0!=ea&&(d.setFillAlpha(Math.abs(ea)),d.setFillColor(0>ea?"#FFFFFF":"#000000"),d.begin(),d.moveTo(0,0),d.lineTo(D,D),d.lineTo(D,z),d.lineTo(0,z-D),d.close(),d.fill()),d.begin(),d.moveTo(D,z),d.lineTo(D,D),d.lineTo(0,0),d.moveTo(D,D),d.lineTo(t,D),d.end(),d.stroke())};u.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)?(d=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(d,d,0,0)):null};mxCellRenderer.registerShape("cube",
u);var cb=Math.tan(mxUtils.toRadians(30)),eb=(.5-cb)/2;mxCellRenderer.registerShape("isoRectangle",B);mxUtils.extend(y,mxConnector);y.prototype.paintEdgeShape=function(d,p){var A=this.createMarker(d,p,!0),t=this.createMarker(d,p,!1);d.setDashed(!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments);null!=this.isDashed&&d.setDashed(this.isDashed,null!=this.style?1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1):!1);d.setShadow(!1);d.setStrokeColor(this.fill);mxPolyline.prototype.paintEdgeShape.apply(this,
arguments);d.setStrokeColor(this.stroke);d.setFillColor(this.stroke);d.setDashed(!1);null!=A&&A();null!=t&&t()};mxCellRenderer.registerShape("wire",y);mxUtils.extend(q,mxCylinder);q.prototype.size=6;q.prototype.paintVertexShape=function(d,p,A,t,z){d.setFillColor(this.stroke);var D=Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size))-2)+2*this.strokewidth;d.ellipse(p+.5*(t-D),A+.5*(z-D),D,D);d.fill();d.setFillColor(mxConstants.NONE);d.rect(p,A,t,z);d.fill()};mxCellRenderer.registerShape("waypoint",
q);mxUtils.extend(B,mxActor);B.prototype.size=20;B.prototype.redrawPath=function(d,p,A,t,z){p=Math.min(t,z/cb);d.translate((t-p)/2,(z-p)/2+p/4);d.moveTo(0,.25*p);d.lineTo(.5*p,p*eb);d.lineTo(p,.25*p);d.lineTo(.5*p,(.5-eb)*p);d.lineTo(0,.25*p);d.close();d.end()};mxCellRenderer.registerShape("isoRectangle",B);mxUtils.extend(H,mxCylinder);H.prototype.size=20;H.prototype.redrawPath=function(d,p,A,t,z,D){p=Math.min(t,z/(.5+cb));D?(d.moveTo(0,.25*p),d.lineTo(.5*p,(.5-eb)*p),d.lineTo(p,.25*p),d.moveTo(.5*
p,(.5-eb)*p),d.lineTo(.5*p,(1-eb)*p)):(d.translate((t-p)/2,(z-p)/2),d.moveTo(0,.25*p),d.lineTo(.5*p,p*eb),d.lineTo(p,.25*p),d.lineTo(p,.75*p),d.lineTo(.5*p,(1-eb)*p),d.lineTo(0,.75*p),d.close());d.end()};mxCellRenderer.registerShape("isoCube",H);mxUtils.extend(S,mxCylinder);S.prototype.redrawPath=function(d,p,A,t,z,D){p=Math.min(z/2,Math.round(z/8)+this.strokewidth-1);if(D&&null!=this.fill||!D&&null==this.fill)d.moveTo(0,p),d.curveTo(0,2*p,t,2*p,t,p),D||(d.stroke(),d.begin()),d.translate(0,p/2),d.moveTo(0,
p),d.curveTo(0,2*p,t,2*p,t,p),D||(d.stroke(),d.begin()),d.translate(0,p/2),d.moveTo(0,p),d.curveTo(0,2*p,t,2*p,t,p),D||(d.stroke(),d.begin()),d.translate(0,-p);D||(d.moveTo(0,p),d.curveTo(0,-p/3,t,-p/3,t,p),d.lineTo(t,z-p),d.curveTo(t,z+p/3,0,z+p/3,0,z-p),d.close())};S.prototype.getLabelMargins=function(d){return new mxRectangle(0,2.5*Math.min(d.height/2,Math.round(d.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",S);mxUtils.extend(E,mxCylinder);E.prototype.size=30;E.prototype.darkOpacity=
0;E.prototype.paintVertexShape=function(d,p,A,t,z){var D=Math.max(0,Math.min(t,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),G=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));d.translate(p,A);d.begin();d.moveTo(0,0);d.lineTo(t-D,0);d.lineTo(t,D);d.lineTo(t,z);d.lineTo(0,z);d.lineTo(0,0);d.close();d.end();d.fillAndStroke();this.outline||(d.setShadow(!1),0!=G&&(d.setFillAlpha(Math.abs(G)),d.setFillColor(0>G?"#FFFFFF":"#000000"),
d.begin(),d.moveTo(t-D,0),d.lineTo(t-D,D),d.lineTo(t,D),d.close(),d.fill()),d.begin(),d.moveTo(t-D,0),d.lineTo(t-D,D),d.lineTo(t,D),d.end(),d.stroke())};mxCellRenderer.registerShape("note",E);mxUtils.extend(Q,E);mxCellRenderer.registerShape("note2",Q);Q.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(d.height*this.scale,p*this.scale),0,0)}return null};mxUtils.extend(c,mxShape);c.prototype.isoAngle=
15;c.prototype.paintVertexShape=function(d,p,A,t,z){var D=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;D=Math.min(t*Math.tan(D),.5*z);d.translate(p,A);d.begin();d.moveTo(.5*t,0);d.lineTo(t,D);d.lineTo(t,z-D);d.lineTo(.5*t,z);d.lineTo(0,z-D);d.lineTo(0,D);d.close();d.fillAndStroke();d.setShadow(!1);d.begin();d.moveTo(0,D);d.lineTo(.5*t,2*D);d.lineTo(t,D);d.moveTo(.5*t,2*D);d.lineTo(.5*t,z);d.stroke()};mxCellRenderer.registerShape("isoCube2",
c);mxUtils.extend(g,mxShape);g.prototype.size=15;g.prototype.paintVertexShape=function(d,p,A,t,z){var D=Math.max(0,Math.min(.5*z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.translate(p,A);0==D?(d.rect(0,0,t,z),d.fillAndStroke()):(d.begin(),d.moveTo(0,D),d.arcTo(.5*t,D,0,0,1,.5*t,0),d.arcTo(.5*t,D,0,0,1,t,D),d.lineTo(t,z-D),d.arcTo(.5*t,D,0,0,1,.5*t,z),d.arcTo(.5*t,D,0,0,1,0,z-D),d.close(),d.fillAndStroke(),d.setShadow(!1),d.begin(),d.moveTo(t,D),d.arcTo(.5*t,D,0,0,1,.5*t,2*D),d.arcTo(.5*
t,D,0,0,1,0,D),d.stroke())};mxCellRenderer.registerShape("cylinder2",g);mxUtils.extend(m,mxCylinder);m.prototype.size=15;m.prototype.paintVertexShape=function(d,p,A,t,z){var D=Math.max(0,Math.min(.5*z,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),G=mxUtils.getValue(this.style,"lid",!0);d.translate(p,A);0==D?(d.rect(0,0,t,z),d.fillAndStroke()):(d.begin(),G?(d.moveTo(0,D),d.arcTo(.5*t,D,0,0,1,.5*t,0),d.arcTo(.5*t,D,0,0,1,t,D)):(d.moveTo(0,0),d.arcTo(.5*t,D,0,0,0,.5*t,D),d.arcTo(.5*t,D,
0,0,0,t,0)),d.lineTo(t,z-D),d.arcTo(.5*t,D,0,0,1,.5*t,z),d.arcTo(.5*t,D,0,0,1,0,z-D),d.close(),d.fillAndStroke(),d.setShadow(!1),G&&(d.begin(),d.moveTo(t,D),d.arcTo(.5*t,D,0,0,1,.5*t,2*D),d.arcTo(.5*t,D,0,0,1,0,D),d.stroke()))};mxCellRenderer.registerShape("cylinder3",m);mxUtils.extend(n,mxActor);n.prototype.redrawPath=function(d,p,A,t,z){d.moveTo(0,0);d.quadTo(t/2,.5*z,t,0);d.quadTo(.5*t,z/2,t,z);d.quadTo(t/2,.5*z,0,z);d.quadTo(.5*t,z/2,0,0);d.end()};mxCellRenderer.registerShape("switch",n);mxUtils.extend(x,
mxCylinder);x.prototype.tabWidth=60;x.prototype.tabHeight=20;x.prototype.tabPosition="right";x.prototype.arcSize=.1;x.prototype.isRoundable=function(){return!0};x.prototype.paintVertexShape=function(d,p,A,t,z){d.translate(p,A);p=Math.max(0,Math.min(t,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var D=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),G=mxUtils.getValue(this.style,
"rounded",!1),ea=mxUtils.getValue(this.style,"absoluteArcSize",!1),O=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));ea||(O*=Math.min(t,z));O=Math.min(O,.5*t,.5*(z-A));p=Math.max(p,O);p=Math.min(t-O,p);G||(O=0);d.begin();"left"==D?(d.moveTo(Math.max(O,0),A),d.lineTo(Math.max(O,0),0),d.lineTo(p,0),d.lineTo(p,A)):(d.moveTo(t-p,A),d.lineTo(t-p,0),d.lineTo(t-Math.max(O,0),0),d.lineTo(t-Math.max(O,0),A));G?(d.moveTo(0,O+A),d.arcTo(O,O,0,0,1,O,A),d.lineTo(t-O,A),d.arcTo(O,O,0,0,1,t,O+A),
d.lineTo(t,z-O),d.arcTo(O,O,0,0,1,t-O,z),d.lineTo(O,z),d.arcTo(O,O,0,0,1,0,z-O)):(d.moveTo(0,A),d.lineTo(t,A),d.lineTo(t,z),d.lineTo(0,z));d.close();d.fillAndStroke();d.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(d.begin(),d.moveTo(t-30,A+20),d.lineTo(t-20,A+10),d.lineTo(t-10,A+20),d.close(),d.stroke())};mxCellRenderer.registerShape("folder",x);x.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=mxUtils.getValue(this.style,
"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var A=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;p=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var t=mxUtils.getValue(this.style,"rounded",!1),z=mxUtils.getValue(this.style,"absoluteArcSize",!1),D=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));z||(D*=Math.min(d.width,d.height));D=Math.min(D,.5*d.width,.5*(d.height-p));t||(D=0);return"left"==mxUtils.getValue(this.style,"tabPosition",
this.tabPosition)?new mxRectangle(D,0,Math.min(d.width,d.width-A),Math.min(d.height,d.height-p)):new mxRectangle(Math.min(d.width,d.width-A),0,D,Math.min(d.height,d.height-p))}return new mxRectangle(0,Math.min(d.height,p),0,0)}return null};mxUtils.extend(F,mxCylinder);F.prototype.arcSize=.1;F.prototype.paintVertexShape=function(d,p,A,t,z){d.translate(p,A);var D=mxUtils.getValue(this.style,"rounded",!1),G=mxUtils.getValue(this.style,"absoluteArcSize",!1);p=parseFloat(mxUtils.getValue(this.style,"arcSize",
this.arcSize));A=mxUtils.getValue(this.style,"umlStateConnection",null);G||(p*=Math.min(t,z));p=Math.min(p,.5*t,.5*z);D||(p=0);D=0;null!=A&&(D=10);d.begin();d.moveTo(D,p);d.arcTo(p,p,0,0,1,D+p,0);d.lineTo(t-p,0);d.arcTo(p,p,0,0,1,t,p);d.lineTo(t,z-p);d.arcTo(p,p,0,0,1,t-p,z);d.lineTo(D+p,z);d.arcTo(p,p,0,0,1,D,z-p);d.close();d.fillAndStroke();d.setShadow(!1);"collapseState"==mxUtils.getValue(this.style,"umlStateSymbol",null)&&(d.roundrect(t-40,z-20,10,10,3,3),d.stroke(),d.roundrect(t-20,z-20,10,10,
3,3),d.stroke(),d.begin(),d.moveTo(t-30,z-15),d.lineTo(t-20,z-15),d.stroke());"connPointRefEntry"==A?(d.ellipse(0,.5*z-10,20,20),d.fillAndStroke()):"connPointRefExit"==A&&(d.ellipse(0,.5*z-10,20,20),d.fillAndStroke(),d.begin(),d.moveTo(5,.5*z-5),d.lineTo(15,.5*z+5),d.moveTo(15,.5*z-5),d.lineTo(5,.5*z+5),d.stroke())};F.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,
0,0,0):null};mxCellRenderer.registerShape("umlState",F);mxUtils.extend(I,mxActor);I.prototype.size=30;I.prototype.isRoundable=function(){return!0};I.prototype.redrawPath=function(d,p,A,t,z){p=Math.max(0,Math.min(t,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(p,0),new mxPoint(t,0),new mxPoint(t,z),new mxPoint(0,z),new mxPoint(0,p)],this.isRounded,A,!0);d.end()};
mxCellRenderer.registerShape("card",I);mxUtils.extend(M,mxActor);M.prototype.size=.4;M.prototype.redrawPath=function(d,p,A,t,z){p=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(0,p/2);d.quadTo(t/4,1.4*p,t/2,p/2);d.quadTo(3*t/4,p*(1-1.4),t,p/2);d.lineTo(t,z-p/2);d.quadTo(3*t/4,z-1.4*p,t/2,z-p/2);d.quadTo(t/4,z-p*(1-1.4),0,z-p/2);d.lineTo(0,p/2);d.close();d.end()};M.prototype.getLabelBounds=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=
mxUtils.getValue(this.style,"size",this.size),A=d.width,t=d.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return p*=t,new mxRectangle(d.x,d.y+p,A,t-2*p);p*=A;return new mxRectangle(d.x+p,d.y,A-2*p,t)}return d};mxCellRenderer.registerShape("tape",M);mxUtils.extend(L,mxActor);L.prototype.size=.3;L.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,
"size",this.size))*d.height):null};L.prototype.redrawPath=function(d,p,A,t,z){p=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(0,0);d.lineTo(t,0);d.lineTo(t,z-p/2);d.quadTo(3*t/4,z-1.4*p,t/2,z-p/2);d.quadTo(t/4,z-p*(1-1.4),0,z-p/2);d.lineTo(0,p/2);d.close();d.end()};mxCellRenderer.registerShape("document",L);var lb=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(d,p,A,t){var z=mxUtils.getValue(this.style,"size");return null!=
z?t*Math.max(0,Math.min(1,z)):lb.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale,d.height*p),0,0)}return null};m.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=mxUtils.getValue(this.style,"size",15);mxUtils.getValue(this.style,"lid",!0)||(p/=2);return new mxRectangle(0,Math.min(d.height*
this.scale,2*p*this.scale),0,Math.max(0,.3*p*this.scale))}return null};x.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var A=mxUtils.getValue(this.style,"tabWidth",15)*this.scale;p=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;var t=mxUtils.getValue(this.style,"rounded",!1),z=mxUtils.getValue(this.style,"absoluteArcSize",!1),D=parseFloat(mxUtils.getValue(this.style,
"arcSize",this.arcSize));z||(D*=Math.min(d.width,d.height));D=Math.min(D,.5*d.width,.5*(d.height-p));t||(D=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(D,0,Math.min(d.width,d.width-A),Math.min(d.height,d.height-p)):new mxRectangle(Math.min(d.width,d.width-A),0,D,Math.min(d.height,d.height-p))}return new mxRectangle(0,Math.min(d.height,p),0,0)}return null};F.prototype.getLabelMargins=function(d){return mxUtils.getValue(this.style,"boundedLbl",!1)&&null!=
mxUtils.getValue(this.style,"umlStateConnection",null)?new mxRectangle(10*this.scale,0,0,0):null};Q.prototype.getLabelMargins=function(d){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var p=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(d.height*this.scale,p*this.scale),0,Math.max(0,p*this.scale))}return null};mxUtils.extend(K,mxActor);K.prototype.size=.2;K.prototype.fixedSize=20;K.prototype.isRoundable=function(){return!0};K.prototype.redrawPath=function(d,p,A,t,z){p=
"0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(t,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):t*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,z),new mxPoint(p,0),new mxPoint(t,0),new mxPoint(t-p,z)],this.isRounded,A,!0);d.end()};mxCellRenderer.registerShape("parallelogram",K);mxUtils.extend(aa,mxActor);aa.prototype.size=
.2;aa.prototype.fixedSize=20;aa.prototype.isRoundable=function(){return!0};aa.prototype.redrawPath=function(d,p,A,t,z){p="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*t,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):t*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,z),new mxPoint(p,0),new mxPoint(t-p,0),
new mxPoint(t,z)],this.isRounded,A,!0)};mxCellRenderer.registerShape("trapezoid",aa);mxUtils.extend(ja,mxActor);ja.prototype.size=.5;ja.prototype.redrawPath=function(d,p,A,t,z){d.setFillColor(null);p=t*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(t,0),new mxPoint(p,0),new mxPoint(p,z/2),new mxPoint(0,z/2),new mxPoint(p,z/2),new mxPoint(p,z),new mxPoint(t,
z)],this.isRounded,A,!1);d.end()};mxCellRenderer.registerShape("curlyBracket",ja);mxUtils.extend(ca,mxActor);ca.prototype.redrawPath=function(d,p,A,t,z){d.setStrokeWidth(1);d.setFillColor(this.stroke);p=t/5;d.rect(0,0,p,z);d.fillAndStroke();d.rect(2*p,0,p,z);d.fillAndStroke();d.rect(4*p,0,p,z);d.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",ca);ba.prototype.moveTo=function(d,p){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=p;this.firstX=d;this.firstY=p};
ba.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)};ba.prototype.quadTo=function(d,p,A,t){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=A;this.lastY=t};ba.prototype.curveTo=function(d,p,A,t,z,D){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=z;this.lastY=D};ba.prototype.arcTo=function(d,p,A,t,z,D,G){this.originalArcTo.apply(this.canvas,
arguments);this.lastX=D;this.lastY=G};ba.prototype.lineTo=function(d,p){if(null!=this.lastX&&null!=this.lastY){var A=function(ma){return"number"===typeof ma?ma?0>ma?-1:1:ma===ma?0:NaN:NaN},t=Math.abs(d-this.lastX),z=Math.abs(p-this.lastY),D=Math.sqrt(t*t+z*z);if(2>D){this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=p;return}var G=Math.round(D/10),ea=this.defaultVariation;5>G&&(G=5,ea/=3);var O=A(d-this.lastX)*t/G;A=A(p-this.lastY)*z/G;t/=D;z/=D;for(D=0;D<G;D++){var sa=(Math.random()-
.5)*ea;this.originalLineTo.call(this.canvas,O*D+this.lastX-sa*z,A*D+this.lastY-sa*t)}this.originalLineTo.call(this.canvas,d,p)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=p};ba.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 kb=mxShape.prototype.beforePaint;
mxShape.prototype.beforePaint=function(d){kb.apply(this,arguments);null==d.handJiggle&&(d.handJiggle=this.createHandJiggle(d))};var ob=mxShape.prototype.afterPaint;mxShape.prototype.afterPaint=function(d){ob.apply(this,arguments);null!=d.handJiggle&&(d.handJiggle.destroy(),delete d.handJiggle)};mxShape.prototype.createComicCanvas=function(d){return new ba(d,mxUtils.getValue(this.style,"jiggle",Editor.sketchDefaultJiggle))};mxShape.prototype.createHandJiggle=function(d){return this.outline||null==
this.style||"0"==mxUtils.getValue(this.style,"comic","0")?null:this.createComicCanvas(d)};var hb=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"))&&hb.apply(this,arguments)};var pb=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(d,p,A,t,z){if(null==d.handJiggle||
d.handJiggle.constructor!=ba)pb.apply(this,arguments);else{var D=!0;null!=this.style&&(D="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(D||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)D||null!=this.fill&&this.fill!=mxConstants.NONE||(d.pointerEvents=!1),d.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?D=Math.min(t/2,Math.min(z/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,
mxConstants.LINE_ARCSIZE)/2)):(D=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,D=Math.min(t*D,z*D)),d.moveTo(p+D,A),d.lineTo(p+t-D,A),d.quadTo(p+t,A,p+t,A+D),d.lineTo(p+t,A+z-D),d.quadTo(p+t,A+z,p+t-D,A+z),d.lineTo(p+D,A+z),d.quadTo(p,A+z,p,A+z-D),d.lineTo(p,A+D),d.quadTo(p,A,p+D,A)):(d.moveTo(p,A),d.lineTo(p+t,A),d.lineTo(p+t,A+z),d.lineTo(p,A+z),d.lineTo(p,A)),d.close(),d.end(),d.fillAndStroke()}};mxUtils.extend(oa,mxRectangleShape);oa.prototype.size=
.1;oa.prototype.fixedSize=!1;oa.prototype.isHtmlAllowed=function(){return!1};oa.prototype.getLabelBounds=function(d){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var p=d.width,A=d.height;d=new mxRectangle(d.x,d.y,p,A);var t=p*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded){var z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,
100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;t=Math.max(t,Math.min(p*z,A*z))}d.x+=Math.round(t);d.width-=Math.round(2*t);return d}return d};oa.prototype.paintForeground=function(d,p,A,t,z){var D=mxUtils.getValue(this.style,"fixedSize",this.fixedSize),G=parseFloat(mxUtils.getValue(this.style,"size",this.size));G=D?Math.max(0,Math.min(t,G)):t*Math.max(0,Math.min(1,G));this.isRounded&&(D=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,G=Math.max(G,
Math.min(t*D,z*D)));G=Math.round(G);d.begin();d.moveTo(p+G,A);d.lineTo(p+G,A+z);d.moveTo(p+t-G,A);d.lineTo(p+t-G,A+z);d.end();d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",oa);mxCellRenderer.registerShape("process2",oa);mxUtils.extend(Y,mxRectangleShape);Y.prototype.paintBackground=function(d,p,A,t,z){d.setFillColor(mxConstants.NONE);d.rect(p,A,t,z);d.fill()};Y.prototype.paintForeground=function(d,p,A,t,z){};mxCellRenderer.registerShape("transparent",
Y);mxUtils.extend(da,mxHexagon);da.prototype.size=30;da.prototype.position=.5;da.prototype.position2=.5;da.prototype.base=20;da.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};da.prototype.isRoundable=function(){return!0};da.prototype.redrawPath=function(d,p,A,t,z){p=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,
"size",this.size))));var D=t*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),G=t*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),ea=Math.max(0,Math.min(t,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(d,[new mxPoint(0,0),new mxPoint(t,0),new mxPoint(t,z-A),new mxPoint(Math.min(t,D+ea),z-A),new mxPoint(G,z),new mxPoint(Math.max(0,D),z-A),new mxPoint(0,z-A)],this.isRounded,p,!0,[4])};mxCellRenderer.registerShape("callout",
da);mxUtils.extend(ha,mxActor);ha.prototype.size=.2;ha.prototype.fixedSize=20;ha.prototype.isRoundable=function(){return!0};ha.prototype.redrawPath=function(d,p,A,t,z){p="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(t,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):t*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,
0),new mxPoint(t-p,0),new mxPoint(t,z/2),new mxPoint(t-p,z),new mxPoint(0,z),new mxPoint(p,z/2)],this.isRounded,A,!0);d.end()};mxCellRenderer.registerShape("step",ha);mxUtils.extend(Z,mxHexagon);Z.prototype.size=.25;Z.prototype.fixedSize=20;Z.prototype.isRoundable=function(){return!0};Z.prototype.redrawPath=function(d,p,A,t,z){p="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(.5*t,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):t*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,
"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(p,0),new mxPoint(t-p,0),new mxPoint(t,.5*z),new mxPoint(t-p,z),new mxPoint(p,z),new mxPoint(0,.5*z)],this.isRounded,A,!0)};mxCellRenderer.registerShape("hexagon",Z);mxUtils.extend(k,mxRectangleShape);k.prototype.isHtmlAllowed=function(){return!1};k.prototype.paintForeground=function(d,p,A,t,z){var D=Math.min(t/5,z/5)+1;d.begin();d.moveTo(p+t/2,A+D);d.lineTo(p+t/2,
A+z-D);d.moveTo(p+D,A+z/2);d.lineTo(p+t-D,A+z/2);d.end();d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",k);var sb=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(d){if(1==this.style["double"]){var p=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(d.x+p,d.y+p,d.width-2*p,d.height-2*p)}return d};mxRhombus.prototype.paintVertexShape=
function(d,p,A,t,z){sb.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var D=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);p+=D;A+=D;t-=2*D;z-=2*D;0<t&&0<z&&(d.setShadow(!1),sb.apply(this,[d,p,A,t,z]))}};mxUtils.extend(v,mxRectangleShape);v.prototype.isHtmlAllowed=function(){return!1};v.prototype.getLabelBounds=function(d){if(1==this.style["double"]){var p=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;
return new mxRectangle(d.x+p,d.y+p,d.width-2*p,d.height-2*p)}return d};v.prototype.paintForeground=function(d,p,A,t,z){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var D=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);p+=D;A+=D;t-=2*D;z-=2*D;0<t&&0<z&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}d.setDashed(!1);D=0;do{var G=mxCellRenderer.defaultShapes[this.style["symbol"+D]];if(null!=G){var ea=this.style["symbol"+D+"Align"],
O=this.style["symbol"+D+"VerticalAlign"],sa=this.style["symbol"+D+"Width"],ma=this.style["symbol"+D+"Height"],$a=this.style["symbol"+D+"Spacing"]||0,jb=this.style["symbol"+D+"VSpacing"]||$a,db=this.style["symbol"+D+"ArcSpacing"];null!=db&&(db*=this.getArcSize(t+this.strokewidth,z+this.strokewidth),$a+=db,jb+=db);db=p;var Fa=A;db=ea==mxConstants.ALIGN_CENTER?db+(t-sa)/2:ea==mxConstants.ALIGN_RIGHT?db+(t-sa-$a):db+$a;Fa=O==mxConstants.ALIGN_MIDDLE?Fa+(z-ma)/2:O==mxConstants.ALIGN_BOTTOM?Fa+(z-ma-jb):
Fa+jb;d.save();ea=new G;ea.style=this.style;G.prototype.paintVertexShape.call(ea,d,db,Fa,sa,ma);d.restore()}D++}while(null!=G)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",v);mxUtils.extend(J,mxCylinder);J.prototype.redrawPath=function(d,p,A,t,z,D){D?(d.moveTo(0,0),d.lineTo(t/2,z/2),d.lineTo(t,0),d.end()):(d.moveTo(0,0),d.lineTo(t,0),d.lineTo(t,z),d.lineTo(0,z),d.close())};mxCellRenderer.registerShape("message",J);mxUtils.extend(N,mxShape);N.prototype.paintBackground=
function(d,p,A,t,z){d.translate(p,A);d.ellipse(t/4,0,t/2,z/4);d.fillAndStroke();d.begin();d.moveTo(t/2,z/4);d.lineTo(t/2,2*z/3);d.moveTo(t/2,z/3);d.lineTo(0,z/3);d.moveTo(t/2,z/3);d.lineTo(t,z/3);d.moveTo(t/2,2*z/3);d.lineTo(0,z);d.moveTo(t/2,2*z/3);d.lineTo(t,z);d.end();d.stroke()};mxCellRenderer.registerShape("umlActor",N);mxUtils.extend(T,mxShape);T.prototype.getLabelMargins=function(d){return new mxRectangle(d.width/6,0,0,0)};T.prototype.paintBackground=function(d,p,A,t,z){d.translate(p,A);d.begin();
d.moveTo(0,z/4);d.lineTo(0,3*z/4);d.end();d.stroke();d.begin();d.moveTo(0,z/2);d.lineTo(t/6,z/2);d.end();d.stroke();d.ellipse(t/6,0,5*t/6,z);d.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",T);mxUtils.extend(V,mxEllipse);V.prototype.paintVertexShape=function(d,p,A,t,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.begin();d.moveTo(p+t/8,A+z);d.lineTo(p+7*t/8,A+z);d.end();d.stroke()};mxCellRenderer.registerShape("umlEntity",V);mxUtils.extend(U,mxShape);U.prototype.paintVertexShape=
function(d,p,A,t,z){d.translate(p,A);d.begin();d.moveTo(t,0);d.lineTo(0,z);d.moveTo(0,0);d.lineTo(t,z);d.end();d.stroke()};mxCellRenderer.registerShape("umlDestroy",U);mxUtils.extend(X,mxShape);X.prototype.getLabelBounds=function(d){return new mxRectangle(d.x,d.y+d.height/8,d.width,7*d.height/8)};X.prototype.paintBackground=function(d,p,A,t,z){d.translate(p,A);d.begin();d.moveTo(3*t/8,z/8*1.1);d.lineTo(5*t/8,0);d.end();d.stroke();d.ellipse(0,z/8,t,7*z/8);d.fillAndStroke()};X.prototype.paintForeground=
function(d,p,A,t,z){d.begin();d.moveTo(3*t/8,z/8*1.1);d.lineTo(5*t/8,z/4);d.end();d.stroke()};mxCellRenderer.registerShape("umlControl",X);mxUtils.extend(fa,mxRectangleShape);fa.prototype.size=40;fa.prototype.isHtmlAllowed=function(){return!1};fa.prototype.getLabelBounds=function(d){var p=Math.max(0,Math.min(d.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(d.x,d.y,d.width,p)};fa.prototype.paintBackground=function(d,p,A,t,z){var D=Math.max(0,Math.min(z,
parseFloat(mxUtils.getValue(this.style,"size",this.size)))),G=mxUtils.getValue(this.style,"participant");null==G||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,d,p,A,t,D):(G=this.state.view.graph.cellRenderer.getShape(G),null!=G&&G!=fa&&(G=new G,G.apply(this.state),d.save(),G.paintVertexShape(d,p,A,t,D),d.restore()));D<z&&(d.setDashed("1"==mxUtils.getValue(this.style,"lifelineDashed","1")),d.begin(),d.moveTo(p+t/2,A+D),d.lineTo(p+t/2,A+z),d.end(),d.stroke())};fa.prototype.paintForeground=
function(d,p,A,t,z){var D=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,d,p,A,t,Math.min(z,D))};mxCellRenderer.registerShape("umlLifeline",fa);mxUtils.extend(na,mxShape);na.prototype.width=60;na.prototype.height=30;na.prototype.corner=10;na.prototype.configurePointerEvents=function(d){var p=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);null==this.style||null!=p&&p!=mxConstants.NONE&&
0!=this.opacity&&0!=this.fillOpacity||"0"!=mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||(d.pointerEvents=!1)};na.prototype.getLabelMargins=function(d){return new mxRectangle(0,0,d.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),d.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))};na.prototype.paintBackground=function(d,p,A,t,z){var D=this.corner,G=Math.min(t,Math.max(D,parseFloat(mxUtils.getValue(this.style,"width",
this.width)))),ea=Math.min(z,Math.max(1.5*D,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),O=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);O!=mxConstants.NONE&&(d.setFillColor(O),d.rect(p,A,t,z),d.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE?(this.getGradientBounds(d,p,A,t,z),d.setGradient(this.fill,this.gradient,p,A,t,z,this.gradientDirection)):d.setFillColor(this.fill);d.pointerEvents=!0;
d.begin();d.moveTo(p,A);d.lineTo(p+G,A);d.lineTo(p+G,A+Math.max(0,ea-1.5*D));d.lineTo(p+Math.max(0,G-D),A+ea);d.lineTo(p,A+ea);d.close();d.fillAndStroke();this.configurePointerEvents(d);d.begin();d.moveTo(p+G,A);d.lineTo(p+t,A);d.lineTo(p+t,A+z);d.lineTo(p,A+z);d.lineTo(p,A+ea);d.stroke()};mxCellRenderer.registerShape("umlFrame",na);mxPerimeter.CenterPerimeter=function(d,p,A,t){return new mxPoint(d.getCenterX(),d.getCenterY())};mxStyleRegistry.putValue("centerPerimeter",mxPerimeter.CenterPerimeter);
mxPerimeter.LifelinePerimeter=function(d,p,A,t){t=fa.prototype.size;null!=p&&(t=mxUtils.getValue(p.style,"size",t)*p.view.scale);p=parseFloat(p.style[mxConstants.STYLE_STROKEWIDTH]||1)*p.view.scale/2-1;A.x<d.getCenterX()&&(p=-1*(p+1));return new mxPoint(d.getCenterX()+p,Math.min(d.y+d.height,Math.max(d.y+t,A.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(d,p,A,t){t=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};
mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(d,p,A,t){t=parseFloat(p.style[mxConstants.STYLE_STROKEWIDTH]||1)*p.view.scale/2-1;null!=p.style.backboneSize&&(t+=parseFloat(p.style.backboneSize)*p.view.scale/2-1);if("south"==p.style[mxConstants.STYLE_DIRECTION]||"north"==p.style[mxConstants.STYLE_DIRECTION])return A.x<d.getCenterX()&&(t=-1*(t+1)),new mxPoint(d.getCenterX()+t,Math.min(d.y+d.height,Math.max(d.y,A.y)));A.y<d.getCenterY()&&
(t=-1*(t+1));return new mxPoint(Math.min(d.x+d.width,Math.max(d.x,A.x)),d.getCenterY()+t)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(d,p,A,t){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(d,new mxRectangle(0,0,0,Math.max(0,Math.min(d.height,parseFloat(mxUtils.getValue(p.style,"size",da.prototype.size))*p.view.scale))),p.style),p,A,t)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);
mxPerimeter.ParallelogramPerimeter=function(d,p,A,t){var z="0"!=mxUtils.getValue(p.style,"fixedSize","0"),D=z?K.prototype.fixedSize:K.prototype.size;null!=p&&(D=mxUtils.getValue(p.style,"size",D));z&&(D*=p.view.scale);var G=d.x,ea=d.y,O=d.width,sa=d.height;p=null!=p?mxUtils.getValue(p.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;p==mxConstants.DIRECTION_NORTH||p==mxConstants.DIRECTION_SOUTH?(z=z?Math.max(0,Math.min(sa,D)):sa*Math.max(0,Math.min(1,D)),ea=
[new mxPoint(G,ea),new mxPoint(G+O,ea+z),new mxPoint(G+O,ea+sa),new mxPoint(G,ea+sa-z),new mxPoint(G,ea)]):(z=z?Math.max(0,Math.min(.5*O,D)):O*Math.max(0,Math.min(1,D)),ea=[new mxPoint(G+z,ea),new mxPoint(G+O,ea),new mxPoint(G+O-z,ea+sa),new mxPoint(G,ea+sa),new mxPoint(G+z,ea)]);sa=d.getCenterX();d=d.getCenterY();d=new mxPoint(sa,d);t&&(A.x<G||A.x>G+O?d.y=A.y:d.x=A.x);return mxUtils.getPerimeterPoint(ea,d,A)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=
function(d,p,A,t){var z="0"!=mxUtils.getValue(p.style,"fixedSize","0"),D=z?aa.prototype.fixedSize:aa.prototype.size;null!=p&&(D=mxUtils.getValue(p.style,"size",D));z&&(D*=p.view.scale);var G=d.x,ea=d.y,O=d.width,sa=d.height;p=null!=p?mxUtils.getValue(p.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;p==mxConstants.DIRECTION_EAST?(z=z?Math.max(0,Math.min(.5*O,D)):O*Math.max(0,Math.min(1,D)),ea=[new mxPoint(G+z,ea),new mxPoint(G+O-z,ea),new mxPoint(G+O,ea+sa),
new mxPoint(G,ea+sa),new mxPoint(G+z,ea)]):p==mxConstants.DIRECTION_WEST?(z=z?Math.max(0,Math.min(O,D)):O*Math.max(0,Math.min(1,D)),ea=[new mxPoint(G,ea),new mxPoint(G+O,ea),new mxPoint(G+O-z,ea+sa),new mxPoint(G+z,ea+sa),new mxPoint(G,ea)]):p==mxConstants.DIRECTION_NORTH?(z=z?Math.max(0,Math.min(sa,D)):sa*Math.max(0,Math.min(1,D)),ea=[new mxPoint(G,ea+z),new mxPoint(G+O,ea),new mxPoint(G+O,ea+sa),new mxPoint(G,ea+sa-z),new mxPoint(G,ea+z)]):(z=z?Math.max(0,Math.min(sa,D)):sa*Math.max(0,Math.min(1,
D)),ea=[new mxPoint(G,ea),new mxPoint(G+O,ea+z),new mxPoint(G+O,ea+sa-z),new mxPoint(G,ea+sa),new mxPoint(G,ea)]);sa=d.getCenterX();d=d.getCenterY();d=new mxPoint(sa,d);t&&(A.x<G||A.x>G+O?d.y=A.y:d.x=A.x);return mxUtils.getPerimeterPoint(ea,d,A)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(d,p,A,t){var z="0"!=mxUtils.getValue(p.style,"fixedSize","0"),D=z?ha.prototype.fixedSize:ha.prototype.size;null!=p&&(D=mxUtils.getValue(p.style,
"size",D));z&&(D*=p.view.scale);var G=d.x,ea=d.y,O=d.width,sa=d.height,ma=d.getCenterX();d=d.getCenterY();p=null!=p?mxUtils.getValue(p.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;p==mxConstants.DIRECTION_EAST?(z=z?Math.max(0,Math.min(O,D)):O*Math.max(0,Math.min(1,D)),ea=[new mxPoint(G,ea),new mxPoint(G+O-z,ea),new mxPoint(G+O,d),new mxPoint(G+O-z,ea+sa),new mxPoint(G,ea+sa),new mxPoint(G+z,d),new mxPoint(G,ea)]):p==mxConstants.DIRECTION_WEST?(z=z?Math.max(0,
Math.min(O,D)):O*Math.max(0,Math.min(1,D)),ea=[new mxPoint(G+z,ea),new mxPoint(G+O,ea),new mxPoint(G+O-z,d),new mxPoint(G+O,ea+sa),new mxPoint(G+z,ea+sa),new mxPoint(G,d),new mxPoint(G+z,ea)]):p==mxConstants.DIRECTION_NORTH?(z=z?Math.max(0,Math.min(sa,D)):sa*Math.max(0,Math.min(1,D)),ea=[new mxPoint(G,ea+z),new mxPoint(ma,ea),new mxPoint(G+O,ea+z),new mxPoint(G+O,ea+sa),new mxPoint(ma,ea+sa-z),new mxPoint(G,ea+sa),new mxPoint(G,ea+z)]):(z=z?Math.max(0,Math.min(sa,D)):sa*Math.max(0,Math.min(1,D)),
ea=[new mxPoint(G,ea),new mxPoint(ma,ea+z),new mxPoint(G+O,ea),new mxPoint(G+O,ea+sa-z),new mxPoint(ma,ea+sa),new mxPoint(G,ea+sa-z),new mxPoint(G,ea)]);ma=new mxPoint(ma,d);t&&(A.x<G||A.x>G+O?ma.y=A.y:ma.x=A.x);return mxUtils.getPerimeterPoint(ea,ma,A)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(d,p,A,t){var z="0"!=mxUtils.getValue(p.style,"fixedSize","0"),D=z?Z.prototype.fixedSize:Z.prototype.size;null!=p&&(D=mxUtils.getValue(p.style,
"size",D));z&&(D*=p.view.scale);var G=d.x,ea=d.y,O=d.width,sa=d.height,ma=d.getCenterX();d=d.getCenterY();p=null!=p?mxUtils.getValue(p.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;p==mxConstants.DIRECTION_NORTH||p==mxConstants.DIRECTION_SOUTH?(z=z?Math.max(0,Math.min(sa,D)):sa*Math.max(0,Math.min(1,D)),ea=[new mxPoint(ma,ea),new mxPoint(G+O,ea+z),new mxPoint(G+O,ea+sa-z),new mxPoint(ma,ea+sa),new mxPoint(G,ea+sa-z),new mxPoint(G,ea+z),new mxPoint(ma,ea)]):
(z=z?Math.max(0,Math.min(O,D)):O*Math.max(0,Math.min(1,D)),ea=[new mxPoint(G+z,ea),new mxPoint(G+O-z,ea),new mxPoint(G+O,d),new mxPoint(G+O-z,ea+sa),new mxPoint(G+z,ea+sa),new mxPoint(G,d),new mxPoint(G+z,ea)]);ma=new mxPoint(ma,d);t&&(A.x<G||A.x>G+O?ma.y=A.y:ma.x=A.x);return mxUtils.getPerimeterPoint(ea,ma,A)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(la,mxShape);la.prototype.size=10;la.prototype.paintBackground=function(d,p,A,t,z){var D=parseFloat(mxUtils.getValue(this.style,
"size",this.size));d.translate(p,A);d.ellipse((t-D)/2,0,D,D);d.fillAndStroke();d.begin();d.moveTo(t/2,D);d.lineTo(t/2,z);d.end();d.stroke()};mxCellRenderer.registerShape("lollipop",la);mxUtils.extend(qa,mxShape);qa.prototype.size=10;qa.prototype.inset=2;qa.prototype.paintBackground=function(d,p,A,t,z){var D=parseFloat(mxUtils.getValue(this.style,"size",this.size)),G=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;d.translate(p,A);d.begin();d.moveTo(t/2,D+G);d.lineTo(t/
2,z);d.end();d.stroke();d.begin();d.moveTo((t-D)/2-G,D/2);d.quadTo((t-D)/2-G,D+G,t/2,D+G);d.quadTo((t+D)/2+G,D+G,(t+D)/2+G,D/2);d.end();d.stroke()};mxCellRenderer.registerShape("requires",qa);mxUtils.extend(ya,mxShape);ya.prototype.paintBackground=function(d,p,A,t,z){d.translate(p,A);d.begin();d.moveTo(0,0);d.quadTo(t,0,t,z/2);d.quadTo(t,z,0,z);d.end();d.stroke()};mxCellRenderer.registerShape("requiredInterface",ya);mxUtils.extend(wa,mxShape);wa.prototype.inset=2;wa.prototype.paintBackground=function(d,
p,A,t,z){var D=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;d.translate(p,A);d.ellipse(0,D,t-2*D,z-2*D);d.fillAndStroke();d.begin();d.moveTo(t/2,0);d.quadTo(t,0,t,z/2);d.quadTo(t,z,t/2,z);d.end();d.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",wa);mxUtils.extend(Ja,mxCylinder);Ja.prototype.jettyWidth=20;Ja.prototype.jettyHeight=10;Ja.prototype.redrawPath=function(d,p,A,t,z,D){var G=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));
p=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));A=G/2;G=A+G/2;var ea=Math.min(p,z-p),O=Math.min(ea+2*p,z-p);D?(d.moveTo(A,ea),d.lineTo(G,ea),d.lineTo(G,ea+p),d.lineTo(A,ea+p),d.moveTo(A,O),d.lineTo(G,O),d.lineTo(G,O+p),d.lineTo(A,O+p)):(d.moveTo(A,0),d.lineTo(t,0),d.lineTo(t,z),d.lineTo(A,z),d.lineTo(A,O+p),d.lineTo(0,O+p),d.lineTo(0,O),d.lineTo(A,O),d.lineTo(A,ea+p),d.lineTo(0,ea+p),d.lineTo(0,ea),d.lineTo(A,ea),d.close());d.end()};mxCellRenderer.registerShape("module",
Ja);mxUtils.extend(Aa,mxCylinder);Aa.prototype.jettyWidth=32;Aa.prototype.jettyHeight=12;Aa.prototype.redrawPath=function(d,p,A,t,z,D){var G=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));p=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));A=G/2;G=A+G/2;var ea=.3*z-p/2,O=.7*z-p/2;D?(d.moveTo(A,ea),d.lineTo(G,ea),d.lineTo(G,ea+p),d.lineTo(A,ea+p),d.moveTo(A,O),d.lineTo(G,O),d.lineTo(G,O+p),d.lineTo(A,O+p)):(d.moveTo(A,0),d.lineTo(t,0),d.lineTo(t,z),d.lineTo(A,
z),d.lineTo(A,O+p),d.lineTo(0,O+p),d.lineTo(0,O),d.lineTo(A,O),d.lineTo(A,ea+p),d.lineTo(0,ea+p),d.lineTo(0,ea),d.lineTo(A,ea),d.close());d.end()};mxCellRenderer.registerShape("component",Aa);mxUtils.extend(Ba,mxRectangleShape);Ba.prototype.paintForeground=function(d,p,A,t,z){var D=t/2,G=z/2,ea=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;d.begin();this.addPoints(d,[new mxPoint(p+D,A),new mxPoint(p+t,A+G),new mxPoint(p+D,A+z),new mxPoint(p,A+G)],this.isRounded,
ea,!0);d.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",Ba);mxUtils.extend(Ga,mxDoubleEllipse);Ga.prototype.outerStroke=!0;Ga.prototype.paintVertexShape=function(d,p,A,t,z){var D=Math.min(4,Math.min(t/5,z/5));0<t&&0<z&&(d.ellipse(p+D,A+D,t-2*D,z-2*D),d.fillAndStroke());d.setShadow(!1);this.outerStroke&&(d.ellipse(p,A,t,z),d.stroke())};mxCellRenderer.registerShape("endState",Ga);mxUtils.extend(Ma,Ga);Ma.prototype.outerStroke=
!1;mxCellRenderer.registerShape("startState",Ma);mxUtils.extend(ra,mxArrowConnector);ra.prototype.defaultWidth=4;ra.prototype.isOpenEnded=function(){return!0};ra.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};ra.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",ra);mxUtils.extend(Ca,mxArrowConnector);Ca.prototype.defaultWidth=10;Ca.prototype.defaultArrowWidth=20;Ca.prototype.getStartArrowWidth=
function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};Ca.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};Ca.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",Ca);mxUtils.extend(Da,mxActor);Da.prototype.size=30;Da.prototype.isRoundable=function(){return!0};
Da.prototype.redrawPath=function(d,p,A,t,z){p=Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size)));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,z),new mxPoint(0,p),new mxPoint(t,0),new mxPoint(t,z)],this.isRounded,A,!0);d.end()};mxCellRenderer.registerShape("manualInput",Da);mxUtils.extend(va,mxRectangleShape);va.prototype.dx=20;va.prototype.dy=20;va.prototype.isHtmlAllowed=function(){return!1};va.prototype.paintForeground=
function(d,p,A,t,z){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var D=0;if(this.isRounded){var G=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;D=Math.max(D,Math.min(t*G,z*G))}G=Math.max(D,Math.min(t,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));D=Math.max(D,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));d.begin();d.moveTo(p,A+D);d.lineTo(p+t,A+D);d.end();d.stroke();d.begin();d.moveTo(p+G,A);d.lineTo(p+
G,A+z);d.end();d.stroke()};mxCellRenderer.registerShape("internalStorage",va);mxUtils.extend(Na,mxActor);Na.prototype.dx=20;Na.prototype.dy=20;Na.prototype.isRoundable=function(){return!0};Na.prototype.redrawPath=function(d,p,A,t,z){p=Math.max(0,Math.min(t,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var D=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,
mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,0),new mxPoint(t,0),new mxPoint(t,A),new mxPoint(p,A),new mxPoint(p,z),new mxPoint(0,z)],this.isRounded,D,!0);d.end()};mxCellRenderer.registerShape("corner",Na);mxUtils.extend(Oa,mxActor);Oa.prototype.redrawPath=function(d,p,A,t,z){d.moveTo(0,0);d.lineTo(0,z);d.end();d.moveTo(t,0);d.lineTo(t,z);d.end();d.moveTo(0,z/2);d.lineTo(t,z/2);d.end()};mxCellRenderer.registerShape("crossbar",Oa);mxUtils.extend(Qa,mxActor);Qa.prototype.dx=20;Qa.prototype.dy=
20;Qa.prototype.isRoundable=function(){return!0};Qa.prototype.redrawPath=function(d,p,A,t,z){p=Math.max(0,Math.min(t,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));A=Math.max(0,Math.min(z,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var D=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,0),new mxPoint(t,0),new mxPoint(t,A),new mxPoint((t+p)/2,A),new mxPoint((t+
p)/2,z),new mxPoint((t-p)/2,z),new mxPoint((t-p)/2,A),new mxPoint(0,A)],this.isRounded,D,!0);d.end()};mxCellRenderer.registerShape("tee",Qa);mxUtils.extend(Ra,mxActor);Ra.prototype.arrowWidth=.3;Ra.prototype.arrowSize=.2;Ra.prototype.isRoundable=function(){return!0};Ra.prototype.redrawPath=function(d,p,A,t,z){var D=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));p=t*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));
A=(z-D)/2;D=A+D;var G=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,A),new mxPoint(t-p,A),new mxPoint(t-p,0),new mxPoint(t,z/2),new mxPoint(t-p,z),new mxPoint(t-p,D),new mxPoint(0,D)],this.isRounded,G,!0);d.end()};mxCellRenderer.registerShape("singleArrow",Ra);mxUtils.extend(za,mxActor);za.prototype.isRoundable=function(){return!0};za.prototype.redrawPath=function(d,p,A,t,z){var D=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,
"arrowWidth",Ra.prototype.arrowWidth))));p=t*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Ra.prototype.arrowSize))));A=(z-D)/2;D=A+D;var G=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,z/2),new mxPoint(p,0),new mxPoint(p,A),new mxPoint(t-p,A),new mxPoint(t-p,0),new mxPoint(t,z/2),new mxPoint(t-p,z),new mxPoint(t-p,D),new mxPoint(p,D),new mxPoint(p,z)],this.isRounded,G,!0);d.end()};mxCellRenderer.registerShape("doubleArrow",
za);mxUtils.extend(Ea,mxActor);Ea.prototype.size=.1;Ea.prototype.fixedSize=20;Ea.prototype.redrawPath=function(d,p,A,t,z){p="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(t,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):t*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.moveTo(p,0);d.lineTo(t,0);d.quadTo(t-2*p,z/2,t,z);d.lineTo(p,z);d.quadTo(p-2*p,z/2,p,0);d.close();d.end()};mxCellRenderer.registerShape("dataStorage",Ea);
mxUtils.extend(C,mxActor);C.prototype.redrawPath=function(d,p,A,t,z){d.moveTo(0,0);d.quadTo(t,0,t,z/2);d.quadTo(t,z,0,z);d.close();d.end()};mxCellRenderer.registerShape("or",C);mxUtils.extend(P,mxActor);P.prototype.redrawPath=function(d,p,A,t,z){d.moveTo(0,0);d.quadTo(t,0,t,z/2);d.quadTo(t,z,0,z);d.quadTo(t/2,z/2,0,0);d.close();d.end()};mxCellRenderer.registerShape("xor",P);mxUtils.extend(R,mxActor);R.prototype.size=20;R.prototype.isRoundable=function(){return!0};R.prototype.redrawPath=function(d,
p,A,t,z){p=Math.min(t/2,Math.min(z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(p,0),new mxPoint(t-p,0),new mxPoint(t,.8*p),new mxPoint(t,z),new mxPoint(0,z),new mxPoint(0,.8*p)],this.isRounded,A,!0);d.end()};mxCellRenderer.registerShape("loopLimit",R);mxUtils.extend(W,mxActor);W.prototype.size=.375;W.prototype.isRoundable=function(){return!0};W.prototype.redrawPath=function(d,
p,A,t,z){p=z*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(d,[new mxPoint(0,0),new mxPoint(t,0),new mxPoint(t,z-p),new mxPoint(t/2,z),new mxPoint(0,z-p)],this.isRounded,A,!0);d.end()};mxCellRenderer.registerShape("offPageConnector",W);mxUtils.extend(ia,mxEllipse);ia.prototype.paintVertexShape=function(d,p,A,t,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);
d.begin();d.moveTo(p+t/2,A+z);d.lineTo(p+t,A+z);d.end();d.stroke()};mxCellRenderer.registerShape("tapeData",ia);mxUtils.extend(ka,mxEllipse);ka.prototype.paintVertexShape=function(d,p,A,t,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();d.moveTo(p,A+z/2);d.lineTo(p+t,A+z/2);d.end();d.stroke();d.begin();d.moveTo(p+t/2,A);d.lineTo(p+t/2,A+z);d.end();d.stroke()};mxCellRenderer.registerShape("orEllipse",ka);mxUtils.extend(pa,mxEllipse);pa.prototype.paintVertexShape=
function(d,p,A,t,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();d.moveTo(p+.145*t,A+.145*z);d.lineTo(p+.855*t,A+.855*z);d.end();d.stroke();d.begin();d.moveTo(p+.855*t,A+.145*z);d.lineTo(p+.145*t,A+.855*z);d.end();d.stroke()};mxCellRenderer.registerShape("sumEllipse",pa);mxUtils.extend(xa,mxRhombus);xa.prototype.paintVertexShape=function(d,p,A,t,z){mxRhombus.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();d.moveTo(p,A+z/2);d.lineTo(p+
t,A+z/2);d.end();d.stroke()};mxCellRenderer.registerShape("sortShape",xa);mxUtils.extend(ta,mxEllipse);ta.prototype.paintVertexShape=function(d,p,A,t,z){d.begin();d.moveTo(p,A);d.lineTo(p+t,A);d.lineTo(p+t/2,A+z/2);d.close();d.fillAndStroke();d.begin();d.moveTo(p,A+z);d.lineTo(p+t,A+z);d.lineTo(p+t/2,A+z/2);d.close();d.fillAndStroke()};mxCellRenderer.registerShape("collate",ta);mxUtils.extend(ua,mxEllipse);ua.prototype.paintVertexShape=function(d,p,A,t,z){var D=d.state.strokeWidth/2,G=10+2*D,ea=A+
z-G/2;d.begin();d.moveTo(p,A);d.lineTo(p,A+z);d.moveTo(p+D,ea);d.lineTo(p+D+G,ea-G/2);d.moveTo(p+D,ea);d.lineTo(p+D+G,ea+G/2);d.moveTo(p+D,ea);d.lineTo(p+t-D,ea);d.moveTo(p+t,A);d.lineTo(p+t,A+z);d.moveTo(p+t-D,ea);d.lineTo(p+t-G-D,ea-G/2);d.moveTo(p+t-D,ea);d.lineTo(p+t-G-D,ea+G/2);d.end();d.stroke()};mxCellRenderer.registerShape("dimension",ua);mxUtils.extend(Ia,mxEllipse);Ia.prototype.drawHidden=!0;Ia.prototype.paintVertexShape=function(d,p,A,t,z){this.outline||d.setStrokeColor(null);if(null!=
this.style){var D=d.pointerEvents,G=null!=this.fill&&this.fill!=mxConstants.NONE;"1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")||G||(d.pointerEvents=!1);var ea="1"==mxUtils.getValue(this.style,"top","1"),O="1"==mxUtils.getValue(this.style,"left","1"),sa="1"==mxUtils.getValue(this.style,"right","1"),ma="1"==mxUtils.getValue(this.style,"bottom","1");this.drawHidden||G||this.outline||ea||sa||ma||O?(d.rect(p,A,t,z),d.fill(),d.pointerEvents=D,d.setStrokeColor(this.stroke),d.setLineCap("square"),
d.begin(),d.moveTo(p,A),this.outline||ea?d.lineTo(p+t,A):d.moveTo(p+t,A),this.outline||sa?d.lineTo(p+t,A+z):d.moveTo(p+t,A+z),this.outline||ma?d.lineTo(p,A+z):d.moveTo(p,A+z),(this.outline||O)&&d.lineTo(p,A),d.end(),d.stroke(),d.setLineCap("flat")):d.setStrokeColor(this.stroke)}};mxCellRenderer.registerShape("partialRectangle",Ia);mxUtils.extend(Va,mxEllipse);Va.prototype.paintVertexShape=function(d,p,A,t,z){mxEllipse.prototype.paintVertexShape.apply(this,arguments);d.setShadow(!1);d.begin();"vertical"==
mxUtils.getValue(this.style,"line")?(d.moveTo(p+t/2,A),d.lineTo(p+t/2,A+z)):(d.moveTo(p,A+z/2),d.lineTo(p+t,A+z/2));d.end();d.stroke()};mxCellRenderer.registerShape("lineEllipse",Va);mxUtils.extend(Wa,mxActor);Wa.prototype.redrawPath=function(d,p,A,t,z){p=Math.min(t,z/2);d.moveTo(0,0);d.lineTo(t-p,0);d.quadTo(t,0,t,z/2);d.quadTo(t,z,t-p,z);d.lineTo(0,z);d.close();d.end()};mxCellRenderer.registerShape("delay",Wa);mxUtils.extend(Ta,mxActor);Ta.prototype.size=.2;Ta.prototype.redrawPath=function(d,p,
A,t,z){p=Math.min(z,t);var D=Math.max(0,Math.min(p,p*parseFloat(mxUtils.getValue(this.style,"size",this.size))));p=(z-D)/2;A=p+D;var G=(t-D)/2;D=G+D;d.moveTo(0,p);d.lineTo(G,p);d.lineTo(G,0);d.lineTo(D,0);d.lineTo(D,p);d.lineTo(t,p);d.lineTo(t,A);d.lineTo(D,A);d.lineTo(D,z);d.lineTo(G,z);d.lineTo(G,A);d.lineTo(0,A);d.close();d.end()};mxCellRenderer.registerShape("cross",Ta);mxUtils.extend(ab,mxActor);ab.prototype.size=.25;ab.prototype.redrawPath=function(d,p,A,t,z){p=Math.min(t,z/2);A=Math.min(t-
p,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*t);d.moveTo(0,z/2);d.lineTo(A,0);d.lineTo(t-p,0);d.quadTo(t,0,t,z/2);d.quadTo(t,z,t-p,z);d.lineTo(A,z);d.close();d.end()};mxCellRenderer.registerShape("display",ab);mxUtils.extend(Pa,mxActor);Pa.prototype.cst={RECT2:"mxgraph.basic.rect"};Pa.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"}]}];Pa.prototype.paintVertexShape=function(d,p,A,t,z){d.translate(p,A);this.strictDrawShape(d,0,0,t,z)};Pa.prototype.strictDrawShape=function(d,p,A,t,z,D){var G=D&&D.rectStyle?D.rectStyle:mxUtils.getValue(this.style,"rectStyle",this.rectStyle),ea=D&&D.absoluteCornerSize?D.absoluteCornerSize:mxUtils.getValue(this.style,"absoluteCornerSize",
this.absoluteCornerSize),O=D&&D.size?D.size:Math.max(0,Math.min(t,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),sa=D&&D.rectOutline?D.rectOutline:mxUtils.getValue(this.style,"rectOutline",this.rectOutline),ma=D&&D.indent?D.indent:Math.max(0,Math.min(t,parseFloat(mxUtils.getValue(this.style,"indent",this.indent)))),$a=D&&D.dashed?D.dashed:mxUtils.getValue(this.style,"dashed",!1),jb=D&&D.dashPattern?D.dashPattern:mxUtils.getValue(this.style,"dashPattern",null),db=D&&D.relIndent?D.relIndent:
Math.max(0,Math.min(50,ma)),Fa=D&&D.top?D.top:mxUtils.getValue(this.style,"top",!0),La=D&&D.right?D.right:mxUtils.getValue(this.style,"right",!0),Ka=D&&D.bottom?D.bottom:mxUtils.getValue(this.style,"bottom",!0),Ha=D&&D.left?D.left:mxUtils.getValue(this.style,"left",!0),Ua=D&&D.topLeftStyle?D.topLeftStyle:mxUtils.getValue(this.style,"topLeftStyle","default"),Xa=D&&D.topRightStyle?D.topRightStyle:mxUtils.getValue(this.style,"topRightStyle","default"),Ya=D&&D.bottomRightStyle?D.bottomRightStyle:mxUtils.getValue(this.style,
"bottomRightStyle","default"),Za=D&&D.bottomLeftStyle?D.bottomLeftStyle:mxUtils.getValue(this.style,"bottomLeftStyle","default"),Hb=D&&D.fillColor?D.fillColor:mxUtils.getValue(this.style,"fillColor","#ffffff");D&&D.strokeColor||mxUtils.getValue(this.style,"strokeColor","#000000");var Ib=D&&D.strokeWidth?D.strokeWidth:mxUtils.getValue(this.style,"strokeWidth","1"),Eb=D&&D.fillColor2?D.fillColor2:mxUtils.getValue(this.style,"fillColor2","none"),Gb=D&&D.gradientColor2?D.gradientColor2:mxUtils.getValue(this.style,
"gradientColor2","none"),Jb=D&&D.gradientDirection2?D.gradientDirection2:mxUtils.getValue(this.style,"gradientDirection2","south"),Kb=D&&D.opacity?D.opacity:mxUtils.getValue(this.style,"opacity","100"),Lb=Math.max(0,Math.min(50,O));D=Pa.prototype;d.setDashed($a);jb&&""!=jb&&d.setDashPattern(jb);d.setStrokeWidth(Ib);O=Math.min(.5*z,.5*t,O);ea||(O=Lb*Math.min(t,z)/100);O=Math.min(O,.5*Math.min(t,z));ea||(ma=Math.min(db*Math.min(t,z)/100));ma=Math.min(ma,.5*Math.min(t,z)-O);(Fa||La||Ka||Ha)&&"frame"!=
sa&&(d.begin(),Fa?D.moveNW(d,p,A,t,z,G,Ua,O,Ha):d.moveTo(0,0),Fa&&D.paintNW(d,p,A,t,z,G,Ua,O,Ha),D.paintTop(d,p,A,t,z,G,Xa,O,La),La&&D.paintNE(d,p,A,t,z,G,Xa,O,Fa),D.paintRight(d,p,A,t,z,G,Ya,O,Ka),Ka&&D.paintSE(d,p,A,t,z,G,Ya,O,La),D.paintBottom(d,p,A,t,z,G,Za,O,Ha),Ha&&D.paintSW(d,p,A,t,z,G,Za,O,Ka),D.paintLeft(d,p,A,t,z,G,Ua,O,Fa),d.close(),d.fill(),d.setShadow(!1),d.setFillColor(Eb),$a=ea=Kb,"none"==Eb&&(ea=0),"none"==Gb&&($a=0),d.setGradient(Eb,Gb,0,0,t,z,Jb,ea,$a),d.begin(),Fa?D.moveNWInner(d,
p,A,t,z,G,Ua,O,ma,Fa,Ha):d.moveTo(ma,0),D.paintLeftInner(d,p,A,t,z,G,Za,O,ma,Ka,Ha),Ha&&Ka&&D.paintSWInner(d,p,A,t,z,G,Za,O,ma,Ka),D.paintBottomInner(d,p,A,t,z,G,Ya,O,ma,La,Ka),Ka&&La&&D.paintSEInner(d,p,A,t,z,G,Ya,O,ma),D.paintRightInner(d,p,A,t,z,G,Xa,O,ma,Fa,La),La&&Fa&&D.paintNEInner(d,p,A,t,z,G,Xa,O,ma),D.paintTopInner(d,p,A,t,z,G,Ua,O,ma,Ha,Fa),Fa&&Ha&&D.paintNWInner(d,p,A,t,z,G,Ua,O,ma),d.fill(),"none"==Hb&&(d.begin(),D.paintFolds(d,p,A,t,z,G,Ua,Xa,Ya,Za,O,Fa,La,Ka,Ha),d.stroke()));Fa||La||
Ka||!Ha?Fa||La||!Ka||Ha?!Fa&&!La&&Ka&&Ha?"frame"!=sa?(d.begin(),D.moveSE(d,p,A,t,z,G,Ya,O,La),D.paintBottom(d,p,A,t,z,G,Za,O,Ha),D.paintSW(d,p,A,t,z,G,Za,O,Ka),D.paintLeft(d,p,A,t,z,G,Ua,O,Fa),"double"==sa&&(D.moveNWInner(d,p,A,t,z,G,Ua,O,ma,Fa,Ha),D.paintLeftInner(d,p,A,t,z,G,Za,O,ma,Ka,Ha),D.paintSWInner(d,p,A,t,z,G,Za,O,ma,Ka),D.paintBottomInner(d,p,A,t,z,G,Ya,O,ma,La,Ka)),d.stroke()):(d.begin(),D.moveSE(d,p,A,t,z,G,Ya,O,La),D.paintBottom(d,p,A,t,z,G,Za,O,Ha),D.paintSW(d,p,A,t,z,G,Za,O,Ka),D.paintLeft(d,
p,A,t,z,G,Ua,O,Fa),D.lineNWInner(d,p,A,t,z,G,Ua,O,ma,Fa,Ha),D.paintLeftInner(d,p,A,t,z,G,Za,O,ma,Ka,Ha),D.paintSWInner(d,p,A,t,z,G,Za,O,ma,Ka),D.paintBottomInner(d,p,A,t,z,G,Ya,O,ma,La,Ka),d.close(),d.fillAndStroke()):Fa||!La||Ka||Ha?!Fa&&La&&!Ka&&Ha?"frame"!=sa?(d.begin(),D.moveSW(d,p,A,t,z,G,Ua,O,Ka),D.paintLeft(d,p,A,t,z,G,Ua,O,Fa),"double"==sa&&(D.moveNWInner(d,p,A,t,z,G,Ua,O,ma,Fa,Ha),D.paintLeftInner(d,p,A,t,z,G,Za,O,ma,Ka,Ha)),d.stroke(),d.begin(),D.moveNE(d,p,A,t,z,G,Xa,O,Fa),D.paintRight(d,
p,A,t,z,G,Ya,O,Ka),"double"==sa&&(D.moveSEInner(d,p,A,t,z,G,Ya,O,ma,Ka),D.paintRightInner(d,p,A,t,z,G,Xa,O,ma,Fa,La)),d.stroke()):(d.begin(),D.moveSW(d,p,A,t,z,G,Ua,O,Ka),D.paintLeft(d,p,A,t,z,G,Ua,O,Fa),D.lineNWInner(d,p,A,t,z,G,Ua,O,ma,Fa,Ha),D.paintLeftInner(d,p,A,t,z,G,Za,O,ma,Ka,Ha),d.close(),d.fillAndStroke(),d.begin(),D.moveNE(d,p,A,t,z,G,Xa,O,Fa),D.paintRight(d,p,A,t,z,G,Ya,O,Ka),D.lineSEInner(d,p,A,t,z,G,Ya,O,ma,Ka),D.paintRightInner(d,p,A,t,z,G,Xa,O,ma,Fa,La),d.close(),d.fillAndStroke()):
!Fa&&La&&Ka&&!Ha?"frame"!=sa?(d.begin(),D.moveNE(d,p,A,t,z,G,Xa,O,Fa),D.paintRight(d,p,A,t,z,G,Ya,O,Ka),D.paintSE(d,p,A,t,z,G,Ya,O,La),D.paintBottom(d,p,A,t,z,G,Za,O,Ha),"double"==sa&&(D.moveSWInner(d,p,A,t,z,G,Za,O,ma,Ha),D.paintBottomInner(d,p,A,t,z,G,Ya,O,ma,La,Ka),D.paintSEInner(d,p,A,t,z,G,Ya,O,ma),D.paintRightInner(d,p,A,t,z,G,Xa,O,ma,Fa,La)),d.stroke()):(d.begin(),D.moveNE(d,p,A,t,z,G,Xa,O,Fa),D.paintRight(d,p,A,t,z,G,Ya,O,Ka),D.paintSE(d,p,A,t,z,G,Ya,O,La),D.paintBottom(d,p,A,t,z,G,Za,O,Ha),
D.lineSWInner(d,p,A,t,z,G,Za,O,ma,Ha),D.paintBottomInner(d,p,A,t,z,G,Ya,O,ma,La,Ka),D.paintSEInner(d,p,A,t,z,G,Ya,O,ma),D.paintRightInner(d,p,A,t,z,G,Xa,O,ma,Fa,La),d.close(),d.fillAndStroke()):!Fa&&La&&Ka&&Ha?"frame"!=sa?(d.begin(),D.moveNE(d,p,A,t,z,G,Xa,O,Fa),D.paintRight(d,p,A,t,z,G,Ya,O,Ka),D.paintSE(d,p,A,t,z,G,Ya,O,La),D.paintBottom(d,p,A,t,z,G,Za,O,Ha),D.paintSW(d,p,A,t,z,G,Za,O,Ka),D.paintLeft(d,p,A,t,z,G,Ua,O,Fa),"double"==sa&&(D.moveNWInner(d,p,A,t,z,G,Ua,O,ma,Fa,Ha),D.paintLeftInner(d,
p,A,t,z,G,Za,O,ma,Ka,Ha),D.paintSWInner(d,p,A,t,z,G,Za,O,ma,Ka),D.paintBottomInner(d,p,A,t,z,G,Ya,O,ma,La,Ka),D.paintSEInner(d,p,A,t,z,G,Ya,O,ma),D.paintRightInner(d,p,A,t,z,G,Xa,O,ma,Fa,La)),d.stroke()):(d.begin(),D.moveNE(d,p,A,t,z,G,Xa,O,Fa),D.paintRight(d,p,A,t,z,G,Ya,O,Ka),D.paintSE(d,p,A,t,z,G,Ya,O,La),D.paintBottom(d,p,A,t,z,G,Za,O,Ha),D.paintSW(d,p,A,t,z,G,Za,O,Ka),D.paintLeft(d,p,A,t,z,G,Ua,O,Fa),D.lineNWInner(d,p,A,t,z,G,Ua,O,ma,Fa,Ha),D.paintLeftInner(d,p,A,t,z,G,Za,O,ma,Ka,Ha),D.paintSWInner(d,
p,A,t,z,G,Za,O,ma,Ka),D.paintBottomInner(d,p,A,t,z,G,Ya,O,ma,La,Ka),D.paintSEInner(d,p,A,t,z,G,Ya,O,ma),D.paintRightInner(d,p,A,t,z,G,Xa,O,ma,Fa,La),d.close(),d.fillAndStroke()):!Fa||La||Ka||Ha?Fa&&!La&&!Ka&&Ha?"frame"!=sa?(d.begin(),D.moveSW(d,p,A,t,z,G,Za,O,Ka),D.paintLeft(d,p,A,t,z,G,Ua,O,Fa),D.paintNW(d,p,A,t,z,G,Ua,O,Ha),D.paintTop(d,p,A,t,z,G,Xa,O,La),"double"==sa&&(D.moveNEInner(d,p,A,t,z,G,Xa,O,ma,La),D.paintTopInner(d,p,A,t,z,G,Ua,O,ma,Ha,Fa),D.paintNWInner(d,p,A,t,z,G,Ua,O,ma),D.paintLeftInner(d,
p,A,t,z,G,Za,O,ma,Ka,Ha)),d.stroke()):(d.begin(),D.moveSW(d,p,A,t,z,G,Za,O,Ka),D.paintLeft(d,p,A,t,z,G,Ua,O,Fa),D.paintNW(d,p,A,t,z,G,Ua,O,Ha),D.paintTop(d,p,A,t,z,G,Xa,O,La),D.lineNEInner(d,p,A,t,z,G,Xa,O,ma,La),D.paintTopInner(d,p,A,t,z,G,Ua,O,ma,Ha,Fa),D.paintNWInner(d,p,A,t,z,G,Ua,O,ma),D.paintLeftInner(d,p,A,t,z,G,Za,O,ma,Ka,Ha),d.close(),d.fillAndStroke()):Fa&&!La&&Ka&&!Ha?"frame"!=sa?(d.begin(),D.moveNW(d,p,A,t,z,G,Ua,O,Ha),D.paintTop(d,p,A,t,z,G,Xa,O,La),"double"==sa&&(D.moveNEInner(d,p,A,
t,z,G,Xa,O,ma,La),D.paintTopInner(d,p,A,t,z,G,Ua,O,ma,Ha,Fa)),d.stroke(),d.begin(),D.moveSE(d,p,A,t,z,G,Ya,O,La),D.paintBottom(d,p,A,t,z,G,Za,O,Ha),"double"==sa&&(D.moveSWInner(d,p,A,t,z,G,Za,O,ma,Ha),D.paintBottomInner(d,p,A,t,z,G,Ya,O,ma,La,Ka)),d.stroke()):(d.begin(),D.moveNW(d,p,A,t,z,G,Ua,O,Ha),D.paintTop(d,p,A,t,z,G,Xa,O,La),D.lineNEInner(d,p,A,t,z,G,Xa,O,ma,La),D.paintTopInner(d,p,A,t,z,G,Ua,O,ma,Ha,Fa),d.close(),d.fillAndStroke(),d.begin(),D.moveSE(d,p,A,t,z,G,Ya,O,La),D.paintBottom(d,p,A,
t,z,G,Za,O,Ha),D.lineSWInner(d,p,A,t,z,G,Za,O,ma,Ha),D.paintBottomInner(d,p,A,t,z,G,Ya,O,ma,La,Ka),d.close(),d.fillAndStroke()):Fa&&!La&&Ka&&Ha?"frame"!=sa?(d.begin(),D.moveSE(d,p,A,t,z,G,Ya,O,La),D.paintBottom(d,p,A,t,z,G,Za,O,Ha),D.paintSW(d,p,A,t,z,G,Za,O,Ka),D.paintLeft(d,p,A,t,z,G,Ua,O,Fa),D.paintNW(d,p,A,t,z,G,Ua,O,Ha),D.paintTop(d,p,A,t,z,G,Xa,O,La),"double"==sa&&(D.moveNEInner(d,p,A,t,z,G,Xa,O,ma,La),D.paintTopInner(d,p,A,t,z,G,Ua,O,ma,Ha,Fa),D.paintNWInner(d,p,A,t,z,G,Ua,O,ma),D.paintLeftInner(d,
p,A,t,z,G,Za,O,ma,Ka,Ha),D.paintSWInner(d,p,A,t,z,G,Za,O,ma,Ka),D.paintBottomInner(d,p,A,t,z,G,Ya,O,ma,La,Ka)),d.stroke()):(d.begin(),D.moveSE(d,p,A,t,z,G,Ya,O,La),D.paintBottom(d,p,A,t,z,G,Za,O,Ha),D.paintSW(d,p,A,t,z,G,Za,O,Ka),D.paintLeft(d,p,A,t,z,G,Ua,O,Fa),D.paintNW(d,p,A,t,z,G,Ua,O,Ha),D.paintTop(d,p,A,t,z,G,Xa,O,La),D.lineNEInner(d,p,A,t,z,G,Xa,O,ma,La),D.paintTopInner(d,p,A,t,z,G,Ua,O,ma,Ha,Fa),D.paintNWInner(d,p,A,t,z,G,Ua,O,ma),D.paintLeftInner(d,p,A,t,z,G,Za,O,ma,Ka,Ha),D.paintSWInner(d,
p,A,t,z,G,Za,O,ma,Ka),D.paintBottomInner(d,p,A,t,z,G,Ya,O,ma,La,Ka),d.close(),d.fillAndStroke()):Fa&&La&&!Ka&&!Ha?"frame"!=sa?(d.begin(),D.moveNW(d,p,A,t,z,G,Ua,O,Ha),D.paintTop(d,p,A,t,z,G,Xa,O,La),D.paintNE(d,p,A,t,z,G,Xa,O,Fa),D.paintRight(d,p,A,t,z,G,Ya,O,Ka),"double"==sa&&(D.moveSEInner(d,p,A,t,z,G,Ya,O,ma,Ka),D.paintRightInner(d,p,A,t,z,G,Xa,O,ma,Fa,La),D.paintNEInner(d,p,A,t,z,G,Xa,O,ma),D.paintTopInner(d,p,A,t,z,G,Ua,O,ma,Ha,Fa)),d.stroke()):(d.begin(),D.moveNW(d,p,A,t,z,G,Ua,O,Ha),D.paintTop(d,
p,A,t,z,G,Xa,O,La),D.paintNE(d,p,A,t,z,G,Xa,O,Fa),D.paintRight(d,p,A,t,z,G,Ya,O,Ka),D.lineSEInner(d,p,A,t,z,G,Ya,O,ma,Ka),D.paintRightInner(d,p,A,t,z,G,Xa,O,ma,Fa,La),D.paintNEInner(d,p,A,t,z,G,Xa,O,ma),D.paintTopInner(d,p,A,t,z,G,Ua,O,ma,Ha,Fa),d.close(),d.fillAndStroke()):Fa&&La&&!Ka&&Ha?"frame"!=sa?(d.begin(),D.moveSW(d,p,A,t,z,G,Za,O,Ka),D.paintLeft(d,p,A,t,z,G,Ua,O,Fa),D.paintNW(d,p,A,t,z,G,Ua,O,Ha),D.paintTop(d,p,A,t,z,G,Xa,O,La),D.paintNE(d,p,A,t,z,G,Xa,O,Fa),D.paintRight(d,p,A,t,z,G,Ya,O,
Ka),"double"==sa&&(D.moveSEInner(d,p,A,t,z,G,Ya,O,ma,Ka),D.paintRightInner(d,p,A,t,z,G,Xa,O,ma,Fa,La),D.paintNEInner(d,p,A,t,z,G,Xa,O,ma),D.paintTopInner(d,p,A,t,z,G,Ua,O,ma,Ha,Fa),D.paintNWInner(d,p,A,t,z,G,Ua,O,ma),D.paintLeftInner(d,p,A,t,z,G,Za,O,ma,Ka,Ha)),d.stroke()):(d.begin(),D.moveSW(d,p,A,t,z,G,Za,O,Ka),D.paintLeft(d,p,A,t,z,G,Ua,O,Fa),D.paintNW(d,p,A,t,z,G,Ua,O,Ha),D.paintTop(d,p,A,t,z,G,Xa,O,La),D.paintNE(d,p,A,t,z,G,Xa,O,Fa),D.paintRight(d,p,A,t,z,G,Ya,O,Ka),D.lineSEInner(d,p,A,t,z,G,
Ya,O,ma,Ka),D.paintRightInner(d,p,A,t,z,G,Xa,O,ma,Fa,La),D.paintNEInner(d,p,A,t,z,G,Xa,O,ma),D.paintTopInner(d,p,A,t,z,G,Ua,O,ma,Ha,Fa),D.paintNWInner(d,p,A,t,z,G,Ua,O,ma),D.paintLeftInner(d,p,A,t,z,G,Za,O,ma,Ka,Ha),d.close(),d.fillAndStroke()):Fa&&La&&Ka&&!Ha?"frame"!=sa?(d.begin(),D.moveNW(d,p,A,t,z,G,Ua,O,Ha),D.paintTop(d,p,A,t,z,G,Xa,O,La),D.paintNE(d,p,A,t,z,G,Xa,O,Fa),D.paintRight(d,p,A,t,z,G,Ya,O,Ka),D.paintSE(d,p,A,t,z,G,Ya,O,La),D.paintBottom(d,p,A,t,z,G,Za,O,Ha),"double"==sa&&(D.moveSWInner(d,
p,A,t,z,G,Za,O,ma,Ha),D.paintBottomInner(d,p,A,t,z,G,Ya,O,ma,La,Ka),D.paintSEInner(d,p,A,t,z,G,Ya,O,ma),D.paintRightInner(d,p,A,t,z,G,Xa,O,ma,Fa,La),D.paintNEInner(d,p,A,t,z,G,Xa,O,ma),D.paintTopInner(d,p,A,t,z,G,Ua,O,ma,Ha,Fa)),d.stroke()):(d.begin(),D.moveNW(d,p,A,t,z,G,Ua,O,Ha),D.paintTop(d,p,A,t,z,G,Xa,O,La),D.paintNE(d,p,A,t,z,G,Xa,O,Fa),D.paintRight(d,p,A,t,z,G,Ya,O,Ka),D.paintSE(d,p,A,t,z,G,Ya,O,La),D.paintBottom(d,p,A,t,z,G,Za,O,Ha),D.lineSWInner(d,p,A,t,z,G,Za,O,ma,Ha),D.paintBottomInner(d,
p,A,t,z,G,Ya,O,ma,La,Ka),D.paintSEInner(d,p,A,t,z,G,Ya,O,ma),D.paintRightInner(d,p,A,t,z,G,Xa,O,ma,Fa,La),D.paintNEInner(d,p,A,t,z,G,Xa,O,ma),D.paintTopInner(d,p,A,t,z,G,Ua,O,ma,Ha,Fa),d.close(),d.fillAndStroke()):Fa&&La&&Ka&&Ha&&("frame"!=sa?(d.begin(),D.moveNW(d,p,A,t,z,G,Ua,O,Ha),D.paintNW(d,p,A,t,z,G,Ua,O,Ha),D.paintTop(d,p,A,t,z,G,Xa,O,La),D.paintNE(d,p,A,t,z,G,Xa,O,Fa),D.paintRight(d,p,A,t,z,G,Ya,O,Ka),D.paintSE(d,p,A,t,z,G,Ya,O,La),D.paintBottom(d,p,A,t,z,G,Za,O,Ha),D.paintSW(d,p,A,t,z,G,Za,
O,Ka),D.paintLeft(d,p,A,t,z,G,Ua,O,Fa),d.close(),"double"==sa&&(D.moveSWInner(d,p,A,t,z,G,Za,O,ma,Ha),D.paintSWInner(d,p,A,t,z,G,Za,O,ma,Ka),D.paintBottomInner(d,p,A,t,z,G,Ya,O,ma,La,Ka),D.paintSEInner(d,p,A,t,z,G,Ya,O,ma),D.paintRightInner(d,p,A,t,z,G,Xa,O,ma,Fa,La),D.paintNEInner(d,p,A,t,z,G,Xa,O,ma),D.paintTopInner(d,p,A,t,z,G,Ua,O,ma,Ha,Fa),D.paintNWInner(d,p,A,t,z,G,Ua,O,ma),D.paintLeftInner(d,p,A,t,z,G,Za,O,ma,Ka,Ha),d.close()),d.stroke()):(d.begin(),D.moveNW(d,p,A,t,z,G,Ua,O,Ha),D.paintNW(d,
p,A,t,z,G,Ua,O,Ha),D.paintTop(d,p,A,t,z,G,Xa,O,La),D.paintNE(d,p,A,t,z,G,Xa,O,Fa),D.paintRight(d,p,A,t,z,G,Ya,O,Ka),D.paintSE(d,p,A,t,z,G,Ya,O,La),D.paintBottom(d,p,A,t,z,G,Za,O,Ha),D.paintSW(d,p,A,t,z,G,Za,O,Ka),D.paintLeft(d,p,A,t,z,G,Ua,O,Fa),d.close(),D.moveSWInner(d,p,A,t,z,G,Za,O,ma,Ha),D.paintSWInner(d,p,A,t,z,G,Za,O,ma,Ka),D.paintBottomInner(d,p,A,t,z,G,Ya,O,ma,La,Ka),D.paintSEInner(d,p,A,t,z,G,Ya,O,ma),D.paintRightInner(d,p,A,t,z,G,Xa,O,ma,Fa,La),D.paintNEInner(d,p,A,t,z,G,Xa,O,ma),D.paintTopInner(d,
p,A,t,z,G,Ua,O,ma,Ha,Fa),D.paintNWInner(d,p,A,t,z,G,Ua,O,ma),D.paintLeftInner(d,p,A,t,z,G,Za,O,ma,Ka,Ha),d.close(),d.fillAndStroke())):"frame"!=sa?(d.begin(),D.moveNW(d,p,A,t,z,G,Ua,O,Ha),D.paintTop(d,p,A,t,z,G,Xa,O,La),"double"==sa&&(D.moveNEInner(d,p,A,t,z,G,Xa,O,ma,La),D.paintTopInner(d,p,A,t,z,G,Ua,O,ma,Ha,Fa)),d.stroke()):(d.begin(),D.moveNW(d,p,A,t,z,G,Ua,O,Ha),D.paintTop(d,p,A,t,z,G,Xa,O,La),D.lineNEInner(d,p,A,t,z,G,Xa,O,ma,La),D.paintTopInner(d,p,A,t,z,G,Ua,O,ma,Ha,Fa),d.close(),d.fillAndStroke()):
"frame"!=sa?(d.begin(),D.moveNE(d,p,A,t,z,G,Xa,O,Fa),D.paintRight(d,p,A,t,z,G,Ya,O,Ka),"double"==sa&&(D.moveSEInner(d,p,A,t,z,G,Ya,O,ma,Ka),D.paintRightInner(d,p,A,t,z,G,Xa,O,ma,Fa,La)),d.stroke()):(d.begin(),D.moveNE(d,p,A,t,z,G,Xa,O,Fa),D.paintRight(d,p,A,t,z,G,Ya,O,Ka),D.lineSEInner(d,p,A,t,z,G,Ya,O,ma,Ka),D.paintRightInner(d,p,A,t,z,G,Xa,O,ma,Fa,La),d.close(),d.fillAndStroke()):"frame"!=sa?(d.begin(),D.moveSE(d,p,A,t,z,G,Ya,O,La),D.paintBottom(d,p,A,t,z,G,Za,O,Ha),"double"==sa&&(D.moveSWInner(d,
p,A,t,z,G,Za,O,ma,Ha),D.paintBottomInner(d,p,A,t,z,G,Ya,O,ma,La,Ka)),d.stroke()):(d.begin(),D.moveSE(d,p,A,t,z,G,Ya,O,La),D.paintBottom(d,p,A,t,z,G,Za,O,Ha),D.lineSWInner(d,p,A,t,z,G,Za,O,ma,Ha),D.paintBottomInner(d,p,A,t,z,G,Ya,O,ma,La,Ka),d.close(),d.fillAndStroke()):"frame"!=sa?(d.begin(),D.moveSW(d,p,A,t,z,G,Ua,O,Ka),D.paintLeft(d,p,A,t,z,G,Ua,O,Fa),"double"==sa&&(D.moveNWInner(d,p,A,t,z,G,Ua,O,ma,Fa,Ha),D.paintLeftInner(d,p,A,t,z,G,Za,O,ma,Ka,Ha)),d.stroke()):(d.begin(),D.moveSW(d,p,A,t,z,G,
Ua,O,Ka),D.paintLeft(d,p,A,t,z,G,Ua,O,Fa),D.lineNWInner(d,p,A,t,z,G,Ua,O,ma,Fa,Ha),D.paintLeftInner(d,p,A,t,z,G,Za,O,ma,Ka,Ha),d.close(),d.fillAndStroke());d.begin();D.paintFolds(d,p,A,t,z,G,Ua,Xa,Ya,Za,O,Fa,La,Ka,Ha);d.stroke()};Pa.prototype.moveNW=function(d,p,A,t,z,D,G,ea,O){"square"==G||"default"==G&&"square"==D||!O?d.moveTo(0,0):d.moveTo(0,ea)};Pa.prototype.moveNE=function(d,p,A,t,z,D,G,ea,O){"square"==G||"default"==G&&"square"==D||!O?d.moveTo(t,0):d.moveTo(t-ea,0)};Pa.prototype.moveSE=function(d,
p,A,t,z,D,G,ea,O){"square"==G||"default"==G&&"square"==D||!O?d.moveTo(t,z):d.moveTo(t,z-ea)};Pa.prototype.moveSW=function(d,p,A,t,z,D,G,ea,O){"square"==G||"default"==G&&"square"==D||!O?d.moveTo(0,z):d.moveTo(ea,z)};Pa.prototype.paintNW=function(d,p,A,t,z,D,G,ea,O){if(O)if("rounded"==G||"default"==G&&"rounded"==D||"invRound"==G||"default"==G&&"invRound"==D){p=0;if("rounded"==G||"default"==G&&"rounded"==D)p=1;d.arcTo(ea,ea,0,0,p,ea,0)}else("snip"==G||"default"==G&&"snip"==D||"fold"==G||"default"==G&&
"fold"==D)&&d.lineTo(ea,0);else d.lineTo(0,0)};Pa.prototype.paintTop=function(d,p,A,t,z,D,G,ea,O){"square"==G||"default"==G&&"square"==D||!O?d.lineTo(t,0):d.lineTo(t-ea,0)};Pa.prototype.paintNE=function(d,p,A,t,z,D,G,ea,O){if(O)if("rounded"==G||"default"==G&&"rounded"==D||"invRound"==G||"default"==G&&"invRound"==D){p=0;if("rounded"==G||"default"==G&&"rounded"==D)p=1;d.arcTo(ea,ea,0,0,p,t,ea)}else("snip"==G||"default"==G&&"snip"==D||"fold"==G||"default"==G&&"fold"==D)&&d.lineTo(t,ea);else d.lineTo(t,
0)};Pa.prototype.paintRight=function(d,p,A,t,z,D,G,ea,O){"square"==G||"default"==G&&"square"==D||!O?d.lineTo(t,z):d.lineTo(t,z-ea)};Pa.prototype.paintLeft=function(d,p,A,t,z,D,G,ea,O){"square"==G||"default"==G&&"square"==D||!O?d.lineTo(0,0):d.lineTo(0,ea)};Pa.prototype.paintSE=function(d,p,A,t,z,D,G,ea,O){if(O)if("rounded"==G||"default"==G&&"rounded"==D||"invRound"==G||"default"==G&&"invRound"==D){p=0;if("rounded"==G||"default"==G&&"rounded"==D)p=1;d.arcTo(ea,ea,0,0,p,t-ea,z)}else("snip"==G||"default"==
G&&"snip"==D||"fold"==G||"default"==G&&"fold"==D)&&d.lineTo(t-ea,z);else d.lineTo(t,z)};Pa.prototype.paintBottom=function(d,p,A,t,z,D,G,ea,O){"square"==G||"default"==G&&"square"==D||!O?d.lineTo(0,z):d.lineTo(ea,z)};Pa.prototype.paintSW=function(d,p,A,t,z,D,G,ea,O){if(O)if("rounded"==G||"default"==G&&"rounded"==D||"invRound"==G||"default"==G&&"invRound"==D){p=0;if("rounded"==G||"default"==G&&"rounded"==D)p=1;d.arcTo(ea,ea,0,0,p,0,z-ea)}else("snip"==G||"default"==G&&"snip"==D||"fold"==G||"default"==
G&&"fold"==D)&&d.lineTo(0,z-ea);else d.lineTo(0,z)};Pa.prototype.paintNWInner=function(d,p,A,t,z,D,G,ea,O){if("rounded"==G||"default"==G&&"rounded"==D)d.arcTo(ea-.5*O,ea-.5*O,0,0,0,O,.5*O+ea);else if("invRound"==G||"default"==G&&"invRound"==D)d.arcTo(ea+O,ea+O,0,0,1,O,O+ea);else if("snip"==G||"default"==G&&"snip"==D)d.lineTo(O,.5*O+ea);else if("fold"==G||"default"==G&&"fold"==D)d.lineTo(O+ea,O+ea),d.lineTo(O,O+ea)};Pa.prototype.paintTopInner=function(d,p,A,t,z,D,G,ea,O,sa,ma){sa||ma?!sa&&ma?d.lineTo(0,
O):sa&&!ma?d.lineTo(O,0):sa?"square"==G||"default"==G&&"square"==D?d.lineTo(O,O):"rounded"==G||"default"==G&&"rounded"==D||"snip"==G||"default"==G&&"snip"==D?d.lineTo(ea+.5*O,O):d.lineTo(ea+O,O):d.lineTo(0,O):d.lineTo(0,0)};Pa.prototype.paintNEInner=function(d,p,A,t,z,D,G,ea,O){if("rounded"==G||"default"==G&&"rounded"==D)d.arcTo(ea-.5*O,ea-.5*O,0,0,0,t-ea-.5*O,O);else if("invRound"==G||"default"==G&&"invRound"==D)d.arcTo(ea+O,ea+O,0,0,1,t-ea-O,O);else if("snip"==G||"default"==G&&"snip"==D)d.lineTo(t-
ea-.5*O,O);else if("fold"==G||"default"==G&&"fold"==D)d.lineTo(t-ea-O,ea+O),d.lineTo(t-ea-O,O)};Pa.prototype.paintRightInner=function(d,p,A,t,z,D,G,ea,O,sa,ma){sa||ma?!sa&&ma?d.lineTo(t-O,0):sa&&!ma?d.lineTo(t,O):sa?"square"==G||"default"==G&&"square"==D?d.lineTo(t-O,O):"rounded"==G||"default"==G&&"rounded"==D||"snip"==G||"default"==G&&"snip"==D?d.lineTo(t-O,ea+.5*O):d.lineTo(t-O,ea+O):d.lineTo(t-O,0):d.lineTo(t,0)};Pa.prototype.paintLeftInner=function(d,p,A,t,z,D,G,ea,O,sa,ma){sa||ma?!sa&&ma?d.lineTo(O,
z):sa&&!ma?d.lineTo(0,z-O):sa?"square"==G||"default"==G&&"square"==D?d.lineTo(O,z-O):"rounded"==G||"default"==G&&"rounded"==D||"snip"==G||"default"==G&&"snip"==D?d.lineTo(O,z-ea-.5*O):d.lineTo(O,z-ea-O):d.lineTo(O,z):d.lineTo(0,z)};Pa.prototype.paintSEInner=function(d,p,A,t,z,D,G,ea,O){if("rounded"==G||"default"==G&&"rounded"==D)d.arcTo(ea-.5*O,ea-.5*O,0,0,0,t-O,z-ea-.5*O);else if("invRound"==G||"default"==G&&"invRound"==D)d.arcTo(ea+O,ea+O,0,0,1,t-O,z-ea-O);else if("snip"==G||"default"==G&&"snip"==
D)d.lineTo(t-O,z-ea-.5*O);else if("fold"==G||"default"==G&&"fold"==D)d.lineTo(t-ea-O,z-ea-O),d.lineTo(t-O,z-ea-O)};Pa.prototype.paintBottomInner=function(d,p,A,t,z,D,G,ea,O,sa,ma){sa||ma?!sa&&ma?d.lineTo(t,z-O):sa&&!ma?d.lineTo(t-O,z):"square"==G||"default"==G&&"square"==D||!sa?d.lineTo(t-O,z-O):"rounded"==G||"default"==G&&"rounded"==D||"snip"==G||"default"==G&&"snip"==D?d.lineTo(t-ea-.5*O,z-O):d.lineTo(t-ea-O,z-O):d.lineTo(t,z)};Pa.prototype.paintSWInner=function(d,p,A,t,z,D,G,ea,O,sa){if(!sa)d.lineTo(O,
z);else if("square"==G||"default"==G&&"square"==D)d.lineTo(O,z-O);else if("rounded"==G||"default"==G&&"rounded"==D)d.arcTo(ea-.5*O,ea-.5*O,0,0,0,ea+.5*O,z-O);else if("invRound"==G||"default"==G&&"invRound"==D)d.arcTo(ea+O,ea+O,0,0,1,ea+O,z-O);else if("snip"==G||"default"==G&&"snip"==D)d.lineTo(ea+.5*O,z-O);else if("fold"==G||"default"==G&&"fold"==D)d.lineTo(O+ea,z-ea-O),d.lineTo(O+ea,z-O)};Pa.prototype.moveSWInner=function(d,p,A,t,z,D,G,ea,O,sa){sa?"square"==G||"default"==G&&"square"==D?d.moveTo(O,
z-O):"rounded"==G||"default"==G&&"rounded"==D||"snip"==G||"default"==G&&"snip"==D?d.moveTo(O,z-ea-.5*O):("invRound"==G||"default"==G&&"invRound"==D||"fold"==G||"default"==G&&"fold"==D)&&d.moveTo(O,z-ea-O):d.moveTo(0,z-O)};Pa.prototype.lineSWInner=function(d,p,A,t,z,D,G,ea,O,sa){sa?"square"==G||"default"==G&&"square"==D?d.lineTo(O,z-O):"rounded"==G||"default"==G&&"rounded"==D||"snip"==G||"default"==G&&"snip"==D?d.lineTo(O,z-ea-.5*O):("invRound"==G||"default"==G&&"invRound"==D||"fold"==G||"default"==
G&&"fold"==D)&&d.lineTo(O,z-ea-O):d.lineTo(0,z-O)};Pa.prototype.moveSEInner=function(d,p,A,t,z,D,G,ea,O,sa){sa?"square"==G||"default"==G&&"square"==D?d.moveTo(t-O,z-O):"rounded"==G||"default"==G&&"rounded"==D||"snip"==G||"default"==G&&"snip"==D?d.moveTo(t-O,z-ea-.5*O):("invRound"==G||"default"==G&&"invRound"==D||"fold"==G||"default"==G&&"fold"==D)&&d.moveTo(t-O,z-ea-O):d.moveTo(t-O,z)};Pa.prototype.lineSEInner=function(d,p,A,t,z,D,G,ea,O,sa){sa?"square"==G||"default"==G&&"square"==D?d.lineTo(t-O,
z-O):"rounded"==G||"default"==G&&"rounded"==D||"snip"==G||"default"==G&&"snip"==D?d.lineTo(t-O,z-ea-.5*O):("invRound"==G||"default"==G&&"invRound"==D||"fold"==G||"default"==G&&"fold"==D)&&d.lineTo(t-O,z-ea-O):d.lineTo(t-O,z)};Pa.prototype.moveNEInner=function(d,p,A,t,z,D,G,ea,O,sa){sa?"square"==G||"default"==G&&"square"==D||sa?d.moveTo(t-O,O):"rounded"==G||"default"==G&&"rounded"==D||"snip"==G||"default"==G&&"snip"==D?d.moveTo(t-O,ea+.5*O):("invRound"==G||"default"==G&&"invRound"==D||"fold"==G||"default"==
G&&"fold"==D)&&d.moveTo(t-O,ea+O):d.moveTo(t,O)};Pa.prototype.lineNEInner=function(d,p,A,t,z,D,G,ea,O,sa){sa?"square"==G||"default"==G&&"square"==D||sa?d.lineTo(t-O,O):"rounded"==G||"default"==G&&"rounded"==D||"snip"==G||"default"==G&&"snip"==D?d.lineTo(t-O,ea+.5*O):("invRound"==G||"default"==G&&"invRound"==D||"fold"==G||"default"==G&&"fold"==D)&&d.lineTo(t-O,ea+O):d.lineTo(t,O)};Pa.prototype.moveNWInner=function(d,p,A,t,z,D,G,ea,O,sa,ma){sa||ma?!sa&&ma?d.moveTo(O,0):sa&&!ma?d.moveTo(0,O):"square"==
G||"default"==G&&"square"==D?d.moveTo(O,O):"rounded"==G||"default"==G&&"rounded"==D||"snip"==G||"default"==G&&"snip"==D?d.moveTo(O,ea+.5*O):("invRound"==G||"default"==G&&"invRound"==D||"fold"==G||"default"==G&&"fold"==D)&&d.moveTo(O,ea+O):d.moveTo(0,0)};Pa.prototype.lineNWInner=function(d,p,A,t,z,D,G,ea,O,sa,ma){sa||ma?!sa&&ma?d.lineTo(O,0):sa&&!ma?d.lineTo(0,O):"square"==G||"default"==G&&"square"==D?d.lineTo(O,O):"rounded"==G||"default"==G&&"rounded"==D||"snip"==G||"default"==G&&"snip"==D?d.lineTo(O,
ea+.5*O):("invRound"==G||"default"==G&&"invRound"==D||"fold"==G||"default"==G&&"fold"==D)&&d.lineTo(O,ea+O):d.lineTo(0,0)};Pa.prototype.paintFolds=function(d,p,A,t,z,D,G,ea,O,sa,ma,$a,jb,db,Fa){if("fold"==D||"fold"==G||"fold"==ea||"fold"==O||"fold"==sa)("fold"==G||"default"==G&&"fold"==D)&&$a&&Fa&&(d.moveTo(0,ma),d.lineTo(ma,ma),d.lineTo(ma,0)),("fold"==ea||"default"==ea&&"fold"==D)&&$a&&jb&&(d.moveTo(t-ma,0),d.lineTo(t-ma,ma),d.lineTo(t,ma)),("fold"==O||"default"==O&&"fold"==D)&&db&&jb&&(d.moveTo(t-
ma,z),d.lineTo(t-ma,z-ma),d.lineTo(t,z-ma)),("fold"==sa||"default"==sa&&"fold"==D)&&db&&Fa&&(d.moveTo(0,z-ma),d.lineTo(ma,z-ma),d.lineTo(ma,z))};mxCellRenderer.registerShape(Pa.prototype.cst.RECT2,Pa);Pa.prototype.constraints=null;mxUtils.extend(Sa,mxConnector);Sa.prototype.origPaintEdgeShape=Sa.prototype.paintEdgeShape;Sa.prototype.paintEdgeShape=function(d,p){for(var A=[],t=0;t<p.length;t++)A.push(mxUtils.clone(p[t]));t=d.state.dashed;var z=d.state.fixDash;Sa.prototype.origPaintEdgeShape.apply(this,
[d,A]);3<=d.state.strokeWidth&&(A=mxUtils.getValue(this.style,"fillColor",null),null!=A&&(d.setStrokeColor(A),d.setStrokeWidth(d.state.strokeWidth-2),d.setDashed(t,z),Sa.prototype.origPaintEdgeShape.apply(this,[d,p])))};mxCellRenderer.registerShape("filledEdge",Sa);mxUtils.extend(gb,mxConnector);gb.prototype.defaultWidth=4;gb.prototype.getEdgeWidth=function(){return Math.max(0,mxUtils.getNumber(this.style,"width",this.defaultWidth))};gb.prototype.getFlowAnimationPath=function(){return mxShape.prototype.getFlowAnimationPath.call(this,
2)};gb.prototype.origPaintEdgeShape=gb.prototype.paintEdgeShape;gb.prototype.paintEdgeShape=function(d,p){for(var A=[],t=0;t<p.length;t++)A.push(mxUtils.clone(p[t]));t=d.state.dashed;var z=d.state.fixDash,D=this.getEdgeWidth();d.setStrokeWidth(D+2*this.strokewidth);d.setDashed(!1);gb.prototype.origPaintEdgeShape.apply(this,[d,A]);A=mxUtils.getValue(this.style,"fillColor",null);null!=A&&(d.setStrokeWidth(D),d.setStrokeColor(A),d.setDashed(t,z),gb.prototype.origPaintEdgeShape.apply(this,[d,p]))};mxCellRenderer.registerShape("pipe",
gb);"undefined"!==typeof StyleFormatPanel&&function(){var d=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var p=this.editorUi.getSelectionState(),A=d.apply(this,arguments);"umlFrame"==p.style.shape&&A.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return A}}();mxMarker.addMarker("dash",function(d,p,A,t,z,D,G,ea,O,sa){var ma=z*(G+O+1),$a=D*(G+O+1);return function(){d.begin();d.moveTo(t.x-ma/2-$a/2,t.y-$a/
2+ma/2);d.lineTo(t.x+$a/2-3*ma/2,t.y-3*$a/2-ma/2);d.stroke()}});mxMarker.addMarker("box",function(d,p,A,t,z,D,G,ea,O,sa){var ma=z*(G+O+1),$a=D*(G+O+1),jb=t.x+ma/2,db=t.y+$a/2;t.x-=ma;t.y-=$a;return function(){d.begin();d.moveTo(jb-ma/2-$a/2,db-$a/2+ma/2);d.lineTo(jb-ma/2+$a/2,db-$a/2-ma/2);d.lineTo(jb+$a/2-3*ma/2,db-3*$a/2-ma/2);d.lineTo(jb-$a/2-3*ma/2,db-3*$a/2+ma/2);d.close();sa?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("cross",function(d,p,A,t,z,D,G,ea,O,sa){var ma=z*(G+O+1),$a=D*(G+O+
1);return function(){d.begin();d.moveTo(t.x-ma/2-$a/2,t.y-$a/2+ma/2);d.lineTo(t.x+$a/2-3*ma/2,t.y-3*$a/2-ma/2);d.moveTo(t.x-ma/2+$a/2,t.y-$a/2-ma/2);d.lineTo(t.x-$a/2-3*ma/2,t.y-3*$a/2+ma/2);d.stroke()}});mxMarker.addMarker("circle",fb);mxMarker.addMarker("circlePlus",function(d,p,A,t,z,D,G,ea,O,sa){var ma=t.clone(),$a=fb.apply(this,arguments),jb=z*(G+2*O),db=D*(G+2*O);return function(){$a.apply(this,arguments);d.begin();d.moveTo(ma.x-z*O,ma.y-D*O);d.lineTo(ma.x-2*jb+z*O,ma.y-2*db+D*O);d.moveTo(ma.x-
jb-db+D*O,ma.y-db+jb-z*O);d.lineTo(ma.x+db-jb-D*O,ma.y-db-jb+z*O);d.stroke()}});mxMarker.addMarker("halfCircle",function(d,p,A,t,z,D,G,ea,O,sa){var ma=z*(G+O+1),$a=D*(G+O+1),jb=t.clone();t.x-=ma;t.y-=$a;return function(){d.begin();d.moveTo(jb.x-$a,jb.y+ma);d.quadTo(t.x-$a,t.y+ma,t.x,t.y);d.quadTo(t.x+$a,t.y-ma,jb.x+$a,jb.y-ma);d.stroke()}});mxMarker.addMarker("async",function(d,p,A,t,z,D,G,ea,O,sa){p=z*O*1.118;A=D*O*1.118;z*=G+O;D*=G+O;var ma=t.clone();ma.x-=p;ma.y-=A;t.x+=-z-p;t.y+=-D-A;return function(){d.begin();
d.moveTo(ma.x,ma.y);ea?d.lineTo(ma.x-z-D/2,ma.y-D+z/2):d.lineTo(ma.x+D/2-z,ma.y-D-z/2);d.lineTo(ma.x-z,ma.y-D);d.close();sa?d.fillAndStroke():d.stroke()}});mxMarker.addMarker("openAsync",function(d){d=null!=d?d:2;return function(p,A,t,z,D,G,ea,O,sa,ma){D*=ea+sa;G*=ea+sa;var $a=z.clone();return function(){p.begin();p.moveTo($a.x,$a.y);O?p.lineTo($a.x-D-G/d,$a.y-G+D/d):p.lineTo($a.x+G/d-D,$a.y-G-D/d);p.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var ib=function(d,p,A){return mb(d,["width"],
p,function(t,z,D,G,ea){ea=d.shape.getEdgeWidth()*d.view.scale+A;return new mxPoint(G.x+z*t/4+D*ea/2,G.y+D*t/4-z*ea/2)},function(t,z,D,G,ea,O){t=Math.sqrt(mxUtils.ptSegDistSq(G.x,G.y,ea.x,ea.y,O.x,O.y));d.style.width=Math.round(2*t)/d.view.scale-A})},mb=function(d,p,A,t,z){return bb(d,p,function(D){var G=d.absolutePoints;if(null!=G&&0<G.length){var ea=G.length-1;D=d.view.translate;var O=d.view.scale,sa=A?G[0]:G[ea];G=A?G[1]:G[ea-1];ea=G.x-sa.x;var ma=G.y-sa.y,$a=Math.sqrt(ea*ea+ma*ma);sa=t.call(this,
$a,ea/$a,ma/$a,sa,G);return new mxPoint(sa.x/O-D.x,sa.y/O-D.y)}return null},function(D,G,ea){var O=d.absolutePoints,sa=O.length-1;D=d.view.translate;var ma=d.view.scale,$a=A?O[0]:O[sa];O=A?O[1]:O[sa-1];sa=O.x-$a.x;var jb=O.y-$a.y,db=Math.sqrt(sa*sa+jb*jb);G.x=(G.x+D.x)*ma;G.y=(G.y+D.y)*ma;z.call(this,db,sa/db,jb/db,$a,O,G,ea)})},nb=function(d,p){return function(A){return[mb(A,["startWidth"],!0,function(t,z,D,G,ea){ea=mxUtils.getNumber(A.style,"startWidth",d)*A.view.scale+p;return new mxPoint(G.x+
z*t/4+D*ea/2,G.y+D*t/4-z*ea/2)},function(t,z,D,G,ea,O){t=Math.sqrt(mxUtils.ptSegDistSq(G.x,G.y,ea.x,ea.y,O.x,O.y));A.style.startWidth=Math.round(2*t)/A.view.scale-p})]}},qb=function(d){return function(p){return[bb(p,["arrowWidth","arrowSize"],function(A){var t=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",Ra.prototype.arrowWidth))),z=Math.max(0,Math.min(d,mxUtils.getValue(this.state.style,"arrowSize",Ra.prototype.arrowSize)));return new mxPoint(A.x+(1-z)*A.width,A.y+(1-t)*A.height/
2)},function(A,t){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(A.y+A.height/2-t.y)/A.height*2));this.state.style.arrowSize=Math.max(0,Math.min(d,(A.x+A.width-t.x)/A.width))})]}},ub=function(d){return function(p){return[bb(p,["size"],function(A){var t=Math.max(0,Math.min(.5*A.height,parseFloat(mxUtils.getValue(this.state.style,"size",d))));return new mxPoint(A.x,A.y+t)},function(A,t){this.state.style.size=Math.max(0,t.y-A.y)},!0)]}},zb=function(d,p,A){return function(t){var z=[bb(t,["size"],
function(D){var G=Math.max(0,Math.min(D.width,Math.min(D.height,parseFloat(mxUtils.getValue(this.state.style,"size",p)))))*d;return new mxPoint(D.x+G,D.y+G)},function(D,G){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(D.width,G.x-D.x),Math.min(D.height,G.y-D.y)))/d)},!1)];A&&mxUtils.getValue(t.style,mxConstants.STYLE_ROUNDED,!1)&&z.push(wb(t));return z}},Cb=function(d,p,A,t,z){A=null!=A?A:.5;return function(D){var G=[bb(D,["size"],function(ea){var O=null!=z?"0"!=mxUtils.getValue(this.state.style,
"fixedSize","0"):null,sa=parseFloat(mxUtils.getValue(this.state.style,"size",O?z:d));return new mxPoint(ea.x+Math.max(0,Math.min(.5*ea.width,sa*(O?1:ea.width))),ea.getCenterY())},function(ea,O,sa){ea=null!=z&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?O.x-ea.x:Math.max(0,Math.min(A,(O.x-ea.x)/ea.width));this.state.style.size=ea},!1,t)];p&&mxUtils.getValue(D.style,mxConstants.STYLE_ROUNDED,!1)&&G.push(wb(D));return G}},Ab=function(d,p,A){d=null!=d?d:.5;return function(t){var z=[bb(t,["size"],
function(D){var G=null!=A?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,ea=Math.max(0,parseFloat(mxUtils.getValue(this.state.style,"size",G?A:p)));return new mxPoint(D.x+Math.min(.75*D.width*d,ea*(G?.75:.75*D.width)),D.y+D.height/4)},function(D,G){D=null!=A&&"0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?G.x-D.x:Math.max(0,Math.min(d,(G.x-D.x)/D.width*.75));this.state.style.size=D},!1,!0)];mxUtils.getValue(t.style,mxConstants.STYLE_ROUNDED,!1)&&z.push(wb(t));return z}},Bb=
function(){return function(d){var p=[];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&p.push(wb(d));return p}},wb=function(d,p){return bb(d,[mxConstants.STYLE_ARCSIZE],function(A){var t=null!=p?p:A.height/8;if("1"==mxUtils.getValue(d.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var z=mxUtils.getValue(d.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(A.x+A.width-Math.min(A.width/2,z),A.y+t)}z=Math.max(0,parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_ARCSIZE,
100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(A.x+A.width-Math.min(Math.max(A.width/2,A.height/2),Math.min(A.width,A.height)*z),A.y+t)},function(A,t,z){"1"==mxUtils.getValue(d.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(A.width,2*(A.x+A.width-t.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(A.width-t.x+A.x)/Math.min(A.width,A.height))))})},bb=function(d,p,A,t,
z,D,G){var ea=new mxHandle(d,null,mxVertexHandler.prototype.secondaryHandleImage);ea.execute=function(sa){for(var ma=0;ma<p.length;ma++)this.copyStyle(p[ma]);G&&G(sa)};ea.getPosition=A;ea.setPosition=t;ea.ignoreGrid=null!=z?z:!0;if(D){var O=ea.positionChanged;ea.positionChanged=function(){O.apply(this,arguments);d.view.invalidate(this.state.cell);d.view.validate()}}return ea},yb={link:function(d){return[ib(d,!0,10),ib(d,!1,10)]},pipe:function(d){return[ib(d,!0,10),ib(d,!1,10)]},flexArrow:function(d){var p=
d.view.graph.gridSize/d.view.scale,A=[];mxUtils.getValue(d.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(A.push(mb(d,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(t,z,D,G,ea){t=(d.shape.getEdgeWidth()-d.shape.strokewidth)*d.view.scale;ea=3*mxUtils.getNumber(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(G.x+z*(ea+d.shape.strokewidth*d.view.scale)+D*t/2,G.y+D*(ea+d.shape.strokewidth*d.view.scale)-
z*t/2)},function(t,z,D,G,ea,O,sa){t=Math.sqrt(mxUtils.ptSegDistSq(G.x,G.y,ea.x,ea.y,O.x,O.y));z=mxUtils.ptLineDist(G.x,G.y,G.x+D,G.y-z,O.x,O.y);d.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(z-d.shape.strokewidth)/3)/100/d.view.scale;d.style.width=Math.round(2*t)/d.view.scale;if(mxEvent.isShiftDown(sa.getEvent())||mxEvent.isControlDown(sa.getEvent()))d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE];mxEvent.isAltDown(sa.getEvent())||Math.abs(parseFloat(d.style[mxConstants.STYLE_STARTSIZE])-
parseFloat(d.style[mxConstants.STYLE_ENDSIZE]))<p/6&&(d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE])})),A.push(mb(d,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(t,z,D,G,ea){t=(d.shape.getStartArrowWidth()-d.shape.strokewidth)*d.view.scale;ea=3*mxUtils.getNumber(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(G.x+z*(ea+d.shape.strokewidth*d.view.scale)+D*t/2,G.y+D*(ea+d.shape.strokewidth*
d.view.scale)-z*t/2)},function(t,z,D,G,ea,O,sa){t=Math.sqrt(mxUtils.ptSegDistSq(G.x,G.y,ea.x,ea.y,O.x,O.y));z=mxUtils.ptLineDist(G.x,G.y,G.x+D,G.y-z,O.x,O.y);d.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(z-d.shape.strokewidth)/3)/100/d.view.scale;d.style.startWidth=Math.max(0,Math.round(2*t)-d.shape.getEdgeWidth())/d.view.scale;if(mxEvent.isShiftDown(sa.getEvent())||mxEvent.isControlDown(sa.getEvent()))d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE],d.style.endWidth=
d.style.startWidth;mxEvent.isAltDown(sa.getEvent())||(Math.abs(parseFloat(d.style[mxConstants.STYLE_STARTSIZE])-parseFloat(d.style[mxConstants.STYLE_ENDSIZE]))<p/6&&(d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(d.style.startWidth)-parseFloat(d.style.endWidth))<p&&(d.style.startWidth=d.style.endWidth))})));mxUtils.getValue(d.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(A.push(mb(d,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],
!1,function(t,z,D,G,ea){t=(d.shape.getEdgeWidth()-d.shape.strokewidth)*d.view.scale;ea=3*mxUtils.getNumber(d.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(G.x+z*(ea+d.shape.strokewidth*d.view.scale)-D*t/2,G.y+D*(ea+d.shape.strokewidth*d.view.scale)+z*t/2)},function(t,z,D,G,ea,O,sa){t=Math.sqrt(mxUtils.ptSegDistSq(G.x,G.y,ea.x,ea.y,O.x,O.y));z=mxUtils.ptLineDist(G.x,G.y,G.x+D,G.y-z,O.x,O.y);d.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(z-d.shape.strokewidth)/
3)/100/d.view.scale;d.style.width=Math.round(2*t)/d.view.scale;if(mxEvent.isShiftDown(sa.getEvent())||mxEvent.isControlDown(sa.getEvent()))d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE];mxEvent.isAltDown(sa.getEvent())||Math.abs(parseFloat(d.style[mxConstants.STYLE_ENDSIZE])-parseFloat(d.style[mxConstants.STYLE_STARTSIZE]))<p/6&&(d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE])})),A.push(mb(d,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],
!1,function(t,z,D,G,ea){t=(d.shape.getEndArrowWidth()-d.shape.strokewidth)*d.view.scale;ea=3*mxUtils.getNumber(d.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*d.view.scale;return new mxPoint(G.x+z*(ea+d.shape.strokewidth*d.view.scale)-D*t/2,G.y+D*(ea+d.shape.strokewidth*d.view.scale)+z*t/2)},function(t,z,D,G,ea,O,sa){t=Math.sqrt(mxUtils.ptSegDistSq(G.x,G.y,ea.x,ea.y,O.x,O.y));z=mxUtils.ptLineDist(G.x,G.y,G.x+D,G.y-z,O.x,O.y);d.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(z-d.shape.strokewidth)/
3)/100/d.view.scale;d.style.endWidth=Math.max(0,Math.round(2*t)-d.shape.getEdgeWidth())/d.view.scale;if(mxEvent.isShiftDown(sa.getEvent())||mxEvent.isControlDown(sa.getEvent()))d.style[mxConstants.STYLE_STARTSIZE]=d.style[mxConstants.STYLE_ENDSIZE],d.style.startWidth=d.style.endWidth;mxEvent.isAltDown(sa.getEvent())||(Math.abs(parseFloat(d.style[mxConstants.STYLE_ENDSIZE])-parseFloat(d.style[mxConstants.STYLE_STARTSIZE]))<p/6&&(d.style[mxConstants.STYLE_ENDSIZE]=d.style[mxConstants.STYLE_STARTSIZE]),
Math.abs(parseFloat(d.style.endWidth)-parseFloat(d.style.startWidth))<p&&(d.style.endWidth=d.style.startWidth))})));return A},swimlane:function(d){var p=[];if(mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED)){var A=parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));p.push(wb(d,A/2))}p.push(bb(d,[mxConstants.STYLE_STARTSIZE],function(t){var z=parseFloat(mxUtils.getValue(d.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(d.style,
mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(t.getCenterX(),t.y+Math.max(0,Math.min(t.height,z))):new mxPoint(t.x+Math.max(0,Math.min(t.width,z)),t.getCenterY())},function(t,z){d.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(t.height,z.y-t.y))):Math.round(Math.max(0,Math.min(t.width,z.x-t.x)))},!1,null,function(t){var z=d.view.graph;if(!mxEvent.isShiftDown(t.getEvent())&&!mxEvent.isControlDown(t.getEvent())&&(z.isTableRow(d.cell)||
z.isTableCell(d.cell))){t=z.getSwimlaneDirection(d.style);var D=z.model.getParent(d.cell);D=z.model.getChildCells(D,!0);for(var G=[],ea=0;ea<D.length;ea++)D[ea]!=d.cell&&z.isSwimlane(D[ea])&&z.getSwimlaneDirection(z.getCurrentCellStyle(D[ea]))==t&&G.push(D[ea]);z.setCellStyles(mxConstants.STYLE_STARTSIZE,d.style[mxConstants.STYLE_STARTSIZE],G)}}));return p},label:Bb(),ext:Bb(),rectangle:Bb(),triangle:Bb(),rhombus:Bb(),umlLifeline:function(d){return[bb(d,["size"],function(p){var A=Math.max(0,Math.min(p.height,
parseFloat(mxUtils.getValue(this.state.style,"size",fa.prototype.size))));return new mxPoint(p.getCenterX(),p.y+A)},function(p,A){this.state.style.size=Math.round(Math.max(0,Math.min(p.height,A.y-p.y)))},!1)]},umlFrame:function(d){return[bb(d,["width","height"],function(p){var A=Math.max(na.prototype.corner,Math.min(p.width,mxUtils.getValue(this.state.style,"width",na.prototype.width))),t=Math.max(1.5*na.prototype.corner,Math.min(p.height,mxUtils.getValue(this.state.style,"height",na.prototype.height)));
return new mxPoint(p.x+A,p.y+t)},function(p,A){this.state.style.width=Math.round(Math.max(na.prototype.corner,Math.min(p.width,A.x-p.x)));this.state.style.height=Math.round(Math.max(1.5*na.prototype.corner,Math.min(p.height,A.y-p.y)))},!1)]},process:function(d){var p=[bb(d,["size"],function(A){var t="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),z=parseFloat(mxUtils.getValue(this.state.style,"size",oa.prototype.size));return t?new mxPoint(A.x+z,A.y+A.height/4):new mxPoint(A.x+A.width*z,A.y+
A.height/4)},function(A,t){A="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(.5*A.width,t.x-A.x)):Math.max(0,Math.min(.5,(t.x-A.x)/A.width));this.state.style.size=A},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&p.push(wb(d));return p},cross:function(d){return[bb(d,["size"],function(p){var A=Math.min(p.width,p.height);A=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",Ta.prototype.size)))*A/2;return new mxPoint(p.getCenterX()-A,p.getCenterY()-
A)},function(p,A){var t=Math.min(p.width,p.height);this.state.style.size=Math.max(0,Math.min(1,Math.min(Math.max(0,p.getCenterY()-A.y)/t*2,Math.max(0,p.getCenterX()-A.x)/t*2)))})]},note:function(d){return[bb(d,["size"],function(p){var A=Math.max(0,Math.min(p.width,Math.min(p.height,parseFloat(mxUtils.getValue(this.state.style,"size",E.prototype.size)))));return new mxPoint(p.x+p.width-A,p.y+A)},function(p,A){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(p.width,p.x+p.width-A.x),Math.min(p.height,
A.y-p.y))))})]},note2:function(d){return[bb(d,["size"],function(p){var A=Math.max(0,Math.min(p.width,Math.min(p.height,parseFloat(mxUtils.getValue(this.state.style,"size",Q.prototype.size)))));return new mxPoint(p.x+p.width-A,p.y+A)},function(p,A){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(p.width,p.x+p.width-A.x),Math.min(p.height,A.y-p.y))))})]},manualInput:function(d){var p=[bb(d,["size"],function(A){var t=Math.max(0,Math.min(A.height,mxUtils.getValue(this.state.style,"size",
Da.prototype.size)));return new mxPoint(A.x+A.width/4,A.y+3*t/4)},function(A,t){this.state.style.size=Math.round(Math.max(0,Math.min(A.height,4*(t.y-A.y)/3)))},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&p.push(wb(d));return p},dataStorage:function(d){return[bb(d,["size"],function(p){var A="0"!=mxUtils.getValue(this.state.style,"fixedSize","0"),t=parseFloat(mxUtils.getValue(this.state.style,"size",A?Ea.prototype.fixedSize:Ea.prototype.size));return new mxPoint(p.x+p.width-t*(A?1:
p.width),p.getCenterY())},function(p,A){p="0"!=mxUtils.getValue(this.state.style,"fixedSize","0")?Math.max(0,Math.min(p.width,p.x+p.width-A.x)):Math.max(0,Math.min(1,(p.x+p.width-A.x)/p.width));this.state.style.size=p},!1)]},callout:function(d){var p=[bb(d,["size","position"],function(A){var t=Math.max(0,Math.min(A.height,mxUtils.getValue(this.state.style,"size",da.prototype.size))),z=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",da.prototype.position)));mxUtils.getValue(this.state.style,
"base",da.prototype.base);return new mxPoint(A.x+z*A.width,A.y+A.height-t)},function(A,t){mxUtils.getValue(this.state.style,"base",da.prototype.base);this.state.style.size=Math.round(Math.max(0,Math.min(A.height,A.y+A.height-t.y)));this.state.style.position=Math.round(100*Math.max(0,Math.min(1,(t.x-A.x)/A.width)))/100},!1),bb(d,["position2"],function(A){var t=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",da.prototype.position2)));return new mxPoint(A.x+t*A.width,A.y+A.height)},
function(A,t){this.state.style.position2=Math.round(100*Math.max(0,Math.min(1,(t.x-A.x)/A.width)))/100},!1),bb(d,["base"],function(A){var t=Math.max(0,Math.min(A.height,mxUtils.getValue(this.state.style,"size",da.prototype.size))),z=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",da.prototype.position))),D=Math.max(0,Math.min(A.width,mxUtils.getValue(this.state.style,"base",da.prototype.base)));return new mxPoint(A.x+Math.min(A.width,z*A.width+D),A.y+A.height-t)},function(A,t){var z=
Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",da.prototype.position)));this.state.style.base=Math.round(Math.max(0,Math.min(A.width,t.x-A.x-z*A.width)))},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&p.push(wb(d));return p},internalStorage:function(d){var p=[bb(d,["dx","dy"],function(A){var t=Math.max(0,Math.min(A.width,mxUtils.getValue(this.state.style,"dx",va.prototype.dx))),z=Math.max(0,Math.min(A.height,mxUtils.getValue(this.state.style,"dy",va.prototype.dy)));
return new mxPoint(A.x+t,A.y+z)},function(A,t){this.state.style.dx=Math.round(Math.max(0,Math.min(A.width,t.x-A.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(A.height,t.y-A.y)))},!1)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&p.push(wb(d));return p},module:function(d){return[bb(d,["jettyWidth","jettyHeight"],function(p){var A=Math.max(0,Math.min(p.width,mxUtils.getValue(this.state.style,"jettyWidth",Ja.prototype.jettyWidth))),t=Math.max(0,Math.min(p.height,mxUtils.getValue(this.state.style,
"jettyHeight",Ja.prototype.jettyHeight)));return new mxPoint(p.x+A/2,p.y+2*t)},function(p,A){this.state.style.jettyWidth=Math.round(2*Math.max(0,Math.min(p.width,A.x-p.x)));this.state.style.jettyHeight=Math.round(Math.max(0,Math.min(p.height,A.y-p.y))/2)})]},corner:function(d){return[bb(d,["dx","dy"],function(p){var A=Math.max(0,Math.min(p.width,mxUtils.getValue(this.state.style,"dx",Na.prototype.dx))),t=Math.max(0,Math.min(p.height,mxUtils.getValue(this.state.style,"dy",Na.prototype.dy)));return new mxPoint(p.x+
A,p.y+t)},function(p,A){this.state.style.dx=Math.round(Math.max(0,Math.min(p.width,A.x-p.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(p.height,A.y-p.y)))},!1)]},tee:function(d){return[bb(d,["dx","dy"],function(p){var A=Math.max(0,Math.min(p.width,mxUtils.getValue(this.state.style,"dx",Qa.prototype.dx))),t=Math.max(0,Math.min(p.height,mxUtils.getValue(this.state.style,"dy",Qa.prototype.dy)));return new mxPoint(p.x+(p.width+A)/2,p.y+t)},function(p,A){this.state.style.dx=Math.round(Math.max(0,
2*Math.min(p.width/2,A.x-p.x-p.width/2)));this.state.style.dy=Math.round(Math.max(0,Math.min(p.height,A.y-p.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(d){return[bb(d,["tabWidth","tabHeight"],function(p){var A=Math.max(0,Math.min(p.width,mxUtils.getValue(this.state.style,"tabWidth",x.prototype.tabWidth))),t=Math.max(0,Math.min(p.height,mxUtils.getValue(this.state.style,
"tabHeight",x.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",x.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(A=p.width-A);return new mxPoint(p.x+A,p.y+t)},function(p,A){var t=Math.max(0,Math.min(p.width,A.x-p.x));mxUtils.getValue(this.state.style,"tabPosition",x.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(t=p.width-t);this.state.style.tabWidth=Math.round(t);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(p.height,A.y-p.y)))},!1)]},document:function(d){return[bb(d,
["size"],function(p){var A=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",L.prototype.size))));return new mxPoint(p.x+3*p.width/4,p.y+(1-A)*p.height)},function(p,A){this.state.style.size=Math.max(0,Math.min(1,(p.y+p.height-A.y)/p.height))},!1)]},tape:function(d){return[bb(d,["size"],function(p){var A=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",M.prototype.size))));return new mxPoint(p.getCenterX(),p.y+A*p.height/2)},function(p,A){this.state.style.size=
Math.max(0,Math.min(1,(A.y-p.y)/p.height*2))},!1)]},isoCube2:function(d){return[bb(d,["isoAngle"],function(p){var A=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.state.style,"isoAngle",c.isoAngle))))*Math.PI/200;return new mxPoint(p.x,p.y+Math.min(p.width*Math.tan(A),.5*p.height))},function(p,A){this.state.style.isoAngle=Math.max(0,50*(A.y-p.y)/p.height)},!0)]},cylinder2:ub(g.prototype.size),cylinder3:ub(m.prototype.size),offPageConnector:function(d){return[bb(d,["size"],function(p){var A=
Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",W.prototype.size))));return new mxPoint(p.getCenterX(),p.y+(1-A)*p.height)},function(p,A){this.state.style.size=Math.max(0,Math.min(1,(p.y+p.height-A.y)/p.height))},!1)]},"mxgraph.basic.rect":function(d){var p=[Graph.createHandle(d,["size"],function(A){var t=Math.max(0,Math.min(A.width/2,A.height/2,parseFloat(mxUtils.getValue(this.state.style,"size",this.size))));return new mxPoint(A.x+t,A.y+t)},function(A,t){this.state.style.size=
Math.round(100*Math.max(0,Math.min(A.height/2,A.width/2,t.x-A.x)))/100})];d=Graph.createHandle(d,["indent"],function(A){var t=Math.max(0,Math.min(100,parseFloat(mxUtils.getValue(this.state.style,"indent",this.dx2))));return new mxPoint(A.x+.75*A.width,A.y+t*A.height/200)},function(A,t){this.state.style.indent=Math.round(100*Math.max(0,Math.min(100,200*(t.y-A.y)/A.height)))/100});p.push(d);return p},step:Cb(ha.prototype.size,!0,null,!0,ha.prototype.fixedSize),hexagon:Cb(Z.prototype.size,!0,.5,!0,Z.prototype.fixedSize),
curlyBracket:Cb(ja.prototype.size,!1),display:Cb(ab.prototype.size,!1),cube:zb(1,u.prototype.size,!1),card:zb(.5,I.prototype.size,!0),loopLimit:zb(.5,R.prototype.size,!0),trapezoid:Ab(.5,aa.prototype.size,aa.prototype.fixedSize),parallelogram:Ab(1,K.prototype.size,K.prototype.fixedSize)};Graph.createHandle=bb;Graph.handleFactory=yb;var tb=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){var d=tb.apply(this,arguments);if(this.graph.isCellRotatable(this.state.cell)){var p=
this.state.style.shape;null==mxCellRenderer.defaultShapes[p]&&null==mxStencilRegistry.getStencil(p)?p=mxConstants.SHAPE_RECTANGLE:this.state.view.graph.isSwimlane(this.state.cell)&&(p=mxConstants.SHAPE_SWIMLANE);p=yb[p];null==p&&null!=this.state.shape&&this.state.shape.isRoundable()&&(p=yb[mxConstants.SHAPE_RECTANGLE]);null!=p&&(p=p(this.state),null!=p&&(d=null==d?p:d.concat(p)))}return d};mxEdgeHandler.prototype.createCustomHandles=function(){var d=this.state.style.shape;null==mxCellRenderer.defaultShapes[d]&&
null==mxStencilRegistry.getStencil(d)&&(d=mxConstants.SHAPE_CONNECTOR);d=yb[d];return null!=d?d(this.state):null}}else Graph.createHandle=function(){},Graph.handleFactory={};var xb=new mxPoint(1,0),vb=new mxPoint(1,0),rb=mxUtils.toRadians(-30);xb=mxUtils.getRotatedPoint(xb,Math.cos(rb),Math.sin(rb));var Db=mxUtils.toRadians(-150);vb=mxUtils.getRotatedPoint(vb,Math.cos(Db),Math.sin(Db));mxEdgeStyle.IsometricConnector=function(d,p,A,t,z){var D=d.view;t=null!=t&&0<t.length?t[0]:null;var G=d.absolutePoints,
ea=G[0];G=G[G.length-1];null!=t&&(t=D.transformControlPoint(d,t));null==ea&&null!=p&&(ea=new mxPoint(p.getCenterX(),p.getCenterY()));null==G&&null!=A&&(G=new mxPoint(A.getCenterX(),A.getCenterY()));var O=xb.x,sa=xb.y,ma=vb.x,$a=vb.y,jb="horizontal"==mxUtils.getValue(d.style,"elbow","horizontal");if(null!=G&&null!=ea){d=function(Fa,La,Ka){Fa-=db.x;var Ha=La-db.y;La=($a*Fa-ma*Ha)/(O*$a-sa*ma);Fa=(sa*Fa-O*Ha)/(sa*ma-O*$a);jb?(Ka&&(db=new mxPoint(db.x+O*La,db.y+sa*La),z.push(db)),db=new mxPoint(db.x+
ma*Fa,db.y+$a*Fa)):(Ka&&(db=new mxPoint(db.x+ma*Fa,db.y+$a*Fa),z.push(db)),db=new mxPoint(db.x+O*La,db.y+sa*La));z.push(db)};var db=ea;null==t&&(t=new mxPoint(ea.x+(G.x-ea.x)/2,ea.y+(G.y-ea.y)/2));d(t.x,t.y,!0);d(G.x,G.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Fb=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(d,p){if(p==mxEdgeStyle.IsometricConnector){var A=new mxElbowEdgeHandler(d);A.snapToTerminals=!1;return A}return Fb.apply(this,
arguments)};B.prototype.constraints=[];H.prototype.getConstraints=function(d,p,A){d=[];var t=Math.tan(mxUtils.toRadians(30)),z=(.5-t)/2;t=Math.min(p,A/(.5+t));p=(p-t)/2;A=(A-t)/2;d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,A+.25*t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p+.5*t,A+t*z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p+t,A+.25*t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p+t,A+.75*t));d.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,p+.5*t,A+(1-z)*t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,A+.75*t));return d};c.prototype.getConstraints=function(d,p,A){d=[];var t=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;t=Math.min(p*Math.tan(t),.5*A);d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,t));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,p,A-t));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A-t));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,t));return d};da.prototype.getConstraints=function(d,p,A){d=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var t=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size))));parseFloat(mxUtils.getValue(this.style,
"position",this.position));var z=p*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2))));parseFloat(mxUtils.getValue(this.style,"base",this.base));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.25,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.75,0),!1));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,p,.5*(A-t)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,A-t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,A));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A-t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(A-t)));p>=2*t&&d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return d};mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(.25,
0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(.25,
1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0)];mxEllipse.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(0,
.5),!0),new mxConnectionConstraint(new mxPoint(1,.5))];Ia.prototype.constraints=mxRectangleShape.prototype.constraints;mxImageShape.prototype.constraints=mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;k.prototype.constraints=mxRectangleShape.prototype.constraints;mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints;E.prototype.getConstraints=function(d,p,A){d=[];var t=Math.max(0,Math.min(p,Math.min(A,parseFloat(mxUtils.getValue(this.style,
"size",this.size)))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p-t),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-t,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-.5*t,.5*t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,.5*(A+t)));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,
1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));p>=2*t&&d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return d};I.prototype.getConstraints=function(d,p,A){d=[];var t=Math.max(0,Math.min(p,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+t),0));d.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,t,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*t,.5*t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(A+t)));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));p>=2*t&&d.push(new mxConnectionConstraint(new mxPoint(.5,
0),!1));return d};u.prototype.getConstraints=function(d,p,A){d=[];var t=Math.max(0,Math.min(p,Math.min(A,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p-t),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-t,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-.5*t,.5*t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,t));d.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,p,.5*(A+t)));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+t),A));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,t,A));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*t,A-.5*t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A-t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(A-t)));return d};m.prototype.getConstraints=function(d,p,A){d=[];p=Math.max(0,Math.min(A,
parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,p));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,p));d.push(new mxConnectionConstraint(new mxPoint(1,1),!1,null,0,-p));d.push(new mxConnectionConstraint(new mxPoint(0,
1),!1,null,0,-p));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,p+.5*(.5*A-p)));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,p+.5*(.5*A-p)));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1,null,0,A-p-.5*(.5*A-p)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A-p-.5*(.5*A-p)));d.push(new mxConnectionConstraint(new mxPoint(.145,0),!1,null,0,.29*p));d.push(new mxConnectionConstraint(new mxPoint(.855,0),!1,null,0,.29*p));d.push(new mxConnectionConstraint(new mxPoint(.855,
1),!1,null,0,.29*-p));d.push(new mxConnectionConstraint(new mxPoint(.145,1),!1,null,0,.29*-p));return d};x.prototype.getConstraints=function(d,p,A){d=[];var t=Math.max(0,Math.min(p,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))),z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?(d.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),d.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,.5*t,0)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,t,0)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,t,z)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+t),z))):(d.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-.5*t,0)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-t,0)),d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-t,z)),d.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,.5*(p-t),z)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,.25*(A-z)+z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,.5*(A-z)+z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,.75*(A-z)+z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,A));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,
0,.25*(A-z)+z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(A-z)+z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.75*(A-z)+z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A));d.push(new mxConnectionConstraint(new mxPoint(.25,1),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(.75,1),!1));return d};va.prototype.constraints=mxRectangleShape.prototype.constraints;Ea.prototype.constraints=
mxRectangleShape.prototype.constraints;ia.prototype.constraints=mxEllipse.prototype.constraints;ka.prototype.constraints=mxEllipse.prototype.constraints;pa.prototype.constraints=mxEllipse.prototype.constraints;Va.prototype.constraints=mxEllipse.prototype.constraints;Da.prototype.constraints=mxRectangleShape.prototype.constraints;Wa.prototype.constraints=mxRectangleShape.prototype.constraints;ab.prototype.getConstraints=function(d,p,A){d=[];var t=Math.min(p,A/2),z=Math.min(p-t,Math.max(0,parseFloat(mxUtils.getValue(this.style,
"size",this.size)))*p);d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(z+p-t),0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-t,0));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-t,A));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(z+p-t),A));d.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,z,A));return d};Ja.prototype.getConstraints=function(d,p,A){p=parseFloat(mxUtils.getValue(d,"jettyWidth",Ja.prototype.jettyWidth))/2;d=parseFloat(mxUtils.getValue(d,"jettyHeight",Ja.prototype.jettyHeight));var t=[new mxConnectionConstraint(new mxPoint(0,0),!1,null,p),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,p),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(A-.5*d,1.5*d)),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(A-
.5*d,3.5*d))];A>5*d&&t.push(new mxConnectionConstraint(new mxPoint(0,.75),!1,null,p));A>8*d&&t.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null,p));A>15*d&&t.push(new mxConnectionConstraint(new mxPoint(0,.25),!1,null,p));return t};R.prototype.constraints=mxRectangleShape.prototype.constraints;W.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)];N.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)];Aa.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)];n.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,
0),!1),new mxConnectionConstraint(new mxPoint(.5,.25),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.5,.75),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];M.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.35),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,
.65),!1),new mxConnectionConstraint(new mxPoint(1,.35),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,.65),!1),new mxConnectionConstraint(new mxPoint(.25,1),!1),new mxConnectionConstraint(new mxPoint(.75,0),!1)];ha.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)];la.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)];K.prototype.constraints=mxRectangleShape.prototype.constraints;aa.prototype.constraints=mxRectangleShape.prototype.constraints;L.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,
0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxArrow.prototype.constraints=null;Qa.prototype.getConstraints=function(d,p,A){d=[];var t=Math.max(0,
Math.min(p,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,.5*z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,
null,.75*p+.25*t,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+t),z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+t),.5*(A+z)));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+t),A));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p-t),A));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p-t),.5*(A+z)));d.push(new mxConnectionConstraint(new mxPoint(0,0),
!1,null,.5*(p-t),z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.25*p-.25*t,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*z));return d};Na.prototype.getConstraints=function(d,p,A){d=[];var t=Math.max(0,Math.min(p,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),z=Math.max(0,Math.min(A,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));d.push(new mxConnectionConstraint(new mxPoint(0,0),
!1));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(1,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,.5*z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+t),z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,t,z));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,t,.5*(A+z)));d.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,t,A));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*t,A));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,1),!1));return d};Oa.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)];Ra.prototype.getConstraints=function(d,p,A){d=[];var t=A*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),z=p*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));t=(A-t)/2;d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,0,t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p-z),t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-z,0));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-z,A));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p-z),A-t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,A-t));return d};za.prototype.getConstraints=function(d,p,A){d=[];var t=A*Math.max(0,Math.min(1,
parseFloat(mxUtils.getValue(this.style,"arrowWidth",Ra.prototype.arrowWidth)))),z=p*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Ra.prototype.arrowSize))));t=(A-t)/2;d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*p,t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-z,0));d.push(new mxConnectionConstraint(new mxPoint(1,.5),
!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p-z,A));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*p,A-t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,A));return d};Ta.prototype.getConstraints=function(d,p,A){d=[];var t=Math.min(A,p),z=Math.max(0,Math.min(t,t*parseFloat(mxUtils.getValue(this.style,"size",this.size))));t=(A-z)/2;var D=t+z,G=(p-z)/2;z=G+z;d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,G,.5*t));d.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,G,0));d.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,0));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,.5*t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,G,A-.5*t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,G,A));d.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));d.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,z,A));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,A-.5*t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,z,D));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+z),t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,t));d.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,p,D));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(p+z),D));d.push(new mxConnectionConstraint(new mxPoint(0,
0),!1,null,G,D));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*G,t));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,t));d.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,D));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*G,D));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,G,t));return d};fa.prototype.constraints=null;C.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)];P.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)];ya.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];wa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]})();function Actions(b){this.editorUi=b;this.actions={};this.init()}
Actions.prototype.init=function(){function b(E){q.escape();E=q.deleteCells(q.getDeletableCells(q.getSelectionCells()),E);null!=E&&q.setSelectionCells(E)}function f(){if(!q.isSelectionEmpty()){q.getModel().beginUpdate();try{for(var E=q.getSelectionCells(),Q=0;Q<E.length;Q++)q.cellLabelChanged(E[Q],"")}finally{q.getModel().endUpdate()}}}function l(E,Q,c,g,m){m.getModel().beginUpdate();try{var n=m.getCellGeometry(E);null!=n&&c&&g&&(c/=g,n=n.clone(),1<c?n.height=n.width/c:n.width=n.height*c,m.getModel().setGeometry(E,
n));m.setCellStyles(mxConstants.STYLE_CLIP_PATH,Q,[E]);m.setCellStyles(mxConstants.STYLE_ASPECT,"fixed",[E])}finally{m.getModel().endUpdate()}}var u=this.editorUi,y=u.editor,q=y.graph,B=function(){return Action.prototype.isEnabled.apply(this,arguments)&&q.isEnabled()};this.addAction("new...",function(){q.openLink(u.getUrl())});this.addAction("open...",function(){window.openNew=!0;window.openKey="open";u.openFile()});var H=new Action("smartFit",function(){q.popupMenuHandler.hideMenu();var E=q.view.scale,
Q=q.container.scrollLeft,c=q.container.scrollTop,g=q.view.translate.x,m=q.view.translate.y;u.actions.get("resetView").funct();1E-5>Math.abs(E-q.view.scale)&&5>Math.abs(Q-q.container.scrollLeft)&&5>Math.abs(c-q.container.scrollTop)&&g==q.view.translate.x&&m==q.view.translate.y&&u.actions.get("fitWindow").funct()},null,null,"Enter");H.getTitle=function(){return mxResources.get("fitWindow")+" / "+mxResources.get("resetView")};this.put("smartFit",H);this.addAction("keyPressEnter",function(){q.isSelectionEmpty()?
u.actions.get("smartFit").funct():q.isEnabled()&&q.startEditingAtCell()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){u.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(E,Q){try{var c=mxUtils.parseXml(E);y.graph.setSelectionCells(y.graph.importGraphModel(c.documentElement))}catch(g){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+g.message)}}));u.showDialog((new OpenDialog(this)).container,
320,220,!0,!0,function(){window.openFile=null})}).isEnabled=B;this.addAction("save",function(){u.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=B;this.addAction("saveAs...",function(){u.saveFile(!0)},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+S");this.addAction("export...",function(){u.showDialog((new ExportDialog(u)).container,300,340,!0,!0)});this.addAction("editDiagram...",function(){var E=new EditDiagramDialog(u);u.showDialog(E.container,620,420,!0,!1);E.init()}).isEnabled=B;this.addAction("pageSetup...",
function(){u.showDialog((new PageSetupDialog(u)).container,320,240,!0,!0)}).isEnabled=B;this.addAction("print...",function(){u.showPrintDialog()},null,"",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(q,null,10,10)});this.addAction("undo",function(){u.undo()},null,"",Editor.ctrlKey+"+Z");this.addAction("redo",function(){u.redo()},null,"",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+"+Editor.shiftKey+"+Z");this.addAction("cut",function(){var E=null;try{E=u.copyXml(),
null!=E&&q.removeCells(E,!1)}catch(Q){}try{null==E&&mxClipboard.cut(q)}catch(Q){u.handleError(Q)}},null,"",Editor.ctrlKey+"+X");this.addAction("copy",function(){try{u.copyXml()}catch(E){}try{mxClipboard.copy(q)}catch(E){u.handleError(E)}},null,"",Editor.ctrlKey+"+C");this.addAction("paste",function(){u.pasteFromClipboard()},!1,"",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(E){u.pasteFromClipboard(q.popupMenuHandler.getTriggerPoint())});this.addAction("swap",function(){var E=q.getSelectionCells();
2==E.length&&q.swapShapes(E[0],E[1])});this.addAction("copySize",function(){var E=q.getSelectionCell();q.isEnabled()&&null!=E&&q.getModel().isVertex(E)&&(E=q.getCellGeometry(E),null!=E&&(u.copiedSize=new mxRectangle(E.x,E.y,E.width,E.height)))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+F");this.addAction("pasteSize",function(){if(q.isEnabled()&&!q.isSelectionEmpty()&&null!=u.copiedSize){q.getModel().beginUpdate();try{for(var E=q.getResizableCells(q.getSelectionCells()),Q=0;Q<E.length;Q++)if(q.getModel().isVertex(E[Q])){var c=
q.getCellGeometry(E[Q]);null!=c&&(c=c.clone(),c.width=u.copiedSize.width,c.height=u.copiedSize.height,q.getModel().setGeometry(E[Q],c))}}finally{q.getModel().endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+V");this.addAction("copyData",function(){var E=q.getSelectionCell()||q.getModel().getRoot();q.isEnabled()&&null!=E&&(E=E.cloneValue(),null==E||isNaN(E.nodeType)||(u.copiedValue=E))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+B");this.addAction("copyAsText",function(){var E=q.getSelectionCell();
if(q.isEnabled()&&null!=E)try{q.isHtmlLabel(E)?u.writeHtmlToClipboard(q.getLabel(E),mxUtils.bind(this,function(Q){u.handleError(Q)})):u.writeTextToClipboard(q.getLabel(E),mxUtils.bind(this,function(Q){u.handleError(Q)}))}catch(Q){u.handleError(Q)}});this.addAction("pasteData",function(E,Q){function c(n,x){var F=g.getValue(n);x=n.cloneValue(x);x.removeAttribute("placeholders");null==F||isNaN(F.nodeType)||x.setAttribute("placeholders",F.getAttribute("placeholders"));null!=E&&mxEvent.isShiftDown(E)||
x.setAttribute("label",q.convertValueToString(n));g.setValue(n,x)}E=null!=Q?Q:E;var g=q.getModel();if(q.isEnabled()&&!q.isSelectionEmpty()&&null!=u.copiedValue){g.beginUpdate();try{var m=q.getEditableCells(q.getSelectionCells());if(0==m.length)c(g.getRoot(),u.copiedValue);else for(Q=0;Q<m.length;Q++)c(m[Q],u.copiedValue)}finally{g.endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+E");this.addAction("delete",function(E,Q){E=null!=Q?Q:E;null!=E&&mxEvent.isShiftDown(E)?f():b(null!=E&&(mxEvent.isControlDown(E)||
mxEvent.isMetaDown(E)||mxEvent.isAltDown(E)))},null,null,"Delete");this.addAction("deleteAll",function(){b(!0)});this.addAction("deleteLabels",function(){f()},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){try{q.setSelectionCells(q.duplicateCells()),q.scrollCellToVisible(q.getSelectionCell())}catch(E){u.handleError(E)}},null,null,Editor.ctrlKey+"+D");this.put("mergeCells",new Action("merge",function(){var E=u.getSelectionState();if(null!=E.mergeCell){q.getModel().beginUpdate();
try{q.setCellStyles("rowspan",E.rowspan,[E.mergeCell]),q.setCellStyles("colspan",E.colspan,[E.mergeCell])}finally{q.getModel().endUpdate()}}}));this.put("unmergeCells",new Action("unmerge",function(){var E=u.getSelectionState();if(0<E.cells.length){q.getModel().beginUpdate();try{q.setCellStyles("rowspan",null,E.cells),q.setCellStyles("colspan",null,E.cells)}finally{q.getModel().endUpdate()}}}));H=new Action("turn",function(E,Q){E=null!=Q?Q:E;q.turnShapes(q.getResizableCells(q.getSelectionCells()),
null!=E?mxEvent.isShiftDown(E):!1)},null,null,mxClient.IS_SF?null:Editor.ctrlKey+"+R");H.getTitle=function(){return mxResources.get("turn")+" / "+mxResources.get("reverse")};this.put("turn",H);this.put("selectConnections",new Action("selectEdges",function(E){E=q.getSelectionCell();q.isEnabled()&&null!=E&&q.addSelectionCells(q.getEdges(E))}));this.addAction("selectVertices",function(){q.selectVertices(null,!0)},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+I");this.addAction("selectEdges",function(){q.selectEdges()},
null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+E");this.addAction("selectAll",function(){q.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){q.clearSelection()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+A");this.addAction("lockUnlock",function(){if(!q.isSelectionEmpty()){q.getModel().beginUpdate();try{var E=q.getSelectionCells(),Q=q.getCurrentCellStyle(q.getSelectionCell()),c=1==mxUtils.getValue(Q,mxConstants.STYLE_EDITABLE,1)?0:1;q.setCellStyles(mxConstants.STYLE_MOVABLE,
c,E);q.setCellStyles(mxConstants.STYLE_RESIZABLE,c,E);q.setCellStyles(mxConstants.STYLE_ROTATABLE,c,E);q.setCellStyles(mxConstants.STYLE_DELETABLE,c,E);q.setCellStyles(mxConstants.STYLE_EDITABLE,c,E);q.setCellStyles("locked",1==c?0:1,E);q.setCellStyles("connectable",c,E)}finally{q.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+L");this.addAction("explore",function(){var E=q.getSelectionCell();q.model.isEdge(E)&&(E=q.model.getTerminal(E,!0));q.model.isVertex(E)&&Graph.exploreFromCell(u.editor.graph,
E)});this.addAction("home",function(){q.home()},null,null,"Shift+Home");this.addAction("exitGroup",function(){q.exitGroup()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+Home");this.addAction("enterGroup",function(){q.enterGroup()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+End");this.addAction("collapse",function(){q.foldCells(!0)},null,null,Editor.ctrlKey+"+Home");this.addAction("expand",function(){q.foldCells(!1)},null,null,Editor.ctrlKey+"+End");this.addAction("toFront",function(){q.orderCells(!1)},
null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+F");this.addAction("toBack",function(){q.orderCells(!0)},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+B");this.addAction("bringForward",function(E){q.orderCells(!1,null,!0)},null,null,Editor.ctrlKey+"+Alt+Shift+F");this.addAction("sendBackward",function(E){q.orderCells(!0,null,!0)},null,null,Editor.ctrlKey+"+Alt+Shift+B");this.addAction("group",function(){if(q.isEnabled()){var E=mxUtils.sortCells(q.getSelectionCells(),!0);1!=E.length||q.isTable(E[0])||
q.isTableRow(E[0])?(E=q.getCellsForGroup(E),1<E.length&&q.setSelectionCell(q.groupCells(null,0,E))):q.setCellStyles("container","1")}},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",function(){if(q.isEnabled()){var E=q.getEditableCells(q.getSelectionCells());q.model.beginUpdate();try{var Q=q.ungroupCells();if(null!=E)for(var c=0;c<E.length;c++)q.model.contains(E[c])&&(0==q.model.getChildCount(E[c])&&q.model.isVertex(E[c])&&q.setCellStyles("container","0",[E[c]]),Q.push(E[c]))}finally{q.model.endUpdate()}0<
Q.length&&q.setSelectionCells(Q)}},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+U");this.addAction("removeFromGroup",function(){if(q.isEnabled()){var E=q.getSelectionCells();if(null!=E){for(var Q=[],c=0;c<E.length;c++)q.isTableRow(E[c])||q.isTableCell(E[c])||Q.push(E[c]);q.removeCellsFromParent(Q);0<Q.length&&q.scrollCellToVisible(Q[0])}}});this.addAction("edit",function(){q.isEnabled()&&q.startEditingAtCell()},null,null,"F2/Enter");this.addAction("editData...",function(){var E=q.getSelectionCell()||
q.getModel().getRoot();u.showDataDialog(E)},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var E=q.getSelectionCell();if(q.isEnabled()&&null!=E&&q.isCellEditable(E)){var Q="";if(mxUtils.isNode(E.value)){var c=null;Graph.translateDiagram&&null!=Graph.diagramLanguage&&E.value.hasAttribute("tooltip_"+Graph.diagramLanguage)&&(c=E.value.getAttribute("tooltip_"+Graph.diagramLanguage));null==c&&(c=E.value.getAttribute("tooltip"));null!=c&&(Q=c)}Q=new TextareaDialog(u,mxResources.get("editTooltip")+
":",Q,function(g){q.setTooltipForCell(E,g)});u.showDialog(Q.container,320,200,!0,!0);Q.init()}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+T");this.addAction("openLink",function(){var E=q.getLinkForCell(q.getSelectionCell());null!=E&&q.openLink(E)});this.addAction("editLink...",function(){var E=q.getSelectionCell();if(q.isEnabled()&&null!=E&&q.isCellEditable(E)){var Q=q.getLinkForCell(E,!0)||"";u.showLinkDialog(Q,mxResources.get("ok"),function(c,g,m){q.getModel().beginUpdate();try{q.setLinkForCell(E,
0<c.length?c:null),q.setAttributeForCell(E,"linkTarget",m)}finally{q.getModel().endUpdate()}},!0,q.getLinkTargetForCell(E))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+L");this.put("insertImage",new Action("image...",function(){q.isEnabled()&&!q.isCellLocked(q.getDefaultParent())&&(q.clearSelection(),u.actions.get("image").funct())})).isEnabled=B;this.addAction("editImage...",function(){u.actions.get("image").funct()});this.put("insertLink",new Action("link...",function(){q.isEnabled()&&!q.isCellLocked(q.getDefaultParent())&&
u.showLinkDialog("",mxResources.get("ok"),function(E,Q,c){E=mxUtils.trim(E);if(0<E.length){var g=null,m=q.getLinkTitle(E);null!=Q&&0<Q.length&&(g=Q[0].iconUrl,m=Q[0].name||Q[0].type,m=m.charAt(0).toUpperCase()+m.substring(1),30<m.length&&(m=m.substring(0,30)+"..."));Q=new mxCell(m,new mxGeometry(0,0,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=g?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+g:"spacing=10;"));Q.vertex=!0;g=q.getCenterInsertPoint(q.getBoundingBoxFromGeometry([Q],
!0));Q.geometry.x=g.x;Q.geometry.y=g.y;q.setAttributeForCell(Q,"linkTarget",c);q.setLinkForCell(Q,E);q.cellSizeUpdated(Q,!0);q.getModel().beginUpdate();try{Q=q.addCell(Q),q.fireEvent(new mxEventObject("cellsInserted","cells",[Q]))}finally{q.getModel().endUpdate()}q.setSelectionCell(Q);q.scrollCellToVisible(q.getSelectionCell())}},!0)},null,null,"L")).isEnabled=B;this.addAction("link...",mxUtils.bind(this,function(){if(q.isEnabled())if(q.cellEditor.isContentEditing()){var E=q.getSelectedElement(),
Q=q.getParentByName(E,"A",q.cellEditor.textarea),c="";if(null==Q&&null!=E&&null!=E.getElementsByTagName)for(var g=E.getElementsByTagName("a"),m=0;m<g.length&&null==Q;m++)g[m].textContent==E.textContent&&(Q=g[m]);null!=Q&&"A"==Q.nodeName&&(c=Q.getAttribute("href")||"",q.selectNode(Q));var n=q.cellEditor.saveSelection();u.showLinkDialog(c,mxResources.get("ok"),mxUtils.bind(this,function(x){q.cellEditor.restoreSelection(n);null!=x&&q.insertLink(x)}))}else q.isSelectionEmpty()?this.get("insertLink").funct():
this.get("editLink").funct()})).isEnabled=B;this.addAction("autosize",function(){var E=q.getSelectionCells();if(null!=E){q.getModel().beginUpdate();try{for(var Q=0;Q<E.length;Q++){var c=E[Q];q.getModel().isVertex(c)&&(0<q.getModel().getChildCount(c)?q.updateGroupBounds([c],0,!0):q.updateCellSize(c))}}finally{q.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+Y");this.addAction("snapToGrid",function(){q.snapCellsToGrid(q.getSelectionCells(),q.gridSize)});this.addAction("formattedText",
function(){q.stopEditing();var E=q.getCommonStyle(q.getSelectionCells());E="1"==mxUtils.getValue(E,"html","0")?null:"1";q.getModel().beginUpdate();try{for(var Q=q.getEditableCells(q.getSelectionCells()),c=0;c<Q.length;c++)if(state=q.getView().getState(Q[c]),null!=state){var g=mxUtils.getValue(state.style,"html","0");if("1"==g&&null==E)q.removeTextStyleForCell(state.cell),q.setCellStyles("html",E,[Q[c]]);else if("0"==g&&"1"==E){var m=mxUtils.htmlEntities(q.convertValueToString(state.cell),!1);"0"!=
mxUtils.getValue(state.style,"nl2Br","1")&&(m=m.replace(/\n/g,"<br/>"));q.cellLabelChanged(state.cell,Graph.sanitizeHtml(m));q.setCellStyles("html",E,[Q[c]])}}u.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=E?E:"0"],"cells",Q))}finally{q.getModel().endUpdate()}});this.addAction("wordWrap",function(){var E=q.getView().getState(q.getSelectionCell()),Q="wrap";q.stopEditing();null!=E&&"wrap"==E.style[mxConstants.STYLE_WHITE_SPACE]&&(Q=null);q.setCellStyles(mxConstants.STYLE_WHITE_SPACE,
Q)});this.addAction("rotation",function(){var E="0",Q=q.getView().getState(q.getSelectionCell());null!=Q&&(E=Q.style[mxConstants.STYLE_ROTATION]||E);E=new FilenameDialog(u,E,mxResources.get("apply"),function(c){null!=c&&0<c.length&&q.setCellStyles(mxConstants.STYLE_ROTATION,c)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");u.showDialog(E.container,375,80,!0,!0);E.init()});this.addAction("resetView",function(){q.zoomTo(1);u.resetScrollbars()},null,null,"Enter/Home");this.addAction("zoomIn",
function(E){q.isFastZoomEnabled()?q.lazyZoom(!0,!0,u.buttonZoomDelay):q.zoomIn()},null,null,Editor.ctrlKey+" + / Alt+Mousewheel");this.addAction("zoomOut",function(E){q.isFastZoomEnabled()?q.lazyZoom(!1,!0,u.buttonZoomDelay):q.zoomOut()},null,null,Editor.ctrlKey+" - / Alt+Mousewheel");this.addAction("fitWindow",function(){q.pageVisible&&q.isSelectionEmpty()?q.fitPages():u.fitDiagramToWindow()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+H");this.addAction("fitPage",mxUtils.bind(this,function(){q.pageVisible?
q.fitPages(1):this.get("pageView").funct()}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){q.pageVisible?q.fitPages(2):this.get("pageView").funct()}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){q.pageVisible?q.fitPages(1,!0):this.get("pageView").funct()}));this.put("customZoom",new Action("custom...",mxUtils.bind(this,function(){var E=new FilenameDialog(this.editorUi,parseInt(100*q.getView().getScale()),
mxResources.get("apply"),mxUtils.bind(this,function(Q){Q=parseInt(Q);!isNaN(Q)&&0<Q&&q.zoomTo(Q/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(E.container,300,80,!0,!0);E.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var E=new FilenameDialog(this.editorUi,parseInt(100*q.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(Q){Q=parseInt(Q);!isNaN(Q)&&0<Q&&(Q=new ChangePageSetup(u,null,null,null,Q/100),Q.ignoreColor=!0,
Q.ignoreImage=!0,q.model.execute(Q))}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(E.container,300,80,!0,!0);E.init()}));H=null;H=this.addAction("grid",function(){q.setGridEnabled(!q.isGridEnabled());q.defaultGridEnabled=q.isGridEnabled();u.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+G");H.setToggleAction(!0);H.setSelectedCallback(function(){return q.isGridEnabled()});H.setEnabled(!1);H=this.addAction("guides",function(){q.graphHandler.guidesEnabled=
!q.graphHandler.guidesEnabled;u.fireEvent(new mxEventObject("guidesEnabledChanged"))});H.setToggleAction(!0);H.setSelectedCallback(function(){return q.graphHandler.guidesEnabled});H.setEnabled(!1);H=this.addAction("animations",function(){Editor.enableAnimations=!Editor.enableAnimations;u.fireEvent(new mxEventObject("enableAnimationsChanged"))});H.setToggleAction(!0);H.setSelectedCallback(function(){return Editor.enableAnimations});H=this.addAction("tooltips",function(){q.tooltipHandler.setEnabled(!q.tooltipHandler.isEnabled());
u.fireEvent(new mxEventObject("tooltipsEnabledChanged"))});H.setToggleAction(!0);H.setSelectedCallback(function(){return q.tooltipHandler.isEnabled()});H=this.addAction("collapseExpand",function(){var E=new ChangePageSetup(u);E.ignoreColor=!0;E.ignoreImage=!0;E.foldingEnabled=!q.foldingEnabled;q.model.execute(E)});H.setToggleAction(!0);H.setSelectedCallback(function(){return q.foldingEnabled});H.isEnabled=B;H=this.addAction("pageView",mxUtils.bind(this,function(){u.setPageVisible(!q.pageVisible)}));
H.setToggleAction(!0);H.setSelectedCallback(function(){return q.pageVisible});H=this.addAction("connectionArrows",function(){q.connectionArrowsEnabled=!q.connectionArrowsEnabled;u.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,Editor.altKey+"+"+Editor.shiftKey+"+A");H.setToggleAction(!0);H.setSelectedCallback(function(){return q.connectionArrowsEnabled});H=this.addAction("connectionPoints",function(){q.setConnectable(!q.connectionHandler.isEnabled());u.fireEvent(new mxEventObject("connectionPointsChanged"))},
null,null,Editor.altKey+"+"+Editor.shiftKey+"+O");H.setToggleAction(!0);H.setSelectedCallback(function(){return q.connectionHandler.isEnabled()});H=this.addAction("copyConnect",function(){q.connectionHandler.setCreateTarget(!q.connectionHandler.isCreateTarget());u.fireEvent(new mxEventObject("copyConnectChanged"))});H.setToggleAction(!0);H.setSelectedCallback(function(){return q.connectionHandler.isCreateTarget()});H.isEnabled=B;H=this.addAction("autosave",function(){u.editor.setAutosave(!u.editor.autosave)});
H.setToggleAction(!0);H.setSelectedCallback(function(){return u.editor.autosave});H.isEnabled=B;H.visible=!1;this.addAction("help",function(){var E="";mxResources.isLanguageSupported(mxClient.language)&&(E="_"+mxClient.language);q.openLink(RESOURCES_PATH+"/help"+E+".html")});var S=!1;H=new Action("about",function(){S||(u.showDialog((new AboutDialog(u)).container,320,280,!0,!0,function(){S=!1}),S=!0)});H.getTitle=function(){return mxResources.get("about")+" Graph Editor..."};this.put("about",H);H=
mxUtils.bind(this,function(E,Q,c,g){return this.addAction(E,function(){if(null!=c&&q.cellEditor.isContentEditing())c();else{q.stopEditing(!1);q.getModel().beginUpdate();try{var m=q.getEditableCells(q.getSelectionCells());q.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,Q,m);(Q&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?q.updateLabelElements(m,function(x){x.style.fontWeight=null;"B"==x.nodeName&&q.replaceElement(x)}):(Q&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?q.updateLabelElements(m,
function(x){x.style.fontStyle=null;"I"==x.nodeName&&q.replaceElement(x)}):(Q&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&q.updateLabelElements(m,function(x){x.style.textDecoration=null;"U"==x.nodeName&&q.replaceElement(x)});for(var n=0;n<m.length;n++)0==q.model.getChildCount(m[n])&&q.autoSizeCell(m[n],!1)}finally{q.getModel().endUpdate()}}},null,null,g)});H("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");H("italic",mxConstants.FONT_ITALIC,
function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I");H("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){u.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000","default",q.shapeForegroundColor)});this.addAction("strokeColor...",function(){u.menus.pickColor(mxConstants.STYLE_STROKECOLOR,null,null,"default",q.shapeForegroundColor)});this.addAction("fillColor...",function(){u.menus.pickColor(mxConstants.STYLE_FILLCOLOR,
null,null,"default",q.shapeBackgroundColor)});this.addAction("gradientColor...",function(){u.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR,null,null,"default",q.shapeForegroundColor)});this.addAction("backgroundColor...",function(){u.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor",null,"default",q.shapeBackgroundColor)});this.addAction("borderColor...",function(){u.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR,null,null,"default",q.shapeForegroundColor)});this.addAction("removeFormat",
function(){if(q.isEnabled()&&!q.isSelectionEmpty()&&!q.isEditing()){q.getModel().beginUpdate();try{for(var E=q.getSelectionCells(),Q=0;Q<E.length;Q++)q.removeTextStyleForCell(E[Q],!0)}finally{q.getModel().endUpdate()}}});this.addAction("vertical",function(){u.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){u.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){q.getModel().beginUpdate();try{q.setCellStyles(mxConstants.STYLE_DASHED,
null),q.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),u.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",q.getSelectionCells()))}finally{q.getModel().endUpdate()}});this.addAction("dashed",function(){q.getModel().beginUpdate();try{q.setCellStyles(mxConstants.STYLE_DASHED,"1"),q.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),u.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,
mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",q.getSelectionCells()))}finally{q.getModel().endUpdate()}});this.addAction("dotted",function(){q.getModel().beginUpdate();try{q.setCellStyles(mxConstants.STYLE_DASHED,"1"),q.setCellStyles(mxConstants.STYLE_DASH_PATTERN,"1 4"),u.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],"cells",q.getSelectionCells()))}finally{q.getModel().endUpdate()}});this.addAction("sharp",
function(){q.getModel().beginUpdate();try{q.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),q.setCellStyles(mxConstants.STYLE_CURVED,"0"),u.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","0"],"cells",q.getSelectionCells()))}finally{q.getModel().endUpdate()}});this.addAction("rounded",function(){q.getModel().beginUpdate();try{q.setCellStyles(mxConstants.STYLE_ROUNDED,"1"),q.setCellStyles(mxConstants.STYLE_CURVED,"0"),u.fireEvent(new mxEventObject("styleChanged",
"keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",q.getSelectionCells()))}finally{q.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!q.isSelectionEmpty()&&q.isEnabled()){q.getModel().beginUpdate();try{var E=q.getSelectionCells(),Q=q.getCurrentCellStyle(E[0]),c="1"==mxUtils.getValue(Q,mxConstants.STYLE_ROUNDED,"0")?"0":"1";q.setCellStyles(mxConstants.STYLE_ROUNDED,c);q.setCellStyles(mxConstants.STYLE_CURVED,null);u.fireEvent(new mxEventObject("styleChanged",
"keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[c,"0"],"cells",q.getSelectionCells()))}finally{q.getModel().endUpdate()}}});this.addAction("curved",function(){q.getModel().beginUpdate();try{q.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),q.setCellStyles(mxConstants.STYLE_CURVED,"1"),u.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",q.getSelectionCells()))}finally{q.getModel().endUpdate()}});this.addAction("collapsible",
function(){var E=q.view.getState(q.getSelectionCell()),Q="1";null!=E&&null!=q.getFoldingImage(E)&&(Q="0");q.setCellStyles("collapsible",Q);u.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[Q],"cells",q.getSelectionCells()))});this.addAction("editStyle...",mxUtils.bind(this,function(){var E=q.getEditableCells(q.getSelectionCells());if(null!=E&&0<E.length){var Q=q.getModel();Q=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",Q.getStyle(E[0])||"",function(c){null!=
c&&q.setCellStyle(mxUtils.trim(c),E)},null,null,400,220);this.editorUi.showDialog(Q.container,420,300,!0,!0);Q.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){q.isEnabled()&&!q.isSelectionEmpty()&&u.setDefaultStyle(q.getSelectionCell())},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+D");this.addAction("clearDefaultStyle",function(){q.isEnabled()&&u.clearDefaultStyle()},null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+R");this.addAction("addWaypoint",function(){var E=
q.getSelectionCell();if(null!=E&&q.getModel().isEdge(E)){var Q=y.graph.selectionCellsHandler.getHandler(E);if(Q instanceof mxEdgeHandler){var c=0,g=0;E=q.getModel().getParent(E);for(var m=q.getCellGeometry(E);q.getModel().isVertex(E)&&null!=m;)c+=m.x,g+=m.y,E=q.getModel().getParent(E),m=q.getCellGeometry(E);E=q.popupMenuHandler.getTriggerPoint();c=Math.round(q.snap(E.x-c));g=Math.round(q.snap(E.y-g));Q.addPointAt(Q.state,c,g)}}});this.addAction("removeWaypoint",function(){var E=u.actions.get("removeWaypoint");
null!=E.handler&&E.handler.removePoint(E.handler.state,E.index)});this.addAction("clearAnchors",function(){var E=q.getSelectionCells();if(null!=E){E=q.getEditableCells(q.addAllEdges(E));q.getModel().beginUpdate();try{for(var Q=0;Q<E.length;Q++){var c=E[Q];q.getModel().isEdge(c)&&(q.setCellStyles(mxConstants.STYLE_EXIT_X,null,[c]),q.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[c]),q.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[c]),q.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[c]))}}finally{q.getModel().endUpdate()}}});
this.addAction("clearWaypoints",function(){var E=q.getSelectionCells();if(null!=E){E=q.getEditableCells(q.addAllEdges(E));q.getModel().beginUpdate();try{for(var Q=0;Q<E.length;Q++){var c=E[Q];if(q.getModel().isEdge(c)){var g=q.getCellGeometry(c);null!=g&&(g=g.clone(),g.points=null,g.x=0,g.y=0,g.offset=null,q.getModel().setGeometry(c,g))}}}finally{q.getModel().endUpdate()}}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+R");H=this.addAction("subscript",mxUtils.bind(this,function(){q.cellEditor.isContentEditing()&&
document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");H=this.addAction("superscript",mxUtils.bind(this,function(){q.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");H=this.addAction("decreaseFontSize",mxUtils.bind(this,function(){if(!q.isSelectionEmpty()){var E=q.getCurrentCellStyle(q.getSelectionCell());E=mxUtils.getValue(E,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);q.setCellStyles(mxConstants.STYLE_FONTSIZE,
Math.max(1,E-1),q.getSelectionCells())}}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+" + (Numpad)");H=this.addAction("increaseFontSize",mxUtils.bind(this,function(){if(!q.isSelectionEmpty()){var E=q.getCurrentCellStyle(q.getSelectionCell());E=mxUtils.getValue(E,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);q.setCellStyles(mxConstants.STYLE_FONTSIZE,Math.min(100,E+1),q.getSelectionCells())}}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+" - (Numpad)");this.addAction("image...",function(){if(q.isEnabled()&&
!q.isCellLocked(q.getDefaultParent())){var E=mxResources.get("image")+" ("+mxResources.get("url")+"):",Q=q.getView().getState(q.getSelectionCell()),c="",g=null;null!=Q&&(c=Q.style[mxConstants.STYLE_IMAGE]||c,g=Q.style[mxConstants.STYLE_CLIP_PATH]||g);var m=q.cellEditor.saveSelection();u.showImageDialog(E,c,function(n,x,F,I,M,L){if(q.cellEditor.isContentEditing())q.cellEditor.restoreSelection(m),q.insertImage(n,x,F);else{var K=q.getSelectionCells();if(null!=n&&(0<n.length||0<K.length)){var aa=null;
q.getModel().beginUpdate();try{if(0==K.length){K=[q.insertVertex(q.getDefaultParent(),null,"",0,0,x,F,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];var ja=q.getCenterInsertPoint(q.getBoundingBoxFromGeometry(K,!0));K[0].geometry.x=ja.x;K[0].geometry.y=ja.y;null!=I&&l(K[0],I,M,L,q);aa=K;q.fireEvent(new mxEventObject("cellsInserted","cells",aa))}q.setCellStyles(mxConstants.STYLE_IMAGE,0<n.length?n:null,K);var ca=q.getCurrentCellStyle(K[0]);"image"!=ca[mxConstants.STYLE_SHAPE]&&
"label"!=ca[mxConstants.STYLE_SHAPE]?q.setCellStyles(mxConstants.STYLE_SHAPE,"image",K):0==n.length&&q.setCellStyles(mxConstants.STYLE_SHAPE,null,K);null==I&&q.setCellStyles(mxConstants.STYLE_CLIP_PATH,null,K);if(null!=x&&null!=F)for(n=0;n<K.length;n++){var ba=K[n];if("0"!=q.getCurrentCellStyle(ba).expand){var oa=q.getModel().getGeometry(ba);null!=oa&&(oa=oa.clone(),oa.width=x,oa.height=F,q.getModel().setGeometry(ba,oa))}null!=I&&l(ba,I,M,L,q)}}finally{q.getModel().endUpdate()}null!=aa&&(q.setSelectionCells(aa),
q.scrollCellToVisible(aa[0]))}}},q.cellEditor.isContentEditing(),!q.cellEditor.isContentEditing(),!0,g)}}).isEnabled=B;this.addAction("crop...",function(){var E=q.getSelectionCell();if(q.isEnabled()&&!q.isCellLocked(q.getDefaultParent())&&null!=E){var Q=q.getCurrentCellStyle(E),c=Q[mxConstants.STYLE_IMAGE],g=Q[mxConstants.STYLE_SHAPE];c&&"image"==g&&(Q=new CropImageDialog(u,c,Q[mxConstants.STYLE_CLIP_PATH],function(m,n,x){l(E,m,n,x,q)}),u.showDialog(Q.container,300,390,!0,!0))}}).isEnabled=B;H=this.addAction("layers",
mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(u,document.body.offsetWidth-280,120,212,200),this.layersWindow.window.addListener("show",mxUtils.bind(this,function(){u.fireEvent(new mxEventObject("layers"))})),this.layersWindow.window.addListener("hide",function(){u.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),u.fireEvent(new mxEventObject("layers")),this.layersWindow.init()):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),
null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+L");H.setToggleAction(!0);H.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));H=this.addAction("format",mxUtils.bind(this,function(){u.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+"+P");H.setToggleAction(!0);H.setSelectedCallback(mxUtils.bind(this,function(){return u.isFormatPanelVisible()}));H=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?
(this.outlineWindow=new OutlineWindow(u,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",mxUtils.bind(this,function(){u.fireEvent(new mxEventObject("outline"))})),this.outlineWindow.window.addListener("hide",function(){u.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),u.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+"+Editor.shiftKey+
"+O");H.setToggleAction(!0);H.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}));this.addAction("editConnectionPoints...",function(){var E=q.getSelectionCell();if(q.isEnabled()&&!q.isCellLocked(q.getDefaultParent())&&null!=E&&null!=E.geometry){var Q=new ConnectionPointsDialog(u,E);u.showDialog(Q.container,350,450,!0,!1,function(){Q.destroy()});Q.init()}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+Q").isEnabled=B};
Actions.prototype.addAction=function(b,f,l,u,y,q){var B=b;"..."==B.substring(B.length-3)&&(B=B.substring(0,B.length-3));return this.put(B,new Action(b,f,l,u,y,q))};Actions.prototype.put=function(b,f){return this.actions[b]=f};Actions.prototype.get=function(b){return this.actions[b]};function Action(b,f,l,u,y,q){mxEventSource.call(this);this.label=b;this.funct=this.createFunction(f);this.enabled=null!=l?l:!0;this.iconCls=u;this.shortcut=y;this.visible=null!=q?q:!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")))};Action.prototype.isEnabled=function(){return this.enabled};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,f){mxEventSource.call(this);this.ui=b;this.setData(f||"");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.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(){null==this.shadowPages&&(this.shadowPages=this.ui.getPagesForXml(this.initialData));return this.shadowPages};DrawioFile.prototype.setShadowPages=function(b){this.shadowPages=b};
DrawioFile.prototype.synchronizeFile=function(b,f){if(this.savingFile)null!=f&&f({message:mxResources.get("busy")});else{var l=!0,u=window.setTimeout(mxUtils.bind(this,function(){l=!1;null!=f&&f({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:mxUtils.bind(this,function(){this.synchronizeFile(b,f)})})}),this.ui.timeout),y=mxUtils.bind(this,function(B){l&&(window.clearTimeout(u),null!=f&&f(B))}),q=mxUtils.bind(this,function(){return!l});null!=this.sync?this.sync.fileChanged(mxUtils.bind(this,
function(B){l&&(window.clearTimeout(u),this.sync.cleanup(b,f,B))}),y,q):this.updateFile(mxUtils.bind(this,function(){l&&(window.clearTimeout(u),null!=b&&b())}),y,q)}};
DrawioFile.prototype.updateFile=function(b,f,l,u,y){null!=l&&l()||(EditorUi.debug("DrawioFile.updateFile",[this],"immediate",y,"invalidChecksum",this.invalidChecksum),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=f&&f():this.getLatestVersion(mxUtils.bind(this,function(q){try{null!=l&&l()||(EditorUi.debug("DrawioFile.updateFile",[this],"invalidChecksum",this.invalidChecksum,"latestFile",[q]),this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=f&&f():null!=q?this.mergeFile(q,b,f,
u,y):this.reloadFile(b,f))}catch(B){null!=f&&f(B)}}),f))};
DrawioFile.prototype.mergeFile=function(b,f,l,u,y){try{var q=b.getShadowPages();if(null!=q&&0<q.length){var B=this.getShadowPages(),H=[this.ui.diffPages(null!=u?u:B,q)],S=this.ignorePatches(H);if(S)this.inConflictState=this.invalidChecksum=!1,this.setDescriptor(b.getDescriptor()),this.descriptorChanged(),EditorUi.debug("File.mergeFile",[this],"file",[b],"ignored",S),null!=f&&f();else try{this.stats.fileMerged++;null!=this.sync&&this.sync.sendLocalChanges();var E=this.isModified()?this.ui.diffPages(B,
this.isRealtime()?this.ownPages:this.ui.pages):null,Q=this.ui.patchPages(this.ui.clonePages(B),H[0]),c=this.ui.getHashValueForPages(Q,{}),g=this.ui.getHashValueForPages(q,{});EditorUi.debug("File.mergeFile",[this],"file",[b],"ui",this.ui.pages,"shadow",B,"pages",q,"patched",Q,"patches",H,"changes",E,"checksum",c,"current",g,"valid",c==g,"from",this.getCurrentRevisionId(),"to",b.getCurrentRevisionId(),"modified",this.isModified(),"immediate",y);if(null!=c&&c!=g)this.checksumError(l,H,null,null,"mergeFile",
c,g,b.getCurrentRevisionId());else{this.setShadowPages(q);if(null!=this.sync){var m=this.sync.patchRealtime(H,DrawioFile.LAST_WRITE_WINS?E:null,null,y);null==m||mxUtils.isEmptyObject(m)||H.push(m)}this.patch(H,DrawioFile.LAST_WRITE_WINS?E:null);this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(b.getDescriptor());this.descriptorChanged();null!=f&&f()}}catch(F){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=l&&l(F);try{var n=this.getCurrentUser(),x=null!=n?
n.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),x,F)}catch(I){}}}else throw Error(mxResources.get("notADiagramFile"));}catch(F){null!=l&&l(F)}};
DrawioFile.prototype.getAnonymizedXmlForPages=function(b){var f=new mxCodec(mxUtils.createXmlDocument()),l=f.document.createElement("mxfile");if(null!=b)for(var u=0;u<b.length;u++){var y=f.encode(new mxGraphModel(b[u].root));"1"!=urlParams.dev&&(y=this.ui.anonymizeNode(y,!0));y.setAttribute("id",b[u].getId());b[u].viewState&&this.ui.editor.graph.saveViewState(b[u].viewState,y,!0);l.appendChild(y)}return mxUtils.getPrettyXml(l)};
DrawioFile.prototype.compressReportData=function(b,f,l){f=null!=f?f:1E4;null!=l&&null!=b&&b.length>l?b=b.substring(0,l)+"[...]":null!=b&&b.length>f&&(b=Graph.compress(b)+"\n");return b};
DrawioFile.prototype.checksumError=function(b,f,l,u,y,q,B,H){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var S=this.getCurrentUser(),E=null!=S?S.id:"unknown",Q=""!=this.getId()?this.getId():"("+this.ui.hashValue(this.getTitle())+")",c=JSON.stringify(f).length,g=null;if(null!=f&&1E3>c){b=[];for(l=0;l<f.length;l++)b.push(this.ui.anonymizePatch(f[l]));g=JSON.stringify(b);g=null!=g&&1E3>
g.length?Graph.compress(g):null}this.getLatestVersion(mxUtils.bind(this,function(m){try{var n=null!=g?"report":"error",x=this.ui.getHashValueForPages(m.getShadowPages()),F="unknown",I="unknown",M="unknown";try{var L=null!=m.initialData&&0<m.initialData.length?mxUtils.parseXml(m.initialData).documentElement:null;null!=L&&(null!=L.getAttribute("version")&&(F=L.getAttribute("version")),null!=L.getAttribute("agent")&&(I=L.getAttribute("agent")),null!=L.getAttribute("type")&&(M=L.getAttribute("type")))}catch(K){}EditorUi.logError("Checksum "+
n+" in "+y,null,this.getMode()+"."+Q,"user_"+E+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+c+"-patches_"+f.length+(null!=g?"-json_"+g:"")+"-size_"+this.getSize()+(null!=q?"-expected_"+q:"")+(null!=B?"-current_"+B:"")+(null!=H?"-rev_"+this.ui.hashValue(H):"")+(null!=x?"-latest_"+x:"")+"-latestRev_"+this.ui.hashValue(m.getCurrentRevisionId())+("-latestVersion_"+F)+("-latestAgent_"+I)+("-latestType_"+M));EditorUi.logEvent({category:"CHECKSUM-ERROR-SYNC-FILE-"+Q,action:y,label:"user_"+
E+(null!=this.sync?"-client_"+this.sync.clientId:"-nosync")+"-bytes_"+c+"-patches_"+f.length+"-size_"+this.getSize()})}catch(K){}}),function(){})}catch(m){}};
DrawioFile.prototype.sendErrorReport=function(b,f,l,u){try{var y=this.compressReportData(this.getAnonymizedXmlForPages(this.getShadowPages()),25E3),q=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),B=this.getCurrentUser(),H=null!=B?this.ui.hashValue(B.id):"unknown",S=null!=this.sync?"-client_"+this.sync.clientId:"-nosync",E=this.getTitle(),Q=E.lastIndexOf(".");B="xml";0<Q&&(B=E.substring(Q));var c=null!=l?l.stack:Error().stack;EditorUi.sendReport(b+" "+(new Date).toISOString()+
":\n\nAppVersion="+navigator.appVersion+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+B+")\nUser="+H+S+"\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=f?"\n\n"+f:
"")+(null!=l?"\n\nError: "+l.message:"")+"\n\nStack:\n"+c+"\n\nShadow:\n"+y+"\n\nData:\n"+q,u)}catch(g){}};
DrawioFile.prototype.reloadFile=function(b,f){try{this.stats.fileReloaded++;var l=this.ui.diffPages(this.getShadowPages(),this.isRealtime()?this.ownPages:this.ui.pages),u=this.ui.editor.graph,y=u.getSelectionCells(),q=u.getViewState(),B=this.ui.currentPage;this.getLatestVersion(mxUtils.bind(this,function(H){EditorUi.debug("DrawioFile.reloadFile",[this],"modified",this.isModified(),"rev",this.getCurrentRevisionId(),"changes",[l],"viewState",[q],"latestFile",H);null!=H?(this.ui.replaceFileData(H.getData(),
[l]),this.ui.restoreViewState(B,q,y),this.setDescriptor(H.getDescriptor()),this.descriptorChanged(),null!=b&&b()):(this.ui.spinner.stop(),this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){var S=this.ui.getCurrentFile();null!=S&&(S.stats=this.stats,S.patch([l]),S.fileChanged());this.ui.restoreViewState(B,q,y);null!=b&&b()}else null!=f&&f(this.ui.fileLoadedError)}),!0))}),f)}catch(H){null!=f&&f(H)}};
DrawioFile.prototype.copyFile=function(b,f){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};DrawioFile.prototype.ignorePatches=function(b){var f=!0;if(null!=b)for(var l=0;l<b.length&&f;l++)f=f&&mxUtils.isEmptyObject(b[l]);return f};
DrawioFile.prototype.patch=function(b,f,l,u){if(null!=b){var y=this.ui.editor.undoManager,q=y.history.slice(),B=y.indexOfNextAdd,H=this.ui.editor.graph;H.container.style.visibility="hidden";var S=this.changeListenerEnabled;this.changeListenerEnabled=l;var E=H.foldingEnabled,Q=H.mathEnabled,c=H.cellRenderer.redraw;H.cellRenderer.redraw=function(I){I.view.graph.isEditing(I.cell)&&(I.view.graph.scrollCellToVisible(I.cell),I.view.graph.cellEditor.resize());c.apply(this,arguments)};H.model.beginUpdate();
try{if(l){for(var g=this.ui.pages.slice(),m=this.ui.currentPage,n=this.ui.applyPatches(this.ui.pages,b,!0,f,this.isModified()),x=0;x<n.length;x++){var F=mxUtils.indexOf(this.ui.pages,n[x]);0>F?this.ui.insertPage(n[x],Math.min(x,this.ui.pages.length)):this.ui.movePage(F,x)}for(x=0;x<g.length;x++)0>mxUtils.indexOf(n,g[x])&&this.ui.removePage(g[x]);0<=mxUtils.indexOf(this.ui.pages,m)&&this.ui.selectPage(m,!0)}else this.ui.pages=this.ui.applyPatches(this.ui.pages,b,!0,f,this.isModified());0==this.ui.pages.length&&
this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0);H.checkDefaultParent()}finally{H.container.style.visibility="";H.model.endUpdate();H.cellRenderer.redraw=c;this.changeListenerEnabled=S;l||(y.history=q,y.indexOfNextAdd=B,y.fireEvent(new mxEventObject(mxEvent.CLEAR)));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)Q!=H.mathEnabled?(this.ui.editor.updateGraphComponents(),H.refresh()):(E!=H.foldingEnabled?
H.view.revalidate():H.view.validate(),H.sizeDidChange());null!=this.sync&&this.isRealtime()&&!u&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages));this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",[this],"patches",b,"resolver",f,"undoable",l)}return b};
DrawioFile.prototype.save=function(b,f,l,u,y,q){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",u,"overwrite",y,"manual",q,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!y&&this.invalidChecksum)if(null!=l)l({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=f&&f();else if(null!=l)l({message:mxResources.get("readOnly")});
else throw Error(mxResources.get("readOnly"));}catch(B){if(null!=l)l(B);else throw B;}};DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var f=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=f&&(f.viewState=this.ui.editor.graph.getViewState(),f.needsUpdate=!0)}f=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return f};
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,f,l){};DrawioFile.prototype.saveFile=function(b,f,l,u){};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,f,l){};DrawioFile.prototype.isMovable=function(){return!1};DrawioFile.prototype.isTrashed=function(){return!1};DrawioFile.prototype.move=function(b,f,l){};
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 f=this.ui.editor.graph,l=f.getSelectionCells(),u=f.getViewState(),y=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(y,
u,l);this.ui.actions.get("share").funct()}))}))}),null,mxResources.get("saveToGoogleDrive",null,"Save to Google Drive"),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 f=0;null!=b&&f<b.length;f++){var l=b[f];null!=l.id&&0==l.id.indexOf("extFont_")&&l.parentNode.removeChild(l)}};
DrawioFile.prototype.open=function(){this.stats.opened++;var b=this.getData();null!=b&&(this.ui.setFileData(b),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,f){b(null)};
DrawioFile.prototype.loadDescriptor=function(b,f){b(null)};DrawioFile.prototype.loadPatchDescriptor=function(b,f){this.loadDescriptor(mxUtils.bind(this,function(l){b(l)}),f)};DrawioFile.prototype.patchDescriptor=function(b,f){this.setDescriptorEtag(b,this.getDescriptorEtag(f));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,f){b(null)};DrawioFile.prototype.getLatestVersionId=function(b,f){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,f){this.setDescriptorEtag(b,f)};DrawioFile.prototype.getDescriptorRevisionId=function(b){return this.getDescriptorEtag(b)};DrawioFile.prototype.setDescriptorEtag=function(b,f){};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,f){b=null!=f?f.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 f=this.isRevisionHistorySupported()&&b!=mxUtils.htmlEntities(mxResources.get(this.savingStatusKey))+"..."?'data-action="revisionHistory" ':"";this.ui.editor.setStatus("<div "+f+'title="'+b+'">'+b+(this.isLocked()?' <img class="geToolbarButton" data-action="properties" style="margin-left:4px;flex-shrink:0;" src="'+
Editor.lockedImage+'"/>':"")+"</div>")}};
DrawioFile.prototype.saveDraft=function(b){try{null==this.draftId&&(this.draftId=null!=this.usedDraftId?this.usedDraftId:Editor.guid());var f={type:"draft",created:this.created,modified:(new Date).getTime(),data:null!=b?b:this.ui.getFileData(),title:this.getTitle(),fileObject:this.fileObject,aliveCheck:this.ui.draftAliveCheck};this.ui.setDatabaseItem(".draft_"+this.draftId,JSON.stringify(f));EditorUi.debug("DrawioFile.saveDraft",[this],"draftId",this.draftId,[f])}catch(l){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 f=mxUtils.htmlEntities(mxResources.get("unsavedChanges"));this.ui.editor.setStatus('<div title="'+f+'" data-title="'+mxUtils.htmlEntities(mxResources.get("unsavedChanges"))+'" data-message="'+mxUtils.htmlEntities(b.message)+'" class="geStatusAlert">'+f+" ("+mxUtils.htmlEntities(b.message)+
")</div>")})):(this.ui.updateStatus(mxUtils.bind(this,function(){var f=this.getErrorMessage(b);if(null==f&&null!=this.lastSaved){var l=this.ui.timeSince(new Date(this.lastSaved));null!=l&&(f=mxResources.get("lastSaved",[l]))}null!=f&&60<f.length&&(f=f.substring(0,60)+"...");f=mxUtils.htmlEntities(mxResources.get("unsavedChangesClickHereToSave"))+(null!=f&&""!=f?" ("+mxUtils.htmlEntities(f)+")":"");l='data-action="'+(null!=this.ui.mode&&this.isEditable()?"save":"saveAs")+'"';this.ui.editor.setStatus("<div "+
l+' title="'+f+'" class="geStatusAlert">'+f+"</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,f){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)+")":""),f)}));this.ui.spinner.stop();this.clearAutosave()};
DrawioFile.prototype.setConflictStatus=function(b,f){this.ui.editor.setStatus('<div title="'+b+'" '+(null!=f?'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>',f)};
DrawioFile.prototype.showRefreshDialog=function(b,f,l){null==l&&(l=mxResources.get("checksum"));this.ui.editor.isChromelessView()&&!this.ui.editor.editable?this.ui.alert(mxResources.get("fileChangedSync"),mxUtils.bind(this,function(){this.reloadFile(b,f)})):(this.addConflictStatus(l,mxUtils.bind(this,function(){this.showRefreshDialog(b,f)})),this.ui.showError(mxResources.get("warning")+" ("+l+")",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"))}),f)}),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!=f&&f()}))}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),380,130))};
DrawioFile.prototype.showCopyDialog=function(b,f,l){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,f)}),null,mxResources.get("overwrite"),l,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),380,150)};
DrawioFile.prototype.showConflictDialog=function(b,f){this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedSyncDialog"),mxResources.get("overwrite"),b,null,mxResources.get("merge"),f,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog();this.handleFileError(null,!1)}),380,130)};
DrawioFile.prototype.redirectToNewApp=function(b,f){this.ui.spinner.stop();if(!this.redirectDialogShowing){this.redirectDialogShowing=!0;var l=window.location.protocol+"//"+window.location.host+"/"+this.ui.getSearch("create title mode url drive splash state".split(" "))+"#"+this.getHash(),u=mxResources.get("redirectToNewApp");null!=f&&(u+=" ("+f+")");f=mxUtils.bind(this,function(){var y=mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href==l?window.location.reload():window.location.href=
l});null==b&&this.isModified()?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.redirectDialogShowing=!1}),y,mxResources.get("cancel"),mxResources.get("discardChanges")):y()});null!=b?this.isModified()?this.ui.confirm(u,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;b()}),f,mxResources.get("cancel"),mxResources.get("discardChanges")):this.ui.confirm(u,f,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;b()})):this.ui.alert(mxResources.get("redirectToNewApp"),
f)}};
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,f){this.ui.spinner.stop();this.ui.getCurrentFile()==this&&(this.inConflictState?this.handleConflictError(b,f):(this.isModified()&&this.addUnsavedStatus(b),f?this.ui.handleError(b,null!=b?mxResources.get("errorSavingFile"):null):this.isModified()||this.ui.updateStatus(mxUtils.bind(this,function(){var l=this.getErrorMessage(b);null!=l&&60<l.length&&(l=l.substring(0,60)+"...");this.ui.editor.setStatus('<div class="geStatusAlert">'+mxUtils.htmlEntities(mxResources.get("error"))+
(null!=l?" ("+mxUtils.htmlEntities(l)+")":"")+"</div>")}))))};
DrawioFile.prototype.handleConflictError=function(b,f){var l=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),u=mxUtils.bind(this,function(B){this.handleFileError(B,!0)}),y=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get(this.savingSpinnerKey))&&(this.ui.clearStatus(),this.save(!0,l,u,null,!0,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage))}),q=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,l,u,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==b?null:b.commitMessage)}),u)});"none"==DrawioFile.SYNC?this.showCopyDialog(l,u,y):this.invalidChecksum&&f?this.showRefreshDialog(l,u,this.getErrorMessage(b)):f?this.showConflictDialog(y,q):this.addConflictStatus(this.getErrorMessage(b),mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));
this.synchronizeFile(l,u)}))};DrawioFile.prototype.getErrorMessage=function(b){var f=null!=b?null!=b.error?b.error.message:b.message:null;null==f&&null!=b&&b.code==App.ERROR_TIMEOUT?f=mxResources.get("timeout"):"0"==f&&(f=mxResources.get("noResponse"));return f};DrawioFile.prototype.isOverdue=function(){return null!=this.ageStart&&Date.now()-this.ageStart.getTime()>=this.ui.warnInterval};
DrawioFile.prototype.compressionChanged=function(b){var f=null!=this.ownPages?this.ownPages:this.ui.pages;if(null!=f)for(var l=0;l<f.length;l++){var u=f[l].node;if(null!=u&&(null==this.ui.currentPage||this.ui.currentPage.getId()!=f[l].getId())){var y=u.getElementsByTagName("mxGraphModel");y=0<y.length?y[0]:null;var q=Graph.decompress(mxUtils.getNodeValue(u));b?0==q.length&&null!=y&&(EditorUi.removeChildNodes(u),mxUtils.setTextContent(u,Graph.compressNode(y)),EditorUi.debug("DrawioFile.compressionChanged",
[this],"Page "+l+" compressed")):0<q.length&&null==y&&(EditorUi.removeChildNodes(u),u.appendChild(mxUtils.parseXml(q).documentElement),EditorUi.debug("DrawioFile.compressionChanged",[this],"Page "+l+" 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(f){this.ui.stopSanityCheck();null==this.autosaveThread?(this.handleFileSuccess(!0),this.ageStart=null):this.isModified()&&(this.ui.scheduleSanityCheck(),this.ageStart=this.lastChanged)}),mxUtils.bind(this,function(f){this.handleFileError(f)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus());null!=this.sync&&b&&this.sync.localFileChanged()};
DrawioFile.prototype.createSecret=function(b){var f=Editor.guid(32);Editor.enableRealtimeCache&&null!=this.sync&&!this.isOptimisticSync()?this.sync.createToken(f,mxUtils.bind(this,function(l){EditorUi.debug("DrawioFile.createSecret",[this],"secret",f,"token",l);b(f,l)}),mxUtils.bind(this,function(){b(f)})):b(f)};DrawioFile.prototype.fileSaving=function(){null!=this.sync&&this.sync.fileSaving()};
DrawioFile.prototype.fileSaved=function(b,f,l,u,y,q,B){this.lastSaved=new Date;this.ageStart=null;this.stats.saved++;try{this.invalidChecksum=this.inConflictState=!1;q=null!=q?q:this.ui.getPagesForXml(b);try{null==this.sync||this.isOptimisticSync()?(this.setShadowPages(q),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=l&&l()):this.sync.fileSaved(q,f,l,u,y,B)}catch(E){this.invalidChecksum=
this.inConflictState=!0;this.descriptorChanged();null!=u&&u(E);try{var H=this.getCurrentUser(),S=null!=H?H.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),S,E)}catch(Q){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"desc",[f],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}catch(E){this.descriptorChanged(),null!=u&&u(E)}};
DrawioFile.prototype.autosave=function(b,f,l,u){null==this.lastAutosave&&(this.lastAutosave=Date.now());var y=Date.now()-this.lastAutosave<f?b:0;this.clearAutosave();var q=window.setTimeout(mxUtils.bind(this,function(){try{if(this.lastAutosave=null,this.autosaveThread==q&&(this.autosaveThread=null),EditorUi.debug("DrawioFile.autosave",[this],"thread",q,"modified",this.isModified(),"now",this.isAutosaveNow(),"saving",this.savingFile),this.isModified()&&this.isAutosaveNow()){var B=this.isAutosaveRevision();
B&&(this.lastAutosaveRevision=(new Date).getTime());this.save(B,mxUtils.bind(this,function(H){this.autosaveCompleted();null!=l&&l(H)}),mxUtils.bind(this,function(H){null!=u&&u(H)}))}else this.isModified()||this.ui.clearStatus(),null!=l&&l(null)}catch(H){null!=u&&u(H)}}),y);this.autosaveThread=q;EditorUi.debug("DrawioFile.autosave",[this],"thread",q,"delay",b,"maxDelay",f,"actualDelay",y,"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(f){}this.stats.closed++;this.destroy()};DrawioFile.prototype.hasSameExtension=function(b,f){if(null!=b&&null!=f){var l=b.lastIndexOf(".");b=0<l?b.substring(l):"";l=f.lastIndexOf(".");return b===(0<l?f.substring(l):"")}return b==f};
DrawioFile.prototype.removeListeners=function(){null!=this.changeListener&&(this.ui.editor.graph.model.removeListener(this.changeListener),this.ui.editor.graph.removeListener(this.changeListener),this.ui.removeListener(this.changeListener),this.changeListener=null)};DrawioFile.prototype.destroy=function(){this.clearAutosave();this.removeListeners();this.stats.destroyed++;null!=this.sync&&(this.sync.destroy(),this.sync=null)};DrawioFile.prototype.commentsSupported=function(){return!1};
DrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(b,f){b([])};DrawioFile.prototype.addComment=function(b,f,l){f(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,f){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,f)};LocalFile=function(b,f,l,u,y,q,B){DrawioFile.call(this,b,f);this.title=l;this.mode=u?null:App.MODE_DEVICE;this.fileHandle=y;this.desc=q;this.editable=B};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return null!=this.fileHandle&&!this.invalidFileHandle&&DrawioFile.prototype.isAutosave.apply(this,arguments)};LocalFile.prototype.isAutosaveOptional=function(){return null!=this.fileHandle};LocalFile.prototype.getMode=function(){return this.mode};
LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.isEditable=function(){return DrawioFile.prototype.isEditable.apply(this,arguments)&&(null==this.editable||this.editable)};LocalFile.prototype.setEditable=function(b){this.editable=b;this.descriptorChanged()};LocalFile.prototype.save=function(b,f,l,u,y){this.saveAs(this.title,f,l,u,y)};LocalFile.prototype.saveAs=function(b,f,l,u,y){this.saveFile(b,!1,f,l,null,u,y)};
LocalFile.prototype.getDescriptor=function(){return this.desc};LocalFile.prototype.setDescriptor=function(b){this.desc=b};LocalFile.prototype.getLatestVersion=function(b,f){null==this.fileHandle?null!=f&&f({message:mxResources.get("cannotOpenFile")}):this.ui.loadFileSystemEntry(this.fileHandle,b,f)};
LocalFile.prototype.saveFile=function(b,f,l,u,y,q,B){b!=this.title&&(this.editable=this.desc=this.fileHandle=null);this.title=b;y||this.updateFileData();var H=Editor.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var S=this.getData(),E=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=l&&l()}),Q=mxUtils.bind(this,function(c){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=
!0;var g=mxUtils.bind(this,function(n){this.savingFile=!1;null!=u&&u({error:n})});this.saveDraft(S);this.fileHandle.createWritable().then(mxUtils.bind(this,function(n){this.fileHandle.getFile().then(mxUtils.bind(this,function(x){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[x],"conflict",this.desc.lastModified!=x.lastModified);B||this.desc.lastModified==x.lastModified?n.write(H?this.ui.base64ToBlob(c,"image/png"):c).then(mxUtils.bind(this,function(){n.close().then(mxUtils.bind(this,
function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(F){try{var I=this.desc;this.savingFile=!1;this.desc=F;this.fileSaved(S,I,E,g);this.removeDraft()}catch(M){g(M)}}),g)}),g)}),g):(this.inConflictState=!0,g())}),mxUtils.bind(this,function(x){this.invalidFileHandle=!0;g(x)}))}),g)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(c,b,H?"image/png":"text/xml",H);else if(c.length<MAX_REQUEST_SIZE){var m=b.lastIndexOf(".");m=0<m?b.substring(m+1):"xml";
(new mxXmlRequest(SAVE_URL,"format="+m+"&xml="+encodeURIComponent(c)+"&filename="+encodeURIComponent(b)+(H?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(c)}));E()}});H?(f=this.ui.getPngFileProperties(this.ui.fileNode),this.ui.getEmbeddedPng(mxUtils.bind(this,function(c){Q(c)}),u,this.ui.getCurrentFile()!=this?S:null,f.scale,f.border)):Q(S)};
LocalFile.prototype.rename=function(b,f,l){this.title=b;this.descriptorChanged();null!=f&&f()};(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.thinTableImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTcgNDFWN2gzNHYzNFptMi4yNS0yMy42aDI5LjVWOS4yNUg5LjI1Wm0xMC42IDEwLjdoOC4zdi04LjRoLTguM1ptMCAxMC42NWg4LjN2LTguNGgtOC4zWk05LjI1IDI4LjFoOC4zNXYtOC40SDkuMjVabTIxLjE1IDBoOC4zNXYtOC40SDMwLjRaTTkuMjUgMzguNzVoOC4zNXYtOC40SDkuMjVabTIxLjE1IDBoOC4zNXYtOC40SDMwLjRaIi8+PC9zdmc+";Editor.thinAddCircleImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTIzIDMzLjVoMi4yNXYtOC4yaDguMjVWMjNoLTguMjV2LTguNUgyM1YyM2gtOC41djIuM0gyM1ptMSA5LjVxLTMuOTUgMC03LjQtMS41dC02LjAyNS00LjA3NVE4IDM0Ljg1IDYuNSAzMS40VDUgMjRxMC0zLjk1IDEuNS03LjQyNVE4IDEzLjEgMTAuNTc1IDEwLjU1IDEzLjE1IDggMTYuNiA2LjVUMjQgNXEzLjk1IDAgNy40MjUgMS41UTM0LjkgOCAzNy40NSAxMC41NSA0MCAxMy4xIDQxLjUgMTYuNTc1IDQzIDIwLjA1IDQzIDI0cTAgMy45NS0xLjUgNy40dC00LjA1IDYuMDI1UTM0LjkgNDAgMzEuNDI1IDQxLjUgMjcuOTUgNDMgMjQgNDNabS4wNS0yLjI1cTYuOTUgMCAxMS44MjUtNC45IDQuODc1LTQuOSA0Ljg3NS0xMS45IDAtNi45NS00Ljg3NS0xMS44MjVRMzEgNy4yNSAyNCA3LjI1cS02Ljk1IDAtMTEuODUgNC44NzVRNy4yNSAxNyA3LjI1IDI0cTAgNi45NSA0LjkgMTEuODUgNC45IDQuOSAxMS45IDQuOVpNMjQgMjRaIi8+PC9zdmc+";
Editor.thinArrowLeftImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI4LjA1IDM1LjMgMTYuNyAyMy45NSAyOC4wNSAxMi42bDEuNiAxLjY1LTkuNyA5LjcgOS43IDkuNzVaIi8+PC9zdmc+";Editor.thinArrowRightImage="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0ibTE4Ljc1IDM1LjMtMS42LTEuNiA5LjctOS43NS05LjctOS43IDEuNi0xLjY1TDMwLjEgMjMuOTVaIi8+PC9zdmc+";Editor.thinVerticalDotsImage=
"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iNDgiIHdpZHRoPSI0OCI+PHBhdGggZD0iTTI0LjA1IDQxLjdxLTEuMjUgMC0yLjEyNS0uODc1dC0uODc1LTIuMDc1cTAtMS4yLjg3NS0yLjEuODc1LS45IDIuMDc1LS45IDEuMjUgMCAyLjEuOS44NS45Ljg1IDIuMSAwIDEuMi0uODUgMi4wNzUtLjg1Ljg3NS0yLjA1Ljg3NVptMC0xNC43NXEtMS4yNSAwLTIuMTI1LS44NzVUMjEuMDUgMjRxMC0xLjI1Ljg3NS0yLjEuODc1LS44NSAyLjA3NS0uODUgMS4yNSAwIDIuMS44NS44NS44NS44NSAyLjA1IDAgMS4yNS0uODUgMi4xMjV0LTIuMDUuODc1Wm0wLTE0LjdxLTEuMjUgMC0yLjEyNS0uODc1VDIxLjA1IDkuMjVxMC0xLjI1Ljg3NS0yLjEyNVQyNCA2LjI1cTEuMjUgMCAyLjEuODc1Ljg1Ljg3NS44NSAyLjEyNXQtLjg1IDIuMTI1cS0uODUuODc1LTIuMDUuODc1WiIvPjwvc3ZnPg==";
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.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.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.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(k){Editor.enableServiceWorker=!1}Editor.enableWebFonts=
"1"!=urlParams["safe-style-src"]&&!window.mxIsElectron;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.enableAnimations=!0;Editor.pasteAtMousePointer=!0;Editor.enableChatGpt=/test\.draw\.io$/.test(window.location.hostname)||
/preprod\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname);Editor.gptApiKey=null!=urlParams["gpt-api-key"]?decodeURIComponent(urlParams["gpt-api-key"]):null;Editor.gptModel=null!=urlParams["gpt-model"]?decodeURIComponent(urlParams["gpt-model"]):"gpt-3.5-turbo";Editor.gptUrl=null!=urlParams["gpt-url"]?decodeURIComponent(urlParams["gpt-url"]):"https://api.openai.com/v1/chat/completions";Editor.replaceSvgDataUris=
!0;Editor.foreignObjectImages=!0;Editor.svgFileTheme="auto";Editor.svgRasterScale=4;Editor.htmlRasterScale=4;Editor.config=null;Editor.configVersion=null;Editor.createInheritProperty=function(k,v){return{name:v,dispName:k,type:"bool",defVal:!1,isVisible:function(J,N){return 1==J.vertices.length?(N=N.editorUi.editor.graph.model,J=N.getParent(J.vertices[0]),N.isEdge(J)||N.isVertex(J)):!1},getValue:function(J,N){return"inherit"==mxUtils.getValue(J.style,v)},valueChanged:function(J,N,T,V){N=V.editorUi.editor.graph;
"1"==J?N.setCellStyles(v,"inherit",T.vertices):N.setCellStyles(v,null,T.vertices)}}};Editor.commonProperties=[{name:"enumerate",dispName:"Enumerate",type:"bool",defVal:!1,onChange:function(k){k.refresh()}},{name:"enumerateValue",dispName:"Enumerate Value",type:"string",defVal:"",isVisible:function(k,v){return"1"==mxUtils.getValue(k.style,"enumerate","0")}},{name:"comic",dispName:"Comic",type:"bool",defVal:!1,isVisible:function(k,v){return"1"!=mxUtils.getValue(k.style,"sketch","0")}},{name:"jiggle",
dispName:"Jiggle",type:"float",min:0,defVal:1,isVisible:function(k,v){return"1"==mxUtils.getValue(k.style,"comic","0")||"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"fillWeight",dispName:"Fill Weight",type:"int",defVal:-1,isVisible:function(k,v){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"hachureGap",dispName:"Hachure Gap",type:"int",defVal:-1,isVisible:function(k,v){return"1"==mxUtils.getValue(k.style,"sketch",
"1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"hachureAngle",dispName:"Hachure Angle",type:"int",defVal:-41,isVisible:function(k,v){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"curveFitting",dispName:"Curve Fitting",type:"float",defVal:.95,isVisible:function(k,v){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"simplification",dispName:"Simplification",type:"float",defVal:0,min:0,max:1,isVisible:function(k,
v){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"disableMultiStroke",dispName:"Disable Multi Stroke",type:"bool",defVal:!1,isVisible:function(k,v){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:"disableMultiStrokeFill",dispName:"Disable Multi Stroke Fill",type:"bool",defVal:!1,isVisible:function(k,v){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"dashOffset",dispName:"Dash Offset",
type:"int",defVal:-1,isVisible:function(k,v){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"dashGap",dispName:"Dash Gap",type:"int",defVal:-1,isVisible:function(k,v){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},{name:"zigzagOffset",dispName:"ZigZag Offset",type:"int",defVal:-1,isVisible:function(k,v){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")&&0<k.vertices.length}},
{name:"sketchStyle",dispName:"Sketch Style",type:"enum",defVal:"rough",enumList:[{val:"rough",dispName:"Rough"},{val:"comic",dispName:"Comic"}],isVisible:function(k,v){return"1"==mxUtils.getValue(k.style,"sketch","1"==urlParams.rough?"1":"0")}},{name:mxConstants.STYLE_SHADOWCOLOR,dispName:"Shadow Color",type:"color",getDefaultValue:function(){return mxConstants.SHADOWCOLOR},isVisible:function(k,v){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,
"0")}},{name:mxConstants.STYLE_SHADOW_OPACITY,dispName:"Shadow Opacity",type:"int",min:0,max:100,getDefaultValue:function(){return 100*mxConstants.SHADOW_OPACITY},isVisible:function(k,v){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_OFFSET_X,dispName:"Shadow Offset X",type:"int",getDefaultValue:function(){return mxConstants.SHADOW_OFFSET_X},isVisible:function(k,v){return"1"==mxUtils.getValue(k.style,
mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_OFFSET_Y,dispName:"Shadow Offset Y",type:"int",getDefaultValue:function(){return mxConstants.SHADOW_OFFSET_Y},isVisible:function(k,v){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:mxConstants.STYLE_SHADOW_BLUR,dispName:"Shadow Blur",type:"int",min:0,getDefaultValue:function(){return mxConstants.SHADOW_BLUR},
isVisible:function(k,v){return"1"==mxUtils.getValue(k.style,mxConstants.STYLE_SHADOW,"0")||"1"==mxUtils.getValue(k.style,mxConstants.STYLE_TEXT_SHADOW,"0")}},{name:"linecap",dispName:"Line Cap",type:"enum",defVal:null,enumList:[{val:null,dispName:"Flat"},{val:"round",dispName:"Round"},{val:"square",dispName:"Square"}]},{name:"linejoin",dispName:"Line Join",type:"enum",defVal:null,enumList:[{val:null,dispName:"Miter"},{val:"arcs",dispName:"Arcs"},{val:"bevel",dispName:"Bevel"},{val:"miter-clip",dispName:"Miter-Clip"},
{val:"round",dispName:"Round"}]},{name:"miterlimit",dispName:"Miter Limit",type:"int",min:1,defVal:4,isVisible:function(k,v){k=mxUtils.getValue(k.style,"linejoin","miter");return"miter"==k||"miter-clip"==k}}];Editor.commonEdgeProperties=[{type:"separator"},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"sourcePortConstraint",dispName:"Source Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},{val:"east",
dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"targetPortConstraint",dispName:"Target Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"jettySize",dispName:"Jetty Size",type:"int",min:0,defVal:"auto",allowAuto:!0,isVisible:function(k){return"orthogonalEdgeStyle"==mxUtils.getValue(k.style,mxConstants.STYLE_EDGE,
null)}},{name:"segment",dispName:"Segment Size",type:"int",min:0,defVal:mxConstants.ENTITY_SEGMENT,isVisible:function(k){return"entityRelationEdgeStyle"==mxUtils.getValue(k.style,mxConstants.STYLE_EDGE,null)}},{name:"fillOpacity",dispName:"Fill Opacity",type:"int",min:0,max:100,defVal:100},{name:"strokeOpacity",dispName:"Stroke Opacity",type:"int",min:0,max:100,defVal:100},{name:"startFill",dispName:"Start Fill",type:"bool",defVal:!0},{name:"startFillColor",dispName:"Start Fill Color",type:"color",
defVal:null},{name:"endFill",dispName:"End Fill",type:"bool",defVal:!0},{name:"endFillColor",dispName:"End Fill Color",type:"color",defVal:null},{name:"perimeterSpacing",dispName:"Terminal Spacing",type:"float",defVal:0},{name:"anchorPointDirection",dispName:"Anchor Direction",type:"bool",defVal:!0},{name:"snapToPoint",dispName:"Snap to Point",type:"bool",defVal:!1},{name:"dashPattern",dispName:"Dash Pattern",type:"numbers",defVal:""},{name:"fixDash",dispName:"Fixed Dash",type:"bool",defVal:!1},{name:"flowAnimationDuration",
dispName:"Flow Duration",type:"int",defVal:500,isVisible:function(k){return"1"==mxUtils.getValue(k.style,"flowAnimation",null)}},{name:"flowAnimationTimingFunction",dispName:"Flow Timing",type:"enum",defVal:"linear",enumList:[{val:"linear",dispName:"Linear"},{val:"ease",dispName:"Ease"},{val:"ease-in",dispName:"Ease-in"},{val:"ease-out",dispName:"Ease-out"},{val:"ease-in-out",dispName:"Ease-in-out"}],isVisible:function(k){return"1"==mxUtils.getValue(k.style,"flowAnimation",null)}},{name:"flowAnimationDirection",
dispName:"Flow Direction",type:"enum",defVal:"normal",enumList:[{val:"normal",dispName:"Normal"},{val:"reverse",dispName:"Reverse"},{val:"alternate",dispName:"Alternate"},{val:"alternate-reverse",dispName:"Alternate-Reverse"}],isVisible:function(k){return"1"==mxUtils.getValue(k.style,"flowAnimation",null)}},{name:"editable",dispName:"Editable",type:"bool",defVal:!0},{name:"metaEdit",dispName:"Edit Dialog",type:"bool",defVal:!1},{name:"backgroundOutline",dispName:"Background Outline",type:"bool",defVal:!1},
{name:"bendable",dispName:"Bendable",type:"bool",defVal:!0},{name:"movable",dispName:"Movable",type:"bool",defVal:!0},{name:"cloneable",dispName:"Cloneable",type:"bool",defVal:!0},{name:"deletable",dispName:"Deletable",type:"bool",defVal:!0},{name:"noJump",dispName:"No Jumps",type:"bool",defVal:!1},{name:"ignoreEdge",dispName:"Ignore Edge",type:"bool",defVal:!1},{name:"orthogonalLoop",dispName:"Loop Routing",type:"bool",defVal:!1},{name:"orthogonal",dispName:"Orthogonal",type:"bool",defVal:!1}].concat(Editor.commonProperties);
Editor.commonVertexProperties=[{name:"colspan",dispName:"Colspan",type:"int",min:1,defVal:1,isVisible:function(k,v){v=v.editorUi.editor.graph;return 1==k.vertices.length&&0==k.edges.length&&v.isTableCell(k.vertices[0])}},{name:"rowspan",dispName:"Rowspan",type:"int",min:1,defVal:1,isVisible:function(k,v){v=v.editorUi.editor.graph;return 1==k.vertices.length&&0==k.edges.length&&v.isTableCell(k.vertices[0])}},{type:"separator"},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",getDefaultValue:function(k,
v){k=v.editorUi.editor.graph.getCellStyle(1==k.vertices.length&&0==k.edges.length?k.vertices[0]:null);return"1"==mxUtils.getValue(k,"resizeLastRow","0")},isVisible:function(k,v){v=v.editorUi.editor.graph;return 1==k.vertices.length&&0==k.edges.length&&v.isTable(k.vertices[0])}},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",getDefaultValue:function(k,v){k=v.editorUi.editor.graph.getCellStyle(1==k.vertices.length&&0==k.edges.length?k.vertices[0]:null);return"1"==mxUtils.getValue(k,"resizeLast",
"0")},isVisible:function(k,v){v=v.editorUi.editor.graph;return 1==k.vertices.length&&0==k.edges.length&&v.isTable(k.vertices[0])}},{name:"fillOpacity",dispName:"Fill Opacity",type:"int",min:0,max:100,defVal:100},{name:"strokeOpacity",dispName:"Stroke Opacity",type:"int",min:0,max:100,defVal:100},{name:"overflow",dispName:"Text Overflow",defVal:"visible",type:"enum",enumList:[{val:"visible",dispName:"Visible"},{val:"hidden",dispName:"Hidden"},{val:"block",dispName:"Block"},{val:"fill",dispName:"Fill"},
{val:"width",dispName:"Width"}]},{name:"noLabel",dispName:"Hide Label",type:"bool",defVal:!1},{name:"labelPadding",dispName:"Label Padding",type:"float",defVal:0},{name:"direction",dispName:"Direction",type:"enum",defVal:"east",enumList:[{val:"north",dispName:"North"},{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"portConstraint",dispName:"Constraint",type:"enum",defVal:"none",enumList:[{val:"none",dispName:"None"},{val:"north",dispName:"North"},
{val:"east",dispName:"East"},{val:"south",dispName:"South"},{val:"west",dispName:"West"}]},{name:"portConstraintRotation",dispName:"Rotate Constraint",type:"bool",defVal:!1},{name:"connectable",dispName:"Connectable",type:"bool",getDefaultValue:function(k,v){return v.editorUi.editor.graph.isCellConnectable(0<k.vertices.length&&0==k.edges.length?k.vertices[0]:null)},isVisible:function(k,v){return 0<k.vertices.length&&0==k.edges.length}},{name:"allowArrows",dispName:"Allow Arrows",type:"bool",defVal:!0},
{name:"snapToPoint",dispName:"Snap to Point",type:"bool",defVal:!1},{name:"perimeter",dispName:"Perimeter",defVal:"none",type:"enum",enumList:[{val:"none",dispName:"None"},{val:"rectanglePerimeter",dispName:"Rectangle"},{val:"ellipsePerimeter",dispName:"Ellipse"},{val:"rhombusPerimeter",dispName:"Rhombus"},{val:"trianglePerimeter",dispName:"Triangle"},{val:"hexagonPerimeter2",dispName:"Hexagon"},{val:"lifelinePerimeter",dispName:"Lifeline"},{val:"orthogonalPerimeter",dispName:"Orthogonal"},{val:"backbonePerimeter",
dispName:"Backbone"},{val:"calloutPerimeter",dispName:"Callout"},{val:"parallelogramPerimeter",dispName:"Parallelogram"},{val:"trapezoidPerimeter",dispName:"Trapezoid"},{val:"stepPerimeter",dispName:"Step"},{val:"centerPerimeter",dispName:"Center"}]},{name:"fixDash",dispName:"Fixed Dash",type:"bool",defVal:!1},{name:"container",dispName:"Container",type:"bool",getDefaultValue:function(k,v){k=1==k.vertices.length&&0==k.edges.length?k.vertices[0]:null;v=v.editorUi.editor.graph;return null!=k&&v.isSwimlane(k)},
isVisible:function(k,v){return 1==k.vertices.length&&0==k.edges.length}},{name:"dropTarget",dispName:"Drop Target",type:"bool",getDefaultValue:function(k,v){k=1==k.vertices.length&&0==k.edges.length?k.vertices[0]:null;v=v.editorUi.editor.graph;return null!=k&&(v.isSwimlane(k)||0<v.model.getChildCount(k))},isVisible:function(k,v){return 1==k.vertices.length&&0==k.edges.length}},{name:"collapsible",dispName:"Collapsible",type:"bool",getDefaultValue:function(k,v){var J=1==k.vertices.length&&0==k.edges.length?
k.vertices[0]:null;v=v.editorUi.editor.graph;return null!=J&&(v.isContainer(J)&&"0"!=k.style.collapsible||!v.isContainer(J)&&"1"==k.style.collapsible)},isVisible:function(k,v){return 1==k.vertices.length&&0==k.edges.length}},{name:"recursiveResize",dispName:"Resize Children",type:"bool",defVal:!0,isVisible:function(k,v){return 1==k.vertices.length&&0==k.edges.length&&!v.editorUi.editor.graph.isSwimlane(k.vertices[0])&&null==mxUtils.getValue(k.style,"childLayout",null)}},{name:"expand",dispName:"Expand",
type:"bool",defVal:!0},{name:"part",dispName:"Part",type:"bool",defVal:!1,isVisible:function(k,v){v=v.editorUi.editor.graph.model;return 0<k.vertices.length?v.isVertex(v.getParent(k.vertices[0])):!1}},{name:"editable",dispName:"Editable",type:"bool",defVal:!0},{name:"metaEdit",dispName:"Edit Dialog",type:"bool",defVal:!1},{name:"backgroundOutline",dispName:"Background Outline",type:"bool",defVal:!1},{name:"movable",dispName:"Movable",type:"bool",defVal:!0},{name:"movableLabel",dispName:"Movable Label",
type:"bool",defVal:!1,isVisible:function(k,v){k=0<k.vertices.length?v.editorUi.editor.graph.getCellGeometry(k.vertices[0]):null;return null!=k&&!k.relative}},{name:"autosize",dispName:"Autosize",type:"bool",defVal:!1},{name:"autosizeGrid",dispName:"Autosize Grid",type:"enum",defVal:null,enumList:[{val:null,dispName:"Default"},{val:"1",dispName:"Enabled"},{val:"0",dispName:"Disabled"}],isVisible:function(k,v){return 0<k.vertices.length&&v.editorUi.editor.graph.isAutoSizeCell(k.vertices[0])}},{name:"fixedWidth",
dispName:"Fixed Width",type:"bool",defVal:!1},{name:"resizable",dispName:"Resizable",type:"bool",defVal:!0},{name:"resizeWidth",dispName:"Resize Width",type:"bool",defVal:!1},{name:"resizeHeight",dispName:"Resize Height",type:"bool",defVal:!1},{name:"rotatable",dispName:"Rotatable",type:"bool",defVal:!0},{name:"cloneable",dispName:"Cloneable",type:"bool",defVal:!0},{name:"deletable",dispName:"Deletable",type:"bool",defVal:!0},{name:"treeFolding",dispName:"Tree Folding",type:"bool",defVal:!1},{name:"treeMoving",
dispName:"Tree Moving",type:"bool",defVal:!1},{name:"pointerEvents",dispName:"Pointer Events",type:"bool",defVal:!0,isVisible:function(k,v){var J=mxUtils.getValue(k.style,mxConstants.STYLE_FILLCOLOR,null);return!mxShape.forceFilledPointerEvents||v.editorUi.editor.graph.isSwimlane(k.vertices[0])||null==J||J==mxConstants.NONE||0==mxUtils.getValue(k.style,mxConstants.STYLE_FILL_OPACITY,100)||0==mxUtils.getValue(k.style,mxConstants.STYLE_OPACITY,100)||null!=k.style.pointerEvents}},{name:"moveCells",dispName:"Move Cells on Fold",
type:"bool",defVal:!1,isVisible:function(k,v){return 0<k.vertices.length&&v.editorUi.editor.graph.isContainer(k.vertices[0])}},Editor.createInheritProperty("Inherit Font Family",mxConstants.STYLE_FONTFAMILY),Editor.createInheritProperty("Inherit Font Size",mxConstants.STYLE_FONTSIZE),Editor.createInheritProperty("Inherit Font Color",mxConstants.STYLE_FONTCOLOR),Editor.createInheritProperty("Inherit Fill Color",mxConstants.STYLE_FILLCOLOR),Editor.createInheritProperty("Inherit Stroke Color",mxConstants.STYLE_STROKECOLOR)].concat(Editor.commonProperties);
Editor.defaultCsvValue='##\n## Example CSV import. Use ## for comments and # for configuration. Paste CSV below.\n## The following names are reserved and should not be used (or ignored):\n## id, tooltip, placeholder(s), link and label (see below)\n##\n#\n## Node label with placeholders and HTML.\n## Default is \'%name_of_first_column%\'.\n#\n# label: %name%<br><i style="color:gray;">%position%</i><br><a href="mailto:%email%">Email</a>\n#\n## Node style (placeholders are replaced once).\n## Default is the current style for nodes.\n#\n# style: label;image=%image%;whiteSpace=wrap;html=1;rounded=1;fillColor=%fill%;strokeColor=%stroke%;\n#\n## Parent style for nodes with child nodes (placeholders are replaced once).\n#\n# parentstyle: swimlane;whiteSpace=wrap;html=1;childLayout=stackLayout;horizontal=1;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;\n#\n## Style to be used for objects not in the CSV. If this is - then such objects are ignored,\n## else they are created using this as their style, eg. whiteSpace=wrap;html=1;\n#\n# unknownStyle: -\n#\n## Optional column name that contains a reference to a named style in styles.\n## Default is the current style for nodes.\n#\n# stylename: -\n#\n## JSON for named styles of the form {"name": "style", "name": "style"} where style is a cell style with\n## placeholders that are replaced once.\n#\n# styles: -\n#\n## JSON for variables in styles of the form {"name": "value", "name": "value"} where name is a string\n## that will replace a placeholder in a style.\n#\n# vars: -\n#\n## Optional column name that contains a reference to a named label in labels.\n## Default is the current label.\n#\n# labelname: -\n#\n## JSON for named labels of the form {"name": "label", "name": "label"} where label is a cell label with\n## placeholders.\n#\n# labels: -\n#\n## Uses the given column name as the identity for cells (updates existing cells).\n## Default is no identity (empty value or -).\n#\n# identity: -\n#\n## Uses the given column name as the parent reference for cells. Default is no parent (empty or -).\n## The identity above is used for resolving the reference so it must be specified.\n#\n# parent: -\n#\n## Adds a prefix to the identity of cells to make sure they do not collide with existing cells (whose\n## IDs are numbers from 0..n, sometimes with a GUID prefix in the context of realtime collaboration).\n## Default is csvimport-.\n#\n# namespace: csvimport-\n#\n## Connections between rows ("from": source colum, "to": target column).\n## Label, style and invert are optional. Defaults are \'\', current style and false.\n## If placeholders are used in the style, they are replaced with data from the source.\n## An optional placeholders can be set to target to use data from the target instead.\n## In addition to label, an optional fromlabel and tolabel can be used to name the column\n## that contains the text for the label in the edges source or target (invert ignored).\n## In addition to those, an optional source and targetlabel can be used to specify a label\n## that contains placeholders referencing the respective columns in the source or target row.\n## The label is created in the form fromlabel + sourcelabel + label + tolabel + targetlabel.\n## Additional labels can be added by using an optional labels array with entries of the\n## form {"label": string, "x": number, "y": number, "dx": number, "dy": number} where\n## x is from -1 to 1 along the edge, y is orthogonal, and dx/dy are offsets in pixels.\n## An optional placeholders with the string value "source" or "target" can be specified\n## to replace placeholders in the additional label with data from the source or target.\n## An optional data object can be specified to define the metadata for the connector.\n## The target column may contain a comma-separated list of values.\n## Multiple connect entries are allowed.\n#\n# connect: {"from": "manager", "to": "name", "invert": true, "label": "manages", \\\n# "style": "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"}\n# connect: {"from": "refs", "to": "id", "style": "curved=1;fontSize=11;"}\n#\n## Node x-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# left: \n#\n## Node y-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# top: \n#\n## Node width. Possible value is a number (in px), auto or an @ sign followed by a column\n## name that contains the value for the width. Default is auto.\n#\n# width: auto\n#\n## Node height. Possible value is a number (in px), auto, width or an @ sign followed by a column\n## name that contains the value for the height. Default is auto.\n#\n# height: auto\n#\n## Collapsed state for vertices. Possible values are true or false. Default is false.\n#\n# collapsed: false\n#\n## Padding for autosize. Default is 0.\n#\n# padding: -12\n#\n## Comma-separated list of ignored columns for metadata. (These can be\n## used for connections and styles but will not be added as metadata.)\n#\n# ignore: id,image,fill,stroke,refs,manager\n#\n## Column to be renamed to link attribute (used as link).\n#\n# link: url\n#\n## Spacing between nodes. Default is 40.\n#\n# nodespacing: 40\n#\n## Spacing between levels of hierarchical layouts. Default is 100.\n#\n# levelspacing: 100\n#\n## Spacing between parallel edges. Default is 40. Use 0 to disable.\n#\n# edgespacing: 40\n#\n## Name or JSON of layout. Possible values are auto, none, verticaltree, horizontaltree,\n## verticalflow, horizontalflow, organic, circle, orgchart or a JSON string as used in\n## Layout, Apply. Default is auto.\n#\n# layout: auto\n#\n## ---- CSV below this line. First line are column names. ----\nname,position,id,location,manager,email,fill,stroke,refs,url,image\nTessa Miller,CFO,emi,Office 1,,me@example.com,default,#6c8ebf,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\nEdward Morrison,Brand Manager,emo,Office 2,Tessa Miller,me@example.com,default,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png\nAlison Donovan,System Admin,rdo,Office 3,Tessa Miller,me@example.com,default,#82b366,"emo,tva",https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png\nEvan Valet,HR Director,tva,Office 4,Tessa Miller,me@example.com,default,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\n';
Editor.canvasSupported=!1;(function(){try{var k=document.createElement("canvas");Editor.canvasSupported=!(!k.getContext||!k.getContext("2d"))}catch(v){}})();Editor.useCanvasForExport=!1;(function(){try{var k=document.createElement("canvas"),v=new Image;v.onload=function(){try{k.getContext("2d").drawImage(v,0,0);var J=k.toDataURL("image/png");Editor.useCanvasForExport=null!=J&&6<J.length}catch(N){}};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(J){}})();
Editor.jpgSupported=!1;Editor.webpSupported=!1;(function(){try{var k=document.createElement("canvas");k.width=k.height=1;var v=k.toDataURL("image/jpeg");Editor.jpgSupported=null!==v.match("image/jpeg");v=k.toDataURL("image/webp");Editor.webpSupported=null!==v.match("image/webp")}catch(J){}})();Editor.loadCompatibleCss=function(k){mxUtils.lightDarkColorSupported||mxUtils.get(k||"styles/grapheditor.css",mxUtils.bind(this,function(v){if(200<=v.getStatus()&&299>=v.getStatus()){var J=document.createElement("style");
J.type="text/css";var N=J.appendChild,T=document,V=T.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(U){}N.call(J,V.call(T,v));document.head.appendChild(J)}}))};Editor.createRoughCanvas=function(k){var v=
rough.canvas({getContext:function(){return k}});v.draw=function(J){var N=J.sets||[];J=J.options||this.getDefaultOptions();for(var T=0;T<N.length;T++){var V=N[T];switch(V.type){case "path":null!=J.stroke&&this._drawToContext(k,V,J);break;case "fillPath":this._drawToContext(k,V,J);break;case "fillSketch":this.fillSketch(k,V,J)}}};v.fillSketch=function(J,N,T){var V=k.state.strokeColor,U=k.state.strokeWidth,X=k.state.strokeAlpha,fa=k.state.dashed,na=T.fillWeight;0>na&&(na=T.strokeWidth/2);k.setStrokeAlpha(k.state.fillAlpha);
k.setStrokeColor(T.fill||"");k.setStrokeWidth(na);k.setDashed(!1);this._drawToContext(J,N,T);k.setDashed(fa);k.setStrokeWidth(U);k.setStrokeColor(V);k.setStrokeAlpha(X)};v._drawToContext=function(J,N,T){J.begin();for(var V=0;V<N.ops.length;V++){var U=N.ops[V],X=U.data;switch(U.op){case "move":J.moveTo(X[0],X[1]);break;case "bcurveTo":J.curveTo(X[0],X[1],X[2],X[3],X[4],X[5]);break;case "lineTo":J.lineTo(X[0],X[1])}}J.end();"fillPath"===N.type&&T.filled?J.fill():J.stroke()};return v};(function(){function k(V,
U,X){this.canvas=V;this.rc=U;this.shape=X;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.originalBegin=this.canvas.begin;this.canvas.begin=mxUtils.bind(this,k.prototype.begin);this.originalEnd=this.canvas.end;this.canvas.end=mxUtils.bind(this,k.prototype.end);this.originalRect=this.canvas.rect;this.canvas.rect=mxUtils.bind(this,k.prototype.rect);this.originalRoundrect=this.canvas.roundrect;this.canvas.roundrect=mxUtils.bind(this,k.prototype.roundrect);this.originalEllipse=this.canvas.ellipse;
this.canvas.ellipse=mxUtils.bind(this,k.prototype.ellipse);this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,k.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,k.prototype.moveTo);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,k.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;this.canvas.curveTo=mxUtils.bind(this,k.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=
mxUtils.bind(this,k.prototype.arcTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,k.prototype.close);this.originalFill=this.canvas.fill;this.canvas.fill=mxUtils.bind(this,k.prototype.fill);this.originalStroke=this.canvas.stroke;this.canvas.stroke=mxUtils.bind(this,k.prototype.stroke);this.originalFillAndStroke=this.canvas.fillAndStroke;this.canvas.fillAndStroke=mxUtils.bind(this,k.prototype.fillAndStroke);this.path=[];this.passThrough=!1}k.prototype.moveOp="M";k.prototype.lineOp=
"L";k.prototype.quadOp="Q";k.prototype.curveOp="C";k.prototype.closeOp="Z";k.prototype.getStyle=function(V,U){var X=1;if(null!=this.shape.state){var fa=this.shape.state.cell.id;if(null!=fa)for(var na=0;na<fa.length;na++)X=(X<<5)-X+fa.charCodeAt(na)<<0}X={strokeWidth:this.canvas.state.strokeWidth,seed:X,preserveVertices:!0};fa=this.rc.getDefaultOptions();X.stroke=V?this.canvas.state.strokeColor===mxConstants.NONE?"transparent":this.canvas.state.strokeColor:mxConstants.NONE;V=null;(X.filled=U)?(X.fill=
this.canvas.state.fillColor===mxConstants.NONE?"":this.canvas.state.fillColor,V=this.canvas.state.gradientColor===mxConstants.NONE?null:this.canvas.state.gradientColor):X.fill="";X.bowing=mxUtils.getValue(this.shape.style,"bowing",fa.bowing);X.hachureAngle=mxUtils.getValue(this.shape.style,"hachureAngle",fa.hachureAngle);X.curveFitting=mxUtils.getValue(this.shape.style,"curveFitting",fa.curveFitting);X.roughness=mxUtils.getValue(this.shape.style,"jiggle",fa.roughness);X.simplification=mxUtils.getValue(this.shape.style,
"simplification",fa.simplification);X.disableMultiStroke=mxUtils.getValue(this.shape.style,"disableMultiStroke",fa.disableMultiStroke);X.disableMultiStrokeFill=mxUtils.getValue(this.shape.style,"disableMultiStrokeFill",fa.disableMultiStrokeFill);U=mxUtils.getValue(this.shape.style,"hachureGap",-1);X.hachureGap="auto"==U?-1:U;X.dashGap=mxUtils.getValue(this.shape.style,"dashGap",U);X.dashOffset=mxUtils.getValue(this.shape.style,"dashOffset",U);X.zigzagOffset=mxUtils.getValue(this.shape.style,"zigzagOffset",
U);U=mxUtils.getValue(this.shape.style,"fillWeight",-1);X.fillWeight="auto"==U?-1:U;U=mxUtils.getValue(this.shape.style,"fillStyle","auto");"dots"==U&&(U="auto");"auto"==U&&(U=[mxUtils.hex2rgb("#ffffff")],null!=this.shape.state&&U.push(mxUtils.hex2rgb(this.shape.state.view.graph.shapeBackgroundColor)),Editor.isDarkMode()&&U.push(mxUtils.hex2rgb(Editor.darkColor)),U=null!=X.fill&&(null!=V||0<=mxUtils.indexOf(U,mxUtils.hex2rgb(X.fill)))?"solid":fa.fillStyle);X.fillStyle=U;return X};k.prototype.begin=
function(){this.passThrough?this.originalBegin.apply(this.canvas,arguments):this.path=[]};k.prototype.end=function(){this.passThrough&&this.originalEnd.apply(this.canvas,arguments)};k.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var 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))};k.prototype.lineTo=function(V,U){this.passThrough?
this.originalLineTo.apply(this.canvas,arguments):(this.addOp(this.lineOp,V,U),this.lastX=V,this.lastY=U)};k.prototype.moveTo=function(V,U){this.passThrough?this.originalMoveTo.apply(this.canvas,arguments):(this.addOp(this.moveOp,V,U),this.lastX=V,this.lastY=U,this.firstX=V,this.firstY=U)};k.prototype.close=function(){this.passThrough?this.originalClose.apply(this.canvas,arguments):this.addOp(this.closeOp)};k.prototype.quadTo=function(V,U,X,fa){this.passThrough?this.originalQuadTo.apply(this.canvas,
arguments):(this.addOp(this.quadOp,V,U,X,fa),this.lastX=X,this.lastY=fa)};k.prototype.curveTo=function(V,U,X,fa,na,la){this.passThrough?this.originalCurveTo.apply(this.canvas,arguments):(this.addOp(this.curveOp,V,U,X,fa,na,la),this.lastX=na,this.lastY=la)};k.prototype.arcTo=function(V,U,X,fa,na,la,qa){if(this.passThrough)this.originalArcTo.apply(this.canvas,arguments);else{var ya=mxUtils.arcToCurves(this.lastX,this.lastY,V,U,X,fa,na,la,qa);if(null!=ya)for(var wa=0;wa<ya.length;wa+=6)this.curveTo(ya[wa],
ya[wa+1],ya[wa+2],ya[wa+3],ya[wa+4],ya[wa+5]);this.lastX=la;this.lastY=qa}};k.prototype.rect=function(V,U,X,fa){this.passThrough?this.originalRect.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.rectangle(V,U,X,fa,this.getStyle(!0,!0)))};k.prototype.ellipse=function(V,U,X,fa){this.passThrough?this.originalEllipse.apply(this.canvas,arguments):(this.path=[],this.nextShape=this.rc.generator.ellipse(V+X/2,U+fa/2,X,fa,this.getStyle(!0,!0)))};k.prototype.roundrect=function(V,
U,X,fa,na,la){this.passThrough?this.originalRoundrect.apply(this.canvas,arguments):(this.begin(),this.moveTo(V+na,U),this.lineTo(V+X-na,U),this.quadTo(V+X,U,V+X,U+la),this.lineTo(V+X,U+fa-la),this.quadTo(V+X,U+fa,V+X-na,U+fa),this.lineTo(V+na,U+fa),this.quadTo(V,U+fa,V,U+fa-la),this.lineTo(V,U+la),this.quadTo(V,U,V+na,U))};k.prototype.drawPath=function(V){if(0<this.path.length){this.passThrough=!0;try{this.rc.path(this.path.join(" "),V)}catch(X){}this.passThrough=!1}else if(null!=this.nextShape){for(var U in V)this.nextShape.options[U]=
V[U];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}};k.prototype.stroke=function(){this.passThrough?this.originalStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!1))};k.prototype.fill=function(){this.passThrough?this.originalFill.apply(this.canvas,arguments):this.drawPath(this.getStyle(!1,!0))};k.prototype.fillAndStroke=function(){this.passThrough?
this.originalFillAndStroke.apply(this.canvas,arguments):this.drawPath(this.getStyle(!0,!0))};k.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo;this.canvas.close=this.originalClose;this.canvas.fill=this.originalFill;this.canvas.stroke=this.originalStroke;this.canvas.fillAndStroke=this.originalFillAndStroke;
this.canvas.begin=this.originalBegin;this.canvas.end=this.originalEnd;this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(V){return new k(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 J=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(V,U,X,fa,na){null!=V.handJiggle&&V.handJiggle.passThrough||J.apply(this,arguments)};var N=mxShape.prototype.paint;mxShape.prototype.paint=function(V){var U=V.addTolerance,X=!0;null!=this.style&&(X="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=V.handJiggle&&V.handJiggle.constructor==k&&!this.outline){V.save();
var fa=this.fill,na=this.stroke;this.stroke=this.fill=null;var la=this.configurePointerEvents,qa=V.setStrokeColor;V.setStrokeColor=function(){};var ya=V.setFillColor;V.setFillColor=function(){};X||null==fa||(this.configurePointerEvents=function(){});V.handJiggle.passThrough=!0;N.apply(this,arguments);V.handJiggle.passThrough=!1;V.setFillColor=ya;V.setStrokeColor=qa;this.configurePointerEvents=la;this.stroke=na;this.fill=fa;V.restore();X&&null!=fa&&(V.addTolerance=function(){})}N.apply(this,arguments);
V.addTolerance=U};var T=mxShape.prototype.paintGlassEffect;mxShape.prototype.paintGlassEffect=function(V,U,X,fa,na,la){null!=V.handJiggle&&V.handJiggle.constructor==k?(V.handJiggle.passThrough=!0,T.apply(this,arguments),V.handJiggle.passThrough=!1):T.apply(this,arguments)}})();Editor.fastCompress=function(k){return null==k||0==k.length||"undefined"===typeof pako?k:Graph.arrayBufferToString(pako.deflateRaw(k))};Editor.fastDecompress=function(k){return null==k||0==k.length||"undefined"===typeof pako?
k:pako.inflateRaw(Graph.stringToArrayBuffer(atob(k)),{to:"string"})};Editor.extractGraphModel=function(k,v,J){if(null!=k&&"undefined"!==typeof pako){var N=k.ownerDocument.getElementsByTagName("div"),T=[];if(null!=N&&0<N.length)for(var V=0;V<N.length;V++)if("mxgraph"==N[V].getAttribute("class")){T.push(N[V]);break}0<T.length&&(N=T[0].getAttribute("data-mxgraph"),null!=N?(T=JSON.parse(N),null!=T&&null!=T.xml&&(k=mxUtils.parseXml(T.xml),k=k.documentElement)):(T=T[0].getElementsByTagName("div"),0<T.length&&
(N=mxUtils.getTextContent(T[0]),N=Graph.decompress(N,null,J),0<N.length&&(k=mxUtils.parseXml(N),k=k.documentElement))))}if(null!=k&&"svg"==k.nodeName)if(N=k.getAttribute("content"),null!=N&&"<"!=N.charAt(0)&&"%"!=N.charAt(0)&&(N=unescape(window.atob?atob(N):Base64.decode(cont,N))),null!=N&&"%"==N.charAt(0)&&(N=decodeURIComponent(N)),null!=N&&0<N.length)k=mxUtils.parseXml(N).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==k||v||(T=null,"diagram"==k.nodeName?T=k:"mxfile"==
k.nodeName&&(N=k.getElementsByTagName("diagram"),0<N.length&&(T=N[Math.max(0,Math.min(N.length-1,urlParams.page||0))])),null!=T&&(k=Editor.parseDiagramNode(T,J)));null==k||"mxGraphModel"==k.nodeName||v&&"mxfile"==k.nodeName||(k=null);return k};Editor.parseDiagramNode=function(k,v,J){Editor.validateDiagramNode(k);var N=mxUtils.trim(mxUtils.getTextContent(k)),T=null;0<N.length?(v=Graph.decompress(N,null,v),null!=v&&0<v.length&&(T=mxUtils.parseXml(v).documentElement)):(k=mxUtils.getChildNodes(k),0<k.length&&
(T=k[0],J&&(T=Editor.parseDiagramNode(T,v,!1)),v=mxUtils.createXmlDocument(),v.appendChild(v.importNode(T,!0)),T=v.documentElement));return T};Editor.getDiagramNodeXml=function(k){Editor.validateDiagramNode(k);var v=mxUtils.getNodeValue(k),J=null;0<v.length?J=Graph.decompress(v):(k=k.getElementsByTagName("mxGraphModel"),null!=k&&0<k.length&&(J=mxUtils.getXml(k[0])));return J};Editor.validateDiagramNode=function(k){if(0==mxUtils.trim(mxUtils.getTextContent(k)).length&&0==mxUtils.getChildNodes(k).length){var v=
new mxCodec,J=new mxGraphModel;k.appendChild(v.encode(J))}return k};Editor.extractGraphModelFromPdf=function(k){var v=null;k=k.substring(k.indexOf(",")+1);k=window.atob&&!mxClient.IS_SF?atob(k):Base64.decode(k,!0);if("%PDF-1.7"==k.substring(0,8)){var J=k.indexOf("EmbeddedFile");if(-1<J){var N=k.indexOf("stream",J)+9;if(0<k.substring(J,N).indexOf("application#2Fvnd.jgraph.mxfile")){var T=k.indexOf("endstream",N-1);return pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(N,T)),{to:"string"})}}for(J=
k.indexOf("/ObjStm");0<J;){N=k.indexOf("stream",J)+9;T=k.indexOf("endstream",N-1);N=pako.inflateRaw(Graph.stringToArrayBuffer(k.substring(N,T)),{to:"string"});T=N.indexOf("/Subject <");if(0<T){J=N.substring(T+14,N.indexOf(">",T));if(null!=J){v=J;J=[];for(N=0;N<v.length;N+=2)T=v.substr(N,2),"00"!=T&&J.push(String.fromCharCode(parseInt(T,16)));v=J.join("")}break}J=k.indexOf("/ObjStm",J+1)}}if(null==v&&"%PDF-1.4"==k.substring(0,8)){J="";T=N=0;for(var V=[],U=null;T<k.length;){var X=k.charCodeAt(T);T+=
1;10!=X&&(J+=String.fromCharCode(X));X=="/Subject (%3Cmxfile".charCodeAt(N)?N++:N=0;if(19==N){var fa=k.indexOf("%3C%2Fmxfile%3E",T)+15;T-=9;if(fa>T){v=k.substring(T,fa);break}}10==X&&("endobj"==J?U=null:"obj"==J.substring(J.length-3,J.length)||"xref"==J||"trailer"==J?(U=[],V[J.split(" ")[0]]=U):null!=U&&U.push(J),J="")}}null==v&&null!=V&&(v=Editor.extractGraphModelFromXref(V));null!=v&&(v=decodeURIComponent(v.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return v};Editor.extractGraphModelFromXref=function(k){var v=
k.trailer,J=null;null!=v&&(v=/.* \/Info (\d+) (\d+) R/g.exec(v.join("\n")),null!=v&&0<v.length&&(v=k[v[1]],null!=v&&(v=/.* \/Subject (\d+) (\d+) R/g.exec(v.join("\n")),null!=v&&0<v.length&&(k=k[v[1]],null!=k&&(k=k.join("\n"),J=k.substring(1,k.length-1))))));return J};Editor.extractParserError=function(k,v){var J=null;k=null!=k?k.getElementsByTagName("parsererror"):null;null!=k&&0<k.length&&(J=v||mxResources.get("invalidChars"),v=k[0].getElementsByTagName("div"),0<v.length&&(J=mxUtils.getTextContent(v[0])));
return null!=J?mxUtils.trim(J):J};Editor.addRetryToError=function(k,v){null!=k&&(k=null!=k.error?k.error:k,null==k.retry&&(k.retry=v))};Editor.mermaidToDrawio=function(k,v,J){if("function"===typeof mxMermaidToDrawio)return mxMermaidToDrawio(k,v,J)};Editor.configure=function(k){if(null!=k){Editor.config=k;Editor.configVersion=k.version;k.debug&&(urlParams.test="1");if(null!=k.customCss){var v=document.createElement("style");v.type="text/css";v.appendChild(document.createTextNode(k.customCss));document.head.appendChild(v)}null!=
k.defaultFonts&&(Menus.prototype.defaultFonts=k.defaultFonts);null!=k.presetColors&&(ColorDialog.prototype.presetColors=k.presetColors);null!=k.defaultColors&&(ColorDialog.prototype.defaultColors=k.defaultColors);null!=k.colorNames&&(ColorDialog.prototype.colorNames=k.colorNames);null!=k.defaultColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=k.defaultColorSchemes);null!=k.defaultEdgeLength&&(Graph.prototype.defaultEdgeLength=k.defaultEdgeLength);null!=k.selectParentLayer&&(Graph.selectParentLayer=
k.selectParentLayer);null!=k.autosaveDelay&&(DrawioFile.prototype.autosaveDelay=k.autosaveDelay);null!=k.templateFile&&(EditorUi.templateFile=k.templateFile);null!=k.styles&&(Array.isArray(k.styles)?Editor.styles=k.styles:EditorUi.debug("Configuration Error: Array expected for styles"));null!=k.globalVars&&(Editor.globalVars=k.globalVars);null!=k.compressXml&&(Editor.defaultCompressed=k.compressXml,Editor.compressXml=k.compressXml);null!=k.includeDiagram&&(Editor.defaultIncludeDiagram=k.includeDiagram);
null!=k.simpleLabels&&(Editor.simpleLabels=k.simpleLabels);null!=k.pasteAtMousePointer&&(Editor.pasteAtMousePointer=k.pasteAtMousePointer);null!=k.oneDriveInlinePicker&&(Editor.oneDriveInlinePicker=k.oneDriveInlinePicker);null!=k.defaultAdaptiveColors?Graph.defaultAdaptiveColors=k.defaultAdaptiveColors:0==k.enableCssDarkMode&&(Graph.defaultAdaptiveColors="simple");null!=k.enableLightDarkColors&&(mxUtils.lightDarkColorSupported=k.enableLightDarkColors);null!=k.darkColor&&(Editor.darkColor=k.darkColor);
null!=k.darkColorVar&&(Editor.darkColorVar=k.darkColorVar);Graph.prototype.defaultPageBackgroundColor="light-dark(#ffffff, "+Editor.darkColor+")";Graph.prototype.shapeBackgroundColor="light-dark(#ffffff, var("+Editor.darkColorVar+", "+Editor.darkColor+"))";null!=k.settingsName&&(Editor.configurationKey="."+k.settingsName+"-configuration",Editor.settingsKey="."+k.settingsName+"-config",mxSettings.key=Editor.settingsKey);null!=k.customFonts&&(Menus.prototype.defaultFonts=k.customFonts.concat(Menus.prototype.defaultFonts));
null!=k.customPresetColors&&(ColorDialog.prototype.presetColors=k.customPresetColors.concat(ColorDialog.prototype.presetColors));null!=k.customColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=k.customColorSchemes.concat(StyleFormatPanel.prototype.defaultColorSchemes));if(null!=k.css){v=document.createElement("style");v.setAttribute("type","text/css");v.appendChild(document.createTextNode(k.css));var J=document.getElementsByTagName("script")[0];J.parentNode.insertBefore(v,J)}null!=k.expandLibraries&&
(Sidebar.prototype.expandLibraries=k.expandLibraries);null!=k.appendCustomLibraries&&(Sidebar.prototype.appendCustomLibraries=k.appendCustomLibraries);null!=k.libraries&&(Sidebar.prototype.customEntries=k.libraries);null!=k.enabledLibraries&&(Array.isArray(k.enabledLibraries)?Sidebar.prototype.enabledLibraries=k.enabledLibraries:EditorUi.debug("Configuration Error: Array expected for enabledLibraries"));null!=k.defaultLibraries&&(Sidebar.prototype.defaultEntries=k.defaultLibraries);null!=k.defaultCustomLibraries&&
(Editor.defaultCustomLibraries=k.defaultCustomLibraries);null!=k.enableCustomLibraries&&(Editor.enableCustomLibraries=k.enableCustomLibraries);null!=k.defaultVertexStyle&&(Graph.prototype.defaultVertexStyle=k.defaultVertexStyle);null!=k.defaultEdgeStyle&&(Graph.prototype.defaultEdgeStyle=k.defaultEdgeStyle);null!=k.defaultPageVisible&&(Graph.prototype.defaultPageVisible=k.defaultPageVisible);null!=k.defaultGridEnabled&&(Graph.prototype.defaultGridEnabled=k.defaultGridEnabled);null!=k.zoomWheel&&(Graph.zoomWheel=
k.zoomWheel);null!=k.zoomFactor&&(v=parseFloat(k.zoomFactor),!isNaN(v)&&1<v?Graph.prototype.zoomFactor=v:EditorUi.debug("Configuration Error: Float > 1 expected for zoomFactor"));null!=k.defaultGridSize&&(v=parseInt(k.defaultGridSize),!isNaN(v)&&0<v?mxGraph.prototype.gridSize=v:EditorUi.debug("Configuration Error: Int > 0 expected for defaultGridSize"));null!=k.gridSteps&&(v=parseInt(k.gridSteps),!isNaN(v)&&0<v?mxGraphView.prototype.gridSteps=v:EditorUi.debug("Configuration Error: Int > 0 expected for gridSteps"));
null!=k.pageFormat&&(v=parseInt(k.pageFormat.width),J=parseInt(k.pageFormat.height),!isNaN(v)&&0<v&&!isNaN(J)&&0<J?(mxGraph.prototype.defaultPageFormat=new mxRectangle(0,0,v,J),mxGraph.prototype.pageFormat=mxGraph.prototype.defaultPageFormat):EditorUi.debug("Configuration Error: {width: int, height: int} expected for pageFormat"));null!=k.thumbWidth&&(Sidebar.prototype.thumbWidth=k.thumbWidth);null!=k.thumbHeight&&(Sidebar.prototype.thumbHeight=k.thumbHeight);null!=k.emptyLibraryXml&&(EditorUi.prototype.emptyLibraryXml=
k.emptyLibraryXml);null!=k.emptyDiagramXml&&(EditorUi.prototype.emptyDiagramXml=k.emptyDiagramXml);null!=k.sidebarWidth&&(EditorUi.prototype.hsplitPosition=k.sidebarWidth);null!=k.updateDefaultStyle&&(EditorUi.prototype.updateDefaultStyle=k.updateDefaultStyle);null!=k.sidebarTitles&&(Sidebar.prototype.sidebarTitles=k.sidebarTitles);null!=k.sidebarTitleSize&&(v=parseInt(k.sidebarTitleSize),!isNaN(v)&&0<v?Sidebar.prototype.sidebarTitleSize=v:EditorUi.debug("Configuration Error: Int > 0 expected for sidebarTitleSize"));
null!=k.fontCss&&("string"===typeof k.fontCss?Editor.configureFontCss(k.fontCss):EditorUi.debug("Configuration Error: String expected for fontCss"));null!=k.autosaveDelay&&(v=parseInt(k.autosaveDelay),!isNaN(v)&&0<v?DrawioFile.prototype.autosaveDelay=v:EditorUi.debug("Configuration Error: Int > 0 expected for autosaveDelay"));null!=k.maxImageBytes&&(EditorUi.prototype.maxImageBytes=k.maxImageBytes);null!=k.maxImageSize&&(EditorUi.prototype.maxImageSize=k.maxImageSize);null!=k.shareCursorPosition&&
(EditorUi.prototype.shareCursorPosition=k.shareCursorPosition);null!=k.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=k.showRemoteCursors);null!=k.restrictExport&&(DrawioFile.RESTRICT_EXPORT=k.restrictExport);null!=k.replaceSvgDataUris&&(Editor.replaceSvgDataUris=k.replaceSvgDataUris);null!=k.foreignObjectImages&&(Editor.foreignObjectImages=k.foreignObjectImages);null!=k.shadowColor&&(mxConstants.SHADOW_COLOR=k.shadowColor);null!=k.shadowOpacity&&(mxConstants.SHADOW_OPACITY=k.shadowOpacity);
null!=k.shadowOffsetX&&(mxConstants.SHADOW_OFFSET_X=k.shadowOffsetX);null!=k.shadowOffsetY&&(mxConstants.SHADOW_OFFSET_Y=k.shadowOffsetY);null!=k.shadowBlur&&(mxConstants.SHADOW_BLUR=k.shadowBlur);null!=k.enableAnimations&&(Editor.enableAnimations=k.enableAnimations);null!=k.enableChatGpt&&(Editor.enableChatGpt=k.enableChatGpt);null!=k.gptApiKey&&(Editor.gptApiKey=k.gptApiKey);null!=k.gptModel&&(Editor.gptModel=k.gptModel);null!=k.gptUrl&&(Editor.gptUrl=k.gptUrl)}};Editor.isSettingsEnabled=function(){return"undefined"!==
typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};Editor.configureFontCss=function(k){if(null!=k){Editor.prototype.fontCss=k;var v=document.getElementsByTagName("script")[0];if(null!=v&&null!=v.parentNode){var J=document.createElement("style");J.setAttribute("type","text/css");J.appendChild(document.createTextNode(k));v.parentNode.insertBefore(J,v);k=k.split("url(");for(J=1;J<k.length;J++){var N=k[J].indexOf(")");N=Editor.trimCssUrl(k[J].substring(0,N));var T=document.createElement("link");
T.setAttribute("rel","preload");T.setAttribute("href",N);T.setAttribute("as","font");T.setAttribute("crossorigin","");v.parentNode.insertBefore(T,v)}}}};Editor.trimCssUrl=function(k){return k.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GOOGLE_FONTS_CSS2="https://fonts.googleapis.com/css2?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=
20;Editor.guid=function(k){k=null!=k?k:Editor.GUID_LENGTH;for(var v=[],J=0;J<k;J++)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.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;Editor.prototype.crossOriginImages=!mxClient.IS_IE;var b=Editor.prototype.setGraphXml;
Editor.prototype.setGraphXml=function(k){k=null!=k&&"mxlibrary"!=k.nodeName?this.extractGraphModel(k):null;if(null!=k){var v=Editor.extractParserError(k,mxResources.get("invalidOrMissingFile"));if(v)throw EditorUi.debug("Editor.setGraphXml ParserError",[this],"node",[k],"cause",[v]),Error(mxResources.get("notADiagramFile")+" ("+v+")");if("mxGraphModel"==k.nodeName){v=k.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=v&&""!=v)v!=this.graph.currentStyle&&(J=null!=this.graph.themes?
this.graph.themes[v]:mxUtils.load(STYLE_PATH+"/"+v+".xml").getDocumentElement(),null!=J&&(N=new mxCodec(J.ownerDocument),N.decode(J,this.graph.getStylesheet())));else{var J=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement();if(null!=J){var N=new mxCodec(J.ownerDocument);N.decode(J,this.graph.getStylesheet())}}this.graph.currentStyle=v;this.graph.mathEnabled="1"==urlParams.math||"1"==k.getAttribute("math");this.graph.setAdaptiveColors(k.getAttribute("adaptiveColors"));
v=k.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"==k.getAttribute("shadow"),!1);if(v=k.getAttribute("extFonts"))try{for(v=v.split("|").map(function(T){T=T.split("^");return{name:T[0],url:T[1]}}),J=0;J<v.length;J++)this.graph.addExtFont(v[J].name,
v[J].url)}catch(T){console.log("ExtFonts format error: "+T.message)}else null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(this.graph.extFonts=[])}b.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||"Invalid data",toString:function(){return this.message}};};var f=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(k,v){k=null!=k?k:!0;var J=f.apply(this,arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&J.setAttribute("style",
this.graph.currentStyle);var N=this.graph.getBackgroundImageObject(this.graph.backgroundImage,v);null!=N&&J.setAttribute("backgroundImage",JSON.stringify(N));J.setAttribute("math",this.graph.mathEnabled?"1":"0");J.setAttribute("shadow",this.graph.shadowVisible?"1":"0");null!=this.graph.adaptiveColors?J.setAttribute("adaptiveColors",this.graph.adaptiveColors):J.removeAttribute("adaptiveColors");null!=this.graph.extFonts&&0<this.graph.extFonts.length&&(N=this.graph.extFonts.map(function(T){return T.name+
"^"+T.url}),J.setAttribute("extFonts",N.join("|")));return J};Editor.prototype.isDataSvg=function(k){try{var v=mxUtils.parseXml(k).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 J=mxUtils.parseXml(v).documentElement;return"mxfile"==J.nodeName||"mxGraphModel"==J.nodeName}}catch(N){}return!1};Editor.prototype.extractGraphModel=
function(k,v,J){return Editor.extractGraphModel.apply(this,arguments)};var l=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.setAdaptiveColors(null);this.graph.view.x0=null;this.graph.view.y0=null;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();l.apply(this,arguments)};var u=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=
function(){u.apply(this,arguments);this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(k,v){if("undefined"===typeof window.MathJax&&!mxClient.IS_IE&&!mxClient.IS_IE11){var J=function(){N=null;if(0<Editor.mathJaxQueue.length)Editor.doMathJaxRender(Editor.mathJaxQueue.shift());else Editor.onMathJaxDone()};k=null!=k?k:DRAW_MATH_URL+"/startup.js";Editor.mathJaxQueue=[];var N=null;Editor.doMathJaxRender=
function(U){try{null==N?(MathJax.typesetClear([U]),MathJax.typeset([U]),J()):N!=U&&Editor.mathJaxQueue.push(U)}catch(X){MathJax.typesetClear([U]),null!=X.retry?(N=U,X.retry.then(function(){MathJax.typesetPromise([U]).then(J)["catch"](function(fa){console.log("Error in MathJax.typesetPromise: "+fa.toString());J()})})["catch"](function(fa){console.log("Error in MathJax.retry: "+fa.toString());J()})):null!=window.console&&console.log("Error in MathJax.typeset: "+X.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"]},startup:{pageReady:function(){for(var U=0;U<Editor.mathJaxQueue.length;U++)Editor.doMathJaxRender(Editor.mathJaxQueue[U])}}};Editor.MathJaxRender=function(U){"undefined"!==typeof MathJax&&"function"===typeof MathJax.typeset?Editor.doMathJaxRender(U):Editor.mathJaxQueue.push(U)};Editor.onMathJaxDone=function(){};
var T=Editor.prototype.init;Editor.prototype.init=function(){T.apply(this,arguments);var U=mxUtils.bind(this,function(X,fa){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)});this.graph.model.addListener(mxEvent.CHANGE,U);this.graph.addListener(mxEvent.REFRESH,U)};v=document.getElementsByTagName("script");if(null!=v&&0<v.length){var V=document.createElement("script");V.setAttribute("type","text/javascript");V.setAttribute("src",k);v[0].parentNode.appendChild(V)}}};
Editor.prototype.csvToArray=function(k){if(0<k.length){var v="",J=[""],N=0,T=!0,V;k=$jscomp.makeIterator(k);for(V=k.next();!V.done;V=k.next())V=V.value,'"'===V?(T&&V===v&&(J[N]+=V),T=!T):","===V&&T?V=J[++N]="":J[N]+=V,v=V;return J}return[]};Editor.prototype.getProxiedUrl=function(k){if((/test\.draw\.io$/.test(window.location.hostname)||/app\.diagrams\.net$/.test(window.location.hostname))&&!this.isCorsEnabledForUrl(k)){var v=EditorUi.isVisioFilename(k);v=/\.png$/i.test(k)||/\.pdf$/i.test(k)||v;var J=
"t="+(new Date).getTime();k=PROXY_URL+"?url="+encodeURIComponent(k)+"&"+J+(v?"&base64=1":"")}return k};Editor.prototype.isCorsEnabledForUrl=function(k){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||k.substring(0,window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(k)||"https://raw.githubusercontent.com/"===k.substring(0,34)||
"https://fonts.googleapis.com/"===k.substring(0,29)||"https://fonts.gstatic.com/"===k.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var k=new mxUrlConverter;k.updateBaseUrl();var v=k.convert,J=this;k.convert=function(N){null!=N&&navigator.onLine&&("http://"!=N.substring(0,7)&&"https://"!=N.substring(0,8)||N.substring(0,k.baseUrl.length)==k.baseUrl||J.crossOriginImages&&J.isCorsEnabledForUrl(N)?"chrome-extension://"!=N.substring(0,19)&&(N=v.apply(this,arguments)):N=PROXY_URL+
"?url="+encodeURIComponent(N));return N};return k};Editor.createSvgDataUri=function(k){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(k)))};Editor.prototype.convertImageToDataUri=function(k,v,J,N,T){try{var V=!0,U=window.setTimeout(mxUtils.bind(this,function(){V=!1;v(k)}),this.timeout),X=mxUtils.bind(this,function(){null!=N?this.convertImageToDataUri(k,v,J,N,!0):v(k)});if(/(\.svg)$/i.test(k)&&!T)mxUtils.get(k,mxUtils.bind(this,function(na){window.clearTimeout(U);V&&(200>na.getStatus()||
299<na.getStatus()?X():v(Editor.createSvgDataUri(na.getText())))}),mxUtils.bind(this,function(){window.clearTimeout(U);V&&X()}));else{var fa=new Image;this.crossOriginImages&&(fa.crossOrigin="anonymous");fa.onload=function(){window.clearTimeout(U);if(V)try{N=null!=N&&T?N:1;var na=document.createElement("canvas"),la=na.getContext("2d");la.scale(N,N);na.height=fa.height*N;na.width=fa.width*N;la.drawImage(fa,0,0);v(na.toDataURL())}catch(qa){v(k)}};fa.onerror=function(){window.clearTimeout(U);V&&(null!=
J?J():v(k))};fa.src=k}}catch(na){null!=J?J():v(k)}};Editor.prototype.convertImages=function(k,v,J,N){function T(){0<V.length?V.shift()():v(k)}null==N&&(N=this.createImageUrlConverter());var V=[],U=J||{};J=mxUtils.bind(this,function(X,fa){X=k.getElementsByTagName(X);for(var na=0;na<X.length;na++)mxUtils.bind(this,function(la){V.push(mxUtils.bind(this,function(){try{if(null!=la){var qa=N.convert(la.getAttribute(fa));if(null!=qa&&"data:"!=qa.substring(0,5)){var ya=U[qa];null==ya?this.convertImageToDataUri(qa,
function(wa){null!=wa&&(U[qa]=wa,la.setAttribute(fa,wa));T()},null,Editor.svgRasterScale):(la.setAttribute(fa,ya),T())}else null!=qa&&la.setAttribute(fa,qa),T()}}catch(wa){T()}}))})(X[na])});J("image","xlink:href");J("img","src");T()};Editor.base64Encode=function(k){for(var v="",J=0,N=k.length,T,V,U;J<N;){T=k.charCodeAt(J++)&255;if(J==N){v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(T>>2);v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((T&
3)<<4);v+="==";break}V=k.charCodeAt(J++);if(J==N){v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(T>>2);v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((T&3)<<4|(V&240)>>4);v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((V&15)<<2);v+="=";break}U=k.charCodeAt(J++);v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(T>>2);v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((T&
3)<<4|(V&240)>>4);v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((V&15)<<2|(U&192)>>6);v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(U&63)}return v};Editor.prototype.loadUrl=function(k,v,J,N,T,V,U,X){try{var fa=!U&&(N||/(\.png)($|\?)/i.test(k)||/(\.jpe?g)($|\?)/i.test(k)||/(\.gif)($|\?)/i.test(k)||/(\.pdf)($|\?)/i.test(k));T=null!=T?T:!0;var na=mxUtils.bind(this,function(){mxUtils.get(k,mxUtils.bind(this,function(la){200<=la.getStatus()&&
299>=la.getStatus()?null!=v&&(la=la.getText(),fa&&(V=null!=V?V:"data:image/png;base64,",la=V+Editor.base64Encode(la)),v(la)):null!=J&&(0==la.getStatus()?J({message:mxResources.get("accessDenied")},la):404==la.getStatus()?J({message:mxResources.get("fileNotFound"),code:la.getStatus()},la):J({message:this.getErrorMessage(la)},la))}),function(la){null!=J&&J({message:mxResources.get("error")+" "+la.getStatus()})},fa,this.timeout,function(){T&&null!=J&&J({code:App.ERROR_TIMEOUT,retry:na})},X)});na()}catch(la){null!=
J&&J(la)}};Editor.prototype.getErrorMessage=function(k){var v=mxResources.get("error")+" "+k.getStatus();try{var J=k.getText(),N=JSON.parse(J);null!=N&&null!=N.error&&null!=N.error.message&&(v=N.error.message+" ("+v+")")}catch(T){}return v};Editor.prototype.absoluteCssFonts=function(k){var v=null;if(null!=k){var J=k.split("url(");if(0<J.length){v=[J[0]];k=window.location.pathname;var N=null!=k?k.lastIndexOf("/"):-1;0<=N&&(k=k.substring(0,N+1));N=document.getElementsByTagName("base");var T=null;null!=
N&&0<N.length&&(T=N[0].getAttribute("href"));for(var V=1;V<J.length;V++)if(N=J[V].indexOf(")"),0<N){var U=Editor.trimCssUrl(J[V].substring(0,N));this.graph.isRelativeUrl(U)&&(U=null!=T?T+U:window.location.protocol+"//"+window.location.hostname+("/"==U.charAt(0)?"":k)+U);v.push('url("'+U+'"'+J[V].substring(N))}else v.push(J[V])}else v=[k]}return null!=v?v.join(""):null};Editor.prototype.mapFontUrl=function(k,v,J){/^https?:\/\//.test(v)&&!this.isCorsEnabledForUrl(v)&&(v=PROXY_URL+"?url="+encodeURIComponent(v));
J(k,v)};Editor.prototype.embedCssFonts=function(k,v){var J=k.split("url("),N=0;null==this.cachedFonts&&(this.cachedFonts={});var T=mxUtils.bind(this,function(){if(0==N){for(var fa=[J[0]],na=1;na<J.length;na++){var la=J[na].indexOf(")");fa.push('url("');fa.push(this.cachedFonts[Editor.trimCssUrl(J[na].substring(0,la))]);fa.push('"'+J[na].substring(la))}v(fa.join(""))}});if(0<J.length){for(k=1;k<J.length;k++){var V=J[k].indexOf(")"),U=null,X=J[k].indexOf("format(",V);0<X&&(U=Editor.trimCssUrl(J[k].substring(X+
7,J[k].indexOf(")",X))));mxUtils.bind(this,function(fa){if(null==this.cachedFonts[fa]){this.cachedFonts[fa]=fa;N++;var na="application/x-font-ttf";if("svg"==U||/(\.svg)($|\?)/i.test(fa))na="image/svg+xml";else if("otf"==U||"embedded-opentype"==U||/(\.otf)($|\?)/i.test(fa))na="application/x-font-opentype";else if("woff"==U||/(\.woff)($|\?)/i.test(fa))na="application/font-woff";else if("woff2"==U||/(\.woff2)($|\?)/i.test(fa))na="application/font-woff2";else if("eot"==U||/(\.eot)($|\?)/i.test(fa))na=
"application/vnd.ms-fontobject";else if("sfnt"==U||/(\.sfnt)($|\?)/i.test(fa))na="application/font-sfnt";this.mapFontUrl(na,fa,mxUtils.bind(this,function(la,qa){this.loadUrl(qa,mxUtils.bind(this,function(ya){this.cachedFonts[fa]=ya;N--;T()}),mxUtils.bind(this,function(ya){N--;T()}),!0,null,"data:"+la+";charset=utf-8;base64,")}))}})(Editor.trimCssUrl(J[k].substring(0,V)),U)}T()}else v(k)};Editor.prototype.loadFonts=function(k){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,
mxUtils.bind(this,function(v){this.resolvedFontCss=v;null!=k&&k()})):null!=k&&k()};Editor.prototype.createGoogleFontCache=function(){var k={},v;for(v in Graph.fontMapping)Graph.isCssFontUrl(v)&&(k[v]=Graph.fontMapping[v]);return k};Editor.prototype.embedExtFonts=function(k){var v=this.graph.getCustomFonts();if(0<v.length){var J=[],N=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var T=mxUtils.bind(this,function(){0==N&&this.embedCssFonts(J.join(""),k)}),
V=0;V<v.length;V++)mxUtils.bind(this,function(U,X){Graph.isCssFontUrl(X)?null==this.cachedGoogleFonts[X]?(N++,this.loadUrl(Graph.rewriteGoogleFontUrl(X),mxUtils.bind(this,function(fa){this.cachedGoogleFonts[X]=fa;J.push(fa+"\n");N--;T()}),mxUtils.bind(this,function(fa){N--;J.push("@import url("+X+");\n");T()}))):J.push(this.cachedGoogleFonts[X]+"\n"):J.push('@font-face {font-family: "'+U+'";src: url("'+X+'")}\n')})(v[V].name,v[V].url);T()}else k()};Editor.prototype.addMathCss=function(k){k=k.getElementsByTagName("defs");
if(null!=k&&0<k.length)for(var v=document.getElementsByTagName("style"),J=0;J<v.length;J++){var N=mxUtils.getTextContent(v[J]);0>N.indexOf("mxPageSelector")&&0<N.indexOf("MathJax")&&k[0].appendChild(v[J].cloneNode(!0))}};Editor.prototype.addFontCss=function(k,v){v=null!=v?v:this.absoluteCssFonts(this.fontCss);if(null!=v){var J=mxUtils.getSvgDefs(k),N=v.split("\n");v=[];for(var T=[],V=0;V<N.length;V++)"@import"==N[V].substring(0,7)?v.push(N[V]):T.push(N[V]);k=k.ownerDocument;k=null!=k.createElementNS?
k.createElementNS(mxConstants.NS_SVG,"style"):k.createElement("style");k.setAttribute("type","text/css");0<v.length&&(mxUtils.setTextContent(k,v.join("\n")),J.appendChild(k));0<T.length&&(k=k.cloneNode(!1),mxUtils.setTextContent(k,T.join("\n")),J.appendChild(k))}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||Editor.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(k,v,J){var N=mxClient.IS_FF?8192:16384;return Math.min(J,Math.min(N/k,N/v))};Editor.prototype.exportToCanvas=
function(k,v,J,N,T,V,U,X,fa,na,la,qa,ya,wa,Ja,Aa,Ba,Ga){try{V=null!=V?V:!0;U=null!=U?U:!0;qa=null!=qa?qa:this.graph;ya=null!=ya?ya:0;var Ma=fa?null:qa.background;Ma==mxConstants.NONE&&(Ma=null);null==Ma&&(Ma=N);null==Ma&&0==fa&&(Ma="light-dark(#ffffff,"+Editor.darkColor+")");this.convertImages(qa.getSvg(null,null,ya,wa,null,U,null,null,null,na,null,Aa,Ba,Ga),mxUtils.bind(this,function(ra){try{var Ca=new Image;Ca.onload=mxUtils.bind(this,function(){try{var va=function(){mxClient.IS_SF?window.setTimeout(function(){Ra.drawImage(Ca,
0,0);k(Na,ra)},0):(Ra.drawImage(Ca,0,0),k(Na,ra))},Na=document.createElement("canvas"),Oa=parseInt(ra.getAttribute("width")),Qa=parseInt(ra.getAttribute("height"));X=null!=X?X:1;null!=v&&(X=V?Math.min(1,Math.min(3*v/(4*Qa),v/Oa)):v/Oa);X=this.getMaxCanvasScale(Oa,Qa,X);Oa=Math.ceil(X*Oa);Qa=Math.ceil(X*Qa);Na.setAttribute("width",Oa);Na.setAttribute("height",Qa);var Ra=Na.getContext("2d");if(null!=Ma){var za=mxUtils.getLightDarkColor(Ma);Ra.beginPath();Ra.rect(0,0,Oa,Qa);Ra.fillStyle="dark"==Aa&&
"none"!=qa.getAdaptiveColors()?za.dark:za.light;Ra.fill()}1!=X&&Ra.scale(X,X);if(Ja){var Ea=qa.view,C=Ea.scale;Ea.scale=1;var P=btoa(unescape(encodeURIComponent(Ea.createSvgGrid(Ea.gridColor))));Ea.scale=C;P="data:image/svg+xml;base64,"+P;var R=qa.gridSize*Ea.gridSteps*X,W=qa.getGraphBounds(),ia=Ea.translate.x*C,ka=Ea.translate.y*C,pa=ia+(W.x-ia)/C-ya,xa=ka+(W.y-ka)/C-ya,ta=new Image;ta.onload=function(){try{for(var ua=-Math.round(R-mxUtils.mod((ia-pa)*X,R)),Ia=-Math.round(R-mxUtils.mod((ka-xa)*X,
R));ua<Oa;ua+=R)for(var Va=Ia;Va<Qa;Va+=R)Ra.drawImage(ta,ua/X,Va/X);va()}catch(Wa){null!=T&&T(Wa)}};ta.onerror=function(ua){null!=T&&T(ua)};ta.src=P}else va()}catch(ua){null!=T&&T(ua)}});Ca.onerror=function(va){null!=T&&T(va)};na&&this.graph.addSvgShadow(ra);this.graph.mathEnabled&&this.addMathCss(ra);var Da=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(ra,this.resolvedFontCss),Ca.src=Editor.createSvgDataUri(mxUtils.getXml(ra))}catch(va){null!=T&&T(va)}});this.embedExtFonts(mxUtils.bind(this,
function(va){try{null!=va&&this.addFontCss(ra,va),this.loadFonts(Da)}catch(Na){null!=T&&T(Na)}}))}catch(va){null!=T&&T(va)}}),J,la)}catch(ra){null!=T&&T(ra)}};Editor.crcTable=[];for(var y=0;256>y;y++)for(var q=y,B=0;8>B;B++)q=1==(q&1)?3988292384^q>>>1:q>>>1,Editor.crcTable[y]=q;Editor.updateCRC=function(k,v,J,N){for(var T=0;T<N;T++)k=Editor.crcTable[(k^v.charCodeAt(J+T))&255]^k>>>8;return k};Editor.crc32=function(k){for(var v=-1,J=0;J<k.length;J++)v=v>>>8^Editor.crcTable[(v^k.charCodeAt(J))&255];
return(v^-1)>>>0};Editor.writeGraphModelToPng=function(k,v,J,N,T){function V(la,qa){var ya=fa;fa+=qa;return la.substring(ya,fa)}function U(la){la=V(la,4);return la.charCodeAt(3)+(la.charCodeAt(2)<<8)+(la.charCodeAt(1)<<16)+(la.charCodeAt(0)<<24)}function X(la){return String.fromCharCode(la>>24&255,la>>16&255,la>>8&255,la&255)}k=k.substring(k.indexOf(",")+1);k=window.atob?atob(k):Base64.decode(k,!0);var fa=0;if(V(k,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=T&&T();else if(V(k,
4),"IHDR"!=V(k,4))null!=T&&T();else{V(k,17);T=k.substring(0,fa);do{var na=U(k);if("IDAT"==V(k,4)){T=k.substring(0,fa-8);"pHYs"==v&&"dpi"==J?(J=Math.round(N/.0254),J=X(J)+X(J)+String.fromCharCode(1)):J=J+String.fromCharCode(0)+("zTXt"==v?String.fromCharCode(0):"")+N;N=4294967295;N=Editor.updateCRC(N,v,0,4);N=Editor.updateCRC(N,J,0,J.length);T+=X(J.length)+v+J+X(N^4294967295);T+=k.substring(fa-8,k.length);break}T+=k.substring(fa-8,fa-4+na);V(k,na);V(k,4)}while(na);return"data:image/png;base64,"+(window.btoa?
btoa(T):Base64.encode(T,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.drawio.com/doc/faq/save-file-formats";var H=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(k,v){H.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var S=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){S.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}"undefined"!==typeof window.EditDataDialog&&
(EditDataDialog.getDisplayIdForCell=function(k,v){var J=null;null!=k.editor.graph.getModel().getParent(v)?J=v.getId():null!=k.currentPage&&(J=k.currentPage.getId());return J});if(null!=window.StyleFormatPanel){var E=Format.prototype.init;Format.prototype.init=function(){E.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var Q=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?
Q.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(k){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var c=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(k){k=c.apply(this,arguments);var v=this.editorUi,J=v.editor.graph;if(J.isEnabled()){var N=v.getCurrentFile();null!=N&&N.isAutosaveOptional()&&k.appendChild(this.createOption(mxResources.get("autosave"),function(){return v.editor.autosave},
function(V){v.editor.setAutosave(V);v.editor.autosave&&N.isModified()&&N.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()&&J.isEnabled()&&"undefined"!==typeof MathJax){var T=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return J.mathEnabled},function(V){v.actions.get("mathematicalTypesetting").funct()},
{install:function(V){this.listener=function(){V(J.mathEnabled)};v.addListener("mathEnabledChanged",this.listener)},destroy:function(){v.removeListener(this.listener)}});k.appendChild(T);(!v.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&T.appendChild(v.menus.createHelpLink("https://www.drawio.com/doc/faq/math-typesetting"))}return k};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},
{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=
[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",
type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2,isVisible:function(k){return"0"==mxUtils.getValue(k.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:20,isVisible:function(k){return"1"==mxUtils.getValue(k.style,
"fixedSize","0")}}];mxCellRenderer.defaultShapes.hexagon.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.25,isVisible:function(k){return"0"==mxUtils.getValue(k.style,"fixedSize","0")}},{name:"size",dispName:"Slope Angle",type:"float",min:0,defVal:25,isVisible:function(k){return"1"==mxUtils.getValue(k.style,"fixedSize","0")}}];mxCellRenderer.defaultShapes.triangle.prototype.customProperties=
[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE}];mxCellRenderer.defaultShapes.document.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",defVal:.3,min:0,max:1}];mxCellRenderer.defaultShapes.internalStorage.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"dx",dispName:"Left Line",type:"float",min:0,defVal:20},{name:"dy",dispName:"Top Line",type:"float",min:0,defVal:20}];
mxCellRenderer.defaultShapes.cube.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0},{name:"darkOpacity2",dispName:"Dark Opacity 2",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.step.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Notch Size",type:"float",min:0,defVal:20},{name:"fixedSize",
dispName:"Fixed Size",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.trapezoid.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.tape.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.4}];mxCellRenderer.defaultShapes.note.prototype.customProperties=[{name:"size",dispName:"Fold Size",type:"float",
min:0,defVal:30},{name:"darkOpacity",dispName:"Dark Opacity",type:"float",min:-1,max:1,defVal:0}];mxCellRenderer.defaultShapes.card.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Cutoff Size",type:"float",min:0,defVal:30}];mxCellRenderer.defaultShapes.callout.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"base",dispName:"Callout Width",
type:"float",min:0,defVal:20},{name:"size",dispName:"Callout Length",type:"float",min:0,defVal:30},{name:"position",dispName:"Callout Position",type:"float",min:0,max:1,defVal:.5},{name:"position2",dispName:"Callout Tip Position",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.folder.prototype.customProperties=[{name:"tabWidth",dispName:"Tab Width",type:"float"},{name:"tabHeight",dispName:"Tab Height",type:"float"},{name:"tabPosition",dispName:"Tap Position",type:"enum",enumList:[{val:"left",
dispName:"Left"},{val:"right",dispName:"Right"}]}];mxCellRenderer.defaultShapes.swimlane.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1},{name:"startSize",dispName:"Header Size",type:"float"},{name:"swimlaneHead",dispName:"Head Border",type:"bool",defVal:!0},{name:"swimlaneBody",dispName:"Body Border",type:"bool",defVal:!0},{name:"horizontal",dispName:"Horizontal",type:"bool",defVal:!0},
{name:"separatorColor",dispName:"Separator Color",type:"color",defVal:null}];mxCellRenderer.defaultShapes.table.prototype.customProperties=[{name:"rowLines",dispName:"Row Lines",type:"bool",defVal:!0},{name:"columnLines",dispName:"Column Lines",type:"bool",defVal:!0},{name:"fixedRows",dispName:"Fixed Rows",type:"bool",defVal:!1},{name:"resizeLast",dispName:"Resize Last Column",type:"bool",defVal:!1},{name:"resizeLastRow",dispName:"Resize Last Row",type:"bool",defVal:!1}].concat(mxCellRenderer.defaultShapes.swimlane.prototype.customProperties).concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);
mxCellRenderer.defaultShapes.tableRow.prototype.customProperties=mxCellRenderer.defaultShapes.swimlane.prototype.customProperties.concat(mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties);mxCellRenderer.defaultShapes.doubleEllipse.prototype.customProperties=[{name:"margin",dispName:"Indent",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.ext.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:15},{name:"double",dispName:"Double",
type:"bool",defVal:!1},{name:"margin",dispName:"Indent",type:"float",min:0,defVal:0}];mxCellRenderer.defaultShapes.curlyBracket.prototype.customProperties=[{name:"rounded",dispName:"Rounded",type:"bool",defVal:!0},{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.5}];mxCellRenderer.defaultShapes.image.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.label.prototype.customProperties=[{name:"imageAspect",dispName:"Fixed Image Aspect",
type:"bool",defVal:!0},{name:"imageAlign",dispName:"Image Align",type:"enum",enumList:[{val:"left",dispName:"Left"},{val:"center",dispName:"Center"},{val:"right",dispName:"Right"}],defVal:"left"},{name:"imageVerticalAlign",dispName:"Image Vertical Align",type:"enum",enumList:[{val:"top",dispName:"Top"},{val:"middle",dispName:"Middle"},{val:"bottom",dispName:"Bottom"}],defVal:"middle"},{name:"imageWidth",dispName:"Image Width",type:"float",min:0,defVal:24},{name:"imageHeight",dispName:"Image Height",
type:"float",min:0,defVal:24},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:12},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.dataStorage.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.1}];mxCellRenderer.defaultShapes.manualInput.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:30},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.loopLimit.prototype.customProperties=
[{name:"size",dispName:"Size",type:"float",min:0,defVal:20},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.offPageConnector.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,defVal:38},{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.display.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,max:1,defVal:.25}];mxCellRenderer.defaultShapes.singleArrow.prototype.customProperties=
[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.doubleArrow.prototype.customProperties=[{name:"arrowWidth",dispName:"Arrow Width",type:"float",min:0,max:1,defVal:.3},{name:"arrowSize",dispName:"Arrowhead Length",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.cross.prototype.customProperties=[{name:"size",dispName:"Size",type:"float",min:0,
max:1,defVal:.2}];mxCellRenderer.defaultShapes.corner.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.tee.prototype.customProperties=[{name:"dx",dispName:"Width1",type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.umlLifeline.prototype.customProperties=[{name:"participant",dispName:"Participant",type:"enum",
defVal:"none",enumList:[{val:"none",dispName:"Default"},{val:"umlActor",dispName:"Actor"},{val:"umlBoundary",dispName:"Boundary"},{val:"umlEntity",dispName:"Entity"},{val:"umlControl",dispName:"Control"}]},{name:"size",dispName:"Height",type:"float",defVal:40,min:0}];mxCellRenderer.defaultShapes.umlFrame.prototype.customProperties=[{name:"width",dispName:"Title Width",type:"float",defVal:60,min:0},{name:"height",dispName:"Title Height",type:"float",defVal:30,min:0}];StyleFormatPanel.prototype.defaultColorSchemes=
[[{fill:"",stroke:""},{fill:"#f5f5f5",stroke:"#666666",font:"#333333"},{fill:"#dae8fc",stroke:"#6c8ebf"},{fill:"#d5e8d4",stroke:"#82b366"},{fill:"#ffe6cc",stroke:"#d79b00"},{fill:"#fff2cc",stroke:"#d6b656"},{fill:"#f8cecc",stroke:"#b85450"},{fill:"#e1d5e7",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 g=StyleFormatPanel.prototype.init;
StyleFormatPanel.prototype.init=function(){var k=this.editorUi.getSelectionState();null!=this.defaultColorSchemes&&0<this.defaultColorSchemes.length&&"image"!=k.style.shape&&!k.containsLabel&&0<k.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));g.apply(this,arguments);null!=k.customProperties&&this.container.appendChild(this.addProperties(this.createPanel(),k.customProperties,k))};var m=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(k){var v=
this.editorUi.getSelectionState();1==v.cells.length?this.addActions(k,["copyStyle","pasteStyle"]):1<=v.cells.length&&this.addActions(k,["pasteStyle","pasteData"]);m.apply(this,arguments);return k};EditorUi.prototype.propertiesCollapsed=!0;BaseFormatPanel.prototype.addProperties=function(k,v,J,N){function T(Ra,za,Ea,C,P){if(null!=Ea.valueChanged)Ea.valueChanged(za,P,J,qa);else{ya.getModel().beginUpdate();try{P=[];var R=[];if(null!=Ea.index){for(var W=[],ia=Ea.parentRow.nextSibling;ia&&ia.getAttribute("data-pName")==
Ra;)W.push(ia.getAttribute("data-pValue")),ia=ia.nextSibling;Ea.index<W.length?null!=C?W.splice(C,1):W[Ea.index]=za:W.push(za);null!=Ea.size&&W.length>Ea.size&&(W=W.slice(0,Ea.size));za=W.join(",");null!=Ea.countProperty&&(ya.setCellStyles(Ea.countProperty,W.length,ya.getSelectionCells()),P.push(Ea.countProperty),R.push(W.length))}ya.setCellStyles(Ra,za,ya.getSelectionCells());P.push(Ra);R.push(za);if(null!=Ea.dependentProps)for(Ra=0;Ra<Ea.dependentProps.length;Ra++){var ka=Ea.dependentPropsDefVal[Ra],
pa=Ea.dependentPropsVals[Ra];if(pa.length>za)pa=pa.slice(0,za);else for(var xa=pa.length;xa<za;xa++)pa.push(ka);pa=pa.join(",");ya.setCellStyles(Ea.dependentProps[Ra],pa,ya.getSelectionCells());P.push(Ea.dependentProps[Ra]);R.push(pa)}if("function"==typeof Ea.onChange)Ea.onChange(ya,za);qa.editorUi.fireEvent(new mxEventObject("styleChanged","keys",P,"values",R,"cells",ya.getSelectionCells()))}finally{ya.getModel().endUpdate()}}}function V(Ra,za){za.style.left="0px";za.style.top="0px";za.style.position=
"relative";za.style.right="0px";za.style.bottom="0px";za.style.width="100%";za.style.maxWidth="100%";za.style.maxHeight="100%";za.style.textAlign="left"}function U(Ra,za,Ea){function C(R){if(null==R||R==mxConstants.NONE)P.style.background="url('"+Dialog.prototype.noColorImage+"')";else if("default"==R)P.style.background="";else{var W=mxUtils.getLightDarkColor(R);mxUtils.isLightDarkColor(R)&&W.light!=W.dark?P.style.background="linear-gradient(to right bottom, "+W.cssText+" 50%, "+mxUtils.invertLightDarkColor(W).cssText+
" 50.3%)":P.style.background=R}}var P=document.createElement("div");P.style.width="32px";P.style.height="8px";P.style.margin="2px";P.style.borderStyle="solid";P.style.borderWidth="1px";C(za);btn=mxUtils.button("",mxUtils.bind(qa,function(R){this.editorUi.pickColor(za,function(W){T(Ra,W,Ea);C(W)});mxEvent.consume(R)}));btn.style.height="18px";btn.style.width="40px";btn.style.marginTop="1px";btn.style.marginLeft="1px";btn.className="geColorBtn";btn.appendChild(P);return btn}function X(Ra,za,Ea,C,P,
R,W){null!=za&&(za=za.split(","),wa.push({name:Ra,values:za,type:Ea,defVal:C,countProperty:P,parentRow:R,isDeletable:!0,flipBkg:W}));btn=mxUtils.button("+",mxUtils.bind(qa,function(ia){for(var ka=R,pa=0;null!=ka.nextSibling;)if(ka.nextSibling.getAttribute("data-pName")==Ra)ka=ka.nextSibling,pa++;else break;var xa={type:Ea,parentRow:R,index:pa,isDeletable:!0,defVal:C,countProperty:P};pa=la(Ra,"",xa,0==pa%2,W);T(Ra,C,xa);ka.parentNode.insertBefore(pa,ka.nextSibling);mxEvent.consume(ia)}));btn.style.height=
"16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function fa(Ra,za,Ea,C,P,R,W){if(0<P){var ia=Array(P);za=null!=za?za.split(","):[];for(var ka=0;ka<P;ka++)ia[ka]=null!=za[ka]?za[ka]:null!=C?C:"";wa.push({name:Ra,values:ia,type:Ea,defVal:C,parentRow:R,flipBkg:W,size:P})}return document.createElement("div")}function na(Ra,za,Ea){var C=document.createElement("input");C.type="checkbox";C.checked="1"==za;mxEvent.addListener(C,"change",function(){T(Ra,C.checked?"1":"0",Ea,null,C)});return C}
function la(Ra,za,Ea,C,P){var R=Ea.dispName,W=Ea.type,ia=document.createElement("tr");ia.className="gePropRow"+(P?"Dark":"")+(C?"Alt":"")+" gePropNonHeaderRow";ia.setAttribute("data-pName",Ra);ia.setAttribute("data-pValue",za);C=!1;null!=Ea.index&&(ia.setAttribute("data-index",Ea.index),R=(null!=R?R:"")+"["+Ea.index+"]",C=!0);var ka=document.createElement("td");ka.className="gePropRowCell";R=mxResources.get(R,null,R);mxUtils.write(ka,R);ka.setAttribute("title",R);C&&(ka.style.textAlign="right");ia.appendChild(ka);
ka=document.createElement("td");ka.className="gePropRowCell";ka.setAttribute("title",null!=za?decodeURIComponent(za):mxResources.get("none"));mxEvent.addListener(ka,"click",mxUtils.bind(qa,function(ua){console.log("click on property2");!mxUtils.isAncestorNode(ia,document.activeElement)&&mxUtils.isAncestorNode(ia.parentNode,document.activeElement)&&null!=document.activeElement&&null!=document.activeElement.blur&&(document.activeElement.blur(),mxEvent.consume(ua))}));if("color"==W)ka.appendChild(U(Ra,
za,Ea));else if("bool"==W||"boolean"==W)ka.appendChild(na(Ra,za,Ea));else if("enum"==W){var pa=Ea.enumList;ka.innerHTML="";var xa=document.createElement("div");xa.className="gePropValue";ka.appendChild(xa);for(P=0;P<pa.length;P++)if(R=pa[P],R.val==za){mxUtils.write(xa,mxResources.get(R.dispName,null,R.dispName));break}mxEvent.addListener(ka,"click",mxUtils.bind(qa,function(ua){var Ia=mxEvent.getSource(ua);if(!(Ia!=ka&&Ia!=xa||mxEvent.isConsumed(ua))){xa.innerHTML="";var Va=document.createElement("select"),
Wa=null;V(ka,Va);for(ua=0;ua<pa.length;ua++){Ia=pa[ua];var Ta=document.createElement("option");Ta.value=mxUtils.htmlEntities(Ia.val);mxUtils.write(Ta,mxResources.get(Ia.dispName,null,Ia.dispName));Va.appendChild(Ta);null==Ia.val&&(Ta.value="null",Wa=Ta)}Va.value=null==za&&null!=Wa?"null":za;xa.appendChild(Va);mxEvent.addListener(Va,"change",function(){var ab=mxUtils.htmlEntities(Va.value);if(Va[Va.selectedIndex]==Wa||"null"==ab.value)ab=null;T(Ra,ab,Ea)});Va.focus();mxEvent.addListener(Va,"blur",
function(){xa.innerHTML="";for(var ab=0;ab<pa.length;ab++){var Pa=pa[ab];if(Pa.val==Va.value){mxUtils.write(xa,mxResources.get(Pa.dispName,null,Pa.dispName));break}}})}}))}else if("dynamicArr"==W)ka.appendChild(X(Ra,za,Ea.subType,Ea.subDefVal,Ea.countProperty,ia,P));else if("staticArr"==W)ka.appendChild(fa(Ra,za,Ea.subType,Ea.subDefVal,Ea.size,ia,P));else if("readOnly"==W)P=document.createElement("input"),P.setAttribute("readonly",""),P.value=za,P.style.borderWidth="0px","id"==Ra?(ia.firstChild.innerHTML=
"",ia.firstChild.setAttribute("colspan","2"),P.style.flexGrow="1",P.style.marginLeft="4px",P.style.textAlign="center",P.setAttribute("title",za),R=document.createElement("div"),mxUtils.write(R,mxResources.get("id")),R.style.display="inline-flex",R.style.alignItems="center",R.style.width="100%",R.appendChild(P),ia.firstChild.appendChild(R)):(P.style.width="96px",ka.appendChild(P));else{ka.innerHTML="";var ta=document.createElement("div");ta.className="gePropValue";ka.appendChild(ta);ta.innerHTML=mxUtils.htmlEntities(decodeURIComponent(za));
mxEvent.addListener(ka,"click",mxUtils.bind(qa,function(ua){function Ia(){var Ta=Wa.value;Ta=0==Ta.length&&"string"!=W&&"numbers"!=W?0:Ta;Ea.allowAuto&&(null!=Ta.trim&&"auto"==Ta.trim().toLowerCase()?(Ta="auto",W="string"):(Ta=parseFloat(Ta),Ta=isNaN(Ta)?0:Ta));null!=Ea.min&&Ta<Ea.min?Ta=Ea.min:null!=Ea.max&&Ta>Ea.max&&(Ta=Ea.max);var ab=null;try{ab="numbers"==W?Ta.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==W?parseInt(Ta):Ta)+"")}catch(Pa){}T(Ra,ab,Ea,null,Wa)}var Va=mxEvent.getSource(ua);
if(!(Va!=ka&&Va!=ta||mxEvent.isConsumed(ua))){ta.innerHTML="";var Wa=document.createElement("input");V(ta,Wa);Wa.value=decodeURIComponent(za);Wa.className="gePropEditor";"int"!=W&&"float"!=W||Ea.allowAuto||(Wa.type="number",Wa.step="int"==W?"1":"any",null!=Ea.min&&(Wa.min=parseFloat(Ea.min)),null!=Ea.max&&(Wa.max=parseFloat(Ea.max)));ta.appendChild(Wa);mxEvent.addListener(Wa,"keypress",function(Ta){13==Ta.keyCode&&Ia()});Wa.focus();mxEvent.addListener(Wa,"blur",function(){Ia()})}}))}Ea.isDeletable&&
(P=mxUtils.button("-",mxUtils.bind(qa,function(ua){T(Ra,"",Ea,Ea.index);mxEvent.consume(ua)})),P.style.height="16px",P.style.width="25px",P.style.float="right",P.className="geColorBtn",ka.appendChild(P));ia.appendChild(ka);return ia}var qa=this,ya=this.editorUi.editor.graph,wa=[],Ja=document.createElement("table");Ja.className="geProperties geFullWidthElement";var Aa=document.createElement("tr");Aa.className="gePropHeader";var Ba=document.createElement("th");Ba.className="gePropHeaderCell";Ba.style.paddingLeft=
"16px";Ba.style.backgroundRepeat="no-repeat";Ba.style.backgroundPosition="-2px 50%";Ba.style.backgroundSize="20px";mxUtils.write(Ba,mxResources.get("property"));Aa.style.cursor="pointer";var Ga=function(){var Ra=Ja.querySelectorAll(".gePropNonHeaderRow");if(qa.editorUi.propertiesCollapsed){Ba.style.backgroundImage="url('"+Editor.arrowRightImage+"')";var za="none";for(var Ea=k.childNodes.length-1;0<=Ea;Ea--)try{var C=k.childNodes[Ea],P=C.nodeName.toUpperCase();"INPUT"!=P&&"SELECT"!=P||k.removeChild(C)}catch(R){}}else Ba.style.backgroundImage=
"url('"+Editor.arrowDownImage+"')",za="";for(Ea=0;Ea<Ra.length;Ea++)Ra[Ea].style.display=za};mxEvent.addListener(Aa,"click",function(){qa.editorUi.propertiesCollapsed=!qa.editorUi.propertiesCollapsed;Ga()});Aa.appendChild(Ba);var Ma=document.createElement("th");Ma.className="gePropHeaderCell";Ma.style.paddingLeft="4px";mxUtils.write(Ma,mxResources.get("value"));Aa.appendChild(Ma);Ja.appendChild(Aa);var ra=Ma=!1;Aa=null;1==J.vertices.length&&0==J.edges.length?Aa=J.vertices[0].id:0==J.vertices.length&&
1==J.edges.length&&(Aa=J.edges[0].id);null==Aa||N||Ja.appendChild(la("id",mxUtils.htmlEntities(Aa),{dispName:"id",type:"readOnly"},!0,!1));for(var Ca in v)if(N=v[Ca],!N.primary&&("function"!=typeof N.isVisible||N.isVisible(J,this))){var Da=null!=N.getValue?N.getValue(J,this):null!=J.style[Ca]?mxUtils.htmlEntities(J.style[Ca]+""):null!=N.getDefaultValue?N.getDefaultValue(J,this):N.defVal;if("separator"==N.type)ra=!ra;else{if("staticArr"==N.type)N.size=parseInt(J.style[N.sizeProperty]||v[N.sizeProperty].defVal)||
0;else if(null!=N.dependentProps){var va=N.dependentProps,Na=[],Oa=[];for(Aa=0;Aa<va.length;Aa++){var Qa=J.style[va[Aa]];Oa.push(v[va[Aa]].subDefVal);Na.push(null!=Qa?Qa.split(","):[])}N.dependentPropsDefVal=Oa;N.dependentPropsVals=Na}Ja.appendChild(la(Ca,Da,N,Ma,ra));Ma=!Ma}}for(Aa=0;Aa<wa.length;Aa++)for(N=wa[Aa],v=N.parentRow,Ca=0;Ca<N.values.length;Ca++)Ma=la(N.name,N.values[Ca],{type:N.type,parentRow:N.parentRow,isDeletable:N.isDeletable,index:Ca,defVal:N.defVal,countProperty:N.countProperty,
size:N.size},0==Ca%2,N.flipBkg),v.parentNode.insertBefore(Ma,v.nextSibling),v=Ma;k.appendChild(Ja);Ga();return k};StyleFormatPanel.prototype.addStyles=function(k){if(null!=this.defaultColorSchemes){var v=this.editorUi,J=v.editor.graph,N=document.createElement("div");N.style.padding="6px 20px 0 24px";k.appendChild(N);var T=document.createElement("div");T.className="geSwitcher";T.style.padding="4px 18px 6px 0px";for(var V=[],U=0;U<this.defaultColorSchemes.length;U++){var X=document.createElement("div");
X.className="geSwitcherDot";mxUtils.bind(this,function(ya){mxEvent.addListener(X,"click",mxUtils.bind(this,function(){fa(ya)}))})(U);V.push(X);T.appendChild(X)}var fa=mxUtils.bind(this,function(ya){null!=V[ya]&&(null!=this.format.currentScheme&&null!=V[this.format.currentScheme]&&(V[this.format.currentScheme].style.background="transparent"),this.format.currentScheme=ya,na(this.defaultColorSchemes[this.format.currentScheme]),V[this.format.currentScheme].style.background="#84d7ff")}),na=mxUtils.bind(this,
function(ya){var wa=mxUtils.clone(J.defaultVertexStyle);wa[mxConstants.STYLE_STROKECOLOR]=null!=wa[mxConstants.STYLE_STROKECOLOR]?wa[mxConstants.STYLE_STROKECOLOR]:"default";wa[mxConstants.STYLE_FILLCOLOR]=null!=wa[mxConstants.STYLE_FILLCOLOR]?wa[mxConstants.STYLE_FILLCOLOR]:"default";wa[mxConstants.STYLE_FONTCOLOR]=null!=wa[mxConstants.STYLE_FONTCOLOR]?wa[mxConstants.STYLE_FONTCOLOR]:"default";J.replaceDefaultColors(new mxCell,wa);var Ja=mxUtils.bind(this,function(Ba){var Ga=mxUtils.button("",mxUtils.bind(this,
function(Ca){J.getModel().beginUpdate();try{for(var Da=v.getSelectionState().cells,va=0;va<Da.length;va++){var Na=J.getModel().getStyle(Da[va]);null!=Ba?(mxEvent.isShiftDown(Ca)||(Na=""==Ba.fill||null==Ba.fill?mxUtils.setStyle(Na,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(Na,mxConstants.STYLE_FILLCOLOR,Ba.fill),Na=""==Ba.gradient||null==Ba.gradient?mxUtils.setStyle(Na,mxConstants.STYLE_GRADIENTCOLOR,null):mxUtils.setStyle(Na,mxConstants.STYLE_GRADIENTCOLOR,Ba.gradient),mxEvent.isControlDown(Ca)||
mxClient.IS_MAC&&mxEvent.isMetaDown(Ca)||!J.getModel().isVertex(Da[va])||(Na=""==Ba.font||null==Ba.font?mxUtils.setStyle(Na,mxConstants.STYLE_FONTCOLOR,null):mxUtils.setStyle(Na,mxConstants.STYLE_FONTCOLOR,Ba.font))),mxEvent.isAltDown(Ca)||(Na=""==Ba.stroke||null==Ba.fill?mxUtils.setStyle(Na,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(Na,mxConstants.STYLE_STROKECOLOR,Ba.stroke))):(Na=mxUtils.setStyle(Na,mxConstants.STYLE_FILLCOLOR,null),Na=mxUtils.setStyle(Na,mxConstants.STYLE_STROKECOLOR,
null),Na=mxUtils.setStyle(Na,mxConstants.STYLE_GRADIENTCOLOR,null),J.getModel().isVertex(Da[va])&&(Na=mxUtils.setStyle(Na,mxConstants.STYLE_FONTCOLOR,null)));J.getModel().setStyle(Da[va],Na)}}finally{J.getModel().endUpdate()}}));Ga.className="geStyleButton";Ga.style.width="36px";Ga.style.height=10>=this.defaultColorSchemes.length?"24px":"30px";Ga.style.margin="0px 6px 6px 0px";if(null!=Ba){var Ma="1px solid";null!=Ba.border&&(Ma=Ba.border);if(null!=Ba.gradient)Ga.style.backgroundImage="linear-gradient("+
mxUtils.getLightDarkColor(Ba.fill).cssText+" 0px,"+mxUtils.getLightDarkColor(Ba.gradient).cssText+" 100%)";else if(Ba.fill==mxConstants.NONE)Ga.style.background="url('"+Dialog.prototype.noColorImage+"')";else if(null==Ba.fill||""==Ba.fill)Ga.style.backgroundColor=mxUtils.getLightDarkColor(mxUtils.getValue(wa,mxConstants.STYLE_FILLCOLOR,"#ffffff")).cssText;else{var ra=mxUtils.getLightDarkColor(Ba.fill);Ga.style.backgroundImage="linear-gradient(to right bottom, "+ra.cssText+" 50%, "+ra.light+" 50.3%)"}null==
Ba.stroke||Ba.stroke==mxConstants.NONE?Ga.style.border=Ma+" transparent":""==Ba.stroke?Ga.style.border="1px solid "+mxUtils.getLightDarkColor(mxUtils.getValue(wa,mxConstants.STYLE_STROKECOLOR,"#000000")).cssText:(ra=mxUtils.getLightDarkColor(Ba.stroke),Ga.style.border=Ma+" "+ra.cssText,Ga.style.borderRightColor=ra.light,Ga.style.borderBottomColor=Ga.style.borderRightColor);null!=Ba.title&&Ga.setAttribute("title",Ba.title)}else Ma=mxUtils.getValue(wa,mxConstants.STYLE_FILLCOLOR,"#ffffff"),ra=mxUtils.getValue(wa,
mxConstants.STYLE_STROKECOLOR,"#000000"),Ga.style.backgroundColor=Ma,Ga.style.border="1px solid "+ra;Ga.style.borderRadius="0";N.appendChild(Ga);null!=Ba&&null!=Ba.gradient&&(Ma=Ga.cloneNode(!1),Ma.style.backgroundImage="linear-gradient(light-dark(transparent, "+mxUtils.getLightDarkColor(Ba.fill).light+") 0px, light-dark(transparent, "+mxUtils.getLightDarkColor(Ba.gradient).light+") 100%)",Ma.style.clipPath="polygon(0 100%, 100% 0, 100% 100%)",Ma.style.backgroundColor="transparent",N.appendChild(Ma),
Ma.style.marginLeft="-42px",mxEvent.addListener(Ma,"click",function(){Ga.click()}))});N.innerText="";if(null!=ya)for(var Aa=0;Aa<ya.length;Aa++)0<Aa&&0==mxUtils.mod(Aa,4)&&mxUtils.br(N),Ja(ya[Aa])});null==this.format.currentScheme?fa(Math.min(V.length-1,Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0)):fa(this.format.currentScheme);U=10>=this.defaultColorSchemes.length?43:23;var la=document.createElement("div");la.className="geButton";la.style.cssText="position:absolute;left:0px;bottom:"+U+"px;width:20px;background-image:url("+
Editor.chevronLeftImage+");";mxEvent.addListener(la,"click",mxUtils.bind(this,function(){fa(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var qa=document.createElement("div");qa.className="geButton";qa.style.cssText="position:absolute;left:186px;bottom:"+U+"px;width:20px;background-image:url("+Editor.chevronRightImage+");";1<this.defaultColorSchemes.length&&(k.appendChild(la),k.appendChild(qa));mxEvent.addListener(qa,"click",mxUtils.bind(this,function(){fa(mxUtils.mod(this.format.currentScheme+
1,this.defaultColorSchemes.length))}));na(this.defaultColorSchemes[this.format.currentScheme]);10>=this.defaultColorSchemes.length&&k.appendChild(T)}return k}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.isGoogleFontUrl=function(k){return k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS||
k.substring(0,Editor.GOOGLE_FONTS_CSS2.length)==Editor.GOOGLE_FONTS_CSS2};Graph.isCssFontUrl=function(k){return Graph.isGoogleFontUrl(k)};Graph.rewriteGoogleFontUrl=function(k){null!=k&&k.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS&&(k=Editor.GOOGLE_FONTS_CSS2+k.substring(Editor.GOOGLE_FONTS.length)+":wght@400;500");return k};Graph.createFontElement=function(k,v){var J=Graph.fontMapping[v];null==J&&Graph.isCssFontUrl(v)?(k=document.createElement("link"),k.setAttribute("rel","stylesheet"),
k.setAttribute("type","text/css"),k.setAttribute("charset","UTF-8"),k.setAttribute("href",Graph.rewriteGoogleFontUrl(v))):(null==J&&(J='@font-face {\nfont-family: "'+k+'";\nsrc: url("'+v+'");\n}'),k=document.createElement("style"),mxUtils.write(k,J));return k};Graph.addRecentCustomFont=function(k,v){};Graph.addFont=function(k,v,J,N){if(null!=k&&0<k.length&&null!=v&&0<v.length){N=null!=N?N:Graph.customFontElements;var T=k.toLowerCase();if("helvetica"!=T&&"arial"!=k&&"sans-serif"!=T){var V=N[T];null!=
V&&V.url!=v&&(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:k,url:v,elt:Graph.createFontElement(k,V)},N[T]=V,v=N==Graph.customFontElements?document.getElementsByTagName("head")[0]:null,null!=J&&("link"==V.elt.nodeName.toLowerCase()?(V.elt.onload=J,V.elt.onerror=J):J()),null!=v&&v.appendChild(V.elt)):null!=J&&J()}else null!=J&&J()}else null!=J&&J();return k};Graph.getFontUrl=function(k,v){k=Graph.customFontElements[k.toLowerCase()];
null!=k&&(v=k.url);return v};Graph.processFontAttributes=function(k){k=k.getElementsByTagName("*");for(var v=0;v<k.length;v++){var J=k[v].getAttribute("data-font-src");if(null!=J){var N="FONT"==k[v].nodeName?k[v].getAttribute("face"):k[v].style.fontFamily;null!=N&&Graph.addFont(N,J)}}};Graph.processFontStyle=function(k){if(null!=k){var v=mxUtils.getValue(k,"fontSource",null);if(null!=v){var J=mxUtils.getValue(k,mxConstants.STYLE_FONTFAMILY,null);if(null!=J)try{Graph.addFont(J,decodeURIComponent(v))}catch(N){}}}return k};
Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize="3";Graph.prototype.hiddenTags=[];Graph.prototype.defaultMathEnabled=!1;var n=Graph.prototype.init;Graph.prototype.init=function(){function k(T){v=
T}n.apply(this,arguments);this.hiddenTags=[];window.mxFreehand&&(this.freehand=new mxFreehand(this));var v=null;mxEvent.addListener(this.container,"mouseenter",k);mxEvent.addListener(this.container,"mousemove",k);mxEvent.addListener(this.container,"mouseleave",function(T){v=null});this.isMouseInsertPoint=function(){return null!=v};var J=this.getInsertPoint;this.getInsertPoint=function(){return null!=v?this.getPointForEvent(v):J.apply(this,arguments)};var N=this.layoutManager.getLayout;this.layoutManager.getLayout=
function(T){var V=this.graph.getCellStyle(T);if(null!=V&&"rack"==V.childLayout){var U=new mxStackLayout(this.graph,!1);U.gridSize=null!=V.rackUnitSize?parseFloat(V.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;U.marginLeft=V.marginLeft||0;U.marginRight=V.marginRight||0;U.marginTop=V.marginTop||0;U.marginBottom=V.marginBottom||0;U.allowGaps=V.allowGaps||0;U.horizontal="1"==mxUtils.getValue(V,"horizontalRack","0");U.resizeParent=!1;U.fill=!0;return U}return N.apply(this,
arguments)};this.updateGlobalUrlVariables()};var x=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(k,v){return Graph.processFontStyle(x.apply(this,arguments))};var F=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(k,v,J,N,T,V,U,X,fa,na,la,qa){F.apply(this,arguments);Graph.processFontAttributes(qa)};var I=mxText.prototype.redraw;mxText.prototype.redraw=function(){I.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&
Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(k,v,J,N){function T(){for(var Aa=X.getSelectionCells(),Ba=[],Ga=0;Ga<Aa.length;Ga++)X.isCellVisible(Aa[Ga])&&Ba.push(Aa[Ga]);X.setSelectionCells(Ba)}function V(Aa){X.setHiddenTags(Aa?[]:fa.slice());T();X.refresh()}function U(Aa,Ba){la.innerText="";if(0<Aa.length){var Ga=document.createElement("table");Ga.setAttribute("cellpadding","2");Ga.style.boxSizing="border-box";Ga.style.tableLayout="fixed";Ga.style.width="100%";
var Ma=document.createElement("tbody");if(null!=Aa&&0<Aa.length)for(var ra=0;ra<Aa.length;ra++)(function(Ca){function Da(){var za=X.getCellsForTags([Ca],null,null,!0);X.isEnabled()?X.setSelectionCells(za):X.highlightCells(za,null,null,70)}var va=0>mxUtils.indexOf(X.hiddenTags,Ca),Na=document.createElement("tr"),Oa=document.createElement("td");Oa.style.align="center";Oa.style.width="16px";var Qa=document.createElement("img");Qa.setAttribute("src",va?Editor.visibleImage:Editor.hiddenImage);Qa.setAttribute("title",
mxResources.get(va?"hideIt":"show",[Ca]));mxUtils.setOpacity(Qa,va?75:25);Qa.className="geAdaptiveAsset";Qa.style.verticalAlign="middle";Qa.style.cursor="pointer";Qa.style.width="16px";if(v||Editor.isDarkMode())Qa.style.filter="invert(100%)";Oa.appendChild(Qa);mxEvent.addListener(Qa,"click",function(za){mxEvent.isShiftDown(za)?V(0<=mxUtils.indexOf(X.hiddenTags,Ca)):(X.toggleHiddenTag(Ca),T(),X.refresh());mxEvent.consume(za)});Na.appendChild(Oa);Oa=document.createElement("td");Oa.style.align="center";
Oa.style.width="16px";Qa=document.createElement("img");Qa.setAttribute("src",Editor.selectImage);Qa.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Qa,va?75:25);Qa.className="geAdaptiveAsset";Qa.style.verticalAlign="middle";Qa.style.cursor="pointer";Qa.style.width="16px";if(v||Editor.isDarkMode())Qa.style.filter="invert(100%)";mxEvent.addListener(Qa,"click",function(za){V(!0);Da();mxEvent.consume(za)});Oa.appendChild(Qa);Na.appendChild(Oa);Oa=document.createElement("td");Oa.style.overflow=
"hidden";Oa.style.whiteSpace="nowrap";Oa.style.textOverflow="ellipsis";Oa.style.verticalAlign="middle";Oa.style.cursor="pointer";Oa.setAttribute("title",Ca);a=document.createElement("a");mxUtils.write(a,Ca);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,va?100:40);Oa.appendChild(a);mxEvent.addListener(Oa,"click",function(za){if(mxEvent.isShiftDown(za))V(!0),Da();else if(va&&0<X.hiddenTags.length)V(!0);else{var Ea=fa.slice(),C=mxUtils.indexOf(Ea,Ca);Ea.splice(C,1);
X.setHiddenTags(Ea);T();X.refresh()}mxEvent.consume(za)});Na.appendChild(Oa);if(X.isEnabled()){Oa=document.createElement("td");Oa.style.verticalAlign="middle";Oa.style.textAlign="center";Oa.style.width="18px";if(null==Ba){Oa.style.align="center";Oa.style.width="16px";Qa=document.createElement("img");Qa.setAttribute("src",Editor.trashImage);Qa.setAttribute("title",mxResources.get("removeIt",[Ca]));mxUtils.setOpacity(Qa,va?75:25);Qa.className="geAdaptiveAsset";Qa.style.verticalAlign="middle";Qa.style.cursor=
"pointer";Qa.style.width="16px";if(v||Editor.isDarkMode())Qa.style.filter="invert(100%)";mxEvent.addListener(Qa,"click",function(za){var Ea=mxUtils.indexOf(fa,Ca);0<=Ea&&fa.splice(Ea,1);X.removeTagsForCells(X.model.getDescendants(X.model.getRoot()),[Ca]);X.refresh();mxEvent.consume(za)});Oa.appendChild(Qa)}else{var Ra=document.createElement("input");Ra.setAttribute("type","checkbox");Ra.style.margin="0px";Ra.defaultChecked=null!=Ba&&0<=mxUtils.indexOf(Ba,Ca);Ra.checked=Ra.defaultChecked;Ra.style.background=
"transparent";Ra.setAttribute("title",mxResources.get(Ra.defaultChecked?"removeIt":"add",[Ca]));mxEvent.addListener(Ra,"change",function(za){Ra.checked?X.addTagsForCells(X.getSelectionCells(),[Ca]):X.removeTagsForCells(X.getSelectionCells(),[Ca]);mxEvent.consume(za)});Oa.appendChild(Ra)}Na.appendChild(Oa)}Ma.appendChild(Na)})(Aa[ra]);Ga.appendChild(Ma);la.appendChild(Ga)}}var X=this,fa=X.hiddenTags.slice(),na=document.createElement("div");na.style.userSelect="none";na.style.overflow="hidden";na.style.padding=
"10px";na.style.height="100%";var la=document.createElement("div");la.style.position="absolute";la.style.boxSizing="border-box";la.style.userSelect="none";la.style.overflow="auto";la.style.padding="3px";la.style.left="0px";la.style.right="0px";la.style.top="0px";la.style.bottom="0px";na.appendChild(la);X.addListener(mxEvent.ROOT,function(){fa=X.hiddenTags.slice()});var qa=mxUtils.bind(this,function(Aa,Ba){if(k()){Aa=X.getAllTags();for(Ba=0;Ba<Aa.length;Ba++)0>mxUtils.indexOf(fa,Aa[Ba])&&fa.push(Aa[Ba]);
fa.sort();X.isSelectionEmpty()?U(fa):U(fa,X.getCommonTagsForCells(X.getSelectionCells()))}});X.selectionModel.addListener(mxEvent.CHANGE,qa);X.model.addListener(mxEvent.CHANGE,qa);X.addListener(mxEvent.REFRESH,qa);var ya=document.createElement("div");ya.className="geToolbarContainer geDialogToolbar";ya.style.position="absolute";ya.style.display="flex";ya.style.bottom="0px";ya.style.left="0px";ya.style.right="0px";ya.style.height="32px";ya.style.overflow="hidden";ya.style.padding="3px 4px 4px 4px";
ya.style.borderWidth="1px 0px 0px 0px";ya.style.borderStyle="solid";ya.style.whiteSpace="nowrap";if(X.isEnabled()){la.style.bottom="32px";var wa=document.createElement("a");wa.className="geButton";var Ja=wa.cloneNode(!1);Ja.style.backgroundImage="url("+Editor.visibleImage+")";Ja.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(Ja,"click",function(Aa){X.setHiddenTags([]);mxEvent.isShiftDown(Aa)||(fa=X.hiddenTags.slice());T();X.refresh();mxEvent.consume(Aa)});ya.appendChild(Ja);null!=
J&&(wa=wa.cloneNode(!1),wa.style.backgroundImage="url("+Editor.plusImage+")",wa.setAttribute("title",mxResources.get("add")),mxEvent.addListener(wa,"click",function(Aa){J(fa,function(Ba){fa=Ba;qa()});mxEvent.consume(Aa)}),ya.appendChild(wa));na.appendChild(ya)}null!=N&&ya.appendChild(N);return{div:na,refresh:qa}};Graph.prototype.getCustomFonts=function(){var k=this.extFonts;k=null!=k?k.slice():[];for(var v in Graph.customFontElements){var J=Graph.customFontElements[v];k.push({name:J.name,url:J.url})}return k};
Graph.prototype.setFont=function(k,v){Graph.addFont(k,v);var J=Editor.guid();document.execCommand("fontname",!1,J);for(var N=this.cellEditor.textarea.getElementsByTagName("font"),T=!1,V=0;V<N.length;V++)N[V].getAttribute("face")==J&&(T=!0,N[V].setAttribute("face",k),null!=v?N[V].setAttribute("data-font-src",v):N[V].removeAttribute("data-font-src"));T||document.execCommand("fontname",!1,k)};var M=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return M.apply(this,arguments)&&
(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var k=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=k)for(var v in k)this.globalVars[v]=k[v]}catch(J){null!=window.console&&console.log("Error in vars URL parameter: "+J)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):
{}};var L=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(k){var v=L.apply(this,arguments);null==v&&null!=this.globalVars&&(v=this.globalVars[k]);return v};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var k=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(k.ownerDocument)).decode(k)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var K=Graph.prototype.getSvg;Graph.prototype.getSvg=
function(k,v,J,N,T,V,U,X,fa,na,la,qa,ya,wa,Ja,Aa){var Ba=K.apply(this,arguments);if(null!=qa){var Ga=Ba.getAttribute("style");null==Ga&&(Ga="");qa="auto"==qa||"none"==this.getAdaptiveColors()?"none"==this.getAdaptiveColors()?"light":"light dark":qa;Ba.setAttribute("style",Ga+(" color-scheme: "+qa+";"))}var Ma=this.getCustomFonts();if(la&&0<Ma.length){var ra=Ba.ownerDocument;Ga=null!=ra.createElementNS?ra.createElementNS(mxConstants.NS_SVG,"style"):ra.createElement("style");null!=ra.setAttributeNS?
Ga.setAttributeNS("type","text/css"):Ga.setAttribute("type","text/css");for(var Ca="",Da="",va=0;va<Ma.length;va++){var Na=Ma[va].name,Oa=Ma[va].url;Graph.isCssFontUrl(Oa)?Ca+="@import url("+Graph.rewriteGoogleFontUrl(Oa)+");\n":Da+='@font-face {\nfont-family: "'+Na+'";\nsrc: url("'+Oa+'");\n}\n'}Ga.appendChild(ra.createTextNode(Ca+Da));Ba.getElementsByTagName("defs")[0].appendChild(Ga)}Editor.replaceSvgDataUris&&null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&EditorUi.embedSvgImages(Ba);
this.mathEnabled&&(document.body.appendChild(Ba),Editor.MathJaxRender(Ba),Ba.parentNode.removeChild(Ba),Ga=Ba.ownerDocument.getElementById("MJX-SVG-styles"),null!=Ga&&Ba.getElementsByTagName("defs")[0].appendChild(Ga.cloneNode(!0)));return Ba};var aa=mxCellRenderer.prototype.destroy;mxCellRenderer.prototype.destroy=function(k){aa.apply(this,arguments);null!=k.secondLabel&&(k.secondLabel.destroy(),k.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(k){return[k.shape,k.text,k.secondLabel,
k.control]};var ja=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){ja.apply(this,arguments);this.enumerationState=0};var ca=mxGraphView.prototype.stateValidated;mxGraphView.prototype.stateValidated=function(k){null!=k.shape&&this.redrawEnumerationState(k);return ca.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(k){k=decodeURIComponent(mxUtils.getValue(k.style,"enumerateValue",""));""==k&&(k=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+
mxUtils.htmlEntities(k)+"</div>"};mxGraphView.prototype.redrawEnumerationState=function(k){var v="1"==mxUtils.getValue(k.style,"enumerate",0);v&&null==k.secondLabel?(k.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),k.secondLabel.size=12,k.secondLabel.state=k,k.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(k,k.secondLabel)):v||null==k.secondLabel||(k.secondLabel.destroy(),k.secondLabel=null);v=k.secondLabel;if(null!=
v){var J=k.view.scale,N=this.createEnumerationValue(k);k=this.graph.model.isVertex(k.cell)?new mxRectangle(k.x+k.width-4*J,k.y+4*J,0,0):mxRectangle.fromPoint(k.view.getPoint(k));v.bounds.equals(k)&&v.value==N&&v.scale==J||(v.bounds=k,v.value=N,v.scale=J,v.redraw())}};var ba=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();ba.apply(this,arguments)};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&
(this.setBackgroundImage(this.backgroundImage),this.view.validateBackgroundImage())};var oa=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){oa.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(k,v){"data:action/json,"==k.substring(0,17)&&(k=JSON.parse(k.substring(17)),null!=k.actions&&this.executeCustomActions(k.actions,null,v))};Graph.prototype.executeCustomActions=function(k,v,J){if(this.executingCustomActions)this.stoppingCustomActions=
!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var N=!1,T=0,V=0,U=mxUtils.bind(this,function(){N||(N=!0,this.model.beginUpdate())}),X=mxUtils.bind(this,function(){N&&(N=!1,this.model.endUpdate())}),fa=mxUtils.bind(this,function(){0<T&&T--;0==T&&na()}),na=mxUtils.bind(this,function(){if(V<k.length){var la=
this.stoppingCustomActions,qa=k[V++],ya=[];if(null!=qa.open)if(X(),this.isCustomLink(qa.open)){if(!this.customLinkClicked(qa.open,J))return}else this.openLink(qa.open);null==qa.wait||la||(this.pendingExecuteNextAction=mxUtils.bind(this,function(){this.pendingWaitThread=this.pendingExecuteNextAction=null;fa()}),T++,this.pendingWaitThread=window.setTimeout(this.pendingExecuteNextAction,""!=qa.wait?parseInt(qa.wait):1E3),X());null!=qa.opacity&&null!=qa.opacity.value&&Graph.setOpacityForNodes(this.getNodesForCells(this.getCellsForAction(qa.opacity,
!0)),qa.opacity.value);null!=qa.fadeIn&&(T++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeIn,!0)),0,1,fa,la?0:qa.fadeIn.delay));null!=qa.fadeOut&&(T++,Graph.fadeNodes(this.getNodesForCells(this.getCellsForAction(qa.fadeOut,!0)),1,0,fa,la?0:qa.fadeOut.delay));null!=qa.wipeIn&&(ya=ya.concat(this.createWipeAnimations(this.getCellsForAction(qa.wipeIn,!0),!0)));null!=qa.wipeOut&&(ya=ya.concat(this.createWipeAnimations(this.getCellsForAction(qa.wipeOut,!0),!1)));null!=qa.toggle&&
(U(),this.toggleCells(this.getCellsForAction(qa.toggle,!0)));if(null!=qa.show){U();var wa=this.getCellsForAction(qa.show,!0);Graph.setOpacityForNodes(this.getNodesForCells(wa),1);this.setCellsVisible(wa,!0)}null!=qa.hide&&(U(),wa=this.getCellsForAction(qa.hide,!0),Graph.setOpacityForNodes(this.getNodesForCells(wa),0),this.setCellsVisible(wa,!1));null!=qa.toggleStyle&&null!=qa.toggleStyle.key&&(U(),this.toggleCellStyles(qa.toggleStyle.key,null!=qa.toggleStyle.defaultValue?qa.toggleStyle.defaultValue:
"0",this.getCellsForAction(qa.toggleStyle,!0)));null!=qa.style&&null!=qa.style.key&&(U(),this.setCellStyles(qa.style.key,qa.style.value,this.getCellsForAction(qa.style,!0)));wa=[];null!=qa.select&&this.isEnabled()&&(wa=this.getCellsForAction(qa.select),this.setSelectionCells(wa));null!=qa.highlight&&(wa=this.getCellsForAction(qa.highlight),this.highlightCells(wa,qa.highlight.color,qa.highlight.duration,qa.highlight.opacity));null!=qa.scroll&&(wa=this.getCellsForAction(qa.scroll));null!=qa.viewbox&&
this.fitWindow(qa.viewbox,qa.viewbox.border);0<wa.length&&this.scrollCellToVisible(wa[0]);null!=J&&null!=qa.explore&&Graph.exploreFromCell(this,J,qa.explore);if(null!=qa.tags){if(null!=qa.tags.toggle){var Ja=qa.tags.toggle;0==Ja.length&&(Ja=this.getAllTags());for(wa=0;wa<Ja.length;wa++)this.toggleHiddenTag(Ja[wa])}Ja=null;null!=qa.tags.hidden&&(null==Ja&&(Ja=[]),Ja=Ja.concat(qa.tags.hidden));if(null!=qa.tags.visible){null==Ja&&(Ja=[]);var Aa=this.getAllTags();for(wa=0;wa<Aa.length;wa++)0>mxUtils.indexOf(qa.tags.visible,
Aa[wa])&&0>mxUtils.indexOf(Ja,Aa[wa])&&Ja.push(Aa[wa])}null!=Ja&&this.setHiddenTags(Ja);this.refresh()}0<ya.length&&(T++,this.executeAnimations(ya,fa,la?1:qa.steps,la?0:qa.delay));0==T?na():X()}else this.stoppingCustomActions=this.executingCustomActions=!1,X(),null!=v&&v()});na()}};Graph.prototype.doUpdateCustomLinksForCell=function(k,v){var J=this.getLinkForCell(v);null!=J&&"data:action/json,"==J.substring(0,17)&&this.setLinkForCell(v,this.updateCustomLink(k,J));if(this.isHtmlLabel(v)){var N=document.createElement("div");
N.innerHTML=Graph.sanitizeHtml(this.getLabel(v));for(var T=N.getElementsByTagName("a"),V=!1,U=0;U<T.length;U++)J=T[U].getAttribute("href"),null!=J&&"data:action/json,"==J.substring(0,17)&&(T[U].setAttribute("href",this.updateCustomLink(k,J)),V=!0);V&&this.labelChanged(v,N.innerHTML)}};Graph.prototype.updateCustomLink=function(k,v){if("data:action/json,"==v.substring(0,17))try{var J=JSON.parse(v.substring(17));null!=J.actions&&(this.updateCustomLinkActions(k,J.actions),v="data:action/json,"+JSON.stringify(J))}catch(N){}return v};
Graph.prototype.updateCustomLinkActions=function(k,v){for(var J=0;J<v.length;J++){var N=v[J],T;for(T in N)this.updateCustomLinkAction(k,N[T],"cells"),this.updateCustomLinkAction(k,N[T],"excludeCells")}};Graph.prototype.updateCustomLinkAction=function(k,v,J){if(null!=v&&null!=v[J]){for(var N=[],T=0;T<v[J].length;T++)if("*"==v[J][T])N.push(v[J][T]);else{var V=k[v[J][T]];null!=V?""!=V&&N.push(V):N.push(v[J][T])}v[J]=N}};Graph.prototype.getCellsForAction=function(k,v){v=this.getCellsById(k.cells).concat(this.getCellsForTags(k.tags,
null,v));if(null!=k.excludeCells){for(var J=[],N=0;N<v.length;N++)0>k.excludeCells.indexOf(v[N].id)&&J.push(v[N]);v=J}return v};Graph.prototype.getCellsById=function(k){var v=[];if(null!=k)for(var J=0;J<k.length;J++)if("*"==k[J]){var N=this.model.getRoot();v=v.concat(this.model.filterDescendants(function(V){return V!=N},N))}else{var T=this.model.getCell(k[J]);null!=T&&v.push(T)}return v};var Y=Graph.prototype.isCellVisible;Graph.prototype.isCellVisible=function(k){return Y.apply(this,arguments)&&
!this.isAllTagsHidden(this.getTagsForCell(k))};Graph.prototype.setHiddenTags=function(k){this.hiddenTags=k;this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.toggleHiddenTag=function(k){var v=mxUtils.indexOf(this.hiddenTags,k);0>v?this.hiddenTags.push(k):0<=v&&this.hiddenTags.splice(v,1);this.fireEvent(new mxEventObject("hiddenTagsChanged"))};Graph.prototype.isAllTagsHidden=function(k){if(null==k||0==k.length||0==this.hiddenTags.length)return!1;k=k.split(" ");if(k.length>this.hiddenTags.length)return!1;
for(var v=0;v<k.length;v++)if(0>mxUtils.indexOf(this.hiddenTags,k[v]))return!1;return!0};Graph.prototype.getCellsForTags=function(k,v,J,N){var T=[];if(null!=k){v=null!=v?v:this.model.getDescendants(this.model.getRoot());for(var V=0,U={},X=0;X<k.length;X++)0<k[X].length&&(U[k[X]]=!0,V++);for(X=0;X<v.length;X++)if(J&&this.model.getParent(v[X])==this.model.root||this.model.isVertex(v[X])||this.model.isEdge(v[X])){var fa=this.getTagsForCell(v[X]),na=!1;if(0<fa.length&&(fa=fa.split(" "),fa.length>=k.length)){for(var la=
na=0;la<fa.length&&na<V;la++)null!=U[fa[la]]&&na++;na=na==V}na&&(1!=N||this.isCellVisible(v[X]))&&T.push(v[X])}}return T};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(k){for(var v=null,J=[],N=0;N<k.length;N++){var T=this.getTagsForCell(k[N]);J=[];if(0<T.length){T=T.split(" ");for(var V={},U=0;U<T.length;U++)if(null==v||null!=v[T[U]])V[T[U]]=!0,J.push(T[U]);v=V}else return[]}return J};
Graph.prototype.getTagsForCells=function(k){for(var v=[],J={},N=0;N<k.length;N++){var T=this.getTagsForCell(k[N]);if(0<T.length){T=T.split(" ");for(var V=0;V<T.length;V++)null==J[T[V]]&&(J[T[V]]=!0,v.push(T[V]))}}return v};Graph.prototype.getTagsForCell=function(k){return this.getAttributeForCell(k,"tags","")};Graph.prototype.addTagsForCells=function(k,v){if(0<k.length&&0<v.length){this.model.beginUpdate();try{for(var J=0;J<k.length;J++){for(var N=this.getTagsForCell(k[J]),T=N.split(" "),V=!1,U=0;U<
v.length;U++){var X=mxUtils.trim(v[U]);""!=X&&0>mxUtils.indexOf(T,X)&&(N=0<N.length?N+" "+X:X,V=!0)}V&&this.setAttributeForCell(k[J],"tags",N)}}finally{this.model.endUpdate()}}};Graph.prototype.removeTagsForCells=function(k,v){if(0<k.length&&0<v.length){this.model.beginUpdate();try{for(var J=0;J<k.length;J++){var N=this.getTagsForCell(k[J]);if(0<N.length){for(var T=N.split(" "),V=!1,U=0;U<v.length;U++){var X=mxUtils.indexOf(T,v[U]);0<=X&&(T.splice(X,1),V=!0)}V&&this.setAttributeForCell(k[J],"tags",
T.join(" "))}}}finally{this.model.endUpdate()}}};Graph.prototype.toggleCells=function(k){this.model.beginUpdate();try{for(var v=0;v<k.length;v++)this.model.setVisible(k[v],!this.model.isVisible(k[v]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(k,v){this.model.beginUpdate();try{for(var J=0;J<k.length;J++)this.model.setVisible(k[J],v)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(k,v,J,N){for(var T=0;T<k.length;T++)this.highlightCell(k[T],v,
J,N)};Graph.prototype.highlightCell=function(k,v,J,N,T){v=null!=v?v:mxConstants.DEFAULT_VALID_COLOR;J=null!=J?J:1E3;k=this.view.getState(k);var V=null;null!=k&&(T=null!=T?T:4,T=Math.max(T+1,mxUtils.getValue(k.style,mxConstants.STYLE_STROKEWIDTH,1)+T),V=new mxCellHighlight(this,v,T,!1),null!=N&&(V.opacity=N),V.highlight(k),window.setTimeout(function(){null!=V.shape&&(mxUtils.setPrefixedStyle(V.shape.node.style,"transition","all 1200ms ease-in-out"),V.shape.node.style.opacity=0);window.setTimeout(function(){V.destroy()},
1200)},J));return V};Graph.prototype.addSvgShadow=function(k,v,J,N){N=null!=N?N:!0;var T=Math.ceil(this.svgShadowSize*this.svgShadowBlur);null!=J&&J||(v=null!=v?v:k.getElementsByTagName("g")[0],null!=v&&(this.updateShadowFilter(v,!0),!isNaN(parseInt(k.getAttribute("width")))&&N&&(k.setAttribute("width",parseInt(k.getAttribute("width"))+T),k.setAttribute("height",parseInt(k.getAttribute("height"))+T),v=k.getAttribute("viewBox"),null!=v&&0<v.length&&(v=v.split(" "),3<v.length&&(w=parseFloat(v[2])+T,
h=parseFloat(v[3])+T,k.setAttribute("viewBox",v[0]+" "+v[1]+" "+w+" "+h))))));return T};Graph.prototype.updateShadowFilter=function(k,v){mxClient.IS_SF||(v?(v=mxUtils.getLightDarkColor(this.svgShadowColor,this.svgShadowOpacity),k.style.filter="drop-shadow("+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowSize)/100+"px "+Math.round(100*this.svgShadowBlur)/100+"px "+v.cssText+")"):k.style.filter="")};Graph.prototype.setShadowVisible=function(k,v){v=null!=v?v:!0;this.shadowVisible=
k;this.updateShadowFilter(this.view.getDrawPane(),this.shadowVisible);v&&this.fireEvent(new mxEventObject("shadowVisibleChanged"))};Graph.prototype.checkDefaultParent=function(){null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer())};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var k=this.model.getChildCount(this.model.root),v=0;do var J=this.model.getChildAt(this.model.root,v);while(v++<k&&"1"==mxUtils.getValue(this.getCellStyle(J),
"locked","0"));null!=J&&this.setDefaultParent(J)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.bpmn2=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bpmn.xml",
SHAPES_PATH+"/bpmn/mxBpmnShape2.js"];mxStencilRegistry.libraries.c4=[SHAPES_PATH+"/mxC4.js"];mxStencilRegistry.libraries.cisco19=[SHAPES_PATH+"/mxCisco19.js",STENCIL_PATH+"/cisco19.xml"];mxStencilRegistry.libraries.cisco_safe=[SHAPES_PATH+"/mxCiscoSafe.js",STENCIL_PATH+"/cisco_safe/architecture.xml",STENCIL_PATH+"/cisco_safe/business_icons.xml",STENCIL_PATH+"/cisco_safe/capability.xml",STENCIL_PATH+"/cisco_safe/design.xml",STENCIL_PATH+"/cisco_safe/iot_things_icons.xml",STENCIL_PATH+"/cisco_safe/people_places_things_icons.xml",
STENCIL_PATH+"/cisco_safe/security_icons.xml",STENCIL_PATH+"/cisco_safe/technology_icons.xml",STENCIL_PATH+"/cisco_safe/threat.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.kubernetes=[SHAPES_PATH+"/mxKubernetes.js",STENCIL_PATH+"/kubernetes.xml",STENCIL_PATH+"/kubernetes2.xml"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=
[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=
[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/miscellaneous"]=[SHAPES_PATH+"/mxElectrical.js",
STENCIL_PATH+"/electrical/miscellaneous.xml"];mxStencilRegistry.libraries["electrical/signal_sources"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/signal_sources.xml"];mxStencilRegistry.libraries["electrical/electro-mechanical"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/electro-mechanical.xml"];mxStencilRegistry.libraries["electrical/transmission"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+
"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=[SHAPES_PATH+"/mockup/mxMockupContainers.js"];mxStencilRegistry.libraries["mockup/forms"]=[SHAPES_PATH+"/mockup/mxMockupForms.js"];mxStencilRegistry.libraries["mockup/graphics"]=[SHAPES_PATH+"/mockup/mxMockupGraphics.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/markup"]=[SHAPES_PATH+"/mockup/mxMockupMarkup.js"];mxStencilRegistry.libraries["mockup/misc"]=
[SHAPES_PATH+"/mockup/mxMockupMisc.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/navigation"]=[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/bootstrap.xml"];
mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.ibm=[SHAPES_PATH+"/mxIBM.js",STENCIL_PATH+"/ibm.xml"];mxStencilRegistry.libraries.ibmcloud=[STENCIL_PATH+"/ibm_cloud.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=
[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.networks2=[SHAPES_PATH+"/mxNetworks2.js",STENCIL_PATH+"/networks2.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+
"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.uml25=[SHAPES_PATH+"/mxUML25.js"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];
mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxStencilRegistry.libraries.salesforce=[STENCIL_PATH+"/salesforce.xml"];mxStencilRegistry.libraries.sap=[SHAPES_PATH+"/mxSAP.js",STENCIL_PATH+"/sap.xml"];mxStencilRegistry.libraries.emoji=[SHAPES_PATH+"/emoji/mxEmoji.js"];mxMarker.getPackageForType=
function(k){var v=null;null!=k&&0<k.length&&("ER"==k.substring(0,2)?v="mxgraph.er":"sysML"==k.substring(0,5)&&(v="mxgraph.sysml"));return v};var da=mxMarker.createMarker;mxMarker.createMarker=function(k,v,J,N,T,V,U,X,fa,na){if(null!=J&&null==mxMarker.markers[J]){var la=this.getPackageForType(J);null!=la&&mxStencilRegistry.getStencil(la)}return da.apply(this,arguments)};var ha=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(k,v,J,N,T,V){"1"==mxUtils.getValue(v.style,"lineShape",
null)&&k.setFillColor(mxUtils.getValue(v.style,mxConstants.STYLE_STROKECOLOR,this.stroke));return ha.apply(this,arguments)};PrintDialog.prototype.create=function(k,v,J,N){function T(){Ja.value=Math.max(1,Math.min(la,Math.max(parseInt(Ja.value),parseInt(wa.value))));wa.value=Math.max(1,Math.min(la,Math.min(parseInt(Ja.value),parseInt(wa.value))))}function V(ua){k.lastPrintPagesRadioChecked=ya.checked;k.lastPrintSelectionOnlyChecked=Ba.checked;k.lastPrintCropRadioChecked=Ma.checked;k.lastPrintFitRadioChecked=
ra.checked;ya.checked&&wa.value<Ja.value?(k.lastPrintPagesFromInput=wa.value,k.lastPrintPagesToInput=Ja.value):(k.lastPrintPagesFromInput=null,k.lastPrintPagesToInput=null);R.value=Math.max(1,Math.min(1600,parseInt(R.value)))+"%";k.lastPrintZoom=R.value;k.lastPrintBorder=P.value;k.lastPrintGrid=W.checked;k.lastPrintTransparent=ka.checked;k.lastPrintInclude=pa.checked;k.lastPrintSheetsAcross=Ea.value;k.lastPrintSheetsDown=C.value;var Ia={};Ia.border=parseInt(P.value);Ia.scale=parseInt(R.value)/100;
Ia.grid=W.checked;Ia.shadows=ia.checked;Ia.transparent=ka.checked;Ia.includeCopy=pa.checked;Ia.sheetsAcross=parseInt(Ea.value);Ia.sheetsDown=parseInt(C.value);Ia.pagesFrom=parseInt(wa.value);Ia.pagesTo=parseInt(Ja.value);Ia.allPages=qa.checked;Ia.selection=Ba.checked;Ia.pageView=Ga.checked;Ia.crop=Ma.checked;Ia.fit=ra.checked;return null!=J?J(!ua,Ia):k.print(!ua,Ia)}var U=k.editor.graph,X=document.createElement("div"),fa=document.createElement("h3");fa.style.width="100%";fa.style.textAlign="center";
fa.style.marginTop="0px";mxUtils.write(fa,v||mxResources.get("print"));X.appendChild(fa);var na=1,la=1;fa=document.createElement("div");fa.style.whiteSpace="nowrap";var qa=document.createElement("input");qa.style.marginRight="8px";qa.style.marginBottom="8px";qa.setAttribute("type","radio");qa.setAttribute("name","pages-printdialog");fa.appendChild(qa);v=document.createElement("span");mxUtils.write(v,mxResources.get("allPages"));mxEvent.addListener(v,"click",function(){qa.checked=!0});fa.appendChild(v);
mxUtils.br(fa);var ya=qa.cloneNode(!0);fa.appendChild(ya);v=document.createElement("span");mxUtils.write(v,mxResources.get("pages")+":");fa.appendChild(v);mxEvent.addListener(v,"click",function(){ya.checked=!0});var wa=document.createElement("input");wa.style.margin="0 4px";wa.setAttribute("value","1");wa.setAttribute("type","number");wa.setAttribute("min","1");wa.style.width="40px";fa.appendChild(wa);v=document.createElement("span");mxUtils.write(v,mxResources.get("to"));fa.appendChild(v);var Ja=
wa.cloneNode(!0);fa.appendChild(Ja);mxEvent.addListener(wa,"focus",function(){ya.checked=!0});mxEvent.addListener(Ja,"focus",function(){ya.checked=!0});mxEvent.addListener(wa,"change",T);mxEvent.addListener(Ja,"change",T);if(null!=k.pages&&(la=k.pages.length,null!=k.currentPage))for(var Aa=0;Aa<la;Aa++)if(k.currentPage==k.pages[Aa]){na=Aa+1;break}null!=k.lastPrintPagesFromInput&&null!=k.lastPrintPagesToInput?(wa.value=Math.min(la,Math.max(1,k.lastPrintPagesFromInput)),Ja.value=Math.min(la,Math.max(1,
k.lastPrintPagesToInput))):(wa.value=na,Ja.value=na);wa.setAttribute("max",la);Ja.setAttribute("max",la);Aa=mxUtils.button(mxResources.get("currentPage"),function(ua){wa.value=na;Ja.value=na;ya.checked=!0});Aa.setAttribute("title",mxResources.get("currentPage"));Aa.style.marginLeft="4px";Aa.style.maxWidth="100px";Aa.style.overflow="hidden";Aa.style.textOverflow="ellipsis";Aa.style.whiteSpace="nowrap";fa.appendChild(Aa);1<la&&X.appendChild(fa);fa=document.createElement("div");fa.style.borderBottom=
"1px solid lightGray";fa.style.paddingBottom="12px";fa.style.marginBottom="12px";fa.style.whiteSpace="nowrap";var Ba=document.createElement("input");Ba.setAttribute("name","pages-printdialog");Ba.setAttribute("type",1==la?"checkbox":"radio");Ba.style.marginRight="8px";U.isSelectionEmpty()&&Ba.setAttribute("disabled","disabled");U.isEnabled()&&(fa.appendChild(Ba),v=document.createElement("span"),mxUtils.write(v,mxResources.get("selectionOnly")),fa.appendChild(v));(U.isEnabled()||1<la)&&X.appendChild(fa);
!k.isPagesEnabled()||k.lastPrintPagesRadioChecked?ya.checked=!0:!U.isSelectionEmpty()&&k.lastPrintSelectionOnlyChecked?Ba.checked=!0:qa.checked=!0;U.isSelectionEmpty()||mxEvent.addListener(v,"click",function(){Ba.checked=!Ba.checked});U=document.createElement("div");U.style.whiteSpace="nowrap";var Ga=document.createElement("input");Ga.style.marginBottom="8px";Ga.style.marginRight="8px";Ga.setAttribute("type","radio");Ga.setAttribute("name","printSize");U.appendChild(Ga);v=document.createElement("span");
mxUtils.write(v,mxResources.get("pageView"));U.appendChild(v);mxEvent.addListener(U,"click",function(){Ga.checked=!0});X.appendChild(U);U=document.createElement("div");U.style.whiteSpace="nowrap";var Ma=document.createElement("input");Ma.style.marginBottom="8px";Ma.style.marginRight="8px";Ma.setAttribute("type","radio");Ma.setAttribute("name","printSize");U.appendChild(Ma);v=document.createElement("span");mxUtils.write(v,mxResources.get("crop"));U.appendChild(v);mxEvent.addListener(U,"click",function(){Ma.checked=
!0});X.appendChild(U);U=document.createElement("div");U.style.whiteSpace="nowrap";var ra=document.createElement("input");ra.style.marginBottom="8px";ra.style.marginRight="8px";ra.setAttribute("type","radio");ra.setAttribute("name","printSize");v=document.createElement("div");v.style.display="inline-block";v.style.verticalAlign="top";v.style.paddingTop="2px";v.appendChild(ra);U.appendChild(v);fa=document.createElement("table");fa.style.display="inline-block";fa.style.borderSpacing="0";Aa=document.createElement("tbody");
var Ca=document.createElement("tr"),Da=Ca.cloneNode(!0),va=document.createElement("td"),Na=va.cloneNode(!0),Oa=va.cloneNode(!0),Qa=va.cloneNode(!0),Ra=va.cloneNode(!0),za=va.cloneNode(!0);va.style.textAlign="right";Qa.style.textAlign="right";mxUtils.write(va,mxResources.get("fitTo"));mxEvent.addListener(U,"click",function(ua){mxEvent.getSource(ua)!=ra&&(ra.checked=!ra.checked)});var Ea=document.createElement("input");Ea.style.margin="0 2px";Ea.style.boxSizing="border-box";Ea.setAttribute("value",
k.lastPrintSheetsAcross||"1");Ea.setAttribute("min","1");Ea.setAttribute("type","number");Ea.style.width="40px";Na.appendChild(Ea);v=document.createElement("span");mxUtils.write(v,mxResources.get("fitToSheetsAcross"));Oa.appendChild(v);mxUtils.write(Qa,mxResources.get("fitToBy"));var C=Ea.cloneNode(!0);C.setAttribute("value",k.lastPrintSheetsDown||"1");Ra.appendChild(C);mxEvent.addListener(Ea,"click",function(ua){ra.checked=!0;mxEvent.consume(ua)});mxEvent.addListener(C,"click",function(ua){ra.checked=
!0;mxEvent.consume(ua)});k.lastPrintCropRadioChecked?Ma.checked=!0:k.lastPrintFitRadioChecked?ra.checked=!0:Ga.checked=!0;v=document.createElement("span");mxUtils.write(v,mxResources.get("fitToSheetsDown"));za.appendChild(v);Ca.appendChild(va);Ca.appendChild(Na);Ca.appendChild(Oa);Da.appendChild(Qa);Da.appendChild(Ra);Da.appendChild(za);Aa.appendChild(Ca);Aa.appendChild(Da);fa.appendChild(Aa);U.appendChild(fa);X.appendChild(U);U=document.createElement("div");U.style.borderTop="1px solid lightGray";
U.style.whiteSpace="nowrap";U.style.paddingTop="12px";U.style.marginTop="12px";U.style.paddingLeft="8px";mxUtils.write(U,mxResources.get("borderWidth")+":");var P=document.createElement("input");P.setAttribute("type","number");P.setAttribute("min","0");P.style.width="40px";P.style.marginLeft="4px";P.value=null!=k.lastPrintBorder?k.lastPrintBorder:mxPrintPreview.prototype.pageMargin;U.appendChild(P);v=document.createElement("span");v.style.marginLeft="8px";mxUtils.write(v,mxResources.get("zoom")+":");
U.appendChild(v);var R=document.createElement("input");R.style.width="60px";R.style.marginLeft="4px";R.value=null!=k.lastPrintZoom?k.lastPrintZoom:"100%";U.appendChild(R);mxUtils.br(U);var W=document.createElement("input");W.setAttribute("type","checkbox");W.style.marginTop="12px";W.checked=null!=k.lastPrintGrid?k.lastPrintGrid:!1;U.appendChild(W);v=document.createElement("span");v.style.marginLeft="4px";v.style.marginRight="8px";mxUtils.write(v,mxResources.get("grid"));U.appendChild(v);mxEvent.addListener(v,
"click",function(ua){W.checked=!0;mxEvent.consume(ua)});var ia=document.createElement("input");ia.setAttribute("type","checkbox");ia.style.marginTop="12px";ia.checked=null!=k.lastPrintShadow?k.lastPrintShadow:!1;U.appendChild(ia);v=document.createElement("span");v.style.marginLeft="4px";v.style.marginRight="8px";mxUtils.write(v,mxResources.get("shadows"));U.appendChild(v);k.isOffline()&&!mxClient.IS_CHROMEAPP||v.appendChild(k.createHelpIcon("https://github.com/jgraph/drawio/discussions/5136"));mxEvent.addListener(v,
"click",function(ua){"IMG"!=mxEvent.getSource(ua).nodeName&&(ia.checked=!0,mxEvent.consume(ua))});Editor.enableShadowOption?null!=J&&mxUtils.br(U):(ia.style.display="none",v.style.display="none");var ka=document.createElement("input");ka.setAttribute("type","checkbox");ka.style.marginTop="10px";ka.checked=null!=k.lastPrintTransparent?k.lastPrintTransparent:!1;null!=J&&(U.appendChild(ka),v=document.createElement("span"),v.style.marginLeft="4px",mxUtils.write(v,mxResources.get("transparentBackground")),
U.appendChild(v),mxEvent.addListener(v,"click",function(ua){ka.checked=!0;mxEvent.consume(ua)}));var pa=document.createElement("input");pa.setAttribute("type","checkbox");pa.style.marginTop="10px";pa.checked=null!=k.lastPrintInclude?k.lastPrintInclude:Editor.defaultIncludeDiagram;null==J||mxClient.IS_CHROMEAPP||"draw.io"!=k.getServiceName()||(mxUtils.br(U),U.appendChild(pa),v=document.createElement("span"),v.style.marginLeft="4px",mxUtils.write(v,mxResources.get("includeCopyOfMyDiagram")),U.appendChild(v),
mxEvent.addListener(v,"click",function(ua){pa.checked=!0;mxEvent.consume(ua)}));X.appendChild(U);v=document.createElement("div");v.style.marginTop="30px";v.style.textAlign="right";v.style.whiteSpace="nowrap";k.isOffline()&&!mxClient.IS_CHROMEAPP||null!=J||v.appendChild(k.createHelpIcon("https://www.drawio.com/doc/faq/print-diagram"));U=mxUtils.button(mxResources.get("cancel"),function(){k.hideDialog()});U.className="geBtn";k.editor.cancelFirst&&v.appendChild(U);PrintDialog.previewEnabled&&null==J&&
(fa=mxUtils.button(mxResources.get("preview"),function(){try{k.hideDialog(),V(!1)}catch(ua){k.handleError(ua)}}),fa.className="geBtn",v.appendChild(fa));N=null!=N?N:null!=J?"export":PrintDialog.previewEnabled?"print":"ok";N=mxUtils.button(mxResources.get(N),function(){try{k.hideDialog(),V(!0)}catch(ua){k.handleError(ua)}});N.className="geBtn gePrimaryBtn";v.appendChild(N);k.editor.cancelFirst||v.appendChild(U);X.appendChild(v);if(k.editor.isChromelessView()){var xa=function(){Editor.isDarkMode()?
(X.classList.add("geDarkMode"),X.style.colorScheme="dark"):(X.classList.remove("geDarkMode"),X.style.colorScheme="light")};k.addListener("darkModeChanged",xa);xa();var ta=function(ua,Ia){ua=Ia.getProperty("dialog");X.parentNode==ua.container&&(k.editor.removeListener(ta),k.removeListener(xa))};k.editor.addListener("hideDialog",ta)}this.container=X};var Z=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);if(this.page!=this.ui.currentPage){if(null!=
this.page.viewState){this.ignoreColor||(this.page.viewState.background=this.color);if(!this.ignoreImage){var k=this.image;null!=k&&null!=k.src&&Graph.isPageLink(k.src)&&(k={originalSrc:k.src});this.page.viewState.backgroundImage=k}null!=this.format&&(this.page.viewState.pageFormat=this.format);null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled);null!=this.adaptiveColors&&(this.page.viewState.adaptiveColors=this.adaptiveColors);null!=this.shadowVisible&&(this.page.viewState.shadowVisible=
this.shadowVisible)}}else Z.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.adaptiveColors&&this.adaptiveColors!=this.ui.editor.graph.adaptiveColors&&(k=this.ui.editor.graph.adaptiveColors,this.ui.setAdaptiveColors(this.adaptiveColors),this.adaptiveColors=null!=k?k:"default"),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),
this.shadowVisible=!this.shadowVisible)}})();(function(){EditorUi.VERSION="28.0.7";EditorUi.compactUi="atlas"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&"1"!=urlParams.lockdown&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"https://preprod.diagrams.net/"!=window.location.hostname&&"support.draw.io"!=window.location.hostname&&
"test.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lightboxHost=window.DRAWIO_LIGHTBOX_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl=window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.enablePlantUml=EditorUi.enableLogging||"1"==urlParams.dev;EditorUi.isElectronApp=
null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.nativeFileSupport=!mxClient.IS_OP&&!EditorUi.isElectronApp&&"1"!=urlParams.extAuth&&"showSaveFilePicker"in window&&"showOpenFilePicker"in window;EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&isLocalStorage&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://www.drawio.com/doc/faq/scratchpad";EditorUi.enableHtmlEditOption=!0;EditorUi.mermaidDiagramTypes="flowchart classDiagram sequenceDiagram stateDiagram mindmap graph erDiagram requirementDiagram journey gantt pie gitGraph".split(" ");
EditorUi.defaultMermaidConfig={theme:"neutral",arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!1},sequence:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1},gantt:{titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};
EditorUi.logError=function(c,g,m,n,x,F,I){if(null!=c){x=null!=x?x:Error(c);x.stack=null!=x.stack?x.stack:"";F=null!=F?F:0>c.indexOf("NetworkError")&&0>c.indexOf("SecurityError")&&0>c.indexOf("NS_ERROR_FAILURE")&&0>c.indexOf("out of memory")?"SEVERE":"CONFIG";try{EditorUi.enableLogging&&"1"!=urlParams.dev&&c!=EditorUi.lastErrorMessage&&0>c.indexOf("extension:")&&0>c.indexOf("ResizeObserver loop completed with undelivered notifications")&&0>x.stack.indexOf("extension:")&&0>x.stack.indexOf("<anonymous>:")&&
0>x.stack.indexOf("/math/es5/")&&(EditorUi.lastErrorMessage=c,(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+F+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(c)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(m)+(null!=n?":colno:"+encodeURIComponent(n):"")+(""!=x.stack?"&stack="+encodeURIComponent(x.stack):""))}catch(M){}try{I||null==window.console||console.error(F,c,g,m,n,x)}catch(M){}}};EditorUi.logEvent=
function(c){if("1"==urlParams.dev)EditorUi.debug("logEvent",c);else if(EditorUi.enableLogging)try{var g=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=g+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=c?"&data="+encodeURIComponent(JSON.stringify(c)):"")}catch(m){}};EditorUi.sendReport=function(c,g){if("1"==urlParams.dev)EditorUi.debug("sendReport",c);else if(EditorUi.enableLogging)try{g=null!=g?g:5E4,c.length>g&&(c=c.substring(0,g)+"\n...[SHORTENED]"),mxUtils.post("/email",
"version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(c))}catch(m){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var c=[(new Date).toISOString()],g=0;g<arguments.length;g++)c.push(arguments[g]);mxClient.IS_IOS?(mxLog.show(),mxLog.debug(c.join(" "))):console.log.apply(console,c)}}catch(m){}};EditorUi.removeChildNodes=function(c){for(;null!=c.firstChild;)c.removeChild(c.firstChild)};EditorUi.embedSvgImages=
function(c){c=c.getElementsByTagName("image");for(var g=[],m=0;m<c.length;m++)g.push(c[m]);for(m=0;m<g.length;m++)EditorUi.replaceSvgImage(g[m])};EditorUi.replaceSvgImage=function(c){try{var g=null;g=null==c.getAttributeNS?c.getAttribute("xlink:href"):c.getAttributeNS(mxConstants.NS_XLINK,"href");var m=EditorUi.getSvgSubtree(g);if(null!=m&&"svg"==m.nodeName){var n=m.getAttribute("width"),x=m.getAttribute("height");m.setAttribute("x",c.getAttribute("x"));m.setAttribute("y",c.getAttribute("y"));m.setAttribute("width",
c.getAttribute("width"));m.setAttribute("height",c.getAttribute("height"));m.style.fontFamily="initial";0<n&&0<x&&null==m.getAttribute("viewBox")&&m.setAttribute("viewBox","0 0 "+n+" "+x);var F=mxUtils.createElementNs(m.ownerDocument,mxConstants.NS_SVG,"g");F.appendChild(m);c.hasAttribute("transform")&&F.setAttribute("transform",c.getAttribute("transform"));c.parentNode.replaceChild(F,c)}}catch(I){}};EditorUi.getSvgSubtree=function(c){var g=Graph.getSvgFromDataUri(c);c=null;if(null!=g){c=Graph.sanitizeNode(mxUtils.parseXml(g).documentElement);
g=c.getElementsByTagName("style");if(0<g.length){var m="svg-image-"+Editor.guid();c.setAttribute("id",m);for(var n=document.implementation.createHTMLDocument(""),x=document.createElement("style"),F=0;F<g.length;F++){x.textContent=g[F].textContent;n.body.appendChild(x);for(var I="",M=0;M<x.sheet.cssRules.length;M++){var L=x.sheet.cssRules[M];if(null!=L.selectorText){for(var K=L.selectorText.split(","),aa=0;aa<K.length;aa++)K[aa]="#"+m+" "+K[aa];L.selectorText=K.join(",")}I+=L.cssText+"\n"}g[F].textContent=
I}}null!=c.style&&"light dark"==c.style.getPropertyValue("color-scheme")&&c.style.removeProperty("color-scheme");g=c.getElementsByTagName("*");for(m=0;m<g.length;m++)g[m].removeAttribute("data-cell-id")}return c};EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.timeout=Editor.prototype.timeout;EditorUi.prototype.defaultCustomShapeStyle=
"shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=1200;EditorUi.prototype.maxTextWidth=520;EditorUi.prototype.resampleThreshold=1E5;
EditorUi.prototype.maxImageBytes=2E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.maxTextBytes=5E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;EditorUi.prototype.embedExportBorder=8;EditorUi.prototype.embedExportTheme="auto";EditorUi.prototype.embedExportBackground=null;EditorUi.prototype.shareCursorPosition=
!0;EditorUi.prototype.showRemoteCursors=!0;EditorUi.prototype.createButtonContainer=function(){var c=document.createElement("div");c.className="geButtonContainer";return c};EditorUi.prototype.openLink=function(c,g,m){return this.editor.graph.openLink(c,g,m)};EditorUi.prototype.showSplash=function(c){};EditorUi.prototype.getLocalData=function(c,g){g(localStorage.getItem(c))};EditorUi.prototype.setLocalData=function(c,g,m){localStorage.setItem(c,g);null!=m&&m()};EditorUi.prototype.isLocked=function(){var c=
this.getCurrentFile();return null!=c&&c.isLocked()};EditorUi.prototype.removeLocalData=function(c,g){localStorage.removeItem(c);g()};EditorUi.prototype.setShareCursorPosition=function(c){this.shareCursorPosition=c;this.fireEvent(new mxEventObject("shareCursorPositionChanged"))};EditorUi.prototype.isShareCursorPosition=function(){return this.shareCursorPosition};EditorUi.prototype.setShowRemoteCursors=function(c){this.showRemoteCursors=c;this.fireEvent(new mxEventObject("showRemoteCursorsChanged"))};
EditorUi.prototype.isShowRemoteCursors=function(){return this.showRemoteCursors};EditorUi.prototype.setMathEnabled=function(c){var g=this.editor.graph;g.mathEnabled=c;null!=g.view.backgroundImage&&(g.view.backgroundImage.destroy(),g.view.backgroundImage=null);this.editor.updateGraphComponents();g.refresh();g.defaultMathEnabled=c;this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(c){return this.editor.graph.mathEnabled};EditorUi.prototype.setAdaptiveColors=
function(c){this.editor.graph.setAdaptiveColors(c);this.editor.graph.view.clear();this.fireEvent(new mxEventObject("adaptiveColorsChanged"))};EditorUi.prototype.isStandaloneApp=function(){return mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(c){return this.isOfflineApp()||!navigator.onLine||!c&&("1"==urlParams.stealth||"1"==urlParams.lockdown)};EditorUi.prototype.isExternalDataComms=
function(){return"1"!=urlParams.offline&&!this.isOffline()&&!this.isOfflineApp()};EditorUi.prototype.createSpinner=function(c,g,m){var n=null==c||null==g;m=null!=m?m:24;var x=new Spinner({lines:12,length:m,width:Math.round(m/3),radius:Math.round(m/2),rotate:0,color:"light-dark(#000000, #C0C0C0)",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),F=this.timeout,I=x.spin,M=null,L=null,K=mxUtils.bind(this,function(ca){null!=ca&&ca()}),aa=this;x.spin=function(ca,ba,oa,Y){Y=null!=Y?Y:F;var da=!1;if(!this.active){var ha=
Date.now();null!=oa&&(M=window.setTimeout(function(){x.stop();M=null;oa({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout"),retry:L})},Y));n&&(g=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,c=document.body.clientWidth/2-2);ca==document.body&&"1"==urlParams.embedInline&&(ca=aa.diagramContainer,c=ca.scrollLeft+ca.clientWidth/2,g=ca.scrollTop+ca.clientHeight/2);I.call(this,ca);"1"==urlParams.embedInline&&null!=x.el&&(x.el.style.marginTop=ca.scrollTop+"px",
x.el.style.marginLeft=ca.scrollLeft+"px");this.active=!0;null!=ba&&(da=document.createElement("div"),da.className="geSpinnerStatus",da.setAttribute("title",ba),ca==document.body?(da.style.left=Math.max(0,c)+"px",da.style.top=Math.max(0,g+66)+"px"):(da.style.left="50%",da.style.top="50%",da.style.marginTop="70px"),"..."!=ba.substring(ba.length-3,ba.length)&&"!"!=ba.charAt(ba.length-1)&&(ba+="..."),da.innerText=ba,ca.appendChild(da),x.status=da);this.pause=mxUtils.bind(this,function(){var Z=K;this.active&&
(Y=Math.max(0,Y-(Date.now()-ha)),Z=mxUtils.bind(this,function(k){this.spin(ca,ba,oa,Y);if(null!=k)try{k(),L=mxUtils.bind(this,function(){this.spin(ca,ba,oa,Y);try{k()}catch(v){null!=oa&&oa(v)}})}catch(v){null!=oa&&oa(v)}}));this.stop();return Z});da=!0}return da};var ja=x.stop;x.stop=function(){ja.call(this);this.active&&(this.active=!1,null!=M&&(window.clearTimeout(M),M=null),null!=x.status&&null!=x.status.parentNode&&x.status.parentNode.removeChild(x.status),x.status=null)};x.pause=function(){return K};
return x};EditorUi.prototype.isCompatibleString=function(c){try{if(c=mxUtils.trim(c),"<"==c.charAt(0)){var g=mxUtils.parseXml(c),m=this.editor.extractGraphModel(g.documentElement,!0);return null!=m&&0==m.getElementsByTagName("parsererror").length}}catch(n){}return!1};EditorUi.isVisioFilename=function(c){return/(\.v(dx|sdx?))($|\?)/i.test(c)||/(\.vs(x|sx?))($|\?)/i.test(c)};EditorUi.prototype.isVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&
224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&4==c.charCodeAt(3)||80==c.charCodeAt(0)&&75==c.charCodeAt(1)&&3==c.charCodeAt(2)&&6==c.charCodeAt(3))};EditorUi.prototype.isRemoteVisioData=function(c){return 8<c.length&&(208==c.charCodeAt(0)&&207==c.charCodeAt(1)&&17==c.charCodeAt(2)&&224==c.charCodeAt(3)&&161==c.charCodeAt(4)&&177==c.charCodeAt(5)&&26==c.charCodeAt(6)&&225==c.charCodeAt(7)||
60==c.charCodeAt(0)&&63==c.charCodeAt(1)&&120==c.charCodeAt(2)&&109==c.charCodeAt(3)&&108==c.charCodeAt(3))};var b=EditorUi.prototype.createKeyHandler;EditorUi.prototype.createKeyHandler=function(c){var g=b.apply(this,arguments);if(!this.editor.chromeless||this.editor.editable){var m=g.getFunction,n=this.editor.graph,x=this;g.getFunction=function(F){if(n.isSelectionEmpty()&&null!=x.pages&&0<x.pages.length){var I=x.getSelectedPageIndex();if(mxEvent.isShiftDown(F)){if(37==F.keyCode)return function(){0<
I&&x.movePage(I,I-1)};if(38==F.keyCode)return function(){0<I&&x.movePage(I,0)};if(39==F.keyCode)return function(){I<x.pages.length-1&&x.movePage(I,I+1)};if(40==F.keyCode)return function(){I<x.pages.length-1&&x.movePage(I,x.pages.length-1)}}else if(mxEvent.isControlDown(F)||mxClient.IS_MAC&&mxEvent.isMetaDown(F)){if(37==F.keyCode)return function(){0<I&&x.selectNextPage(!1)};if(38==F.keyCode)return function(){0<I&&x.selectPage(x.pages[0])};if(39==F.keyCode)return function(){I<x.pages.length-1&&x.selectNextPage(!0)};
if(40==F.keyCode)return function(){I<x.pages.length-1&&x.selectPage(x.pages[x.pages.length-1])}}}return!(65<=F.keyCode&&90>=F.keyCode)||n.isSelectionEmpty()||mxEvent.isAltDown(F)||mxEvent.isShiftDown(F)||mxEvent.isControlDown(F)||mxClient.IS_MAC&&mxEvent.isMetaDown(F)?m.apply(this,arguments):null}}return g};var f=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var g=f.apply(this,arguments);if(null==g)try{var m=c.indexOf("&lt;mxfile ");if(0<=m){var n=
c.lastIndexOf("&lt;/mxfile&gt;");n>m&&(g=c.substring(m,n+15).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else{var x=mxUtils.parseXml(c),F=this.editor.extractGraphModel(x.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility);g=null!=F?mxUtils.getXml(F):""}}catch(I){}return g};EditorUi.prototype.validateFileData=function(c){if(null!=c&&0<c.length){var g=c.indexOf('<meta charset="utf-8">');0<=g&&(c=c.slice(0,g)+'<meta charset="utf-8"/>'+
c.slice(g+23-1,c.length));c=Graph.zapGremlins(c)}return c};EditorUi.prototype.replaceFileData=function(c,g){EditorUi.debug("EditorUi.replaceFileData",[this],"data",[c],"patches",g);c=this.validateFileData(c);c=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null;var m=null!=c?this.editor.extractGraphModel(c,!0):null;null!=m&&(c=m);if(null!=c){m=this.editor.graph;m.model.beginUpdate();try{var n=null!=this.pages?this.pages.slice():null,x=c.getElementsByTagName("diagram");if(1<x.length||1==x.length&&
x[0].hasAttribute("name")){this.fileNode=c;this.pages=null!=this.pages?this.pages:[];for(var F=x.length-1;0<=F;F--){var I=this.updatePageRoot(new DiagramPage(x[F]));null==I.getName()&&I.setName(mxResources.get("pageWithNumber",[F+1]));m.model.execute(new ChangePage(this,I,0==F?I:null,0))}}else null==this.fileNode&&(this.fileNode=c.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(c.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",
[1])),m.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(c),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,m.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0)));if(null!=n)for(F=0;F<n.length;F++)m.model.execute(new ChangePage(this,n[F],null));var M=this.getCurrentFile();null!=M&&M.fileReplaced(g)}finally{m.model.endUpdate()}}};EditorUi.prototype.createFileData=function(c,g,m,n,x,F,I,M,L,K,aa,ja,ca){g=
null!=g?g:this.editor.graph;x=null!=x?x:!1;L=null!=L?L:!0;aa=null!=aa?aa:!Editor.defaultCompressed;var ba=null;if(null==m||m.getMode()==App.MODE_DEVICE||m.getMode()==App.MODE_BROWSER)var oa="_blank";else ba=oa=n;if(null==c)return"";var Y=c;if("mxfile"!=Y.nodeName.toLowerCase()){if(aa){var da=c.ownerDocument.createElement("diagram");da.setAttribute("name",mxResources.get("pageWithNumber",[1]));da.setAttribute("id",Editor.guid());da.appendChild(c)}else{da=Graph.zapGremlins(mxUtils.getXml(c));Y=Graph.compress(da);
if(Graph.decompress(Y)!=da)return da;da=c.ownerDocument.createElement("diagram");da.setAttribute("name",mxResources.get("pageWithNumber",[1]));da.setAttribute("id",Editor.guid());mxUtils.setTextContent(da,Y)}Y=c.ownerDocument.createElement("mxfile");Y.appendChild(da)}K?(Y=Y.cloneNode(!0),Y.removeAttribute("modified"),Y.removeAttribute("host"),Y.removeAttribute("agent"),Y.removeAttribute("etag"),Y.removeAttribute("userAgent"),Y.removeAttribute("version"),Y.removeAttribute("editor"),Y.removeAttribute("type")):
(Y.removeAttribute("userAgent"),Y.removeAttribute("modified"),Y.removeAttribute("version"),Y.removeAttribute("editor"),Y.removeAttribute("pages"),Y.removeAttribute("type"),Y.removeAttribute("etag"),mxClient.IS_CHROMEAPP?Y.setAttribute("host","Chrome"):EditorUi.isElectronApp?Y.setAttribute("host","Electron"):Y.setAttribute("host",window.location.hostname),Y.setAttribute("agent",null!=navigator.userAgent?navigator.userAgent:navigator.appVersion),Y.setAttribute("version",EditorUi.VERSION),1<Y.getElementsByTagName("diagram").length&&
null!=this.pages&&Y.setAttribute("pages",this.pages.length));null!=ja&&(Y=Y.cloneNode(!0),Y.setAttribute("scale",ja));null!=ca&&(Y=Y.cloneNode(!0),Y.setAttribute("border",ca));c=aa?mxUtils.getPrettyXml(Y):mxUtils.getXml(Y);if(!F&&!x&&(I||null!=m&&/(\.html)$/i.test(m.getTitle())))c=this.getHtml2(mxUtils.getXml(Y),g,null!=m?m.getTitle():null,oa,ba);else if(F||!x&&null!=m&&/(\.svg)$/i.test(m.getTitle()))null==m||m.getMode()!=App.MODE_DEVICE&&m.getMode()!=App.MODE_BROWSER||(n=null),m=this.getSvgFileProperties(Y),
c=this.getEmbeddedSvg(c,g,n,null,M,L,ba,null,null,m.scale,m.border,null,Editor.svgFileTheme);return c};EditorUi.prototype.getXmlFileData=function(c,g,m,n){c=null!=c?c:!0;g=null!=g?g:!1;m=null!=m?m:!Editor.defaultCompressed;var x=this.editor.getGraphXml(c,n);if(c&&null!=this.fileNode&&null!=this.currentPage)if(c=function(L){var K=L.getElementsByTagName("mxGraphModel"),aa=0<K.length?K[0]:null;K=L;null==aa&&m?(aa=mxUtils.getNodeValue(L),0<aa.length&&(aa=Graph.decompress(aa),null!=aa&&0<aa.length&&(K=
L.cloneNode(!1),K.appendChild(mxUtils.parseXml(aa).documentElement)))):null==aa||m?K=L.cloneNode(!0):(K=L.cloneNode(!1),mxUtils.setTextContent(K,Graph.compressNode(aa)));x.appendChild(K)},EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(x),x=this.fileNode.cloneNode(!1),g)c(this.currentPage.node);else for(g=0;g<this.pages.length;g++){var F=this.pages[g],I=F.node;if(F!=this.currentPage)if(F.needsUpdate){var M=new mxCodec(mxUtils.createXmlDocument());M=M.encode(new mxGraphModel(F.root));
this.editor.graph.saveViewState(F.viewState,M,null,n);EditorUi.removeChildNodes(I);I.appendChild(M);delete F.needsUpdate}else n&&(this.updatePageRoot(F),null!=F.viewState.backgroundImage&&(null!=F.viewState.backgroundImage.originalSrc?F.viewState.backgroundImage=this.createImageForPageLink(F.viewState.backgroundImage.originalSrc,F):Graph.isPageLink(F.viewState.backgroundImage.src)&&(F.viewState.backgroundImage=this.createImageForPageLink(F.viewState.backgroundImage.src,F))),null!=F.viewState.backgroundImage&&
null!=F.viewState.backgroundImage.originalSrc&&(M=new mxCodec(mxUtils.createXmlDocument()),M=M.encode(new mxGraphModel(F.root)),this.editor.graph.saveViewState(F.viewState,M,null,n),I=I.cloneNode(!1),I.appendChild(M)));c(I)}return x};EditorUi.prototype.anonymizeString=function(c,g){for(var m=[],n=0;n<c.length;n++){var x=c.charAt(n);0<=EditorUi.ignoredAnonymizedChars.indexOf(x)?m.push(x):isNaN(parseInt(x))?x.toLowerCase()!=x?m.push(String.fromCharCode(65+Math.round(25*Math.random()))):x.toUpperCase()!=
x?m.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(x)?m.push(" "):m.push("?"):m.push(g?"0":Math.round(9*Math.random()))}return m.join("")};EditorUi.prototype.anonymizePatch=function(c){c=mxUtils.clone(c);if(null!=c[EditorUi.DIFF_INSERT])for(var g=0;g<c[EditorUi.DIFF_INSERT].length;g++)try{var m=mxUtils.parseXml(c[EditorUi.DIFF_INSERT][g].data).documentElement.cloneNode(!1);null!=m.getAttribute("name")&&m.setAttribute("name",this.anonymizeString(m.getAttribute("name")));c[EditorUi.DIFF_INSERT][g].data=
mxUtils.getXml(m)}catch(F){c[EditorUi.DIFF_INSERT][g].data=F.message}if(null!=c[EditorUi.DIFF_UPDATE]){for(var n in c[EditorUi.DIFF_UPDATE]){var x=c[EditorUi.DIFF_UPDATE][n];null!=x.name&&(x.name=this.anonymizeString(x.name));null!=x.cells&&(g=mxUtils.bind(this,function(F){var I=x.cells[F];if(null!=I){for(var M in I)null!=I[M].value&&(I[M].value="["+I[M].value.length+"]"),null!=I[M].xmlValue&&(I[M].xmlValue="["+I[M].xmlValue.length+"]"),null!=I[M].style&&(I[M].style="["+I[M].style.length+"]"),mxUtils.isEmptyObject(I[M])&&
delete I[M];mxUtils.isEmptyObject(I)&&delete x.cells[F]}}),g(EditorUi.DIFF_INSERT),g(EditorUi.DIFF_UPDATE),mxUtils.isEmptyObject(x.cells)&&delete x.cells);mxUtils.isEmptyObject(x)&&delete c[EditorUi.DIFF_UPDATE][n]}mxUtils.isEmptyObject(c[EditorUi.DIFF_UPDATE])&&delete c[EditorUi.DIFF_UPDATE]}return c};EditorUi.prototype.anonymizeAttributes=function(c,g){if(null!=c.attributes)for(var m=0;m<c.attributes.length;m++)"as"!=c.attributes[m].name&&c.setAttribute(c.attributes[m].name,this.anonymizeString(c.attributes[m].value,
g));if(null!=c.childNodes)for(m=0;m<c.childNodes.length;m++)this.anonymizeAttributes(c.childNodes[m],g)};EditorUi.prototype.anonymizeNode=function(c,g){g=c.getElementsByTagName("mxCell");for(var m=0;m<g.length;m++)null!=g[m].getAttribute("value")&&g[m].setAttribute("value","["+g[m].getAttribute("value").length+"]"),null!=g[m].getAttribute("xmlValue")&&g[m].setAttribute("xmlValue","["+g[m].getAttribute("xmlValue").length+"]"),null!=g[m].getAttribute("style")&&g[m].setAttribute("style","["+g[m].getAttribute("style").length+
"]"),null!=g[m].parentNode&&"root"!=g[m].parentNode.nodeName&&null!=g[m].parentNode.parentNode&&(g[m].setAttribute("id",g[m].parentNode.getAttribute("id")),g[m].parentNode.parentNode.replaceChild(g[m],g[m].parentNode));return c};EditorUi.prototype.synchronizeCurrentFile=function(c){var g=this.getCurrentFile();null!=g&&(g.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&g.invalidChecksum?g.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&
(g.clearAutosave(),this.clearStatus(),c?g.reloadFile(mxUtils.bind(this,function(){this.spinner.stop();g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(m){this.spinner.stop();g.handleFileError(m,!0)})):g.synchronizeFile(mxUtils.bind(this,function(){g.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(m){g.handleFileError(m,!0)}))))};EditorUi.prototype.getFileData=function(c,g,m,n,x,F,I,M,L,K,aa,ja,ca){x=null!=x?x:!0;F=null!=F?F:!1;K=null!=K?K:!Editor.defaultCompressed;
var ba=this.editor.graph;if((g||!c&&null!=L&&/(\.svg)$/i.test(L.getTitle()))&&null!=this.pages&&this.currentPage!=this.pages[0]){var oa=ba.getGlobalVariable;ba=this.createTemporaryGraph(ba.getStylesheet());ba.setBackgroundImage=this.editor.graph.setBackgroundImage;ba.background=this.editor.graph.background;var Y=null!=this.pages?this.pages[0]:null;null==Y||this.currentPage==Y?ba.setBackgroundImage(this.editor.graph.backgroundImage):null!=Y.viewState&&null!=Y.viewState&&ba.setBackgroundImage(Y.viewState.backgroundImage);
ba.getGlobalVariable=function(da){return"page"==da&&null!=Y?Y.getName():"pagenumber"==da?1:oa.apply(this,arguments)};document.body.appendChild(ba.container);null!=Y&&ba.model.setRoot(Y.root)}I=null!=I?I:this.getXmlFileData(x,F,K,aa);L=null!=L?L:this.getCurrentFile();c=this.createFileData(I,ba,L,window.location.href,c,g,m,n,x,M,K,ja,ca);ba!=this.editor.graph&&ba.container.parentNode.removeChild(ba.container);return c};EditorUi.prototype.getHtml=function(c,g,m,n,x,F){F=null!=F?F:!0;var I=null,M=EditorUi.drawHost+
"/js/embed-static.min.js";if(null!=g){I=F?g.getGraphBounds():g.getBoundingBox(g.getSelectionCells());var L=g.view.scale;F=Math.floor(I.x/L-g.view.translate.x);L=Math.floor(I.y/L-g.view.translate.y);I=g.background;null==x&&(g=this.getBasenames().join(";"),0<g.length&&(M=EditorUi.drawHost+"/embed.js?s="+g));c.setAttribute("x0",F);c.setAttribute("y0",L)}null!=c&&(c.setAttribute("pan","1"),c.setAttribute("zoom","1"),c.setAttribute("resize","0"),c.setAttribute("fit","0"),c.setAttribute("border","20"),
c.setAttribute("links","1"),null!=n&&c.setAttribute("edit",n));null!=x&&(x=x.replace(/&/g,"&amp;"));c=null!=c?Graph.zapGremlins(mxUtils.getXml(c)):"";n=Graph.compress(c);Graph.decompress(n)!=c&&(n=encodeURIComponent(c));return(null==x?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=x?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==x?null!=m?"<title>"+mxUtils.htmlEntities(m)+"</title>\n":"":"<title>draw.io</title>\n")+
(null!=x?'<meta http-equiv="refresh" content="0;URL=\''+x+"'\"/>\n":"")+"</head>\n<body"+(null==x&&null!=I&&I!=mxConstants.NONE?' style="background-color:'+I+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+n+"</div>\n</div>\n"+(null==x?'<script type="text/javascript" src="'+M+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+x+'" target="_blank"><img border="0" src="'+
EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(c,g,m,n,x){g=window.DRAWIO_VIEWER_URL||EditorUi.drawHost+"/js/viewer-static.min.js";null!=x&&(x=x.replace(/&/g,"&amp;"));c={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(c),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==x?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':
"")+"<!DOCTYPE html>\n<html"+(null!=x?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==x?null!=m?"<title>"+mxUtils.htmlEntities(m)+"</title>\n":"":"<title>draw.io</title>\n")+(null!=x?'<meta http-equiv="refresh" content="0;URL=\''+x+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>\n'+(null==x?'<script type="text/javascript" src="'+g+'">\x3c/script>':
'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+x+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.setFileData=function(c){c=this.validateFileData(c);this.pages=this.fileNode=this.currentPage=null;var g=null!=c&&0<c.length?mxUtils.parseXml(c).documentElement:null,m=Editor.extractParserError(g,mxResources.get("invalidOrMissingFile"));if(m)throw EditorUi.debug("EditorUi.setFileData ParserError",
[this],"data",[c],"node",[g],"cause",[m]),Error(mxResources.get("notADiagramFile")+" ("+m+")");c=null!=g?this.editor.extractGraphModel(g,!0):null;null!=c&&(g=c);if(null!=g&&"mxfile"==g.nodeName&&(c=g.getElementsByTagName("diagram"),m={},0<c.length)){var n=this.getHashObject(),x=null;this.fileNode=g;this.pages=[];for(var F=0;F<c.length;F++){null==c[F].getAttribute("id")&&c[F].setAttribute("id",F);g=new DiagramPage(c[F]);null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[F+1]));this.pages.push(g);
if(null==n.pageId&&null!=urlParams["page-id"]&&g.getId()==urlParams["page-id"]||null!=n.pageId&&g.getId()==n.pageId)x=g;if(null==m[g.getId()])m[g.getId()]=g;else throw Error(g.getId()+": Duplicate page ID");}this.currentPage=null!=x?x:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];g=this.currentPage.node}null==this.fileNode&&null!=g&&(this.fileNode=g.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(g.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",
[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(g);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root,this.currentPage.setDiagramModified(!1),this.scrollToPage());if(null!=urlParams["layer-ids"])try{var I=decodeURIComponent(urlParams["layer-ids"]).split(" ");g={};for(F=0;F<I.length;F++)g[I[F]]=!0;var M=this.editor.graph.getModel(),L=M.getChildren(M.root);for(F=0;F<L.length;F++){var K=L[F];M.setVisible(K,g[K.id]||!1)}}catch(aa){}};EditorUi.prototype.getBaseFilename=
function(c){var g=this.getCurrentFile();g=null!=g&&null!=g.getTitle()?g.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(g)||/(\.html)$/i.test(g)||/(\.svg)$/i.test(g)||/(\.png)$/i.test(g))g=g.substring(0,g.lastIndexOf("."));/(\.drawio)$/i.test(g)&&(g=g.substring(0,g.lastIndexOf(".")));!c&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(g=g+"-"+this.currentPage.getName());return g};EditorUi.prototype.downloadFile=
function(c,g,m,n,x,F,I,M,L,K,aa,ja,ca,ba,oa,Y,da){try{n=null!=n?n:this.editor.graph.isSelectionEmpty();var ha=this.getBaseFilename(!x),Z=ha+("xml"==c||"pdf"==c&&aa?".drawio":"")+"."+c;if("xml"==c){var k=Graph.xmlDeclaration+"\n"+this.getFileData(!0,null,null,null,n,x,null,null,null,g);this.saveData(Z,c,k,"text/xml")}else if("html"==c)k=this.getHtml2(this.getFileData(!0),this.editor.graph,ha),this.saveData(Z,c,k,"text/html");else if("svg"!=c&&"xmlsvg"!=c||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==
c?Z=ha+".png":"jpeg"==c&&(Z=ha+".jpg"),this.saveRequest(Z,c,mxUtils.bind(this,function(V,U){try{return this.createDownloadRequest(V,c,n,U,I,x,M,L,K,aa,ja,void 0,void 0,!F,ca,ba,oa,Y,da)}catch(X){this.handleError(X)}}));else{var v=null,J=mxUtils.bind(this,function(V){V.length<=MAX_REQUEST_SIZE?this.saveData(Z,"svg",V,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(v)}))});if("svg"==c){var N=this.editor.graph.background;
if(I||N==mxConstants.NONE)N=null;var T=this.editor.graph.getSvg(N,null,null,null,null,n);m&&this.editor.graph.addSvgShadow(T);this.editor.convertImages(T,mxUtils.bind(this,mxUtils.bind(this,function(V){this.spinner.stop();J(Graph.xmlDeclaration+"\n"+Graph.svgDoctype+"\n"+mxUtils.getXml(V))})))}else Z=ha+".svg",v=this.getFileData(!1,!0,null,mxUtils.bind(this,function(V){this.spinner.stop();J(V)}),n)}}catch(V){this.handleError(V)}};EditorUi.prototype.createDownloadRequest=function(c,g,m,n,x,F,I,M,L,
K,aa,ja,ca,ba,oa,Y,da,ha,Z){c=this.downloadRequestBuilder(c,g,m,n,x,F,I,M,L,K,aa,ja,ca,ba,oa,Y,da,ha,Z);g="";for(var k in c)m=c[k],null!=m&&(g+=k+"="+encodeURIComponent(m)+"&");return new mxXmlRequest(EXPORT_URL,g)};EditorUi.prototype.downloadRequestBuilder=function(c,g,m,n,x,F,I,M,L,K,aa,ja,ca,ba,oa,Y,da,ha,Z){var k=this.editor.graph,v=k.getGraphBounds();m=this.getFileData(!0,null,null,null,m,0==F?!1:"xmlpng"!=g,null,null,null,!Editor.defaultCompressed,"pdf"==g);var J=null,N=null,T=null;if(!EditorUi.isElectronApp&&
(v.width*v.height>MAX_AREA||m.length>MAX_REQUEST_SIZE))throw{message:mxResources.get("drawingTooLarge")};K=K?"1":"0";"pdf"==g&&(null!=aa?(J=aa.from,N=aa.to):0==F&&(T="1"));"xmlpng"==g&&(K="1",g="png");if(("xmlpng"==g||"svg"==g)&&null!=this.pages&&null!=this.currentPage)for(F=0;F<this.pages.length;F++)if(this.pages[F]==this.currentPage){J=F;break}F=k.background;"png"!=g&&"pdf"!=g&&"svg"!=g||!x?x||null!=F&&F!=mxConstants.NONE||(F="#ffffff"):F=mxConstants.NONE;x={globalVars:k.getExportVariables()};null!=
aa&&null!=aa.from&&(x.globalVars.pagenumber=aa.from+1);L&&(x.grid={size:k.gridSize,steps:k.view.gridSteps,color:Editor.isDarkMode()&&"pdf"==g?mxGraphView.prototype.defaultGridColor:k.view.gridColor});Graph.translateDiagram&&(x.diagramLanguage=Graph.diagramLanguage);return{format:g,from:J,to:N,allPages:T,bg:null!=F?F:mxConstants.NONE,base64:n,embedXml:K,xml:m,filename:null!=c?c:"",extras:JSON.stringify(x),scale:I,border:M,pageMargin:oa,w:ja&&isFinite(ja)?ja:null,h:ca&&isFinite(ca)?ca:null,crop:null!=
ba&&ba?"1":"0",fit:null!=Y&&Y?"1":"0",shadows:null!=Z&&Z?"1":"0",sheetsAcross:da,sheetsDown:ha}};EditorUi.prototype.setMode=function(c,g){this.mode=c};EditorUi.prototype.getDiagramId=function(){var c=window.location.hash;null!=c&&0<c.length&&(c=c.substring(1));if(null!=c&&1<c.length){var g=c.indexOf("#");0<=g&&(c=c.substring(0,g))}return c};EditorUi.prototype.getHashObject=function(){var c=window.location.hash,g={};if(null!=c&&0<c.length){var m=c.lastIndexOf("#");if(0<m){c=decodeURIComponent(c.substring(m+
1));try{g=JSON.parse(c)}catch(n){}}}return g};EditorUi.prototype.updateHashObject=function(){if(null!=this.currentFile&&null!=this.currentPage&&""!=this.currentFile.getHash()){var c=this.getHashObject();c.pageId=this.currentPage.getId();this.setHashObject(c)}else this.setHashObject(null)};EditorUi.prototype.setHashObject=function(c){if(Editor.enableHashObjects){var g=window.location.hash;if(null==g||""==g)g="#";var m=g.lastIndexOf("#");0<m&&(g=g.substring(0,m));try{null==c||mxUtils.isEmptyObject(c)||
(g=g+"#"+encodeURIComponent(JSON.stringify(c)))}catch(n){}0<m&&0<g.lastIndexOf("#")?window.location.hash=g:window.location.replace(g)}};EditorUi.prototype.loadDescriptor=function(c,g,m){var n=window.location.hash,x=mxUtils.bind(this,function(I){var M=null!=c.data?c.data:"";null!=I&&0<I.length&&(0<M.length&&(M+="\n"),M+=I);I=new LocalFile(this,"csv"!=c.format&&0<M.length?M:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);I.getHash=function(){return n};
this.fileLoaded(I);"csv"==c.format&&this.importCsv(M,mxUtils.bind(this,function(ca){this.editor.undoManager.clear();this.editor.setModified(!1);this.clearStatus()}));if(null!=c.update){var L=null!=c.interval?parseInt(c.interval):6E4,K=null,aa=mxUtils.bind(this,function(){var ca=this.currentPage;mxUtils.post(c.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(ba){ca===this.currentPage&&(200<=ba.getStatus()&&300>=ba.getStatus()?(this.updateDiagram(ba.getText()),
ja()):this.handleError({message:mxResources.get("error")+" "+ba.getStatus()}))}),mxUtils.bind(this,function(ba){this.handleError(ba)}))}),ja=mxUtils.bind(this,function(){window.clearTimeout(K);K=window.setTimeout(aa,L)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){ja();aa()}));ja();aa()}null!=g&&g()});if(null!=c.url&&0<c.url.length){var F=this.editor.getProxiedUrl(c.url);this.editor.loadUrl(F,mxUtils.bind(this,function(I){x(I)}),mxUtils.bind(this,function(I){null!=m&&m(I)}))}else x("")};
EditorUi.prototype.updateDiagram=function(c){function g(k){var v=new mxCellOverlay(k.image||x.warningImage,k.tooltip,k.align,k.valign,k.offset);v.addListener(mxEvent.CLICK,function(J,N){n.alert(k.tooltip)});return v}var m=null,n=this;if(null!=c&&0<c.length&&(m=mxUtils.parseXml(c),c=null!=m?m.documentElement:null,null!=c&&"updates"==c.nodeName)){var x=this.editor.graph,F=x.getModel();F.beginUpdate();var I=null;try{for(c=c.firstChild;null!=c;){if("update"==c.nodeName){var M=F.getCell(c.getAttribute("id"));
if(null!=M){try{var L=c.getAttribute("value");if(null!=L){var K=mxUtils.parseXml(L).documentElement;if(null!=K)if("1"==K.getAttribute("replace-value"))F.setValue(M,K);else for(var aa=K.attributes,ja=0;ja<aa.length;ja++)x.setAttributeForCell(M,aa[ja].nodeName,0<aa[ja].nodeValue.length?aa[ja].nodeValue:null)}}catch(k){null!=window.console&&console.log("Error in value for "+M.id+": "+k)}try{var ca=c.getAttribute("style");null!=ca&&x.model.setStyle(M,ca)}catch(k){null!=window.console&&console.log("Error in style for "+
M.id+": "+k)}try{var ba=c.getAttribute("icon");if(null!=ba){var oa=0<ba.length?JSON.parse(ba):null;null!=oa&&oa.append||x.removeCellOverlays(M);null!=oa&&x.addCellOverlay(M,g(oa))}}catch(k){null!=window.console&&console.log("Error in icon for "+M.id+": "+k)}try{var Y=c.getAttribute("geometry");if(null!=Y){Y=JSON.parse(Y);var da=x.getCellGeometry(M);if(null!=da){da=da.clone();for(key in Y){var ha=parseFloat(Y[key]);"dx"==key?da.x+=ha:"dy"==key?da.y+=ha:"dw"==key?da.width+=ha:"dh"==key?da.height+=ha:
da[key]=parseFloat(Y[key])}x.model.setGeometry(M,da)}}}catch(k){null!=window.console&&console.log("Error in icon for "+M.id+": "+k)}}}else if("model"==c.nodeName){for(var Z=c.firstChild;null!=Z&&Z.nodeType!=mxConstants.NODETYPE_ELEMENT;)Z=Z.nextSibling;null!=Z&&(new mxCodec(c.firstChild)).decode(Z,F)}else if("view"==c.nodeName){if(c.hasAttribute("scale")&&(x.view.scale=parseFloat(c.getAttribute("scale"))),c.hasAttribute("dx")||c.hasAttribute("dy"))x.view.translate=new mxPoint(parseFloat(c.getAttribute("dx")||
0),parseFloat(c.getAttribute("dy")||0))}else"fit"==c.nodeName&&(I=c.hasAttribute("max-scale")?parseFloat(c.getAttribute("max-scale")):1);c=c.nextSibling}}finally{F.endUpdate()}null!=I&&this.chromelessResize&&this.chromelessResize(!0,I)}return m};EditorUi.prototype.getCopyFilename=function(c,g){var m=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;c="";var n=m.lastIndexOf(".");0<=n&&(c=m.substring(n),m=m.substring(0,n));if(g){g=m;var x=new Date;m=x.getFullYear();n=x.getMonth()+1;var F=
x.getDate(),I=x.getHours(),M=x.getMinutes();x=x.getSeconds();m=g+(" "+(m+"-"+n+"-"+F+"-"+I+"-"+M+"-"+x))}return m=mxResources.get("copyOf",[m])+c};EditorUi.prototype.logIfModified=function(c,g){try{null!=c&&g&&EditorUi.debug("File.closed",[c])}catch(m){}};EditorUi.prototype.fileLoaded=function(c,g,m){var n=this.getCurrentFile();this.fileEditable=this.fileLoadedError=null;this.setCurrentFile(null);var x=!1;this.hideDialog();null!=n&&(n.removeListener(this.descriptorChangedListener),this.logIfModified(n,
!0),n.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var F=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=n&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!g&&null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fname.innerText="");this.clearStatus();this.updateUi();g||("0"!=urlParams.splash?this.showSplash():
this.createFile(this.defaultFilename,this.getFileData(),null,null,null,null,null,!0))});if(null!=c)try{this.openingFile=!0;this.setCurrentFile(c);c.addListener("descriptorChanged",this.descriptorChangedListener);c.addListener("contentChanged",this.descriptorChangedListener);c.open();delete this.openingFile;this.setGraphEnabled(!0);this.setMode(c.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();c.isEditable()?c.isModified()?
c.addUnsavedStatus():this.clearStatus():this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus('<div class="geStatusBox" title="'+mxUtils.htmlEntities(mxResources.get("readOnly"))+'">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"</div>")}));!this.editor.isChromelessView()||this.editor.editable?(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),this.restoreLibraries(),window.self!==window.top&&window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();
this.chromelessResize&&this.chromelessResize();null!=m&&m();this.editor.fireEvent(new mxEventObject("fileLoaded"));x=!0;if(!this.isOffline()&&null!=c.getMode()){var I="1"==urlParams.sketch?"sketch":uiTheme;if(null==I)I="default";else if("sketch"==I||"min"==I)I+=Editor.isDarkMode()?"-dark":"-light";EditorUi.logEvent({category:c.getMode().toUpperCase()+"-OPEN-FILE-"+c.getHash(),action:"size_"+c.getSize(),label:"autosave_"+(this.editor.autosave?"on":"off")+"_theme_"+I})}EditorUi.debug("File.opened",
[c]);"1"==urlParams.viewerOnlyMsg&&this.showAlert(mxResources.get("viewerOnlyMsg"));if(this.editor.editable&&this.mode==c.getMode()&&c.getMode()!=App.MODE_DEVICE&&null!=c.getMode())try{this.addRecent({id:c.getHash(),title:c.getTitle(),mode:c.getMode()})}catch(M){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(M){}}catch(M){this.fileLoadedError=M;if(null!=c)try{c.close()}catch(L){}c=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,
mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=n?this.fileLoaded(n)||F():F()});g?c():(null!=M.fallbackFileData&&(M.alternateAction={label:mxResources.get("makeCopy"),funct:mxUtils.bind(this,function(){this.hideDialog();var L=new LocalFile(this,M.fallbackFileData,this.defaultFilename,!0);this.fileLoaded(L)})}),this.handleError(M,mxResources.get("errorLoadingFile"),c,!0,null,null,!0))}else F();return x};EditorUi.prototype.getHashValueForPages=function(c,g){var m=
0,n=new mxGraphModel,x=new mxCodec;null!=g&&(g.byteCount=0,g.attrCount=0,g.eltCount=0,g.nodeCount=0);for(var F=0;F<c.length;F++){this.updatePageRoot(c[F]);var I=c[F].node.cloneNode(!1);I.removeAttribute("name");n.root=c[F].root;var M=x.encode(n);this.editor.graph.saveViewState(c[F].viewState,M,!0);M.removeAttribute("pageWidth");M.removeAttribute("pageHeight");I.appendChild(M);null!=g&&(g.eltCount+=I.getElementsByTagName("*").length,g.nodeCount+=I.getElementsByTagName("mxCell").length);m=(m<<5)-m+
this.hashValue(I,function(L,K,aa,ja){return!ja||"mxGeometry"!=L.nodeName&&"mxPoint"!=L.nodeName||"x"!=K&&"y"!=K&&"width"!=K&&"height"!=K?ja&&"mxCell"==L.nodeName&&"previous"==K?null:aa:Math.round(aa)},g)<<0}return m};EditorUi.prototype.hashValue=function(c,g,m){var n=0;if(null!=c&&"object"===typeof c&&"number"===typeof c.nodeType&&"string"===typeof c.nodeName&&"function"===typeof c.getAttribute){null!=c.nodeName&&(n^=this.hashValue(c.nodeName,g,m));if(null!=c.attributes){null!=m&&(m.attrCount+=c.attributes.length);
for(var x=0;x<c.attributes.length;x++){var F=c.attributes[x].name,I=null!=g?g(c,F,c.attributes[x].value,!0):c.attributes[x].value;null!=I&&(n^=this.hashValue(F,g,m)+this.hashValue(I,g,m))}}if(null!=c.childNodes)for(x=0;x<c.childNodes.length;x++)n=(n<<5)-n+this.hashValue(c.childNodes[x],g,m)<<0}else if(null!=c&&"function"!==typeof c){c=String(c);g=0;null!=m&&(m.byteCount+=c.length);for(x=0;x<c.length;x++)g=(g<<5)-g+c.charCodeAt(x)<<0;n^=g}return n};EditorUi.prototype.descriptorChanged=function(){};
EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(c,g,m,n,x,F,I){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?StorageFile.getFileContent(this,".scratchpad",mxUtils.bind(this,function(c){null==c&&(c=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,c,".scratchpad"))})):this.closeLibrary(this.scratchpad))};
EditorUi.prototype.createLibraryDataFromImages=function(c){if(!Editor.defaultCompressed)for(var g=0;g<c.length;g++)null!=c[g].xml&&"<"!=c[g].xml.charAt(0)&&(c[g].xml=mxUtils.trim(Graph.decompress(c[g].xml)));g=mxUtils.createXmlDocument();var m=g.createElement("mxlibrary");mxUtils.setTextContent(m,JSON.stringify(c,null,2));g.appendChild(m);return mxUtils.getXml(g,"\n")};EditorUi.prototype.closeLibrary=function(c){null!=c&&(this.removeLibrarySidebar(c.getHash()),c.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(c.getHash()),
".scratchpad"==c.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(c){var g=this.sidebar.palettes[c];if(null!=g){for(var m=0;m<g.length;m++)g[m].parentNode.removeChild(g[m]);delete this.sidebar.palettes[c]}};EditorUi.prototype.repositionLibrary=function(c,g){var m=this.sidebar.getEntryContainer();if(!this.sidebar.appendCustomLibraries||null!=c||!g){null==c&&(g=this.sidebar.palettes["L.scratchpad"],null==g&&(g=this.sidebar.palettes.search),null!=g&&(c=g[g.length-1].nextSibling));
c=null!=c?c:m.firstChild.nextSibling.nextSibling;g=m.lastChild;var n=g.previousSibling;m.insertBefore(g,c);m.insertBefore(n,g)}};EditorUi.prototype.loadLibrary=function(c,g){var m=mxUtils.parseXml(c.getData());if("mxlibrary"==m.documentElement.nodeName){var n=JSON.parse(mxUtils.getTextContent(m.documentElement));this.libraryLoaded(c,n,m.documentElement.getAttribute("title"),g)}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(c){return""};EditorUi.prototype.showSidebar=
function(){null!=this.sidebarWindow?this.sidebarWindow.window.setVisible(!0):this.toggleShapesPanel(!0)};EditorUi.prototype.showSearchWindow=function(c,g){var m=c?"findReplace":"find",n=m+"Window";if(null==this[n]){var x="min"==Editor.currentTheme||"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme,F=c?x?330:300:240;this[n]=new FindWindow(this,document.body.offsetWidth-(F+20),100,F,c?x?304:288:180,c);this[n].window.addListener("show",function(){this.fireEvent(new mxEventObject(m))});this[n].window.addListener("hide",
function(){this.fireEvent(new mxEventObject(m))});this[n].window.setVisible(!0)}else null==g&&this[n].window.setVisible(!this[n].window.isVisible());null!=g&&(this[n].doSearch(g),this[n].window.setVisible(!0))};EditorUi.prototype.libraryLoaded=function(c,g,m,n){if(null!=this.sidebar){c.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(c.getHash());var x=null;if(c.constructor!=StorageLibrary||".scratchpad"!=c.title){null==this.openLibraries&&(this.openLibraries=[]);for(var F=0;F<this.openLibraries.length;F++)if(this.openLibraries[F].file.getHash()==
c.getHash()){mxUtils.remove(this.openLibraries[F],this.openLibraries);break}x={file:c,images:g,title:m,expand:n};this.openLibraries.push(x)}else this.scratchpad=c;F=this.sidebar.palettes[c.getHash()];F=null!=F?F[F.length-1].nextSibling:null;this.removeLibrarySidebar(c.getHash());var I=null,M=mxUtils.bind(this,function(ha,Z){0==ha.length&&c.isEditable()?(null==I&&(I=document.createElement("div"),I.className="geDropTarget",mxUtils.write(I,mxResources.get("dragElementsHere"))),Z.appendChild(I)):this.addLibraryEntries(ha,
Z)});null!=this.sidebar&&null!=g&&this.sidebar.addEntries(g);null==m&&(m=c.getTitle(),null!=m&&/(\.xml)$/i.test(m)&&(m=m.substring(0,m.lastIndexOf("."))));var L=this.sidebar.addPalette(c.getHash(),m,null!=n?n:!0,mxUtils.bind(this,function(ha){M(g,ha)}));null!=x&&(x.div=L);this.repositionLibrary(F,"L.scratchpad"!=c.getHash());n=L.parentNode.previousSibling;m=n.getAttribute("title");null!=m&&0<m.length&&".scratchpad"!=c.title&&n.setAttribute("title",this.getLibraryStorageHint(c)+"\n"+m);var K=document.createElement("div");
K.style.backgroundColor="inherit";n.style.position="relative";var aa=document.createElement("img");aa.className="geLibraryButton";aa.setAttribute("src",Editor.crossImage);aa.setAttribute("title",mxResources.get("close"));var ja=null;if(".scratchpad"!=c.title||this.closableScratchpad)K.appendChild(aa),mxEvent.addListener(aa,"click",mxUtils.bind(this,function(ha){if(!mxEvent.isConsumed(ha)){var Z=mxUtils.bind(this,function(){null!=x&&mxUtils.remove(x,this.openLibraries);this.closeLibrary(c)});null!=
ja?this.confirm(mxResources.get("allChangesLost"),null,Z,mxResources.get("cancel"),mxResources.get("discardChanges")):Z();mxEvent.consume(ha)}}));if(c.isEditable()){var ca=this.editor.graph,ba=null;m=mxUtils.bind(this,function(ha){this.showLibraryDialog(c.getTitle(),L,g,c,c.getMode());mxEvent.consume(ha)});var oa=mxUtils.bind(this,function(ha){c.setModified(!0);c.isAutosave()?(null!=ba&&null!=ba.parentNode&&ba.parentNode.removeChild(ba),ba=aa.cloneNode(!1),ba.setAttribute("src",Editor.spinImage),
ba.setAttribute("title",mxResources.get("saving")),ba.style.cursor="default",ba.style.marginRight="2px",ba.style.marginTop="-2px",K.insertBefore(ba,K.firstChild),this.saveLibrary(c.getTitle(),g,c,c.getMode(),!0,!0,function(){null!=ba&&null!=ba.parentNode&&ba.parentNode.removeChild(ba)})):null==ja&&(ja=aa.cloneNode(!1),ja.setAttribute("src",Editor.saveImage),ja.setAttribute("title",mxResources.get("save")),K.insertBefore(ja,K.firstChild),mxEvent.addListener(ja,"click",mxUtils.bind(this,function(Z){this.saveLibrary(c.getTitle(),
g,c,c.getMode(),c.constructor==LocalLibrary,!0,function(){null==ja||c.isModified()||(ja.parentNode.removeChild(ja),ja=null)});mxEvent.consume(Z)})))}),Y=mxUtils.bind(this,function(ha,Z,k,v){ha=ca.cloneCells(mxUtils.sortCells(ca.model.getTopmostCells(ha)));for(var J=0;J<ha.length;J++){var N=ca.getCellGeometry(ha[J]);null!=N&&N.translate(-Z.x,-Z.y)}L.appendChild(this.sidebar.createVertexTemplateFromCells(ha,Z.width,Z.height,v||"",!0,null,!1));ha=mxUtils.getXml(this.editor.graph.encodeCells(ha));Editor.defaultCompressed&&
(ha=Graph.compress(ha));Z={xml:ha,w:Z.width,h:Z.height};null!=v&&(Z.title=v);g.push(Z);oa(k);null!=I&&null!=I.parentNode&&0<g.length&&(I.parentNode.removeChild(I),I=null)}),da=mxUtils.bind(this,function(ha){if(ca.isSelectionEmpty())ca.getRubberband().isActive()?(ca.getRubberband().execute(ha),ca.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var Z=ca.getSelectionCells(),k=ca.view.getBounds(Z);if(null!=k&&0<k.width&&
0<k.height){var v=ca.view.scale;k.x/=v;k.y/=v;k.width/=v;k.height/=v;k.x-=ca.view.translate.x;k.y-=ca.view.translate.y;Y(Z,k)}else this.showError(mxResources.get("error"),mxResources.get("invalidSel"),mxResources.get("ok"))}mxEvent.consume(ha)});mxEvent.addGestureListeners(L,function(){},mxUtils.bind(this,function(ha){ca.isMouseDown&&null!=ca.panningManager&&null!=ca.graphHandler.first&&(ca.graphHandler.suspend(),null!=ca.graphHandler.hint&&(ca.graphHandler.hint.style.visibility="hidden"),L.style.backgroundColor=
"light-dark(#fefefe, #000000)",L.style.cursor="copy",ca.panningManager.stop(),ca.autoScroll=!1,mxEvent.consume(ha))}),mxUtils.bind(this,function(ha){ca.isMouseDown&&null!=ca.panningManager&&null!=ca.graphHandler&&(L.style.backgroundColor="",L.style.cursor="default",this.sidebar.showTooltips=!0,ca.panningManager.stop(),ca.graphHandler.reset(),ca.isMouseDown=!1,ca.autoScroll=!0,da(ha),mxEvent.consume(ha))}));mxEvent.addListener(L,"mouseleave",mxUtils.bind(this,function(ha){ca.isMouseDown&&null!=ca.graphHandler.first&&
(ca.graphHandler.resume(),null!=ca.graphHandler.hint&&(ca.graphHandler.hint.style.visibility="visible"),L.style.backgroundColor="",L.style.cursor="",ca.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(L,"dragover",mxUtils.bind(this,function(ha){L.style.backgroundColor="light-dark(#fefefe, #000000)";ha.dataTransfer.dropEffect="copy";L.style.cursor="copy";this.sidebar.hideTooltip();ha.stopPropagation();ha.preventDefault()})),mxEvent.addListener(L,"drop",mxUtils.bind(this,function(ha){L.style.cursor=
"";L.style.backgroundColor="";0<ha.dataTransfer.files.length&&this.importFiles(ha.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(Z,k,v,J,N,T,V,U,X){if(null!=Z&&"image/"==k.substring(0,6))Z="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(Z),Z=[new mxCell("",new mxGeometry(0,0,N,T),Z)],Z[0].vertex=!0,Y(Z,new mxRectangle(0,0,N,T),ha,mxEvent.isAltDown(ha)?null:V.substring(0,V.lastIndexOf(".")).replace(/_/g," ")),null!=
I&&null!=I.parentNode&&0<g.length&&(I.parentNode.removeChild(I),I=null);else{var fa=!1,na=mxUtils.bind(this,function(la,qa){null!=la&&"application/pdf"==qa&&(qa=Editor.extractGraphModelFromPdf(la),null!=qa&&0<qa.length&&(la=qa));if(null!=la)if(la=mxUtils.parseXml(la),"mxlibrary"==la.documentElement.nodeName)try{var ya=JSON.parse(mxUtils.getTextContent(la.documentElement));M(ya,L);g=g.concat(ya);oa(ha);this.spinner.stop();fa=!0}catch(Ba){}else if("mxfile"==la.documentElement.nodeName)try{var wa=la.documentElement.getElementsByTagName("diagram");
for(ya=0;ya<wa.length;ya++){var Ja=this.stringToCells(Editor.getDiagramNodeXml(wa[ya])),Aa=this.editor.graph.getBoundingBoxFromGeometry(Ja);null!=Aa&&Y(Ja,new mxRectangle(0,0,Aa.width,Aa.height),ha)}fa=!0}catch(Ba){null!=window.console&&console.log("error in drop handler:",Ba)}fa||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=I&&null!=I.parentNode&&0<g.length&&(I.parentNode.removeChild(I),I=null)});null!=X&&null!=V&&EditorUi.isVisioFilename(V)?this.importVisio(X,
function(la){na(la,"text/xml")},null,V):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(Z,V)&&null!=X?this.isExternalDataComms()?this.parseFile(X,mxUtils.bind(this,function(la){4==la.readyState&&(this.spinner.stop(),200<=la.status&&299>=la.status?na(la.responseText,"text/xml"):this.handleError({message:mxResources.get(413==la.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):
na(Z,k)}}));ha.stopPropagation();ha.preventDefault()})),mxEvent.addListener(L,"dragleave",function(ha){L.style.cursor="";L.style.backgroundColor="";ha.stopPropagation();ha.preventDefault()}));aa=aa.cloneNode(!1);aa.setAttribute("src",Editor.editImage);aa.setAttribute("title",mxResources.get("edit"));K.insertBefore(aa,K.firstChild);mxEvent.addListener(aa,"click",m);m=aa.cloneNode(!1);m.setAttribute("src",Editor.plusImage);m.setAttribute("title",mxResources.get("add"));K.insertBefore(m,K.firstChild);
mxEvent.addListener(m,"click",da);".scratchpad"==c.title&&(this.addSelectionToScratchpad=da);this.isOffline()||".scratchpad"!=c.title||null==EditorUi.scratchpadHelpLink||(m=this.createHelpIcon(EditorUi.scratchpadHelpLink,!0),m.className="geLibraryButton",K.insertBefore(m,K.firstChild))}n.appendChild(K);this.editor.fireEvent(new mxEventObject("libraryLoaded"))}};EditorUi.prototype.addLibraryEntries=function(c,g){for(var m=0;m<c.length;m++)try{var n=c[m],x=n.data;if(null!=x){x="data:"==x.substring(0,
5)?this.convertDataUri(x):x;var F="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==n.aspect&&(F+="aspect=fixed;");F=F+"image="+x+";";null!=n.style&&(F+=n.style);g.appendChild(this.sidebar.createVertexTemplate(F,n.w,n.h,"",n.title||"",!1,null,!0))}else if(null!=n.xml){var I=this.stringToCells("<"==n.xml.charAt(0)?n.xml:Graph.decompress(n.xml)),M=0==I.length?mxResources.get("drawingEmpty"):null!=n.title?n.title:"";g.appendChild(this.sidebar.createVertexTemplateFromCells(I,
n.w,n.h,M,!0,null,!0))}}catch(L){M=null!=L.message?mxResources.get("error")+": "+L.message:String(L),F=this.sidebar.createVertexTemplateFromCells(null,n.w,n.h,M,!0,null,!0),g.appendChild(F)}};EditorUi.prototype.getResource=function(c){return null!=c?c[mxLanguage]||c.main:null};"1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);EditorUi.initTheme=function(){"sketch"!=Editor.currentTheme||window.DRAWIO_PUBLIC_BUILD||(Editor.configurationKey=".sketch-configuration",
Editor.settingsKey=".sketch-config")};EditorUi.initTheme();EditorUi.prototype.showImageDialog=function(c,g,m,n,x,F,I){c=new ImageDialog(this,c,g,m,n,x,F,I);this.showDialog(c.container,Graph.fileSupport?480:360,Graph.fileSupport?200:90,!0,!0);c.init()};EditorUi.prototype.showLocalStorageDialog=function(c,g,m,n,x,F){var I=localStorage.getItem(g);c=new TextareaDialog(this,c,null!=I?JSON.stringify(JSON.parse(I),null,2):"",mxUtils.bind(this,function(M){if(null!=M)try{if(null!=F&&F(M),M==I)this.hideDialog();
else{if(0<M.length){var L=JSON.parse(M);localStorage.setItem(g,JSON.stringify(L))}else localStorage.removeItem(g);this.hideDialog();this.alert(mxResources.get("restartForChangeRequired"))}}catch(K){this.handleError(K)}}),null,mxResources.get("close"),null,null,null,!0,null,null,x,m,n);this.showDialog(c.container,660,480,!0,!1);c.init()};EditorUi.prototype.showBackgroundImageDialog=function(c,g,m,n){c=null!=c?c:mxUtils.bind(this,function(x,F,I,M){F||(x=new ChangePageSetup(this,n?I:null,x),x.ignoreColor=
!n,null!=M&&n&&(x.shadowVisible=M),this.editor.graph.model.execute(x))});c=new BackgroundImageDialog(this,c,g,m,n);this.showDialog(c.container,400,n?240:220,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(c,g,m,n,x){c=new LibraryDialog(this,c,g,m,n,x);this.showDialog(c.container,640,440,!0,!1,mxUtils.bind(this,function(F){F&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));c.init()};var l=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(c){var g=
l.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(m){this.editor.graph.isSelectionEmpty()&&g.refresh()}));return g};EditorUi.prototype.handleError=function(c,g,m,n,x,F,I){var M=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},L=null!=c&&null!=c.error?c.error:c;if(null!=c&&("1"==urlParams.test||null!=c.stack)&&null!=c.message)try{I||EditorUi.logError("Caught: "+(""==c.message&&null!=c.name)?c.name:c.message,c.filename,
c.lineNumber,c.columnNumber,c,"INFO"),"1"!=urlParams.test&&!I||null==window.console||console.error("EditorUi.handleError:",c)}catch(ca){}if(null!=L||null!=g){I=mxUtils.htmlEntities(mxResources.get("unknownError"),!1);var K=mxResources.get("ok"),aa=null;g=null!=g?g:mxResources.get("error");if(null!=L){null!=L.retry&&(K=mxResources.get("cancel"),aa=function(){M();L.retry()});if(404==L.code||404==L.status||403==L.code){I=403==L.code?null!=L.message?mxUtils.htmlEntities(L.message,!1):mxUtils.htmlEntities(mxResources.get("accessDenied"),
!1):null!=x?x:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.email+")":""),!1);var ja=null!=x?null:null!=F?F:window.location.hash;if(null!=ja&&("#G"==ja.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==ja.substring(0,45))&&(null!=c&&null!=c.error&&(null!=c.error.errors&&0<c.error.errors.length&&"fileAccess"==c.error.errors[0].reason||null!=c.error.data&&0<c.error.data.length&&"fileAccess"==c.error.data[0].reason)||
404==L.code||404==L.status)){ja="#U"==ja.substring(0,2)?ja.substring(45,ja.lastIndexOf("%26ex")):ja.substring(2);this.showError(g,I,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+ja);null!=n&&n()}),aa,mxResources.get("changeUser"),mxUtils.bind(this,function(){function ca(){da.innerText="";for(var ha=0;ha<ba.length;ha++){var Z=document.createElement("option");mxUtils.write(Z,ba[ha].displayName);Z.value=ha;da.appendChild(Z);
Z=document.createElement("option");Z.innerHTML="&nbsp;&nbsp;&nbsp;";mxUtils.write(Z,"<"+ba[ha].email+">");Z.setAttribute("disabled","disabled");da.appendChild(Z)}Z=document.createElement("option");mxUtils.write(Z,mxResources.get("addAccount"));Z.value=ba.length;da.appendChild(Z)}var ba=this.drive.getUsersList(),oa=document.createElement("div"),Y=document.createElement("div");Y.style.marginBottom="6px";mxUtils.write(Y,mxResources.get("changeUser")+": ");oa.appendChild(Y);var da=document.createElement("select");
da.style.width="100%";ca();mxEvent.addListener(da,"change",mxUtils.bind(this,function(){var ha=da.value,Z=ba.length!=ha;Z&&this.drive.setUser(ba[ha]);this.drive.authorize(Z,mxUtils.bind(this,function(){Z||(ba=this.drive.getUsersList(),ca())}),mxUtils.bind(this,function(k){this.handleError(k)}),!0)}));oa.appendChild(da);oa=new CustomDialog(this,oa,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(oa.container,300,100,!0,!0)}),mxResources.get("cancel"),
mxUtils.bind(this,function(){this.hideDialog();null!=m&&m()}),520,150);return}}null!=L.message?I=""==L.message&&null!=L.name?mxUtils.htmlEntities(L.name,!1):mxUtils.htmlEntities(L.message,!1):null!=L.response&&null!=L.response.error?I=mxUtils.htmlEntities(L.response.error,!1):"undefined"!==typeof window.App&&(L.code==App.ERROR_TIMEOUT?I=mxUtils.htmlEntities(mxResources.get("timeout"),!1):L.code==App.ERROR_BUSY?I=mxUtils.htmlEntities(mxResources.get("busy"),!1):"string"===typeof L&&0<L.length&&(I=
mxUtils.htmlEntities(L,!1)))}x=c=null;null!=L&&null!=L.helpLink?(c=mxResources.get("help"),x=mxUtils.bind(this,function(){return this.editor.graph.openLink(L.helpLink)})):null!=L&&null!=L.ownerEmail?(c=mxResources.get("contactOwner"),I+=mxUtils.htmlEntities(" ("+c+": "+L.ownerEmail+")",!1),x=mxUtils.bind(this,function(){return this.openLink("mailto:"+mxUtils.htmlEntities(L.ownerEmail))})):null!=L&&null!=L.alternateAction&&(c=L.alternateAction.label,x=L.alternateAction.funct);this.showError(g,I,K,
m,aa,null,null,c,x,null,null,null,n?m:null)}else null!=m&&m()};EditorUi.prototype.alert=function(c,g,m){c=new ErrorDialog(this,null,c,mxResources.get("ok"),g);this.showDialog(c.container,m||340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(c,g,m,n,x,F){c=null!=c?c:"";var I=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},M=Math.min(220,28*Math.ceil(Math.max(1,c.length)/50));c=new ConfirmDialog(this,c,function(){I();null!=g&&g()},function(){I();null!=m&&m()},
n,x,null,null,null,null,M);this.showDialog(c.container,340,46+M,!0,F);c.init()};EditorUi.prototype.showBanner=function(c,g,m,n,x,F,I,M,L){F=!1;if(!(this.bannerShowing||this["hideBanner"+c]||isLocalStorage&&null!=mxSettings.settings&&null!=mxSettings.settings["close"+c])){I=null!=I?I:"translate(-50%,120%)";M=null!=M?M:"translate(-50%,0%)";var K=document.createElement("div");K.className="geBtn gePrimaryBtn geBanner"+(x?" geSmallBanner":"");K.style.zIndex=mxPopupMenu.prototype.zIndex;mxUtils.setPrefixedStyle(K.style,
"transform",I);mxUtils.setPrefixedStyle(K.style,"transition","all 1000ms ease");null!=L&&mxUtils.setPrefixedStyle(K.style,"transform-origin",L);L=L=document.createElement("img");L.setAttribute("src",Editor.crossImage);L.setAttribute("title",mxResources.get(n?"doNotShowAgain":"close"));L.setAttribute("border","0");x||(F=document.createElement("img"),F.setAttribute("src",IMAGE_PATH+"/logo.png"),F.setAttribute("border","0"),F.setAttribute("align","absmiddle"),F.style.cssText="margin-top:-4px;margin-left:8px;margin-right:12px;width:26px;height:26px;",
K.appendChild(F),L.style.cssText=(x?"right:6px;top:9px;":"right:10px;top:12px;")+"position:absolute;filter:invert(1);padding:6px;margin:-6px;cursor:default;",K.appendChild(L));mxUtils.write(K,g);document.body.appendChild(K);this.bannerShowing=!0;x&&(L.className="geLibraryButton",K.appendChild(L));g=document.createElement("div");g.style.cssText="display:flex;align-items:center;justify-content:center;padding-top:6px;font-size:11px;text-align:center;font-weight:normal;";var aa=document.createElement("input");
aa.setAttribute("type","checkbox");aa.setAttribute("id","geDoNotShowAgainCheckbox");aa.style.marginRight="6px";if(!n){g.appendChild(aa);var ja=document.createElement("label");ja.setAttribute("for","geDoNotShowAgainCheckbox");mxUtils.write(ja,mxResources.get("doNotShowAgain"));g.appendChild(ja);K.style.paddingBottom=x?"16px":"30px";K.appendChild(g)}var ca=mxUtils.bind(this,function(){null!=K.parentNode&&(K.parentNode.removeChild(K),this.bannerShowing=!1,aa.checked||n)&&(this["hideBanner"+c]=!0,isLocalStorage&&
null!=mxSettings.settings&&(mxSettings.settings["close"+c]=Date.now(),mxSettings.save()))});null!=L&&mxEvent.addListener(L,"click",mxUtils.bind(this,function(oa){mxEvent.consume(oa);ca()}));var ba=mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(K.style,"transform",I);window.setTimeout(mxUtils.bind(this,function(){ca()}),1E3)});mxEvent.addListener(K,"click",mxUtils.bind(this,function(oa){var Y=mxEvent.getSource(oa);Y!=aa&&Y!=ja?(null!=m&&m(),ca(),mxEvent.consume(oa)):ba()}));window.setTimeout(mxUtils.bind(this,
function(){mxUtils.setPrefixedStyle(K.style,"transform",M)}),500);window.setTimeout(ba,x?5E3:3E4);F=!0}return F};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.createImageDataUri=function(c,g,m,n){c=c.toDataURL("image/"+m);if(null!=c&&6<c.length)null!=g&&(c=Editor.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(g))),0<n&&(c=Editor.writeGraphModelToPng(c,
"pHYs","dpi",n));else throw{message:mxResources.get("unknownError")};return c};EditorUi.prototype.saveCanvas=function(c,g,m,n,x){var F="jpeg"==m?"jpg":m;n=this.getBaseFilename(n)+(null!=g?".drawio":"")+"."+F;c=this.createImageDataUri(c,g,m,x);this.saveData(n,F,c.substring(c.lastIndexOf(",")+1),"image/"+m,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=
document.documentMode&&7!=document.documentMode||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(c,g){c=new TextareaDialog(this,c,g,null,null,mxResources.get("close"));this.showDialog(c.container,620,460,!0,!0,null,null,null,null,!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(c,g,m,n,x,F){"text/xml"!=m||/(\.drawio)$/i.test(g)||/(\.xml)$/i.test(g)||/(\.svg)$/i.test(g)||/(\.html)$/i.test(g)||(g=g+"."+(null!=F?F:"drawio"));
if(window.Blob&&navigator.msSaveOrOpenBlob)c=n?this.base64ToBlob(c,m):new Blob([c],{type:m}),navigator.msSaveOrOpenBlob(c,g);else if(mxClient.IS_IE)m=window.open("about:blank","_blank"),null==m?mxUtils.popup(c,!0):(m.document.write(c),m.document.close(),m.document.execCommand("SaveAs",!0,g),m.close());else if(mxClient.IS_IOS&&this.isOffline())navigator.standalone||null==m||"image/"!=m.substring(0,6)?this.showTextDialog(g+":",c):this.openInNewWindow(c,m,n);else{var I=document.createElement("a");F=
(null==navigator.userAgent||0>navigator.userAgent.indexOf("PaleMoon/"))&&"undefined"!==typeof I.download;if(mxClient.IS_GC&&null!=navigator.userAgent){var M=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);F=65==(M?parseInt(M[2],10):!1)?!1:F}if(F||this.isOffline()){I.href=URL.createObjectURL(n?this.base64ToBlob(c,m):new Blob([c],{type:m}));F?I.download=g:I.setAttribute("target","_blank");document.body.appendChild(I);try{window.setTimeout(function(){URL.revokeObjectURL(I.href)},2E4),I.click(),
I.parentNode.removeChild(I)}catch(L){}}else this.createEchoRequest(c,g,m,n,x).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(c,g,m,n,x,F){c="xml="+encodeURIComponent(c);return new mxXmlRequest(SAVE_URL,c+(null!=m?"&mime="+m:"")+(null!=x?"&format="+x:"")+(null!=F?"&base64="+F:"")+(null!=g?"&filename="+encodeURIComponent(g):"")+(n?"&binary=1":""))};EditorUi.prototype.saveLocalFile=function(c,g,m,n,x,F,I,M,L){F=null!=F?F:!1;I=null!=I?I:"vsdx"!=x&&(!mxClient.IS_IOS||!navigator.standalone);
var K=mxUtils.bind(this,function(ja,ca,ba,oa){try{if("_blank"==ca)if(null!=m&&"image/"==m.substring(0,6))this.openInNewWindow(c,m,n);else if(null!=m&&"text/html"==m.substring(0,9)){var Y=new EmbedDialog(this,c);this.showDialog(Y.container,450,240,!0,!0);Y.init()}else{var da=window.open("about:blank");null==da?mxUtils.popup(c,!0):(da.document.write("<pre>"+mxUtils.htmlEntities(c,!1)+"</pre>"),da.document.close())}else if(ca==App.MODE_DEVICE||"download"==ca)this.doSaveLocalFile(c,ja,m,n,null,M);else if(null!=
ja&&0<ja.length){var ha=mxUtils.bind(this,function(Z){try{this.exportFile(c,ja,m,n,ca,Z)}catch(k){this.handleError(k)}});null!=oa?ha(oa):this.pickFolder(ca,ha)}}catch(Z){this.handleError(Z)}});x=[];F||x.push(App.MODE_BROWSER);I||x.push("_blank");var aa=new SaveDialog(this,g,mxUtils.bind(this,function(ja,ca,ba){K(ja.value,ca,ja,ba);this.hideDialog(null,null,aa.container)}),x,c,m,n,L);this.showDialog(aa.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));aa.init()};EditorUi.prototype.openInNewWindow=
function(c,g,m){var n=window.open("about:blank");if(null==n||null==n.document)mxUtils.popup(c,!0);else{var x="background: light-dark(rgb(255, 255, 255), rgb(18, 18, 18))";if("image/svg+xml"==g){var F=mxUtils.parseXml(c).documentElement.style.backgroundColor;""!=F&&(x="background: "+F+";")}x='<html><head><meta charset="UTF-8"></head><body style="color-scheme: light dark; '+x+'">';"image/svg+xml"!=g||mxClient.IS_SVG?"image/svg+xml"!=g||m?(F=m?c:btoa(unescape(encodeURIComponent(c))),n.document.write(x+
'<img style="max-width:100%;" src="data:'+g+";base64,"+F+'"/></body></html>')):n.document.write(x+c+"</body></html>"):n.document.write(x+"<pre>"+mxUtils.htmlEntities(c,!1)+"</pre></body></html>");n.document.close()}};var u=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.isChromelessImageExportEnabled=function(){return"draw.io"!=this.getServiceName()||/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)};EditorUi.prototype.addChromelessToolbarItems=
function(c){if(null!=urlParams.tags){this.tagsDialog=this.tagsComponent=null;var g=c(mxUtils.bind(this,function(n){null==this.tagsComponent&&(this.tagsComponent=this.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return null!=this.tagsDialog}),!0),this.tagsComponent.div.getElementsByTagName("div")[0].style.position="",mxUtils.setPrefixedStyle(this.tagsComponent.div.style,"borderRadius","5px"),this.tagsComponent.div.style.maxHeight="160px",this.tagsComponent.div.style.maxWidth="120px",
this.tagsComponent.div.style.padding="4px",this.tagsComponent.div.style.overflow="auto",this.tagsComponent.div.style.height="auto",this.tagsComponent.div.style.position="fixed",this.tagsComponent.div.style.fontFamily=Editor.defaultHtmlFont,this.tagsComponent.div.style.backgroundColor="#000000",this.tagsComponent.div.style.color="#ffffff",mxUtils.setOpacity(this.tagsComponent.div,80));if(null!=this.tagsDialog)this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null;else{this.tagsDialog=
this.tagsComponent.div;mxEvent.addListener(this.tagsDialog,"mouseleave",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));var x=g.getBoundingClientRect();this.tagsDialog.style.left=x.left+"px";this.tagsDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";x=mxUtils.getCurrentStyle(this.editor.graph.container);this.tagsDialog.style.zIndex=x.zIndex;document.body.appendChild(this.tagsDialog);
this.tagsComponent.refresh();this.editor.fireEvent(new mxEventObject("tagsDialogShown"))}mxEvent.consume(n)}),Editor.tagsImage,mxResources.get("tags"));this.editor.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var n=this.editor.graph.getAllTags();g.style.display=0<n.length?"":"none"}))}u.apply(this,arguments);this.editor.addListener("tagsDialogShown",mxUtils.bind(this,function(){null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=
null)}));this.editor.addListener("layersDialogShown",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null)}));this.editor.addListener("pageSelected",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));mxEvent.addListener(this.editor.graph.container,
"click",mxUtils.bind(this,function(){null!=this.tagsDialog&&(this.tagsDialog.parentNode.removeChild(this.tagsDialog),this.tagsDialog=null);null!=this.layersDialog&&(this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null)}));if(this.editor.isExportToCanvas()&&this.isChromelessImageExportEnabled()){this.exportDialog=null;var m=c(mxUtils.bind(this,function(n){var x=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",x);null!=this.exportDialog&&
(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)x.apply(this);else{this.exportDialog=document.createElement("div");var F=m.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily=Editor.defaultHtmlFont;this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width=
"50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,80);this.exportDialog.style.left=F.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";F=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=F.zIndex;var I=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"light-dark(#000000, #C0C0C0)",
speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});I.spin(this.exportDialog);document.body.appendChild(this.exportDialog);mxEvent.addListener(this.editor.graph.container,"click",x);this.editor.exportToCanvas(mxUtils.bind(this,function(M){I.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var L=this.createImageDataUri(M,null,"png");M=document.createElement("img");M.style.maxWidth="140px";M.style.maxHeight="140px";
M.style.cursor="pointer";M.style.backgroundColor="white";M.setAttribute("title",mxResources.get("openInNewWindow"));M.setAttribute("border","0");M.setAttribute("src",L);this.exportDialog.appendChild(M);mxEvent.addListener(M,"click",mxUtils.bind(this,function(){this.openInNewWindow(L.substring(L.indexOf(",")+1),"image/png",!0);x.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(M){I.stop();null!=this.exportDialog&&null!=this.exportDialog.parentNode&&(this.exportDialog.parentNode.removeChild(this.exportDialog),
this.exportDialog=null);this.handleError(M)}),null,null,null,null,null,null,null,Editor.defaultBorder)}mxEvent.consume(n)}),Editor.cameraImage,mxResources.get("export"))}};EditorUi.prototype.saveData=function(c,g,m,n,x,F){this.isLocalFileSave()?this.saveLocalFile(m,c,n,x,g,F):this.saveRequest(c,g,mxUtils.bind(this,function(I,M){return this.createEchoRequest(m,I,n,x,g,M)}),m,x,n)};EditorUi.prototype.saveRequest=function(c,g,m,n,x,F,I){I=null!=I?I:!mxClient.IS_IOS||!navigator.standalone;var M=mxUtils.bind(this,
function(K,aa,ja,ca){if("_blank"==aa||null!=K&&0<K.length){var ba=m("_blank"==aa?null:K,aa==App.MODE_DEVICE||"download"==aa||null==aa||"_blank"==aa?"0":"1");null!=ba&&(aa==App.MODE_DEVICE||"download"==aa||"_blank"==aa?ba.simulate(document,"_blank"):(ja=mxUtils.bind(this,function(oa){F=null!=F?F:"pdf"==g?"application/pdf":"image/"+g;if(null!=n)try{this.exportFile(n,K,F,!0,aa,oa)}catch(Y){this.handleError(Y)}else this.spinner.spin(document.body,mxResources.get("saving"))&&ba.send(mxUtils.bind(this,
function(){this.spinner.stop();if(200<=ba.getStatus()&&299>=ba.getStatus())try{this.exportFile(ba.getText(),K,F,!0,aa,oa)}catch(Y){this.handleError(Y)}else this.handleError({message:mxResources.get("errorSavingFile")})}),mxUtils.bind(this,function(Y){this.spinner.stop();this.handleError(Y)}))}),null!=ca?ja(ca):this.pickFolder(aa,ja)))}});x=[App.MODE_BROWSER];I||x.push("_blank");var L=new SaveDialog(this,c,mxUtils.bind(this,function(K,aa,ja){M(K.value,aa,K,ja);this.hideDialog(null,null,L.container)}),
x,null,"application/pdf");this.showDialog(L.container,420,110,!0,!1,mxUtils.bind(this,function(){this.hideDialog()}));L.init()};EditorUi.prototype.isServices=function(c){return 1!=c};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(c,g,m,n,x,F){};EditorUi.prototype.getServiceForName=function(c){return null};EditorUi.prototype.getTitleForService=function(c){return mxResources.get(c)};EditorUi.prototype.pickFolder=function(c,g,m){g(null)};
EditorUi.prototype.exportSvg=function(c,g,m,n,x,F,I,M,L,K,aa,ja,ca,ba){if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(la){Editor.addRetryToError(la,mxUtils.bind(this,function(){this.exportSvg(c,g,m,n,x,F,I,M,L,K,aa,ja,ca,ba)}));this.handleError(la)})))try{var oa=this.editor.graph.isSelectionEmpty();m=null!=m?m:oa;var Y=g?null:this.editor.graph.background;Y==mxConstants.NONE&&(Y=null);null==Y&&0==g&&(Y=this.editor.graph.shapeBackgroundColor);var da=this.editor.graph.addForeignObjectWarning;
Editor.foreignObjectImages&&(this.editor.graph.addForeignObjectWarning=function(){});var ha=mxUtils.lightDarkColorSupported,Z=mxUtils.preferDarkColor;if("light"==aa||"dark"==aa)mxUtils.lightDarkColorSupported=!1,mxUtils.preferDarkColor="dark"==aa;var k=Graph.addFont,v={};Graph.addFont=function(la,qa,ya,wa){k.call(this,la,qa,ya,v)};var J=this.editor.graph.createSvgImageExport(x),N=J.drawCellState;J.drawCellState=function(la,qa){null!=la&&Graph.processFontStyle(la.style);N.apply(this,arguments)};var T=
this.editor.graph.getSvg(Y,c,I,M,null,m,null,J,"blank"==K?"_blank":"self"==K?"_top":null,null,!ca,aa,ja);mxUtils.lightDarkColorSupported=ha;mxUtils.preferDarkColor=Z;this.editor.graph.addForeignObjectWarning=da;n&&this.editor.graph.addSvgShadow(T);var V=this.getBaseFilename()+(x?".drawio":"")+".svg";ba=null!=ba?ba:mxUtils.bind(this,function(la){this.isLocalFileSave()||la.length<=MAX_REQUEST_SIZE?this.saveData(V,"svg",la,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},
mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(la)}))});var U=mxUtils.bind(this,function(la){this.spinner.stop();x&&la.setAttribute("content",this.getFileData(!0,null,null,null,m,L,null,null,null,null,null,c,I));ba(Graph.xmlDeclaration+"\n"+(x?Graph.svgFileComment+"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(la))});this.editor.graph.mathEnabled&&this.editor.addMathCss(T);var X=mxUtils.bind(this,function(la){Editor.replaceSvgDataUris&&F&&EditorUi.embedSvgImages(la);Editor.foreignObjectImages&&
ca?this.replaceAlternateContent(la,aa,U):U(la)}),fa=Graph.customFontElements;Graph.customFontElements=v;var na=mxUtils.bind(this,function(la){Graph.customFontElements=fa;Graph.addFont=k;F&&!this.isOffline()&&Editor.canvasSupported?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(la,X,this.thumbImageCache)):X(la)});ca?this.embedFonts(T,na):(this.editor.addFontCss(T),na(T))}catch(la){this.handleError(la)}};EditorUi.prototype.replaceAlternateContent=function(c,g,m){function n(ja,
ca,ba,oa,Y){var da=mxUtils.createElementNs(c.ownerDocument,mxConstants.NS_SVG,"image");da.setAttribute("x",ca);da.setAttribute("y",ba+.5);da.setAttribute("width",oa.width);da.setAttribute("height",oa.height);null==da.setAttributeNS?da.setAttribute("xlink:href",Y):da.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",Y);ja.replaceChild(da,ja.lastChild);M()}function x(){if(I<aa.length)aa[I++](x)}var F="";g=c.getElementsByTagName("style");for(var I=0;I<g.length;I++)F+=g[I].innerHTML;g=c.getElementsByTagName("switch");
counter=g.length;var M=mxUtils.bind(this,function(){counter--;0==counter&&m(c)}),L={},K={},aa=[];for(I=0;I<g.length;I++)mxUtils.bind(this,function(ja){var ca=ja.getElementsByTagName("div");if(0<ca.length)try{var ba=ca[0].cloneNode(!0),oa=parseInt(ba.style.marginLeft),Y=parseInt(ba.style.paddingTop),da=ba.getElementsByTagName("div")[1],ha=ca=!1,Z=ba.style.alignItems,k=ba.style.justifyContent;if(null!=ba.style.writingMode){var v=ba.style.writingMode;ha="vertical-"==v.substring(0,9);ca="-rl"==v.substring(v.length-
3)}var J=!ha&&"1px"==ba.style.width||ha&&"1px"==ba.style.height;if(!ha&&"1px"==ba.style.height||ha&&"1px"==ba.style.width)ba.style.alignItems=ha&&ca?"unsafe flex-end":"unsafe flex-start";J&&(ba.style.justifyContent="unsafe flex-start");ba.style.paddingTop="";ba.style.marginLeft="";var N=ba.outerHTML,T=L[N];null==T&&(ba.style.position="absolute",ba.style.visibility="hidden",document.body.appendChild(ba),v=1,v="1px"==ba.style.width?da.offsetWidth:parseInt(ba.style.width),J=1,J="1px"==ba.style.height?
da.offsetHeight:parseInt(ba.style.height),document.body.removeChild(ba),T=new mxRectangle(oa,Y,v,J),L[N]=T);"1px"==ba.style.height&&("unsafe center"==Z?Y-=T.height/2:"unsafe flex-end"==Z&&(Y-=T.height));if("1px"==ba.style.width)if(!ha&&"unsafe center"==k||ha&&"unsafe center"==Z)oa-=T.width/2;else if(!ha&&"unsafe flex-end"==k||ha&&(!ca&&"unsafe flex-end"==Z||ca&&"unsafe flex-start"==Z))oa-=T.width;T=new mxRectangle(oa,Y,T.width,T.height+parseInt(da.style.fontSize)/4);aa.push(mxUtils.bind(this,function(V){var U=
K[N];null==U?Graph.htmlToPng(N,T.width,T.height,mxUtils.bind(this,function(X){n(ja,oa,Y,T,X);K[N]=X;V()}),F):(n(ja,oa,Y,T,U),V())}))}catch(V){M()}else M()})(g[I]);0==counter&&m(c);I=0;x()};EditorUi.prototype.addRadiobox=function(c,g,m,n,x,F,I){return this.addCheckbox(c,m,n,x,F,I,!0,g)};EditorUi.prototype.addCheckbox=function(c,g,m,n,x,F,I,M){F=null!=F?F:!0;var L=document.createElement("input");L.style.marginRight="8px";L.style.marginTop="16px";L.setAttribute("type",I?"radio":"checkbox");I="geCheckbox-"+
Editor.guid();L.id=I;null!=M&&L.setAttribute("name",M);m&&(L.setAttribute("checked","checked"),L.defaultChecked=!0);n&&L.setAttribute("disabled","disabled");F&&(c.appendChild(L),m=document.createElement("label"),mxUtils.write(m,g),m.setAttribute("for",I),c.appendChild(m),x||mxUtils.br(c));return L};EditorUi.prototype.addEditButton=function(c,g){var m=this.addCheckbox(c,mxResources.get("edit")+":",!0,null,!0);m.style.marginLeft="24px";var n=this.getCurrentFile(),x="";null!=n&&n.getMode()!=App.MODE_DEVICE&&
n.getMode()!=App.MODE_BROWSER&&(x=window.location.href);var F=document.createElement("select");F.style.maxWidth="200px";F.style.width="auto";F.style.marginLeft="8px";F.style.marginRight="10px";F.className="geBtn";n=document.createElement("option");n.setAttribute("value","blank");mxUtils.write(n,mxResources.get("makeCopy"));F.appendChild(n);var I=document.createElement("option");I.setAttribute("value","custom");mxUtils.write(I,mxResources.get("custom")+"...");F.appendChild(I);c.appendChild(F);mxEvent.addListener(F,
"change",mxUtils.bind(this,function(){if("custom"==F.value){var M=new FilenameDialog(this,x,mxResources.get("ok"),function(L){null!=L?(x=L,I.setAttribute("title",L)):(F.value="blank",I.removeAttribute("title"))},mxResources.get("url"),null,null,null,null,function(){F.value="blank"});this.showDialog(M.container,300,80,!0,!1);M.init()}}));mxEvent.addListener(m,"change",mxUtils.bind(this,function(){m.checked&&(null==g||g.checked)?F.removeAttribute("disabled"):F.setAttribute("disabled","disabled")}));
mxUtils.br(c);return{getLink:function(){return m.checked?"blank"===F.value?"_blank":x:null},getEditInput:function(){return m},getEditSelect:function(){return F}}};EditorUi.prototype.addLinkSection=function(c,g){function m(){var M=document.createElement("div");M.style.width="100%";M.style.height="100%";M.style.boxSizing="border-box";null!=F&&F!=mxConstants.NONE?(M.style.border="1px solid black",M.style.backgroundColor=F):(M.style.backgroundPosition="center center",M.style.backgroundRepeat="no-repeat",
M.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");I.innerText="";I.appendChild(M)}mxUtils.write(c,mxResources.get("links")+":");var n=document.createElement("select");n.style.width="100px";n.style.padding="0px";n.style.marginLeft="8px";n.style.marginRight="10px";n.className="geBtn";var x=document.createElement("option");x.setAttribute("value","auto");mxUtils.write(x,mxResources.get("automatic"));n.appendChild(x);x=document.createElement("option");x.setAttribute("value","blank");mxUtils.write(x,
mxResources.get("openInNewWindow"));n.appendChild(x);x=document.createElement("option");x.setAttribute("value","self");mxUtils.write(x,mxResources.get("openInThisWindow"));n.appendChild(x);g&&(g=document.createElement("option"),g.setAttribute("value","frame"),mxUtils.write(g,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),n.appendChild(g));c.appendChild(n);mxUtils.write(c,mxResources.get("borderColor")+":");var F="#0000ff",I=null;I=mxUtils.button("",mxUtils.bind(this,function(M){this.pickColor(F||
"none",function(L){F=L;m()});mxEvent.consume(M)}));m();I.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";I.style.marginLeft="4px";I.style.height="22px";I.style.width="22px";I.style.position="relative";I.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";I.className="geColorBtn";c.appendChild(I);mxUtils.br(c);return{getColor:function(){return F},getTarget:function(){return n.value},focus:function(){n.focus()}}};EditorUi.prototype.createUrlParameters=function(c,g,m,n,x,F){F=
null!=F?F:[];m&&(F.push("lightbox=1"),"auto"!=c&&F.push("target="+c),null!=g&&g!=mxConstants.NONE&&F.push("highlight="+("#"==g.charAt(0)?g.substring(1):g)),null!=n&&0<n.length&&F.push("edit="+encodeURIComponent(n)),x&&F.push("layers=1"),this.editor.graph.foldingEnabled&&F.push("nav=1"));return F};EditorUi.prototype.createLink=function(c,g,m,n,x,F,I,M,L,K,aa,ja,ca){var ba=this.getCurrentFile();L=this.createUrlParameters(c,g,n,x,F,L);c=!0;null!=I?m="#U"+encodeURIComponent(I):M||null==ba||""==ba.getHash()?
m="#R"+encodeURIComponent(m?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(m="#"+ba.getHash(),c=!1);c&&null!=ba&&null!=ba.getTitle()&&ba.getTitle()!=this.defaultFilename&&L.push("title="+encodeURIComponent(ba.getTitle()));K&&1<m.length&&(L.push("open="+m.substring(1)),m="");aa&&null!=this.currentPage&&L.push("page-id="+this.currentPage.getId());ja&&L.push("transparent=1");null!=ca&&L.push("dark="+ca);return(n&&(null!=I||null!=
ba&&ba.getMode()!=App.MODE_GITHUB&&ba.getMode()!=App.MODE_GITLAB)?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<L.length?"?"+L.join("&"):"")+m};EditorUi.prototype.createHtml=function(c,g,m,n,x,F,I,M,L,K,aa,ja,ca){this.getBasenames();var ba={};""!=x&&x!=mxConstants.NONE&&(ba.highlight=x);"auto"!==n&&(ba.target=n);K||(ba.lightbox=!1);ba.nav=this.editor.graph.foldingEnabled;
m=parseInt(m);isNaN(m)||100==m||(ba.zoom=m/100);m=[];I&&(m.push("pages"),ba.resize=!0,null!=this.pages&&null!=this.currentPage&&(ba.page=mxUtils.indexOf(this.pages,this.currentPage)));g&&(m.push("zoom"),ba.resize=!0);M&&m.push("layers");L&&m.push("tags");null!=ca&&(ba["dark-mode"]=ca);0<m.length&&(K&&m.push("lightbox"),ba.toolbar=m.join(" "));null!=aa&&0<aa.length&&(ba.edit=aa);null!=c?ba.url=c:ba.xml=this.getFileData(!0,null,null,null,null,!I);g='<div class="mxgraph" style="'+(F?"max-width:100%;":
"")+(""!=m?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(ba))+'"></div>';c=null!=c?"&fetch="+encodeURIComponent(c):"";ja(g,'<script type="text/javascript" src="'+(0<c.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.lightboxHost+"/embed2.js?")+c:"1"==urlParams.dev?"https://test.draw.io/js/viewer-static.min.js":window.DRAWIO_VIEWER_URL?window.DRAWIO_VIEWER_URL:EditorUi.lightboxHost+"/js/viewer-static.min.js")+'">\x3c/script>')};
EditorUi.prototype.showHtmlDialog=function(c,g,m,n){var x=document.createElement("div");x.style.whiteSpace="nowrap";var F=document.createElement("h3");mxUtils.write(F,mxResources.get("html"));F.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";x.appendChild(F);var I=document.createElement("div");I.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var M=document.createElement("input");M.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";
M.setAttribute("value","url");M.setAttribute("type","radio");M.setAttribute("name","type-embedhtmldialog");F=M.cloneNode(!0);F.setAttribute("value","copy");I.appendChild(F);var L=document.createElement("span");mxUtils.write(L,mxResources.get("includeCopyOfMyDiagram"));I.appendChild(L);mxUtils.br(I);I.appendChild(M);L=document.createElement("span");mxUtils.write(L,mxResources.get("publicDiagramUrl"));I.appendChild(L);var K=this.getCurrentFile();null==m&&null!=K&&K.constructor==window.DriveFile&&(L=
document.createElement("a"),L.style.paddingLeft="12px",L.style.color="gray",L.style.cursor="pointer",mxUtils.write(L,mxResources.get("share")),I.appendChild(L),mxEvent.addListener(L,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(K.getId(),K)})));F.setAttribute("checked","checked");null==m&&M.setAttribute("disabled","disabled");x.appendChild(I);I=380;var aa=this.addLinkSection(x),ja=document.createElement("select");ja.style.maxWidth="260px";ja.style.marginLeft="8px";
ja.style.marginTop="16px";L=document.createElement("option");L.setAttribute("value","light");mxUtils.write(L,mxResources.get("light"));ja.appendChild(L);L=document.createElement("option");L.setAttribute("value","dark");mxUtils.write(L,mxResources.get("dark"));ja.appendChild(L);L=document.createElement("option");L.setAttribute("value","auto");mxUtils.write(L,mxResources.get("automatic"));L.setAttribute("selected","selected");ja.appendChild(L);L.setAttribute("selected","selected");mxUtils.write(x,mxResources.get("appearance")+
":");x.appendChild(ja);mxUtils.br(x);I+=26;var ca=this.addCheckbox(x,mxResources.get("zoom"),!0,null,!0);mxUtils.write(x,":");var ba=document.createElement("input");ba.setAttribute("type","text");ba.style.marginRight="16px";ba.style.width="60px";ba.style.marginLeft="4px";ba.style.marginRight="12px";ba.value="100%";x.appendChild(ba);var oa=this.addCheckbox(x,mxResources.get("fit"),!0);L=null!=this.pages&&1<this.pages.length;var Y=Y=this.addCheckbox(x,mxResources.get("allPages"),L,!L),da=this.addCheckbox(x,
mxResources.get("layers"),!0),ha=this.addCheckbox(x,mxResources.get("tags"),!0),Z=this.addCheckbox(x,mxResources.get("lightbox"),!0),k=null;if(EditorUi.enableHtmlEditOption){k=this.addEditButton(x,Z);var v=k.getEditInput();v.style.marginBottom="16px";I+=50;mxEvent.addListener(Z,"change",function(){Z.checked?v.removeAttribute("disabled"):v.setAttribute("disabled","disabled");v.checked&&Z.checked?k.getEditSelect().removeAttribute("disabled"):k.getEditSelect().setAttribute("disabled","disabled")})}c=
new CustomDialog(this,x,mxUtils.bind(this,function(){n(M.checked?m:null,ca.checked,ba.value,aa.getTarget(),aa.getColor(),oa.checked,Y.checked,da.checked,ha.checked,Z.checked,null!=k?k.getLink():null,null!=ja?ja.value:null)}),null,c,g);this.showDialog(c.container,340,I,!0,!0);F.focus()};EditorUi.prototype.showPublishLinkDialog=function(c,g,m,n,x,F,I,M,L,K,aa,ja){var ca=document.createElement("div");ca.style.whiteSpace="nowrap";var ba=document.createElement("h3");mxUtils.write(ba,c||mxResources.get("publish"));
ba.style.width="100%";ba.style.textAlign="center";ba.style.marginTop="2px";ba.style.marginBottom="20px";ca.appendChild(ba);var oa=document.createElement("select");c=30;oa.className="geBtn";oa.style.marginBottom="8px";oa.style.marginLeft="0px";oa.style.width="100%";oa.style.boxSizing="border-box";if(null==M||""==M.getHash())x=null!=x?x:"https://www.drawio.com/doc/faq/publish-diagram-as-link",ba=document.createElement("option"),mxUtils.write(ba,mxResources.get("makeCopy")),ba.setAttribute("value","copy"),
oa.appendChild(ba);ba=document.createElement("option");mxUtils.write(ba,mxResources.get("authorizationRequired"));ba.setAttribute("value","auth");oa.appendChild(ba);null!=M&&""!=M.getHash()||ba.setAttribute("disabled","disabled");M=document.createElement("option");M.setAttribute("value","public");oa.appendChild(M);null!=I?(mxUtils.write(M,mxResources.get("publicDiagramUrl")),M.setAttribute("title",I),oa.value="public"):(mxUtils.write(M,mxResources.get("publicDiagramUrl")+" ("+mxResources.get("diagramIsNotPublic")+
")"),M.setAttribute("disabled","disabled"));ca.appendChild(oa);mxUtils.br(ca);oa.focus();var Y=null,da=null;if(null!=g||null!=m)c+=30,mxUtils.write(ca,mxResources.get("width")+":"),Y=document.createElement("input"),Y.setAttribute("type","text"),Y.style.marginRight="16px",Y.style.width="50px",Y.style.marginLeft="6px",Y.style.marginRight="16px",Y.style.marginBottom="10px",Y.value="100%",ca.appendChild(Y),mxUtils.write(ca,mxResources.get("height")+":"),da=document.createElement("input"),da.setAttribute("type",
"text"),da.style.width="50px",da.style.marginLeft="6px",da.style.marginBottom="10px",da.value=m+"px",ca.appendChild(da),mxUtils.br(ca);var ha=this.addLinkSection(ca,n),Z=K?this.addCheckbox(ca,mxResources.get("transparentBackground"),!1):null;null!=Z&&(c+=20);var k=document.createElement("select");k.className="geBtn";k.style.marginTop="8px";g=document.createElement("option");mxUtils.write(g,mxResources.get("allPages"));g.setAttribute("value","allPages");k.appendChild(g);g=document.createElement("option");
mxUtils.write(g,mxResources.get("currentPage"));g.setAttribute("value","currentPage");k.appendChild(g);var v=null;null!=this.pages&&null!=this.currentPage&&0<this.getPageIndex(this.currentPage)&&(c+=30,g=null!=this.currentPage?this.currentPage.getName():"",16<g.length&&(g=g.substring(0,16)+"..."),ja&&(mxUtils.write(ca,mxResources.get("pages")+":"),ca.appendChild(k),mxUtils.br(ca),c+=30),v=this.addCheckbox(ca,mxResources.get("selectedPage")+": "+g));var J=document.createElement("select");J.style.maxWidth=
"260px";J.style.marginLeft="8px";J.style.marginTop="16px";ja=document.createElement("option");ja.setAttribute("value","0");mxUtils.write(ja,mxResources.get("light"));J.appendChild(ja);ja=document.createElement("option");ja.setAttribute("value","1");mxUtils.write(ja,mxResources.get("dark"));J.appendChild(ja);ja=document.createElement("option");ja.setAttribute("value","auto");mxUtils.write(ja,mxResources.get("automatic"));ja.setAttribute("selected","selected");J.appendChild(ja);aa&&(mxUtils.write(ca,
mxResources.get("appearance")+":"),ca.appendChild(J),mxUtils.br(ca),c+=30);var N=this.addCheckbox(ca,mxResources.get("lightbox"),!0,null,null,!n),T=this.addEditButton(ca,N),V=T.getEditInput();n&&(V.style.marginLeft=N.style.marginLeft,N.style.display="none",c-=20);var U=this.addCheckbox(ca,mxResources.get("layers"),!0);U.style.marginLeft=V.style.marginLeft;U.style.marginTop="8px";var X=this.addCheckbox(ca,mxResources.get("tags"),!0);X.style.marginLeft=V.style.marginLeft;X.style.marginBottom="16px";
X.style.marginTop="16px";mxEvent.addListener(N,"change",function(){N.checked?(U.removeAttribute("disabled"),V.removeAttribute("disabled"),X.removeAttribute("disabled")):(U.setAttribute("disabled","disabled"),V.setAttribute("disabled","disabled"),X.setAttribute("disabled","disabled"));V.checked&&N.checked?T.getEditSelect().removeAttribute("disabled"):T.getEditSelect().setAttribute("disabled","disabled")});n=new CustomDialog(this,ca,mxUtils.bind(this,function(){L(ha.getTarget(),ha.getColor(),null==
v?!1:v.checked,N.checked,T.getLink(),U.checked,null!=Y?Y.value:null,null!=da?da.value:null,X.checked,oa.value,null!=Z?Z.checked:!1,J.value,"allPages"==k.value)}),null,mxResources.get("create"),x,F);this.showDialog(n.container,340,296+c,!0,!0);null!=Y?(Y.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?Y.select():document.execCommand("selectAll",!1,null)):null==oa.parentNode;ha.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,g,m,n,x){var F=document.createElement("div");
F.style.whiteSpace="nowrap";var I=document.createElement("h3");mxUtils.write(I,mxResources.get("image"));I.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(x?"10":"4")+"px";F.appendChild(I);if(x){mxUtils.write(F,mxResources.get("zoom")+":");var M=document.createElement("input");M.setAttribute("type","text");M.style.marginRight="16px";M.style.width="60px";M.style.marginLeft="4px";M.style.marginRight="12px";M.value=this.lastExportZoom||"100%";F.appendChild(M);mxUtils.write(F,
mxResources.get("borderWidth")+":");var L=document.createElement("input");L.setAttribute("type","text");L.style.marginRight="16px";L.style.width="60px";L.style.marginLeft="4px";L.value=this.lastExportBorder||"0";F.appendChild(L);mxUtils.br(F)}var K=this.addCheckbox(F,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),aa=n?null:this.addCheckbox(F,mxResources.get("includeCopyOfMyDiagram"),Editor.defaultIncludeDiagram);I=this.editor.graph;var ja=n?null:this.addCheckbox(F,mxResources.get("transparentBackground"),
I.background==mxConstants.NONE||null==I.background);null!=ja&&(ja.style.marginBottom="16px");c=new CustomDialog(this,F,mxUtils.bind(this,function(){var ca=parseInt(M.value)/100||1,ba=parseInt(L.value)||0;m(!K.checked,null!=aa?aa.checked:!1,null!=ja?ja.checked:!1,ca,ba)}),null,c,g);this.showDialog(c.container,300,(x?25:0)+(n?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(c,g,m,n,x,F,I,M,L){I=null!=I?I:Editor.defaultIncludeDiagram;var K=document.createElement("div");K.style.whiteSpace=
"nowrap";var aa=this.editor.graph,ja="jpeg"==M||"webp"==M?220:320,ca=document.createElement("h3");mxUtils.write(ca,c);ca.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";K.appendChild(ca);mxUtils.write(K,mxResources.get("zoom")+":");var ba=document.createElement("input");ba.setAttribute("type","text");ba.style.marginRight="16px";ba.style.width="60px";ba.style.marginLeft="4px";ba.style.marginRight="12px";ba.value=this.lastExportZoom||"100%";K.appendChild(ba);mxUtils.write(K,
mxResources.get("borderWidth")+":");var oa=document.createElement("input");oa.setAttribute("type","text");oa.style.marginRight="16px";oa.style.width="60px";oa.style.marginLeft="4px";oa.value=this.lastExportBorder||"0";K.appendChild(oa);mxUtils.br(K);var Y=this.addCheckbox(K,mxResources.get("selectionOnly"),!1,aa.isSelectionEmpty()),da=document.createElement("input");da.style.marginTop="16px";da.style.marginRight="8px";da.style.marginLeft="24px";da.setAttribute("disabled","disabled");da.setAttribute("type",
"checkbox");var ha=document.createElement("select");ha.style.marginTop="16px";ha.style.marginLeft="8px";c=["selectionOnly","diagram","page"];for(ca=0;ca<c.length;ca++)if(!aa.isSelectionEmpty()||"selectionOnly"!=c[ca]){var Z=document.createElement("option");mxUtils.write(Z,mxResources.get(c[ca]));Z.setAttribute("value",c[ca]);ha.appendChild(Z)}L?(mxUtils.write(K,mxResources.get("size")+":"),K.appendChild(ha),mxUtils.br(K),ja+=26,mxEvent.addListener(ha,"change",function(){"selectionOnly"==ha.value&&
(Y.checked=!0)})):F&&(K.appendChild(da),mxUtils.write(K,mxResources.get("crop")),mxUtils.br(K),ja+=30,mxEvent.addListener(Y,"change",function(){Y.checked?da.removeAttribute("disabled"):da.setAttribute("disabled","disabled")}));aa.isSelectionEmpty()?L&&(Y.style.display="none",Y.nextSibling.style.display="none",Y.nextSibling.nextSibling.style.display="none",ja-=30):(ha.value="diagram",da.setAttribute("checked","checked"),da.defaultChecked=!0,mxEvent.addListener(Y,"change",function(){ha.value=Y.checked?
"selectionOnly":"diagram"}));var k=this.addCheckbox(K,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=M&&"webp"!=M),v=document.createElement("select");v.style.maxWidth="260px";v.style.marginLeft="8px";v.style.marginTop="16px";F=document.createElement("option");F.setAttribute("value","light");mxUtils.write(F,mxResources.get("light"));v.appendChild(F);L=document.createElement("option");L.setAttribute("value","dark");mxUtils.write(L,mxResources.get("dark"));v.appendChild(L);"svg"==M&&mxUtils.lightDarkColorSupported?
(F=document.createElement("option"),F.setAttribute("value","auto"),mxUtils.write(F,mxResources.get("automatic")),F.setAttribute("selected","selected"),v.appendChild(F)):Editor.isDarkMode()?L.setAttribute("selected","selected"):F.setAttribute("selected","selected");mxUtils.write(K,mxResources.get("appearance")+":");K.appendChild(v);mxUtils.br(K);ja+=26;var J=this.addCheckbox(K,mxResources.get("shadow"),aa.shadowVisible),N=null;if("png"==M||"jpeg"==M||"webp"==M)N=this.addCheckbox(K,mxResources.get("grid"),
!1,this.isOffline()||!Editor.canvasSupported,!1,!0),ja+=30;aa=null!=this.pages?this.pages.length:1;var T=this.addCheckbox(K,mxResources.get("includeCopyOfMyDiagram")+(1<aa?":":""),I,null,null,"jpeg"!=M&&"webp"!=M),V=document.createElement("select");V.style.maxWidth="260px";V.style.marginLeft="28px";"png"==M||"svg"==M?(I=function(){T.checked?V.removeAttribute("disabled"):V.setAttribute("disabled","disabled")},F=document.createElement("option"),F.setAttribute("value","allPages"),mxUtils.write(F,mxResources.get("allPages")),
V.appendChild(F),F=document.createElement("option"),F.setAttribute("value","currentPage"),mxUtils.write(F,mxResources.get("currentPage")),V.appendChild(F),1<aa?(T.style.marginBottom="12px",V.style.marginBottom="16px",K.appendChild(V),mxUtils.br(K),ja+=20):T.style.marginBottom="16px",null!=this.lastEmbedInclude&&(V.value=this.lastEmbedInclude),mxEvent.addListener(T,"change",I),I()):T.style.marginBottom="16px";var U=document.createElement("input");U.style.marginBottom="16px";U.style.marginRight="8px";
U.setAttribute("type","checkbox");var X=document.createElement("input");X.style.marginBottom="16px";X.style.marginRight="8px";X.setAttribute("type","checkbox");g&&(U.checked=null!=this.lastEmbedImages?this.lastEmbedImages:!0,K.appendChild(U),mxUtils.write(K,mxResources.get("embedImages")),mxUtils.br(K),X.checked=null!=this.lastEmbedFonts?this.lastEmbedImages:!0,K.appendChild(X),mxUtils.write(K,mxResources.get("embedFonts")),mxUtils.br(K),ja+=50);var fa=document.createElement("select");fa.style.maxWidth=
"260px";fa.style.marginLeft="8px";F=document.createElement("option");F.setAttribute("value","auto");mxUtils.write(F,mxResources.get("automatic"));fa.appendChild(F);I=document.createElement("option");I.setAttribute("value","blank");mxUtils.write(I,mxResources.get("openInNewWindow"));fa.appendChild(I);I=document.createElement("option");I.setAttribute("value","self");mxUtils.write(I,mxResources.get("openInThisWindow"));fa.appendChild(I);I=document.createElement("div");mxUtils.write(I,mxResources.get("LinksLost"));
I.style.margin="7px";I.style.display="none";"svg"==M&&(mxUtils.write(K,mxResources.get("links")+":"),K.appendChild(fa),K.appendChild(I),mxUtils.br(K),mxUtils.br(K),ja+=50);m=new CustomDialog(this,K,mxUtils.bind(this,function(){this.lastExportBorder=oa.value;this.lastExportZoom=ba.value;this.lastEmbedImages=U.checked;this.lastEmbedFonts=X.checked;this.lastEmbedInclude=V.value;x(ba.value,k.checked,!Y.checked,J.checked,T.checked,U.checked&&g,oa.value,da.checked,("png"==M||"svg"==M)&&"currentPage"==V.value,
fa.value,null!=N?N.checked:null,null!=v?v.value:null,ha.value,X.checked)}),null,m,n);this.showDialog(m.container,340,ja,!0,!0,null,null,null,null,!0);ba.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?ba.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(c,g,m,n,x){var F=document.createElement("div");F.style.whiteSpace="nowrap";var I=this.editor.graph;if(null!=g){var M=document.createElement("h3");mxUtils.write(M,g);M.style.cssText=
"width:100%;text-align:center;margin-top:0px;margin-bottom:4px";F.appendChild(M)}var L=this.addCheckbox(F,mxResources.get("fit"),!0),K=this.addCheckbox(F,mxResources.get("shadow"),I.shadowVisible&&n,!n),aa=this.addCheckbox(F,m),ja=this.addCheckbox(F,mxResources.get("lightbox"),!0),ca=this.addEditButton(F,ja),ba=ca.getEditInput(),oa=1<I.model.getChildCount(I.model.getRoot()),Y=this.addCheckbox(F,mxResources.get("layers"),oa,!oa);Y.style.marginLeft=ba.style.marginLeft;Y.style.marginBottom="12px";Y.style.marginTop=
"8px";mxEvent.addListener(ja,"change",function(){ja.checked?(oa&&Y.removeAttribute("disabled"),ba.removeAttribute("disabled")):(Y.setAttribute("disabled","disabled"),ba.setAttribute("disabled","disabled"));ba.checked&&ja.checked?ca.getEditSelect().removeAttribute("disabled"):ca.getEditSelect().setAttribute("disabled","disabled")});g=new CustomDialog(this,F,mxUtils.bind(this,function(){c(L.checked,K.checked,aa.checked,ja.checked,ca.getLink(),Y.checked)}),null,mxResources.get("embed"),x);this.showDialog(g.container,
280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,g,m,n,x,F,I,M){function L(ba){var oa=" ",Y="";n&&(oa=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(null!=aa?"&page="+aa:"")+(x?"&edit=_blank":
"")+(F?"&layers=1":"")+"');}})(this);\"",Y+="cursor:pointer;");c&&(Y+="max-width:100%;");var da="";m&&(da=' width="'+Math.round(K.width)+'" height="'+Math.round(K.height)+'"');I('<img src="'+ba+'"'+da+(""!=Y?' style="'+Y+'"':"")+oa+"/>")}var K=this.editor.graph.getGraphBounds(),aa=this.getSelectedPageIndex();if(this.editor.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(ba){var oa=n?this.getFileData(!0):null;ba=this.createImageDataUri(ba,oa,"png");L(ba)}),null,null,null,mxUtils.bind(this,
function(ba){M({message:mxResources.get("unknownError")})}),null,!0,m?2:1,null,g,null,null,Editor.defaultBorder);else if(g=this.getFileData(!0),K.width*K.height<=MAX_AREA&&g.length<=MAX_REQUEST_SIZE){var ja="";m&&(ja="&w="+Math.round(2*K.width)+"&h="+Math.round(2*K.height));var ca=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(n?"1":"0")+ja+"&xml="+encodeURIComponent(g));ca.send(mxUtils.bind(this,function(){200<=ca.getStatus()&&299>=ca.getStatus()?L("data:image/png;base64,"+ca.getText()):
M({message:mxResources.get("unknownError")})}))}else M({message:mxResources.get("drawingTooLarge")})};EditorUi.prototype.createEmbedSvg=function(c,g,m,n,x,F,I){var M=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!m,"auto"),L=M.getElementsByTagName("a");if(null!=L)for(var K=0;K<L.length;K++){var aa=L[K].getAttribute("href");null!=aa&&"#"==aa.charAt(0)&&"_blank"==L[K].getAttribute("target")&&L[K].removeAttribute("target")}n&&M.setAttribute("content",this.getFileData(!0));
g&&this.editor.graph.addSvgShadow(M);if(m){var ja=" ",ca="";n&&(ja="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+EditorUi.lightboxHost+"/?client=1"+(x?"&edit=_blank":"")+(F?"&layers=1":"")+"');}})(this);\"",ca+="cursor:pointer;");
c&&(ca+="max-width:100%;");this.editor.convertImages(M,mxUtils.bind(this,function(ba){I('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(ba))+'"'+(""!=ca?' style="'+ca+'"':"")+ja+"/>")}))}else ca="",n&&(g=this.getSelectedPageIndex(),M.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+
EditorUi.lightboxHost+"/?client=1"+(null!=g?"&page="+g:"")+(x?"&edit=_blank":"")+(F?"&layers=1":"")+"');}}})(this);"),ca+="cursor:pointer;"),c&&(c=parseInt(M.getAttribute("width")),x=parseInt(M.getAttribute("height")),M.setAttribute("viewBox","-0.5 -0.5 "+c+" "+x),ca+="max-width:100%;max-height:"+x+"px;",M.removeAttribute("height")),""!=ca&&M.setAttribute("style",ca),this.editor.addFontCss(M),this.editor.graph.mathEnabled&&this.editor.addMathCss(M),I(mxUtils.getXml(M))};EditorUi.prototype.timeSince=
function(c){c=Math.floor((new Date-c)/1E3);var g=Math.floor(c/31536E3);if(1<g)return g+" "+mxResources.get("years");g=Math.floor(c/2592E3);if(1<g)return g+" "+mxResources.get("months");g=Math.floor(c/86400);if(1<g)return g+" "+mxResources.get("days");g=Math.floor(c/3600);if(1<g)return g+" "+mxResources.get("hours");g=Math.floor(c/60);return 1<g?g+" "+mxResources.get("minutes"):1==g?g+" "+mxResources.get("minute"):null};EditorUi.prototype.decodeNodeIntoGraph=function(c,g){if(null!=c){var m=null;if("diagram"==
c.nodeName)m=c;else if("mxfile"==c.nodeName){var n=c.getElementsByTagName("diagram");if(0<n.length){m=n[0];var x=g.getGlobalVariable;g.getGlobalVariable=function(F){return"page"==F?m.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==F?1:x.apply(this,arguments)}}}null!=m&&(c=Editor.parseDiagramNode(m))}n=this.editor.graph;try{this.editor.graph=g,this.editor.setGraphXml(c)}catch(F){}finally{this.editor.graph=n}return c};EditorUi.prototype.getSvgFileProperties=function(c){return this.getPngFileProperties(c)};
EditorUi.prototype.getPngFileProperties=function(c){var g=1,m=0;if(null!=c){if(c.hasAttribute("scale")){var n=parseFloat(c.getAttribute("scale"));!isNaN(n)&&0<n&&(g=n)}c.hasAttribute("border")&&(n=parseInt(c.getAttribute("border")),!isNaN(n)&&0<n&&(m=n))}return{scale:g,border:m}};EditorUi.prototype.getEmbeddedPng=function(c,g,m,n,x){try{var F=this.editor.graph,I=null;if(null!=m&&0<m.length)F=this.createTemporaryGraph(F.getStylesheet()),document.body.appendChild(F.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(m).documentElement,
!0),F),I=m;else if(null!=this.pages&&this.currentPage!=this.pages[0]){F=this.createTemporaryGraph(F.getStylesheet());var M=F.getGlobalVariable;F.setBackgroundImage=this.editor.graph.setBackgroundImage;var L=this.pages[0];this.currentPage==L?F.setBackgroundImage(this.editor.graph.backgroundImage):null!=L.viewState&&null!=L.viewState&&F.setBackgroundImage(L.viewState.backgroundImage);F.getGlobalVariable=function(K){return"page"==K?L.getName():"pagenumber"==K?1:M.apply(this,arguments)};document.body.appendChild(F.container);
F.model.setRoot(L.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(K){try{null==I&&(I=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var aa=K.toDataURL("image/png");aa=Editor.writeGraphModelToPng(aa,"tEXt","mxfile",encodeURIComponent(I));c(aa.substring(aa.lastIndexOf(",")+1));F!=this.editor.graph&&F.container.parentNode.removeChild(F.container)}catch(ja){null!=g&&g(ja)}}),null,null,null,mxUtils.bind(this,function(K){null!=g&&g(K)}),null,null,n,null,F.shadowVisible,null,
F,x,null,null,null,"diagram",null)}catch(K){null!=g&&g(K)}};EditorUi.prototype.getEmbeddedSvg=function(c,g,m,n,x,F,I,M,L,K,aa,ja,ca){M=null!=M?M:!0;aa=null!=aa?aa:0;I=null!=L?L:g.background;I==mxConstants.NONE&&(I=null);null==I&&"none"==g.getAdaptiveColors()&&(I="#ffffff");L=this.editor.graph.createSvgImageExport(null!=c);F=g.getSvg(I,K,aa,null,null,F,null,L,null,g.shadowVisible||ja,null,ca,"diagram");(g.shadowVisible||ja)&&g.addSvgShadow(F,null,null,0==aa);null!=c&&F.setAttribute("content",c);null!=
m&&F.setAttribute("resource",m);var ba=mxUtils.bind(this,function(oa){oa=(n?"":Graph.xmlDeclaration+"\n"+Graph.svgFileComment+"\n"+Graph.svgDoctype+"\n")+mxUtils.getXml(oa);null!=x&&x(oa);return oa});g.mathEnabled&&this.editor.addMathCss(F);if(null!=x)this.embedFonts(F,mxUtils.bind(this,function(oa){M?this.editor.convertImages(oa,mxUtils.bind(this,function(Y){ba(Y)})):ba(oa)}));else return ba(F)};EditorUi.prototype.embedFonts=function(c,g){this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=
this.editor.resolvedFontCss&&this.editor.addFontCss(c,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(m){try{null!=m&&this.editor.addFontCss(c,m),g(c)}catch(n){g(c)}}))}catch(m){g(c)}}))};EditorUi.prototype.exportImage=function(c,g,m,n,x,F,I,M,L,K,aa,ja,ca){L=null!=L?L:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"),mxUtils.bind(this,function(oa){Editor.addRetryToError(oa,mxUtils.bind(this,function(){this.exportImage(c,g,m,n,x,F,I,M,L,K,aa,ja,
ca)}));this.handleError(oa)}))){var ba=this.editor.graph.isSelectionEmpty();m=null!=m?m:ba;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.editor.exportToCanvas(mxUtils.bind(this,function(oa){this.spinner.stop();try{this.saveCanvas(oa,x?this.getFileData(!0,null,null,null,m,M,null,null,null,null,null,c,F):null,L,null==this.pages||0==this.pages.length,aa)}catch(Y){this.handleError(Y)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(oa){this.spinner.stop();this.handleError(oa)}),
null,m,c||1,g,n,null,null,F,I,K,ja,ca)}catch(oa){this.spinner.stop(),this.handleError(oa)}}};EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};EditorUi.prototype.addLocalPagesToMapping=function(c){c=null!=c?c:{};if(null!=this.pages)for(var g=0;g<this.pages.length;g++)c[this.pages[g].getId()]=this.pages[g].getId();return c};EditorUi.prototype.importXml=function(c,g,m,n,x,F,I){g=null!=g?g:0;m=null!=m?m:0;var M=[];try{var L=this.editor.graph;if(null!=c&&0<
c.length){L.model.beginUpdate();try{var K=mxUtils.parseXml(c);c={};var aa=this.editor.extractGraphModel(K.documentElement,null!=this.pages);if(null!=aa&&"mxfile"==aa.nodeName&&null!=this.pages){var ja=aa.getElementsByTagName("diagram");if(1==ja.length&&!F){if(aa=Editor.parseDiagramNode(ja[0]),null!=this.currentPage&&(c[ja[0].getAttribute("id")]=this.currentPage.getId(),this.isBlankFile())){var ca=ja[0].getAttribute("name");null!=ca&&""!=ca&&this.editor.graph.model.execute(new RenamePage(this,this.currentPage,
ca))}}else if(0<ja.length){F=[];var ba=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(c[ja[0].getAttribute("id")]=this.pages[0].getId(),ca=ja[0].getAttribute("name"),null!=ca&&""!=ca&&this.editor.graph.model.execute(new RenamePage(this,this.pages[0],ca)),aa=Editor.parseDiagramNode(ja[0]),n=!1,ba=1);for(;ba<ja.length;ba++){var oa=ja[ba].getAttribute("id");ja[ba].removeAttribute("id");var Y=this.updatePageRoot(new DiagramPage(ja[ba]));c[oa]=ja[ba].getAttribute("id");var da=this.pages.length;
null==Y.getName()&&Y.setName(mxResources.get("pageWithNumber",[da+1]));L.model.execute(new ChangePage(this,Y,Y,da,!0));F.push(Y)}this.updatePageLinks(c,F)}}if(null!=aa&&"mxGraphModel"===aa.nodeName){M=L.importGraphModel(aa,g,m,n);if(null!=M)for(this.addLocalPagesToMapping(c),ba=0;ba<M.length;ba++)this.updatePageLinksForCell(c,M[ba]);var ha=L.parseBackgroundImage(aa.getAttribute("backgroundImage"));if(null!=ha&&null!=ha.originalSrc){this.updateBackgroundPageLink(c,ha);var Z=new ChangePageSetup(this,
null,ha);Z.ignoreColor=!0;L.model.execute(Z)}}I&&L.pasteCellStyles(L.includeDescendants(M),L.defaultVertexStyle,L.defaultEdgeStyle)}finally{L.model.endUpdate()}}}catch(k){if(x)throw k;this.handleError(k)}return M};EditorUi.prototype.updatePageLinks=function(c,g){for(var m=0;m<g.length;m++)this.updatePageLinksForCell(c,g[m].root),null!=g[m].viewState&&this.updateBackgroundPageLink(c,g[m].viewState.backgroundImage)};EditorUi.prototype.updateBackgroundPageLink=function(c,g){try{if(null!=g&&Graph.isPageLink(g.originalSrc)){var m=
c[g.originalSrc.substring(g.originalSrc.indexOf(",")+1)];null!=m&&(g.originalSrc="data:page/id,"+m)}}catch(n){}};EditorUi.prototype.updatePageLinksForCell=function(c,g){var m=document.createElement("div"),n=this.editor.graph,x=n.getLinkForCell(g);null!=x&&n.setLinkForCell(g,this.updatePageLink(c,x));if(n.isHtmlLabel(g)){m.innerHTML=Graph.sanitizeHtml(n.getLabel(g));for(var F=m.getElementsByTagName("a"),I=!1,M=0;M<F.length;M++)x=F[M].getAttribute("href"),null!=x&&(F[M].setAttribute("href",this.updatePageLink(c,
x)),I=!0);I&&n.labelChanged(g,m.innerHTML)}for(M=0;M<n.model.getChildCount(g);M++)this.updatePageLinksForCell(c,n.model.getChildAt(g,M))};EditorUi.prototype.updatePageLink=function(c,g){if(Graph.isPageLink(g)){var m=c[g.substring(g.indexOf(",")+1)];g=null!=m?"data:page/id,"+m:null}else if("data:action/json,"==g.substring(0,17))try{var n=JSON.parse(g.substring(17));if(null!=n.actions){for(var x=0;x<n.actions.length;x++){var F=n.actions[x];if(null!=F.open&&Graph.isPageLink(F.open)){var I=F.open.substring(F.open.indexOf(",")+
1);m=c[I];null!=m?F.open="data:page/id,"+m:null==this.getPageById(I)&&delete F.open}}g="data:action/json,"+JSON.stringify(n)}}catch(M){}return g};EditorUi.prototype.isRemoteVisioFormat=function(c){return/(\.v(sd|dx))($|\?)/i.test(c)||/(\.vs(s|x))($|\?)/i.test(c)};EditorUi.prototype.importVisio=function(c,g,m,n,x){var F=mxUtils.bind(this,function(I){this.loadingExtensions=!1;null!=m?m(I):this.handleError(I)});this.createTimeout(null,mxUtils.bind(this,function(I){n=null!=n?n:c.name;var M=mxUtils.bind(this,
function(K){I.clear()&&F(K)}),L=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var K=this.isRemoteVisioFormat(n);try{var aa=n.lastIndexOf(".");if(0<=aa&&aa<n.length)n.substring(aa+1).toUpperCase();else{var ja=n.lastIndexOf("/");0<=ja&&ja<n.length&&(n=n.substring(ja+1))}}catch(ba){}if(K)if(null==VSS_CONVERT_URL||this.isOffline())M({message:"draw.io"!=this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{K=new FormData;
K.append("file1",c,n);var ca=new XMLHttpRequest;ca.open("POST",VSS_CONVERT_URL+(/(\.vss|\.vsx)$/.test(n)?"?stencil=1":""));ca.responseType="blob";this.addRemoteServiceSecurityCheck(ca);null!=x&&ca.setRequestHeader("x-convert-custom",x);ca.onreadystatechange=mxUtils.bind(this,function(){if(4==ca.readyState&&I.clear())if(200<=ca.status&&299>=ca.status)try{var ba=ca.response;if("text/xml"==ba.type){var oa=new FileReader;oa.onload=mxUtils.bind(this,function(Y){try{g(Y.target.result)}catch(da){M({message:mxResources.get("errorLoadingFile")})}});
oa.readAsText(ba)}else this.doImportVisio(ba,g,M,n)}catch(Y){M(Y)}else try{""==ca.responseType||"text"==ca.responseType?M({message:ca.responseText}):(oa=new FileReader,oa.onload=function(){try{M({message:JSON.parse(oa.result).Message})}catch(Y){null!=oa.result&&0<oa.result.length?M({message:oa.result}):M(Y)}},oa.readAsText(ca.response))}catch(Y){M({})}});ca.send(K)}else if(I.clear())try{this.doImportVisio(c,g,M,n)}catch(ba){M(ba)}}else M({message:mxResources.get("serviceUnavailableOrBlocked")})});
this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?L():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",L,null,null,null,M))}),F)};EditorUi.prototype.importGraphML=function(c,g,m){var n=mxUtils.bind(this,function(x){this.loadingExtensions=!1;null!=m?m(x):this.handleError(x)});this.createTimeout(null,mxUtils.bind(this,function(x){var F=mxUtils.bind(this,function(M){x.clear()&&n(M)}),I=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(x.clear())if(this.doImportGraphML)try{this.doImportGraphML(c,
g,n)}catch(M){F(M)}else F({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?I():(this.loadingExtensions=!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",I,null,null,null,F))}),n)};EditorUi.prototype.exportVisio=function(c){if(this.spinner.spin(document.body,mxResources.get("loading"))){var g=mxUtils.bind(this,function(m){this.loadingExtensions=!1;this.handleError(m)});this.vsdxExportEnabled()?this.createTimeout(null,
mxUtils.bind(this,function(m){var n=mxUtils.bind(this,function(F){m.clear()&&g(F)}),x=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(m.clear())if("undefined"!==typeof VsdxExport)try{this.spinner.stop(),(new VsdxExport(this)).exportCurrentDiagrams(c)||n({message:mxResources.get("unknownError")})}catch(F){n(F)}else n({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(x,0):(this.loadingExtensions=
!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",x,null,null,null,n))}),g):g({message:mxResources.get("serviceUnavailableOrBlocked")})}};EditorUi.prototype.convertLucidChart=function(c,g,m){var n=mxUtils.bind(this,function(x){this.loadingExtensions=!1;null!=m?m(x):this.handleError(x)});this.createTimeout(null,mxUtils.bind(this,function(x){var F=mxUtils.bind(this,function(M){x.clear()&&n(M)}),I=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(x.clear())if("undefined"!==typeof window.LucidImporter)try{var M=
JSON.parse(c);g(LucidImporter.importState(M));try{if(null!=window.console&&"1"==urlParams.test){var L=[(new Date).toISOString(),"convertLucidChart",M];null!=M.state&&L.push(JSON.parse(M.state));if(null!=M.svgThumbs)for(var K=0;K<M.svgThumbs.length;K++)L.push(Editor.createSvgDataUri(M.svgThumbs[K]));null!=M.thumb&&L.push(M.thumb);console.log.apply(console,L)}}catch(aa){}}catch(aa){null!=window.console&&console.error(aa),F(aa)}else F({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==
typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(I,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",function(){mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",I,null,null,null,F)},null,null,null,F)},null,null,null,F)},null,null,null,F)},null,null,null,F):mxscript(window.DRAWIO_SERVER_URL+
"js/extensions.min.js",I,null,null,null,F))}),n)};EditorUi.prototype.createMermaidXml=function(c,g,m,n,x,F){var I=new Graph(document.createElement("div"));m=I.insertVertex(null,null,null,0,0,n,x,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+m+";");I.setAttributeForCell(m,"mermaidData",JSON.stringify({data:c,config:g},null,2));null!=F&&I.setAttributeForCell(m,"templatePrompt",F);c=(new mxCodec).encode(I.getModel());return mxUtils.getXml(c)};EditorUi.prototype.generateOpenAiMermaidDiagram=
function(c,g,m){var n=0,x=function(){for(var I=document.querySelectorAll('div[id*="dgeMermaidOutput-"]'),M=0;M<I.length;M++)null!=I[M].parentNode&&I[M].parentNode.removeChild(I[M])},F=mxUtils.bind(this,function(){this.createTimeout(3E4,mxUtils.bind(this,function(I){var M=new mxXmlRequest("https://www.draw.io/generate/v2",c,"POST"),L=mxUtils.bind(this,function(K){I.clear()&&(x(),m(K))});M.send(mxUtils.bind(this,function(K){if(I.isAlive())if(200<=K.getStatus()&&299>=K.getStatus())this.tryAndHandle(mxUtils.bind(this,
function(){var ja=mxUtils.trim(K.getText());this.generateMermaidImage(ja,null,mxUtils.bind(this,function(ca,ba,oa){this.tryAndHandle(mxUtils.bind(this,function(){I.clear()&&(EditorUi.debug("EditorUi.generateOpenAiMermaidDiagram",[this],"prompt",[c],"result",[ja]),x(),g(ja,ca,ba,oa))}),L)}),L,mxUtils.bind(this,function(ca){3>n++?I.clear()&&F():L(ca)}))}),L);else{var aa={message:mxResources.get("error")+" "+K.getStatus()};try{aa=JSON.parse(K.getText()),aa=aa.error}catch(ja){}L(aa)}}),L)}),m)});F()};
EditorUi.prototype.extractMermaidDeclaration=function(c){c=mxUtils.trim(c);"o\n\n"==c.substring(0,3)&&(c=c.substring(3));var g=c.split("```");g=1<g.length?g:c.split("<pre>");g=1<g.length?g:c.split("~~~");g=1<g.length?g:c.split("%%");g=1<g.length?g:c.split("(Begins)");c=mxUtils.trim(1>=g.length?c:g[1]);g=c.split("\n");var m=1<g.length?g[1]:null;if(null!=m){var n=m.indexOf("-");0<n&&(m=m.substring(0,n))}if(0<g.length&&"mermaid"==mxUtils.trim(g[0])||null!=m&&0<=mxUtils.indexOf(EditorUi.mermaidDiagramTypes,
m))g.shift(),c=mxUtils.trim(g.join("\n")),g=c.split("\n");m=g[0].split(" ")[0].replace(/:$/,"");n=m.indexOf("-");0<n&&(m=m.substring(0,n));try{"mindmap"==m&&2<g.length&&(c=extractMermaidMindmap(g))}catch(x){}0>mxUtils.indexOf(EditorUi.mermaidDiagramTypes,m)&&(c=null);return c};EditorUi.prototype.generateMermaidImage=function(c,g,m,n,x){var F=mxUtils.bind(this,function(M){this.loadingMermaid=!1;null!=n?n(M):this.handleError(M)}),I=mxUtils.bind(this,function(){try{this.loadingMermaid=!1;g=null!=g?g:
mxUtils.clone(EditorUi.defaultMermaidConfig);g.securityLevel="strict";g.startOnLoad=!1;g.maxTextSize=9E5;"undefined"!==typeof mxMermaidToDrawio&&g.flowchart&&0<=c.indexOf("$$")&&(g.flowchart.htmlLabels=!0,mxMermaidToDrawio.htmlLabels=!0);Editor.isDarkMode()&&(g.theme="dark");var M=mxUtils.bind(this,function(L){try{if(mxClient.IS_IE||mxClient.IS_IE11)L=L.replace(/ xmlns:\S*="http:\/\/www.w3.org\/XML\/1998\/namespace"/g,"").replace(/ (NS xml|\S*):space="preserve"/g,' xml:space="preserve"');L=L.replace(/xlink:href/g,
"href").replace(/<br>/g,"<br/>");var K=mxUtils.parseXml(L).getElementsByTagName("svg");if(0<K.length&&"error"!=K[0].getAttribute("aria-roledescription")){var aa=parseFloat(K[0].getAttribute("width")),ja=parseFloat(K[0].getAttribute("height"));if(isNaN(aa)||isNaN(ja))try{var ca=K[0].getAttribute("viewBox").split(/\s+/);aa=parseFloat(ca[2]);ja=parseFloat(ca[3])}catch(ba){aa=aa||100,ja=ja||100}m(this.convertDataUri(Editor.createSvgDataUri(L)),aa,ja)}else null!=x?x():n({message:mxResources.get("invalidInput")})}catch(ba){n(ba)}});
mermaid.mermaidAPI.initialize(g);mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),c).then(function(L){M(L.svg)}).catch(function(L){null!=x?x(L):n(L)})}catch(L){n(L)}});"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?window.setTimeout(I,0):(this.loadingMermaid=!0,"1"==urlParams.dev?("1"==urlParams.mermaidToDrawioTest&&mxMermaidToDrawio.addListener(mxUtils.bind(this,function(M){this.importXml(M,null,null,null,null,null,!0)})),mxscript("js/mermaid/mermaid.min.js",
I,null,null,null,F)):mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",I,null,null,null,F))};EditorUi.prototype.generatePlantUmlImage=function(c,g,m,n){function x(M,L,K){c1=M>>2;c2=(M&3)<<4|L>>4;c3=(L&15)<<2|K>>6;c4=K&63;r="";r+=F(c1&63);r+=F(c2&63);r+=F(c3&63);return r+=F(c4&63)}function F(M){if(10>M)return String.fromCharCode(48+M);M-=10;if(26>M)return String.fromCharCode(65+M);M-=26;if(26>M)return String.fromCharCode(97+M);M-=26;return 0==M?"-":1==M?"_":"?"}var I=new XMLHttpRequest;I.open("GET",
("txt"==g?PLANT_URL+"/txt/":"png"==g?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(M){r="";for(i=0;i<M.length;i+=3)r=i+2==M.length?r+x(M.charCodeAt(i),M.charCodeAt(i+1),0):i+1==M.length?r+x(M.charCodeAt(i),0,0):r+x(M.charCodeAt(i),M.charCodeAt(i+1),M.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=g&&(I.responseType="blob");I.onload=function(M){if(200<=this.status&&300>this.status)if("txt"==g)m(this.response);else{var L=new FileReader;L.readAsDataURL(this.response);
L.onloadend=function(K){var aa=new Image;aa.onload=function(){try{var ja=aa.width,ca=aa.height;if(0==ja&&0==ca){var ba=L.result,oa=ba.indexOf(","),Y=decodeURIComponent(escape(atob(ba.substring(oa+1)))),da=mxUtils.parseXml(Y).getElementsByTagName("svg");0<da.length&&(ja=parseFloat(da[0].getAttribute("width")),ca=parseFloat(da[0].getAttribute("height")))}m(L.result,ja,ca)}catch(ha){n(ha)}};aa.src=L.result};L.onerror=function(K){n(K)}}else n(M)};I.onerror=function(M){n(M)};I.send()};EditorUi.prototype.insertAsPreText=
function(c,g,m){var n=this.editor.graph,x=null;n.getModel().beginUpdate();try{x=n.insertVertex(null,null,"<pre>"+c+"</pre>",g,m,1,1,"text;html=1;align=left;verticalAlign=top;"),n.updateCellSize(x,!0)}finally{n.getModel().endUpdate()}return x};EditorUi.prototype.insertTextAt=function(c,g,m,n,x,F,I,M){F=null!=F?F:!0;I=null!=I?I:!0;if(null!=c)if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c))this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):
this.parseFileData(c.replace(/\s+/g," "),mxUtils.bind(this,function(ca){4==ca.readyState&&200<=ca.status&&299>=ca.status&&this.editor.graph.setSelectionCells(this.insertTextAt(ca.responseText,g,m,!0))}));else if("data:"==c.substring(0,5)||!this.isOffline()&&(x||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c))){var L=this.editor.graph;if("data:application/pdf;base64,"==c.substring(0,28)){var K=Editor.extractGraphModelFromPdf(c);if(null!=K&&0<K.length)return this.importXml(K,g,m,F,!0,M)}if(Editor.isPngDataUrl(c)&&
(K=Editor.extractGraphModelFromPng(c),null!=K&&0<K.length))return this.importXml(K,g,m,F,!0,M);if("data:image/svg+xml;"==c.substring(0,19))try{K=null;"data:image/svg+xml;base64,"==c.substring(0,26)?(K=c.substring(c.indexOf(",")+1),K=window.atob&&!mxClient.IS_SF?atob(K):Base64.decode(K,!0)):K=decodeURIComponent(c.substring(c.indexOf(",")+1));var aa=this.importXml(K,g,m,F,!0,M);if(0<aa.length)return aa}catch(ca){}this.loadImage(c,mxUtils.bind(this,function(ca){if("data:"==c.substring(0,5))this.resizeImage(ca,
c,mxUtils.bind(this,function(Y,da,ha){L.setSelectionCell(L.insertVertex(null,null,"",L.snap(g),L.snap(m),da,ha,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(Y)+";"))}),I,this.maxImageSize);else{var ba=Math.min(1,Math.min(this.maxImageSize/ca.width,this.maxImageSize/ca.height)),oa=Math.round(ca.width*ba);ca=Math.round(ca.height*ba);L.setSelectionCell(L.insertVertex(null,null,"",L.snap(g),L.snap(m),oa,
ca,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+c+";"))}}),mxUtils.bind(this,function(){var ca=null;L.getModel().beginUpdate();try{ca=L.insertVertex(L.getDefaultParent(),null,c,L.snap(g),L.snap(m),1,1,"text;"+(n?"html=1;":"")),L.updateCellSize(ca),L.fireEvent(new mxEventObject("textInserted","cells",[ca]))}finally{L.getModel().endUpdate()}L.setSelectionCell(ca)}))}else{c=Graph.zapGremlins(mxUtils.trim(c));if(this.isCompatibleString(c))return this.importXml(c,
g,m,F,null,M);if(0<c.length)if(this.isLucidChartData(c))this.convertLucidChart(c,mxUtils.bind(this,function(ca){this.editor.graph.setSelectionCells(this.importXml(ca,g,m,F,null,M))}),mxUtils.bind(this,function(ca){this.handleError(ca)}));else{L=this.editor.graph;x=null;L.getModel().beginUpdate();try{x=L.insertVertex(L.getDefaultParent(),null,"",L.snap(g),L.snap(m),1,1,"text;whiteSpace=wrap;"+(n?"html=1;":""));L.fireEvent(new mxEventObject("textInserted","cells",[x]));n&&(c=L.sanitizeHtml(c));c.length>
this.maxTextBytes&&(c=c.substring(0,this.maxTextBytes)+"...");x.value=c;L.updateCellSize(x);if(0<this.maxTextWidth&&x.geometry.width>this.maxTextWidth){var ja=L.getPreferredSizeForCell(x,this.maxTextWidth);x.geometry.width=ja.width;x.geometry.height=ja.height}Graph.isLink(x.value)&&L.setLinkForCell(x,x.value);x.geometry.width+=L.gridSize;x.geometry.height+=L.gridSize}finally{L.getModel().endUpdate()}return[x]}}return[]};EditorUi.prototype.formatFileSize=function(c){var g=-1;do c/=1024,g++;while(1024<
c);return Math.max(c,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[g]};EditorUi.prototype.convertDataUri=function(c){if("data:"==c.substring(0,5)){var g=c.indexOf(";");0<g&&(c=c.substring(0,g)+c.substring(c.indexOf(",",g+1)))}return c};EditorUi.prototype.isRemoteFileFormat=function(c,g){return/("contentType":\s*"application\/gliffy\+json")/.test(c)};EditorUi.prototype.isLucidChartData=function(c){return null!=c&&('{"state":"{\\"Properties\\":'==c.substring(0,26)||'{"Properties":'==c.substring(0,
14))};EditorUi.prototype.importLocalFile=function(c,g){if(c&&Graph.fileSupport){if(null==this.importFileInputElt){var m=document.createElement("input");m.setAttribute("type","file");mxEvent.addListener(m,"change",mxUtils.bind(this,function(){null!=m.files&&(this.importFiles(m.files,null,null,this.maxImageSize),m.type="",m.type="file",m.value="")}));m.style.display="none";document.body.appendChild(m);this.importFileInputElt=m}this.importFileInputElt.click()}else{window.openNew=!1;window.openKey="import";
window.listBrowserFiles=mxUtils.bind(this,function(I,M){StorageFile.listFiles(this,"F",I,M)});window.openBrowserFile=mxUtils.bind(this,function(I,M,L){StorageFile.getFileContent(this,I,M,L)});window.deleteBrowserFile=mxUtils.bind(this,function(I,M,L){StorageFile.deleteFile(this,I,M,L)});if(!g){var n=Editor.useLocalStorage;Editor.useLocalStorage=!c}window.openFile=new OpenFile(mxUtils.bind(this,function(I){this.hideDialog(I)}));window.openFile.setConsumer(mxUtils.bind(this,function(I,M){null!=M&&Graph.fileSupport&&
/(\.v(dx|sdx?))($|\?)/i.test(M)?(I=new Blob([I],{type:"application/octet-stream"}),this.importVisio(I,mxUtils.bind(this,function(L){this.importXml(L,0,0,!0)}),null,M)):this.editor.graph.setSelectionCells(this.importXml(I,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:360,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null});if(!g){var x=this.dialog,F=x.close;this.dialog.close=mxUtils.bind(this,function(I){Editor.useLocalStorage=n;F.apply(x,
arguments);I&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(c,g,m){var n=this,x=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(c).then(function(F){if(mxUtils.isEmptyObject(F.files))m();else{var I=0,M,L=!1;F.forEach(function(K,aa){K=aa.name.toLowerCase();"diagram/diagram.xml"==K?(L=!0,aa.async("string").then(function(ja){0==ja.indexOf("<mxfile ")?g(ja):m()})):0==K.indexOf("versions/")&&
(K=parseInt(K.substr(9)),K>I&&(I=K,M=aa))});0<I?M.async("string").then(function(K){(new XMLHttpRequest).upload&&n.isRemoteFileFormat(K,c.name)?n.isOffline()?n.showError(mxResources.get("error"),mxResources.get("notInOffline"),null,m):n.parseFileData(K,mxUtils.bind(this,function(aa){4==aa.readyState&&(200<=aa.status&&299>=aa.status?g(aa.responseText):m())}),c.name):m()}):L||m()}},function(F){m(F)}):m()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?x():(this.loadingExtensions=
!0,mxscript(window.DRAWIO_SERVER_URL+"js/extensions.min.js",x,null,null,null,m))};EditorUi.prototype.importFile=function(c,g,m,n,x,F,I,M,L,K,aa,ja){K=null!=K?K:!0;var ca=!1,ba=null,oa=mxUtils.bind(this,function(Y){var da=null;null!=Y&&"<mxlibrary"==Y.substring(0,10)?(this.loadLibrary(new LocalLibrary(this,Y,I)),this.showSidebar()):da=this.importXml(Y,m,n,K,null,null!=ja?mxEvent.isControlDown(ja):null);null!=M&&M(da)});"image"==g.substring(0,5)?(L=!1,"image/png"==g.substring(0,9)&&(aa=aa?null:this.extractGraphModelFromPng(c),
null!=aa&&0<aa.length&&(ba=this.importXml(aa,m,n,K,null,null!=ja?mxEvent.isControlDown(ja):null),L=!0)),L||(L=this.editor.graph,aa=c.indexOf(";"),0<aa&&(c=c.substring(0,aa)+c.substring(c.indexOf(",",aa+1))),K&&L.isGridEnabled()&&(m=L.snap(m),n=L.snap(n)),aa="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;","image/svg"==g.substring(0,9)&&(aa+="editableCssRules=.*;"),ba=[L.insertVertex(null,null,"",m,n,x,F,aa+"image="+c+";")])):/(\.*<graphml )/.test(c)?
(ca=!0,this.importGraphML(c,oa)):null!=L&&null!=I&&EditorUi.isVisioFilename(I)?(ca=!0,this.importVisio(L,oa)):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,I)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(ca=!0,g=mxUtils.bind(this,function(Y){4==Y.readyState&&(200<=Y.status&&299>=Y.status?oa(Y.responseText):null!=M&&(M(null),this.showError(mxResources.get("error"),413==Y.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))))}),
null!=c?this.parseFileData(c,g,I):this.parseFile(L,g,I)):0==c.indexOf("PK")&&null!=L?(ca=!0,this.importZipFile(L,oa,mxUtils.bind(this,function(){ba=this.insertTextAt(this.validateFileData(c),m,n,!0,null,K);M(ba)}))):/(\.v(sd|dx))($|\?)/i.test(I)||/(\.vs(s|x))($|\?)/i.test(I)||(ba=this.insertTextAt(this.validateFileData(c),m,n,!0,null,K,null,null!=ja?mxEvent.isControlDown(ja):null));ca||null==M||M(ba);return ba};EditorUi.prototype.importFiles=function(c,g,m,n,x,F,I,M,L,K,aa,ja,ca){n=null!=n?n:this.maxImageSize;
K=null!=K?K:this.maxImageBytes;var ba=null!=g&&null!=m,oa=!0;g=null!=g?g:0;m=null!=m?m:0;var Y=!1;if(!mxClient.IS_CHROMEAPP&&null!=c)for(var da=aa||this.resampleThreshold,ha=0;ha<c.length;ha++)if("image/svg"!==c[ha].type.substring(0,9)&&"image/"===c[ha].type.substring(0,6)&&c[ha].size>da){Y=!0;break}EditorUi.debug("EditorUi.importFiles",[this],"files",[c],"x",[g],"y",[m],"maxSize",[n],"maxBytes",[K],"resampleThreshold",[this.resampleThreshold],"largeImages",[Y],"crop",[ba],"resizeImages",[oa],"ignoreEmbeddedXml",
[ja],"evt",[ca]);var Z=mxUtils.bind(this,function(){var k=this.editor.graph,v=k.gridSize;x=null!=x?x:mxUtils.bind(this,function(X,fa,na,la,qa,ya,wa,Ja,Aa){try{if(null!=X&&"<mxlibrary"==X.substring(0,10))return this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,X,wa)),this.showSidebar(),null;this.isCompatibleString(X)&&1==c.length&&null!=ca&&"drop"==ca.type&&this.isBlankFile()&&!this.canUndo()&&(ba=!1,la=na=0);return this.importFile(X,fa,na,la,qa,ya,wa,Ja,Aa,ba,ja,ca)}catch(Ba){return this.handleError(Ba),
null}});F=null!=F?F:mxUtils.bind(this,function(X){k.setSelectionCells(X)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var J=c.length,N=J,T=[],V=mxUtils.bind(this,function(X,fa){T[X]=fa;if(0==--N){this.spinner.stop();if(null!=M)M(T);else{var na=[];k.getModel().beginUpdate();try{for(X=0;X<T.length;X++){var la=T[X]();null!=la&&(na=na.concat(la))}}finally{k.getModel().endUpdate()}}F(na)}}),U=0;U<J;U++)mxUtils.bind(this,function(X){var fa=c[X];if(null!=fa){var na=new FileReader;
na.onload=mxUtils.bind(this,function(la){if(null==I||I(fa))try{if("image/"==fa.type.substring(0,6))if("image/svg"==fa.type.substring(0,9)){var qa=Graph.clipSvgDataUri(la.target.result),ya=qa.indexOf(","),wa=decodeURIComponent(escape(atob(qa.substring(ya+1)))),Ja=mxUtils.parseXml(wa),Aa=Ja.getElementsByTagName("svg");if(0<Aa.length){var Ba=Aa[0],Ga=ja?null:Ba.getAttribute("content");null!=Ga&&"<"!=Ga.charAt(0)&&"%"!=Ga.charAt(0)&&(Ga=unescape(window.atob?atob(Ga):Base64.decode(Ga,!0)));null!=Ga&&"%"==
Ga.charAt(0)&&(Ga=decodeURIComponent(Ga));null==Ga||"<mxfile "!==Ga.substring(0,8)&&"<mxGraphModel>"!==Ga.substring(0,14)&&"<mxGraphModel "!==Ga.substring(0,14)?V(X,mxUtils.bind(this,function(){try{if(null!=Ja){var Ca=Ja.getElementsByTagName("svg");if(0<Ca.length){var Da=Ca[0],va=Da.getAttribute("width"),Na=Da.getAttribute("height");va=null!=va&&"%"!=va.charAt(va.length-1)?parseFloat(va):NaN;Na=null!=Na&&"%"!=Na.charAt(Na.length-1)?parseFloat(Na):NaN;var Oa=Da.getAttribute("viewBox");if(null==Oa||
0==Oa.length)Da.setAttribute("viewBox","0 0 "+va+" "+Na);else if(isNaN(va)||isNaN(Na)){var Qa=Oa.split(" ");3<Qa.length&&(va=parseFloat(Qa[2]),Na=parseFloat(Qa[3]))}qa=Editor.createSvgDataUri(mxUtils.getXml(Da));var Ra=Math.min(1,Math.min(n/Math.max(1,va)),n/Math.max(1,Na)),za=x(qa,fa.type,g+X*v,m+X*v,Math.max(1,Math.round(va*Ra)),Math.max(1,Math.round(Na*Ra)),fa.name);if(null!=za&&(isNaN(va)||isNaN(Na))){var Ea=new Image;Ea.onload=mxUtils.bind(this,function(){va=Math.max(1,Ea.width);Na=Math.max(1,
Ea.height);za[0].geometry.width=va;za[0].geometry.height=Na;Da.setAttribute("viewBox","0 0 "+va+" "+Na);qa=Editor.createSvgDataUri(mxUtils.getXml(Da));var C=qa.indexOf(";");0<C&&(qa=qa.substring(0,C)+qa.substring(qa.indexOf(",",C+1)));k.setCellStyles("image",qa,[za[0]])});Ea.src=Editor.createSvgDataUri(mxUtils.getXml(Da))}return za}}}catch(C){}return null})):V(X,mxUtils.bind(this,function(){return x(Ga,"text/xml",g+X*v,m+X*v,0,0,fa.name)}))}else V(X,mxUtils.bind(this,function(){return null}))}else{ya=
!1;if("image/png"==fa.type){var Ma=ja?null:this.extractGraphModelFromPng(la.target.result);if(null!=Ma&&0<Ma.length){var ra=new Image;ra.src=la.target.result;V(X,mxUtils.bind(this,function(){return x(Ma,"text/xml",g+X*v,m+X*v,ra.width,ra.height,fa.name)}));ya=!0}}ya||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):
this.loadImage(la.target.result,mxUtils.bind(this,function(Ca){this.resizeImage(Ca,la.target.result,mxUtils.bind(this,function(Da,va,Na){V(X,mxUtils.bind(this,function(){if(null!=Da&&Da.length<K){var Oa=oa&&this.isResampleImageSize(fa.size,aa)?Math.min(1,Math.min(n/va,n/Na)):1;return x(Da,fa.type,g+X*v,m+X*v,Math.round(va*Oa),Math.round(Na*Oa),fa.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),oa,n,aa,fa.size)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else qa=
la.target.result,x(qa,fa.type,g+X*v,m+X*v,240,160,fa.name,function(Ca){V(X,function(){return Ca})},fa)}catch(Ca){V(X,mxUtils.bind(this,function(){return null})),null!=window.console&&console.error(Ca,fa)}else V(X,mxUtils.bind(this,function(){return null}))});EditorUi.isVisioFilename(fa.name)?x(null,fa.type,g+X*v,m+X*v,240,160,fa.name,function(la){V(X,function(){return la})},fa):"image"==fa.type.substring(0,5)||"application/pdf"==fa.type?na.readAsDataURL(fa):na.readAsText(fa)}})(U)});if(Y){Y=[];for(ha=
0;ha<c.length;ha++)Y.push(c[ha]);c=Y;this.confirmImageResize(function(k){oa=k;Z()},L)}else Z()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=function(c,g){g=null!=g?g:!1;var m=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},n=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,
x=function(F,I){if(F||g)mxSettings.setResizeImages(F?I:null),mxSettings.save();m();c(I)};null==n||g?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(F){x(F,!0)},function(F){x(F,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?226:200,!0,!0):
x(!1,n)};EditorUi.prototype.parseFile=function(c,g,m){m=null!=m?m:c.name;var n=new FileReader;n.onload=mxUtils.bind(this,function(){this.parseFileData(n.result,g,m)});n.readAsText(c)};EditorUi.prototype.parseFileData=function(c,g,m){var n=new XMLHttpRequest;n.open("POST",OPEN_URL);n.setRequestHeader("Content-Type","application/x-www-form-urlencoded");n.onreadystatechange=function(){g(n)};n.send("format=xml&filename="+encodeURIComponent(m)+"&data="+encodeURIComponent(c));try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",
action:"size_"+file.size})}catch(x){}};EditorUi.prototype.isResampleImageSize=function(c,g){g=null!=g?g:this.resampleThreshold;return c>g};EditorUi.prototype.resizeImage=function(c,g,m,n,x,F,I){x=null!=x?x:this.maxImageSize;var M=Math.max(1,c.width),L=Math.max(1,c.height),K=g;if(n&&this.isResampleImageSize(null!=I?I:g.length,F))try{var aa=Math.max(M/x,L/x);if(1<aa){var ja=Math.round(M/aa),ca=Math.round(L/aa),ba=document.createElement("canvas");ba.width=ja;ba.height=ca;ba.getContext("2d").drawImage(c,
0,0,ja,ca);var oa=ba.toDataURL();if(oa.length<g.length){var Y=document.createElement("canvas");Y.width=ja;Y.height=ca;var da=Y.toDataURL();oa!==da&&(g=oa,M=ja,L=ca)}}}catch(ha){}n&&K!=g&&x>this.maxImageSize/2&&g.length>this.maxImageBytes?this.resizeImage(c,g,m,n,x/1.5,F,I):m(g,M,L)};EditorUi.prototype.extractGraphModelFromPng=function(c){return Editor.extractGraphModelFromPng(c)};EditorUi.prototype.loadImage=function(c,g,m){try{var n=new Image;n.onload=function(){n.width=0<n.width?n.width:120;n.height=
0<n.height?n.height:120;g(n)};null!=m&&(n.onerror=m);n.src=c}catch(x){if(null!=m)m(x);else throw x;}};EditorUi.prototype.getDefaultSketchMode=function(){var c="1"==urlParams.sketch;return"0"!=(null!=urlParams.rough?urlParams.rough:c)};var y=EditorUi.prototype.createUi;EditorUi.prototype.createUi=function(){Editor.isSettingsEnabled()&&(null!=mxSettings.settings.sidebarTitles&&(Sidebar.prototype.sidebarTitles=mxSettings.settings.sidebarTitles),this.formatWidth=mxSettings.getFormatWidth());y.apply(this,
arguments);Editor.isSettingsEnabled()&&this.doSetSketchMode(null!=mxSettings.settings.sketchMode&&null==urlParams.rough&&null==urlParams.sketch?mxSettings.settings.sketchMode:this.getDefaultSketchMode())};var q=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();var c=this,g=this.editor.graph,m=g.isEnabled;g.isEnabled=function(){return m.apply(this,arguments)&&!c.isLocked()};Graph.touchStyle&&(g.panningHandler.isPanningTrigger=
function(v){var J=v.getEvent();return null==v.getState()&&!mxEvent.isMouseEvent(J)&&!g.freehand.isDrawing()||mxEvent.isPopupTrigger(J)&&(null==v.getState()||mxEvent.isControlDown(J)||mxEvent.isShiftDown(J))});g.cellEditor.editPlantUmlData=function(v,J,N){var T=JSON.parse(N);J=new SimpleTextareaDialog(c,T.data,function(V){null!=V&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generatePlantUmlImage(V,T.format,function(U,X,fa){c.spinner.stop();g.getModel().beginUpdate();try{if("txt"==
T.format)g.labelChanged(v,"<pre>"+U+"</pre>"),g.updateCellSize(v,!0);else{g.setCellStyles("image",c.convertDataUri(U),[v]);var na=g.model.getGeometry(v);null!=na&&(na=na.clone(),na.width=X,na.height=fa,g.cellsResized([v],[na],!1))}g.setAttributeForCell(v,"plantUmlData",JSON.stringify({data:V,format:T.format}))}finally{g.getModel().endUpdate()}},function(U){c.handleError(U)})});c.showDialog(J.container,640,420,!0,!0,null,null,null,new mxRectangle(0,0,320,280));J.init()};g.cellEditor.editMermaidData=
function(v,J,N){var T=JSON.parse(N);J=new SimpleTextareaDialog(c,T.data,function(V){null!=V&&c.spinner.spin(document.body,mxResources.get("inserting"))&&c.generateMermaidImage(V,T.config,function(U,X,fa){c.spinner.stop();g.getModel().beginUpdate();try{g.setCellStyles("image",U,[v]);var na=g.model.getGeometry(v);null!=na&&(na=na.clone(),na.width=Math.max(na.width,X),na.height=Math.max(na.height,fa),g.cellsResized([v],[na],!1));g.setAttributeForCell(v,"mermaidData",JSON.stringify({data:V,config:T.config},
null,2))}finally{g.getModel().endUpdate()}},function(U){c.handleError(U)})});c.showDialog(J.container,640,420,!0,!0,null,null,null,new mxRectangle(0,0,320,280));J.init()};var n=g.cellEditor.startEditing;g.cellEditor.startEditing=function(v,J){try{var N=this.graph.getAttributeForCell(v,"plantUmlData");if(null!=N)this.editPlantUmlData(v,J,N);else if(N=this.graph.getAttributeForCell(v,"mermaidData"),null!=N&&window.isMermaidEnabled)this.editMermaidData(v,J,N);else{var T=g.getCellStyle(v);"1"==mxUtils.getValue(T,
"metaEdit","0")?c.showDataDialog(v):n.apply(this,arguments)}}catch(V){c.handleError(V)}};g.getLinkTitle=function(v){return c.getLinkTitle(v)};g.customLinkClicked=function(v,J){var N=!1;try{var T=this.getGraphBounds();c.handleCustomLink(v,J);N=!0;c.chromelessResize&&!T.equals(this.getGraphBounds())&&(c.chromelessResize(),this.scrollCellToVisible(J))}catch(V){c.handleError(V)}return N};var x=g.parseBackgroundImage;g.parseBackgroundImage=function(v){var J=x.apply(this,arguments);null!=J&&null!=J.src&&
Graph.isPageLink(J.src)&&(J={originalSrc:J.src});return J};var F=g.setBackgroundImage;g.setBackgroundImage=function(v){null!=v&&null!=v.originalSrc&&(v=c.createImageForPageLink(v.originalSrc,c.currentPage,this));F.apply(this,arguments)};this.editor.addListener("pageRenamed",mxUtils.bind(this,function(){g.refreshBackgroundImage()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(){g.refreshBackgroundImage()}));this.editor.addListener("pagesPatched",mxUtils.bind(this,function(v,J){v=
null!=g.backgroundImage?g.backgroundImage.originalSrc:null;if(null!=v){var N=v.indexOf(",");if(0<N)for(v=v.substring(N+1),J=J.getProperty("patches"),N=0;N<J.length;N++)if(null!=J[N][EditorUi.DIFF_UPDATE]&&null!=J[N][EditorUi.DIFF_UPDATE][v]||null!=J[N][EditorUi.DIFF_REMOVE]&&0<=mxUtils.indexOf(J[N][EditorUi.DIFF_REMOVE],v)){g.refreshBackgroundImage();break}}}));var I=g.getBackgroundImageObject;g.getBackgroundImageObject=function(v,J){var N=I.apply(this,arguments);null!=N&&null!=N.originalSrc&&(N=
J?c.createImageForPageLink(N.originalSrc,null,null,!0):{src:N.originalSrc});return N};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.drawio.com/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var M=c.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(v){v=null!=v?v:"";"1"==
urlParams.dev&&(v+=(0<v.length?"&":"?")+"dev=1");return M.apply(this,arguments)};var L=g.addClickHandler;g.addClickHandler=function(v,J,N){var T=J;J=function(V,U,X){if(null==U){var fa=mxEvent.getSource(V);"a"==fa.nodeName.toLowerCase()&&(U=fa.getAttribute("href"))}null!=U&&g.isCustomLink(U)&&(mxEvent.isTouchEvent(V)||!mxEvent.isPopupTrigger(V))&&g.customLinkClicked(U,X)&&mxEvent.consume(V);null!=T&&T(V,U,X)};L.call(this,v,J,N)};q.apply(this,arguments);this.editor.graph.addSvgShadow(g.view.canvas.ownerSVGElement,
null,!0);if(null!=this.menus){var K=Menus.prototype.addPopupMenuItems;this.menus.addPopupMenuItems=function(v,J,N){g.isSelectionEmpty()&&"simple"==Editor.currentTheme&&this.addMenuItems(v,["zoomIn","zoomOut","-"],null,N);K.apply(this,arguments);g.isSelectionEmpty()||null==c.addSelectionToScratchpad||this.addMenuItems(v,["-","addToScratchpad"],null,N);g.isSelectionEmpty()&&!this.isShowStyleItems()&&this.addMenuItems(v,["-","exitGroup","home"],null,N)};var aa=Menus.prototype.addPopupMenuEditItems;this.menus.addPopupMenuEditItems=
function(v,J,N){if(c.editor.graph.isSelectionEmpty())aa.apply(this,arguments),c.menus.addMenuItems(v,["copyAsImage","copyAsSvg"],null,N);else if(this.isShowCellEditItems()?this.addPopupDeleteItem(v,J,N):this.addPopupMenuArrangeItems(v,J,N),this.addMenuItems(v,"- cut copy copyAsImage copyAsSvg duplicate -".split(" "),null,N),this.isShowCellEditItems()||this.addPopupDeleteItem(v,J,N),this.addMenuItems(v,["lockUnlock","-"],null,N),!this.isShowStyleItems()){if(1==g.getSelectionCount()&&!g.isCellLocked(J)&&
g.isCellEditable(J)&&(this.addSubmenu("editCell",v,null,mxResources.get("edit")),v.addSeparator(),g.getModel().isEdge(J))){this.addSubmenu("line",v);var T=g.getModel().getGeometry(J);null!=T&&null!=T.points&&0<T.points.length&&this.addMenuItems(v,["clearWaypoints"],null,N)}1==g.getSelectionCount()&&this.addMenuItems(v,["enterGroup"],null,N);T=c.getSelectionState();null!=T.mergeCell?this.addMenuItem(v,"mergeCells"):(1<T.style.colspan||1<T.style.rowspan)&&this.addMenuItem(v,"unmergeCells")}};this.menus.isShowStyleItems=
function(){return"simple"!=Editor.currentTheme&&"sketch"!=Editor.currentTheme&&"min"!=Editor.currentTheme};this.menus.isShowHistoryItems=function(){return"simple"!=Editor.currentTheme};this.menus.isShowArrangeItems=this.menus.isShowStyleItems;this.menus.isShowCellEditItems=this.menus.isShowStyleItems}this.dependsOnLanguage(mxUtils.bind(this,function(){this.defaultFilename=mxResources.get("untitledDiagram");this.defaultLibraryName=mxResources.get("untitledLibrary")}));var ja=g.getExportVariables;g.getExportVariables=
function(){var v=ja.apply(this,arguments),J=c.getCurrentFile();null!=J&&(v.filename=J.getTitle());v.pagecount=null!=c.pages?c.pages.length:1;v.page=null!=c.currentPage?c.currentPage.getName():"";v.pagenumber=null!=c.pages&&null!=c.currentPage?mxUtils.indexOf(c.pages,c.currentPage)+1:1;return v};var ca=g.getGlobalVariable;g.getGlobalVariable=function(v){var J=c.getCurrentFile();return"filename"==v&&null!=J?J.getTitle():"page"==v&&null!=c.currentPage?c.currentPage.getName():"pagenumber"==v?null!=c.currentPage&&
null!=c.pages?mxUtils.indexOf(c.pages,c.currentPage)+1:1:"pagecount"==v?null!=c.pages?c.pages.length:1:ca.apply(this,arguments)};var ba=null,oa=null;this.addListener("fileDescriptorChanged",mxUtils.bind(this,function(){var v=this.getCurrentFile(),J=null!=v&&null!=v.getTitle()?v.getTitle():this.defaultFilename;ba!=J&&v==oa&&(g.invalidateDescendantsWithPlaceholders(g.model.getRoot()),g.view.validate());ba=J;oa=v}));var Y=g.labelLinkClicked;g.labelLinkClicked=function(v,J,N){var T=J.getAttribute("href");
if(null==T||!g.isCustomLink(T)||!mxEvent.isTouchEvent(N)&&mxEvent.isPopupTrigger(N))Y.apply(this,arguments);else{if(!g.isEnabled()||null!=v&&g.isCellLocked(v.cell))g.customLinkClicked(T),g.getRubberband().reset();mxEvent.consume(N)}};this.editor.getOrCreateFilename=function(){var v=c.defaultFilename,J=c.getCurrentFile();null!=J&&(v=null!=J.getTitle()?J.getTitle():v);return v};var da=this.actions.get("print");da.setEnabled(!mxClient.IS_IOS||!navigator.standalone);da.visible=da.isEnabled();if(!this.editor.chromeless||
this.editor.editable)this.keyHandler.bindAction(70,!0,"findReplace"),this.keyHandler.bindAction(77,!0,"editGeometry",!0),this.keyHandler.bindAction(75,!0,"tags"),this.keyHandler.bindAction(65,!1,"insertText"),this.keyHandler.bindAction(83,!1,"insertNote"),this.keyHandler.bindAction(68,!1,"insertRectangle"),this.keyHandler.bindAction(70,!1,"insertEllipse"),this.keyHandler.bindAction(76,!1,"insertLink"),this.keyHandler.bindAction(82,!1,"insertRhombus"),this.keyHandler.bindAction(67,!1,"insertEdge"),
this.keyHandler.bindAction(88,!1,"insertFreehand"),this.keyHandler.bindAction(75,!0,"toggleShapes",!0),this.keyHandler.bindAction(54,!0,"adaptiveColors",!0),this.altShiftActions[81]="copyStyle",this.altShiftActions[87]="pasteStyle",this.altShiftActions[83]="synchronize","1"==urlParams.embedInline&&(document.body.classList.add("geEmbedInline"),g.addListener(mxEvent.ESCAPE,function(v,J){null!=J&&g.isEnabled()&&!g.isEditing()&&null!=J.getProperty("event")&&c.actions.get("exit").funct()})),this.installImagePasteHandler(),
this.installNativeClipboardHandler();this.spinner=null!=this.spinner?this.spinner:this.createSpinner(null,null,24);Graph.fileSupport&&g.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(v){var J=g.cellEditor.text2,N=null;null!=J&&(mxEvent.addListener(J,"dragleave",function(T){null!=N&&(N.parentNode.removeChild(N),N=null);T.stopPropagation();T.preventDefault()}),mxEvent.addListener(J,"dragover",mxUtils.bind(this,function(T){null==N&&(N=this.highlightElement(J));T.stopPropagation();T.preventDefault()})),
mxEvent.addListener(J,"drop",mxUtils.bind(this,function(T){null!=N&&(N.parentNode.removeChild(N),N=null);if(0<T.dataTransfer.files.length)this.importFiles(T.dataTransfer.files,0,0,this.maxImageSize,function(U,X,fa,na,la,qa){g.insertImage(U,la,qa)},function(){},function(U){return"image/"==U.type.substring(0,6)},function(U){for(var X=0;X<U.length;X++)U[X]()},mxEvent.isControlDown(T));else if(0<=mxUtils.indexOf(T.dataTransfer.types,"text/uri-list")){var V=T.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(V)?
this.loadImage(decodeURIComponent(V),mxUtils.bind(this,function(U){var X=Math.max(1,U.width);U=Math.max(1,U.height);var fa=this.maxImageSize;fa=Math.min(1,Math.min(fa/Math.max(1,X)),fa/Math.max(1,U));g.insertImage(decodeURIComponent(V),X*fa,U*fa)})):document.execCommand("insertHTML",!1,T.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(T.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,T.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(T.dataTransfer.types,"text/plain")&&
document.execCommand("insertHTML",!1,T.dataTransfer.getData("text/plain"));T.stopPropagation();T.preventDefault()})))}));if(Editor.isSettingsEnabled()){da=this.editor.graph.view;var ha=mxSettings.getUnit();da.setUnit(ha);Editor.pageSizeUnit=ha==mxConstants.METERS?mxConstants.MILLIMETERS:ha;da.addListener("unitChanged",function(v,J){v=J.getProperty("unit");mxSettings.setUnit(v);mxSettings.save();Editor.pageSizeUnit=v==mxConstants.METERS?mxConstants.MILLIMETERS:v});this.ruler=!Editor.canvasSupported||
9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,da.unit);this.refresh()}if("1"==urlParams.styledev){da=document.getElementById("geFooter");null!=da&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility=
"hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),da.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(v,J){0<this.editor.graph.getSelectionCount()?(v=this.editor.graph.getSelectionCell(),v=this.editor.graph.getModel().getStyle(v),this.styleInput.value=v||"",this.styleInput.style.visibility=
"visible"):this.styleInput.style.visibility="hidden"})));var Z=this.isSelectionAllowed;this.isSelectionAllowed=function(v){return mxEvent.getSource(v)==this.styleInput?!0:Z.apply(this,arguments)}}da=document.getElementById("geInfo");null!=da&&da.parentNode.removeChild(da);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var k=null;mxEvent.addListener(g.container,"dragleave",function(v){g.isEnabled()&&(null!=k&&(k.parentNode.removeChild(k),k=null),v.stopPropagation(),v.preventDefault())});
mxEvent.addListener(g.container,"dragover",mxUtils.bind(this,function(v){null==k&&(k=this.highlightElement(g.container));null!=this.sidebar&&this.sidebar.hideTooltip();v.stopPropagation();v.preventDefault()}));mxEvent.addListener(g.container,"drop",mxUtils.bind(this,function(v){null!=k&&(k.parentNode.removeChild(k),k=null);if(g.isEnabled()){var J=mxUtils.convertPoint(g.container,mxEvent.getClientX(v),mxEvent.getClientY(v)),N=v.dataTransfer.files,T=g.view.translate,V=g.view.scale,U=J.x/V-T.x,X=J.y/
V-T.y;if(0<N.length)"1"!=urlParams.embed&&mxEvent.isShiftDown(v)?(this.isBlankFile()&&!this.canUndo()&&null!=this.getCurrentFile()&&this.fileLoaded(null),this.openFiles(N,!0)):(mxEvent.isAltDown(v)&&(X=U=null),this.importFiles(N,U,X,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(v),null,null,mxEvent.isShiftDown(v),v));else{mxEvent.isAltDown(v)&&(X=U=0);var fa=0<=mxUtils.indexOf(v.dataTransfer.types,"text/uri-list")?v.dataTransfer.getData("text/uri-list"):null;J=this.extractGraphModelFromEvent(v,
null!=this.pages);if(null!=J)g.setSelectionCells(this.importXml(J,U,X,!0));else if(0<=mxUtils.indexOf(v.dataTransfer.types,"text/html")){var na=v.dataTransfer.getData("text/html");J=document.createElement("div");J.innerHTML=Graph.sanitizeHtml(na);var la=null;N=J.getElementsByTagName("img");null!=N&&1==N.length?(na=N[0].getAttribute("src"),null==na&&(na=N[0].getAttribute("srcset")),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(na)||(la=!0)):(N=J.getElementsByTagName("a"),null!=N&&1==N.length?na=N[0].getAttribute("href"):
(J=J.getElementsByTagName("pre"),null!=J&&1==J.length&&(na=mxUtils.getTextContent(J[0]))));var qa=!0,ya=mxUtils.bind(this,function(){g.setSelectionCells(this.insertTextAt(na,U,X,!0,la,null,qa,mxEvent.isControlDown(v)))});la&&null!=na&&na.length>this.resampleThreshold?this.confirmImageResize(function(wa){qa=wa;ya()},mxEvent.isControlDown(v)):ya()}else null!=fa&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(fa)?this.loadImage(decodeURIComponent(fa),mxUtils.bind(this,function(wa){var Ja=Math.max(1,wa.width);
wa=Math.max(1,wa.height);var Aa=this.maxImageSize;Aa=Math.min(1,Math.min(Aa/Math.max(1,Ja)),Aa/Math.max(1,wa));g.setSelectionCell(g.insertVertex(null,null,"",U,X,Ja*Aa,wa*Aa,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image="+fa+";"))}),mxUtils.bind(this,function(wa){g.setSelectionCells(this.insertTextAt(fa,U,X,!0))})):0<=mxUtils.indexOf(v.dataTransfer.types,"text/plain")&&g.setSelectionCells(this.insertTextAt(v.dataTransfer.getData("text/plain"),
U,X,!0))}}v.stopPropagation();v.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.addListener("currentThemeChanged",mxUtils.bind(this,function(){null!=this.sidebar&&this.sidebar.updateEntries();this.updateButtonContainer();this.updateDocumentTitle();this.refresh(!0)}));this.addListener("realtimeStateChanged",mxUtils.bind(this,function(){this.updateButtonContainer()}));this.addListener("darkModeChanged",function(){mxClient.IS_SF&&g.view.validateBackground()});
g.addListener("enabledChanged",mxUtils.bind(this,function(){g.isEnabled()||this.hideShapePicker();this.refresh()}));c=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==c.embedViewport)mxUtils.fit(this.div);else{var v=parseInt(this.div.offsetLeft),J=parseInt(this.div.offsetWidth),N=c.embedViewport.x+c.embedViewport.width,T=parseInt(this.div.offsetTop),V=parseInt(this.div.offsetHeight),U=c.embedViewport.y+c.embedViewport.height;this.div.style.left=Math.max(c.embedViewport.x,Math.min(v,
N-J))+"px";this.div.style.top=Math.max(c.embedViewport.y,Math.min(T,U-V))+"px";this.div.style.height=Math.min(c.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(c.embedViewport.width,parseInt(this.div.style.width))+"px"}};if(!this.editor.chromeless||this.editor.editable)if(da=Editor.currentTheme,"simple"==da||"sketch"==da)this.doSetCurrentTheme(da,!0),"1"==urlParams.embedInline?this.initializeInlineEmbedMode():(window.innerWidth||document.documentElement.clientWidth||
document.body.clientWidth)<Editor.smallScreenWidth&&this.toggleFormatPanel(!1),this.fireEvent(new mxEventObject("themeInitialized"));da=!1;if(null!=urlParams.dark)da=urlParams.dark;else if(!this.editor.chromeless||this.editor.editable)da="dark"==Editor.currentTheme,!Editor.isSettingsEnabled()||"1"==urlParams.embed||da&&"auto"!=mxSettings.settings.darkMode||(da=mxSettings.settings.darkMode);"auto"==da&&this.isAutoDarkModeSupported()&&(da=window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode("string"===
typeof da?"1"==da:da);if(this.isAutoDarkModeSupported())try{window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(v){this.isAutoDarkMode()&&this.setDarkMode(v.matches)}))}catch(v){this.actions.get("autoMode").setEnabled(!1)}"1"==urlParams["high-contrast"]?this.setHighContrast(!0):Editor.isSettingsEnabled()&&!this.editor.graph.isLightboxView()&&null!=mxSettings.settings.highContrast&&this.setHighContrast(mxSettings.settings.highContrast);Editor.isSettingsEnabled()&&
(null!=mxSettings.settings.pages&&this.setTabContainerVisible(mxSettings.settings.pages),null!=mxSettings.settings.compactMode&&this.isDefaultTheme(Editor.currentTheme)&&this.setCompactMode(mxSettings.settings.compactMode));this.installSettings();this.addListener("enableAnimationsChanged",mxUtils.bind(this,function(v,J){g.enableFlowAnimation=Editor.enableAnimations;g.refresh()}));g.enableFlowAnimation=Editor.enableAnimations;screen.width<=Editor.smallScreenWidth&&(this.formatWidth=0);"1"==urlParams.prefetchFonts&&
c.editor.loadFonts();"atlas"==Editor.currentTheme&&document.body.classList.add("geAtlas")};var B=EditorUi.prototype.windowResized;EditorUi.prototype.windowResized=function(){if("simple"==Editor.currentTheme){var c=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,g=Editor.smallScreenWidth;null!=this.lastWindowWidth&&this.lastWindowWidth>=g&&c<g?this.isFormatPanelVisible()&&this.toggleFormatPanel(!1):null!=this.lastWindowWidth&&this.lastWindowWidth<g&&c>=g&&(this.isFormatPanelVisible()||
this.toggleFormatPanel(!0));this.lastWindowWidth=c}B.apply(this,arguments)};EditorUi.prototype.initializeInlineEmbedMode=function(){var c=this.sketchFooterMenuElt,g=this.sketchMainMenuElt,m=this.sketchPickerMenuElt,n=this.editor.graph;m.style.transform="";mxEvent.addGestureListeners(this.diagramContainer.parentNode,mxUtils.bind(this,function(K){mxEvent.getSource(K)==this.diagramContainer.parentNode&&(this.embedExitPoint=new mxPoint(mxEvent.getClientX(K),mxEvent.getClientY(K)),this.sendEmbeddedSvgExport())}));
document.body.style.cursor="text";var x=document.createElement("div");x.style.position="absolute";x.style.width="10px";x.style.height="10px";x.style.borderRadius="5px";x.style.border="1px solid gray";x.style.background="#ffffff";x.style.cursor="row-resize";this.diagramContainer.parentNode.appendChild(x);this.bottomResizer=x;var F=null,I=null,M=null,L=null;mxEvent.addGestureListeners(x,mxUtils.bind(this,function(K){L=parseInt(this.diagramContainer.style.height);I=mxEvent.getClientY(K);n.popupMenuHandler.hideMenu();
mxEvent.consume(K)}));x=x.cloneNode(!1);x.style.cursor="col-resize";this.diagramContainer.parentNode.appendChild(x);this.rightResizer=x;mxEvent.addGestureListeners(x,mxUtils.bind(this,function(K){M=parseInt(this.diagramContainer.style.width);F=mxEvent.getClientX(K);n.popupMenuHandler.hideMenu();mxEvent.consume(K)}));mxEvent.addGestureListeners(document.body,null,mxUtils.bind(this,function(K){var aa=!1;null!=F&&(this.diagramContainer.style.width=Math.max(20,M+mxEvent.getClientX(K)-F)+"px",aa=!0);null!=
I&&(this.diagramContainer.style.height=Math.max(20,L+mxEvent.getClientY(K)-I)+"px",aa=!0);aa&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:this.diagramContainer.getBoundingClientRect()}),"*"),this.inlineSizeChanged(),this.refresh())}),function(K){null==F&&null==I||mxEvent.consume(K);I=F=null});document.body.style.backgroundColor="transparent";this.diagramContainer.style.borderRadius="4px";this.bottomResizer.style.visibility="hidden";
this.rightResizer.style.visibility="hidden";this.sketchMenubarElt.style.display="none";g.style.visibility="hidden";c.style.visibility="hidden";m.style.display="none";this.addListener("editInlineStart",mxUtils.bind(this,function(K){this.inlineSizeChanged();this.fitWindows()}));this.addListener("editInlineStop",mxUtils.bind(this,function(K){this.diagramContainer.style.width="10px";this.diagramContainer.style.height="10px";this.diagramContainer.style.border="";this.bottomResizer.style.visibility="hidden";
this.rightResizer.style.visibility="hidden";g.style.visibility="hidden";c.style.visibility="hidden";m.style.display="none"}));this.windowResized=mxUtils.bind(this,function(){});this.inlineSizeChanged()};EditorUi.prototype.installNativeClipboardHandler=function(){function c(){window.setTimeout(function(){m.innerHTML="&nbsp;";m.focus();document.execCommand("selectAll",!1,null)},0)}var g=this.editor.graph,m=document.createElement("div");m.setAttribute("autocomplete","off");m.setAttribute("autocorrect",
"off");m.setAttribute("autocapitalize","off");m.setAttribute("spellcheck","false");m.style.textRendering="optimizeSpeed";m.style.fontFamily="monospace";m.style.wordBreak="break-all";m.style.background="transparent";m.style.color="transparent";m.style.position="absolute";m.style.whiteSpace="nowrap";m.style.overflow="hidden";m.style.display="block";m.style.fontSize="1";m.style.zIndex="-1";m.style.resize="none";m.style.outline="none";m.style.width="1px";m.style.height="1px";mxUtils.setOpacity(m,0);m.contentEditable=
!0;m.innerHTML="&nbsp;";var n=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(F){var I=mxEvent.getSource(F);null==g.container||!g.isEnabled()||g.isMouseDown||g.isEditing()||null!=this.dialog||"INPUT"==I.nodeName||"TEXTAREA"==I.nodeName||"true"==I.contentEditable||224!=F.keyCode&&(mxClient.IS_MAC||17!=F.keyCode)&&(!mxClient.IS_MAC||91!=F.keyCode&&93!=F.keyCode)||
n||(m.style.left=g.container.scrollLeft+10+"px",m.style.top=g.container.scrollTop+10+"px",F=g.container.scrollLeft,I=g.container.scrollTop,g.container.appendChild(m),n=!0,m.focus(),document.execCommand("selectAll",!1,null),g.container.scrollLeft=F,g.container.scrollTop=I)}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(F){var I=F.keyCode;window.setTimeout(mxUtils.bind(this,function(){!n||224!=I&&17!=I&&91!=I&&93!=I||(n=!1,g.isEditing()||null!=this.dialog||null==g.container||g.container.focus(),
m.parentNode.removeChild(m),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(m,"copy",mxUtils.bind(this,function(F){if(g.isEnabled())try{mxClipboard.copy(g),this.copyCells(m),c()}catch(I){this.handleError(I)}}));mxEvent.addListener(m,"cut",mxUtils.bind(this,function(F){if(g.isEnabled())try{mxClipboard.copy(g),this.copyCells(m,!0),c()}catch(I){this.handleError(I)}}));mxEvent.addListener(m,"paste",mxUtils.bind(this,function(F){if(g.isEnabled()&&!g.isCellLocked(g.getDefaultParent()))try{if(m.innerHTML=
"&nbsp;",m.focus(),null!=F.clipboardData&&(Graph.removePasteFormatting(m.firstChild),this.pasteCells(F,m,!0,!0)),!mxEvent.isConsumed(F)){var I=g.container.scrollLeft,M=g.container.scrollTop;window.setTimeout(mxUtils.bind(this,function(){try{g.container.scrollLeft=I,g.container.scrollTop=M,Graph.removePasteFormatting(m.firstChild),this.pasteCells(F,m,!1,!0)}catch(L){this.handleError(L)}}),0)}}catch(L){this.handleError(L)}}),!0);var x=this.isSelectionAllowed;this.isSelectionAllowed=function(F){return mxEvent.getSource(F)==
m?!0:x.apply(this,arguments)}};EditorUi.prototype.setCurrentTheme=function(c,g){mxSettings.setUi(c);(g=this.doSetCurrentTheme(c)||g)||this.alert(mxResources.get("restartForChangeRequired"))};EditorUi.prototype.isDefaultTheme=function(c){return""==c||"dark"==c||"default"==c||"kennedy"==c||null==c};EditorUi.prototype.doSetCurrentTheme=function(c,g){if(null==c||""==c)c=App.isSimpleThemePreferred()?"simple":"kennedy";var m="simple"==Editor.currentTheme&&this.isDefaultTheme(c)||this.isDefaultTheme(Editor.currentTheme)&&
"simple"==c||c==Editor.currentTheme;if(m||g)g=this.saveScrollState(),this.editor.graph.stopEditing(!1),Editor.currentTheme=c,this.switchTheme(c),this.fireEvent(new mxEventObject("currentThemeChanged")),this.editor.fireEvent(new mxEventObject("statusChanged")),this.restoreScrollState(g);return m};EditorUi.prototype.saveScrollState=function(c){var g=this.editor.graph.view.translate,m=this.diagramContainer.scrollLeft,n=this.diagramContainer.scrollTop;null!=this.embedViewport&&(Editor.inlineFullscreen?
(m-=this.embedViewport.x,n-=this.embedViewport.y):(m+=this.embedViewport.x,n+=this.embedViewport.y));g={x:m,y:n,tx:g.x,ty:g.y};c&&(g.boundingRect=this.diagramContainer.getBoundingClientRect());return g};EditorUi.prototype.restoreScrollState=function(c){var g=this.editor.graph.view.scale,m=this.editor.graph.view.translate;if(null!=c.boundingRect){var n=this.diagramContainer.getBoundingClientRect();c.x-=c.boundingRect.x-n.x;c.y-=c.boundingRect.y-n.y}this.diagramContainer.scrollLeft=c.x+(m.x-c.tx)*g;
this.diagramContainer.scrollTop=c.y+(m.y-c.ty)*g};EditorUi.prototype.installStatusMinimizer=function(c){c=null!=c?c:this.statusContainer.parentNode;var g=!1;mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(){"sketch"==Editor.currentTheme&&""!=this.editor.getStatus()&&(this.statusContainer.style.display="")}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(){"sketch"!=Editor.currentTheme||g||(this.statusContainer.style.display="none")}));var m=mxUtils.bind(this,function(){if("sketch"==
Editor.currentTheme){var n=null!=this.statusContainer.firstChild&&"function"===typeof this.statusContainer.firstChild.getAttribute?this.statusContainer.firstChild:null;g=null!=n&&null!=n.getAttribute("class");if(!g&&null!=n){n=n.getAttribute("title");var x=this.getCurrentFile();x=null!=x?x.savingStatusKey:DrawioFile.prototype.savingStatusKey;n==mxResources.get(x)+"..."&&(this.statusContainer.innerHTML='<div><img title="'+mxUtils.htmlEntities(mxResources.get(x))+'..."src="'+Editor.tailSpin+'"></div>',
g=!0)}this.statusContainer.style.display="none";n=32>=c.clientWidth;c.style.visibility=n&&""==this.editor.getStatus()?"hidden":"";if(n||g)this.statusContainer.style.display="",g=!0}else"simple"==Editor.currentTheme?(this.statusContainer.style.display="",this.statusContainer.style.display=0==this.statusContainer.clientWidth?"none":""):this.statusContainer.style.display=""});this.editor.addListener("statusChanged",m);m()};EditorUi.prototype.switchTheme=function(c){this.destroyWindows(!0);this.updateDefaultStyles();
this.switchThemeConstants(c);this.switchCssForTheme(c);this.createMainMenuForTheme(c);this.createFooterMenuForTheme(c);this.createPickerMenuForTheme(c);this.createMenubarForTheme(c);"sketch"==c&&(this.createFormatWindow(),this.createShapesWindow())};EditorUi.prototype.getWindows=function(){var c=[this.sidebarWindow,this.formatWindow,this.freehandWindow];null!=this.actions&&(c=c.concat([this.actions.outlineWindow,this.actions.layersWindow]));null!=this.menus&&(c=c.concat([this.menus.tagsWindow,this.menus.findWindow,
this.menus.findReplaceWindow,this.menus.commentsWindow]));return c};EditorUi.prototype.fitWindows=function(){for(var c=this.getWindows(),g=0;g<c.length;g++)null!=c[g]&&c[g].window.fit()};EditorUi.prototype.hideWindows=function(){for(var c=this.getWindows(),g=0;g<c.length;g++)null!=c[g]&&c[g].window.setVisible(!1)};EditorUi.prototype.destroyWindows=function(c){null==this.sidebarWindow||c||(this.sidebarWindow.destroy(),this.sidebarWindow=null);null==this.formatWindow||c||(this.formatWindow.destroy(),
this.formatWindow=null);null!=this.freehandWindow&&(this.freehandWindow.destroy(),this.freehandWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.destroy(),this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus&&(null!=this.menus.chatWindow&&(this.menus.chatWindow.destroy(),this.menus.chatWindow=null),null!=this.menus.tagsWindow&&(this.menus.tagsWindow.destroy(),this.menus.tagsWindow=
null),null!=this.menus.findWindow&&(this.menus.findWindow.destroy(),this.menus.findWindow=null),null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.destroy(),this.menus.findReplaceWindow=null),null!=this.menus.commentsWindow&&(this.menus.commentsWindow.destroy(),this.menus.commentsWindow=null))};EditorUi.prototype.switchThemeConstants=function(c){var g=this.editor.graph;g.defaultEdgeLength=Graph.prototype.defaultEdgeLength;g.defaultGridEnabled=Graph.prototype.defaultGridEnabled;g.defaultPageVisible=
Graph.prototype.defaultPageVisible;null!=this.menus&&(this.menus.autoPopup="simple"!=c&&"sketch"!=c);if("simple"==c||"sketch"==c){Editor.fitWindowBorders=new mxRectangle(60,30,30,30);if(null==Editor.config||null==Editor.config.defaultEdgeLength)g.defaultEdgeLength=120;null==urlParams.grid&&(g.defaultGridEnabled=!1);null==urlParams.pv&&(g.defaultPageVisible=!1)}else Editor.fitWindowBorders=null};EditorUi.prototype.isPageMenuVisible=function(){return null!=this.pages&&("0"!=urlParams.pages||1<this.pages.length||
Editor.pagesVisible)};EditorUi.prototype.switchCssForTheme=function(c){};EditorUi.prototype.createMainMenuForTheme=function(c){};EditorUi.prototype.createFooterMenuForTheme=function(c){};EditorUi.prototype.createPickerMenuForTheme=function(c){};EditorUi.prototype.getNetworkStatus=function(){var c=null;if(this.isOffline(!0))c=mxResources.get("offline");else{var g=this.getCurrentFile();null!=g&&(g.invalidChecksum?c=mxResources.get("error")+": "+mxResources.get("checksum"):null==g.sync||g.sync.enabled&&
g.sync.isRealtimeActive()||"atlassian"==this.getServiceName()?null==g.sync||g.sync.isConnected()?g.isRealtimeEnabled()&&g.isRealtimeSupported()&&1<g.getRealtimeState()&&(c=g.getRealtimeError(),c=mxResources.get("realtimeCollaboration")+": "+(null!=c&&null!=c.message?c.message:mxResources.get("error"))):c=mxResources.get("notConnected"):c=mxResources.get("realtimeCollaboration")+": "+mxResources.get("disabled"))}return c};EditorUi.prototype.createMenubarForTheme=function(c){null!=this.statusContainer&&
(this.statusContainer.style.flexGrow="",this.statusContainer.style.flexShrink="",this.statusContainer.style.width="",this.statusContainer.style.marginTop="",this.statusContainer.style.justifyContent="",this.statusContainer.style.opacity="");null!=this.userElement&&this.menubarContainer.appendChild(this.userElement);null!=this.buttonContainer&&null!=this.menubar&&(this.buttonContainer.style.display="",this.menubar.container.appendChild(this.buttonContainer))};EditorUi.prototype.createMenu=function(c,
g,m,n){m=null!=m?m:"geButton";var x=this.menus.get(c);n=this.menubar.addMenu(mxResources.get(c),x.funct,null,n);n.className=m;n.setAttribute("title",mxResources.get(c));this.menus.menuCreated(x,n,m);null!=g&&(n.style.backgroundImage="url("+g+")",n.innerText="");return n};EditorUi.prototype.addButton=function(c,g,m,n){c=this.createToolbarButton(c,g,m);n=null!=n?n:this.container;n.appendChild(c);return c};EditorUi.prototype.createToolbarButton=function(c,g,m){var n=document.createElement("a");n.className=
"geButton";null!=c&&"data:"==c.substring(0,5)&&(n.style.backgroundImage="url("+c+")");null!=g&&n.setAttribute("title",g);null!=m&&mxEvent.addListener(n,"click",function(x){"disabled"!=n.getAttribute("disabled")&&m(x);mxEvent.consume(x)});mxEvent.preventDefault(n);return n};EditorUi.prototype.createMenuItem=function(c,g,m){var n=this.actions.get(c),x=null!=n?n.funct:null,F=this.createToolbarButton(g,mxResources.get(c)+(null!=n&&null!=n.shortcut?" ("+n.shortcut+")":""),x);null==n||m||(c=function(){n.isEnabled()?
F.removeAttribute("disabled"):F.setAttribute("disabled","disabled")},this.editor.graph.addListener("enabledChanged",c),n.addListener("stateChanged",c),c());return F};EditorUi.prototype.createFormatWindow=function(){if(null==this.formatWindow){var c=this,g=Math.max(10,this.diagramContainer.parentNode.clientWidth-256),m="1"==urlParams.embedInline?580:"1"==urlParams.sketch?580:Math.min(566,this.editor.graph.container.clientHeight-10);this.formatWindow=new WrapperWindow(this,mxResources.get("format"),
g,60,240,m,mxUtils.bind(this,function(F){F.appendChild(this.formatContainer)}));this.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.formatWindow.window.fit()}));var n=this.formatWindow.window.toggleMinimized,x=240;this.formatWindow.window.toggleMinimized=function(){n.apply(this,arguments);this.minimized?(x=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+x-140+"px"):(this.div.style.width=
x+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-x+140)+"px");c.format.refresh();this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(F){mxEvent.getSource(F)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}));this.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80);"sketch"==Editor.currentTheme?window.setTimeout(mxUtils.bind(this,mxUtils.bind(this,function(){var F=
window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,I=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;this.formatWindow.window.setVisible(!0);(1E3>F||690>I)&&this.formatWindow.window.toggleMinimized()}),0)):this.formatWindow.window.setVisible(!1)}};var H=EditorUi.prototype.toggleFormatPanel;EditorUi.prototype.toggleFormatPanel=function(c){var g=this.formatWindow;null!=g?g.window.setVisible(null!=c?c:!this.isFormatPanelVisible()):
H.apply(this,arguments)};EditorUi.prototype.toggleShapesPanel=function(c){if(this.isShapesPanelVisible()!=c){var g=EditorUi.prototype.hsplitPosition;0==g&&(g=Math.min(this.diagramContainer.clientWidth,this.defaultSidebarWidth));var m=this.hsplitPosition,n=mxUtils.bind(this,function(){this.hsplitPosition=x;this.refresh();this.diagramContainer.scrollLeft-=m-this.hsplitPosition}),x=c?g:0,F=Editor.transitionDelay;mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==x?"translateX(0)":"translateX(-100%)");
0!=x&&n();window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform",0==x?"translateX(-100%)":"translateX(0)");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition","transform "+F+"s ease-in-out");mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin","top left");window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transition",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,
"transform",null);mxUtils.setPrefixedStyle(this.sidebarContainer.style,"transform-origin",null);0==x&&n()}),1E3*F)}),0)}};EditorUi.prototype.isShapesPanelVisible=function(){return 0<this.hsplitPosition};var S=EditorUi.prototype.isFormatPanelVisible;EditorUi.prototype.isFormatPanelVisible=function(){var c=this.formatWindow;return null!=c?c.window.isVisible():S.apply(this,arguments)};EditorUi.prototype.createShapesPanel=function(c){var g=mxUtils.bind(this,function(I,M){var L=this.menus.get(I);I=this.createMenuElement(M,
mxUtils.bind(this,function(){L.funct.apply(this,arguments)}));I.setAttribute("title",M);I.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;";I.className="geButton";c.parentNode.appendChild(I);return I});if(Editor.enableCustomLibraries&&("1"!=urlParams.embed||"1"==urlParams.libraries))if(null!=this.actions.get("newLibrary"))g=document.createElement("div"),g.style.cssText="position:absolute;border-style:solid;bottom:0px;margin:0;border-radius:0;border-width:1px 0 0 0;",
g.className="geButton",g.style.left="0px",g.style.right="50%",mxUtils.write(g,mxResources.get("newLibrary")),c.appendChild(g),mxEvent.addListener(g,"click",this.actions.get("newLibrary").funct),g=g.cloneNode(!1),g.style.left="50%",g.style.right="0px",mxUtils.write(g,mxResources.get("openLibrary")),c.appendChild(g),mxEvent.addListener(g,"click",this.actions.get("openLibrary").funct);else{var m=g("newLibrary","");m.style.left="0px";m.style.right="50%";var n=document.createElement("span");m.appendChild(n);
var x=g("openLibraryFrom","");x.style.borderLeftWidth="1px";x.style.left="50%";x.style.right="0px";var F=document.createElement("span");x.appendChild(F);this.dependsOnLanguage(mxUtils.bind(this,function(){n.innerHTML="";mxUtils.write(n,mxResources.get("newLibrary"));m.setAttribute("title",mxResources.get("newLibrary"));F.innerHTML="";mxUtils.write(F,mxResources.get("openLibraryFrom"));x.setAttribute("title",mxResources.get("openLibraryFrom"))}))}c.appendChild(this.sidebar.container);c.style.overflow=
"hidden"};EditorUi.prototype.createShapesWindow=function(){if(null==this.sidebarWindow){var c=Math.min(this.diagramContainer.parentNode.clientWidth-10,218),g="1"==urlParams.embedInline?650:Math.min(this.diagramContainer.parentNode.clientHeight,650),m="simple"==Editor.currentTheme||"sketch"==Editor.currentTheme;this.sidebarWindow=new WrapperWindow(this,mxResources.get("shapes"),m&&"1"!=urlParams.embedInline?66:10,m&&"1"!=urlParams.embedInline?Math.max(30,(this.diagramContainer.parentNode.clientHeight-
g)/2):56,c-6,g-6,mxUtils.bind(this,function(n){this.createShapesPanel(n)}));this.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.sidebarWindow.window.fit()}));this.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);this.sidebarWindow.window.setVisible(!1)}};EditorUi.prototype.setSketchMode=function(c){this.doSetSketchMode(c);null==urlParams.rough&&(mxSettings.settings.sketchMode=c,mxSettings.save());this.fireEvent(new mxEventObject("sketchModeChanged"))};EditorUi.prototype.setAndPersistDarkMode=
function(c){var g=c;"auto"==c&&(g=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches);this.setDarkMode(g);mxSettings.settings.darkMode=c;mxSettings.save();c=mxSettings.getUi();null==urlParams.ui&&"dark"==c&&this.setCurrentTheme("kennedy",!0)};EditorUi.prototype.setAndPersistLanguage=function(c){this.spinner.spin(document.body,mxResources.get("working"))&&(mxSettings.setLanguage(c),mxSettings.save(),mxClient.language=c,mxResources.loadDefaultBundle=!1,mxResources.add(RESOURCE_BASE,
null,mxUtils.bind(this,function(){this.spinner.stop();this.fireEvent(new mxEventObject("languageChanged"))})))};EditorUi.prototype.setElementTitle=function(c,g){this.dependsOnLanguage(mxUtils.bind(this,function(){c.setAttribute("title",mxResources.get(g))}))};EditorUi.prototype.dependsOnLanguage=function(c){c();this.addListener("languageChanged",c)};EditorUi.prototype.setAndPersistHighContrast=function(c){this.setHighContrast(c);Editor.isSettingsEnabled()&&(mxSettings.settings.highContrast=c,mxSettings.save())};
EditorUi.prototype.isHighContrast=function(){var c=document.getElementById("high-contrast-stylesheet");return null!=c&&window.matchMedia?(c=c.getAttribute("media"),"all"==c||"not all"!=c&&window.matchMedia("(forced-colors: active)").matches):!1};EditorUi.prototype.setHighContrast=function(c){var g=document.getElementById("high-contrast-stylesheet");if(null!=g&&window.matchMedia){var m=window.matchMedia("(forced-colors: active)").matches,n=g.getAttribute("media");(n="all"==n||"not all"!=n&&m)&&!c?
g.setAttribute("media",m?"not all":"(forced-colors: active)"):!n&&c&&g.setAttribute("media",m?"(forced-colors: active)":"all")}};EditorUi.prototype.isRulerVisible=function(){return null!=this.ruler};EditorUi.prototype.setRulerVisible=function(c){var g=this.getDiagramContainerOffset();mxSettings.setRulerOn(c);mxSettings.save();c||null==this.ruler?c&&null==this.ruler&&(this.ruler=new mxDualRuler(this,this.editor.graph.view.unit)):(this.ruler.destroy(),this.ruler=null);this.fireEvent(new mxEventObject("rulerVisibleChanged"));
c=this.getDiagramContainerOffset();this.diagramContainer.scrollLeft+=c.x-g.x;this.diagramContainer.scrollTop+=c.x-g.x};EditorUi.prototype.isAutoDarkModeSupported=function(){return null!=window.matchMedia};EditorUi.prototype.isAutoDarkMode=function(c){return!c&&"auto"==urlParams.dark||Editor.isSettingsEnabled()&&"auto"==mxSettings.settings.darkMode};EditorUi.prototype.setDarkMode=function(c){mxUtils.lightDarkColorSupported&&(Editor.darkMode=c,c=mxUtils.isAncestorNode(document.body,this.container)||
null==this.editor?this.container:this.editor.graph.container,mxConstants.DROP_TARGET_COLOR=Editor.isDarkMode()?"#00ff00":"#0000ff",null!=c&&(Editor.isDarkMode()?(c.classList.add("geDarkMode"),c.style.colorScheme="dark"):(c.classList.remove("geDarkMode"),c.style.colorScheme="light")),null!=this.ruler&&this.ruler.updateStyle(),this.fireEvent(new mxEventObject("darkModeChanged")))};EditorUi.prototype.setPagesVisible=function(c){Editor.pagesVisible!=c&&(Editor.pagesVisible=c,mxSettings.settings.pagesVisible=
c,mxSettings.save(),this.fireEvent(new mxEventObject("pagesVisibleChanged")))};EditorUi.prototype.setSidebarTitles=function(c,g){this.sidebar.sidebarTitles!=c&&(this.sidebar.sidebarTitles=c,Editor.isSettingsEnabled()&&g&&(mxSettings.settings.sidebarTitles=c,mxSettings.save()),this.fireEvent(new mxEventObject("sidebarTitlesChanged")))};EditorUi.prototype.setInlineFullscreen=function(c){Editor.inlineFullscreen!=c&&(this.diagramContainer.setAttribute("data-scrollState",JSON.stringify(this.saveScrollState(!0))),
(window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:c,rect:this.diagramContainer.getBoundingClientRect()}),"*"))};EditorUi.prototype.inlineSizeChanged=function(){var c=this.sketchFooterMenuElt,g=this.sketchMainMenuElt,m=this.sketchPickerMenuElt;if(Editor.inlineFullscreen)g.style.left="10px",g.style.top="10px",m.style.left="10px",m.style.top="60px",c.style.top="10px",c.style.right="12px",c.style.left="",null==this.diagramContainer.getAttribute("data-bounds")&&(this.diagramContainer.setAttribute("data-bounds",
this.diagramContainer.style.top+" "+this.diagramContainer.style.left+" "+this.diagramContainer.style.width+" "+this.diagramContainer.style.height),this.diagramContainer.style.top="0px",this.diagramContainer.style.left="0px",this.diagramContainer.style.bottom="0px",this.diagramContainer.style.right="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="");else{var n=this.diagramContainer.getAttribute("data-bounds");if(null!=n){this.diagramContainer.removeAttribute("data-bounds");
var x=n.split(" ");n=mxUtils.getDocumentSize();this.diagramContainer.style.top=x[0];this.diagramContainer.style.left=x[1];var F=parseInt(x[2]);x=parseInt(x[3]);F=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,F):F,n.width-80);x=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,x):x,n.height-80);this.diagramContainer.style.width=F+"px";this.diagramContainer.style.height=x+"px";this.diagramContainer.style.bottom="";this.diagramContainer.style.right="";(window.opener||
window.parent).postMessage(JSON.stringify({event:"resize",rect:this.diagramContainer.getBoundingClientRect()}),"*")}g.style.left=this.diagramContainer.offsetLeft+"px";g.style.top=this.diagramContainer.offsetTop-g.offsetHeight-4+"px";m.style.display="";m.style.left=this.diagramContainer.offsetLeft-m.offsetWidth-4+"px";m.style.top=this.diagramContainer.offsetTop+"px";c.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-c.offsetWidth+"px";c.style.top=g.style.top;c.style.right=
"";this.bottomResizer.style.left=this.diagramContainer.offsetLeft+(this.diagramContainer.offsetWidth-this.bottomResizer.offsetWidth)/2+"px";this.bottomResizer.style.top=this.diagramContainer.offsetTop+this.diagramContainer.offsetHeight-this.bottomResizer.offsetHeight/2-1+"px";this.rightResizer.style.left=this.diagramContainer.offsetLeft+this.diagramContainer.offsetWidth-this.rightResizer.offsetWidth/2-1+"px";this.rightResizer.style.top=this.diagramContainer.offsetTop+(this.diagramContainer.offsetHeight-
this.bottomResizer.offsetHeight)/2+"px"}this.bottomResizer.style.visibility=Editor.inlineFullscreen?"hidden":"";this.rightResizer.style.visibility=this.bottomResizer.style.visibility;g.style.visibility="";c.style.visibility=""};EditorUi.prototype.doSetSketchMode=function(c){Editor.sketchMode!=c&&(Editor.sketchMode=c,this.updateDefaultStyles())};EditorUi.prototype.updateDefaultStyles=function(){var c=this.editor.graph;c.defaultVertexStyle=mxUtils.clone(Graph.prototype.defaultVertexStyle);c.defaultEdgeStyle=
mxUtils.clone(Graph.prototype.defaultEdgeStyle);if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.vertexFontSize=16,c.edgeFontSize=c.vertexFontSize-4):"sketch"==Editor.currentTheme?(c.vertexFontSize=20,c.edgeFontSize=c.vertexFontSize-4):(c.vertexFontSize=Graph.prototype.vertexFontSize,c.edgeFontSize=Graph.prototype.edgeFontSize),c.defaultEdgeStyle.fontSize=c.edgeFontSize;if(null==Editor.config||
null==Editor.config.defaultEdgeStyle)"simple"==Editor.currentTheme||"1"==urlParams.embedInline?(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.endSize="8",c.defaultEdgeStyle.startSize="8"):"sketch"==Editor.currentTheme&&(c.defaultEdgeStyle.edgeStyle="none",c.defaultEdgeStyle.curved="1",c.defaultEdgeStyle.rounded="0",c.defaultEdgeStyle.jettySize="auto",c.defaultEdgeStyle.orthogonalLoop="1",c.defaultEdgeStyle.endArrow="open",c.defaultEdgeStyle.endSize=
"14",c.defaultEdgeStyle.startSize="14",c.defaultEdgeStyle.sourcePerimeterSpacing="8",c.defaultEdgeStyle.targetPerimeterSpacing="8");if(null==Editor.config||null==Editor.config.defaultFonts){if(null==Editor.config||null==Editor.config.defaultVertexStyle&&null==Editor.config.defaultEdgeStyle){if("sketch"==Editor.currentTheme&&"1"!=urlParams.embedInline||Editor.sketchMode)c.defaultVertexStyle.fontFamily=Editor.sketchFontFamily,c.defaultVertexStyle.fontSource=Editor.sketchFontSource,c.defaultEdgeStyle.fontFamily=
Editor.sketchFontFamily,c.defaultEdgeStyle.fontSource=Editor.sketchFontSource;Editor.sketchMode&&(c.defaultVertexStyle.sketch="1",c.defaultVertexStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultVertexStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultVertexStyle.hachureGap="4",c.defaultEdgeStyle.sketch="1",c.defaultEdgeStyle.curveFitting=Editor.sketchDefaultCurveFitting,c.defaultEdgeStyle.jiggle=Editor.sketchDefaultJiggle,c.defaultEdgeStyle.hachureGap="4")}this.menus.defaultFonts="sketch"==
Editor.currentTheme?Menus.prototype.defaultFonts.concat(Editor.sketchFonts):Menus.prototype.defaultFonts}c.currentVertexStyle=mxUtils.clone(c.defaultVertexStyle);c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);this.clearDefaultStyle()};EditorUi.prototype.getLinkTitle=function(c){var g=Graph.prototype.getLinkTitle.apply(this,arguments);if(Graph.isPageLink(c)){var m=c.indexOf(",");0<m&&(g=this.getPageById(c.substring(m+1)),g=null!=g?g.getName():mxResources.get("pageNotFound"))}else"data:"==c.substring(0,
5)&&(g=this.getCustomLinkTitle(c));return g};EditorUi.prototype.getCustomLinkTitle=function(c){var g=mxResources.get("action");if("data:action/json,"==c.substring(0,17))try{var m=JSON.parse(c.substring(17));null!=m&&null!=m.title&&(g=m.title)}catch(n){}return g};EditorUi.prototype.handleCustomLink=function(c,g){if(Graph.isPageLink(c))if(g=c.indexOf(","),c=this.getPageById(c.substring(g+1)))this.selectPage(c);else throw Error(mxResources.get("pageNotFound")||"Page not found");else this.editor.graph.handleCustomLink(c,
g)};EditorUi.prototype.installSettings=function(){if(Editor.isSettingsEnabled()){var c=this.editor.graph;Editor.pagesVisible=mxSettings.settings.pagesVisible;ColorDialog.recentColors=mxSettings.getRecentColors();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(g){g.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),this.menus.customFonts=mxSettings.getCustomFonts())}),!1)}catch(g){}this.fireEvent(new mxEventObject("styleChanged",
"keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(g,m){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));c.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(g,m){mxSettings.setCreateTarget(c.connectionHandler.isCreateTarget());mxSettings.save()}));
c.pageFormat=null!=c.defaultPageFormat?c.defaultPageFormat:mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(g,m){mxSettings.setPageFormat(c.pageFormat);mxSettings.save()}));c.view.defaultDarkGridColor=mxSettings.getGridColor(!0);c.view.defaultGridColor=mxSettings.getGridColor(!1);c.view.gridColor="light-dark("+c.view.defaultGridColor+", "+c.view.defaultDarkGridColor+")";this.addListener("gridColorChanged",mxUtils.bind(this,function(g,m){mxSettings.setGridColor(c.view.defaultGridColor,
!1);mxSettings.setGridColor(c.view.defaultDarkGridColor,!0);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(g,m){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();if(!this.editor.chromeless||this.editor.editable)null!=mxSettings.settings.enableAnimations&&(Editor.enableAnimations=mxSettings.settings.enableAnimations),this.addListener("enableAnimationsChanged",
mxUtils.bind(this,function(g,m){mxSettings.settings.enableAnimations=Editor.enableAnimations;mxSettings.save()}));null!=this.sidebar&&(null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes?(this.sidebar.searchShapes(decodeURIComponent(urlParams["search-shapes"])),this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),
mxSettings.save())));this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.writeImageToClipboard=function(c,g,m,n,x,F){n=null!=n?n:"image/png";var I=null==g||null==m?'<img src="'+c+'">':'<img src="'+c+'" width="'+g+'" height="'+m+'">',M={"text/html":new Blob([I],{type:"text/html"})};null!=ClipboardItem.supports&&ClipboardItem.supports(n)&&(M[n]=this.base64ToBlob(c.substring(c.indexOf(",")+1),n));var L=new ClipboardItem(M);
navigator.clipboard.write([L]).then(x)["catch"](F);EditorUi.debug("EditorUi.writeImageToClipboard",[this],"dataUrl",[c],"w",g,"h",m,"type",n,"html",[I],"data",[M],"item",[L])};EditorUi.prototype.writeHtmlToClipboard=function(c,g){navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([Editor.convertHtmlToText(c)],{type:"text/plain"}),"text/html":new Blob([c],{type:"text/html"})})])["catch"](g)};EditorUi.prototype.writeTextToClipboard=function(c,g){navigator.clipboard.writeText(c)["catch"](g)};
EditorUi.prototype.copySvg=function(c,g,m){try{if(null!=navigator.clipboard&&"function"===typeof window.ClipboardItem){var n=this.editor.graph.getSvg(null,m,null,null,null,null,null,null,null,null,null,null,null,0<c.length?c:null);n.setAttribute("content",g);var x=Editor.createSvgDataUri(mxUtils.getXml(n)),F=parseInt(n.getAttribute("width")),I=parseInt(n.getAttribute("height"));this.writeImageToClipboard(x,F,I,"image/svg+xml",null,mxUtils.bind(this,function(M){this.handleError(M)}))}}catch(M){this.handleError(M)}};
EditorUi.prototype.copyImage=function(c,g,m){try{m=null!=m?m:4,null!=navigator.clipboard&&"function"===typeof window.ClipboardItem&&this.spinner.spin(document.body,mxResources.get("exporting"))&&this.editor.exportToCanvas(mxUtils.bind(this,function(n,x){try{this.spinner.stop();var F=this.createImageDataUri(n,g,"png"),I=Math.round(parseInt(x.getAttribute("width"))/m),M=Math.round(parseInt(x.getAttribute("height"))/m);EditorUi.debug("EditorUi.copyImage",[this],"cells",[c],"xml",[g],"scale",[m]);this.writeImageToClipboard(F,
I,M,"image/png",null,mxUtils.bind(this,function(){if(this.isLocalFileSave()){var L=this.getBaseFilename(!1)+(null!=g?".drawio":"")+".png";this.saveLocalFile(F.substring(F.lastIndexOf(",")+1),L,"image/png",!0,"png",null,null,null,"copy")}else this.handleError(e)}))}catch(L){this.handleError(L)}}),null,null,null,mxUtils.bind(this,function(n){this.spinner.stop();this.handleError(n)}),null,null,m,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,null,null,null,10,null,
null,!1,null,0<c.length?c:null)}catch(n){this.handleError(n)}};EditorUi.prototype.copyCells=function(c,g){var m=this.editor.graph;if(m.isSelectionEmpty())c.innerText="";else{var n=mxUtils.sortCells(m.model.getTopmostCells(m.getSelectionCells())),x=mxUtils.getXml(m.encodeCells(n));mxUtils.setTextContent(c,encodeURIComponent(x));g?(m.removeCells(n,!1),m.lastPasteXml=null):(m.lastPasteXml=x,m.pasteCounter=0);c.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var c=
null;if(Editor.enableNativeClipboard){var g=this.editor.graph;g.isSelectionEmpty()||(c=mxUtils.sortCells(g.getExportableCells(g.model.getTopmostCells(g.getSelectionCells()))),g=mxUtils.getXml(g.encodeCells(c)),navigator.clipboard.writeText(g))}return c};EditorUi.prototype.pasteXml=function(c,g,m,n,x,F){EditorUi.debug("EditorUi.pasteXml",[this],"xml",[c],"pasteAsLabel",[g],"compat",[m],"evt",[n],"html",[x],"pt",[F]);x=null!=x?x:!0;var I=this.editor.graph,M=null!=F?F:Editor.pasteAtMousePointer&&I.isMouseInsertPoint()?
I.getInsertPoint():null;F=null;I.lastPasteXml==c?null==M&&I.pasteCounter++:(I.lastPasteXml=c,I.pasteCounter=0);var L=I.pasteCounter*I.gridSize;if(m||this.isCompatibleString(c)){I.model.beginUpdate();try{if(F=this.importXml(c,L,L),null!=M){var K=I.getBoundingBoxFromGeometry(F,!0);if(null!=K){var aa=Math.round(I.snap(M.x)),ja=Math.round(I.snap(M.y));I.cellsMoved(F,aa-K.x,ja-K.y)}}}finally{I.model.endUpdate()}I.setSelectionCells(F)}else if(g&&1==I.getSelectionCount()){g=I.getStartEditingCell(I.getSelectionCell(),
n);if(/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)&&"image"==I.getCurrentCellStyle(g)[mxConstants.STYLE_SHAPE])I.setCellStyles(mxConstants.STYLE_IMAGE,c,[g]);else{I.model.beginUpdate();try{I.labelChanged(g,c),Graph.isLink(c)&&I.setLinkForCell(g,c)}finally{I.model.endUpdate()}}I.setSelectionCell(g)}else M=null!=M?M:I.getInsertPoint(),I.isMouseInsertPoint()&&(L=0,I.lastPasteXml==c&&0<I.pasteCounter&&I.pasteCounter--),F=this.insertTextAt(c,M.x+L,M.y+L,x),I.setSelectionCells(F);I.isSelectionEmpty()||(I.scrollCellToVisible(I.getSelectionCell()),
null!=this.hoverIcons&&this.hoverIcons.update(I.view.getState(I.getSelectionCell())));return F};EditorUi.prototype.pasteCells=function(c,g,m,n){if(!mxEvent.isConsumed(c)){var x=c.clipboardData,F=this.editor.graph,I=!1,M=g;if(m&&null!=x&&x.getData){var L=x.getData("text/plain"),K=!1;if(null!=L&&0<L.length&&"%3CmxGraphModel%3E"==L.substring(0,18))try{var aa=decodeURIComponent(L);this.isCompatibleString(aa)&&(K=!0,L=aa)}catch(ha){}K=K?null:x.getData("text/html");null!=K&&0<K.length?(M=this.parseHtmlData(K),
I="text/plain"!=M.getAttribute("data-type")):null!=L&&0<L.length&&(M=document.createElement("div"),mxUtils.setTextContent(M,K))}L=M.getElementsByTagName("span");if(null!=L&&0<L.length&&"application/vnd.lucid.chart.objects"===L[0].getAttribute("data-lucid-type"))m=L[0].getAttribute("data-lucid-content"),null!=m&&0<m.length&&(this.convertLucidChart(m,mxUtils.bind(this,function(ha){var Z=this.editor.graph;Z.lastPasteXml==ha?Z.pasteCounter++:(Z.lastPasteXml=ha,Z.pasteCounter=0);var k=Z.pasteCounter*Z.gridSize;
Z.setSelectionCells(this.importXml(ha,k,k));Z.scrollCellToVisible(Z.getSelectionCell())}),mxUtils.bind(this,function(ha){this.handleError(ha)})),mxEvent.consume(c));else{var ja=!1,ca="";ca=I?null!=M.textContent&&"<mxfile"==M.textContent.substring(0,7)&&"</mxfile>"==M.textContent.substring(M.textContent.length-9)||"<mxGraphModel"==M.textContent.substring(0,13)&&"</mxGraphModel>"==M.textContent.substring(M.textContent.length-15)?M.textContent.replace(/\u00a0/g," "):M.innerHTML:mxUtils.trim(null==M.innerText?
mxUtils.getTextContent(M):M.innerText);try{var ba=ca.lastIndexOf("%3E");0<=ba&&ba<ca.length-3&&(ca=ca.substring(0,ba+3))}catch(ha){}try{L=M.getElementsByTagName("span"),(aa=null!=L&&0<L.length?mxUtils.trim(decodeURIComponent(L[0].textContent)):decodeURIComponent(ca))&&(this.isCompatibleString(aa)||0==aa.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":'))&&(ja=!0,ca=aa)}catch(ha){}aa=null;try{if(!ja&&""==M.textContent)for(ba=0;ba<x.items.length;ba++){var oa=x.items[ba];if("file"===oa.kind){aa=
oa.getAsFile();break}}}catch(ha){}EditorUi.debug("EditorUi.pasteCells",[this],"evt",[c],"realElt",[g.outerHTML],"elt",[M.outerHTML],"useEvent",m,"pasteAsLabel",n,"xml",[ca],"compat",ja,"asHtml",I,"data",x,"items",[x.items.length],"files",[x.files.length],"types",[JSON.stringify(x.types)],"blob",[aa]);try{if(ja||null==aa)if(null!=ca&&0<ca.length){if(0==ca.substring(0,20).replace(/\s/g,"").indexOf('{"isProtected":')){var da=mxUtils.bind(this,function(){try{ca=(new MiroImporter).importMiroJson(JSON.parse(ca)),
this.pasteXml(ca,n,ja,c)}catch(ha){console.log("Miro import error:",ha)}});"undefined"===typeof MiroImporter?mxscript("js/diagramly/miro/MiroImporter.js",da):da()}else this.pasteXml(ca,n,ja,c,I);mxEvent.consume(c)}else m||(F.lastPasteXml=null,F.pasteCounter=0);else{var Y=F.getInsertPoint();this.importFiles([aa],Y.x,Y.y,this.maxImageSize);mxEvent.consume(c)}}catch(ha){this.handleError(ha)}}}g.innerHTML="&nbsp;"};EditorUi.prototype.pasteFromClipboard=function(c){var g=this.editor.graph;if(g.isEnabled()&&
!g.isCellLocked(g.getDefaultParent()))try{Editor.enableNativeClipboard?this.readGraphModelFromClipboard(mxUtils.bind(this,function(m,n,x,F,I){if(null!=m){g.getModel().beginUpdate();try{this.pasteXml(m,!0,null,null,null,c)}finally{g.getModel().endUpdate()}}else m=null!=n?n:null!=x?x:F,null!=m?(c=null!=c?c:g.getInsertPoint(),this.importFiles([m],c.x,c.y,this.maxImageSize)):this.pasteFromLocalClipboard(c)})):this.pasteFromLocalClipboard(c)}catch(m){}};EditorUi.prototype.pasteFromLocalClipboard=function(c){var g=
this.editor.graph;g.getModel().beginUpdate();try{g.moveCellsTo(mxClipboard.paste(g),c)}finally{g.getModel().endUpdate()}};EditorUi.prototype.installImagePasteHandler=function(){var c=this.editor.graph;c.container.addEventListener("paste",mxUtils.bind(this,function(g){for(var m=null!=g.clipboardData?g.clipboardData:g.originalEvent.clipboardData,n=!1,x=null,F=0;F<m.types.length;F++)if("text/"===m.types[F].substring(0,5)){n=!0;break}for(F=0;F<m.items.length;F++){var I=m.items[F];if("file"===I.kind){x=
I.getAsFile();break}}EditorUi.debug("EditorUi.imagePasteHandler",[this],"evt",[g],"data",[m],"items",[m.items.length],"files",[m.files.length],"types",[JSON.stringify(m.types)],"containsText",n,"file",[x],"editing",c.isEditing());var M=mxUtils.bind(this,function(){try{if(!n&&null!=x){if(c.isEditing())this.importFiles([x],0,0,this.maxImageSize,function(K,aa,ja,ca,ba,oa){c.insertImage(K,ba,oa)},function(){},function(K){return"image/"==K.type.substring(0,6)},function(K){for(var aa=0;aa<K.length;aa++)K[aa]()});
else{var L=this.editor.graph.getInsertPoint();this.importFiles([x],L.x,L.y,this.maxImageSize)}mxEvent.consume(g)}}catch(K){}});if(!mxEvent.isConsumed(g)&&!n)if(Editor.enableNativeClipboard)navigator.clipboard.read().then(mxUtils.bind(this,function(L){this.readTypeFromClipboardData(L,"image/svg+xml",mxUtils.bind(this,function(K){if(null!=K){K=new Blob([K],{type:"image/svg+xml"});var aa=this.editor.graph.getInsertPoint();this.importFiles([K],aa.x,aa.y,this.maxImageSize)}else M()}),"image")}))["catch"](M);
else M()}),!1)};EditorUi.prototype.readGraphModelFromClipboard=function(c){navigator.clipboard.read().then(mxUtils.bind(this,function(g){try{EditorUi.debug("EditorUi.readGraphModelFromClipboard",[this],"data",g,"types",null!=g&&0<g.length?[JSON.stringify(g[0].types)]:[]),this.readGraphModelFromHtmlClipboardData(g,mxUtils.bind(this,function(m,n){null!=m?c(m):this.readGraphModelFromImageClipboardData(g,mxUtils.bind(this,function(x,F,I){null!=x?c(x):this.readTypeFromClipboardData(g,"text/plain",mxUtils.bind(this,
function(M){c(M,F,I,n,g)}))}))}))}catch(m){c(null)}}))["catch"](function(){c(null)})};EditorUi.prototype.readGraphModelFromHtmlClipboardData=function(c,g){this.readTypeFromClipboardData(c,"text/html",mxUtils.bind(this,function(m){var n=null,x=null;try{var F=this.parseHtmlData(m);if(null!=F){n="text/plain"!=F.getAttribute("data-type")?F.innerHTML:mxUtils.trim(null==F.innerText?mxUtils.getTextContent(F):F.innerText);try{var I=n.lastIndexOf("%3E");0<=I&&I<n.length-3&&(n=n.substring(0,I+3))}catch(K){}try{null==
n&&(m=null,""==F.textContent&&1==F.children.length&&"IMG"==F.firstChild.nodeName&&(m=F.firstChild.getAttribute("src")),null!=m&&0<m.length&&("data:image/png;base64,"==m.substring(0,22)?x=this.base64ToBlob(m.substring(m.indexOf(",")+1),"image/png"):"data:image/svg+xml;base64,"==m.substring(0,26)&&(x=this.base64ToBlob(m.substring(m.indexOf(",")+1),"image/svg+xml"))))}catch(K){}try{var M=F.getElementsByTagName("span"),L=null!=M&&0<M.length?mxUtils.trim(decodeURIComponent(M[0].textContent)):decodeURIComponent(n);
this.isCompatibleString(L)&&(n=L)}catch(K){}}}catch(K){}g(this.isCompatibleString(n)?n:null,x)}))};EditorUi.prototype.readGraphModelFromImageClipboardData=function(c,g){this.readTypeFromClipboardData(c,"image/svg+xml",mxUtils.bind(this,function(m,n){var x=null;try{null!=m&&(x=mxUtils.parseXml(m).documentElement.getAttribute("content"))}catch(F){}this.isCompatibleString(x)?g(x):this.readTypeFromClipboardData(c,"image/png",mxUtils.bind(this,function(F,I){x=Editor.extractGraphModelFromPng("data:image/png;base64,"+
F);this.isCompatibleString(x)?g(x):g(null,n,I)}))}))};EditorUi.prototype.readTypeFromClipboardData=function(c,g,m){var n=!1;if(null!=c&&0<c.length)for(var x=0;x<c.length&&!n;x++)(function(F){0<=mxUtils.indexOf(F.types,g)&&(n=!0,F.getType(g).then(mxUtils.bind(this,function(I){if("image/png"==g)I.arrayBuffer().then(function(M){m(btoa(Graph.arrayBufferToString(M)),I)})["catch"](function(){m(null)});else I.text().then(mxUtils.bind(this,function(M){EditorUi.debug("EditorUi.readTypeFromClipboardData",[this],
"data",[c],"type",[g],"result",[M]);m(M,I)}))["catch"](function(){m(null)})}))["catch"](function(){m(null)}))})(c[x]);n||m()};EditorUi.prototype.parseHtmlData=function(c){var g=null;if(null!=c&&0<c.length){var m="<meta "==c.substring(0,6);g=document.createElement("div");g.innerHTML=(m?'<meta charset="utf-8">':"")+Graph.sanitizeHtml(c);asHtml=!0;m=g.getElementsByTagName("style");if(null!=m)for(;0<m.length;)m[0].parentNode.removeChild(m[0]);if(null!=g.firstChild&&g.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&
null!=g.firstChild.nextSibling&&g.firstChild.nextSibling.nodeType==mxConstants.NODETYPE_ELEMENT&&"META"==g.firstChild.nodeName&&"A"==g.firstChild.nextSibling.nodeName&&null==g.firstChild.nextSibling.nextSibling){var n=null==g.firstChild.nextSibling.innerText?mxUtils.getTextContent(g.firstChild.nextSibling):g.firstChild.nextSibling.innerText;n==g.firstChild.nextSibling.getAttribute("href")&&(mxUtils.setTextContent(g,n),asHtml=!1)}if(""==g.textContent&&(m=g.getElementsByTagName("img"),1==m.length&&
(n=m[0].getAttribute("src"),m=null,null!=n))){if(Editor.isPngDataUrl(n)){var x=Editor.extractGraphModelFromPng(n);null!=x&&0<x.length&&(m=x)}else if("data:image/svg+xml;base64,"==n.substring(0,26)){img=this.base64ToBlob(n.substring(n.indexOf(",")+1),"image/svg+xml");n=Graph.getSvgFromDataUri(n);try{x=mxUtils.parseXml(n).documentElement.getAttribute("content"),this.isCompatibleString(x)&&(m=x)}catch(F){}}null!=m&&(mxUtils.setTextContent(g,m),asHtml=!1)}asHtml?Graph.removePasteFormatting(g):g.setAttribute("data-type",
"text/plain")}EditorUi.debug("EditorUi.parseHtmlData",[this],"data",[c],"elt",[g],"asHtml",asHtml);return g};EditorUi.prototype.showPrintDialog=function(c,g,m){var n=330;this.editor.graph.isEnabled()&&(n+=40);null!=this.pages&&1<this.pages.length&&(n+=40,this.editor.graph.isEnabled()||(n+=10));null==g||mxClient.IS_CHROMEAPP||"draw.io"!=this.getServiceName()||(n+=20);this.showDialog((new PrintDialog(this,c,g,m)).container,320,n,!0,!0)};EditorUi.prototype.print=function(c,g){var m=this.editor,n=m.graph,
x=this.getPageIndex(this.currentPage),F=null!=x?x+1:1,I=mxUtils.bind(this,function(ha,Z,k,v){var J=ha.useCssTransforms,N=ha.currentTranslate,T=ha.currentScale,V=ha.view.translate,U=ha.view.scale;ha.useCssTransforms&&(ha.useCssTransforms=!1,ha.currentTranslate=new mxPoint(0,0),ha.currentScale=1,ha.view.translate=new mxPoint(0,0),ha.view.scale=1);var X=ha.getGraphBounds(),fa=0,na=0,la=mxRectangle.fromRectangle(ha.pageFormat),qa=g.fit||g.crop||!ha.pageVisible,ya=g.scale;la.width=Math.ceil(la.width*ha.pageScale);
la.height=Math.ceil(la.height*ha.pageScale);var wa=1;if(g.fit){wa=g.sheetsAcross;var Ja=g.sheetsDown;isNaN(ya)||(la.width=Math.ceil(la.width*ya),la.height=Math.ceil(la.height*ya));wa=Math.min(la.height*Ja/(X.height/ha.view.scale),la.width*wa/(X.width/ha.view.scale))}else wa=isNaN(ya)?1:ya;wa*=1;!qa&&ha.pageVisible?(ya=ha.getPageLayout(),fa-=ya.x*la.width,na-=ya.y*la.height):qa=!0;g.crop&&(g.selection&&(X=n.getBoundingBox(n.getSelectionCells())),la.width=(X.width+1)*wa/ha.view.scale,la.height=(X.height+
1)*wa/ha.view.scale);la.width=Math.ceil(1*la.width);la.height=Math.ceil(1*la.height);v=null!=v?"page/id,"+v:null;if(null==Z){Z=PrintDialog.createPrintPreview(ha,wa,null,0,fa,na,qa);Z.title=this.getBaseFilename(!0);Z.pageSelector=!1;Z.mathEnabled=!1;fa=g.border;isNaN(fa)||(Z.pageMargin=fa);g.selection&&(Z.isCellVisible=function(Ma){return ha.isCellSelected(Ma)});var Aa=Z.writeHead;Z.writeHead=function(Ma,ra){ra=null!=ra?ra:"";g.shadows||(ra+='g[style*="filter: drop-shadow("] {\n filter: none !important;{\n}\n');
mxClient.IS_GC&&(ra+="@media print {\n.MathJax svg { shape-rendering: crispEdges; }\n}\n");null!=m.fontCss&&(ra+=m.fontCss);Aa.apply(this,arguments);for(var Ca=ha.getCustomFonts(),Da=0;Da<Ca.length;Da++){var va=Ca[Da].name,Na=Ca[Da].url;Graph.isCssFontUrl(Na)?Ma.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(Graph.rewriteGoogleFontUrl(Na))+'" charset="UTF-8" type="text/css">'):(Ma.writeln('<style type="text/css">'),Ma.writeln('@font-face {\nfont-family: "'+mxUtils.htmlEntities(va)+'";\nsrc: url("'+
mxUtils.htmlEntities(Na)+'");\n}'),Ma.writeln("</style>"))}};if(Editor.replaceSvgDataUris){var Ba=Z.drawBackgroundImage;Z.drawBackgroundImage=function(Ma){Ba.apply(this,arguments);null!=Ma.node&&(EditorUi.embedSvgImages(Ma.node),n.disableSvgLinks(Ma.node,function(ra){ra.setAttribute("href","javascript:void(0)")}))}}var Ga=Z.addGraphFragment;Z.addGraphFragment=function(Ma,ra,Ca,Da,va,Na){Ga.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:va.classList.add("geDisableMathJax");
if(this.graph.shadowVisible)for(var Oa=va.getElementsByTagName("svg"),Qa=0;Qa<Oa.length;Qa++)ha.addSvgShadow(Oa[Qa])};g.grid&&(Z.gridSize=ha.gridSize,Z.gridSteps=ha.view.gridSteps,Z.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:ha.view.gridColor);Z.open(null,null,k,!0,v,la,g.selection?ha.getSelectionCells():null)}else{X=ha.background;if(null==X||""==X||X==mxConstants.NONE)X="#ffffff";Z.backgroundColor=X;Z.autoOrigin=qa;g.grid&&(Z.gridSize=ha.gridSize,Z.gridSteps=ha.view.gridSteps,
Z.gridColor=Editor.isDarkMode()?mxGraphView.prototype.defaultGridColor:ha.view.gridColor);Z.appendGraph(ha,wa,fa,na,k,!0,v,la,g.selection?ha.getSelectionCells():null);k=ha.getCustomFonts();if(null!=Z.wnd)for(la=0;la<k.length;la++)fa=k[la].name,na=k[la].url,Graph.isCssFontUrl(na)?Z.wnd.document.writeln('<link rel="stylesheet" href="'+mxUtils.htmlEntities(na)+'" charset="UTF-8" type="text/css">'):(Z.wnd.document.writeln('<style type="text/css">'),Z.wnd.document.writeln('@font-face {\nfont-family: "'+
mxUtils.htmlEntities(fa)+'";\nsrc: url("'+mxUtils.htmlEntities(na)+'");\n}'),Z.wnd.document.writeln("</style>"))}J&&(ha.useCssTransforms=J,ha.currentTranslate=N,ha.currentScale=T,ha.view.translate=V,ha.view.scale=U);return Z}),M=g.pagesFrom,L=g.pagesTo,K=!g.allPages;x=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(this,g);else{K&&(K=g.selection||M==F&&L==F);if(!K&&null!=this.pages&&this.pages.length){K=0;F=this.pages.length-1;g.allPages||(K=parseInt(M)-1,F=parseInt(L)-1);for(var aa=K;aa<=
F;aa++){var ja=this.pages[aa];M=ja==this.currentPage?n:null;if(null==M){M=this.createTemporaryGraph(n.stylesheet);M.shapeForegroundColor=n.shapeForegroundColor;M.shapeBackgroundColor=n.shapeBackgroundColor;L=!0;var ca=K=!1,ba=null,oa=null;null==ja.viewState&&null==ja.root&&this.updatePageRoot(ja);null!=ja.viewState&&(L=ja.viewState.pageVisible,K=ja.viewState.mathEnabled,ca=ja.viewState.shadowVisible,ba=ja.viewState.background,oa=ja.viewState.backgroundImage,M.pageFormat=ja.viewState.pageFormat,M.gridSize=
ja.viewState.gridSize);null!=oa&&null!=oa.originalSrc&&(oa=this.createImageForPageLink(oa.originalSrc,ja));M.background=ba;M.backgroundImage=null!=oa?new mxImage(oa.src,oa.width,oa.height,oa.x,oa.y):null;M.pageVisible=L;M.mathEnabled=K;M.shadowVisible=ca;var Y=M.getGraphBounds;M.getGraphBounds=function(){var ha=Y.apply(this,arguments),Z=this.backgroundImage;if(null!=Z&&null!=Z.width&&null!=Z.height){var k=this.view.translate,v=this.view.scale;ha=mxRectangle.fromRectangle(ha);ha.add(new mxRectangle((k.x+
Z.x)*v,(k.y+Z.y)*v,Z.width*v,Z.height*v))}return ha};var da=M.getGlobalVariable;M.getGlobalVariable=function(ha){return"page"==ha?ja.getName():"pagenumber"==ha?aa+1:"pagecount"==ha?null!=this.pages?this.pages.length:1:da.apply(this,arguments)};document.body.appendChild(M.container);this.updatePageRoot(ja);M.model.setRoot(ja.root)}x=I(M,x,aa!=F,ja.getId());M!=n&&M.container.parentNode.removeChild(M.container)}}else x=I(n);null==x||null==x.wnd?this.handleError({message:mxResources.get("errorUpdatingPreview")}):
(x.mathEnabled&&(I=x.wnd.document,c||(x.wnd.IMMEDIATE_PRINT=!0),I.writeln('<script type="text/javascript" src="js/math-print.js">\x3c/script>')),x.closeDocument(),Graph.rewritePageLinks(x.wnd.document,!0),x.mathEnabled||c||PrintDialog.printPreview(x));return x}};EditorUi.prototype.addFileDropHandler=function(c){if(Graph.fileSupport)for(var g=null,m=0;m<c.length;m++)mxEvent.addListener(c[m],"dragleave",function(n){null!=g&&(g.parentNode.removeChild(g),g=null);n.stopPropagation();n.preventDefault()}),
mxEvent.addListener(c[m],"dragover",mxUtils.bind(this,function(n){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==g&&(g=this.highlightElement());n.stopPropagation();n.preventDefault()})),mxEvent.addListener(c[m],"drop",mxUtils.bind(this,function(n){null!=g&&(g.parentNode.removeChild(g),g=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<n.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(n.dataTransfer.files,0,0,this.maxImageSize,null,null,
null,null,!mxEvent.isControlDown(n)&&!mxEvent.isShiftDown(n)):this.openFiles(n.dataTransfer.files,!0);else{var x=this.extractGraphModelFromEvent(n);if(null==x){var F=null!=n.dataTransfer?n.dataTransfer:n.clipboardData;null!=F&&(10==document.documentMode||11==document.documentMode?x=F.getData("Text"):(x=null,x=0<=mxUtils.indexOf(F.types,"text/uri-list")?n.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(F.types,"text/html")?F.getData("text/html"):null,null!=x&&0<x.length?(F=document.createElement("div"),
F.innerHTML=Graph.sanitizeHtml(x),F=F.getElementsByTagName("img"),0<F.length&&(x=F[0].getAttribute("src"))):0<=mxUtils.indexOf(F.types,"text/plain")&&(x=F.getData("text/plain"))),null!=x&&(Editor.isPngDataUrl(x)?(x=Editor.extractGraphModelFromPng(x),null!=x&&0<x.length&&this.openLocalFile(x,null,!0)):this.isRemoteFileFormat(x)?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(x))).send(mxUtils.bind(this,
function(I){200<=I.getStatus()&&299>=I.getStatus()?this.openLocalFile(I.getText(),null,!0):this.showError(mxResources.get("error"),413==I.getStatus()?mxResources.get("diagramTooLarge"):mxResources.get("unknownError"))})):/^https?:\/\//.test(x)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(x):window.geOpenWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(x)))))}else this.openLocalFile(x,null,
!0)}n.stopPropagation();n.preventDefault()}))};EditorUi.prototype.highlightElement=function(c){var g=0,m=0;if(null==c){var n=document.body;var x=document.documentElement;var F=(n.clientWidth||x.clientWidth)-3;n=Math.max(n.clientHeight||0,x.clientHeight)-3}else n=c.getBoundingClientRect(),g=n.top,m=n.left,F=n.width,n=n.height;x=document.createElement("div");x.style.zIndex=mxPopupMenu.prototype.zIndex+2;x.style.border="3px dotted rgb(254, 137, 12)";x.style.pointerEvents="none";x.style.position="absolute";
x.style.top=g+"px";x.style.left=m+"px";x.style.width=Math.max(0,F-3)+"px";x.style.height=Math.max(0,n-3)+"px";null!=c&&c.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(x):document.body.appendChild(x);return x};EditorUi.prototype.stringToCells=function(c){c=mxUtils.parseXml(c);var g=this.editor.extractGraphModel(c.documentElement);c=[];if(null!=g){var m=new mxCodec(g.ownerDocument),n=new mxGraphModel;m.decode(g,n);g=n.getChildAt(n.getRoot(),0);for(m=0;m<n.getChildCount(g);m++)c.push(n.getChildAt(g,
m))}return c};EditorUi.prototype.openFileHandle=function(c,g,m,n,x,F){if(null!=g&&0<g.length){if(!Editor.useCanvasForExport&&/(\.png)$/i.test(g)||/(\.pdf)$/i.test(g))g=g.substring(0,g.length-4),/(\.drawio)$/i.test(g)||(g+=".drawio");var I=mxUtils.bind(this,function(L){g=0<=g.lastIndexOf(".")?g.substring(0,g.lastIndexOf("."))+".drawio":g+".drawio";if("<mxlibrary"==L.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,n);try{this.loadLibrary(new LocalLibrary(this,
L,g)),this.showSidebar()}catch(K){this.handleError(K,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(L,g,n)});if(EditorUi.isVisioFilename(g))this.importVisio(m,mxUtils.bind(this,function(L){this.spinner.stop();I(L)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(L){this.spinner.stop();I(L)}));else if(Graph.fileSupport&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,g))this.isOffline()?(this.spinner.stop(),this.showError(mxResources.get("error"),
mxResources.get("notInOffline"))):this.parseFile(m,mxUtils.bind(this,function(L){4==L.readyState&&(this.spinner.stop(),200<=L.status&&299>=L.status?I(L.responseText):this.handleError({message:mxResources.get(413==L.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(g)&&(g=g.substring(0,g.length-5)+".drawio"),this.convertLucidChart(c,mxUtils.bind(this,function(L){this.spinner.stop();this.openLocalFile(L,g,n)}),
mxUtils.bind(this,function(L){this.spinner.stop();this.handleError(L)}));else if("<mxlibrary"==c.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,n);try{this.loadLibrary(new LocalLibrary(this,c,m.name)),this.showSidebar()}catch(L){this.handleError(L,mxResources.get("errorLoadingFile"))}}else if(0==c.indexOf("PK"))this.importZipFile(m,mxUtils.bind(this,function(L){this.spinner.stop();I(L)}),mxUtils.bind(this,
function(){this.spinner.stop();this.openLocalFile(c,g,n)}));else{if("image/png"==m.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==m.type){var M=Editor.extractGraphModelFromPdf(c);null!=M&&(x=null,n=!0,c=M)}this.spinner.stop();this.openLocalFile(c,g,n,x,null!=x?m:null,F)}}};EditorUi.prototype.openFiles=function(c,g){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var m=0;m<c.length;m++)mxUtils.bind(this,function(n){var x=new FileReader;x.onload=
mxUtils.bind(this,function(F){try{this.openFileHandle(F.target.result,n.name,n,g)}catch(I){this.handleError(I)}});x.onerror=mxUtils.bind(this,function(F){this.spinner.stop();this.handleError(F);window.openFile=null});"image"!==n.type.substring(0,5)&&"application/pdf"!==n.type||"image/svg"===n.type.substring(0,9)?x.readAsText(n):x.readAsDataURL(n)})(c[m])};EditorUi.prototype.openLocalFile=function(c,g,m,n,x,F){var I=this.getCurrentFile(),M=mxUtils.bind(this,function(){window.openFile=null;if(null==
g&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var L=mxUtils.parseXml(c);null!=L&&(this.editor.setGraphXml(L.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,c,g||this.defaultFilename,m,n,x,F))});if(null!=c&&0<c.length)null==I||!I.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=n)?M():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null!=n)&&null!=I&&I.isModified()?this.confirm(mxResources.get("allChangesLost"),null,M,mxResources.get("cancel"),
mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(c,g),window.geOpenWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=I&&I.isModified()?this.confirm(mxResources.get("allChangesLost"),null,M,mxResources.get("cancel"),mxResources.get("discardChanges")):M()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=function(){var c={};if(null!=this.pages)for(var g=0;g<this.pages.length;g++)this.updatePageRoot(this.pages[g]),
this.addBasenamesForCell(this.pages[g].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);g=[];for(var m in c)g.push(m);return g};EditorUi.prototype.addBasenamesForCell=function(c,g){function m(I){if(null!=I){var M=I.lastIndexOf(".");0<M&&(I=I.substring(M+1,I.length));null==g[I]&&(g[I]=!0)}}var n=this.editor.graph,x=n.getCellStyle(c);m(mxStencilRegistry.getBasenameForStencil(x[mxConstants.STYLE_SHAPE]));n.model.isEdge(c)&&(m(mxMarker.getPackageForType(x[mxConstants.STYLE_STARTARROW])),
m(mxMarker.getPackageForType(x[mxConstants.STYLE_ENDARROW])));x=n.model.getChildCount(c);for(var F=0;F<x;F++)this.addBasenamesForCell(n.model.getChildAt(c,F),g)};EditorUi.prototype.setGraphEnabled=function(c){this.diagramContainer.style.visibility=c?"":"hidden";this.formatContainer.style.visibility=this.diagramContainer.style.visibility;this.sidebarContainer.style.display=c?"":"none";this.hsplit.style.display=this.sidebarContainer.style.display;this.editor.graph.setEnabled(c);null!=this.tabContainer&&
(this.tabContainer.style.visibility=this.diagramContainer.style.visibility);c||this.hideWindows();this.editor.graph.sizeDidChange();this.resetScrollbars()};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))){var c=!1;this.installMessageHandler(mxUtils.bind(this,function(g,m,n,x){c||(c=!0,this.spinner.stop(),this.addEmbedButtons(),this.setGraphEnabled(!0));
if(null==g||0==g.length)g=this.emptyDiagramXml;this.setCurrentFile(new EmbedFile(this,g,{}));this.mode=App.MODE_EMBED;this.setFileData(g);if(x)try{var F=this.editor.graph;F.setGridEnabled(!1);F.pageVisible=!1;var I=F.model.cells,M;for(M in I){var L=I[M];null!=L&&null!=L.style&&(L.style+=";sketch=1;"+(-1==L.style.indexOf("fontFamily=")||-1<L.style.indexOf("fontFamily=Helvetica;")?"fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;":
""))}}catch(K){console.log(K)}this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog();this.chromelessResize&&this.chromelessResize();this.editor.undoManager.clear();this.editor.modified=null!=n?n:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))}};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?
this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(c,g){null!=c?this.spinner.spin(document.body,mxResources.get("loading"))&&c.getPublicUrl(mxUtils.bind(this,function(m){this.spinner.stop();g(m)})):g(null)};EditorUi.prototype.createLoadMessage=function(c){var g=this.editor.graph;return{event:c,pageVisible:g.pageVisible,translate:g.view.translate,bounds:g.getGraphBounds(),currentPage:this.getSelectedPageIndex(),scale:g.view.scale,
page:g.view.getBackgroundPageBounds()}};EditorUi.prototype.sendEmbeddedSvgExport=function(c){try{var g=this.editor.graph;g.isEditing()&&g.stopEditing(!g.isInvokesStopCellEditing());var m=window.opener||window.parent;if(this.editor.modified){var n=g.background;if(null==n||n==mxConstants.NONE)n=this.embedExportBackground;this.getEmbeddedSvg(this.getFileData(!0,null,null,null,null,null,null,null,null,!1),g,null,!0,mxUtils.bind(this,function(x){m.postMessage(JSON.stringify({event:"export",point:this.embedExitPoint,
exit:null!=c?!c:!0,data:Editor.createSvgDataUri(x)}),"*")}),null,null,!0,n,1,this.embedExportBorder,null,this.embedExportTheme)}else c||m.postMessage(JSON.stringify({event:"exit",point:this.embedExitPoint}),"*");c||(this.diagramContainer.removeAttribute("data-bounds"),Editor.inlineFullscreen=!1,g.model.clear(),this.editor.undoManager.clear(),this.setBackgroundImage(null),this.editor.modified=!1,"1"!=urlParams.embed&&this.fireEvent(new mxEventObject("editInlineStop")))}catch(x){c||this.handleError(x)}};
EditorUi.prototype.installMessageHandler=function(c){var g=null,m=!1,n=!1,x=null,F=mxUtils.bind(this,function(L,K){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.updateStatus(mxUtils.bind(this,function(){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified)))})):this.clearStatus()});this.editor.graph.model.addListener(mxEvent.CHANGE,F);mxEvent.addListener(window,"message",mxUtils.bind(this,function(L){if(L.source==(window.opener||window.parent)){var K=
L.data,aa=null,ja=mxUtils.bind(this,function(ra){if(null!=ra&&"function"===typeof ra.charAt&&"<"!=ra.charAt(0))try{Editor.isPngDataUrl(ra)?ra=Editor.extractGraphModelFromPng(ra):"data:image/svg+xml;base64,"==ra.substring(0,26)?ra=atob(ra.substring(26)):"data:image/svg+xml;utf8,"==ra.substring(0,24)&&(ra=ra.substring(24)),null!=ra&&(""==ra.trim()?ra=null:"%"==ra.charAt(0)?ra=decodeURIComponent(ra):"<"!=ra.charAt(0)&&(ra=Graph.decompress(ra)))}catch(Ca){}return ra});if("json"==urlParams.proto){var ca=
!1;try{K=JSON.parse(K),EditorUi.debug("EditorUi.installMessageHandler",[this],"evt",[L],"data",[K])}catch(ra){K=null}try{if(null==K)return;if("dialog"==K.action){this.showError(null!=K.titleKey?mxResources.get(K.titleKey):K.title,null!=K.messageKey?mxResources.get(K.messageKey):mxUtils.htmlEntities(K.message),null!=K.buttonKey?mxResources.get(K.buttonKey):K.button);null!=K.modified&&(this.editor.modified=K.modified);return}if("layout"==K.action){this.executeLayouts(this.editor.graph.createLayouts(K.layouts));
return}if("prompt"==K.action){this.spinner.stop();var ba=new FilenameDialog(this,K.defaultValue||"",null!=K.okKey?mxResources.get(K.okKey):K.ok,function(ra){null!=ra?I.postMessage(JSON.stringify({event:"prompt",value:ra,message:K}),"*"):I.postMessage(JSON.stringify({event:"prompt-cancel",message:K}),"*")},null!=K.titleKey?mxResources.get(K.titleKey):K.title,null,null,null,null,function(){I.postMessage(JSON.stringify({event:"prompt-cancel",message:K}),"*")});this.showDialog(ba.container,300,80,!0,
!1);ba.init();return}if("draft"==K.action){var oa=ja(K.xml);this.spinner.stop();ba=new DraftDialog(this,mxResources.get("draftFound",[K.name||this.defaultFilename]),oa,mxUtils.bind(this,function(){this.hideDialog();I.postMessage(JSON.stringify({event:"draft",result:"edit",message:K}),"*")}),mxUtils.bind(this,function(){this.hideDialog();I.postMessage(JSON.stringify({event:"draft",result:"discard",message:K}),"*")}),K.editKey?mxResources.get(K.editKey):null,K.discardKey?mxResources.get(K.discardKey):
null,K.ignore?mxUtils.bind(this,function(){this.hideDialog();I.postMessage(JSON.stringify({event:"draft",result:"ignore",message:K}),"*")}):null);this.showDialog(ba.container,640,480,!0,!1,mxUtils.bind(this,function(ra){ra&&this.actions.get("exit").funct()}));try{ba.init()}catch(ra){I.postMessage(JSON.stringify({event:"draft",error:ra.toString(),message:K}),"*")}return}if("template"==K.action){this.spinner.stop();var Y=1==K.enableRecent,da=1==K.enableSearch,ha=1==K.enableCustomTemp;ba=new NewDialog(this,
!1,K.templatesOnly?!1:null!=K.callback,mxUtils.bind(this,function(ra,Ca,Da,va){ra=ra||this.emptyDiagramXml;null!=K.callback?I.postMessage(JSON.stringify({event:"template",xml:ra,blank:ra==this.emptyDiagramXml,name:Ca,tempUrl:Da,libs:va,builtIn:!0,message:K}),"*"):(c(ra,L,ra!=this.emptyDiagramXml,K.toSketch),this.editor.modified||this.clearStatus())}),null,null,null,null,null,null,null,Y?mxUtils.bind(this,function(ra){this.remoteInvoke("getRecentDiagrams",[null],null,ra,function(){ra(null,"Network Error!")})}):
null,da?mxUtils.bind(this,function(ra,Ca){this.remoteInvoke("searchDiagrams",[ra,null],null,Ca,function(){Ca(null,"Network Error!")})}):null,mxUtils.bind(this,function(ra,Ca,Da){I.postMessage(JSON.stringify({event:"template",docUrl:ra,info:Ca,name:Da}),"*")}),null,null,ha?mxUtils.bind(this,function(ra){this.remoteInvoke("getCustomTemplates",null,null,ra,function(){ra({},0)})}):null,1==K.withoutType,null,K.templatesOnly);this.showDialog(ba.container,620,460,!0,!1,mxUtils.bind(this,function(ra){null!=
this.sidebar&&this.sidebar.hideTooltip();ra&&this.actions.get("exit").funct()}));ba.init();return}if("textContent"==K.action){var Z=this.getDiagramTextContent();I.postMessage(JSON.stringify({event:"textContent",data:Z,message:K}),"*");return}if("status"==K.action){this.updateStatus(mxUtils.bind(this,function(){null!=K.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(K.messageKey))):null!=K.message&&this.editor.setStatus(mxUtils.htmlEntities(K.message))}));null!=K.modified&&(this.editor.modified=
K.modified);return}if("spinner"==K.action){var k=null!=K.messageKey?mxResources.get(K.messageKey):K.message;null==K.show||K.show?this.spinner.spin(document.body,k):this.spinner.stop();return}if("exit"==K.action){this.actions.get("exit").funct();return}if("viewport"==K.action){if(null!=K.viewport){var v=this.editor.graph,J=v.view.translate.x,N=v.view.translate.y;this.embedViewport=K.viewport;v.refresh();this.diagramContainer.scrollTop-=(N-v.view.translate.y)*v.view.scale;this.diagramContainer.scrollLeft-=
(J-v.view.translate.x)*v.view.scale;this.fireEvent(new mxEventObject("embedViewportChanged"))}return}if("fullscreenChanged"==K.action){ba=null;try{var T=this.diagramContainer.getAttribute("data-scrollState");null!=T&&(this.diagramContainer.removeAttribute("data-scrollState"),ba=JSON.parse(T))}catch(ra){}Editor.inlineFullscreen=K.value;this.fireEvent(new mxEventObject("inlineFullscreenChanged"));null!=ba&&this.restoreScrollState(ba);return}if("snapshot"==K.action){this.sendEmbeddedSvgExport(!0);return}if("export"==
K.action){if("png"==K.format||"xmlpng"==K.format){if(null==K.spin&&null==K.spinKey||this.spinner.spin(document.body,null!=K.spinKey?mxResources.get(K.spinKey):K.spin)){var V=null!=K.xml?K.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);v=this.editor.graph;var U=mxUtils.bind(this,function(ra,Ca){if(K.withSvg)K.withSvg=!1,this.getEmbeddedSvg(V,this.editor.graph,null,!0,function(va){U(ra,va)},null,null,K.embedImages,this.editor.graph.background,K.scale,K.border,K.shadow,"auto");else{this.editor.graph.setEnabled(!0);
this.spinner.stop();var Da=this.createLoadMessage("export");Da.format=K.format;Da.message=K;Da.data=ra;Da.svg=Ca;Da.xml=V;I.postMessage(JSON.stringify(Da),"*")}}),X=mxUtils.bind(this,function(ra){null==ra&&(ra=Editor.blankImage);"xmlpng"==K.format&&(ra=Editor.writeGraphModelToPng(ra,"tEXt","mxfile",encodeURIComponent(V)));v!=this.editor.graph&&v.container.parentNode.removeChild(v.container);U(ra)}),fa=K.pageId||(null!=this.pages?K.currentPage?this.currentPage.getId():this.pages[0].getId():null);if(this.editor.isExportToCanvas()){var na=
mxUtils.bind(this,function(){if(null!=this.pages&&this.currentPage.getId()!=fa){var ra=v.getGlobalVariable;v=this.createTemporaryGraph(v.getStylesheet());for(var Ca,Da=0;Da<this.pages.length;Da++)if(this.pages[Da].getId()==fa){Ca=this.updatePageRoot(this.pages[Da]);break}null==Ca&&(Ca=this.currentPage);v.getGlobalVariable=function(Qa){return"page"==Qa?Ca.getName():"pagenumber"==Qa?1:ra.apply(this,arguments)};document.body.appendChild(v.container);v.model.setRoot(Ca.root)}if(null!=K.layerIds){var va=
v.model,Na=va.getChildCells(va.getRoot()),Oa={};for(Da=0;Da<K.layerIds.length;Da++)Oa[K.layerIds[Da]]=!0;for(Da=0;Da<Na.length;Da++)va.setVisible(Na[Da],Oa[Na[Da].id]||!1)}Da=null;K.keepTheme&&(Da=Editor.isDarkMode()?"dark":"light");this.editor.exportToCanvas(mxUtils.bind(this,function(Qa){X(Qa.toDataURL("image/png"))}),K.width,null,K.background,mxUtils.bind(this,function(){X(null)}),null,null,K.scale,K.transparent,K.shadow,null,v,K.border,null,K.grid,Da)});null!=K.xml&&0<K.xml.length&&(m=!0,this.setFileData(V),
m=!1);na()}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==K.format?"1":"0")+(null!=fa?"&pageId="+fa:"")+(null!=K.layerIds&&0<K.layerIds.length?"&extras="+encodeURIComponent(JSON.stringify({layerIds:K.layerIds})):"")+(null!=K.scale?"&scale="+K.scale:"")+"&base64=1&xml="+encodeURIComponent(V))).send(mxUtils.bind(this,function(ra){200<=ra.getStatus()&&299>=ra.getStatus()?U("data:image/png;base64,"+ra.getText()):X(null)}),mxUtils.bind(this,function(){X(null)}))}}else if(na=mxUtils.bind(this,
function(){var ra=this.createLoadMessage("export");ra.message=K;if("html2"==K.format||"html"==K.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var Ca=this.getXmlFileData();ra.xml=mxUtils.getXml(Ca);ra.data=this.getFileData(null,null,!0,null,null,null,Ca);ra.format=K.format}else if("html"==K.format)Ca=this.editor.getGraphXml(),ra.data=this.getHtml(Ca,this.editor.graph),ra.xml=mxUtils.getXml(Ca),ra.format=K.format;else{mxSvgCanvas2D.prototype.foAltText=null;Ca=null!=K.background?
K.background:this.editor.graph.background;Ca==mxConstants.NONE&&(Ca=null);ra.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);ra.format="svg";var Da=mxUtils.bind(this,function(Na){this.editor.graph.setEnabled(!0);this.spinner.stop();ra.data=K.asText?Na:Editor.createSvgDataUri(Na);I.postMessage(JSON.stringify(ra),"*")}),va="auto";K.keepTheme&&(va=Editor.isDarkMode()?"dark":"light");null!=K.theme&&(va=K.theme);if("xmlsvg"==K.format){if(null==K.spin&&null==K.spinKey||this.spinner.spin(document.body,
null!=K.spinKey?mxResources.get(K.spinKey):K.spin)){va=null;if(this.isAutoDarkMode()||Editor.isDarkMode())va="auto";null!=K.theme&&(va=K.theme);this.getEmbeddedSvg(ra.xml,this.editor.graph,null,!0,Da,null,null,K.embedImages,Ca,K.scale,K.border,K.shadow,va)}}else if(null==K.spin&&null==K.spinKey||this.spinner.spin(document.body,null!=K.spinKey?mxResources.get(K.spinKey):K.spin))this.editor.graph.setEnabled(!1),Ca=this.editor.graph.getSvg(Ca,K.scale,K.border,null,null,null,null,null,null,this.editor.graph.shadowVisible||
K.shadow,null,va),(this.editor.graph.shadowVisible||K.shadow)&&this.editor.graph.addSvgShadow(Ca),this.embedFonts(Ca,mxUtils.bind(this,function(Na){K.embedImages||null==K.embedImages?this.editor.convertImages(Na,mxUtils.bind(this,function(Oa){Da(mxUtils.getXml(Oa))})):Da(mxUtils.getXml(Na))}));return}I.postMessage(JSON.stringify(ra),"*")}),null!=K.xml&&0<K.xml.length){if(this.editor.graph.mathEnabled){var la=Editor.onMathJaxDone;Editor.onMathJaxDone=function(){la.apply(this,arguments);na()}}m=!0;
this.setFileData(K.xml);m=!1;this.editor.graph.mathEnabled||na()}else na();return}if("load"==K.action){ca=K.toSketch;n=1==K.autosave;this.hideDialog();null!=K.modified&&null==urlParams.modified&&(urlParams.modified=K.modified);null!=K.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=K.saveAndExit);if("1"==urlParams.saveAndExit||"1"==urlParams.publishClose)if(this.actions.get("save").shortcut=null,!this.editor.chromeless||this.editor.editable)this.keyHandler.bindAction(83,!0,"saveAndExit"),
"1"!=urlParams.noSaveBtn&&(this.actions.get("save").shortcut=Editor.ctrlKey+"+"+Editor.shiftKey+"+S",this.keyHandler.bindAction(83,!0,"save",!0));null!=K.noSaveBtn&&null==urlParams.noSaveBtn&&(urlParams.noSaveBtn=K.noSaveBtn);if(null!=K.rough){var qa=Editor.sketchMode;this.doSetSketchMode(K.rough);qa!=Editor.sketchMode&&this.fireEvent(new mxEventObject("sketchModeChanged"))}null!=K.dark&&this.setDarkMode(K.dark);null!=K.border&&(this.embedExportBorder=K.border);null!=K.theme&&(this.embedExportTheme=
K.theme);null!=K.background&&(this.embedExportBackground=K.background);null!=K.viewport&&(this.embedViewport=K.viewport);this.embedExitPoint=null;if(null!=K.rect){var ya=this.embedExportBorder;this.diagramContainer.style.left=Math.max(60,K.rect.left)+"px";this.diagramContainer.style.top=Math.max(40,K.rect.top)+"px";this.minInlineWidth=K.minWidth;this.minInlineHeight=K.minHeight;this.diagramContainer.style.border="2px solid #295fcc";this.diagramContainer.style.bottom="";this.diagramContainer.style.right=
"";var wa=K.maxFitScale,Ja=K.rect.width+2*ya,Aa=K.rect.height+2*ya;aa=mxUtils.bind(this,function(){var ra=mxUtils.getDocumentSize();Ja=Math.min(null!=this.minInlineWidth?Math.max(this.minInlineWidth,Ja):Ja,ra.width-80);ra=Math.min(null!=this.minInlineHeight?Math.max(this.minInlineHeight,Aa):Aa,ra.height-80);this.diagramContainer.style.width=Ja+"px";this.diagramContainer.style.height=ra+"px";var Ca=this.editor.graph;ra=Ca.maxFitScale;Ca.maxFitScale=wa;Ca.fit(2*ya,null,null,null,null,null,Aa);this.setPageVisible(!1);
if(null!=this.minInlineWidth&&Ca.getGraphBounds().width<this.minInlineWidth){var Da=Ca.container.scrollTop;this.resetScrollbars();Ca.container.scrollTop=Da}Ca.maxFitScale=ra;Ca.container.scrollTop-=ya;Ca.container.scrollLeft-=ya;window.setTimeout(mxUtils.bind(this,function(){this.fireEvent(new mxEventObject("editInlineStart","data",[K]));Ca.container.focus();null!=this.formatWindow&&null!=this.formatWindow.window&&this.formatWindow.window.isVisible()&&(this.formatWindow.window.div.style.top=Ca.container.style.top);
var va=Ca.getGraphBounds();Ca.container.clientWidth>va.width+2*ya&&(Ca.container.scrollLeft=va.x+(va.width+ya-Ca.container.clientWidth)/2)}),10)})}null!=K.noExitBtn&&null==urlParams.noExitBtn&&(urlParams.noExitBtn=K.noExitBtn);null!=K.title&&null!=this.buttonContainer&&this.setEmbedTitle(K.title);try{K.libs&&this.sidebar.showEntries(K.libs)}catch(ra){}K=null!=K.xmlpng?this.extractGraphModelFromPng(K.xmlpng):null!=K.descriptor?K.descriptor:K.xml}else{if("merge"==K.action){var Ba=this.getCurrentFile();
null!=Ba&&(oa=ja(K.xml),null!=oa&&""!=oa&&Ba.mergeFile(new LocalFile(this,oa),function(){I.postMessage(JSON.stringify({event:"merge",message:K}),"*")},function(ra){I.postMessage(JSON.stringify({event:"merge",message:K,error:ra}),"*")}))}else"remoteInvokeReady"==K.action?this.handleRemoteInvokeReady(I):"remoteInvoke"==K.action?this.handleRemoteInvoke(K,L.origin):"remoteInvokeResponse"==K.action?this.handleRemoteInvokeResponse(K):I.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(K)}),
"*");return}}catch(ra){this.handleError(ra)}}var Ga=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())}),Ma=mxUtils.bind(this,function(ra,Ca){m=!0;try{c(ra,Ca,null,ca)}catch(Da){this.handleError(Da)}m=!1;null!=urlParams.modified&&this.clearStatus();x=Ga();n&&null==g&&(g=mxUtils.bind(this,function(Da,va){Da=Ga();Da==x||m||(va=this.createLoadMessage("autosave"),va.xml=Da,(window.opener||window.parent).postMessage(JSON.stringify(va),
"*"));x=Da}),this.editor.graph.model.addListener(mxEvent.CHANGE,g),this.editor.graph.addListener("gridSizeChanged",g),this.editor.graph.addListener("shadowVisibleChanged",g),this.addListener("pageFormatChanged",g),this.addListener("pageScaleChanged",g),this.addListener("backgroundColorChanged",g),this.addListener("backgroundImageChanged",g),this.addListener("foldingEnabledChanged",g),this.addListener("mathEnabledChanged",g),this.addListener("gridEnabledChanged",g),this.addListener("guidesEnabledChanged",
g),this.addListener("pageViewChanged",g));if("1"==urlParams.returnbounds||"json"==urlParams.proto)Ca=this.createLoadMessage("load"),Ca.xml=ra,I.postMessage(JSON.stringify(Ca),"*");null!=aa&&aa()});null!=K&&"function"===typeof K.substring&&"data:application/vnd.visio;base64,"==K.substring(0,34)?(ja="0M8R4KGxGuE"==K.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(K.substring(K.indexOf(",")+1)),function(ra){Ma(ra,L)},mxUtils.bind(this,function(ra){this.handleError(ra)}),ja)):
null!=K&&"function"===typeof K.substring&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(K,"")?this.isOffline()?this.showError(mxResources.get("error"),mxResources.get("notInOffline")):this.parseFileData(K,mxUtils.bind(this,function(ra){4==ra.readyState&&(200<=ra.status&&299>=ra.status&&"<mxGraphModel"==ra.responseText.substring(0,13)?Ma(ra.responseText,L):this.handleError({message:413==ra.status?mxResources.get("diagramTooLarge"):mxResources.get("unknownError")}))}),""):null!=K&&"function"===
typeof K.substring&&this.isLucidChartData(K)?this.convertLucidChart(K,mxUtils.bind(this,function(ra){Ma(ra)}),mxUtils.bind(this,function(ra){this.handleError(ra)})):null==K||"object"!==typeof K||null==K.format||null==K.data&&null==K.url?(K=ja(K),Ma(K,L)):this.loadDescriptor(K,mxUtils.bind(this,function(ra){Ma(Ga(),L)}),mxUtils.bind(this,function(ra){this.handleError(ra,mxResources.get("errorLoadingFile"))}))}}));var I=window.opener||window.parent;F="json"==urlParams.proto?JSON.stringify({event:"init"}):
urlParams.ready||"ready";I.postMessage(F,"*");if("json"==urlParams.proto){var M=this.editor.graph.openLink;this.editor.graph.openLink=function(L,K,aa){M.apply(this,arguments);I.postMessage(JSON.stringify({event:"openLink",href:L,target:K,allowOpener:aa}),"*")}}};EditorUi.prototype.createEmbedButton=function(c,g,m,n){var x=document.createElement("button");x.className="geEmbedBtn geBtn";x.setAttribute("title",c+(null!=m?" ("+m+")":""));mxUtils.write(x,c);n&&x.classList.add("gePrimaryBtn");mxEvent.addListener(x,
"click",g);return x};EditorUi.prototype.setEmbedTitle=function(c){c=this.createStatusDiv(c);null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan);"kennedy"==Editor.currentTheme||"atlas"==Editor.currentTheme?this.menubarContainer.appendChild(c):this.buttonContainer.appendChild(c);this.embedFilenameSpan=c};EditorUi.prototype.addEmbedButtons=function(){this.dependsOnLanguage(mxUtils.bind(this,function(){var c=null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode==
this.buttonContainer;this.buttonContainer.innerText="";c&&this.buttonContainer.appendChild(this.embedFilenameSpan);this.commentsSupported()&&null!=this.commentButton&&this.buttonContainer.appendChild(this.commentButton);"1"==urlParams.noSaveBtn?"0"!=urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("publish"):mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S",!0)):(this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("save"),
mxUtils.bind(this,function(){this.actions.get("save").funct(!1)}),"1"==urlParams.saveAndExit?Editor.ctrlKey+"+"+Editor.shiftKey+"+S":Editor.ctrlKey+"+S",!0)),"1"==urlParams.saveAndExit&&this.buttonContainer.appendChild(this.createEmbedButton(mxResources.get("saveAndExit"),this.actions.get("saveAndExit").funct,Editor.ctrlKey+"+S")));"1"!=urlParams.noExitBtn&&this.buttonContainer.appendChild(this.createEmbedButton("1"==urlParams.publishClose?mxResources.get("close"):mxResources.get("exit"),this.actions.get("exit").funct))}))};
EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(c){this.importCsv(c)}),null,null,620,430,null,!0,!0,mxResources.get("import"),this.isOffline()?null:"https://drawio-app.com/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.showCustomLayoutDialog=
function(c){this.loadOrgChartLayouts(mxUtils.bind(this,function(){var g=new TextareaDialog(this,mxResources.get("layout"),c,mxUtils.bind(this,function(m){if(0<m.length)try{var n=JSON.parse(m);this.executeLayouts(this.editor.graph.createLayouts(n));this.customLayoutConfig=n;this.hideDialog()}catch(x){this.handleError(x)}}),null,null,null,null,mxUtils.bind(this,function(m,n){var x=mxUtils.button(mxResources.get("copy"),mxUtils.bind(this,function(){try{var F=n.value;n.value=JSON.stringify(JSON.parse(F));
n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?n.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");this.alert(mxResources.get("copiedToClipboard"));n.value=F}catch(I){this.handleError(I)}}));x.setAttribute("title","copy");x.className="geBtn";m.appendChild(x)}),!0,null,null,"https://www.drawio.com/doc/faq/apply-layouts");this.showDialog(g.container,620,460,!0,!0);g.init()}))};EditorUi.prototype.loadOrgChartLayouts=function(c){this.createTimeout(null,
mxUtils.bind(this,function(g){var m=mxUtils.bind(this,function(){this.loadingOrgChart=!1;g.clear()&&(Graph.layoutNames.push("mxOrgChartLayout"),this.spinner.stop(),c())}),n=mxUtils.bind(this,function(x){this.loadingOrgChart=!1;g.clear()&&this.handleError(x)});"undefined"!==typeof mxOrgChartLayout||this.loadingOrgChart||this.isOffline(!0)?m():this.spinner.spin(document.body,mxResources.get("loading"))&&(this.loadingOrgChart=!0,"1"==urlParams.dev?mxscript("js/orgchart/bridge.min.js",function(){mxscript("js/orgchart/bridge.collections.min.js",
function(){mxscript("js/orgchart/OrgChart.Layout.min.js",function(){mxscript("js/orgchart/mxOrgChartLayout.js",m,null,null,null,n)},null,null,null,n)},null,null,null,n)},null,null,null,n):mxscript(window.DRAWIO_SERVER_URL+"js/orgchart.min.js",m,null,null,null,n))}),onerror)};EditorUi.prototype.importCsv=function(c,g){this.loadOrgChartLayouts(mxUtils.bind(this,function(){this.doImportCsv(c,g)}))};EditorUi.prototype.doImportCsv=function(c,g){try{var m=c.split("\n"),n=[],x=[],F=[],I={};if(0<m.length){var M=
{},L=this.editor.graph,K=null,aa=null,ja=null,ca=null,ba=null,oa=null,Y=null,da="whiteSpace=wrap;html=1;",ha=null,Z=null,k="",v="auto",J="auto",N=!1,T=null,V=null,U=40,X=40,fa=100,na=0,la=mxUtils.bind(this,function(){null!=g?g(ta):(L.setSelectionCells(ta),L.scrollCellToVisible(L.getSelectionCell()));null!=this.chromelessResize&&window.setTimeout(mxUtils.bind(this,function(){this.chromelessResize(!0)}),0)}),qa=L.getFreeInsertPoint(),ya=qa.x,wa=qa.y;qa=wa;var Ja=null,Aa="auto";Z=null;for(var Ba=[],
Ga=null,Ma=null,ra=0;ra<m.length&&"#"==m[ra].charAt(0);){c=m[ra].replace(/\r$/,"");for(ra++;ra<m.length&&"\\"==c.charAt(c.length-1)&&"#"==m[ra].charAt(0);)c=c.substring(0,c.length-1)+mxUtils.trim(m[ra].substring(1)),ra++;if("#"!=c.charAt(1)){var Ca=c.indexOf(":");if(0<Ca){var Da=mxUtils.trim(c.substring(1,Ca)),va=mxUtils.trim(c.substring(Ca+1));"label"==Da?Ja=Graph.sanitizeHtml(va):"labelname"==Da&&0<va.length&&"-"!=va?ba=va:"labels"==Da&&0<va.length&&"-"!=va?Y=JSON.parse(va):"style"==Da?aa=va:"parentstyle"==
Da?da=va:"unknownStyle"==Da&&"-"!=va?oa=va:"stylename"==Da&&0<va.length&&"-"!=va?ca=va:"styles"==Da&&0<va.length&&"-"!=va?ja=JSON.parse(va):"vars"==Da&&0<va.length&&"-"!=va?K=JSON.parse(va):"identity"==Da&&0<va.length&&"-"!=va?ha=va:"parent"==Da&&0<va.length&&"-"!=va?Z=va:"namespace"==Da&&0<va.length&&"-"!=va?k=va:"width"==Da?v=va:"height"==Da?J=va:"collapsed"==Da&&"-"!=va?N="true"==va:"left"==Da&&0<va.length?T=va:"top"==Da&&0<va.length?V=va:"ignore"==Da?Ma=va.split(","):"connect"==Da?Ba.push(JSON.parse(va)):
"link"==Da?Ga=va:"padding"==Da?na=parseFloat(va):"edgespacing"==Da?U=parseFloat(va):"nodespacing"==Da?X=parseFloat(va):"levelspacing"==Da?fa=parseFloat(va):"layout"==Da&&(Aa=va)}}}if(null==m[ra])throw Error(mxResources.get("invalidOrMissingFile"));var Na=this.editor.csvToArray(m[ra].replace(/\r$/,""));Ca=c=null;Da=[];for(va=0;va<Na.length;va++)ha==Na[va]&&(c=va),Z==Na[va]&&(Ca=va),Da.push(mxUtils.trim(Na[va]).replace(/[^a-z0-9]+/ig,"_").replace(/^\d+/,"").replace(/_+$/,""));null==Ja&&(Ja="%"+Da[0]+
"%");if(null!=Ba)for(var Oa=0;Oa<Ba.length;Oa++)null==M[Ba[Oa].to]&&(M[Ba[Oa].to]={});ha=[];for(va=ra+1;va<m.length;va++){var Qa=this.editor.csvToArray(m[va].replace(/\r$/,""));if(null==Qa){var Ra=40<m[va].length?m[va].substring(0,40)+"...":m[va];throw Error(Ra+" ("+va+"):\n"+mxResources.get("containsValidationErrors"));}0<Qa.length&&ha.push(Qa)}L.model.beginUpdate();try{for(va=0;va<ha.length;va++){Qa=ha[va];var za=null,Ea=null!=c?k+Qa[c]:null;m=!1;null!=Ea&&(za=L.model.getCell(Ea),m=null==za||0<=
mxUtils.indexOf(n,za));var C=new mxCell(Ja,new mxGeometry(ya,qa,0,0),aa||"whiteSpace=wrap;html=1;");C.collapsed=N;C.vertex=!0;C.id=Ea;null==za||m||L.model.setCollapsed(za,N);for(var P=0;P<Qa.length;P++)L.setAttributeForCell(C,Da[P],Qa[P]),null==za||m||L.setAttributeForCell(za,Da[P],Qa[P]);if(null!=ba&&null!=Y){var R=Y[C.getAttribute(ba)];null!=R&&(L.labelChanged(C,R),null==za||m||L.cellLabelChanged(za,R))}if(null!=ca&&null!=ja){var W=ja[C.getAttribute(ca)];null!=W&&(C.style=W)}L.setAttributeForCell(C,
"placeholders","1");C.style=L.replacePlaceholders(C,C.style,K);null==za||m?L.fireEvent(new mxEventObject("cellsInserted","cells",[C])):(L.model.setStyle(za,C.style),0>mxUtils.indexOf(F,za)&&F.push(za),L.fireEvent(new mxEventObject("cellsInserted","cells",[za])));m=null!=za;za=C;if(!m)for(Oa=0;Oa<Ba.length;Oa++)M[Ba[Oa].to][za.getAttribute(Ba[Oa].to)]=za;null!=Ga&&"link"!=Ga&&(L.setLinkForCell(za,za.getAttribute(Ga)),L.setAttributeForCell(za,Ga,null));var ia=this.editor.graph.getPreferredSizeForCell(za);
Z=null!=Ca?L.model.getCell(k+Qa[Ca]):null;if(za.vertex){Ra=null!=Z?0:ya;ra=null!=Z?0:wa;null!=T&&null!=za.getAttribute(T)&&(za.geometry.x=Ra+parseFloat(za.getAttribute(T)));null!=V&&null!=za.getAttribute(V)&&(za.geometry.y=ra+parseFloat(za.getAttribute(V)));var ka="@"==v.charAt(0)?za.getAttribute(v.substring(1)):null;za.geometry.width=null!=ka&&"auto"!=ka?parseFloat(za.getAttribute(v.substring(1))):"auto"==v||"auto"==ka?ia.width+na:parseFloat(v);var pa="@"==J.charAt(0)?za.getAttribute(J.substring(1)):
null;za.geometry.height=null!=pa&&"auto"!=pa&&"width"!=J?parseFloat(pa):"auto"==J||"auto"==pa?ia.height+na:"width"==J?za.geometry.width:parseFloat(J);qa+=za.geometry.height+X}m?(null==I[Ea]&&(I[Ea]=[]),I[Ea].push(za)):(n.push(za),null!=Z?(Z.style=L.replacePlaceholders(Z,da,K),L.addCell(za,Z),x.push(Z)):F.push(L.addCell(za)))}for(va=0;va<x.length;va++)ka="@"==v.charAt(0)?x[va].getAttribute(v.substring(1)):null,pa="@"==J.charAt(0)?x[va].getAttribute(J.substring(1)):null,"auto"!=v&&"auto"!=ka||"auto"!=
J&&"auto"!=pa||L.updateGroupBounds([x[va]],na,!0);var xa=F.slice(),ta=F.slice();for(Oa=0;Oa<Ba.length;Oa++){var ua=Ba[Oa];for(va=0;va<n.length;va++){za=n[va];var Ia=mxUtils.bind(this,function(kb,ob,hb){var pb=ob.getAttribute(hb.from);if(null!=pb&&""!=pb){pb=pb.split(",");for(var sb=0;sb<pb.length;sb++){var ib=M[hb.to][pb[sb]];if(null==ib&&null!=oa){ib=new mxCell(pb[sb],new mxGeometry(ya,wa,0,0),oa);ib.style=L.replacePlaceholders(ob,ib.style,K);var mb=this.editor.graph.getPreferredSizeForCell(ib);
ib.geometry.width=mb.width+na;ib.geometry.height=mb.height+na;M[hb.to][pb[sb]]=ib;ib.vertex=!0;ib.id=pb[sb];F.push(L.addCell(ib))}if(null!=ib){mb=hb.label;null!=hb.fromlabel&&(mb=(ob.getAttribute(hb.fromlabel)||"")+(mb||""));null!=hb.sourcelabel&&(mb=L.replacePlaceholders(ob,hb.sourcelabel,K)+(mb||""));null!=hb.tolabel&&(mb=(mb||"")+(ib.getAttribute(hb.tolabel)||""));null!=hb.targetlabel&&(mb=(mb||"")+L.replacePlaceholders(ib,hb.targetlabel,K));var nb="target"==hb.placeholders==!hb.invert?ib:kb;nb=
null!=hb.style?L.replacePlaceholders(nb,hb.style,K):L.createCurrentEdgeStyle();mb=L.insertEdge(null,null,mb||"",hb.invert?ib:kb,hb.invert?kb:ib,nb);if(null!=hb.labels)for(nb=0;nb<hb.labels.length;nb++){var qb=hb.labels[nb],ub=new mxCell(qb.label||nb,new mxGeometry(null!=qb.x?qb.x:0,null!=qb.y?qb.y:0,0,0),"resizable=0;html=1;");ub.vertex=!0;ub.connectable=!1;ub.geometry.relative=!0;null!=qb.placeholders&&(ub.value=L.replacePlaceholders("target"==qb.placeholders==!hb.invert?ib:kb,ub.value,K));if(null!=
qb.dx||null!=qb.dy)ub.geometry.offset=new mxPoint(null!=qb.dx?qb.dx:0,null!=qb.dy?qb.dy:0);mb.insert(ub)}if(null!=hb.data)for(var zb in hb.data)L.setAttributeForCell(mb,zb,hb.data[zb]);ta.push(mb);mxUtils.remove(hb.invert?kb:ib,xa)}}}});Ia(za,za,ua);if(null!=I[za.id])for(P=0;P<I[za.id].length;P++)Ia(za,I[za.id][P],ua)}}if(null!=Ma)for(va=0;va<n.length;va++)for(za=n[va],P=0;P<Ma.length;P++)L.setAttributeForCell(za,mxUtils.trim(Ma[P]),null);if(0<F.length){var Va=new mxParallelEdgeLayout(L);Va.spacing=
U;Va.checkOverlap=!0;var Wa=function(){0<Va.spacing&&Va.execute(L.getDefaultParent());for(var kb=0;kb<F.length;kb++){var ob=L.getCellGeometry(F[kb]);ob.x=Math.round(L.snap(ob.x));ob.y=Math.round(L.snap(ob.y));"auto"==v&&(ob.width=Math.round(L.snap(ob.width)));"auto"==J&&(ob.height=Math.round(L.snap(ob.height)))}};if("["==Aa.charAt(0)){var Ta=la;L.view.validate();this.executeLayouts(L.createLayouts(JSON.parse(Aa)),function(){Wa();Ta()});la=null}else if("circle"==Aa){var ab=new mxCircleLayout(L);ab.disableEdgeStyle=
!1;ab.resetEdges=!1;var Pa=ab.isVertexIgnored;ab.isVertexIgnored=function(kb){return Pa.apply(this,arguments)||0>mxUtils.indexOf(F,kb)};this.executeLayout(function(){ab.execute(L.getDefaultParent());Wa()},!0,la);la=null}else if("horizontaltree"==Aa||"verticaltree"==Aa||"auto"==Aa&&ta.length==2*F.length-1&&1==xa.length){L.view.validate();var Sa=new mxCompactTreeLayout(L,"horizontaltree"==Aa);Sa.levelDistance=X;Sa.edgeRouting=!1;Sa.resetEdges=!1;Sa.sortEdges=!0;this.executeLayout(function(){Sa.execute(L.getDefaultParent(),
0<xa.length?xa[0]:null)},!0,la);la=null}else if("horizontalflow"==Aa||"verticalflow"==Aa||"auto"==Aa&&1==xa.length){L.view.validate();var gb=new mxHierarchicalLayout(L,"horizontalflow"==Aa?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH);gb.intraCellSpacing=X;gb.parallelEdgeSpacing=U;gb.interRankCellSpacing=fa;gb.disableEdgeStyle=!1;this.executeLayout(function(){gb.execute(L.getDefaultParent(),ta);L.moveCells(ta,ya,wa)},!0,la);la=null}else if("orgchart"==Aa){L.view.validate();var fb=new mxOrgChartLayout(L,
2,fa,X),cb=fb.isVertexIgnored;fb.isVertexIgnored=function(kb){return cb.apply(this,arguments)||0>mxUtils.indexOf(F,kb)};this.executeLayout(function(){fb.execute(L.getDefaultParent());Wa()},!0,la);la=null}else if("organic"==Aa||"auto"==Aa&&ta.length>F.length){L.view.validate();var eb=new mxFastOrganicLayout(L);eb.forceConstant=3*X;eb.disableEdgeStyle=!1;eb.resetEdges=!1;var lb=eb.isVertexIgnored;eb.isVertexIgnored=function(kb){return lb.apply(this,arguments)||0>mxUtils.indexOf(F,kb)};this.executeLayout(function(){eb.execute(L.getDefaultParent());
Wa()},!0,la);la=null}}this.hideDialog()}finally{L.model.endUpdate()}null!=la&&la()}}catch(kb){this.handleError(kb)}};EditorUi.prototype.getSearch=function(c){var g="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=c&&0<window.location.search.length){var m="?",n;for(n in urlParams)0>mxUtils.indexOf(c,n)&&null!=urlParams[n]&&(g+=m+n+"="+urlParams[n],m="&")}else g=window.location.search;return g};EditorUi.prototype.getUrl=function(c){c=null!=c?c:window.location.pathname;var g=0<c.indexOf("?")?
1:0;if("1"==urlParams.offline)c+=window.location.search;else{var m="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),n;for(n in urlParams)0>mxUtils.indexOf(m,n)&&(c=0==g?c+"?":c+"&",null!=urlParams[n]&&(c+=n+"="+urlParams[n],g++))}return c};EditorUi.prototype.showLinkDialog=function(c,g,m,n,x){c=new LinkDialog(this,c,g,m,!0,n,x);this.showDialog(c.container,440,120,!0,!0);c.init()};EditorUi.prototype.getServiceCount=function(c){var g=1;null==this.drive&&
"function"!==typeof window.DriveClient||g++;null==this.dropbox&&"function"!==typeof window.DropboxClient||g++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||g++;null!=this.gitHub&&g++;null!=this.gitLab&&g++;c&&isLocalStorage&&"1"==urlParams.browser&&g++;return g};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var c=this.getCurrentFile(),g=null!=c||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(g);
this.menus.get("viewZoom").setEnabled(g);var m=("1"!=urlParams.embed||"1"==urlParams.embedRT||!this.editor.graph.isEnabled())&&(null==c||c.isRestricted());this.actions.get("makeCopy").setEnabled(!m);this.actions.get("print").setEnabled(!m);this.menus.get("exportAs").setEnabled(!m);this.menus.get("embed").setEnabled(!m);m="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(m);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(m),this.menus.get("newLibrary").setEnabled(m));
c="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=c&&c.isEditable();this.actions.get("image").setEnabled(g);this.actions.get("zoomIn").setEnabled(g);this.actions.get("zoomOut").setEnabled(g);this.actions.get("smartFit").setEnabled(g);this.actions.get("resetView").setEnabled(g);this.menus.get("edit").setEnabled(g);this.menus.get("view").setEnabled(g);this.menus.get("importFrom").setEnabled(c);this.menus.get("arrange").setEnabled(c);this.menus.get("edgeShape").setEnabled(c);this.menus.get("edgeStyle").setEnabled(c);
this.menus.get("appearance").setEnabled(mxUtils.lightDarkColorSupported)};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.scheduleSanityCheck=function(){};EditorUi.prototype.stopSanityCheck=function(){};EditorUi.prototype.isDiagramActive=function(){var c=this.getCurrentFile();return null!=c&&c.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};EditorUi.prototype.restoreOpenLibraries=function(){var c=this.openLibraries;this.openLibraries=null;if(null!=c)for(var g=
0;g<c.length;g++)this.libraryLoaded(c[g].file,c[g].images,c[g].title,null!=c[g].div?"none"!=c[g].div.style.display:c[g].expand)};var E=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){E.apply(this,arguments);var c=this.editor.graph,g=this.getCurrentFile(),m=this.getSelectionState(),n=this.isDiagramActive(),x="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=g&&g.isEditable();this.actions.get("undo").setEnabled(this.canUndo()&&x);this.actions.get("redo").setEnabled(this.canRedo()&&
x);this.actions.get("autosave").setEnabled(null!=g&&g.isEditable()&&g.isAutosaveOptional());this.actions.get("guides").setEnabled(n);this.actions.get("editData").setEnabled(c.isEnabled());this.actions.get("explore").setEnabled(n&&(1==m.edges.length||1==m.vertices.length));this.actions.get("editConnectionPoints").setEnabled(n&&0==m.edges.length&&1==m.vertices.length);this.actions.get("editImage").setEnabled(n&&m.image&&0<m.cells.length);this.actions.get("crop").setEnabled(n&&m.image&&0<m.cells.length);
this.actions.get("pageSetup").setEnabled(n);this.actions.get("shadowVisible").setEnabled(n);this.actions.get("connectionArrows").setEnabled(n);this.actions.get("connectionPoints").setEnabled(n);this.actions.get("copyStyle").setEnabled(n&&!c.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(null!=this.copiedStyle&&n&&0<m.cells.length);this.actions.get("editGeometry").setEnabled(0<m.vertices.length);this.actions.get("addToScratchpad").setEnabled(0<m.cells.length);this.actions.get("createShape").setEnabled(n);
this.actions.get("createRevision").setEnabled(n);this.actions.get("moveToFolder").setEnabled(null!=g);this.actions.get("makeCopy").setEnabled(null!=g&&!g.isRestricted());this.actions.get("editDiagram").setEnabled(n&&(null==g||!g.isRestricted()));this.actions.get("publishLink").setEnabled(null!=g&&!g.isRestricted());this.actions.get("removeFormat").setEnabled(c.isEnabled()&&!c.isSelectionEmpty()&&!c.isEditing());this.actions.get("tags").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("layers").setEnabled("none"!=
this.diagramContainer.style.display);this.actions.get("outline").setEnabled("none"!=this.diagramContainer.style.display);this.actions.get("rename").setEnabled(null!=g&&g.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=g);this.actions.get("properties").setEnabled(null!=g);this.menus.get("publish").setEnabled(null!=g&&!g.isRestricted());g=this.actions.get("findReplace");g.setEnabled("none"!=this.diagramContainer.style.display);g.label=mxResources.get("find")+(c.isEnabled()?
"/"+mxResources.get("replace"):"");c=c.view.getState(c.getSelectionCell());this.actions.get("editShape").setEnabled(n&&null!=c&&null!=c.shape&&null!=c.shape.stencil)};var Q=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);Q.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(c,g,m,n,
x,F,I,M){var L=c.editor.graph;if("xml"==m)c.hideDialog(),c.saveData(g,"xml",mxUtils.getXml(c.editor.getGraphXml()),"text/xml");else if("svg"==m)c.hideDialog(),c.saveData(g,"svg",mxUtils.getXml(L.getSvg(n,x,F)),"image/svg+xml");else{var K=c.getFileData(!0,null,null,null,null,!0),aa=L.getGraphBounds(),ja=Math.floor(aa.width*x/L.view.scale),ca=Math.floor(aa.height*x/L.view.scale);if(K.length<=MAX_REQUEST_SIZE&&ja*ca<MAX_AREA)if(c.hideDialog(),"png"!=m&&"jpg"!=m&&"jpeg"!=m||!c.editor.isExportToCanvas()){var ba=
{globalVars:L.getExportVariables()};M&&(ba.grid={size:L.gridSize,steps:L.view.gridSteps,color:L.view.gridColor});c.saveRequest(g,m,function(oa,Y){return new mxXmlRequest(EXPORT_URL,"format="+m+"&base64="+(Y||"0")+(null!=oa?"&filename="+encodeURIComponent(oa):"")+"&extras="+encodeURIComponent(JSON.stringify(ba))+(0<I?"&dpi="+I:"")+"&bg="+(null!=n?n:"none")+"&w="+ja+"&h="+ca+"&border="+F+"&xml="+encodeURIComponent(K))})}else"png"==m?c.exportImage(x,null==n||"none"==n,!0,!1,!1,F,!0,!1,null,M,I):c.exportImage(x,
!1,!0,!1,!1,F,!0,!1,"jpeg",M);else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var c=this.editor.graph,g="";if(null!=this.pages)for(var m=0;m<this.pages.length;m++){var n=c;this.currentPage!=this.pages[m]&&(n=this.createTemporaryGraph(c.getStylesheet()),this.updatePageRoot(this.pages[m]),n.model.setRoot(this.pages[m].root));g+=this.pages[m].getName()+" "+n.getIndexableText()+" "}else g=c.getIndexableText();
this.editor.graph.setEnabled(!0);return g};EditorUi.prototype.showRemotelyStoredLibrary=function(c){var g={},m=document.createElement("div");m.style.whiteSpace="nowrap";var n=document.createElement("h3");mxUtils.write(n,mxUtils.htmlEntities(c));n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";m.appendChild(n);var x=document.createElement("div");x.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";x.innerHTML='<div style="text-align:center;padding:8px;"><img src="'+
IMAGE_PATH+'/spin.gif"></div>';var F={};try{var I=mxSettings.getCustomLibraries();for(c=0;c<I.length;c++){var M=I[c];if("R"==M.substring(0,1)){var L=JSON.parse(decodeURIComponent(M.substring(1)));F[L[0]]={id:L[0],title:L[1],downloadUrl:L[2]}}}}catch(K){}this.remoteInvoke("getCustomLibraries",null,null,function(K){x.innerText="";if(0==K.length)x.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var aa=0;aa<
K.length;aa++){var ja=K[aa];F[ja.id]&&(g[ja.id]=ja);var ca=this.addCheckbox(x,ja.title,F[ja.id]);(function(ba,oa){mxEvent.addListener(oa,"change",function(){this.checked?g[ba.id]=ba:delete g[ba.id]})})(ja,ca)}},mxUtils.bind(this,function(K){x.innerText="";var aa=document.createElement("div");aa.style.padding="8px";aa.style.textAlign="center";mxUtils.write(aa,mxResources.get("error")+": ");mxUtils.write(aa,null!=K&&null!=K.message?K.message:mxResources.get("unknownError"));x.appendChild(aa)}));m.appendChild(x);
m=new CustomDialog(this,m,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var K=0,aa;for(aa in g)null==F[aa]&&(K++,mxUtils.bind(this,function(ja){this.remoteInvoke("getFileContent",[ja.downloadUrl],null,mxUtils.bind(this,function(ca){K--;0==K&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,ca,ja)),this.showSidebar()}catch(ba){this.handleError(ba,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){K--;0==K&&this.spinner.stop();
this.handleError(null,mxResources.get("errorLoadingFile"))}))})(g[aa]));for(aa in F)g[aa]||this.closeLibrary(new RemoteLibrary(this,null,F[aa]));0==K&&this.spinner.stop()}),null,null,"https://www.drawio.com/doc/faq/custom-libraries-confluence-cloud");this.showDialog(m.container,340,390,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},
setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(c){this.remoteWin=c;for(var g=0;g<this.remoteInvokeQueue.length;g++)c.postMessage(this.remoteInvokeQueue[g],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(c){var g=c.msgMarkers,m=this.remoteInvokeCallbacks[g.callbackId];if(null==m)throw Error("No callback for "+
(null!=g?g.callbackId:"null"));c.error?m.error&&m.error(c.error.errResp):m.callback&&m.callback.apply(this,c.resp);this.remoteInvokeCallbacks[g.callbackId]=null};EditorUi.prototype.remoteInvoke=function(c,g,m,n,x){var F=!0,I=window.setTimeout(mxUtils.bind(this,function(){F=!1;x({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),M=mxUtils.bind(this,function(){window.clearTimeout(I);F&&n.apply(this,arguments)}),L=mxUtils.bind(this,function(){window.clearTimeout(I);F&&x.apply(this,
arguments)});m=m||{};m.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:M,error:L});c=JSON.stringify({event:"remoteInvoke",funtionName:c,functionArgs:g,msgMarkers:m});null!=this.remoteWin?this.remoteWin.postMessage(c,"*"):this.remoteInvokeQueue.push(c)};EditorUi.prototype.handleRemoteInvoke=function(c,g){var m=mxUtils.bind(this,function(K,aa){var ja={event:"remoteInvokeResponse",msgMarkers:c.msgMarkers};null!=aa?ja.error={errResp:aa}:null!=K&&(ja.resp=K);this.remoteWin.postMessage(JSON.stringify(ja),
"*")});try{var n=c.funtionName,x=this.remoteInvokableFns[n];if(null!=x&&"function"===typeof this[n]){if(x.allowedDomains){for(var F=!1,I=0;I<x.allowedDomains.length;I++)if(g=="https://"+x.allowedDomains[I]){F=!0;break}if(!F){m(null,"Invalid Call: "+n+" is not allowed.");return}}var M=c.functionArgs;Array.isArray(M)||(M=[]);if(x.isAsync)M.push(function(){m(Array.prototype.slice.apply(arguments))}),M.push(function(K){m(null,K||"Unkown Error")}),this[n].apply(this,M);else{var L=this[n].apply(this,M);
m([L])}}else m(null,"Invalid Call: "+n+" is not found.")}catch(K){m(null,"Invalid Call: An error occurred, "+K.message)}};EditorUi.prototype.openDatabase=function(c,g){if(null==this.database){var m=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=m)try{var n=m.open("database",2);n.onupgradeneeded=function(x){try{var F=n.result;1>x.oldVersion&&F.createObjectStore("objects",{keyPath:"key"});2>x.oldVersion&&(F.createObjectStore("files",{keyPath:"title"}),F.createObjectStore("filesInfo",
{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(I){null!=g&&g(I)}};n.onsuccess=mxUtils.bind(this,function(x){try{var F=n.result;this.database=F;EditorUi.migrateStorageFiles&&(StorageFile.migrate(F),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(I){if((!I||"1"==urlParams.forceMigration)&&"1"==urlParams.forceMigration){var M=document.createElement("iframe");
M.style.display="none";M.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(M);var L=!0,K=!1,aa,ja=0,ca=mxUtils.bind(this,function(){K=!0;this.setDatabaseItem(".drawioMigrated3",!0);M.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),ba=mxUtils.bind(this,function(){ja++;oa()}),oa=mxUtils.bind(this,function(){try{if(ja>=aa.length)ca();else{var da=aa[ja];StorageFile.getFileContent(this,
da,mxUtils.bind(this,function(ha){null==ha||".scratchpad"==da&&ha==this.emptyLibraryXml?M.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[da]}),"*"):ba()}),ba)}}catch(ha){console.log(ha)}}),Y=mxUtils.bind(this,function(da){try{this.setDatabaseItem(null,[{title:da.title,size:da.data.length,lastModified:Date.now(),type:da.isLib?"L":"F"},{title:da.title,data:da.data}],ba,ba,["filesInfo","files"])}catch(ha){console.log(ha)}});I=mxUtils.bind(this,
function(da){try{if(da.source==M.contentWindow){var ha={};try{ha=JSON.parse(da.data)}catch(Z){}"init"==ha.event?(M.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),M.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=ha.event||K||(L?null!=ha.resp&&0<ha.resp.length&&null!=ha.resp[0]?(aa=ha.resp[0],L=!1,oa()):ca():null!=ha.resp&&0<ha.resp.length&&null!=ha.resp[0]?Y(ha.resp[0]):ba())}}catch(Z){console.log(Z)}});
window.addEventListener("message",I)}})));c(F);F.onversionchange=function(){F.close()}}catch(I){null!=g?g(I):null!=window.console&&console.warn(I)}});n.onerror=g;n.onblocked=function(){}}catch(x){null!=g?g(x):null!=window.console&&console.error(x)}else null!=g&&g(Error("IndexedDB not supported"))}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,g,m,n,x){this.openDatabase(mxUtils.bind(this,function(F){try{x=x||"objects";Array.isArray(x)||(x=[x],c=[c],g=[g]);var I=F.transaction(x,
"readwrite");I.oncomplete=m;I.onerror=n;for(F=0;F<x.length;F++)I.objectStore(x[F]).put(null!=c&&null!=c[F]?{key:c[F],data:g[F]}:g[F])}catch(M){null!=n&&n(M)}}),n)};EditorUi.prototype.removeDatabaseItem=function(c,g,m,n){this.openDatabase(mxUtils.bind(this,function(x){try{n=n||"objects";Array.isArray(n)||(n=[n],c=[c]);var F=x.transaction(n,"readwrite");F.oncomplete=g;F.onerror=m;for(x=0;x<n.length;x++)F.objectStore(n[x]).delete(c[x])}catch(I){null!=m&&m(I)}}),m)};EditorUi.prototype.getDatabaseItem=
function(c,g,m,n){this.openDatabase(mxUtils.bind(this,function(x){try{n=n||"objects";var F=x.transaction([n],"readonly").objectStore(n).get(c);F.onsuccess=function(){g(F.result)};F.onerror=m}catch(I){null!=m&&m(I)}}),m)};EditorUi.prototype.getDatabaseItems=function(c,g,m){this.openDatabase(mxUtils.bind(this,function(n){try{m=m||"objects";var x=n.transaction([m],"readonly").objectStore(m).openCursor(IDBKeyRange.lowerBound(0)),F=[];x.onsuccess=function(I){null==I.target.result?c(F):(F.push(I.target.result.value),
I.target.result.continue())};x.onerror=g}catch(I){null!=g&&g(I)}}),g)};EditorUi.prototype.getDatabaseItemKeys=function(c,g,m){this.openDatabase(mxUtils.bind(this,function(n){try{m=m||"objects";var x=n.transaction([m],"readonly").objectStore(m).getAllKeys();x.onsuccess=function(){c(x.result)};x.onerror=g}catch(F){null!=g&&g(F)}}),g)};EditorUi.prototype.commentsSupported=function(){var c=this.getCurrentFile();return null!=c?c.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var c=
this.getCurrentFile();return null!=c?c.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var c=this.getCurrentFile();return null!=c?c.commentsSaveNeeded():!1};EditorUi.prototype.getComments=function(c,g){var m=this.getCurrentFile();null!=m?m.getComments(c,g):c([])};EditorUi.prototype.addComment=function(c,g,m){var n=this.getCurrentFile();null!=n?n.addComment(c,g,m):g(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var c=this.getCurrentFile();return null!=c?
c.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var c=this.getCurrentFile();return null!=c?c.canComment():!0};EditorUi.prototype.newComment=function(c,g){var m=this.getCurrentFile();return null!=m?m.newComment(c,g):new DrawioComment(this,null,c,Date.now(),Date.now(),!1,g)};EditorUi.prototype.isRevisionHistorySupported=function(){var c=this.getCurrentFile();return null!=c&&c.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(c,g){var m=this.getCurrentFile();null!=
m&&m.getRevisions?m.getRevisions(c,g):g({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var c=this.getCurrentFile();return null!=c&&(c.constructor==DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.vsdxExportEnabled=function(){return"atlassian"==this.getServiceName()};EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language",
"da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,g,m,n,x,F,I,M){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,g,m,n,x,F,I,M)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)};EditorUi.prototype.createSvgDataUri=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(c)};EditorUi.prototype.embedCssFonts=function(c,g){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");
return this.editor.embedCssFonts(c,g)};EditorUi.prototype.embedExtFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(c)};EditorUi.prototype.exportToCanvas=function(c,g,m,n,x,F,I,M,L,K,aa,ja,ca,ba,oa,Y){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");return this.editor.exportToCanvas(c,g,m,n,x,F,I,M,L,K,aa,ja,ca,ba,oa,Y)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");
return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,g,m,n){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,g,m,n)};EditorUi.prototype.convertImageToDataUri=function(c,g){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");return this.editor.convertImageToDataUri(c,g)};EditorUi.prototype.base64Encode=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(c)};EditorUi.prototype.updateCRC=
function(c,g,m,n){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(c,g,m,n)};EditorUi.prototype.crc32=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(c)};EditorUi.prototype.writeGraphModelToPng=function(c,g,m,n,x){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");return Editor.writeGraphModelToPng(c,g,m,n,x)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=
urlParams.forceMigration)return null;for(var c=[],g=0;g<localStorage.length;g++){var m=localStorage.key(g),n=localStorage.getItem(m);if(0<m.length&&(".scratchpad"==m||"."!=m.charAt(0))&&0<n.length){var x="<mxfile "===n.substring(0,8)||"<?xml"===n.substring(0,5)||"\x3c!--[if IE]>"===n.substring(0,12);n="<mxlibrary>"===n.substring(0,11);(x||n)&&c.push(m)}}return c};EditorUi.prototype.getLocalStorageFile=function(c){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;
var g=localStorage.getItem(c);return{title:c,data:g,isLib:"<mxlibrary>"===g.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();
var CommentsWindow=function(b,f,l,u,y,q){function B(){for(var Y=M.getElementsByTagName("div"),da=0,ha=0;ha<Y.length;ha++)"none"!=Y[ha].style.display&&Y[ha].parentNode==M&&da++;L.style.display=0==da?"block":"none"}function H(Y,da,ha,Z){function k(){da.removeChild(N);da.removeChild(T);J.style.display="block";v.style.display="block"}x={div:da,comment:Y,saveCallback:ha,deleteOnCancel:Z};var v=da.querySelector(".geCommentTxt"),J=da.querySelector(".geCommentActionsList"),N=document.createElement("textarea");
N.className="geCommentEditTxtArea";N.style.minHeight=v.offsetHeight+"px";N.value=Y.content;da.insertBefore(N,v);var T=document.createElement("div");T.className="geCommentEditBtns";var V=mxUtils.button(mxResources.get("cancel"),function(){Z?(da.parentNode.removeChild(da),B()):k();x=null});V.className="geCommentEditBtn";T.appendChild(V);var U=mxUtils.button(mxResources.get("save"),function(){v.innerText="";Y.content=N.value;mxUtils.write(v,Y.content);k();ha(Y);x=null});mxEvent.addListener(N,"keydown",
mxUtils.bind(this,function(X){mxEvent.isConsumed(X)||((mxEvent.isControlDown(X)||mxClient.IS_MAC&&mxEvent.isMetaDown(X))&&13==X.keyCode?(U.click(),mxEvent.consume(X)):27==X.keyCode&&(V.click(),mxEvent.consume(X)))}));U.focus();U.className="geCommentEditBtn gePrimaryBtn";T.appendChild(U);da.insertBefore(T,v);J.style.display="none";v.style.display="none";N.focus()}function S(Y,da){da.innerText="";Y=new Date(Y.modifiedDate);var ha=b.timeSince(Y);null==ha&&(ha=mxResources.get("lessThanAMinute"));mxUtils.write(da,
mxResources.get("timeAgo",[ha],"{1} ago"));da.setAttribute("title",Y.toLocaleDateString()+" "+Y.toLocaleTimeString())}function E(Y){var da=document.createElement("img");da.className="geCommentBusyImg";da.src=IMAGE_PATH+"/spin.gif";Y.appendChild(da);Y.busyImg=da}function Q(Y){Y.style.border="1px solid red";Y.busyImg.parentNode==Y&&Y.removeChild(Y.busyImg)}function c(Y){Y.style.border="";Y.busyImg.parentNode==Y&&Y.removeChild(Y.busyImg)}function g(Y,da,ha,Z,k){function v(na,la,qa){var ya=document.createElement("li");
ya.className="geCommentAction";var wa=document.createElement("a");wa.className="geCommentActionLnk";mxUtils.write(wa,na);ya.appendChild(wa);mxEvent.addListener(wa,"click",function(Ja){la(Ja,Y);Ja.preventDefault();mxEvent.consume(Ja)});fa.appendChild(ya);qa&&(ya.style.display="none")}function J(){function na(ya){la.push(qa);if(null!=ya.replies)for(var wa=0;wa<ya.replies.length;wa++)qa=qa.nextSibling,na(ya.replies[wa])}var la=[],qa=T;na(Y);return{pdiv:qa,replies:la}}function N(na,la,qa,ya,wa){function Ja(){E(Ma);
Y.addReply(Ga,function(ra){Ga.id=ra;Y.replies.push(Ga);c(Ma);qa&&qa()},function(ra){Aa();Q(Ma);b.handleError(ra,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},ya,wa)}function Aa(){H(Ga,Ma,function(ra){Ja()},!0)}var Ba=J().pdiv,Ga=b.newComment(na,b.getCurrentUser());Ga.pCommentId=Y.id;null==Y.replies&&(Y.replies=[]);var Ma=g(Ga,Y.replies,Ba,Z+1);la?Aa():Ja()}if(k||!Y.isResolved){L.style.display="none";var T=document.createElement("div");T.className="geCommentContainer";T.setAttribute("data-commentId",
Y.id);T.style.marginLeft=20*Z+5+"px";Y.isResolved&&(F.style.opacity="0.7");var V=document.createElement("div");V.className="geCommentHeader";var U=document.createElement("img");U.className="geCommentUserImg";U.src=null!=Y.user&&null!=Y.user.pictureUrl?Y.user.pictureUrl:Editor.userImage;V.appendChild(U);U=document.createElement("div");U.className="geCommentHeaderTxt";V.appendChild(U);var X=document.createElement("div");X.className="geCommentUsername";mxUtils.write(X,null!=Y.user?Y.user.displayName:
mxResources.get("unknownUser"));U.appendChild(X);X=document.createElement("div");X.className="geCommentDate";X.setAttribute("data-commentId",Y.id);S(Y,X);U.appendChild(X);T.appendChild(V);V=document.createElement("div");V.className="geCommentTxt";mxUtils.write(V,Y.content||"");T.appendChild(V);Y.isLocked&&(T.style.opacity="0.5");V=document.createElement("div");V.className="geCommentActions";var fa=document.createElement("ul");fa.className="geCommentActionsList";V.appendChild(fa);m||Y.isLocked||0!=
Z&&!n||v(mxResources.get("reply"),function(){N("",!0)},Y.isResolved);U=b.getCurrentUser();null==U||null==Y.user||U.id!=Y.user.id||m||Y.isLocked||(v(mxResources.get("edit"),function(){function na(){H(Y,T,function(){E(T);Y.editComment(Y.content,function(){c(T)},function(la){Q(T);na();b.handleError(la,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}na()},Y.isResolved),v(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){E(T);Y.deleteComment(function(na){if(!0===
na){na=T.querySelector(".geCommentTxt");na.innerText="";mxUtils.write(na,mxResources.get("msgDeleted"));var la=T.querySelectorAll(".geCommentAction");for(na=0;na<la.length;na++)la[na].parentNode.removeChild(la[na]);c(T);T.style.opacity="0.5"}else{la=J(Y).replies;for(na=0;na<la.length;na++)M.removeChild(la[na]);for(na=0;na<da.length;na++)if(da[na]==Y){da.splice(na,1);break}L.style.display=0==M.getElementsByTagName("div").length?"block":"none"}},function(na){Q(T);b.handleError(na,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},
Y.isResolved));m||Y.isLocked||0!=Z||v(Y.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(na){function la(){var qa=na.target;qa.innerText="";Y.isResolved=!Y.isResolved;mxUtils.write(qa,Y.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var ya=Y.isResolved?"none":"",wa=J(Y).replies,Ja="light-dark("+(Y.isResolved?"ghostWhite":"white")+", transparent)",Aa=0;Aa<wa.length;Aa++){wa[Aa].style.backgroundColor=Ja;for(var Ba=wa[Aa].querySelectorAll(".geCommentAction"),
Ga=0;Ga<Ba.length;Ga++)Ba[Ga]!=qa.parentNode&&(Ba[Ga].style.display=ya);ca||(wa[Aa].style.display="none")}B()}Y.isResolved?N(mxResources.get("reOpened")+": ",!0,la,!1,!0):N(mxResources.get("markedAsResolved"),!1,la,!0)});T.appendChild(V);null!=ha?M.insertBefore(T,ha.nextSibling):M.appendChild(T);for(ha=0;null!=Y.replies&&ha<Y.replies.length;ha++)V=Y.replies[ha],V.isResolved=Y.isResolved,g(V,Y.replies,null,Z+1,k);null!=x&&(x.comment.id==Y.id?(k=Y.content,Y.content=x.comment.content,H(Y,T,x.saveCallback,
x.deleteOnCancel),Y.content=k):null==x.comment.id&&x.comment.pCommentId==Y.id&&(M.appendChild(x.div),H(x.comment,x.div,x.saveCallback,x.deleteOnCancel)));return T}}var m=!b.canComment(),n=b.canReplyToReplies(),x=null,F=document.createElement("div");F.className="geCommentsWin";var I=EditorUi.compactUi?"26px":"30px",M=document.createElement("div");M.className="geCommentsList";M.style.bottom=parseInt(I)+7+"px";F.appendChild(M);var L=document.createElement("span");L.style.cssText="display:none;padding-top:10px;text-align:center;";
mxUtils.write(L,mxResources.get("noCommentsFound"));var K=document.createElement("div");K.className="geToolbarContainer geCommentsToolbar";K.style.height=I;K.style.padding="3px 4px 4px 4px";I=document.createElement("a");I.className="geButton";if(!m){var aa=I.cloneNode();aa.style.backgroundImage="url("+Editor.plusImage+")";aa.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(aa,"click",function(Y){function da(){H(ha,Z,function(k){E(Z);b.addComment(k,function(v){k.id=v;ba.push(k);
c(Z)},function(v){Q(Z);da();b.handleError(v,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},!0)}var ha=b.newComment("",b.getCurrentUser()),Z=g(ha,ba,null,0);da();Y.preventDefault();mxEvent.consume(Y)});K.appendChild(aa)}var ja=I.cloneNode();ja.style.backgroundImage="url("+Editor.checkImage+")";ja.setAttribute("title",mxResources.get("showResolved"));var ca=!1;mxEvent.addListener(ja,"click",function(Y){(ca=!ca)?ja.classList.add("geActiveItem"):ja.classList.remove("geActiveItem");
oa();Y.preventDefault();mxEvent.consume(Y)});K.appendChild(ja);b.commentsRefreshNeeded()&&(aa=I.cloneNode(),aa.style.backgroundImage="url("+Editor.refreshImage+")",aa.setAttribute("title",mxResources.get("refresh")),mxEvent.addListener(aa,"click",function(Y){oa();Y.preventDefault();mxEvent.consume(Y)}),K.appendChild(aa));b.commentsSaveNeeded()&&(I=I.cloneNode(),I.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',I.setAttribute("title",mxResources.get("save")),I.className=
"geButton geAdaptiveAsset",mxEvent.addListener(I,"click",function(Y){q();Y.preventDefault();mxEvent.consume(Y)}),K.appendChild(I));F.appendChild(K);var ba=[],oa=mxUtils.bind(this,function(){this.hasError=!1;if(null!=x)try{x.div=x.div.cloneNode(!0);var Y=x.div.querySelector(".geCommentEditTxtArea"),da=x.div.querySelector(".geCommentEditBtns");x.comment.content=Y.value;Y.parentNode.removeChild(Y);da.parentNode.removeChild(da)}catch(ha){b.handleError(ha)}M.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+
IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";n=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(ha){function Z(k){if(null!=k){k.sort(function(J,N){return new Date(J.modifiedDate)-new Date(N.modifiedDate)});for(var v=0;v<k.length;v++)Z(k[v].replies)}}ha.sort(function(k,v){return new Date(k.modifiedDate)-new Date(v.modifiedDate)});M.innerText="";M.appendChild(L);L.style.display="block";ba=ha;for(ha=0;ha<ba.length;ha++)Z(ba[ha].replies),
g(ba[ha],ba,null,0,ca);null!=x&&null==x.comment.id&&null==x.comment.pCommentId&&(M.appendChild(x.div),H(x.comment,x.div,x.saveCallback,x.deleteOnCancel))},mxUtils.bind(this,function(ha){M.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(ha&&ha.message?": "+ha.message:""));this.hasError=!0})):M.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});oa();this.refreshComments=oa;K=mxUtils.bind(this,function(){function Y(v){var J=ha[v.id];if(null!=J)for(S(v,J),J=0;null!=v.replies&&J<v.replies.length;J++)Y(v.replies[J])}
if(this.window.isVisible()){for(var da=M.querySelectorAll(".geCommentDate"),ha={},Z=0;Z<da.length;Z++){var k=da[Z];ha[k.getAttribute("data-commentId")]=k}for(Z=0;Z<ba.length;Z++)Y(ba[Z])}});setInterval(K,6E4);this.refreshCommentsTime=K;this.window=new mxWindow(mxResources.get("comments"),F,f,l,u,y,!0,!0);this.window.minimumSize=new mxRectangle(0,0,260,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);
this.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){this.window.fit()}));b.installResizeHandler(this,!0)},ConfirmDialog=function(b,f,l,u,y,q,B,H,S,E,Q){var c=document.createElement("div");c.style.textAlign="center";Q=null!=Q?Q:44;var g=document.createElement("div");g.style.padding="6px";g.style.overflow="auto";g.style.maxHeight=Q+"px";g.style.lineHeight="1.2em";mxUtils.write(g,f);c.appendChild(g);null!=E&&(g=document.createElement("div"),g.style.padding="6px 0 6px 0",f=document.createElement("img"),
f.setAttribute("src",E),g.appendChild(f),c.appendChild(g));E=document.createElement("div");E.style.textAlign="center";E.style.whiteSpace="nowrap";var m=document.createElement("input");m.setAttribute("type","checkbox");q=mxUtils.button(q||mxResources.get("cancel"),function(){b.hideDialog();null!=u&&u(m.checked)});q.className="geBtn";null!=H&&(q.innerHTML=H+"<br>"+q.innerHTML,q.style.display="inline-block",q.style.paddingBottom="8px",q.style.paddingTop="8px",q.style.height="auto",q.style.width="40%");
b.editor.cancelFirst&&E.appendChild(q);var n=mxUtils.button(y||mxResources.get("ok"),function(){b.hideDialog();null!=l&&l(m.checked)});E.appendChild(n);null!=B?(n.innerHTML=B+"<br>"+n.innerHTML+"<br>",n.style.display="inline-block",n.style.paddingBottom="8px",n.style.paddingTop="8px",n.style.height="auto",n.className="geBtn",n.style.width="40%"):n.className="geBtn gePrimaryBtn";b.editor.cancelFirst||E.appendChild(q);c.appendChild(E);S?(E.style.marginTop="10px",g=document.createElement("p"),g.style.marginTop=
"20px",g.style.marginBottom="0px",g.appendChild(m),y=document.createElement("span"),mxUtils.write(y," "+mxResources.get("rememberThisSetting")),g.appendChild(y),c.appendChild(g),mxEvent.addListener(y,"click",function(x){m.checked=!m.checked;mxEvent.consume(x)})):E.style.marginTop="12px";this.init=function(){n.focus()};this.container=c},HeadlessEditorUi=function(){EditorUi.call(this,new Editor(!0),document.createElement("div"),!0)};mxUtils.extend(HeadlessEditorUi,EditorUi);
HeadlessEditorUi.prototype.createUi=function(){};HeadlessEditorUi.prototype.addTrees=function(){};HeadlessEditorUi.prototype.onBeforeUnload=function(){};HeadlessEditorUi.prototype.updateActionStates=function(){};function DiagramPage(b,f){this.node=b;null!=f?this.node.setAttribute("id",f):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.diagramModified=!1;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};
DiagramPage.prototype.setName=function(b){null==b?this.node.removeAttribute("name"):this.node.setAttribute("name",b)};DiagramPage.prototype.setDiagramModified=function(b){this.diagramModified=b};DiagramPage.prototype.isDiagramModified=function(){return this.diagramModified};function RenamePage(b,f,l){this.ui=b;this.page=f;this.previous=this.name=l}
RenamePage.prototype.execute=function(){var b=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};function MovePage(b,f,l){this.ui=b;this.oldIndex=f;this.newIndex=l}
MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var b=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=b;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};function SelectPage(b,f,l){this.ui=b;this.previousPage=this.page=f;null!=f&&(this.ui.updatePageRoot(f),null!=l&&(f.viewState=l))}
SelectPage.prototype.execute=function(){var b=mxUtils.indexOf(this.ui.pages,this.previousPage);if(null!=this.page&&0<=b){b=this.ui.currentPage;var f=this.ui.editor,l=f.graph;b.isDiagramModified()&&(b.setDiagramModified(!1),EditorUi.removeChildNodes(b.node),b.node.appendChild(f.getGraphXml(!0)));b.viewState=l.getViewState();b.root=l.model.root;null!=b.model&&b.model.rootChanged(b.root);l.view.clear(b.root,!0);l.clearSelection();this.ui.currentPage=this.previousPage;this.previousPage=b;b=this.ui.currentPage;
l.model.prefix=Editor.guid()+"-";l.model.rootChanged(b.root);l.setViewState(b.viewState);l.gridEnabled=l.gridEnabled&&(!this.ui.editor.isChromelessView()||"1"==urlParams.grid);f.graph.fireEvent(new mxEventObject(mxEvent.ROOT));f.fireEvent(new mxEventObject("pageSelected","change",this))}};function ChangePage(b,f,l,u,y){SelectPage.call(this,b,l);this.relatedPage=f;this.index=u;this.previousIndex=null;this.noSelect=y}mxUtils.extend(ChangePage,SelectPage);
ChangePage.prototype.execute=function(){this.ui.editor.fireEvent(new mxEventObject("beforePageChange","change",this));this.previousIndex=this.index;if(null==this.index){var b=mxUtils.indexOf(this.ui.pages,this.relatedPage);this.ui.pages.splice(b,1);this.index=b}else this.ui.pages.splice(this.index,0,this.relatedPage),this.index=null;this.noSelect||SelectPage.prototype.execute.apply(this,arguments)};function ReplaceDiagram(b,f){this.ui=b;this.data=f}
ReplaceDiagram.prototype.execute=function(){var b=this.ui.editor.graph,f=this.ui.editor.getGraphXml();this.ui.editor.readGraphState(this.data);this.ui.editor.updateGraphComponents();var l=new mxCodec(this.data.ownerDocument),u=new mxGraphModel;l.decode(this.data,u);this.data=f;this.ui.currentPage&&(this.ui.currentPage.viewState=b.getViewState(),this.ui.currentPage.root=u.root,null!=this.ui.currentPage.model&&this.ui.currentPage.model.rootChanged(this.ui.currentPage.model.root));b.view.clear(b.model.root,
!0);b.model.rootChanged(u.root);b.fireEvent(new mxEventObject(mxEvent.ROOT))};EditorUi.prototype.tabContainerVisible=!0;EditorUi.prototype.setTabContainerVisible=function(b,f){Editor.isSettingsEnabled()&&f&&(mxSettings.settings.pages=b,mxSettings.save());this.tabContainerVisible=b;this.updateTabContainer()};EditorUi.prototype.isTabContainerVisible=function(){return this.tabContainerVisible};EditorUi.prototype.getSelectedPageIndex=function(){return this.getPageIndex(this.currentPage)};
EditorUi.prototype.getPageIndex=function(b){var f=null;if(null!=this.pages&&null!=b)for(var l=0;l<this.pages.length;l++)if(this.pages[l]==b){f=l;break}return f};EditorUi.prototype.getPageById=function(b,f){f=null!=f?f:this.pages;if(null!=f)for(var l=0;l<f.length;l++)if(f[l].getId()==b)return f[l];return null};
EditorUi.prototype.createImageForPageLink=function(b,f,l,u){var y=b.indexOf(","),q=null;0<y&&(y=this.getPageById(b.substring(y+1)),null!=y&&y!=f&&(q=this.getImageForPage(y,f,l,u),q.originalSrc=b));null==q&&(q={originalSrc:b});return q};
EditorUi.prototype.pageSelected=function(){var b=this.editor.graph,f=this.currentPage;null!=f&&(b.tooltipHandler.hide(),null==f.viewState||null==f.viewState.scrollTop||null==f.viewState.scrollLeft?(b.selectUnlockedLayer(),this.resetScrollbars(),b.isLightboxView()&&this.lightboxFit(),null!=this.chromelessResize&&(b.container.scrollleft=0,b.container.scrollTop=0,this.chromelessResize())):b.setScrollbarPositions(f.viewState,b.view.translate.x,b.view.translate.y),this.updateTabContainer(),this.scrollToPage())};
EditorUi.prototype.getImageForPage=function(b,f,l,u){l=null!=l?l:this.editor.graph;var y=l.getGlobalVariable;l=this.createTemporaryGraph(l.getStylesheet());var q=this.getPageIndex(null!=f?f:this.currentPage);l.getGlobalVariable=function(H){return"pagenumber"==H?q+1:"page"==H&&null!=f?f.getName():y.apply(this,arguments)};document.body.appendChild(l.container);this.updatePageRoot(b);l.setAdaptiveColors(b.viewState.adaptiveColors);l.model.setRoot(b.root);b=Graph.foreignObjectWarningText;Graph.foreignObjectWarningText=
"";u=l.getSvg(null,null,null,null,null,null,null,null,null,null,u,null,null,null,!0,!0);var B=l.getGraphBounds();document.body.removeChild(l.container);Graph.foreignObjectWarningText=b;return new mxImage(Editor.createSvgDataUri(mxUtils.getXml(u)),B.width,B.height,B.x,B.y)};
EditorUi.prototype.initPages=function(){if(!this.editor.graph.standalone){this.actions.addAction("previousPage",mxUtils.bind(this,function(){this.selectNextPage(!1)}));this.actions.addAction("nextPage",mxUtils.bind(this,function(){this.selectNextPage(!0)}));this.isPagesEnabled()&&(this.keyHandler.bindAction(33,!0,"previousPage",!0),this.keyHandler.bindAction(34,!0,"nextPage",!0));var b=this.editor.graph,f=b.view.validateBackground;b.view.validateBackground=mxUtils.bind(this,function(){f.apply(b.view,
arguments);null!=b.view.backgroundImage&&EditorUi.embedSvgImages(b.view.backgroundImage.node)});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(B,H){B=H.getProperty("edit").changes;for(H=0;H<B.length;H++)if(B[H]instanceof RenamePage||B[H]instanceof ChangePage||B[H]instanceof mxRootChange){this.updateTabContainer();break}null==this.currentPage||1==B.length&&B[0]instanceof SelectPage||this.currentPage.setDiagramModified(!0)}));var l=b.sizeDidChange,u=null,y=this;b.sizeDidChange=
function(){var B=l.apply(this,arguments);null!=y.currentPage&&u!=y.currentPage&&(u=y.currentPage,y.pageSelected());return B};b.addListener(mxEvent.ROOT,mxUtils.bind(this,function(){b.checkDefaultParent()}));var q=mxUtils.bind(this,function(){this.updateDocumentTitle();this.updateTabContainer()});this.addListener("currentThemeChanged",q);this.editor.addListener("pagesPatched",q);this.editor.addListener("pageRenamed",q);this.editor.addListener("pageMoved",q);this.editor.addListener("fileLoaded",q);
this.editor.addListener("pageSelected",mxUtils.bind(this,function(B,H){this.scrollToPage();this.updateHashObject();this.updateTabContainer();this.updateDocumentTitle()}));this.editor.addListener("pageMoved",mxUtils.bind(this,function(B,H){this.scrollToPage();this.updateHashObject()}));mxEvent.addListener(window,"resize",mxUtils.bind(this,function(){this.checkTabScrollerOverflow()}));this.addListener("languageChanged",mxUtils.bind(this,function(){this.updateTabContainer()}))}};
EditorUi.prototype.scrollToPage=function(b,f){var l=null!=b?this.getPageIndex(b):this.getSelectedPageIndex(),u=null!=b?b:this.currentPage;null!=l&&null!=this.tabScroller&&this.tabScroller.children.length>l&&null!=this.tabScroller.children[l]&&(u!=this.lastScrollPage||f)&&(this.tabScroller.children[l].scrollIntoView({block:"nearest",inline:null!=b?"nearest":"center"}),this.tabScroller.children[l].className="geTab gePageTab geActivePage",this.lastScrollPage=u)};
EditorUi.prototype.restoreViewState=function(b,f,l){b=null!=b?this.getPageById(b.getId()):null;var u=this.editor.graph;null!=b&&null!=this.currentPage&&null!=this.pages&&(b!=this.currentPage?this.selectPage(b,!0,f):(u.setViewState(f),this.editor.updateGraphComponents(),u.view.revalidate(),u.sizeDidChange()),u.container.scrollLeft=u.view.translate.x*u.view.scale+f.scrollLeft,u.container.scrollTop=u.view.translate.y*u.view.scale+f.scrollTop,u.restoreSelection(l))};
Graph.prototype.createViewState=function(b){var f=b.getAttribute("page"),l=parseFloat(b.getAttribute("pageScale")),u=parseFloat(b.getAttribute("pageWidth")),y=parseFloat(b.getAttribute("pageHeight")),q=b.getAttribute("background"),B=this.parseBackgroundImage(b.getAttribute("backgroundImage")),H=b.getAttribute("extFonts");if(H)try{H=H.split("|").map(function(S){S=S.split("^");return{name:S[0],url:S[1]}})}catch(S){console.log("ExtFonts format error: "+S.message)}return{gridEnabled:"0"!=b.getAttribute("grid"),
gridSize:parseFloat(b.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=b.getAttribute("guides"),foldingEnabled:"0"!=b.getAttribute("fold"),shadowVisible:"1"==b.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=f?"0"!=f:this.defaultPageVisible,background:null!=q&&0<q.length?q:null,backgroundImage:B,pageScale:isNaN(l)?mxGraph.prototype.pageScale:l,pageFormat:isNaN(u)||isNaN(y)?"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:
mxSettings.getPageFormat():new mxRectangle(0,0,u,y),tooltips:"0"!=b.getAttribute("tooltips"),connect:"0"!=b.getAttribute("connect"),arrows:"0"!=b.getAttribute("arrows"),mathEnabled:"1"==b.getAttribute("math"),adaptiveColors:b.getAttribute("adaptiveColors"),selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1,hiddenTags:[],extFonts:H||[]}};
Graph.prototype.saveViewState=function(b,f,l,u){l||(f.setAttribute("grid",(null==b?this.defaultGridEnabled:b.gridEnabled)?"1":"0"),f.setAttribute("page",(null==b?this.defaultPageVisible:b.pageVisible)?"1":"0"),f.setAttribute("gridSize",null!=b?b.gridSize:mxGraph.prototype.gridSize),f.setAttribute("guides",null==b||b.guidesEnabled?"1":"0"),f.setAttribute("tooltips",null==b||b.tooltips?"1":"0"),f.setAttribute("connect",null==b||b.connect?"1":"0"),f.setAttribute("arrows",null==b||b.arrows?"1":"0"),f.setAttribute("fold",
null==b||b.foldingEnabled?"1":"0"));f.setAttribute("pageScale",null!=b&&null!=b.pageScale?b.pageScale:mxGraph.prototype.pageScale);l=null!=b?b.pageFormat:"undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat();null!=l&&(f.setAttribute("pageWidth",l.width),f.setAttribute("pageHeight",l.height));null!=b&&(null!=b.background&&f.setAttribute("background",b.background),u=this.getBackgroundImageObject(b.backgroundImage,u),null!=u&&f.setAttribute("backgroundImage",
JSON.stringify(u)));f.setAttribute("math",(null==b?this.defaultMathEnabled:b.mathEnabled)?"1":"0");f.setAttribute("shadow",null!=b&&b.shadowVisible?"1":"0");null==b||null==b.adaptiveColors?f.removeAttribute("adaptiveColors"):f.setAttribute("adaptiveColors",b.adaptiveColors);null!=b&&null!=b.extFonts&&0<b.extFonts.length&&f.setAttribute("extFonts",b.extFonts.map(function(y){return y.name+"^"+y.url}).join("|"))};
Graph.prototype.getViewState=function(){return{defaultParent:this.defaultParent,currentRoot:this.view.currentRoot,gridEnabled:this.gridEnabled,gridSize:this.gridSize,guidesEnabled:this.graphHandler.guidesEnabled,foldingEnabled:this.foldingEnabled,shadowVisible:this.shadowVisible,scrollbars:this.scrollbars,pageVisible:this.pageVisible,background:this.background,backgroundImage:this.backgroundImage,pageScale:this.pageScale,pageFormat:this.pageFormat,tooltips:this.tooltipHandler.isEnabled(),connect:this.connectionHandler.isEnabled(),
arrows:this.connectionArrowsEnabled,scale:this.view.scale,scrollLeft:this.container.scrollLeft-this.view.translate.x*this.view.scale,scrollTop:this.container.scrollTop-this.view.translate.y*this.view.scale,translate:this.view.translate.clone(),lastPasteXml:this.lastPasteXml,pasteCounter:this.pasteCounter,mathEnabled:this.mathEnabled,adaptiveColors:this.adaptiveColors,hiddenTags:this.hiddenTags,extFonts:this.extFonts}};
Graph.prototype.setViewState=function(b,f){if(null!=b){this.lastPasteXml=b.lastPasteXml;this.pasteCounter=b.pasteCounter||0;this.mathEnabled=b.mathEnabled;this.adaptiveColors=b.adaptiveColors;this.gridEnabled=b.gridEnabled;this.gridSize=b.gridSize;this.graphHandler.guidesEnabled=b.guidesEnabled;this.foldingEnabled=b.foldingEnabled;this.setShadowVisible(b.shadowVisible,!1);this.scrollbars=b.scrollbars;this.pageVisible=!this.isViewer()&&b.pageVisible;this.background=b.background;this.pageScale=b.pageScale;
this.pageFormat=b.pageFormat;this.view.currentRoot=b.currentRoot;this.defaultParent=b.defaultParent;this.connectionArrowsEnabled=b.arrows;this.setTooltips(b.tooltips);this.setConnectable(b.connect);this.setBackgroundImage(b.backgroundImage);this.hiddenTags=b.hiddenTags;var l=this.extFonts;this.extFonts=b.extFonts||[];if(f&&null!=l)for(f=0;f<l.length;f++){var u=document.getElementById("extFont_"+l[f].name);null!=u&&u.parentNode.removeChild(u)}for(f=0;f<this.extFonts.length;f++)this.addExtFont(this.extFonts[f].name,
this.extFonts[f].url,!0);this.view.scale=null!=b.scale?b.scale:1;null==this.view.currentRoot||this.model.contains(this.view.currentRoot)||(this.view.currentRoot=null);null==this.defaultParent||this.model.contains(this.defaultParent)||(this.setDefaultParent(null),this.selectUnlockedLayer());null!=b.translate&&(this.view.translate=b.translate)}else this.view.currentRoot=null,this.view.scale=1,this.gridEnabled=this.defaultGridEnabled,this.gridSize=mxGraph.prototype.gridSize,this.pageScale=mxGraph.prototype.pageScale,
this.pageFormat="undefined"===typeof mxSettings||null!=this.defaultPageFormat?mxGraph.prototype.pageFormat:mxSettings.getPageFormat(),this.pageVisible=this.defaultPageVisible,this.backgroundImage=this.background=null,this.scrollbars=this.defaultScrollbars,this.foldingEnabled=this.graphHandler.guidesEnabled=!0,this.setShadowVisible(!1,!1),this.defaultParent=null,this.setTooltips(!0),this.setConnectable(!0),this.lastPasteXml=null,this.pasteCounter=0,this.mathEnabled=this.defaultMathEnabled,this.adaptiveColors=
null,this.connectionArrowsEnabled=!0,this.hiddenTags=[],this.extFonts=[];this.setAdaptiveColors(this.adaptiveColors);this.preferPageSize=this.pageBreaksVisible=this.pageVisible;this.fireEvent(new mxEventObject("viewStateChanged","state",b))};Graph.prototype.setScrollbarPositions=function(b,f,l){null!=b&&null!=b.scrollLeft&&null!=b.scrollTop&&(this.container.scrollLeft=f*this.view.scale+b.scrollLeft,this.container.scrollTop=l*this.view.scale+b.scrollTop)};
Graph.prototype.addExtFont=function(b,f,l){if(b&&f){var u="extFont_"+b;if(null==document.getElementById(u))if(0==f.indexOf(Editor.GOOGLE_FONTS))mxClient.link("stylesheet",f,null,u);else{document.getElementsByTagName("head");var y=document.createElement("style");y.appendChild(document.createTextNode('@font-face {\n\tfont-family: "'+b+'";\n\tsrc: url("'+f+'");\n}'));y.setAttribute("id",u);document.getElementsByTagName("head")[0].appendChild(y)}if(!l){null==this.extFonts&&(this.extFonts=[]);l=this.extFonts;
u=!0;for(y=0;y<l.length;y++)if(l[y].name==b){u=!1;break}u&&this.extFonts.push({name:b,url:f})}}};
EditorUi.prototype.updatePageRoot=function(b,f){if(null==b.root){f=this.editor.extractGraphModel(b.node,null,f);var l=Editor.extractParserError(f);if(l)throw Error(l);null!=f?(b.graphModelNode=f,b.viewState=this.editor.graph.createViewState(f),l=new mxCodec(f.ownerDocument),b.root=l.decode(f).root):(b.root=this.editor.graph.model.createRoot(),b.root.setId("0"),b.root.children[0].setId("1"),b.needsUpdate=!0)}else if(null==b.viewState){if(null==b.graphModelNode){f=this.editor.extractGraphModel(b.node);
if(l=Editor.extractParserError(f))throw Error(l);null!=f&&(b.graphModelNode=f)}null!=b.graphModelNode&&(b.viewState=this.editor.graph.createViewState(b.graphModelNode))}if(null==b.root.children||0==b.root.children.length)f=new mxCell,f.setId("1"),b.root.insert(f),b.needsUpdate=!0;return b};EditorUi.prototype.getDiagramSnapshot=function(){return{node:this.editor.getGraphXml(),page:this.currentPage}};
EditorUi.prototype.updateDiagramData=function(b,f){if(null==this.getPageIndex(b.page))this.insertPage(null,null,f);else{var l=new mxCodec(b.node.ownerDocument),u=new mxGraphModel;l.decode(b.node,u);l=new mxCodec(f.ownerDocument);var y=new mxGraphModel;l.decode(f,y);this.selectPage(b.page);f=this.diffCells(u.root,y.root);this.patchPage(b.page,f,null,!0)}};EditorUi.prototype.replaceDiagramData=function(b){this.editor.graph.model.execute(new ReplaceDiagram(this,mxUtils.parseXml(b).documentElement))};
EditorUi.prototype.selectPage=function(b,f,l){try{if(b!=this.currentPage){var u=this.editor.graph;u.isEditing()&&u.stopEditing(!1);f=null!=f?f:!1;u.isMouseDown=!1;u.reset();var y=u.model.createUndoableEdit();y.ignoreEdit=!0;var q=new SelectPage(this,b,l);q.execute();y.add(q);y.notify();f||u.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",y))}}catch(B){this.handleError(B)}};
EditorUi.prototype.selectNextPage=function(b){var f=this.currentPage;null!=f&&null!=this.pages&&(f=mxUtils.indexOf(this.pages,f),b?this.selectPage(this.pages[mxUtils.mod(f+1,this.pages.length)]):b||this.selectPage(this.pages[mxUtils.mod(f-1,this.pages.length)]))};
EditorUi.prototype.insertPage=function(b,f,l){this.editor.graph.isEnabled()&&(this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1),b=null!=b?b:this.createPage(null,this.createPageId(),l),f=null!=f?f:this.pages.length,f=new ChangePage(this,b,b,f),this.editor.graph.model.execute(f));return b};EditorUi.prototype.createPageId=function(){do var b=Editor.guid();while(null!=this.getPageById(b));return b};
EditorUi.prototype.createPage=function(b,f,l){f=new DiagramPage((null!=this.fileNode?this.fileNode.ownerDocument:document).createElement("diagram"),f);f.setName(null!=b?b:this.createPageName());this.initDiagramNode(f,l);return f};EditorUi.prototype.createPageName=function(){for(var b={},f=0;f<this.pages.length;f++){var l=this.pages[f].getName();null!=l&&0<l.length&&(b[l]=l)}f=this.pages.length;do l=mxResources.get("pageWithNumber",[++f]);while(null!=b[l]);return l};
EditorUi.prototype.removePage=function(b){try{var f=this.editor.graph,l=mxUtils.indexOf(this.pages,b);if(f.isEnabled()&&0<=l){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);f.model.beginUpdate();try{var u=this.currentPage;u==b&&1<this.pages.length?(l==this.pages.length-1?l--:l++,u=this.pages[l]):1>=this.pages.length&&(u=this.insertPage(),f.model.execute(new RenamePage(this,u,mxResources.get("pageWithNumber",[1]))));f.model.execute(new ChangePage(this,b,u))}finally{f.model.endUpdate()}}}catch(y){this.handleError(y)}return b};
EditorUi.prototype.duplicatePage=function(b,f){var l=null;try{var u=this.editor.graph;if(u.isEnabled()){u.isEditing()&&u.stopEditing();var y=b.node.cloneNode(!1);y.removeAttribute("id");var q={},B=u.createCellLookup([u.model.root]);l=new DiagramPage(y);l.root=u.cloneCell(u.model.root,null,q);var H=new mxGraphModel;H.prefix=Editor.guid()+"-";H.setRoot(l.root);u.updateCustomLinks(u.createCellMapping(q,B),[l.root]);l.viewState=b==this.currentPage?u.getViewState():b.viewState;this.initDiagramNode(l);
l.viewState.scale=1;delete l.viewState.scrollLeft;delete l.viewState.scrollTop;delete l.viewState.currentRoot;delete l.viewState.defaultParent;l.setName(f);l=this.insertPage(l,mxUtils.indexOf(this.pages,b)+1)}}catch(S){this.handleError(S)}return l};EditorUi.prototype.initDiagramNode=function(b,f){null==f&&(f=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(b.root)));this.editor.graph.saveViewState(b.viewState,f);EditorUi.removeChildNodes(b.node);b.node.appendChild(f)};
EditorUi.prototype.clonePages=function(b){for(var f=[],l=[],u=0;u<b.length;u++)try{l.push(this.clonePage(b[u]))}catch(y){f.push(mxResources.get("pageWithNumber",[u+1])+": "+y.toString())}if(0<f.length){b=Error(f.join("\n"));try{0<l.length&&(b.fallbackFileData=this.getXmlForPages(l))}catch(y){}throw b;}return l};
EditorUi.prototype.clonePage=function(b){this.updatePageRoot(b);var f=new DiagramPage(b.node.cloneNode(!0)),l=b==this.currentPage?this.editor.graph.getViewState():b.viewState;f.viewState=mxUtils.clone(l,EditorUi.transientViewStateProperties);f.root=this.editor.graph.model.cloneCell(b.root,null,!0);f.diagramModified=b.diagramModified;return f};
EditorUi.prototype.renamePage=function(b){if(this.editor.graph.isEnabled()){var f=new FilenameDialog(this,b.getName(),mxResources.get("rename"),mxUtils.bind(this,function(l){null!=l&&0<l.length&&this.editor.graph.model.execute(new RenamePage(this,b,l))}),mxResources.get("rename"));this.showDialog(f.container,300,80,!0,!0);f.init()}return b};EditorUi.prototype.movePage=function(b,f){this.editor.graph.model.execute(new MovePage(this,b,f))};
EditorUi.prototype.createTabContainer=function(){var b=document.createElement("div");b.className="geTabContainer geTabItem";return b};
EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&!this.isTabContainerVisible())this.tabContainer.style.display="none";else if(null!=this.tabContainer&&null!=this.pages){this.tabContainer.style.display="";var b=this.editor.graph,f=document.createElement("div");f.className="geTabScroller";for(var l=null,u=0;u<this.pages.length;u++)mxUtils.bind(this,function(y,q){q.className="geTab gePageTab";this.pages[y]==this.currentPage&&q.classList.add("geActivePage");q.setAttribute("draggable",
"true");mxEvent.addListener(q,"dragstart",mxUtils.bind(this,function(B){b.isEnabled()?(mxClient.IS_FF&&B.dataTransfer.setData("Text","<diagram/>"),l=y):mxEvent.consume(B)}));mxEvent.addListener(q,"dragend",mxUtils.bind(this,function(B){l=null;B.stopPropagation();B.preventDefault()}));mxEvent.addListener(q,"dragover",mxUtils.bind(this,function(B){null!=l&&(B.dataTransfer.dropEffect="move");B.stopPropagation();B.preventDefault()}));mxEvent.addListener(q,"drop",mxUtils.bind(this,function(B){null!=l&&
y!=l&&this.movePage(l,y);B.stopPropagation();B.preventDefault()}));f.appendChild(q)})(u,this.createTabForPage(this.pages[u],u+1));u=null!=this.tabScroller?this.tabScroller.scrollLeft:0;this.tabContainer.innerText="";this.isPageInsertTabVisible()&&this.tabContainer.appendChild(this.createPageInsertTab());"simple"!=Editor.currentTheme&&(this.pageMenuTab=this.createPageMenuTab(),this.tabContainer.appendChild(this.pageMenuTab));this.tabContainer.appendChild(f);this.leftScrollTab=this.createLeftScrollTab();
this.tabContainer.appendChild(this.leftScrollTab);this.rightScrollTab=this.createRightScrollTab();this.tabContainer.appendChild(this.rightScrollTab);this.tabScroller=f;this.tabScroller.scrollLeft=u;this.checkTabScrollerOverflow();mxEvent.addListener(this.tabScroller,"scroll",mxUtils.bind(this,function(y){this.checkTabScrollerOverflow()}))}};
EditorUi.prototype.checkTabScrollerOverflow=function(){null!=this.tabScroller&&null!=this.tabContainer&&2<this.tabContainer.children.length&&(this.tabScroller.scrollWidth>this.tabScroller.offsetWidth?(this.leftScrollTab.style.display="",this.rightScrollTab.style.display="",0==this.tabScroller.scrollLeft?this.leftScrollTab.classList.add("mxDisabled"):this.leftScrollTab.classList.remove("mxDisabled"),Math.ceil(this.tabScroller.scrollLeft)+this.tabScroller.offsetWidth>=this.tabScroller.scrollWidth?this.rightScrollTab.classList.add("mxDisabled"):
this.rightScrollTab.classList.remove("mxDisabled")):(this.leftScrollTab.style.display="none",this.rightScrollTab.style.display="none"))};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};EditorUi.prototype.createTab=function(){var b=document.createElement("div");b.className="geTab";return b};
EditorUi.prototype.getShortPageName=function(b){var f=null;null!=b&&(f=b.getName(),null!=f&&36<f.length&&(f=f.substring(0,34)+"..."));return f};EditorUi.prototype.createControlTab=function(b,f,l){var u=this.createTab();u.className="geTab geControlTab";null!=b&&u.setAttribute("title",b);b=document.createElement("div");b.className="geButton";b.style.backgroundImage="url("+f+")";u.appendChild(b);mxEvent.addListener(u,"click",l);return u};
EditorUi.prototype.createPageInsertTab=function(){return this.createControlTab(mxResources.get("insertPage"),Editor.plusImage,mxUtils.bind(this,function(b){try{this.insertPage()}catch(f){this.handleError(f)}mxEvent.consume(b)}))};
EditorUi.prototype.createLeftScrollTab=function(){return this.createControlTab(null,Editor.chevronLeftImage,mxUtils.bind(this,function(b){var f=Math.max(60,this.tabScroller.clientWidth/2);null!=this.tabScroller.scrollBy?this.tabScroller.scrollBy({left:-f,top:0,behavior:"smooth"}):this.tabScroller.scrollLeft-=f;mxEvent.consume(b)}))};
EditorUi.prototype.createRightScrollTab=function(){return this.createControlTab(null,Editor.chevronRightImage,mxUtils.bind(this,function(b){var f=Math.max(60,this.tabScroller.clientWidth/2);null!=this.tabScroller.scrollBy?this.tabScroller.scrollBy({left:f,top:0,behavior:"smooth"}):this.tabScroller.scrollLeft+=f;mxEvent.consume(b)}))};
EditorUi.prototype.createPageMenuTab=function(){return this.createControlTab(mxResources.get("pages"),Editor.menuImage,mxUtils.bind(this,function(b){this.editor.graph.popupMenuHandler.hideMenu();var f=new mxPopupMenu(mxUtils.bind(this,function(y,q){this.menus.get("pages").funct(y,q)}));f.smartSeparators=!0;f.showDisabled=!0;f.autoExpand=!0;f.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(f,arguments);f.destroy()});var l=mxEvent.getClientX(b),u=mxEvent.getClientY(b);f.popup(l,
u,null,b);this.setCurrentMenu(f);mxEvent.consume(b)}))};EditorUi.prototype.createTabForPage=function(b,f){var l=this.createTab(),u=b.getName()||mxResources.get("untitled"),y=b.getId();l.setAttribute("title",u+(null!=y?" ("+y+")":"")+" ["+f+"]");f=document.createElement("span");f.style.maxWidth="160px";f.style.textOverflow="ellipsis";f.style.overflow="hidden";mxUtils.write(f,u);l.appendChild(f);this.addTabListeners(b,l);return l};
EditorUi.prototype.addTabListeners=function(b,f){mxEvent.disableContextMenu(f);var l=this.editor.graph;mxEvent.addListener(f,"dblclick",mxUtils.bind(this,function(S){this.renamePage(b);mxEvent.consume(S)}));var u=document.createElement("div");u.style.backgroundImage="url("+Editor.thinExpandImage+")";u.className="geButton";f.appendChild(u);var y=!1,q=!1,B=mxUtils.bind(this,function(S){y=null!=this.currentMenu;q=b==this.currentPage;this.scrollToPage(b);l.isMouseDown||q||this.selectPage(b)}),H=mxUtils.bind(this,
function(S){if(!l.isMouseDown&&(q&&(mxEvent.isTouchEvent(S)||mxEvent.getSource(S)==u)||mxEvent.isPopupTrigger(S))&&(l.popupMenuHandler.hideMenu(),this.hideCurrentMenu(),!mxEvent.isTouchEvent(S)||!y)){var E=new mxPopupMenu(this.createPageMenu(b));E.smartSeparators=!0;E.showDisabled=!0;E.autoExpand=!0;E.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(E,arguments);this.resetCurrentMenu();E.destroy()});var Q=mxEvent.getClientX(S),c=mxEvent.getClientY(S);E.popup(Q,c,null,S);
this.setCurrentMenu(E,f)}mxEvent.consume(S)});mxEvent.addGestureListeners(u,B,null,H);mxEvent.addGestureListeners(f,B,null,H)};
EditorUi.prototype.createPageMenu=function(b,f){return mxUtils.bind(this,function(l,u){1!=urlParams.embed&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"draw.io"!=this.getServiceName()||navigator.standalone||l.addItem(mxResources.get("openInNewWindow"),null,mxUtils.bind(this,function(){this.editor.editAsNew(this.getFileData(!0,null,null,null,!0,!0))}),u));this.editor.graph.isEnabled()&&(l.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(b,mxResources.get("copyOf",
[b.getName()]))}),u),l.addSeparator(u),this.currentPage==b&&1<this.pages.length&&this.menus.addSubmenu("movePage",l,u,mxResources.get("move")),l.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(b)}),u),l.addItem(mxResources.get("rename")+"...",null,mxUtils.bind(this,function(){this.renamePage(b,f)}),u))})};(function(){var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(u,y,q,B,H){y=null!=y?y:!1;null==q&&(q=this.getFoldableCells(this.getSelectionCells(),u));this.stopEditing();this.model.beginUpdate();try{for(var S=q.slice(),E=0;E<q.length;E++)"1"==mxUtils.getValue(this.getCurrentCellStyle(q[E]),"treeFolding","0")&&this.foldTreeCell(u,q[E]);q=S;q=b.apply(this,arguments)}finally{this.model.endUpdate()}return q};Graph.prototype.foldTreeCell=function(u,y){this.model.beginUpdate();try{var q=
[];this.traverse(y,!0,mxUtils.bind(this,function(H,S){var E=null!=S&&this.isTreeEdge(S);E&&q.push(S);H==y||null!=S&&!E||q.push(H);return(null==S||E)&&(H==y||!this.model.isCollapsed(H))}));this.model.setCollapsed(y,u);for(var B=0;B<q.length;B++)this.model.setVisible(q[B],!u)}finally{this.model.endUpdate()}};Graph.prototype.isTreeEdge=function(u){return!this.isEdgeIgnored(u)};Graph.prototype.getTreeEdges=function(u,y,q,B,H,S){return this.model.filterCells(this.getEdges(u,y,q,B,H,S),mxUtils.bind(this,
function(E){return this.isTreeEdge(E)}))};Graph.prototype.getIncomingTreeEdges=function(u,y){return this.getTreeEdges(u,y,!0,!1,!1)};Graph.prototype.getOutgoingTreeEdges=function(u,y){return this.getTreeEdges(u,y,!1,!0,!1)};var f=EditorUi.prototype.init;EditorUi.prototype.init=function(){f.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function u(Z){return x.isVertex(Z)&&q(Z)}function y(Z){var k=!1;null!=Z&&(k="1"==
n.getCurrentCellStyle(Z).treeMoving);return k}function q(Z){var k=!1;null!=Z&&(Z=x.getParent(Z),k=n.view.getState(Z),k="tree"==(null!=k?k.style:n.getCellStyle(Z)).containerType);return k}function B(Z){var k=!1;null!=Z&&(Z=x.getParent(Z),k=n.view.getState(Z),n.view.getState(Z),k=null!=(null!=k?k.style:n.getCellStyle(Z)).childLayout);return k}function H(Z){Z=n.view.getState(Z);if(null!=Z){var k=n.getIncomingTreeEdges(Z.cell);if(0<k.length&&(k=n.view.getState(k[0]),null!=k&&(k=k.absolutePoints,null!=
k&&0<k.length&&(k=k[k.length-1],null!=k)))){if(k.y==Z.y&&Math.abs(k.x-Z.getCenterX())<Z.width/2)return mxConstants.DIRECTION_SOUTH;if(k.y==Z.y+Z.height&&Math.abs(k.x-Z.getCenterX())<Z.width/2)return mxConstants.DIRECTION_NORTH;if(k.x>Z.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function S(Z,k){k=null!=k?k:!0;n.model.beginUpdate();try{var v=n.model.getParent(Z),J=n.getIncomingTreeEdges(Z),N=n.cloneCells([J[0],Z]);n.model.setTerminal(N[0],n.model.getTerminal(J[0],
!0),!0);var T=H(Z),V=v.geometry;T==mxConstants.DIRECTION_SOUTH||T==mxConstants.DIRECTION_NORTH?N[1].geometry.x+=k?Z.geometry.width+10:-N[1].geometry.width-10:N[1].geometry.y+=k?Z.geometry.height+10:-N[1].geometry.height-10;n.view.currentRoot!=v&&(N[1].geometry.x-=V.x,N[1].geometry.y-=V.y);var U=n.view.getState(Z),X=n.view.scale;if(null!=U){var fa=mxRectangle.fromRectangle(U);T==mxConstants.DIRECTION_SOUTH||T==mxConstants.DIRECTION_NORTH?fa.x+=(k?Z.geometry.width+10:-N[1].geometry.width-10)*X:fa.y+=
(k?Z.geometry.height+10:-N[1].geometry.height-10)*X;var na=n.getOutgoingTreeEdges(n.model.getTerminal(J[0],!0));if(null!=na){for(var la=T==mxConstants.DIRECTION_SOUTH||T==mxConstants.DIRECTION_NORTH,qa=V=J=0;qa<na.length;qa++){var ya=n.model.getTerminal(na[qa],!1);if(T==H(ya)){var wa=n.view.getState(ya);ya!=Z&&null!=wa&&(la&&k!=wa.getCenterX()<U.getCenterX()||!la&&k!=wa.getCenterY()<U.getCenterY())&&mxUtils.intersects(fa,wa)&&(J=10+Math.max(J,(Math.min(fa.x+fa.width,wa.x+wa.width)-Math.max(fa.x,wa.x))/
X),V=10+Math.max(V,(Math.min(fa.y+fa.height,wa.y+wa.height)-Math.max(fa.y,wa.y))/X))}}la?V=0:J=0;for(qa=0;qa<na.length;qa++)if(ya=n.model.getTerminal(na[qa],!1),T==H(ya)&&(wa=n.view.getState(ya),ya!=Z&&null!=wa&&(la&&k!=wa.getCenterX()<U.getCenterX()||!la&&k!=wa.getCenterY()<U.getCenterY()))){var Ja=[];n.traverse(wa.cell,!0,function(Aa,Ba){var Ga=null!=Ba&&n.isTreeEdge(Ba);Ga&&Ja.push(Ba);(null==Ba||Ga)&&Ja.push(Aa);return null==Ba||Ga});n.moveCells(Ja,(k?1:-1)*J,(k?1:-1)*V)}}}return n.addCells(N,
v)}finally{n.model.endUpdate()}}function E(Z){n.model.beginUpdate();try{var k=H(Z),v=n.getIncomingTreeEdges(Z),J=n.cloneCells([v[0],Z]);n.model.setTerminal(v[0],J[1],!1);n.model.setTerminal(J[0],J[1],!0);n.model.setTerminal(J[0],Z,!1);var N=n.model.getParent(Z),T=N.geometry,V=[];n.view.currentRoot!=N&&(J[1].geometry.x-=T.x,J[1].geometry.y-=T.y);n.traverse(Z,!0,function(fa,na){var la=null!=na&&n.isTreeEdge(na);la&&V.push(na);(null==na||la)&&V.push(fa);return null==na||la});var U=Z.geometry.width+40,
X=Z.geometry.height+40;k==mxConstants.DIRECTION_SOUTH?U=0:k==mxConstants.DIRECTION_NORTH?(U=0,X=-X):k==mxConstants.DIRECTION_WEST?(U=-U,X=0):k==mxConstants.DIRECTION_EAST&&(X=0);n.moveCells(V,U,X);return n.addCells(J,N)}finally{n.model.endUpdate()}}function Q(Z,k){n.model.beginUpdate();try{var v=n.model.getParent(Z),J=n.getIncomingTreeEdges(Z),N=H(Z);0==J.length&&(J=[n.createEdge(v,null,"",null,null,n.createCurrentEdgeStyle())],N=k);var T=n.cloneCells([J[0],Z]);n.model.setTerminal(T[0],Z,!0);null==
n.model.getTerminal(T[0],!1)&&(n.model.setTerminal(T[0],T[1],!1),n.applyNewEdgeStyle(T[1],[T[0]],N));J=n.getOutgoingTreeEdges(Z);var V=v.geometry;k=[];n.view.currentRoot==v&&(V=new mxRectangle);for(var U=0;U<J.length;U++){var X=n.model.getTerminal(J[U],!1);null!=X&&k.push(X)}var fa=n.view.getBounds(k),na=n.view.translate,la=n.view.scale;N==mxConstants.DIRECTION_SOUTH?(T[1].geometry.x=null==fa?Z.geometry.x+(Z.geometry.width-T[1].geometry.width)/2:(fa.x+fa.width)/la-na.x-V.x+10,T[1].geometry.y+=T[1].geometry.height-
V.y+40):N==mxConstants.DIRECTION_NORTH?(T[1].geometry.x=null==fa?Z.geometry.x+(Z.geometry.width-T[1].geometry.width)/2:(fa.x+fa.width)/la-na.x+-V.x+10,T[1].geometry.y-=T[1].geometry.height+V.y+40):(T[1].geometry.x=N==mxConstants.DIRECTION_WEST?T[1].geometry.x-(T[1].geometry.width+V.x+40):T[1].geometry.x+(T[1].geometry.width-V.x+40),T[1].geometry.y=null==fa?Z.geometry.y+(Z.geometry.height-T[1].geometry.height)/2:(fa.y+fa.height)/la-na.y+-V.y+10);return n.addCells(T,v)}finally{n.model.endUpdate()}}
function c(Z,k,v){Z=n.getOutgoingTreeEdges(Z);v=n.view.getState(v);var J=[];if(null!=v&&null!=Z){for(var N=0;N<Z.length;N++){var T=n.view.getState(n.model.getTerminal(Z[N],!1));null!=T&&(!k&&Math.min(T.x+T.width,v.x+v.width)>=Math.max(T.x,v.x)||k&&Math.min(T.y+T.height,v.y+v.height)>=Math.max(T.y,v.y))&&J.push(T)}J.sort(function(V,U){return k?V.x+V.width-U.x-U.width:V.y+V.height-U.y-U.height})}return J}function g(Z,k){var v=H(Z),J=k==mxConstants.DIRECTION_EAST||k==mxConstants.DIRECTION_WEST;(v==mxConstants.DIRECTION_EAST||
v==mxConstants.DIRECTION_WEST)==J&&v!=k?m.actions.get("selectParent").funct():v==k?(k=n.getOutgoingTreeEdges(Z),null!=k&&0<k.length&&n.setSelectionCell(n.model.getTerminal(k[0],!1))):(v=n.getIncomingTreeEdges(Z),null!=v&&0<v.length&&(J=c(n.model.getTerminal(v[0],!0),J,Z),Z=n.view.getState(Z),null!=Z&&(Z=mxUtils.indexOf(J,Z),0<=Z&&(Z+=k==mxConstants.DIRECTION_NORTH||k==mxConstants.DIRECTION_WEST?-1:1,0<=Z&&Z<=J.length-1&&n.setSelectionCell(J[Z].cell)))))}var m=this,n=m.editor.graph,x=n.getModel(),
F=m.menus.createPopupMenu;m.menus.createPopupMenu=function(Z,k,v){F.apply(this,arguments);if(1==n.getSelectionCount()){k=n.getSelectionCell();var J=n.getOutgoingTreeEdges(k);Z.addSeparator();0<J.length&&(u(n.getSelectionCell())&&this.addMenuItems(Z,["selectChildren"],null,v),this.addMenuItems(Z,["selectDescendants"],null,v));u(n.getSelectionCell())?(Z.addSeparator(),0<n.getIncomingTreeEdges(k).length&&this.addMenuItems(Z,["selectSiblings","selectParent"],null,v)):0<n.model.getEdgeCount(k)&&this.addMenuItems(Z,
["selectConnections"],null,v)}};m.actions.addAction("selectChildren",function(Z){if(n.isEnabled()&&1==n.getSelectionCount()){var k=n.getSelectionCell();Z=mxEvent.isControlDown(Z)?null:n.getOutgoingTreeEdges(k);if(null!=Z&&0<Z.length){k=[];for(var v=0;v<Z.length;v++)k.push(n.model.getTerminal(Z[v],!1));n.setSelectionCells(k)}else n.setSelectionCells(n.model.getChildren(k))}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+C");m.actions.addAction("selectDescendants",function(Z){var k=n.getSelectionCell();
if(n.isEnabled()&&null!=k){var v=[];mxEvent.isControlDown(Z)||n.traverse(k,!0,function(J,N){var T=null!=N&&n.isTreeEdge(N);T&&mxEvent.isControlDown(Z)&&v.push(N);(null==N||T)&&v.push(J);return null==N||T});if(0==v.length||1==v.length&&v[0]==k)v=n.model.getDescendants(k);n.setSelectionCells(v)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+X");m.actions.addAction("selectParent",function(Z){var k=n.getSelectionCell();n.isEnabled()&&null!=k&&(Z=mxEvent.isControlDown(Z)?null:n.getIncomingTreeEdges(k),
null!=Z&&0<Z.length?n.setSelectionCell(n.model.getTerminal(Z[0],!0)):n.selectParentCell())},null,null,Editor.altKey+"+"+Editor.shiftKey+"+P");m.actions.addAction("selectSiblings",function(Z){if(n.isEnabled()&&1==n.getSelectionCount()){var k=n.getSelectionCell(),v=mxEvent.isControlDown(Z)?null:n.getIncomingTreeEdges(k);Z=[];if(null!=v&&0<v.length&&(v=n.getOutgoingTreeEdges(n.model.getTerminal(v[0],!0)),null!=v))for(var J=0;J<v.length;J++)Z.push(n.model.getTerminal(v[J],!1));0==Z.length&&(Z=n.model.getChildren(n.model.getParent(k)));
n.setSelectionCells(Z)}},null,null,Editor.altKey+"+"+Editor.shiftKey+"+S");var I=n.removeCells;n.removeCells=function(Z,k){k=null!=k?k:!0;null==Z&&(Z=this.getDeletableCells(this.getSelectionCells()));k&&(Z=this.getDeletableCells(this.addAllEdges(Z)));for(var v=[],J=0;J<Z.length;J++){var N=Z[J];x.isEdge(N)&&q(N)&&(v.push(N),N=x.getTerminal(N,!1));if(u(N)){var T=[];n.traverse(N,!0,function(V,U){var X=null!=U&&n.isTreeEdge(U);X&&T.push(U);(null==U||X)&&T.push(V);return null==U||X});0<T.length&&(v=v.concat(T),
N=n.getIncomingTreeEdges(Z[J]),Z=Z.concat(N))}else null!=N&&v.push(Z[J])}Z=v;return I.apply(this,arguments)};m.hoverIcons.getStateAt=function(Z,k,v){return u(Z.cell)?null:this.graph.view.getState(this.graph.getCellAt(k,v))};var M=n.duplicateCells;n.duplicateCells=function(Z,k){Z=null!=Z?Z:this.getSelectionCells();for(var v=Z.slice(0),J=0;J<v.length;J++){var N=n.view.getState(v[J]);if(null!=N&&u(N.cell)){var T=n.getIncomingTreeEdges(N.cell);for(N=0;N<T.length;N++)mxUtils.remove(T[N],Z)}}this.model.beginUpdate();
try{var V=M.call(this,Z,k);if(V.length==Z.length)for(J=0;J<Z.length;J++)if(u(Z[J])){var U=n.getIncomingTreeEdges(V[J]);T=n.getIncomingTreeEdges(Z[J]);if(0==U.length&&0<T.length){var X=this.cloneCell(T[0]);this.addEdge(X,n.getDefaultParent(),this.model.getTerminal(T[0],!0),V[J])}}}finally{this.model.endUpdate()}return V};var L=n.moveCells;n.moveCells=function(Z,k,v,J,N,T,V){for(var U=null,X=[],fa=0;fa<Z.length;fa++)(y(Z[fa])||u(Z[fa]))&&!B(Z[fa])&&this.isCellCollapsed(Z[fa])?X=X.concat(this.getSubtree(Z[fa])):
X.push(Z[fa]);Z=mxUtils.removeDuplicates(X);this.model.beginUpdate();try{X=N;var na=this.getCurrentCellStyle(N);if(null!=Z&&u(N)&&"1"==mxUtils.getValue(na,"treeFolding","0")){for(fa=0;fa<Z.length;fa++)if(u(Z[fa])||n.model.isEdge(Z[fa])&&null==n.model.getTerminal(Z[fa],!0)){N=n.model.getParent(Z[fa]);break}if(null!=X&&N!=X&&null!=this.view.getState(Z[0])){var la=n.getIncomingTreeEdges(Z[0]);if(0<la.length){var qa=n.view.getState(n.model.getTerminal(la[0],!0));if(null!=qa){var ya=n.view.getState(X);
null!=ya&&(k=(ya.getCenterX()-qa.getCenterX())/n.view.scale,v=(ya.getCenterY()-qa.getCenterY())/n.view.scale)}}}}U=L.apply(this,arguments);if(null!=U&&null!=Z&&U.length==Z.length)for(fa=0;fa<U.length;fa++)if(this.model.isEdge(U[fa]))u(X)&&0>mxUtils.indexOf(U,this.model.getTerminal(U[fa],!0))&&this.model.setTerminal(U[fa],X,!0);else if(u(Z[fa])&&(la=n.getIncomingTreeEdges(Z[fa]),0<la.length))if(!J)u(X)&&0>mxUtils.indexOf(Z,this.model.getTerminal(la[0],!0))&&this.model.setTerminal(la[0],X,!0);else if(0==
n.getIncomingTreeEdges(U[fa]).length){na=X;if(null==na||na==n.model.getParent(Z[fa]))na=n.model.getTerminal(la[0],!0);J=this.cloneCell(la[0]);this.addEdge(J,n.getDefaultParent(),na,U[fa])}}finally{this.model.endUpdate()}return U};if(null!=m.sidebar){var K=m.sidebar.dropAndConnect;m.sidebar.dropAndConnect=function(Z,k,v,J){var N=n.model,T=null;N.beginUpdate();try{if(T=K.apply(this,arguments),u(Z))for(var V=0;V<T.length;V++)if(N.isEdge(T[V])&&null==N.getTerminal(T[V],!0)){N.setTerminal(T[V],Z,!0);var U=
n.getCellGeometry(T[V]);U.points=null;null!=U.getTerminalPoint(!0)&&U.setTerminalPoint(null,!0)}}finally{N.endUpdate()}return T}}var aa={67:m.actions.get("selectChildren"),88:m.actions.get("selectDescendants"),80:m.actions.get("selectParent"),83:m.actions.get("selectSiblings")},ja={67:m.actions.get("copyStyle"),86:m.actions.get("pasteStyle")},ca=m.onKeyDown;m.onKeyDown=function(Z){try{var k=n.getSelectionCell();if(n.isEnabled()&&!n.isEditing()&&null!=k){var v=mxEvent.isAltDown(Z)&&mxEvent.isShiftDown(Z)?
aa[Z.keyCode]:mxEvent.isAltDown(Z)?ja[Z.keyCode]:null;null!=v?(v.funct(Z),mxEvent.consume(Z)):u(k)&&(v=null,0<n.getIncomingTreeEdges(k).length&&(9==Z.which?v=mxEvent.isShiftDown(Z)?E(k):Q(k):13==Z.which&&(v=S(k,!mxEvent.isShiftDown(Z)))),null!=v&&0<v.length?(1==v.length&&n.model.isEdge(v[0])?n.setSelectionCell(n.model.getTerminal(v[0],!1)):n.setSelectionCell(v[v.length-1]),null!=m.hoverIcons&&m.hoverIcons.update(n.view.getState(k)),n.startEditingAtCell(k),mxEvent.consume(Z)):37==Z.keyCode?(g(k,mxConstants.DIRECTION_WEST),
mxEvent.consume(Z)):38==Z.keyCode?(g(k,mxConstants.DIRECTION_NORTH),mxEvent.consume(Z)):39==Z.keyCode?(g(k,mxConstants.DIRECTION_EAST),mxEvent.consume(Z)):40==Z.keyCode&&(g(k,mxConstants.DIRECTION_SOUTH),mxEvent.consume(Z)))}}catch(J){m.handleError(J)}mxEvent.isConsumed(Z)||ca.apply(this,arguments)};var ba=n.connectVertex;n.connectVertex=function(Z,k,v,J,N,T,V){var U=n.getIncomingTreeEdges(Z);if(u(Z)){var X=H(Z),fa=X==mxConstants.DIRECTION_EAST||X==mxConstants.DIRECTION_WEST,na=k==mxConstants.DIRECTION_EAST||
k==mxConstants.DIRECTION_WEST;return X==k||0==U.length?Q(Z,k):fa==na?E(Z):S(Z,k!=mxConstants.DIRECTION_NORTH&&k!=mxConstants.DIRECTION_WEST)}return ba.apply(this,arguments)};n.getSubtree=function(Z){var k=[Z];!y(Z)&&!u(Z)||B(Z)||n.traverse(Z,!0,function(v,J){var N=null!=J&&n.isTreeEdge(J);N&&0>mxUtils.indexOf(k,J)&&k.push(J);(null==J||N)&&0>mxUtils.indexOf(k,v)&&k.push(v);return null==J||N});return k};var oa=mxVertexHandler.prototype.refresh;mxVertexHandler.prototype.refresh=function(){oa.apply(this,
arguments);(y(this.state.cell)||u(this.state.cell))&&!B(this.state.cell)&&0<this.graph.getOutgoingTreeEdges(this.state.cell).length&&!this.graph.isCellCollapsed(this.state.cell)?null==this.moveHandle&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="24px",this.moveHandle.style.height="24px",this.graph.container.appendChild(this.moveHandle),
this.redrawMoveHandle(),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(Z){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(Z),mxEvent.getClientY(Z),this.graph.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(Z);this.graph.isMouseDown=!0;m.hoverIcons.reset();mxEvent.consume(Z)}))):null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)};var Y=mxVertexHandler.prototype.redrawHandles;
mxVertexHandler.prototype.redrawHandles=function(){Y.apply(this,arguments);this.redrawMoveHandle()};mxVertexHandler.prototype.redrawMoveHandle=function(){null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var da=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(Z){da.apply(this,arguments);null!=
this.moveHandle&&(this.moveHandle.style.display=Z?"":"none")};var ha=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(Z,k){ha.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var l=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var u=l.apply(this,arguments),y=this.graph,q=this;return u.concat([this.addEntry("tree container",
function(){var B=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;startSize=20;horizontal=1;containerType=tree;");B.vertex=!0;var H=new mxCell("Parent",new mxGeometry(140,60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');H.vertex=!0;var S=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');
S.vertex=!0;var E=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");E.geometry.relative=!0;E.edge=!0;H.insertEdge(E,!0);S.insertEdge(E,!1);B.insert(E);B.insert(H);B.insert(S);return q.createVertexTemplateFromCells([B],B.geometry.width,B.geometry.height,B.value)}),this.addEntry("tree mindmap mindmaps central idea branch topic",function(){var B=new mxCell("Mindmap",new mxGeometry(0,
0,420,126),"swimlane;startSize=20;horizontal=1;containerType=tree;");B.vertex=!0;var H=new mxCell("Central Idea",new mxGeometry(160,60,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');H.vertex=!0;var S=new mxCell("Topic",new mxGeometry(320,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
S.vertex=!0;var E=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");E.geometry.relative=!0;E.edge=!0;H.insertEdge(E,!0);S.insertEdge(E,!1);var Q=new mxCell("Branch",new mxGeometry(320,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
Q.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),E.style);c.geometry.relative=!0;c.edge=!0;H.insertEdge(c,!0);Q.insertEdge(c,!1);var g=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
g.vertex=!0;var m=new mxCell("",new mxGeometry(0,0,0,0),E.style);m.geometry.relative=!0;m.edge=!0;H.insertEdge(m,!0);g.insertEdge(m,!1);var n=new mxCell("Branch",new mxGeometry(20,80,72,26),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
n.vertex=!0;var x=new mxCell("",new mxGeometry(0,0,0,0),E.style);x.geometry.relative=!0;x.edge=!0;H.insertEdge(x,!0);n.insertEdge(x,!1);B.insert(E);B.insert(c);B.insert(m);B.insert(x);B.insert(H);B.insert(S);B.insert(Q);B.insert(g);B.insert(n);return q.createVertexTemplateFromCells([B],B.geometry.width,B.geometry.height,B.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var B=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};treeFolding=1;treeMoving=1;');
B.vertex=!0;return q.createVertexTemplateFromCells([B],B.geometry.width,B.geometry.height,B.value)}),this.addEntry("tree mindmap mindmaps branch",function(){var B=new mxCell("Branch",new mxGeometry(0,0,80,20),'whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;recursiveResize=0;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');
B.vertex=!0;var H=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");H.geometry.setTerminalPoint(new mxPoint(-40,40),!0);H.geometry.relative=!0;H.edge=!0;B.insertEdge(H,!1);return q.createVertexTemplateFromCells([B,H],B.geometry.width,B.geometry.height,B.value)}),this.addEntry("tree mindmap mindmaps sub topic",function(){var B=new mxCell("Sub Topic",new mxGeometry(0,0,80,26),
'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1,"sourcePerimeterSpacing":0,"targetPerimeterSpacing":0};');B.vertex=!0;var H=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;");
H.geometry.setTerminalPoint(new mxPoint(-40,40),!0);H.geometry.relative=!0;H.edge=!0;B.insertEdge(H,!1);return q.createVertexTemplateFromCells([B,H],B.geometry.width,B.geometry.height,B.value)}),this.addEntry("tree orgchart organization division",function(){var B=new mxCell("Orgchart",new mxGeometry(0,0,280,220),'swimlane;startSize=20;horizontal=1;containerType=tree;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');B.vertex=!0;var H=new mxCell("Organization",new mxGeometry(80,
40,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');y.setAttributeForCell(H,"treeRoot","1");H.vertex=!0;var S=new mxCell("Division",new mxGeometry(20,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');S.vertex=!0;var E=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");
E.geometry.relative=!0;E.edge=!0;H.insertEdge(E,!0);S.insertEdge(E,!1);var Q=new mxCell("Division",new mxGeometry(160,140,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');Q.vertex=!0;var c=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");c.geometry.relative=
!0;c.edge=!0;H.insertEdge(c,!0);Q.insertEdge(c,!1);B.insert(E);B.insert(c);B.insert(H);B.insert(S);B.insert(Q);return q.createVertexTemplateFromCells([B],B.geometry.width,B.geometry.height,B.value)}),this.addEntry("tree root",function(){var B=new mxCell("Organization",new mxGeometry(0,0,120,60),'whiteSpace=wrap;html=1;align=center;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');y.setAttributeForCell(B,"treeRoot","1");B.vertex=!0;return q.createVertexTemplateFromCells([B],
B.geometry.width,B.geometry.height,B.value)}),this.addEntry("tree division",function(){var B=new mxCell("Division",new mxGeometry(20,40,100,60),'whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');B.vertex=!0;var H=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;curved=0;");
H.geometry.setTerminalPoint(new mxPoint(0,0),!0);H.geometry.relative=!0;H.edge=!0;B.insertEdge(H,!1);return q.createVertexTemplateFromCells([B,H],B.geometry.width,B.geometry.height,B.value)}),this.addEntry("tree sub sections",function(){var B=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");B.vertex=!0;var H=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;curved=0;rounded=0;");
H.geometry.setTerminalPoint(new mxPoint(110,-40),!0);H.geometry.relative=!0;H.edge=!0;B.insertEdge(H,!1);var S=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;treeFolding=1;treeMoving=1;");S.vertex=!0;var E=new mxCell("",new mxGeometry(0,0,0,0),H.style);E.geometry.setTerminalPoint(new mxPoint(110,-40),!0);E.geometry.relative=!0;E.edge=!0;S.insertEdge(E,!1);return q.createVertexTemplateFromCells([H,E,B,S],220,60,"Sub Sections")})])}}})();Editor.themes.push("min");EditorUi.windowed="0"!=urlParams.windows;
EditorUi.initMinimalTheme=function(){function b(E,Q){if(EditorUi.windowed){var c=E.editor.graph;c.popupMenuHandler.hideMenu();null==E.formatWindow?(E.formatWindow=new WrapperWindow(E,"",Math.max(10,E.diagramContainer.clientWidth-248),60,240,Math.min(566,c.container.clientHeight-10),function(g){g.className="geSidebarContainer geFormatContainer";E.createFormat(g).init()}),E.dependsOnLanguage(mxUtils.bind(this,function(){E.formatWindow.window.setTitle(mxResources.get("format"))})),E.formatWindow.window.addListener(mxEvent.SHOW,
mxUtils.bind(this,function(){E.formatWindow.window.fit()})),E.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)):E.formatWindow.window.setVisible(null!=Q?Q:!E.formatWindow.window.isVisible())}else null==E.formatElt&&(E.formatElt=E.createSidebarContainer(),E.createFormat(E.formatElt).init(),E.formatElt.style.border="none",E.formatElt.style.width="240px",E.formatElt.style.borderLeftWidth="1px",E.formatElt.style.borderLeftStyle="solid",E.formatElt.style.right="0px"),Q=E.diagramContainer.parentNode,
null!=E.formatElt.parentNode?(E.formatElt.parentNode.removeChild(E.formatElt),Q.style.right="0px"):(Q.parentNode.appendChild(E.formatElt),Q.style.right=E.formatElt.style.width)}function f(E,Q){if(EditorUi.windowed){var c=E.editor.graph;c.popupMenuHandler.hideMenu();null==E.sidebarWindow?(E.sidebarWindow=new WrapperWindow(E,"",10,56,Math.min(c.container.clientWidth-10,218)-6,Math.min(c.container.clientHeight-40,650)-6,function(g){E.createShapesPanel(g)}),E.dependsOnLanguage(mxUtils.bind(this,function(){E.sidebarWindow.window.setTitle(mxResources.get("shapes"))})),
E.sidebarWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){E.sidebarWindow.window.fit()})),E.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90),E.sidebarWindow.window.setVisible(!0),isLocalStorage&&E.getLocalData("sidebar",function(g){E.sidebar.showEntries(g,null,!0)}),E.restoreLibraries()):E.sidebarWindow.window.setVisible(null!=Q?Q:!E.sidebarWindow.window.isVisible())}else null==E.sidebarElt&&(E.sidebarElt=E.createSidebarContainer(),E.createShapesPanel(E.sidebarElt),E.sidebarElt.style.border=
"none",E.sidebarElt.style.width="210px",E.sidebarElt.style.borderRight="1px solid gray"),Q=E.diagramContainer.parentNode,null!=E.sidebarElt.parentNode?(E.sidebarElt.parentNode.removeChild(E.sidebarElt),Q.style.left="0px"):(Q.parentNode.appendChild(E.sidebarElt),Q.style.left=E.sidebarElt.style.width)}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var l=0;try{l=window.innerWidth||document.documentElement.clientWidth||
document.body.clientWidth}catch(E){}Menus.prototype.autoPopup=!1;mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke-width="2" style="stroke-opacity:0.4" stroke="#ffffff"/><path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="#29b6f2"/>');mxOutline.prototype.sizerImage=null;mxConstants.VERTEX_SELECTION_COLOR="#C0C0C0";mxConstants.EDGE_SELECTION_COLOR="#C0C0C0";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.DEFAULT_VALID_COLOR="#29b6f2";mxConstants.GUIDE_COLOR=
"#C0C0C0";mxConstants.OUTLINE_COLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#29b6f2";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#fff";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowSize="0.6";Graph.prototype.svgShadowBlur="1.2";mxRubberband.prototype.defaultOpacity=50;HoverIcons.prototype.inactiveOpacity=25;EditorUi.prototype.closableScratchpad=!1;Graph.prototype.editAfterInsert=!mxClient.IS_IOS&&!mxClient.IS_ANDROID;Editor.prototype.isChromelessView=
function(){return!1};Graph.prototype.isLightboxView=function(){return!1};var u=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){u.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var y=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(E,Q){null!=Q.shortcut&&900>l&&!mxClient.IS_IOS?E.firstChild.nextSibling.setAttribute("title",Q.shortcut):y.apply(this,arguments)};EditorUi.prototype.toggleFormatPanel=
function(E){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=E?E:!this.formatWindow.window.isVisible()):b(this)};EditorUi.prototype.isFormatPanelVisible=function(){return null!=this.formatWindow&&this.formatWindow.window.isVisible()||null==this.formatWindow&&0<this.formatWidth};var q=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.destroyWindows();q.apply(this,arguments)};var B=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(E){B.apply(this,
arguments);if(E){var Q=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;1E3<=Q&&null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&1E3<=Q&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};EditorUi.prototype.installFormatToolbar=function(E){var Q=
this.editor.graph,c=document.createElement("div");c.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";Q.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(g,m){0<Q.getSelectionCount()?(E.appendChild(c),c.innerHTML="Selected: "+Q.getSelectionCount()):null!=c.parentNode&&c.parentNode.removeChild(c)}))};var H=!1;EditorUi.prototype.initFormatWindow=
function(){if(!H&&null!=this.formatWindow){H=!0;var E=this.formatWindow.window.toggleMinimized,Q=240;this.formatWindow.window.toggleMinimized=function(){E.apply(this,arguments);this.minimized?(Q=parseInt(this.div.style.width),this.div.style.width="140px",this.table.style.width="140px",this.div.style.left=parseInt(this.div.style.left)+Q-140+"px"):(this.div.style.width=Q+"px",this.table.style.width=this.div.style.width,this.div.style.left=Math.max(0,parseInt(this.div.style.left)-Q+140)+"px");this.fit()};
mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(c){mxEvent.getSource(c)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var S=EditorUi.prototype.init;EditorUi.prototype.init=function(){function E(J,N,T){var V=n.menus.get(J);N=I.addMenu(mxResources.get(J),mxUtils.bind(this,function(){V.funct.apply(this,arguments)}));N.className="geButton";N.setAttribute("title",mxResources.get(J));n.menus.menuCreated(V,N,"geButton");null!=T&&
(N.style.backgroundImage="url("+T+")",N.innerText="");return N}function Q(J,N,T,V,U,X){var fa=document.createElement("a");fa.className="geButton";F.appendChild(fa);null!=X?fa.style.backgroundImage="url("+X+")":mxUtils.write(fa,J);mxEvent.addListener(fa,"click",function(na){"disabled"!=fa.getAttribute("disabled")&&N(na);mxEvent.consume(na)});mxEvent.preventDefault(fa);null!=V&&fa.setAttribute("title",V);null!=U&&(J=function(){U.isEnabled()?fa.removeAttribute("disabled"):fa.setAttribute("disabled",
"disabled")},U.addListener("stateChanged",J),x.addListener("enabledChanged",J),J());return fa}function c(J,N,T){N=document.createElement("div");N.className="geButtonGroup";for(T=0;T<J.length;T++)null!=J[T]&&N.appendChild(J[T]);F.appendChild(N);return N}function g(){l=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;F.innerHTML="";var J=1E3>l,N=E("diagram",null,J?Editor.menuImage:null);c([N,Q(mxResources.get("shapes"),n.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),
n.actions.get("image"),J?Editor.shapesImage:null),Q(mxResources.get("format"),n.actions.get("format").funct,null,mxResources.get("format")+" ("+n.actions.get("format").shortcut+")",n.actions.get("image"),J?Editor.formatImage:null)]);N=E("insert",!0,J?ja:null);c([N,Q(mxResources.get("delete"),n.actions.get("delete").funct,null,mxResources.get("delete"),n.actions.get("delete"),J?Editor.trashImage:null)]);x.isEnabled()||N.setAttribute("disabled","disabled");Z.setAttribute("title",mxResources.get("undo")+
" ("+da.shortcut+")");k.setAttribute("title",mxResources.get("redo")+" ("+ha.shortcut+")");v.setAttribute("title",mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)");411<=l&&(c([Z,k]),520<=l&&c([v,640<=l?Q("",oa.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",oa,Editor.zoomInImage):null,640<=l?Q("",Y.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",Y,Editor.zoomOutImage):null]));F.appendChild(n.statusContainer);F.appendChild(n.buttonContainer)}S.apply(this,arguments);var m=
mxUtils.isAncestorNode(document.body,this.container)?this.container:this.editor.graph.container;null!=m&&(m.classList.add("geSimple"),m.classList.add("geMinimal"),m.classList.remove("geClassic"));this.sidebar=this.createSidebar(this.sidebarContainer);if(1E3<=l||null!=urlParams.clibs||null!=urlParams.libs||null!=urlParams["search-shapes"])f(this,!0),null!=this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search"));
EditorUi.windowed&&1E3<=l&&(b(this,!0),this.formatWindow.window.setVisible(!0));var n=this,x=n.editor.graph;n.toolbar=this.createToolbar(n.createDiv("geToolbar"));var F=document.createElement("div");F.className="geMenubarContainer";var I=new Menubar(n,F),M=n.hideCurrentMenu;n.hideCurrentMenu=function(){M.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var L=n.descriptorChanged;n.descriptorChanged=function(){L.apply(this,arguments);var J=n.getCurrentFile();if(null!=J&&null!=J.getTitle()){var N=
J.getMode();"google"==N?N="googleDrive":"github"==N?N="gitHub":"gitlab"==N?N="gitLab":"onedrive"==N&&(N="oneDrive");N=mxResources.get(N);F.setAttribute("title",J.getTitle()+(null!=N?" ("+N+")":""))}else F.removeAttribute("title")};n.setStatusText(n.editor.getStatus());F.appendChild(n.statusContainer);n.buttonContainer=this.createButtonContainer();F.appendChild(n.buttonContainer);n.menubarContainer=n.buttonContainer;n.tabContainer=this.createTabContainer();var K=this.createZoomInput(!0),aa=n.updateTabContainer;
n.updateTabContainer=function(){aa.apply(this,arguments);n.tabContainer.appendChild(K)};var ja=Editor.addBoxImage;if(null!=n.hoverIcons){var ca=n.hoverIcons.update;n.hoverIcons.update=function(){x.freehand.isDrawing()||ca.apply(this,arguments)}}if(null!=x.freehand){var ba=x.freehand.createStyle;x.freehand.createStyle=function(J){return ba.apply(this,arguments)+"sketch=0;"}}n.editor.addListener("statusChanged",mxUtils.bind(this,function(){n.setStatusText(n.editor.getStatus())}));n.setStatusText(n.editor.getStatus());
var oa=n.actions.get("zoomIn"),Y=n.actions.get("zoomOut");m=n.actions.get("resetView");var da=n.actions.get("undo"),ha=n.actions.get("redo"),Z=Q("",da.funct,null,"",da,Editor.undoImage),k=Q("",ha.funct,null,"",ha,Editor.redoImage),v=Q("",function(J){mxEvent.isAltDown(J)?(n.hideCurrentMenu(),n.actions.get("customZoom").funct()):(n.hideCurrentMenu(),n.actions.get("smartFit").funct());mxEvent.consume(J)},!0,"",m,Editor.zoomFitImage);n.actions.get("toggleShapes").funct=mxUtils.bind(this,function(){f(n,
null)});n.container.appendChild(n.tabContainer);n.container.appendChild(F);n.updateTabContainer();!EditorUi.windowed&&1E3<=l&&b(this,!0);g();n.addListener("lockedChanged",g);n.addListener("languageChanged",g);n.editor.graph.addListener("enabledChanged",g);mxEvent.addListener(window,"resize",function(){g();null!=n.sidebarWindow&&n.sidebarWindow.window.fit();null!=n.formatWindow&&n.formatWindow.window.fit();null!=n.actions.outlineWindow&&n.actions.outlineWindow.window.fit();null!=n.actions.layersWindow&&
n.actions.layersWindow.window.fit();null!=n.menus.chatWindow&&n.menus.chatWindow.window.fit();null!=n.menus.tagsWindow&&n.menus.tagsWindow.window.fit();null!=n.menus.findWindow&&n.menus.findWindow.window.fit();null!=n.menus.findReplaceWindow&&n.menus.findReplaceWindow.window.fit()})}}};
(function(){var b=!1;"min"!=uiTheme||b||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),b=!0);var f=EditorUi.initTheme;EditorUi.initTheme=function(){f.apply(this,arguments);"min"!=uiTheme||b||(this.initMinimalTheme(),b=!0)}})();DrawioComment=function(b,f,l,u,y,q,B){this.file=b;this.id=f;this.content=l;this.modifiedDate=u;this.createdDate=y;this.isResolved=q;this.user=B;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(b){null!=b&&this.replies.push(b)};DrawioComment.prototype.addReply=function(b,f,l,u,y){f()};DrawioComment.prototype.editComment=function(b,f,l){f()};DrawioComment.prototype.deleteComment=function(b,f){b()};DrawioUser=function(b,f,l,u,y){this.id=b;this.email=f;this.displayName=l;this.pictureUrl=u;this.locale=y};mxResources.parse('# *DO NOT DIRECTLY EDIT THIS FILE, IT IS AUTOMATICALLY GENERATED AND IT IS BASED ON:*\n# https://docs.google.com/spreadsheet/ccc?key=0AmQEO36liL4FdDJLWVNMaVV2UmRKSnpXU09MYkdGbEE\nabout=About\naboutDrawio=About draw.io\naccessDenied=Access Denied\naccounts=Accounts\naction=Action\nactualSize=Actual Size\nadaptiveColors=Adaptive Colors\nadd=Add\naddAccount=Add account\naddedFile=Added {1}\naddImages=Add Images\naddImageUrl=Add Image URL\naddLayer=Add Layer\naddProperty=Add Property\naddress=Address\naddToExistingDrawing=Add to Existing Drawing\naddToScratchpad=Add to Scratchpad\naddWaypoint=Add Waypoint\nadjustTo=Adjust to\nadvanced=Advanced\nsmartTemplate=Smart Template\nalign=Align\nalignment=Alignment\nallChangesLost=All changes will be lost!\nallPages=All Pages\nallProjects=All Projects\nallSpaces=All Spaces\nallTags=All Tags\nanchor=Anchor\nandroid=Android\nangle=Angle\nanimations=Animations\narc=Arc\nareYouSure=Are you sure?\nensureDataSaved=Please ensure your data is saved before closing.\nallChangesSaved=All changes saved\nallChangesSavedInDrive=All changes saved in Drive\nallowPopups=Allow pop-ups to avoid this dialog.\nallowRelativeUrl=Allow relative URL\nalreadyConnected=Nodes already connected\nappearance=Appearance\napply=Apply\narchiMate21=ArchiMate 2.1\narrange=Arrange\narrow=Arrow\narrows=Arrows\naskMeAnything=Ask me anything\nasNew=As New\natlas=Atlas\nauthor=Author\nauthorizationRequired=Authorization required\nauthorizeThisAppIn=Authorize this app in {1}:\nauthorize=Authorize\nauthorizing=Authorizing\nautomatic=Automatic\nautosave=Autosave\nautosize=Autosize\nattachments=Attachments\naws=AWS\naws3d=AWS 3D\nazure=Azure\nback=Back\nbackground=Background\nbackgroundColor=Background Color\nbackgroundImage=Background Image\nbasic=Basic\nbeta=beta\nblankDrawing=Blank Drawing\nblankDiagram=Blank Diagram\nblock=Block\nblockquote=Blockquote\nblog=Blog\nbold=Bold\nbootstrap=Bootstrap\nborder=Border\nborderColor=Border Color\nborderWidth=Border Width\nbottom=Bottom\nbottomAlign=Bottom Align\nbottomLeft=Bottom Left\nbottomRight=Bottom Right\nbpmn=BPMN\nbringForward=Bring Forward\nbrowser=Browser\nbulletedList=Bulleted List\nbusiness=Business\nbusy=Operation in progress\ncabinets=Cabinets\ncancel=Cancel\ncenter=Center\ncannotLoad=Load attempts failed. Please try again later.\ncannotLogin=Log in attempts failed. Please try again later.\ncannotOpenFile=Cannot open file\nchange=Change\nchangeOrientation=Change Orientation\nchangeUser=Change user\nchangeStorage=Change storage\nchangesNotSaved=Changes have not been saved\nclassDiagram=Class Diagram\nuserJoined={1} has joined\nuserLeft={1} has left\nchatWindowTitle=Chat\nchooseAnOption=Choose an option\nchromeApp=Chrome App\ncollaborativeEditingNotice=Important Notice for Collaborative Editing\ncompare=Compare\ncompressed=Compressed\ncommitMessage=Commit Message\nconfigLinkWarn=This link configures draw.io. Only click OK if you trust whoever gave you it!\nconfigLinkConfirm=Click OK to configure and restart draw.io.\ncontainer=Container\ncsv=CSV\ndark=Dark\ndiagramLanguage=Diagram Language\ndiagramType=Diagram type\ndiagramXmlDesc=XML File\ndiagramHtmlDesc=HTML File\ndiagramPngDesc=Editable Bitmap Image\ndiagramSvgDesc=Editable Vector Image\ndidYouMeanToExportToPdf=Did you mean to export to PDF?\ndisabled=Disabled\ndraftFound=A draft for \'{1}\' has been found. Load it into the editor or discard it to continue.\ndraftRevisionMismatch=There is a different version of this diagram on a shared draft of this page. Please edit the diagram from the draft to ensure you are working with the latest version.\nselectDraft=Select a draft to continue editing:\ndragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?\ndropboxCharsNotAllowed=The following characters are not allowed: / : ? * " |\ncheck=Check\nchecksum=Checksum\ncircle=Circle\ncisco=Cisco\nclassic=Classic\nclearDefaultStyle=Clear Default Style\nclearWaypoints=Clear Waypoints\nclipart=Clipart\nclose=Close\nclosingFile=Closing file\nrealtimeCollaboration=Real-Time Collaboration\ncollaborate=Collaborate\ncollaborator=Collaborator\ncollaborators=Collaborators\ncollapse=Collapse\ncollapseExpand=Collapse/Expand\ncollapse-expand=Click to collapse/expand\nShift-click to move neighbors \nAlt-click to protect group size\ncollapsible=Collapsible\ncomic=Comic\ncomment=Comment\ncommentsNotes=Comments/Notes\ncompress=Compress\nconfiguration=Configuration\nconnect=Connect\nconnecting=Connecting\nconnectWithDrive=Connect with Google Drive\nconnection=Connection\nconnectionArrows=Connection Arrows\nconnectionPoints=Connection Points\nconstrainProportions=Constrain Proportions\ncontainsValidationErrors=Contains validation errors\ncopiedToClipboard=Copied to clipboard\ncopy=Copy\ncopyConnect=Copy on Connect\ncopyCreated=A copy of the file was created.\ncopyData=Copy Data\ncopyOf=Copy of {1}\ncopyOfDrawing=Copy of Drawing\ncopySize=Copy Size\ncopyStyle=Copy Style\ncreate=Create\ncreateBlankDiagram=Create Blank Diagram\ncreateNewDiagram=Create New Diagram\ncreateRevision=Create Revision\ncreateShape=Create Shape\ncrop=Crop\ncurved=Curved\ncustom=Custom\ncurrent=Current\ncurrentPage=Current page\ncut=Cut\ndashed=Dashed\ndecideLater=Decide later\ndefault=Default\ndelete=Delete\ndeleteAll=Delete all\ndeleteColumn=Delete column\ndeleteLibrary401=Insufficient permissions to delete this library\ndeleteLibrary404=Selected library could not be found\ndeleteLibrary500=Error deleting library\ndeleteLibraryConfirm=You are about to permanently delete this library. Are you sure you want to do this?\ndeleteRow=Delete Row\ndescription=Description\ndescribeYourDiagram=Describe your diagram\ndevice=Device\ndiagram=Diagram\ndiagramContent=Diagram Content\ndiagramLocked=Diagram has been locked to prevent further data loss.\ndiagramLockedBySince=The diagram is locked by {1} since {2} ago\ndiagramName=Diagram Name\ndiagramIsPublic=Diagram is public\ndiagramIsNotPublic=Diagram is not public\ndiamond=Diamond\ndiamondThin=Diamond (thin)\ndidYouKnow=Did you know...\ndirection=Direction\ndiscard=Discard\ndiscardChangesAndReconnect=Discard Changes and Reconnect\ngoogleDriveMissingClickHere=Google Drive missing? Click here!\ndiscardChanges=Discard Changes\ndisconnected=Disconnected\ndistribute=Distribute\ndone=Done\ndoNotShowAgain=Do not show again\ndotted=Dotted\ndoubleClickOrientation=Doubleclick to change orientation\ndoubleClickTooltip=Doubleclick to insert text\ndoubleClickChangeProperty=Doubleclick to change property name\ndownload=Download\ndownloadDesktop=Get Desktop\ndownloadAs=Download as\nclickHereToSave=Click here to save.\ndpi=DPI\ndraftDiscarded=Draft discarded\ndraftSaved=Draft saved\ndragElementsHere=Drag elements here\ndragImagesHere=Drag images or URLs here\ndragUrlsHere=Drag URLs here\ndraw.io=draw.io\ndrawing=Drawing{1}\ndrawingEmpty=Drawing is empty\ndrawingTooLarge=Drawing is too large\ndrawioForWork=Draw.io for GSuite\ndropbox=Dropbox\nduplicate=Duplicate\nduplicateIt=Duplicate {1}\ndivider=Divider\ndx=Dx\ndy=Dy\neast=East\nedit=Edit\neditData=Edit Data\neditDiagram=Edit Diagram\neditGeometry=Edit Geometry\neditImage=Edit Image\neditImageUrl=Edit Image URL\neditLink=Edit Link\neditShape=Edit Shape\neditStyle=Edit Style\neditText=Edit Text\neditTooltip=Edit Tooltip\nglass=Glass\ngoogleImages=Google Images\nimageSearch=Image Search\neip=EIP\nembed=Embed\nembedFonts=Embed Fonts\nembedImages=Embed Images\nmainEmbedNotice=Paste this into the page\nelectrical=Electrical\nellipse=Ellipse\nembedNotice=Paste this once at the end of the page\nenterGroup=Enter Group\nenterName=Enter Name\nenterPropertyName=Enter Property Name\nenterValue=Enter Value\nentityRelation=Entity Relation\nentityRelationshipDiagram=Entity Relationship Diagram\nerror=Error\nerrorDeletingFile=Error deleting file\nerrorLoadingFile=Error loading file\nerrorRenamingFile=Error renaming file\nerrorRenamingFileNotFound=Error renaming file. File was not found.\nerrorRenamingFileForbidden=Error renaming file. Insufficient access rights.\nerrorSavingDraft=Error saving draft\nerrorSavingFile=Error saving file\nerrorSavingFileUnknown=Error authorizing with Google\'s servers. Please refresh the page to re-attempt.\nerrorSavingFileForbidden=Error saving file. Insufficient access rights.\nerrorSavingFileNameConflict=Could not save diagram. Current page already contains file named \'{1}\'.\nerrorSavingFileNotFound=Error saving file. File was not found.\nerrorSavingFileReadOnlyMode=Could not save diagram while read-only mode is active.\nerrorSavingFileSessionTimeout=Your session has ended. Please <a target=\'_blank\' href=\'{1}\'>{2}</a> and return to this tab to try to save again.\nerrorSendingFeedback=Error sending feedback.\nerrorUpdatingPreview=Error updating preview.\nexit=Exit\nexitGroup=Exit Group\nexpand=Expand\nexplore=Explore\nexport=Export\nexporting=Exporting\nexportAs=Export as\nexportOptionsDisabled=Export options disabled\nexportOptionsDisabledDetails=The owner has disabled options to download, print or copy for commenters and viewers on this file.\nexternalChanges=External Changes\nextras=Extras\nfailedToSaveTryReconnect=Failed to save, trying to reconnect\nfeatureRequest=Feature Request\nfeedback=Feedback\nfeedbackSent=Feedback successfully sent.\nfloorplans=Floorplans\nfile=File\nfileChangedOverwriteDialog=The file has been modified. Do you want to save the file and overwrite those changes?\nfileChangedSyncDialog=The file has been modified.\nfileChangedSync=The file has been modified. Click here to synchronize.\noverwrite=Overwrite\nsynchronize=Synchronize\nfilename=Filename\nfileExists=File already exists\nfileMovedToTrash=File was moved to trash\nfileNearlyFullSeeFaq=File nearly full, please see FAQ\nfileNotFound=File not found\nrepositoryNotFound=Repository not found\nfileNotFoundOrDenied=The file was not found. It does not exist or you do not have access.\nfileNotLoaded=File not loaded\nfileNotSaved=File not saved\nfileOpenLocation=How would you like to open these file(s)?\nfiletypeHtml=.html causes file to save as HTML with redirect to cloud URL\nfiletypePng=.png causes file to save as PNG with embedded data\nfiletypeSvg=.svg causes file to save as SVG with embedded data\nfileWillBeSavedInAppFolder={1} will be saved in the app folder.\nfill=Fill\nfillColor=Fill Color\nfilterCards=Filter Cards\nfind=Find\nfindInDiagram=Find in Diagram\nfit=Fit\nfitContainer=Resize Container\nfitIntoContainer=Fit into Container\nfitPage=Fit Page\nfitPageWidth=Fit Page Width\nfitTo=Fit to\nfitToSheetsAcross=sheet(s) across\nfitToBy=by\nfitToSheetsDown=sheet(s) down\nfitTwoPages=Two Pages\nfitWindow=Fit Window\nflip=Flip\nflipH=Flip Horizontal\nflipV=Flip Vertical\nflowAnimation=Flow Animation\nflowchart=Flowchart\nfolder=Folder\nfont=Font\nfontColor=Font Color\nfontFamily=Font Family\nfontSize=Font Size\nforbidden=You are not authorized to access this file\nformat=Format\nformatPanel=Format Panel\nformatted=Formatted\nformattedText=Formatted Text\nformatPng=PNG\nformatGif=GIF\nformatJpg=JPEG\nformatPdf=PDF\nformatSql=SQL\nformatSvg=SVG\nformatHtmlEmbedded=HTML\nformatSvgEmbedded=SVG (with XML)\nformatVsdx=VSDX\nformatVssx=VSSX\nformatWebp=WebP\nformatXmlPlain=XML (Plain)\nformatXml=XML\nforum=Discussion/Help Forums\nfreehand=Freehand\nfromTemplate=From Template\nfromTemplateUrl=From Template URL\nfromText=From Text\nfromUrl=From URL\nfromThisPage=From this page\nfullscreen=Fullscreen\ngap=Gap\ngcp=GCP\ngeneral=General\ngetNotionChromeExtension=Get the Notion Chrome Extension\ngithub=GitHub\ngitlab=GitLab\ngliffy=Gliffy\nglobal=Global\ngoogleDocs=Google Docs\ngoogleDrive=Google Drive\ngoogleGadget=Google Gadget\ngoogleSharingNotAvailable=Sharing is only available via Google Drive. Please click Open below and share from the more actions menu:\ngoogleSlides=Google Slides\ngoogleSites=Google Sites\ngoogleSheets=Google Sheets\ngradient=Gradient\ngradientColor=Color\ngrid=Grid\ngridColor=Grid Color\ngridSize=Grid Size\ngroup=Group\nguides=Guides\nhateApp=I hate draw.io\nheading=Heading\nheight=Height\nhelp=Help\nhelpTranslate=Help us translate this application\nhide=Hide\nhideIt=Hide {1}\nhidden=Hidden\nhighContrast=High Contrast\nhome=Home\nhorizontal=Horizontal\nhorizontalFlow=Horizontal Flow\nhorizontalTree=Horizontal Tree\nhowTranslate=How good is the translation in your language?\nhtml=HTML\nhtmlText=HTML Text\nid=ID\niframe=IFrame\nignore=Ignore\nimage=Image\nimageUrl=Image URL\nimages=Images\nimagePreviewError=This image couldn\'t be loaded for preview. Please check the URL.\nimageTooBig=Image too big\nimgur=Imgur\nimport=Import\nimportFrom=Import from\nimproveContrast=Improve Contrast\nincludeCopyOfMyDiagram=Include a copy of my diagram\nincreaseIndent=Increase Indent\ndecreaseIndent=Decrease Indent\ninsert=Insert\ninsertColumnBefore=Insert Column Left\ninsertColumnAfter=Insert Column Right\ninsertEllipse=Insert Ellipse\ninsertImage=Insert Image\ninsertHorizontalRule=Insert Horizontal Rule\ninsertLink=Insert Link\ninsertPage=Insert Page\ninsertRectangle=Insert Rectangle\ninsertRhombus=Insert Rhombus\ninsertRowBefore=Insert Row Above\ninsertRowAfter=Insert Row After\ninsertText=Insert Text\ninserting=Inserting\ninstallApp=Install App\ninvalidFilename=Diagram names must not contain the following characters: / | : ; { } < > & + ? = "\ninvalidLicenseSeeThisPage=Your license is invalid, please see this <a target="_blank" href="https://www.drawio.com/doc/faq/license-drawio-confluence-jira-cloud">page</a>.\ninvalidInput=Invalid input\ninvalidName=Invalid name\ninvalidOrMissingFile=Invalid or missing file\ninvalidPublicUrl=Invalid public URL\nisometric=Isometric\nios=iOS\nitalic=Italic\nkennedy=Kennedy\nkeyboardShortcuts=Keyboard Shortcuts\nlabels=Labels\nlayers=Layers\nlandscape=Landscape\nlanguage=Language\nleanMapping=Lean Mapping\nlastChange=Last change {1} ago\nlessThanAMinute=less than a minute\nlicensingError=Licensing Error\nlicenseHasExpired=The license for {1} has expired on {2}. Click here.\nlicenseRequired=This feature requires draw.io to be licensed.\nlicenseWillExpire=The license for {1} will expire on {2}. Click here.\nlight=Light\nlineJumps=Line jumps\nlinkAccountRequired=If the diagram is not public a Google account is required to view the link.\nlinkText=Link Text\nlist=List\nminute=minute\nminutes=minutes\nhours=hours\ndays=days\nmonths=months\nyears=years\nrestartForChangeRequired=Changes will take effect after a restart of the application.\nlaneColor=Lanecolor\nlanguageCode=Language Code\nlastModified=Last modified\nlayout=Layout\nleft=Left\nleftAlign=Left Align\nleftToRight=Left to Right\nlibraryTooltip=Drag and drop shapes here or click + to insert. Double click to edit.\nlightbox=Lightbox\nline=Line\nlineend=Line end\nlineheight=Line Height\nlinestart=Line start\nlinewidth=Linewidth\nlink=Link\nlinks=Links\nloading=Loading\nlocked=Locked\nlockUnlock=Lock/Unlock\nloggedOut=Logged Out\nlogIn=log in\nloveIt=I love {1}\nlucidchart=Lucidchart\nmaps=Maps\nmathematicalTypesetting=Mathematical Typesetting\nmakeCopy=Make a Copy\nmanual=Manual\nmaximize=Maximize\nmerge=Merge\nmermaid=Mermaid\nmicrosoftOffice=Microsoft Office\nmicrosoftExcel=Microsoft Excel\nmicrosoftPowerPoint=Microsoft PowerPoint\nmicrosoftWord=Microsoft Word\nmiddle=Middle\nminimal=Minimal\nminimize=Minimize\nmisc=Misc\nmockups=Mockups\nmodern=Modern\nmodificationDate=Modification date\nmodifiedBy=Modified by\nmore=More\nmoreResults=More Results\nmoreShapes=More Shapes\nmove=Move\nmoveToFolder=Move to Folder\nmoving=Moving\nmoveSelectionTo=Move selection to {1}\nmyDrive=My Drive\nmyFiles=My Files\nname=Name\nnavigation=Navigation\nnetwork=Network\nnetworking=Networking\nnew=New\nnewLibrary=New Library\nnextPage=Next Page\nno=No\nnoPickFolder=No, pick folder\nnoAttachments=No attachments found\nnoColor=No Color\nnoFiles=No Files\nnoFileSelected=No file selected\nnoLibraries=No libraries found\nnoMoreResults=No more results\nnone=None\nnoOtherViewers=No other viewers\nnoPlugins=No plugins\nnoPreview=No preview\nnoResponse=No response from server\nnoResultsFor=No results for \'{1}\'\nnoRevisions=No revisions\nnoSearchResults=No search results found\nnoPageContentOrNotSaved=No anchors found on this page or it hasn\'t been saved yet\nnormal=Normal\nnorth=North\nnotADiagramFile=Not a diagram file\nnotALibraryFile=Not a library file\nnotAvailable=Not available\nnotAUtf8File=Not a UTF-8 file\nnotConnected=Not connected\nnote=Note\nnotion=Notion\nnotSatisfiedWithImport=Not satisfied with the import?\nnotUsingService=Not using {1}?\nnumberedList=Numbered list\noffline=Offline\nok=OK\noneDrive=OneDrive\nonline=Online\nopacity=Opacity\nopen=Open\nopenArrow=Open Arrow\nopenExistingDiagram=Open Existing Diagram\nopenFile=Open File\nopenFrom=Open from\nopenLibrary=Open Library\nopenLibraryFrom=Open Library from\nopenLink=Open Link\nopenInNewWindow=Open in New Window\nopenInThisWindow=Open in This Window\nopenIt=Open {1}\nopenRecent=Open Recent\nopenSupported=Supported formats are files saved from this software (.xml), .vsdx and .gliffy\noptions=Options\norganic=Organic\norgChart=Org Chart\northogonal=Orthogonal\notherViewer=other viewer\notherViewers=other viewers\noutline=Outline\noval=Oval\npage=Page\npageContent=Page Content\npageNotFound=Page not found\npageWithNumber=Page-{1}\npages=Pages\npageTabs=Page Tabs\npageView=Page View\npageSetup=Page Setup\npageScale=Page Scale\npan=Pan\npanTooltip=Space+Drag to pan\npaperSize=Paper Size\npattern=Pattern\nparallels=Parallels\npaste=Paste\npasteData=Paste Data\npasteHere=Paste Here\npasteSize=Paste Size\npasteStyle=Paste Style\nperimeter=Perimeter\npermissionAnyone=Anyone can edit\npermissionAuthor=Owner and admins can edit\npickFolder=Pick a folder\npickLibraryDialogTitle=Select Library\npublicDiagramUrl=Public URL of the diagram\nplaceholders=Placeholders\nplantUml=PlantUML\nplugins=Plugins\npluginUrl=Plugin URL\npluginWarning=The page has requested to load the following plugin(s):\n \n {1}\n \n Would you like to load these plugin(s) now?\n \n NOTE : Only allow plugins to run if you fully understand the security implications of doing so.\n\nplusTooltip=Click to connect and clone (ctrl+click to clone, shift+click to connect). Drag to connect (ctrl+drag to clone).\nportrait=Portrait\nposition=Position\nposterPrint=Poster Print\npreferences=Preferences\npreview=Preview\npreviousPage=Previous Page\npresentationMode=Presentation Mode\nprint=Print\nprocEng=Proc. Eng.\nproject=Project\npriority=Priority\nprocessForHiringNewEmployee=Process for hiring a new employee\nproperties=Properties\npublish=Publish\nquickStart=Quick Start Video\nrack=Rack\nradial=Radial\nradialTree=Radial Tree\nreadOnly=Read-only\nreconnecting=Reconnecting\nrecentlyUpdated=Recently Updated\nrecentlyViewed=Recently Viewed\nrectangle=Rectangle\nredirectToNewApp=This file was created or modified in a newer version of this app. You will be redirected now.\nrealtimeTimeout=It looks like you\'ve made a few changes while offline. We\'re sorry, these changes cannot be saved.\nredo=Redo\nrefresh=Refresh\nregularExpression=Regular Expression\nrelative=Relative\nrelativeUrlNotAllowed=Relative URL not allowed\nrememberMe=Remember me\nrememberThisSetting=Remember this setting\nremoveFormat=Clear Formatting\nremoveFromGroup=Remove from Group\nremoveIt=Remove {1}\nremoveWaypoint=Remove Waypoint\nrename=Rename\nrenamed=Renamed\nrenameIt=Rename {1}\nrenaming=Renaming\nreplace=Replace\nreplaceIt={1} already exists. Do you want to replace it?\nreplaceExistingDrawing=Replace existing drawing\nrequired=required\nrequirementDiagram=Requirement Diagram\nreset=Reset\nresetView=Reset View\nresize=Resize\nresizeLargeImages=Do you want to resize large images to make the application run faster?\nretina=Retina\nresponsive=Responsive\nrestore=Restore\nrestoring=Restoring\nretryingIn=Retrying in {1} second(s)\nretryingLoad=Load failed. Retrying...\nretryingLogin=Login time out. Retrying...\nreverse=Reverse\nrevision=Revision\nrevisionHistory=Revision History\nrhombus=Rhombus\nright=Right\nrightAlign=Right Align\nrightToLeft=Right to Left\nrotate=Rotate\nrotateTooltip=Click and drag to rotate, click to turn shape only by 90 degrees\nrotation=Rotation\nrounded=Rounded\nsave=Save\nsaveAndExit=Save & Exit\nsaveAs=Save as\nsaveAsXmlFile=Save as XML file?\nsaved=Saved\nsaveDiagramFirst=Please save the diagram first\nsaveDiagramsTo=Save diagrams to\nsaveLibrary403=Insufficient permissions to edit this library\nsaveLibrary500=There was an error while saving the library\nsaveLibraryReadOnly=Could not save library while read-only mode is active\nsaving=Saving\nscratchpad=Scratchpad\nscrollbars=Scrollbars\nsearch=Search\nsearchShapes=Search Shapes\nselectAll=Select All\nselectionOnly=Selection Only\nselectCard=Select Card\nselectEdges=Select Edges\nselectedPage=Selected Page\nselectFile=Select File\nselectFolder=Select Folder\nselectFont=Select Font\nselectNone=Select None\nselectTemplate=Select Template\nselectVertices=Select Vertices\nsendBackward=Send Backward\nsendMessage=Send\nsendYourFeedback=Send your feedback\nsequenceDiagram=Sequence Diagram\nserviceUnavailableOrBlocked=Service unavailable or blocked\nsessionExpired=Your session has expired. Please refresh the browser window.\nsessionTimeoutOnSave=Your session has timed out and you have been disconnected from the Google Drive. Press OK to login and save.\nsetAsDefaultStyle=Set as Default Style\nsettings=Settings\nshadow=Shadow\nshadows=Shadows\nshape=Shape\nshapes=Shapes\nshare=Share\nshareCursor=Share Mouse Cursor\nshareLink=Link for shared editing\nsharingAvailable=Sharing available for Google Drive and OneDrive files.\nsaveItToGoogleDriveToCollaborate=You\'ll need to save "{1}" to Google Drive before you can collaborate.\nsaveToGoogleDrive=Save to Google Drive\nsharp=Sharp\nshow=Show\nshowRemoteCursors=Show Remote Mouse Cursors\nshowStartScreen=Show Start Screen\nsidebarTooltip=Click or drag and drop shapes. Shift+click to change selection. Alt+click to insert and connect.\nsigns=Signs\nsignOut=Sign out\nsimple=Simple\nsimpleArrow=Simple Arrow\nsimpleViewer=Simple Viewer\nsize=Size\nsketch=Sketch\nsmoothing=Smoothing\nsnapToGrid=Snap to Grid\nsolid=Solid\nsourceSpacing=Source Spacing\nsouth=South\nsoftware=Software\nspace=Space\nspacing=Spacing\nspecialLink=Special Link\nstateDiagram=State Diagram\nstandard=Standard\nstartDrawing=Start drawing\nstopDrawing=Stop drawing\nstarting=Starting\nstraight=Straight\nstrikethrough=Strikethrough\nstrokeColor=Line Color\nstyle=Style\nsubscript=Subscript\nsummary=Summary\nsuperscript=Superscript\nsupport=Support\nswap=Swap\nswimlaneDiagram=Swimlane Diagram\nsysml=SysML\ntags=Tags\ntable=Table\ntables=Tables\ntakeOver=Take Over\ntargetSpacing=Target Spacing\ntemplate=Template\ntemplates=Templates\ntext=Text\ntextAlignment=Text Alignment\ntextOpacity=Text Opacity\ntheme=Theme\ntimeout=Timeout\ntitle=Title\nto=to\ntoBack=To Back\ntoFront=To Front\ntooLargeUseDownload=Too large, use download instead.\ntoolbar=Toolbar\ntooltips=Tooltips\ntop=Top\ntopAlign=Top Align\ntopLeft=Top Left\ntopRight=Top Right\ntransparent=Transparent\ntransparentBackground=Transparent Background\ntrello=Trello\ntryAgain=Try again\ntryOpeningViaThisPage=Try opening via this page\nturn=Rotate Shape Only by 90°\ntype=Type\ntypeSlashToSearch=Type / to search\numl=UML\nunassigned=Unassigned\nunderline=Underline\nundo=Undo\nungroup=Ungroup\nunmerge=Unmerge\nunsavedChanges=Unsaved changes\nunsavedChangesClickHereToSave=Unsaved changes. Click here to save.\nuntitled=Untitled\nuntitledDiagram=Untitled Diagram\nuntitledLayer=Untitled Layer\nuntitledLibrary=Untitled Library\nunknownError=Unknown error\nunknownUser=Unknown user\nupdateExistingDrawing=Update existing drawing\nupdateFile=Update {1}\nupdatingDocument=Updating Document. Please wait...\nupdatingPreview=Updating Preview. Please wait...\nupdatingSelection=Updating Selection. Please wait...\nupload=Upload\nurl=URL\nuseBlackAndWhite=Use black and white\nuseCurrentSettings=Use current settings\nuseOffline=Use Offline\nuserDefined=User-defined\nuseRootFolder=Use root folder?\nuserManual=User Manual\nvertical=Vertical\nverticalFlow=Vertical Flow\nverticalTree=Vertical Tree\nview=View\nviewerSettings=Viewer Settings\nviewUrl=Link to view: {1}\nvoiceAssistant=Voice Assistant (beta)\nwarning=Warning\nwaypoints=Waypoints\nwest=West\nwhere=Where\nwidth=Width\nwiki=Wiki\nwordWrap=Word Wrap\nwritingDirection=Writing Direction\nyes=Yes\nyourEmailAddress=Your email address\nzoom=Zoom\nzoomIn=Zoom In\nzoomOut=Zoom Out\nbasic=Basic\nbusinessprocess=Business Processes\ncharts=Charts\nengineering=Engineering\nflowcharts=Flowcharts\ngmdl=Material Design\nmindmaps=Mindmaps\nmockups=Mockups\nnetworkdiagrams=Network Diagrams\nnothingIsSelected=Nothing is selected\nother=Other\nsoftwaredesign=Software Design\nvenndiagrams=Venn Diagrams\nwebEmailOrOther=Web, email or any other internet address\nwebLink=Web Link\nwireframes=Wireframes\nproperty=Property\nvalue=Value\nshowMore=Show More\nshowLess=Show Less\nmyDiagrams=My Diagrams\nallDiagrams=All Diagrams\nrecentlyUsed=Recently used\nlistView=List view\ngridView=Grid view\nresultsFor=Results for \'{1}\'\noneDriveCharsNotAllowed=The following characters are not allowed: ~ " # % * : < > ? / { | }\noneDriveInvalidDeviceName=The specified device name is invalid\nofficeNotLoggedOD=You are not logged in to OneDrive. Please open draw.io task pane and login first.\nofficeSelectSingleDiag=Please select a single draw.io diagram only without other contents.\nofficeSelectDiag=Please select a draw.io diagram.\nofficeCannotFindDiagram=Cannot find a draw.io diagram in the selection\nnoDiagrams=No diagrams found\nauthFailed=Authentication failed\nofficeFailedAuthMsg=Unable to successfully authenticate user or authorize application.\nconvertingDiagramFailed=Converting diagram failed\nofficeCopyImgErrMsg=Due to some limitations in the host application, the image could not be inserted. Please manually copy the image then paste it to the document.\ninsertingImageFailed=Inserting image failed\nofficeCopyImgInst=Instructions: Right-click the image below. Select "Copy image" from the context menu. Then, in the document, right-click and select "Paste" from the context menu.\nfolderEmpty=Folder is empty\nrecent=Recent\nsharedWithMe=Shared With Me\nsharepointSites=Sharepoint Sites\nerrorFetchingFolder=Error fetching folder items\nerrorAuthOD=Error authenticating to OneDrive\nofficeMainHeader=Adds draw.io diagrams to your document.\nofficeStepsHeader=This add-in performs the following steps:\nofficeStep1=Connects to Microsoft OneDrive, Google Drive or your device.\nofficeStep2=Select a draw.io diagram.\nofficeStep3=Insert the diagram into the document.\nofficeAuthPopupInfo=Please complete the authentication in the pop-up window.\nofficeSelDiag=Select draw.io Diagram:\nfiles=Files\nshared=Shared\nsharepoint=Sharepoint\nofficeManualUpdateInst=Instructions: Copy draw.io diagram from the document. Then, in the box below, right-click and select "Paste" from the context menu.\nofficeClickToEdit=Click icon to start editing:\npasteDiagram=Paste draw.io diagram here\nconnectOD=Connect to OneDrive\nselectChildren=Select Children\nselectSiblings=Select Siblings\nselectParent=Select Parent\nselectDescendants=Select Descendants\nlastSaved=Last saved {1} ago\nresolve=Resolve\nreopen=Re-open\nshowResolved=Show Resolved\nreply=Reply\nobjectNotFound=Object not found\nreOpened=Re-opened\nmarkedAsResolved=Marked as resolved\nnoCommentsFound=No comments found\ncomments=Comments\ntimeAgo={1} ago\nconfluenceCloud=Confluence Cloud\nlibraries=Libraries\nconfAnchor=Confluence Page Anchor\nconfTimeout=The connection has timed out\nconfSrvTakeTooLong=The server at {1} is taking too long to respond.\nconfCannotInsertNew=Cannot insert draw.io diagram to a new Confluence page\nconfSaveTry=Please save the page and try again.\nconfCannotGetID=Unable to determine page ID\nconfContactAdmin=Please contact your Confluence administrator.\nreadErr=Read Error\neditingErr=Editing Error\nconfExtEditNotPossible=This diagram cannot be edited externally. Please try editing it while editing the page\nconfEditedExt=Diagram/Page edited externally\ndiagNotFound=Diagram Not Found\nconfEditedExtRefresh=Diagram/Page is edited externally. Please refresh the page.\nconfCannotEditDraftDelOrExt=Cannot edit diagrams in a draft page, diagram is deleted from the page, or diagram is edited externally. Please check the page.\nretBack=Return back\nconfDiagNotPublished=The diagram does not belong to a published page\ncreatedByDraw=Created by draw.io\nfilenameShort=Filename too short\ninvalidChars=Invalid characters\nalreadyExst={1} already exists\ndraftReadErr=Draft Read Error\ndiagCantLoad=Diagram cannot be loaded\ndraftWriteErr=Draft Write Error\ndraftCantCreate=Draft could not be created\nconfDuplName=Duplicate diagram name detected. Please pick another name.\nconfSessionExpired=Looks like your session expired. Log in again to keep working.\nlogin=Login\ndrawPrev=draw.io preview\ndrawDiag=draw.io diagram\ninvalidCallFnNotFound=Invalid Call: {1} not found\ninvalidCallErrOccured=Invalid Call: An error occurred, {1}\nanonymous=Anonymous\nconfGotoPage=Go to containing page\nshowComments=Show Comments\nconfError=Error: {1}\ngliffyImport=Gliffy Import\ngliffyImportInst1=Click the "Start Import" button to import all Gliffy diagrams to draw.io.\ngliffyImportInst2=Please note that the import procedure will take some time and the browser window must remain open until the import is completed.\nstartImport=Start Import\ndrawConfig=draw.io Configuration\ncustomLib=Custom Libraries\ncustomTemp=Custom Templates\npageIdsExp=Page IDs Export\ndrawReindex=draw.io re-indexing (beta)\nworking=Working\ndrawConfigNotFoundInst=draw.io Configuration Space (DRAWIOCONFIG) does not exist. This space is needed to store draw.io configuration files and custom libraries/templates.\ncreateConfSp=Create Config Space\nunexpErrRefresh=Unexpected error, please refresh the page and try again.\nconfigJSONInst=Write draw.io JSON configuration in the editor below then click save. If you need help, please refer to\nthisPage=this page\ncurCustLib=Current Custom Libraries\nlibName=Library Name\naction=Action\ndrawConfID=draw.io Config ID\naddLibInst=Click the "Add Library" button to upload a new library.\naddLib=Add Library\ncustomTempInst1=Custom templates are draw.io diagrams saved in children pages of\ncustomTempInst2=For more details, please refer to\ntempsPage=Templates page\npageIdsExpInst1=Select export target, then click the "Start Export" button to export all pages IDs.\npageIdsExpInst2=Please note that the export procedure will take some time and the browser window must remain open until the export is completed.\nstartExp=Start Export\nrefreshDrawIndex=Refresh draw.io Diagrams Index\nreindexInst1=Click the "Start Indexing" button to refresh draw.io diagrams index.\nreindexInst2=Please note that the indexing procedure will take some time and the browser window must remain open until the indexing is completed.\nstartIndexing=Start Indexing\nconfAPageFoundFetch=Page "{1}" found. Fetching\nconfAAllDiagDone=All {1} diagrams processed. Process finished.\nconfAStartedProcessing=Started processing page "{1}"\nconfAAllDiagInPageDone=All {1} diagrams in page "{2}" processed successfully.\nconfAPartialDiagDone={1} out of {2} {3} diagrams in page "{4}" processed successfully.\nconfAUpdatePageFailed=Updating page "{1}" failed.\nconfANoDiagFoundInPage=No {1} diagrams found in page "{2}".\nconfAFetchPageFailed=Fetching the page failed.\nconfANoDiagFound=No {1} diagrams found. Process finished.\nconfASearchFailed=Searching for {1} diagrams failed. Please try again later.\nconfAGliffyDiagFound={2} diagram "{1}" found. Importing\nconfAGliffyDiagImported={2} diagram "{1}" imported successfully.\nconfASavingImpGliffyFailed=Saving imported {2} diagram "{1}" failed.\nconfAImportedFromByDraw=Imported from "{1}" by draw.io\nconfAImportGliffyFailed=Importing {2} diagram "{1}" failed.\nconfAFetchGliffyFailed=Fetching {2} diagram "{1}" failed.\nconfACheckBrokenDiagLnk=Checking for broken diagrams links.\nconfADelDiagLinkOf=Deleting diagram link of "{1}"\nconfADupLnk=(duplicate link)\nconfADelDiagLnkFailed=Deleting diagram link of "{1}" failed.\nconfAUnexpErrProcessPage=Unexpected error during processing the page with id: {1}\nconfADiagFoundIndex=Diagram "{1}" found. Indexing\nconfADiagIndexSucc=Diagram "{1}" indexed successfully.\nconfAIndexDiagFailed=Indexing diagram "{1}" failed.\nconfASkipDiagOtherPage=Skipped "{1}" as it belongs to another page!\nconfADiagUptoDate=Diagram "{1}" is up to date.\nconfACheckPagesWDraw=Checking pages having draw.io diagrams.\nconfAErrOccured=An error occurred!\nsavedSucc=Saved successfully\nconfASaveFailedErr=Saving Failed (Unexpected Error)\ncharacter=Character\nconfAConfPageDesc=This page contains draw.io configuration file (configuration.json) as attachment\nconfALibPageDesc=This page contains draw.io custom libraries as attachments\nconfATempPageDesc=This page contains draw.io custom templates as attachments\nconfAConfSpaceDesc=This space is used to store draw.io configuration files and custom libraries/templates\nconfANoCustLib=No Custom Libraries\ndelFailed=Delete failed!\nshowID=Show ID\nconfAIncorrectLibFileType=Incorrect file type. Libraries should be XML files.\nuploading=Uploading\nconfALibExist=This library already exists\nconfAUploadSucc=Uploaded successfully\nconfAUploadFailErr=Upload Failed (Unexpected Error)\nhiResPreview=High Res Preview\nofficeNotLoggedGD=You are not logged in to Google Drive. Please open draw.io task pane and login first.\nofficePopupInfo=Please complete the process in the pop-up window.\npickODFile=Pick OneDrive File\ncreateODFile=Create OneDrive File\npickGDriveFile=Pick Google Drive File\ncreateGDriveFile=Create Google Drive File\npickDeviceFile=Pick Device File\nvsdNoConfig="vsdurl" is not configured\nruler=Ruler\nunits=Units\npoints=Points\ninches=Inches\nmillimeters=Millimeters\nconfEditDraftDelOrExt=This diagram is in a draft page, is deleted from the page, or is edited externally. It will be saved as a new attachment version and may not be reflected in the page.\nconfDiagEditedExt=Diagram is edited in another session. It will be saved as a new attachment version but the page will show other session\'s modifications.\nmacroNotFound=Macro Not Found\nconfAInvalidPageIdsFormat=Incorrect Page IDs file format\nconfACollectingCurPages=Collecting current pages\nconfABuildingPagesMap=Building pages mapping\nconfAProcessDrawDiag=Started processing imported draw.io diagrams\nconfAProcessDrawDiagDone=Finished processing imported draw.io diagrams\nconfAProcessImpPages=Started processing imported pages\nconfAErrPrcsDiagInPage=Error processing draw.io diagrams in page "{1}"\nconfAPrcsDiagInPage=Processing draw.io diagrams in page "{1}"\nconfAImpDiagram=Importing diagram "{1}"\nconfAImpDiagramFailed=Importing diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\nconfAImpDiagramError=Error importing diagram "{1}". Cannot fetch or save the diagram. Cannot fix this diagram links.\nconfAUpdateDgrmCCFailed=Updating link to diagram "{1}" failed.\nconfImpDiagramSuccess=Updating diagram "{1}" done successfully.\nconfANoLnksInDrgm=No links to update in: {1}\nconfAUpdateLnkToPg=Updated link to page: "{1}" in diagram: "{2}"\nconfAUpdateLBLnkToPg=Updated lightbox link to page: "{1}" in diagram: "{2}"\nconfAUpdateLnkBase=Updated base URL from: "{1}" to: "{2}" in diagram: "{3}"\nconfAPageIdsImpDone=Page IDs Import finished\nconfAPrcsMacrosInPage=Processing draw.io macros in page "{1}"\nconfAErrFetchPage=Error fetching page "{1}"\nconfAFixingMacro=Fixing macro of diagram "{1}"\nconfAErrReadingExpFile=Error reading export file\nconfAPrcsDiagInPageDone=Processing draw.io diagrams in page "{1}" finished\nconfAFixingMacroSkipped=Fixing macro of diagram "{1}" failed. Cannot find its new page ID. Maybe it points to a page that is not imported.\npageIdsExpTrg=Export target\nconfALucidDiagImgImported={2} diagram "{1}" image extracted successfully\nconfASavingLucidDiagImgFailed=Extracting {2} diagram "{1}" image failed\nconfGetInfoFailed=Fetching file info from {1} failed.\nconfCheckCacheFailed=Cannot get cached file info.\nconfReadFileErr=Cannot read "{1}" file from {2}.\nconfSaveCacheFailed=Unexpected error. Cannot save cached file\norgChartType=Org Chart Type\nlinear=Linear\nhanger2=Hanger 2\nhanger4=Hanger 4\nfishbone1=Fishbone 1\nfishbone2=Fishbone 2\n1ColumnLeft=Single Column Left\n1ColumnRight=Single Column Right\nsmart=Smart\nparentChildSpacing=Parent Child Spacing\nsiblingSpacing=Sibling Spacing\nconfNoPermErr=Sorry, you don\'t have enough permissions to view this embedded diagram from page {1}\ncopyAsImage=Copy as Image\ncopyAsText=Copy as Text\ncopyAsSvg=Copy as SVG\nlucidImport=Lucidchart Import\nlucidImportInst1=Click the "Start Import" button to import all Lucidchart diagrams.\ninstallFirst=Please install {1} first\ndrawioChromeExt=draw.io Chrome Extension\nloginFirstThen=Please login to {1} first, then {2}\nerrFetchDocList=Error: Couldn\'t fetch documents list\nbuiltinPlugins=Built-in Plugins\nextPlugins=External Plugins\nbackupFound=Backup file found\nchromeOnly=This feature only works in Google Chrome\nmsgDeleted=This message has been deleted\nconfAErrFetchDrawList=Error fetching diagrams list. Some diagrams are skipped.\nconfAErrCheckDrawDiag=Cannot check diagram {1}\nconfAErrFetchPageList=Error fetching pages list\nconfADiagImportIncom={1} diagram "{2}" is imported partially and may have missing shapes\ninvalidSel=Invalid selection\ndiagNameEmptyErr=Diagram name cannot be empty\nopenDiagram=Open Diagram\nnewDiagram=New diagram\neditable=Editable\nconfAReimportStarted=Re-import {1} diagrams started...\nspaceFilter=Filter by spaces\ncurViewState=Current Viewer State\npageLayers=Page and Layers\ncustomize=Customize\nfirstPage=First Page (All Layers)\ncurEditorState=Current Editor State\nnoAnchorsFound=No anchors found\nattachment=Attachment\ncurDiagram=Current Diagram\nrecentDiags=Recent Diagrams\ncsvImport=CSV Import\nchooseFile=Choose a file...\nchoose=Choose\ngdriveFname=Google Drive filename\nwidthOfViewer=Width of the viewer (px)\nheightOfViewer=Height of the viewer (px)\nautoSetViewerSize=Automatically set the size of the viewer\nthumbnail=Thumbnail\nprevInDraw=Preview in draw.io\nonedriveFname=OneDrive filename\ndiagFname=Diagram filename\ndiagUrl=Diagram URL\nshowDiag=Show Diagram\ndiagPreview=Diagram Preview\ncsvFileUrl=CSV File URL\ngenerate=Generate\nselectDiag2Insert=Please select a diagram to insert it.\nerrShowingDiag=Unexpected error. Cannot show diagram\nnoRecentDiags=No recent diagrams found\nfetchingRecentFailed=Failed to fetch recent diagrams\nuseSrch2FindDiags=Use the search box to find draw.io diagrams\ncantReadChckPerms=Cannot read the specified diagram. Please check you have read permission on that file.\ncantFetchChckPerms=Cannot fetch diagram info. Please check you have read permission on that file.\nsearchFailed=Searching failed. Please try again later.\nplsTypeStr=Please type a search string.\nunsupportedFileChckUrl=Unsupported file. Please check the specified URL\ndiagNotFoundChckUrl=Diagram not found or cannot be accessed. Please check the specified URL\ncsvNotFoundChckUrl=CSV file not found or cannot be accessed. Please check the specified URL\ncantReadUpload=Cannot read the uploaded diagram\nselect=Select\nerrCantGetIdType=Unexpected Error: Cannot get content id or type.\nerrGAuthWinBlocked=Error: Google Authentication window blocked\nauthDrawAccess=Authorize draw.io to access {1}\nconnTimeout=The connection has timed out\nerrAuthSrvc=Error authenticating to {1}\nplsSelectFile=Please select a file\nmustBgtZ={1} must be greater than zero\ncantLoadPrev=Cannot load file preview.\nerrAccessFile=Error: Access Denied. You do not have permission to access "{1}".\nnoPrevAvail=No preview is available.\npersonalAccNotSup=Personal accounts are not supported.\nerrSavingTryLater=Error occurred during saving, please try again later.\nplsEnterFld=Please enter {1}\ninvalidDiagUrl=Invalid Diagram URL\nunsupportedVsdx=Unsupported vsdx file\nunsupportedImg=Unsupported image file\nunsupportedFormat=Unsupported file format\nplsSelectSingleFile=Please select a single file only\nattCorrupt=Attachment file "{1}" is corrupted\nloadAttFailed=Failed to load attachment "{1}"\nembedDrawDiag=Embed draw.io Diagram\naddDiagram=Add Diagram\nembedDiagram=Embed Diagram\neditOwningPg=Edit owning page\ndeepIndexing=Deep Indexing (Index diagrams that aren\'t used in any page also)\nconfADeepIndexStarted=Deep Indexing Started\nconfADeepIndexDone=Deep Indexing Done\nofficeNoDiagramsSelected=No diagrams found in the selection\nofficeNoDiagramsInDoc=No diagrams found in the document\nofficeNotSupported=This feature is not supported in this host application\nsomeImagesFailed={1} out of {2} failed due to the following errors\nimportingNoUsedDiagrams=Importing {1} Diagrams not used in pages\nimportingDrafts=Importing {1} Diagrams in drafts\nprocessingDrafts=Processing drafts\nupdatingDrafts=Updating drafts\nupdateDrafts=Update drafts\nnotifications=Notifications\ndrawioImp=draw.io Import\nconfALibsImp=Importing draw.io Libraries\nconfALibsImpFailed=Importing {1} library failed\ncontributors=Contributors\ndrawDiagrams=draw.io Diagrams\nerrFileNotFoundOrNoPer=Error: Access Denied. File not found or you do not have permission to access "{1}" on {2}.\nconfACheckPagesWEmbed=Checking pages having embedded draw.io diagrams.\nconfADelBrokenEmbedDiagLnk=Removing broken embedded diagram links\nreplaceWith=Replace with\nreplaceAll=Replace All\nconfASkipDiagModified=Skipped "{1}" as it was modified after initial import\nreplFind=Replace/Find\nmatchesRepl={1} matches replaced\ndraftErrDataLoss=An error occurred while reading the draft file. The diagram cannot be edited now to prevent any possible data loss. Please try again later or contact support.\nibm=IBM\nlinkToDiagramHint=Add a link to this diagram. The diagram can only be edited from the page that owns it.\nlinkToDiagram=Link to Diagram\nchangedBy=Changed By\nlastModifiedOn=Last modified on\nsearchResults=Search Results\nshowAllTemps=Show all templates\nnotionToken=Notion Token\nselectDB=Select Database\nnoDBs=No Databases\ndiagramEdited={1} diagram "{2}" edited\nconfDraftPermissionErr=Draft cannot be written. Do you have attachment write/read permission on this page?\nconfFileTooBigErr=File size is too large. Pease check "Attachment Maximum Size" of "Attachment Settings" in Confluence Configuration.\nowner=Owner\nrepository=Repository\nbranch=Branch\nmeters=Meters\nteamsNoEditingMsg=Editor functionality is only available in Desktop environment (in MS Teams App or a web browser)\ncontactOwner=Contact Owner\nviewerOnlyMsg=You cannot edit the diagrams in the mobile platform, please use the desktop client or a web browser.\nwebsite=Website\ncheck4Updates=Check for updates\nattWriteFailedRetry={1}: Attachment write failed, trying again in {2} seconds...\nconfPartialPageList=We couldn\'t fetch all pages due to an error in Confluence. Continuing using {1} pages only.\nspellCheck=Spell checker\nnoChange=No Change\nlblToSvg=Convert labels to SVG\ntxtSettings=Text Settings\nLinksLost=Links will be lost\narcSize=Arc Size\neditConnectionPoints=Edit Connection Points\nnotInOffline=Not supported while offline\nnotInDesktop=Not supported in Desktop App\nconfConfigSpaceArchived=draw.io Configuration space (DRAWIOCONFIG) is archived. Please restore it first.\nconfACleanOldVerStarted=Cleaning old diagram draft versions started\nconfACleanOldVerDone=Cleaning old diagram draft versions finished\nconfACleaningFile=Cleaning diagram draft "{1}" old versions\nconfAFileCleaned=Cleaning diagram draft "{1}" done\nconfAFileCleanFailed=Cleaning diagram draft "{1}" failed\nconfACleanOnly=Clean Diagram Drafts Only\nbrush=Brush\nopenDevTools=Open Developer Tools\nautoBkp=Automatic Backup\nconfAIgnoreCollectErr=Ignore collecting current pages errors\ndrafts=Drafts\ndraftSaveInt=Draft save interval [sec] (0 to disable)\npluginsDisabled=External plugins disabled.\nextExpNotConfigured=External image service is not configured\npathFilename=Path/Filename\nconfAHugeInstances=Very Large Instances\nconfAHugeInstancesDesc=If this instance includes 100,000+ pages, it is faster to request the current instance pages list from Atlassian. Please contact our support for more details.\nchoosePageIDsFile=Choose current page IDs csv file\nchooseDrawioPsgesFile=Choose pages with draw.io diagrams csv file\nprivate=Private\ndiagramTooLarge=The diagram is too large, please reduce its size and try again.\nselectAdminUsers=Select Admin Users\nxyzTeam={1} Team\naddTeamTitle=Adding a new draw.io Team\naddTeamInst1=To create a new draw.io Team, you need to create a new Atlassian group with "drawio-" prefix (e.g, a group named "drawio-marketing").\naddTeamInst2=Then, configure which team member can edit/add configuration, templates, and libraries from this page.\ndrawioTeams=draw.io Teams\nmembers=Members\nadminEditors=Admins/Editors\nallowAll=Allow all\nnoTeams=No teams found\nerrorLoadingTeams=Error Loading Teams\nnoTeamMembers=No team members found\nerrLoadTMembers=Error loading team members\nerrCreateTeamPage=Error creating team "{1}" page in "draw.io Configuration" space, please check you have the required permissions.\ngotoConfigPage=Please create the space from draw.io "Configuration" page.\nnoAdminsSelected=No admins/editors selected\nerrCreateConfigFile=Error creating "configuration.json" file, please check you have the required permissions.\nerrSetPageRestr=Error setting page restrictions\nnotAdmin4Team=You are not an admin for this team\nconfigUpdated=Configuration updated, restart the editor if you want to work with last configuration.\noutOfDateRevisionAlert=You are editing a historical revision of the diagram, please review the revision and open it to replace the latest version. Or close and overwrite/merge later.\nconfAErrFaqs=There are {1} error(s), the following instructions may help fixing most of the cases. (Please download the log for future references)\nconfA403ErrFaq=There are ({1}) 403 error(s). The current users must have add (write) permissions on all pages and attachments. Even admins sometimes are not allowed to write to some pages via page restrictions\nconfA404ErrFaq=There are ({1}) 404 error(s). The attachment/page is not found. This is due to improper migration or the diagram file (an attachment of the page) is deleted.\nconfA500ErrFaq=There are ({1}) 500 error(s). An internal server error in Confluence Cloud. Such errors are due to overloading the server and usually fixed by retrying the process.\nconfAOtherErrFaq=There are ({1}) other error(s). Please check the error description. If the description is not clear, please contact our support.\nconfAReplaceBaseUrl=Replace Base URL in diagram links when no page ID mapping is found\ndrawSvgPrev=draw.io SVG preview\ngoogleFonts=Google Fonts\ndiagDupl=Duplicate Diagram Detected\ndiagDuplMsg=This diagram is used in multiple places, which can result in unexpected results when edited. We\'ve created an independent copy. Please open the editor again.\ndiagDuplNoEditMsg=This diagram is used in multiple places. Please edit it within its own page.\nconfCloudMigConfirm=Warning: This process will edit many pages and diagrams, so it is recommended to stop the Synchrony service during the process. Do you want to proceed?\nconfCloudMigNotice=In the Cloud instance, please add linkAdjustments to draw.io configuration as follows {1}. Without this configuration, links in diagrams pointing to Confluence pages will not work.\nconfALogsPageDesc=This page contains logs of draw.io long running services as attachments\nconfEditOnlyInPageEditor=Can only be edited within Confluence page editor\nconfEvalWarn=Evaluation License - Not for production use\notherUsersEditing=Other user(s) are editing this diagram\nfirstTimeGD=First time to access this file?\ndrawioGDAppNotInstalled=draw.io Google Drive app is not installed, please install it first\nConfDC415Error=Saving drafts is blocked. If you have "Attachment Checker for Confluence" app, please update to the latest version.\nremove=Remove\nselectPgLyr=Select Page and Layers\nerrGenPreview=There was an error generating a diagram preview. Please consult technical support.\nattAccessErr=Diagram attachment access error: cannot display diagram\nwidthIntOrFixed=Width must be a valid integer or of value \'fixed\'\ndupDisabledPgLyrSlct=Diagram duplication is disabled when page and layers are selected\ncantDupPickDiffName=Could not duplicate diagram. Please choose a different name.\nownPgAccessDupErr=Owning page access restriction: cannot duplicate diagram.\ncantDupTryLater=Could not duplicate diagram. Please try again later.\ncantEditLnkd=Cannot edit linked diagram\ndiagEditOwnPgOnlyOpen=Diagram can only be edited from the page that owns it. Would you like to open the owning page for edit?\ndiagInTemps=draw.io diagrams in templates\ndiagInTempsCantEdit=Diagrams in page templates cannot be edited. They can only be edited on pages and blog posts.\nconfDirectEditDraftLost=This Confluence page has unpublished changes. Editing the diagram from page view may cause data loss. Please edit the Confluence page first and then edit the diagram.\nconfConfigSpacePerm=Note: If you recently migrated from DC app, please check draw.io Configuration space permissions such that all users can read and only admins can write. In addition, remove the page restrictions on "Configuration" and "Libraries" pages. You may need admin keys to access them. Also, please check the file "configuration.json" in the "Configuration" page is downloadable.\ntryCurPageOnErr=Try finding the diagram attachment on the macro page when the linked page fails\nconfAExtSrvcNoSupported=Embedded diagrams from external services or urls are not supported.\ngliffyVersionPinning=Import Gliffy pinned version instead of the latest version\nconfEmbedUpload=For a better editing experience, please use the regular draw.io macro to insert a blank diagram, then from (File menu → Import From → Device...) select the file you want to upload and embed.\nconfPublishErr=Another update conflicted with your publish, please try the operation again\ndrives=Drives\n');Graph.prototype.defaultThemes["default-style2"]=mxUtils.parseXml('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="default"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="default"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="default"/><add as="fontColor" value="default"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="edgeLabel" extend="text"><add as="labelBackgroundColor" value="default"/><add as="fontSize" value="11"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="default"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="default"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="default"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add></mxStylesheet>').documentElement;
Graph.prototype.defaultThemes.darkTheme=Graph.prototype.defaultThemes["default-style2"];Editor.currentTheme="";window.uiTheme="";GraphViewer=function(b,f,l){this.init(b,f,l)};mxUtils.extend(GraphViewer,mxEventSource);GraphViewer.prototype.editBlankUrl="1"==urlParams.dev?"https://test.draw.io/":"https://app.diagrams.net/";GraphViewer.prototype.imageBaseUrl=window.DRAWIO_BASE_URL+"/";GraphViewer.prototype.toolbarHeight="BackCompat"==document.compatMode?24:26;GraphViewer.prototype.lightboxChrome=!0;GraphViewer.prototype.lightboxZIndex=999;GraphViewer.prototype.toolbarZIndex=999;
GraphViewer.prototype.autoFit=!1;GraphViewer.prototype.autoCrop=!1;GraphViewer.prototype.autoOrigin=!0;GraphViewer.prototype.center=!1;GraphViewer.prototype.forceCenter=!1;GraphViewer.prototype.allowZoomIn=!1;GraphViewer.prototype.allowZoomOut=!0;GraphViewer.prototype.showTitleAsTooltip=!1;GraphViewer.prototype.checkVisibleState=!0;GraphViewer.prototype.minHeight=28;GraphViewer.prototype.minWidth=100;GraphViewer.prototype.responsive=!1;GraphViewer.prototype.darkMode=null;
GraphViewer.prototype.init=function(b,f,l){GraphViewer.initCss();this.graphConfig=null!=l?l:{};this.autoFit=null!=this.graphConfig["auto-fit"]?this.graphConfig["auto-fit"]:this.autoFit;this.autoCrop=null!=this.graphConfig["auto-crop"]?this.graphConfig["auto-crop"]:this.autoCrop;this.autoOrigin=null!=this.graphConfig["auto-origin"]?this.graphConfig["auto-origin"]:this.autoOrigin;this.allowZoomOut=null!=this.graphConfig["allow-zoom-out"]?this.graphConfig["allow-zoom-out"]:this.allowZoomOut;this.allowZoomIn=
null!=this.graphConfig["allow-zoom-in"]?this.graphConfig["allow-zoom-in"]:this.allowZoomIn;this.forceCenter=null!=this.graphConfig.forceCenter?this.graphConfig.forceCenter:this.forceCenter;this.center=null!=this.graphConfig.center?this.graphConfig.center:this.center||this.forceCenter;this.checkVisibleState=null!=this.graphConfig["check-visible-state"]?this.graphConfig["check-visible-state"]:this.checkVisibleState;this.darkMode=null!=this.graphConfig["dark-mode"]?this.graphConfig["dark-mode"]:this.darkMode;
this.toolbarItems=null!=this.graphConfig.toolbar?this.graphConfig.toolbar.split(" "):[];this.zoomEnabled=0<=mxUtils.indexOf(this.toolbarItems,"zoom");this.layersEnabled=0<=mxUtils.indexOf(this.toolbarItems,"layers");this.tagsEnabled=0<=mxUtils.indexOf(this.toolbarItems,"tags");this.lightboxEnabled=0<=mxUtils.indexOf(this.toolbarItems,"lightbox");this.lightboxClickEnabled=0!=this.graphConfig.lightbox;this.initialOverflow=document.body.style.overflow;this.initialWidth=null!=b?b.style.width:null;this.widthIsEmpty=
null!=this.initialWidth?""==this.initialWidth:!0;this.currentPage=parseInt(this.graphConfig.page)||0;this.responsive=(null!=this.graphConfig.responsive?this.graphConfig.responsive:this.responsive)&&!this.zoomEnabled&&!mxClient.NO_FO&&!mxClient.IS_SF;this.pageId=this.graphConfig.pageId;this.editor=null;var u=this;"inline"==this.graphConfig["toolbar-position"]&&(this.minHeight+=this.toolbarHeight);if(null!=f&&(this.xmlDocument=f.ownerDocument,this.xmlNode=f,this.xml=mxUtils.getXml(f),null!=b)){var y=
mxUtils.bind(this,function(){this.graph=new Graph(b);this.graph.enableFlowAnimation=!0;this.installDarkModeListener();if(this.responsive&&this.graph.dialect==mxConstants.DIALECT_SVG){var H=this.graph.view.getDrawPane().ownerSVGElement;null!=this.graphConfig.border?H.style.padding=this.graphConfig.border+"px":""==b.style.padding&&(H.style.padding="8px");H.style.forcedColorAdjust="none";H.style.boxSizing="border-box";H.style.overflow="visible";this.graph.fit=function(){};this.graph.sizeDidChange=function(){var x=
this.view.graphBounds,F=this.view.translate;H.setAttribute("viewBox",x.x+F.x-this.panDx+" "+(x.y+F.y-this.panDy)+" "+(x.width+1)+" "+(x.height+1));this.container.style.backgroundColor=H.style.backgroundColor;this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",x))}}this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(x){return!0});this.lightboxClickEnabled&&(b.style.cursor="pointer");this.editor=new Editor(!0,null,null,this.graph);this.editor.editBlankUrl=this.editBlankUrl;this.graph.lightbox=
!0;this.graph.centerZoom=!1;this.graph.autoExtend=!1;this.graph.autoScroll=!1;this.graph.setEnabled(!1);1==this.graphConfig["toolbar-nohide"]&&(this.editor.defaultGraphOverflow="visible");var S=this.editor.extractGraphModel(this.xmlNode,!0);if(null!=S&&S!=f)try{this.xml=mxUtils.getXml(S),this.xmlNode=S,this.xmlDocument=S.ownerDocument}catch(x){}this.graph.getImageFromBundles=function(x){return u.getImageUrl(x)};this.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);if("mxfile"==this.xmlNode.nodeName){var E=
this.xmlNode.getElementsByTagName("diagram");if(0<E.length){if(null!=this.pageId)for(S=0;S<E.length;S++)if(this.pageId==E[S].getAttribute("id")){this.currentPage=S;break}var Q=this.graph.getGlobalVariable;this.graph.getGlobalVariable=function(x){var F=E[u.currentPage];return"page"==x?F.getAttribute("name")||"Page-"+(u.currentPage+1):"pagenumber"==x?u.currentPage+1:"pagecount"==x?E.length:Q.apply(this,arguments)}}}this.diagrams=[];var c=null;this.selectPage=function(x){this.handlingResize||(this.currentPage=
mxUtils.mod(x,this.diagrams.length),this.updateGraphXml(Editor.parseDiagramNode(this.diagrams[this.currentPage])))};this.selectPageById=function(x){x=this.getIndexById(x);var F=0<=x;F&&this.selectPage(x);return F};S=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=c&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),c=this.xmlNode)});var g=this.graph.setBackgroundImage;this.graph.setBackgroundImage=function(x){if(null!=x&&
Graph.isPageLink(x.src)){var F=x.src,I=F.indexOf(",");0<I&&(I=u.getIndexById(F.substring(I+1)),0<=I&&(x=u.getImageForGraphModel(Editor.parseDiagramNode(u.diagrams[I])),x.originalSrc=F))}g.apply(this,arguments)};var m=this.graph.getGraphBounds;this.graph.getGraphBounds=function(x){var F=m.apply(this,arguments);x=this.backgroundImage;if(null!=x){var I=this.view.translate,M=this.view.scale;F=mxRectangle.fromRectangle(F);F.add(new mxRectangle((I.x+x.x)*M,(I.y+x.y)*M,x.width*M,x.height*M))}return F};this.addListener("xmlNodeChanged",
S);S();urlParams.page=u.currentPage;S=null;this.graph.getModel().beginUpdate();try{urlParams.nav=0!=this.graphConfig.nav?"1":"0",this.editor.setGraphXml(this.xmlNode),this.graph.view.scale=this.graphConfig.zoom||1,S=this.setLayersVisible(),this.fireEvent(new mxEventObject("graphInitialized")),this.responsive||(this.graph.border=null!=this.graphConfig.border?this.graphConfig.border:8),this.installBackgroundColorHandler(),GraphViewer.viewerInitialized(this)}finally{this.graph.getModel().endUpdate()}this.responsive||
(this.graph.panningHandler.isForcePanningEvent=function(x){return!mxEvent.isPopupTrigger(x.getEvent())&&"auto"==this.graph.container.style.overflow},this.graph.panningHandler.useLeftButtonForPanning=!0,this.graph.panningHandler.ignoreCell=!0,this.graph.panningHandler.usePopupTrigger=!1,this.graph.panningHandler.pinchEnabled=!1);this.graph.setPanning(!1);null!=this.graphConfig.toolbar?this.addToolbar():null!=this.graphConfig.title&&this.showTitleAsTooltip&&b.setAttribute("title",this.graphConfig.titleTooltip||
this.graphConfig.title);this.responsive||this.addSizeHandler();!this.showLayers(this.graph)||this.forceCenter||this.layersEnabled&&!this.autoCrop||this.crop();this.addClickHandler(this.graph);this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};null!=S&&this.setLayersVisible(S);this.graph.customLinkClicked=function(x,F){try{if(Graph.isPageLink(x)){var I=x.indexOf(",");u.selectPageById(x.substring(I+1))||alert(mxResources.get("pageNotFound")||"Page not found")}else{var M=
this.getGraphBounds();this.handleCustomLink(x,F);M.equals(this.getGraphBounds())||u.crop()}}catch(L){alert(L.message)}return!0};var n=this.graph.foldTreeCell;this.graph.foldTreeCell=mxUtils.bind(this,function(){this.treeCellFolded=!0;return n.apply(this.graph,arguments)});this.fireEvent(new mxEventObject("render"))});l=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==b.offsetWidth&&null==this.getAncestorDetails(b)&&"undefined"!==typeof l){var q=
this.getObservableParent(b),B=new l(mxUtils.bind(this,function(H){0<b.offsetWidth&&(B.disconnect(),y())}));B.observe(q,{attributes:!0})}else y()}};
GraphViewer.prototype.installBackgroundColorHandler=function(){var b=this.graph;if(null!=b){null!=GraphViewer.shapeBackgroundColor&&(b.shapeBackgroundColor=GraphViewer.shapeBackgroundColor);b.defaultPageBackgroundColor="transparent";b.diagramBackgroundColor="transparent";b.transparentBackground=!1;var f=b.background,l=mxUtils.bind(this,function(u){"none"==b.getAdaptiveColors()&&null==f&&(this.isDarkMode()?b.background="#ffffff":b.background=null,u&&b.view.validateBackground())});this.addListener("graphChanged",
function(){f=b.background;l(!0)});this.addListener("darkModeChanged",function(){l(!0)});l(!1)}};GraphViewer.prototype.installDarkModeListener=function(){null!=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",mxUtils.bind(this,function(){this.darkModeChanged();this.fireEvent(new mxEventObject("darkModeChanged"))}));this.darkModeChanged()};
GraphViewer.prototype.darkModeChanged=function(){if(null!=this.graph){var b=this.graph.container,f=this.isDarkMode();f?b.classList.add("geDarkMode"):b.classList.remove("geDarkMode");b.style.colorScheme=f?"dark":"light"}};GraphViewer.prototype.getAncestorDetails=function(b){for(;null!=b;){if("DETAILS"==b.nodeName)return b;b=b.parentNode}return null};
GraphViewer.prototype.getObservableParent=function(b){for(b=b.parentNode;b!=document.body&&null!=b.parentNode&&"none"!==mxUtils.getCurrentStyle(b).display;)b=b.parentNode;return b};GraphViewer.prototype.getImageUrl=function(b){null!=b&&"http://"!=b.substring(0,7)&&"https://"!=b.substring(0,8)&&"data:image"!=b.substring(0,10)&&("/"==b.charAt(0)&&(b=b.substring(1,b.length)),b=this.imageBaseUrl+b);return b};
GraphViewer.prototype.getImageForGraphModel=function(b){var f=Graph.createOffscreenGraph(this.graph.getStylesheet());f.getGlobalVariable=this.graph.getGlobalVariable;document.body.appendChild(f.container);b=(new mxCodec(b.ownerDocument)).decode(b).root;f.model.setRoot(b);b=f.getSvg();var l=f.getGraphBounds();document.body.removeChild(f.container);return new mxImage(Editor.createSvgDataUri(mxUtils.getXml(b)),l.width,l.height,l.x,l.y)};
GraphViewer.prototype.getIndexById=function(b){if(null!=this.diagrams)for(var f=0;f<this.diagrams.length;f++)if(this.diagrams[f].getAttribute("id")==b)return f;return-1};GraphViewer.prototype.setXmlNode=function(b){b=this.editor.extractGraphModel(b,!0);this.xmlDocument=b.ownerDocument;this.xml=mxUtils.getXml(b);this.xmlNode=b;this.updateGraphXml(b);this.fireEvent(new mxEventObject("xmlNodeChanged"))};
GraphViewer.prototype.setFileNode=function(b){null==this.xmlNode&&(this.xmlDocument=b.ownerDocument,this.xml=mxUtils.getXml(b),this.xmlNode=b);this.setGraphXml(b)};GraphViewer.prototype.updateGraphXml=function(b){this.setGraphXml(b);this.fireEvent(new mxEventObject("graphChanged"))};
GraphViewer.prototype.setLayersVisible=function(b){var f=!0;if(!this.autoOrigin){var l=[],u=this.graph.getModel();u.beginUpdate();try{for(var y=0;y<u.getChildCount(u.root);y++){var q=u.getChildAt(u.root,y);f=f&&u.isVisible(q);l.push(u.isVisible(q));u.setVisible(q,null!=b?b[y]:!0)}}finally{u.endUpdate()}}return f?null:l};
GraphViewer.prototype.setGraphXml=function(b){if(null!=this.graph){this.graph.view.translate=new mxPoint;this.graph.view.scale=1;var f=null;this.graph.getModel().beginUpdate();try{this.graph.getModel().clear(),this.editor.setGraphXml(b),f=this.setLayersVisible(!0)}finally{this.graph.getModel().endUpdate()}this.responsive||(this.widthIsEmpty?(this.graph.container.style.width="",this.graph.container.style.height=""):this.graph.container.style.width=this.initialWidth,this.positionGraph());this.graph.initialViewState=
{translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};f&&this.setLayersVisible(f)}};GraphViewer.prototype.isDarkMode=function(){return"dark"==this.darkMode||"auto"==this.darkMode&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches};
GraphViewer.prototype.addSizeHandler=function(){var b=this.graph.container,f=this.graph.getGraphBounds(),l=!1;b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?"hidden":"visible";var u=mxUtils.bind(this,function(){if(!l){l=!0;var H=this.graph.getGraphBounds();b.style.overflow=1!=this.graphConfig["toolbar-nohide"]?H.width+2*this.graph.border>b.offsetWidth-2?"auto":"hidden":"visible";if(null!=this.toolbar&&1!=this.graphConfig["toolbar-nohide"]){H=b.getBoundingClientRect();var S=mxUtils.getScrollOrigin(document.body);
S="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-S.x,top:-S.y};H={left:H.left-S.left,top:H.top-S.top,bottom:H.bottom-S.top,right:H.right-S.left};this.toolbar.style.left=H.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=H.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px",this.toolbar.style.top=H.top+1+"px"):this.toolbar.style.top=H.top+"px"}else null!=
this.toolbar&&(this.toolbar.style.width=Math.max(this.minToolbarWidth,b.offsetWidth)+"px");this.treeCellFolded&&(this.treeCellFolded=!1,this.positionGraph(this.graph.view.translate),this.graph.initialViewState.translate=this.graph.view.translate.clone());l=!1}}),y=null;this.handlingResize=!1;this.fitGraph=mxUtils.bind(this,function(H){var S=b.offsetWidth;S==y||this.handlingResize||(this.handlingResize=!0,"auto"==b.style.overflow&&(b.style.overflow="hidden"),this.graph.maxFitScale=null!=H?H:this.graphConfig.zoom||
(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,null,!0),(this.center||0==this.graphConfig.resize&&""!=b.style.height)&&this.graph.center(),this.graph.maxFitScale=null,0==this.graphConfig.resize&&""!=b.style.height||this.updateContainerHeight(b,Math.max(this.minHeight,this.graph.getGraphBounds().height+2*this.graph.border+1)),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},y=S,window.setTimeout(mxUtils.bind(this,function(){this.handlingResize=
!1}),0))});GraphViewer.useResizeSensor&&(9>=document.documentMode?(mxEvent.addListener(window,"resize",u),this.graph.addListener("size",u)):new ResizeSensor(this.graph.container,u));if(this.graphConfig.resize||(this.zoomEnabled||!this.autoFit)&&0!=this.graphConfig.resize)this.graph.minimumContainerSize=new mxRectangle(0,0,this.minWidth,this.minHeight),this.graph.resizeContainer=!0;else if(!this.widthIsEmpty||""!=b.style.height&&this.autoFit||this.updateContainerWidth(b,f.width+2*this.graph.border),
0==this.graphConfig.resize&&""!=b.style.height||this.updateContainerHeight(b,Math.max(this.minHeight,f.height+2*this.graph.border+1)),!this.zoomEnabled&&this.autoFit){var q=y=null;u=mxUtils.bind(this,function(){window.clearTimeout(q);this.handlingResize||(q=window.setTimeout(mxUtils.bind(this,this.fitGraph),100))});GraphViewer.useResizeSensor&&(9>=document.documentMode?mxEvent.addListener(window,"resize",u):new ResizeSensor(this.graph.container,u))}else 9>=document.documentMode||this.graph.addListener("size",
u);var B=mxUtils.bind(this,function(H){var S=b.style.minWidth;this.widthIsEmpty&&(b.style.minWidth="100%");var E=null!=this.graphConfig["max-height"]?this.graphConfig["max-height"]:""!=b.style.height&&this.autoFit?b.offsetHeight:void 0;0<b.offsetWidth&&null==H&&this.allowZoomOut&&(this.allowZoomIn||f.width+2*this.graph.border>b.offsetWidth||f.height+2*this.graph.border>E)?(H=null,null!=E&&f.height+2*this.graph.border>E-2&&(H=(E-2*this.graph.border-2)/f.height),this.fitGraph(H)):this.widthIsEmpty||
null!=H||0!=this.graphConfig.resize||""==b.style.height?(H=null!=H?H:new mxPoint,this.graph.view.setTranslate(Math.floor(this.graph.border-f.x/this.graph.view.scale)+H.x,Math.floor(this.graph.border-f.y/this.graph.view.scale)+H.y),y=b.offsetWidth):this.graph.center((!this.widthIsEmpty||f.width<this.minWidth)&&1!=this.graphConfig.resize);b.style.minWidth=S});8==document.documentMode?window.setTimeout(B,0):B();this.positionGraph=function(H){f=this.graph.getGraphBounds();y=null;B(H)}};
GraphViewer.prototype.crop=function(){var b=this.graph,f=b.getGraphBounds(),l=b.border,u=b.view.scale;b.view.setTranslate(null!=f.x?Math.floor(b.view.translate.x-f.x/u+l):l,null!=f.y?Math.floor(b.view.translate.y-f.y/u+l):l)};GraphViewer.prototype.updateContainerWidth=function(b,f){b.style.width=f+"px"};GraphViewer.prototype.updateContainerHeight=function(b,f){if(this.forceCenter||this.zoomEnabled||!this.autoFit||"BackCompat"==document.compatMode||8==document.documentMode)b.style.height=f+"px"};
GraphViewer.prototype.showLayers=function(b,f){var l=this.graphConfig.layers;l=null!=l&&0<l.length?l.split(" "):[];var u=this.graphConfig.layerIds,y=null!=u&&0<u.length,q=!1;if(0<l.length||y||null!=f){f=null!=f?f.getModel():null;b=b.getModel();b.beginUpdate();try{var B=b.getChildCount(b.root);if(null==f){f=!1;q={};if(y)for(var H=0;H<u.length;H++){var S=b.getCell(u[H]);null!=S&&(f=!0,q[S.id]=!0)}else for(H=0;H<l.length;H++)S=b.getChildAt(b.root,parseInt(l[H])),null!=S&&(f=!0,q[S.id]=!0);for(H=0;f&&
H<B;H++)S=b.getChildAt(b.root,H),b.setVisible(S,q[S.id]||!1)}else for(H=0;H<B;H++)b.setVisible(b.getChildAt(b.root,H),f.isVisible(f.getChildAt(f.root,H)))}finally{b.endUpdate()}q=!0}return q};
GraphViewer.prototype.addToolbar=function(){var b=this.graph.container;"bottom"==this.graphConfig["toolbar-position"]?b.style.marginBottom=this.toolbarHeight+"px":"inline"!=this.graphConfig["toolbar-position"]&&(b.style.marginTop=this.toolbarHeight+"px");var f=b.ownerDocument.createElement("div");f.style.display="flex";f.style.alignItems="center";f.style.position="absolute";f.style.overflow="hidden";f.style.boxSizing="border-box";f.style.whiteSpace="nowrap";f.style.textAlign="left";f.style.zIndex=
this.toolbarZIndex;f.style.backgroundColor="light-dark(#eeeeee, "+GraphViewer.darkBackgroundColor+")";f.style.height=this.toolbarHeight+"px";var l=mxUtils.bind(this,function(){this.isDarkMode()?(f.classList.add("geDarkMode"),f.style.colorScheme="dark"):(f.classList.remove("geDarkMode"),f.style.colorScheme="light")});this.addListener("darkModeChanged",l);this.toolbar=f;l();if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(f.style,"transition","opacity 100ms ease-in-out");
mxUtils.setOpacity(f,30);var u=null,y=null,q=mxUtils.bind(this,function(ba){null!=u&&(window.clearTimeout(u),fadeThead=null);null!=y&&(window.clearTimeout(y),fadeThead2=null);u=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(f,0);u=null;y=window.setTimeout(mxUtils.bind(this,function(){f.style.display="none";y=null}),100)}),ba||200)}),B=mxUtils.bind(this,function(ba){null!=u&&(window.clearTimeout(u),fadeThead=null);null!=y&&(window.clearTimeout(y),fadeThead2=null);f.style.display=
"";mxUtils.setOpacity(f,ba||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(ba){mxEvent.isTouchEvent(ba)||(B(30),q())}));mxEvent.addListener(f,mxClient.IS_POINTER?"pointermove":"mousemove",function(ba){mxEvent.consume(ba)});mxEvent.addListener(f,"mouseenter",mxUtils.bind(this,function(ba){B(100)}));mxEvent.addListener(f,"mousemove",mxUtils.bind(this,function(ba){B(100);mxEvent.consume(ba)}));mxEvent.addListener(f,"mouseleave",
mxUtils.bind(this,function(ba){mxEvent.isTouchEvent(ba)||B(30)}));var H=this.graph,S=H.getTolerance();H.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(ba,oa){this.startX=oa.getGraphX();this.startY=oa.getGraphY();this.scrollLeft=H.container.scrollLeft;this.scrollTop=H.container.scrollTop},mouseMove:function(ba,oa){},mouseUp:function(ba,oa){mxEvent.isTouchEvent(oa.getEvent())&&Math.abs(this.scrollLeft-H.container.scrollLeft)<S&&Math.abs(this.scrollTop-H.container.scrollTop)<
S&&Math.abs(this.startX-oa.getGraphX())<S&&Math.abs(this.startY-oa.getGraphY())<S&&(0<parseFloat(f.style.opacity||0)?q():B(30))}})}l=this.toolbarItems;for(var E=0,Q=mxUtils.bind(this,function(ba,oa,Y,da){ba=this.createToolbarButton(ba,oa,Y,da);f.appendChild(ba);E++;return ba}),c=this.graph.getModel(),g=null,m=null,n=null,x=null,F=0;F<l.length;F++){var I=l[F];if("pages"==I){x=b.ownerDocument.createElement("div");x.style.display="inline-flex";x.style.position="relative";x.style.alignItems="center";
x.style.padding="4px";x.style.fontFamily=GraphViewer.cssFontFamily;x.style.fontSize="12px";x.style.cursor="default";x.style.color="light-dark(#000000, #ffffff)";mxUtils.setOpacity(x,70);var M=Q(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.chevronLeftImage,mxResources.get("previousPage")||"Previous Page");M.style.borderRightStyle="none";M.style.paddingLeft="0px";M.style.paddingRight="0px";f.appendChild(x);var L=Q(mxUtils.bind(this,function(){this.selectPage(this.currentPage+
1)}),Editor.chevronRightImage,mxResources.get("nextPage")||"Next Page");L.style.paddingLeft="0px";L.style.paddingRight="0px";I=mxUtils.bind(this,function(){x.innerText="";mxUtils.write(x,this.currentPage+1+" / "+this.diagrams.length);x.style.display=1<this.diagrams.length?"inline-flex":"none";M.style.display=x.style.display;L.style.display=x.style.display});this.addListener("graphChanged",I);I()}else if("zoom"==I)this.zoomEnabled&&(Q(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,
mxResources.get("zoomOut")||"Zoom Out"),Q(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),Q(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==I){if(this.layersEnabled){var K=Q(mxUtils.bind(this,function(ba){if(null!=g)g.parentNode.removeChild(g),
g=null;else{g=this.graph.createLayersDialog(mxUtils.bind(this,function(){if(this.autoCrop)this.crop();else if(this.autoOrigin){var Y=this.graph.getGraphBounds(),da=this.graph.view;0>Y.x||0>Y.y?(this.crop(),this.graph.originalViewState=this.graph.initialViewState,this.graph.initialViewState={translate:da.translate.clone(),scale:da.scale}):null!=this.graph.originalViewState&&0<Y.x/da.scale+this.graph.originalViewState.translate.x-da.translate.x&&0<Y.y/da.scale+this.graph.originalViewState.translate.y-
da.translate.y&&(da.setTranslate(this.graph.originalViewState.translate.x,this.graph.originalViewState.translate.y),this.graph.originalViewState=null,this.graph.initialViewState={translate:da.translate.clone(),scale:da.scale})}}));mxEvent.addListener(g,"mouseleave",function(){g.parentNode.removeChild(g);g=null});ba=K.getBoundingClientRect();g.style.width="140px";g.style.padding="2px 0px 2px 0px";g.style.border="1px solid #d0d0d0";g.style.backgroundColor="#eee";g.style.fontFamily=GraphViewer.cssFontFamily;
g.style.fontSize="11px";g.style.overflowY="auto";g.style.maxHeight=this.graph.container.clientHeight-this.toolbarHeight-10+"px";g.style.zIndex=this.toolbarZIndex+1;g.style.color="#000";mxUtils.setOpacity(g,85);var oa=mxUtils.getDocumentScrollOrigin(document);g.style.left=oa.x+ba.left-1+"px";g.style.top=oa.y+ba.bottom-2+"px";this.isDarkMode()&&(g.style.filter="invert(93%) hue-rotate(180deg)");document.body.appendChild(g)}}),Editor.layersImage,mxResources.get("layers")||"Layers");c.addListener(mxEvent.CHANGE,
function(){K.style.display=1<c.getChildCount(c.root)?"inline-flex":"none"});K.style.display=1<c.getChildCount(c.root)?"inline-flex":"none"}}else if("tags"==I){if(this.tagsEnabled){var aa=Q(mxUtils.bind(this,function(ba){null==m&&(m=this.graph.createTagsDialog(mxUtils.bind(this,function(){return!0})),m.div.getElementsByTagName("div")[0].style.position="",m.div.style.maxHeight="160px",m.div.style.maxWidth="120px",m.div.style.padding="2px",m.div.style.overflow="auto",m.div.style.height="auto",m.div.style.position=
"fixed",m.div.style.fontFamily=GraphViewer.cssFontFamily,m.div.style.fontSize="11px",m.div.style.backgroundColor="#eee",m.div.style.color="#000",m.div.style.border="1px solid #d0d0d0",m.div.style.zIndex=this.toolbarZIndex+1,this.isDarkMode()&&(m.div.style.filter="invert(93%) hue-rotate(180deg)"),mxUtils.setOpacity(m.div,85));if(null!=n)n.parentNode.removeChild(n),n=null;else{n=m.div;n.style.position="absolute";mxEvent.addListener(n,"mouseleave",function(){null!=n&&(n.parentNode.removeChild(n),n=null)});
ba=aa.getBoundingClientRect();var oa=mxUtils.getDocumentScrollOrigin(document);n.style.left=oa.x+ba.left-1+"px";n.style.top=oa.y+ba.bottom-2+"px";document.body.appendChild(n);m.refresh()}}),Editor.tagsImage,mxResources.get("tags")||"Tags");c.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){aa.style.display=0<this.graph.getAllTags().length?"inline-flex":"none";null!=n&&0==this.graph.getAllTags().length&&(n.parentNode.removeChild(n),n=null)}));aa.style.display=0<this.graph.getAllTags().length?
"inline-flex":"none"}}else"lightbox"==I?this.lightboxEnabled&&Q(mxUtils.bind(this,function(){try{this.showLightbox()}catch(ba){alert(ba.message)}}),Editor.fullscreenImage,mxResources.get("fullscreen")||"Fullscreen"):null!=this.graphConfig["toolbar-buttons"]&&(I=this.graphConfig["toolbar-buttons"][I],null!=I&&(I.elem=Q(null==I.enabled||I.enabled?I.handler:function(){},I.image,I.title,I.enabled)))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*E);null!=this.graphConfig.title&&
(l=b.ownerDocument.createElement("div"),l.style.display="inline-flex",l.style.position="relative",l.style.alignItems="center",l.style.padding="6px",l.style.fontFamily=GraphViewer.cssFontFamily,l.style.fontSize="12px",l.style.cursor="default",l.style.color="light-dark(#000000, #ffffff)",l.setAttribute("title",this.graphConfig.titleTooltip||this.graphConfig.title),mxUtils.write(l,this.graphConfig.title),mxUtils.setOpacity(l,70),f.appendChild(l),this.filename=l);this.minToolbarWidth=34*E;var ja=b.style.border,
ca=mxUtils.bind(this,function(){f.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";f.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var ba=b.getBoundingClientRect(),oa=mxUtils.getScrollOrigin(document.body);oa="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-oa.x,top:-oa.y};ba={left:ba.left-oa.left,top:ba.top-oa.top,bottom:ba.bottom-oa.top,right:ba.right-oa.left};f.style.left=
ba.left+"px";"bottom"==this.graphConfig["toolbar-position"]?f.style.top=ba.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(f.style.marginTop=-this.toolbarHeight+"px",f.style.top=ba.top+1+"px"):f.style.top=ba.top+"px";"1px solid transparent"==ja&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(f);var Y=mxUtils.bind(this,function(){null!=f.parentNode&&f.parentNode.removeChild(f);null!=n&&(n.parentNode.removeChild(n),n=null);null!=g&&(g.parentNode.removeChild(g),g=null);
b.style.border=ja});mxEvent.addListener(document,"mousemove",function(da){for(da=mxEvent.getSource(da);null!=da;){if(da==b||da==f||da==g||da==n)return;da=da.parentNode}Y()});mxEvent.addListener(document.body,"mouseleave",function(da){Y()})}else f.style.top=-this.toolbarHeight+"px",b.appendChild(f)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",ca):ca();this.responsive&&"undefined"!==typeof ResizeObserver&&(new ResizeObserver(function(){null!=f.parentNode&&ca()})).observe(b)};
GraphViewer.prototype.createToolbarButton=function(b,f,l,u){var y=document.createElement("div");y.style.borderRight="1px solid #d0d0d0";y.style.display="inline-flex";y.style.alignItems="center";y.style.padding="6px";mxEvent.addListener(y,"click",b);null!=l&&y.setAttribute("title",l);b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",f);b.style.width="18px";b.className="geAdaptiveAsset";null==u||u?(mxEvent.addListener(y,"mouseenter",function(){y.style.backgroundColor=
"light-dark(#dddddd,#333333)"}),mxEvent.addListener(y,"mouseleave",function(){y.style.backgroundColor="transparent"}),mxUtils.setOpacity(b,60),y.style.cursor="pointer"):mxUtils.setOpacity(y,30);y.appendChild(b);return y};
GraphViewer.prototype.disableButton=function(b,f){var l=this.graphConfig["toolbar-buttons"]?this.graphConfig["toolbar-buttons"][b]:null;null!=l&&(mxUtils.setOpacity(l.elem,30),mxEvent.removeListener(l.elem,"click",l.handler),mxEvent.addListener(l.elem,"mouseenter",function(){l.elem.style.backgroundColor="#eee"}),f&&l.elem.setAttribute("title",f))};
GraphViewer.prototype.addClickHandler=function(b,f){b.linkPolicy=this.graphConfig.target||b.linkPolicy;b.addClickHandler(this.graphConfig.highlight,mxUtils.bind(this,function(l,u,y){if(null==u)for(var q=mxEvent.getSource(l);q!=b.container&&null!=q&&null==u;)"a"==q.nodeName.toLowerCase()&&(u=q.getAttribute("href")),q=q.parentNode;null!=f?null==u||b.isCustomLink(u)?mxEvent.consume(l):b.isExternalProtocol(u)||b.isBlankLink(u)||window.setTimeout(function(){f.destroy()},0):null!=u&&null==f&&b.isCustomLink(u)&&
(mxEvent.isTouchEvent(l)||!mxEvent.isPopupTrigger(l))&&b.customLinkClicked(u,y)&&(mxUtils.clearSelection(),mxEvent.consume(l))}),mxUtils.bind(this,function(l){if(null==f&&this.lightboxClickEnabled&&(!mxEvent.isTouchEvent(l)||0==this.toolbarItems.length))try{this.showLightbox()}catch(u){alert(u.message)}}))};
GraphViewer.prototype.showLightbox=function(b,f,l){if("open"==this.graphConfig.lightbox||window.self!==window.top)if(null==this.lightboxWindow||this.lightboxWindow.closed){b=null!=b?b:null!=this.graphConfig.editable?this.graphConfig.editable:!0;l={client:1,target:null!=l?l:"blank"};b&&(l.edit=this.graphConfig.edit||"_blank");if(null!=f?f:1)l.close=1;this.layersEnabled&&(l.layers=1);this.tagsEnabled&&(l.tags={});null!=this.graphConfig&&0!=this.graphConfig.nav&&(l.nav=1);null!=this.graphConfig&&null!=
this.graphConfig.highlight&&(l.highlight=this.graphConfig.highlight.substring(1));null!=this.currentPage&&0<this.currentPage&&(l.page=this.currentPage);"undefined"!==typeof window.postMessage&&(null==document.documentMode||10<=document.documentMode)?null==this.lightboxWindow&&mxEvent.addListener(window,"message",mxUtils.bind(this,function(u){"ready"==u.data&&u.source==this.lightboxWindow&&this.lightboxWindow.postMessage(this.xml,"*")})):l.data=encodeURIComponent(this.xml);"1"==urlParams.dev&&(l.dev=
"1");this.lightboxWindow=window.open(("1"!=urlParams.dev?EditorUi.lightboxHost:"https://test.draw.io")+"/#P"+encodeURIComponent(JSON.stringify(l)))}else this.lightboxWindow.focus();else this.showLocalLightbox()};
GraphViewer.prototype.showLocalLightbox=function(b){var f=document.createElement("div");f.style.position="fixed";f.style.top="0";f.style.left="0";f.style.bottom="0";f.style.right="0";f.style.zIndex=this.lightboxZIndex;f.style.backgroundColor="#000000";mxUtils.setOpacity(f,70);document.body.appendChild(f);var l=document.createElement("img");l.setAttribute("border","0");l.setAttribute("src",Editor.closeBlackImage);l.style.position="fixed";l.style.top="32px";l.style.right="32px";l.style.cursor="pointer";
l.className="geAdaptiveAsset";var u=mxUtils.bind(this,function(){q.setDarkMode(this.isDarkMode())});mxEvent.addListener(l,"click",mxUtils.bind(this,function(){this.removeListener("darkModeChanged",u);q.destroy()}));urlParams.pages="1";urlParams.page=this.currentPage;urlParams["page-id"]=this.graphConfig.pageId;urlParams["layer-ids"]=null!=this.graphConfig.layerIds&&0<this.graphConfig.layerIds.length?this.graphConfig.layerIds.join(" "):null;urlParams.nav=0!=this.graphConfig.nav?"1":"0";urlParams.layers=
this.layersEnabled?"1":"0";urlParams.dark=this.isDarkMode()?"1":"0";this.tagsEnabled&&(urlParams.tags="{}");if(null!=b)try{var y=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));y.noCloseBtn=!0;urlParams["toolbar-config"]=encodeURIComponent(JSON.stringify(y))}catch(m){}if(null==document.documentMode||10<=document.documentMode)Editor.prototype.editButtonLink=this.graphConfig.edit,Editor.prototype.editButtonFunc=this.graphConfig.editFunc;EditorUi.prototype.updateActionStates=function(){};
EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=function(){};var q=new EditorUi(new Editor(!0),document.createElement("div"),!0);this.addListener("darkModeChanged",u);q.editor.editBlankUrl=this.editBlankUrl;q.refresh=function(){};var B=mxUtils.bind(this,function(m){27==m.keyCode&&q.destroy()}),H=this.initialOverflow,S=q.destroy;q.destroy=function(){null==b&&(mxEvent.removeListener(document.documentElement,"keydown",B),document.body.removeChild(f),
document.body.removeChild(l),document.body.style.overflow=H,GraphViewer.resizeSensorEnabled=!0,S.apply(this,arguments))};var E=q.editor.graph,Q=E.container;Q.style.overflow="hidden";Q.style.inset="0";this.lightboxChrome&&null==b?(Q.style.border="1px solid #c0c0c0",Q.style.margin="40px",mxEvent.addListener(document.documentElement,"keydown",B)):(f.style.display="none",l.style.display="none");var c=this;E.getImageFromBundles=function(m){return c.getImageUrl(m)};var g=q.createTemporaryGraph;q.createTemporaryGraph=
function(){var m=g.apply(this,arguments);m.getImageFromBundles=function(n){return c.getImageUrl(n)};return m};this.graphConfig.move&&(E.isMoveCellsEvent=function(m){return!0});mxUtils.setPrefixedStyle(Q.style,"border-radius","4px");Q.style.position="fixed";GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow="hidden";this.addClickHandler(E,q);window.setTimeout(mxUtils.bind(this,function(){try{mxEvent.addListener(f,"click",function(){q.destroy()}),Q.style.outline="none",Q.style.zIndex=this.lightboxZIndex,
l.style.zIndex=this.lightboxZIndex,null!=b?(b.innerHTML="",b.appendChild(Q)):(document.body.appendChild(Q),document.body.appendChild(l)),q.setFileData(this.xml),mxUtils.setPrefixedStyle(Q.style,"transform","rotateY(0deg)"),q.chromelessToolbar.style.bottom="60px",q.chromelessToolbar.style.zIndex=this.lightboxZIndex,(b||document.body).appendChild(q.chromelessToolbar),q.getEditBlankXml=mxUtils.bind(this,function(){return this.xml}),this.showLayers(E,this.graph),q.lightboxFit(),q.chromelessResize()}catch(m){q.handleError(m,
null,function(){q.destroy()})}}),0);return q};Dialog.prototype.getDocumentSize=function(){return new mxRectangle(0,0,Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0))};
GraphViewer.prototype.updateTitle=function(b,f){b=b||"";this.showTitleAsTooltip&&null!=this.graph&&null!=this.graph.container&&this.graph.container.setAttribute("title",f||b);null!=this.filename&&(this.filename.innerText="",mxUtils.write(this.filename,b),this.filename.setAttribute("title",f||b))};
GraphViewer.processElements=function(b){mxUtils.forEach(GraphViewer.getElementsByClassName(b||"mxgraph"),function(f){try{f.innerText="",GraphViewer.createViewerForElement(f)}catch(l){f.innerText=l.message,null!=window.console&&console.error(l)}})};
GraphViewer.getElementsByClassName=function(b){if(document.getElementsByClassName){var f=document.getElementsByClassName(b);b=[];for(var l=0;l<f.length;l++)b.push(f[l]);return b}var u=document.getElementsByTagName("*");f=[];for(l=0;l<u.length;l++){var y=u[l].className;null!=y&&0<y.length&&(y=y.split(" "),0<=mxUtils.indexOf(y,b)&&f.push(u[l]))}return f};
GraphViewer.createViewerForElement=function(b,f){var l=b.getAttribute("data-mxgraph");if(null!=l){var u=JSON.parse(l),y=function(q){q=mxUtils.parseXml(q);q=new GraphViewer(b,q.documentElement,u);null!=f&&f(q)};null!=u.url?GraphViewer.getUrl(u.url,function(q){y(q)}):y(u.xml)}};
GraphViewer.blockedAncestorFrames=function(){try{if(window.location.ancestorOrigins&&window.location.hostname&&window.location.ancestorOrigins.length&&0<window.location.ancestorOrigins.length){var b=window.location.hostname;b&&1<b.length&&"/"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1));for(var f="",l=0;l<window.location.ancestorOrigins.length;l++)if(f+=" -> "+window.location.ancestorOrigins[l],f.endsWith("dan6v7pm1f1a1.cloudfront.net")||f.endsWith("confluence-cloud-excalidraw-ll3likebca-uc.a.run.app"))return!0;
(b.endsWith("ac.draw.io")||b.endsWith("aj.draw.io"))&&1==window.location.ancestorOrigins.length&&window.location.ancestorOrigins[0]&&window.location.ancestorOrigins[0].endsWith(".atlassian.net")}}catch(u){}return!1};GraphViewer.darkBackgroundColor=Editor.darkColor;GraphViewer.cssFontFamily=Editor.defaultHtmlFont;GraphViewer.shapeBackgroundColor=null;GraphViewer.viewerInitialized=function(b){};
GraphViewer.initCss=function(){try{null==GraphViewer.styleElement&&(GraphViewer.styleElement=document.createElement("style"),GraphViewer.styleElement.setAttribute("type","text/css"),GraphViewer.styleElement.innerHTML=GraphViewer.getCss(),GraphViewer.blockedAncestorFrames()||document.getElementsByTagName("head")[0].appendChild(GraphViewer.styleElement))}catch(b){}};
GraphViewer.getCss=function(){return[".geDarkMode img {\n filter: invert(1);\n}\ndiv.mxTooltip {\n box-shadow: 3px 3px 12px light-dark(#c0c0c0, transparent);"," background: light-dark(#ffffcc, "+GraphViewer.darkBackgroundColor+");"," border-style: solid;\n border-width: 1px;\n border-color: black;"," font-family: "+GraphViewer.cssFontFamily+";"," font-size: 8pt;\n position: absolute;\n cursor: default;\n padding: 4px;\n color: black;\n}\ntd.mxPopupMenuIcon div {\n width: 16px;\n height: 16px;\n}\ndiv.mxPopupMenu {\n box-shadow: 2px 2px 3px light-dark(#d5d5d5, transparent);\n background: white;\n position: absolute;\n border: 3px solid #e7e7e7;\n padding: 3px;\n}\ntable.mxPopupMenu {\n border-collapse: collapse;\n margin: 0px;\n}\ntd.mxPopupMenuItem {\n padding: 7px 30px;",
" font-family: "+GraphViewer.cssFontFamily+";"," font-size: 10pt;\n}\ntd.mxPopupMenuIcon {"," background-color: light-dark(#ffffff, "+GraphViewer.darkBackgroundColor+");"," padding: 0px;\n}\ntr.mxPopupMenuItemHover {\n background-color: #eeeeee;\n color: black;\n}\ntable.mxPopupMenu hr {\n color: #cccccc;\n background-color: #cccccc;\n border: none;\n height: 1px;\n}\ntable.mxPopupMenu tr {\n font-size: 4pt;\n}\n.geDialog, .geDialog table {"," font-family: "+GraphViewer.cssFontFamily+
";"," font-size: 10pt;\n border: none;\n margin: 0px;\n}\n.geDialog {\n position: fixed;"," background: light-dark(#ffffff, "+GraphViewer.darkBackgroundColor+");","\t color: light-dark(#3f3f3f, #c0c0c0);\n box-shadow: 0px 0px 2px 2px light-dark(#d5d5d5, transparent);\n border: 1px solid light-dark(#dadada, #565656);\n overflow: hidden;\n padding: 30px;\n left: 50%;\n top: 50%;\n max-height: 100%;\n max-width: 100%;\n\t box-sizing: border-box;\n transform: translate(-50%, -50%);",
"\t z-index: "+(GraphViewer.prototype.lightboxZIndex+2)+";","}\n.geBackground {"," background-color: light-dark(#ffffff, "+GraphViewer.darkBackgroundColor+");","\t position: fixed;\n left: 0px;\n top: 0px;\n right: 0px;\n bottom: 0px;\n opacity: 0.9;","\t z-index: "+(GraphViewer.prototype.lightboxZIndex+1)+";","}\n.geDialogTitle {\n box-sizing: border-box;\n white-space: nowrap;"," background: light-dark(#f1f3f4, "+GraphViewer.darkBackgroundColor+");"," border-bottom: 1px solid rgb(192, 192, 192);\n font-size: 15px;\n font-weight: bold;\n text-align: center;\n color: rgb(35, 86, 149);\n}\n.geDialogFooter {",
" background: light-dark(#f1f3f4, "+GraphViewer.darkBackgroundColor+");"," white-space: nowrap;\n text-align: right;\n box-sizing: border-box;\n border-top: 1px solid #e5e5e5;\n color: darkGray;\n}\n.geHelpIcon {\n width: 16px;\n margin: 0 4px;\n vertical-align: text-bottom;\n}\n.geBtn, .mxWindow .geBtn {\n background-color: light-dark(#eeeeee, #1b1d1e);\n border: 1px solid light-dark(#d8d8d8, #333333);\n color: light-dark(#3f3f3f, #c0c0c0);\n font-size: 13px;\n font-weight: 500;\n border-radius: 4px;\n height: 30px;\n margin: 0 0 0 8px;\n min-width: 72px;\n outline: 0;\n padding: 0 8px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n.geBtn:hover:not(.gePrimaryBtn), .geBtn:focus {\n border: 1px solid light-dark(#c6c6c6, #333333);\n background: light-dark(#dadada, #333333);\n}\n.geBtn:disabled {\n opacity: .5;\n}\n.gePrimaryBtn {\n background: linear-gradient(light-dark(#4d90fe, #003555) 0px, light-dark(#4787ed, #003555) 100%);\n border: 1px solid light-dark(#3079ed, transparent);\n color: light-dark(#ffffff, #c0c0c0);\n}\n.gePrimaryBtn:hover:not([disabled]) {\n background: linear-gradient(light-dark(#4d90fe, #004a77) 0px, light-dark(#357ae8, #004a77) 100%);\n border: 1px solid light-dark(#2f5bb7, transparent);\n}\n.geBtn:disabled {\n opacity: .5;\n}"].join("\n")};
GraphViewer.cachedUrls={};GraphViewer.getUrl=function(b,f,l){if(null!=GraphViewer.cachedUrls[b])f(GraphViewer.cachedUrls[b]);else{var u=null!=navigator.userAgent&&0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;u.open("GET",b);u.onload=function(){f(null!=u.getText?u.getText():u.responseText)};u.onerror=l;u.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeObserver=!0;GraphViewer.useResizeSensor=!0;
(function(){var b=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(l){return window.setTimeout(l,20)},f=function(l,u){function y(){this.q=[];this.add=function(x){this.q.push(x)};var m,n;this.call=function(){m=0;for(n=this.q.length;m<n;m++)this.q[m].call()}}function q(m,n){return m.currentStyle?m.currentStyle[n]:window.getComputedStyle?window.getComputedStyle(m,null).getPropertyValue(n):m.style[n]}function B(m,n){if(!m.resizedAttached)m.resizedAttached=
new y,m.resizedAttached.add(n);else if(m.resizedAttached){m.resizedAttached.add(n);return}m.resizeSensor=document.createElement("div");m.resizeSensor.className="resize-sensor";m.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";m.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>';
m.appendChild(m.resizeSensor);"static"==q(m,"position")&&(m.style.position="relative");var x=m.resizeSensor.childNodes[0],F=x.childNodes[0],I=m.resizeSensor.childNodes[1],M=function(){F.style.width="100000px";F.style.height="100000px";x.scrollLeft=1E5;x.scrollTop=1E5;I.scrollLeft=1E5;I.scrollTop=1E5};M();var L=!1,K=function(){m.resizedAttached&&(L&&(m.resizedAttached.call(),L=!1),b(K))};b(K);var aa,ja,ca,ba;n=function(){if((ca=m.offsetWidth)!=aa||(ba=m.offsetHeight)!=ja)L=!0,aa=ca,ja=ba;M()};var oa=
function(Y,da,ha){Y.attachEvent?Y.attachEvent("on"+da,ha):Y.addEventListener(da,ha)};oa(x,"scroll",n);oa(I,"scroll",n)}var H=function(){GraphViewer.resizeSensorEnabled&&u()};if(GraphViewer.useResizeObserver&&"undefined"!==typeof ResizeObserver){var S=null,E=!1;(new ResizeObserver(function(){E||(null!=S&&window.clearTimeout(S),S=window.setTimeout(function(){E=!0;H();S=null;E=!1},200))})).observe(l)}else{var Q=Object.prototype.toString.call(l),c="[object Array]"===Q||"[object NodeList]"===Q||"[object HTMLCollection]"===
Q||"undefined"!==typeof jQuery&&l instanceof jQuery||"undefined"!==typeof Elements&&l instanceof Elements;if(c){Q=0;for(var g=l.length;Q<g;Q++)B(l[Q],H)}else B(l,H);this.detach=function(){if(c)for(var m=0,n=l.length;m<n;m++)f.detach(l[m]);else f.detach(l)}}};f.detach=function(l){l.resizeSensor&&(l.removeChild(l.resizeSensor),delete l.resizeSensor,delete l.resizedAttached)};window.ResizeSensor=f})();
(function(){Editor.initMath();if(null!=window.onDrawioViewerLoad)window.onDrawioViewerLoad();else GraphViewer.processElements()})();