diff --git a/layouts/shortcodes/html.html b/layouts/shortcodes/html.html index f309863..f02831b 100644 --- a/layouts/shortcodes/html.html +++ b/layouts/shortcodes/html.html @@ -1,13 +1,14 @@ {{ $source := index .Params 0 }} - -{{ with .Page.Resources.GetMatch $source | readFile }} -{{ .|safeHTML }} -{{ end }} +
+ {{ with .Page.Resources.GetMatch $source | readFile }} + {{ replace . "https://viewer.diagrams.net/js/viewer-static.min.js" "/js/viewer-static.min.js"|safeHTML }} + {{ end }} +
\ No newline at end of file diff --git a/static/js/viewer-static.min.js b/static/js/viewer-static.min.js new file mode 100644 index 0000000..908cf2c --- /dev/null +++ b/static/js/viewer-static.min.js @@ -0,0 +1,7625 @@ +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',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>1)+"px"})}for(var i,k=0,l=(f.lines-1)*(1-f.direction)/2;k2?n-2:0),r=2;r1?t-1:0),o=1;o1?n-1:0),r=1;r2&&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 D(e){for(let t=0;t/gm),W=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|matrix):|[^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:G,IS_ALLOWED_URI:X,IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:B,TMPLIT_EXPR:W});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.3.0",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:w,Element:D,NodeFilter:B,NamedNodeMap:G=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:W,DOMParser:Y,trustedTypes:j}=n,q=D.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:be}=Z;let{IS_ALLOWED_URI:Se}=Z,Ne=null;const we=R({},[...O,...x,...L,...I,...U]);let Re=null;const De=R({},[...z,...P,...F,...H]);let Ce=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,Oe=null;const xe=Object.seal(l(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Le=!0,ke=!0,Ie=!1,Me=!0,Ue=!1,ze=!0,Pe=!1,Fe=!1,He=!1,Be=!1,Ge=!1,We=!1,Ye=!0,je=!1,Xe=!0,qe=!1,$e={},Ke=null;const Ve=R({},["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 Ze=null;const Je=R({},["audio","video","img","source","image","track"]);let Qe=null;const et=R({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),tt="http://www.w3.org/1998/Math/MathML",nt="http://www.w3.org/2000/svg",ot="http://www.w3.org/1999/xhtml";let rt=ot,it=!1,at=null;const lt=R({},[tt,nt,ot],g);let ct=R({},["mi","mo","mn","ms","mtext"]),st=R({},["annotation-xml"]);const ut=R({},["title","style","font","a","script"]);let mt=null;const pt=["application/xhtml+xml","text/html"];let ft=null,dt=null;const ht=r.createElement("form"),gt=function(e){return e instanceof RegExp||e instanceof Function},Tt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!dt||dt!==e){if(e&&"object"==typeof e||(e={}),e=C(e),mt=-1===pt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,ft="application/xhtml+xml"===mt?g:h,Ne=_(e,"ALLOWED_TAGS")?R({},e.ALLOWED_TAGS,ft):we,Re=_(e,"ALLOWED_ATTR")?R({},e.ALLOWED_ATTR,ft):De,at=_(e,"ALLOWED_NAMESPACES")?R({},e.ALLOWED_NAMESPACES,g):lt,Qe=_(e,"ADD_URI_SAFE_ATTR")?R(C(et),e.ADD_URI_SAFE_ATTR,ft):et,Ze=_(e,"ADD_DATA_URI_TAGS")?R(C(Je),e.ADD_DATA_URI_TAGS,ft):Je,Ke=_(e,"FORBID_CONTENTS")?R({},e.FORBID_CONTENTS,ft):Ve,ve=_(e,"FORBID_TAGS")?R({},e.FORBID_TAGS,ft):C({}),Oe=_(e,"FORBID_ATTR")?R({},e.FORBID_ATTR,ft):C({}),$e=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,Le=!1!==e.ALLOW_ARIA_ATTR,ke=!1!==e.ALLOW_DATA_ATTR,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ue=e.SAFE_FOR_TEMPLATES||!1,ze=!1!==e.SAFE_FOR_XML,Pe=e.WHOLE_DOCUMENT||!1,Be=e.RETURN_DOM||!1,Ge=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ye=!1!==e.SANITIZE_DOM,je=e.SANITIZE_NAMED_PROPS||!1,Xe=!1!==e.KEEP_CONTENT,qe=e.IN_PLACE||!1,Se=e.ALLOWED_URI_REGEXP||X,rt=e.NAMESPACE||ot,ct=e.MATHML_TEXT_INTEGRATION_POINTS||ct,st=e.HTML_INTEGRATION_POINTS||st,Ce=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&>(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ce.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&>(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ce.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ce.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ue&&(ke=!1),Ge&&(Be=!0),$e&&(Ne=R({},U),Re=[],!0===$e.html&&(R(Ne,O),R(Re,z)),!0===$e.svg&&(R(Ne,x),R(Re,P),R(Re,H)),!0===$e.svgFilters&&(R(Ne,L),R(Re,P),R(Re,H)),!0===$e.mathMl&&(R(Ne,I),R(Re,F),R(Re,H))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?xe.tagCheck=e.ADD_TAGS:(Ne===we&&(Ne=C(Ne)),R(Ne,e.ADD_TAGS,ft))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?xe.attributeCheck=e.ADD_ATTR:(Re===De&&(Re=C(Re)),R(Re,e.ADD_ATTR,ft))),e.ADD_URI_SAFE_ATTR&&R(Qe,e.ADD_URI_SAFE_ATTR,ft),e.FORBID_CONTENTS&&(Ke===Ve&&(Ke=C(Ke)),R(Ke,e.FORBID_CONTENTS,ft)),Xe&&(Ne["#text"]=!0),Pe&&R(Ne,["html","head","body"]),Ne.table&&(R(Ne,["tbody"]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw S('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),dt=e}},yt=R({},[...x,...L,...k]),Et=R({},[...I,...M]),At=function(e){f(o.removed,{element:e});try{ae(e).removeChild(e)}catch(t){V(e)}},_t=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(Be||Ge)try{At(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},bt=function(e){let t=null,n=null;if(He)e=""+e;else{const t=T(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===mt&&rt===ot&&(e=''+e+"");const o=le?le.createHTML(e):e;if(rt===ot)try{t=(new Y).parseFromString(o,mt)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(rt,"template",null);try{t.documentElement.innerHTML=it?ce:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),rt===ot?pe.call(t,Pe?"html":"body")[0]:Pe?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)},Nt=function(e){return e instanceof W&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof G)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},wt=function(e){return"function"==typeof w&&e instanceof w};function Rt(e,t,n){u(e,(e=>{e.call(o,t,n,dt)}))}const Dt=function(e){let t=null;if(Rt(de.beforeSanitizeElements,e,null),Nt(e))return At(e),!0;const n=ft(e.nodeName);if(Rt(de.uponSanitizeElement,e,{tagName:n,allowedTags:Ne}),ze&&e.hasChildNodes()&&!wt(e.firstElementChild)&&b(/<[/\w!]/g,e.innerHTML)&&b(/<[/\w!]/g,e.textContent))return At(e),!0;if(e.nodeType===ee)return At(e),!0;if(ze&&e.nodeType===te&&b(/<[/\w]/g,e.data))return At(e),!0;if(!(xe.tagCheck instanceof Function&&xe.tagCheck(n))&&(!Ne[n]||ve[n])){if(!ve[n]&&vt(n)){if(Ce.tagNameCheck instanceof RegExp&&b(Ce.tagNameCheck,n))return!1;if(Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(n))return!1}if(Xe&&!Ke[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 At(e),!0}return e instanceof D&&!function(e){let t=ae(e);t&&t.tagName||(t={namespaceURI:rt,tagName:"template"});const n=h(e.tagName),o=h(t.tagName);return!!at[e.namespaceURI]&&(e.namespaceURI===nt?t.namespaceURI===ot?"svg"===n:t.namespaceURI===tt?"svg"===n&&("annotation-xml"===o||ct[o]):Boolean(yt[n]):e.namespaceURI===tt?t.namespaceURI===ot?"math"===n:t.namespaceURI===nt?"math"===n&&st[o]:Boolean(Et[n]):e.namespaceURI===ot?!(t.namespaceURI===nt&&!st[o])&&!(t.namespaceURI===tt&&!ct[o])&&!Et[n]&&(ut[n]||!yt[n]):!("application/xhtml+xml"!==mt||!at[e.namespaceURI]))}(e)?(At(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ue&&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):(At(e),!0)},Ct=function(e,t,n){if(Ye&&("id"===t||"name"===t)&&(n in r||n in ht))return!1;if(ke&&!Oe[t]&&b(ye,t));else if(Le&&b(Ee,t));else if(xe.attributeCheck instanceof Function&&xe.attributeCheck(t,e));else if(!Re[t]||Oe[t]){if(!(vt(e)&&(Ce.tagNameCheck instanceof RegExp&&b(Ce.tagNameCheck,e)||Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(e))&&(Ce.attributeNameCheck instanceof RegExp&&b(Ce.attributeNameCheck,t)||Ce.attributeNameCheck instanceof Function&&Ce.attributeNameCheck(t,e))||"is"===t&&Ce.allowCustomizedBuiltInElements&&(Ce.tagNameCheck instanceof RegExp&&b(Ce.tagNameCheck,n)||Ce.tagNameCheck instanceof Function&&Ce.tagNameCheck(n))))return!1}else if(Qe[t]);else if(b(Se,y(n,_e,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,"data:")||!Ze[e]){if(Ie&&!b(Ae,y(n,_e,"")));else if(n)return!1}else;return!0},vt=function(e){return"annotation-xml"!==e&&T(e,be)},Ot=function(e){Rt(de.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Nt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Re,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:l,value:c}=i,s=ft(a),m=c;let f="value"===a?m:A(m);if(n.attrName=s,n.attrValue=f,n.keepAttr=!0,n.forceKeepAttr=void 0,Rt(de.uponSanitizeAttribute,e,n),f=n.attrValue,!je||"id"!==s&&"name"!==s||(_t(a,e),f="user-content-"+f),ze&&b(/((--!?|])>)|<\/(style|title|textarea)/i,f)){_t(a,e);continue}if("attributename"===s&&T(f,"href")){_t(a,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){_t(a,e);continue}if(!Me&&b(/\/>/i,f)){_t(a,e);continue}Ue&&u([he,ge,Te],(e=>{f=y(f,e," ")}));const d=ft(e.nodeName);if(Ct(d,s,f)){if(le&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(d,s)){case"TrustedHTML":f=le.createHTML(f);break;case"TrustedScriptURL":f=le.createScriptURL(f)}if(f!==m)try{l?e.setAttributeNS(l,a,f):e.setAttribute(a,f),Nt(e)?At(e):p(o.removed)}catch(t){_t(a,e)}}else _t(a,e)}Rt(de.afterSanitizeAttributes,e,null)},xt=function e(t){let n=null;const o=St(t);for(Rt(de.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)Rt(de.uponSanitizeShadowNode,n,null),Dt(n),Ot(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(it=!e,it&&(e="\x3c!--\x3e"),"string"!=typeof e&&!wt(e)){if("function"!=typeof e.toString)throw S("toString is not a function");if("string"!=typeof(e=e.toString()))throw S("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Fe||Tt(t),o.removed=[],"string"==typeof e&&(qe=!1),qe){if(e.nodeName){const t=ft(e.nodeName);if(!Ne[t]||ve[t])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof w)n=bt("\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),r.nodeType===J&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!Be&&!Ue&&!Pe&&-1===e.indexOf("<"))return le&&We?le.createHTML(e):e;if(n=bt(e),!n)return Be?null:We?ce:""}n&&He&&At(n.firstChild);const c=St(qe?e:n);for(;i=c.nextNode();)Dt(i),Ot(i),i.content instanceof s&&xt(i.content);if(qe)return e;if(Be){if(Ge)for(l=me.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(Re.shadowroot||Re.shadowrootmode)&&(l=fe.call(a,l,!0)),l}let m=Pe?n.outerHTML:n.innerHTML;return Pe&&Ne["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&b(K,n.ownerDocument.doctype.name)&&(m="\n"+m),Ue&&u([he,ge,Te],(e=>{m=y(m,e," ")})),le&&We?le.createHTML(m):m},o.setConfig=function(){Tt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Fe=!0},o.clearConfig=function(){dt=null,Fe=!1},o.isValidAttribute=function(e,t,n){dt||Tt({});const o=ft(e),r=ft(t);return Ct(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})); +//# sourceMappingURL=purify.min.js.map +/*! 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<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<>>=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;e8?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]>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],++o0?(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=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>=7;h>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>>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.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]&&rs){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.lookaheadt.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(n=t.strstart-t.block_start)+t.strm.avail_in&&(a=n+t.strm.avail_in),a>i&&(a=i),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_wateri&&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>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=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=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_length4096)&&(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<$||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.gzindexd&&(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.gzindexf&&(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]&&it.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=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>>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;a4)r[n++]=65533,a+=o-1;else{for(s&=2===o?31:3===o?15:7;o>1&&a1?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;nt.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<>>=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,u-=p),u<15&&(f+=z[a++]<>>=p=g>>>24,u-=p,!(16&(p=g>>>16&255))){if(0==(64&p)){g=w[(65535&g)+(f&(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,p2;)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>3,f&=(1<<(u-=v<<3))-1,t.next_in=a,t.next_out=i,t.avail_in=a=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;v0&&(0===t||1!==k))return-1;for(U[1]=0,g=1;g852||2===t&&E>592)return 1;for(;;){c=g-z,s[p]+1=u?(w=D[s[p]-u],m=Z[s[p]-u]):(w=96,m=0),l=1<>z)+(h-=l)]=c<<24|w<<16|m|0}while(0!==h);for(l=1<>=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+z852||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.mode16211?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.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>>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<>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++]<>>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++]<>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++]<>>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>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++]<>>=7&d,d-=7&d,a.mode=Ne;break}for(;d<3;){if(0===o)break t;o--,h+=n[r++]<>>=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++]<>>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++]<>>=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>>=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>>16&255,g=65535&E,!((m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<>>=m,d-=m,a.lens[a.have++]=g;else{if(16===g){for(A=m+2;d>>=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>>=m)),h>>>=3,d-=3}else{for(A=m+7;d>>=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<>>16&255,g=65535&E,!((m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<>p)])>>>16&255,g=65535&E,!(p+(m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<>>=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.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=16202;case 16202:for(;b=(E=a.distcode[h&(1<>>16&255,g=65535&E,!((m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<>p)])>>>16&255,g=65535&E,!(p+(m=E>>>24)<=d);){if(0===o)break t;o--,h+=n[r++]<>>=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.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++]<=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;et.ymine.ymin?1:t.xe.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;ei);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)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{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{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;tn%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))),td&&(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;e2){const o=[];for(let e=0;e2*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;a500?.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;o3){const a=[],h=1-s.curveTightness;o.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+21&&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;ni&&(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;s0?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>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>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;cd?b+=String.fromCharCode(d): +(127d?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;cd?(b+=String.fromCharCode(d),c++):191d?(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||(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)?window.DRAWIO_SERVER_URL+"notifications":null);window.RT_WEBSOCKET_URL=window.RT_WEBSOCKET_URL||"wss://"+("test.draw.io"==window.location.hostname?"app.diagrams.net":window.location.hostname)+"/rt";window.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=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.2.9",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&&2navigator.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:0document.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\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=this.x&&a<=this.x+this.width&&b>=this.y&&b<=this.y+this.height};mxRectangle.prototype.grow=function(a){this.x-=a;this.y-=a;this.width+=2*a;this.height+=2*a;return this};mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)};mxRectangle.prototype.rotate90=function(){var a=(this.width-this.height)/2;this.x+=a;this.y-=a;a=this.width;this.width=this.height;this.height=a}; +mxRectangle.prototype.equals=function(a){return null!=a&&a.x==this.x&&a.y==this.y&&a.width==this.width&&a.height==this.height};mxRectangle.fromPoint=function(a){return new mxRectangle(a.x,a.y,0,0)};mxRectangle.fromRectangle=function(a){return new mxRectangle(a.x,a.y,a.width,a.height)}; +var mxEffects={animateChanges:function(a,b,c){var d=0,e=function(){for(var g=!1,k=0;kd&&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;edocument.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;bdocument.documentMode&&(a="ms");return function(b,c,d){b[c]=d;null!=a&&0mxUtils.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/g,">");if(null==c||c)a=a.replace(/"/g,"""),a=a.replace(/'/g,"'");if(null==b||b)a=a.replace(/\n/g," ");if(null==d||d)a=a.replace(/\t/g," ");return a},decodeHtml:function(a){var b= +document.createElement("textarea");b.innerHTML=a;return b.value},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||" ")},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"+d);null!=g;)f.push(mxUtils.getPrettyXml(g,b,c+b,d,e)),g=g.nextSibling;f.push(c+""+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"==g.innerHTML.toLowerCase()?d.push("\n"):(3===g.nodeType||4===g.nodeType?0"):(b.push(">"),b.push(a.innerHTML),b.push(""));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;dk&&(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;kp||299.213*a.r+.715*a.g+.072*a.b:!1},parseLightDarkColor:function(a,b,c){var d=a,e=null;null!=a&&(a=a.match(mxUtils.lightDarkColorRegex))&&3===a.length&&(d=mxUtils.trim(a[1]),e=mxUtils.trim(a[2]));null==e&& +(c||mxUtils.isVarColor(d))&&(e=d);e=null!=e?e:null!=b?b:mxUtils.getInverseColor(d);return{light:d,dark:e}},getInverseColor:function(a,b,c){function d(n){return Math.round(b/100*(255-n)+n*(1-b/100))}function e(n){return Math.round(Math.max(0,Math.min(255,n)))}c=null!=c?c:180;b=null!=b?b:93;var f=0,g=0,k=0,l=1;if("transparent"==a.toLowerCase())return a;l=mxUtils.parseColor(a);if(null==l)return a;f=l.r;g=l.g;k=l.b;l=l.a;f=d(f);g=d(g);k=d(k);a=[1,0,0,0,1,0,0,0,1];var m=Math.cos(c*Math.PI/180);c=Math.sin(c* +Math.PI/180);a[0]=.2126+.7874*m-.2126*c;a[1]=.7152-.7152*m-.7152*c;a[2]=.0722-.0722*m+.9278*c;a[3]=.2126-.2126*m+.143*c;a[4]=.7152+(1-.7152)*m+.14*c;a[5]=.0722-.0722*m-.283*c;a[6]=.2126-.2126*m-.7874*c;a[7]=.7152-.7152*m+.7152*c;a[8]=.0722+.9278*m+.0722*c;c=e(a[0]*f+a[1]*g+a[2]*k);m=e(a[3]*f+a[4]*g+a[5]*k);f=e(a[6]*f+a[7]*g+a[8]*k);return"#"+(16777216|c<<16|m<<8|f).toString(16).slice(1)+(1>l?("0"+Math.round(255*l).toString(16)).slice(-2):"")},addAlphaToColor:function(a,b,c){null!=b&&null!=a&&"transparent"!= +a&&(a=mxUtils.parseColor(a),a.a=c?b:a.a*b,a="rgba("+a.r+","+a.g+","+a.b+","+a.a+")");return a},getLightDarkColor:function(a,b,c,d){var e={light:"transparent",dark:"transparent",cssText:"transparent"};null!=a&&a!=mxConstants.NONE&&("string"===typeof a?(a=mxUtils.parseLightDarkColor(a,c,d),e.light=mxUtils.addAlphaToColor(a.light,b),e.dark=mxUtils.addAlphaToColor(a.dark,b),e.cssText=mxUtils.lightDarkColorSupported?e.light==e.dark?e.light:"light-dark("+e.light+", "+e.dark+")":mxUtils.preferDarkColor? +e.dark:e.light):(e.light=a,e.dark=a,e.cssText=a));return e},invertLightDarkColor:function(a){var b={};b.light=a.dark;b.dark=a.light;b.cssText=b.light==b.dark?b.light:"light-dark("+b.light+", "+b.dark+")";return b},getColor:function(a,b,c){a=null!=a?a[b]:null;null==a?a=c:a==mxConstants.NONE&&(a=null);return a},isEmptyObject:function(a){for(var b in a)return!1;return!0},clone:function(a,b,c){c=null!=c?c:!1;var d=null;if(null!=a&&"function"==typeof a.constructor)if(a.constructor===Element)d=a.cloneNode(null!= +c?!c:!1);else{d=new a.constructor;for(var e in a)e!=mxObjectIdentity.FIELD_NAME&&(null==b||0>mxUtils.indexOf(b,e))&&(d[e]=c||"object"!=typeof a[e]?a[e]:mxUtils.clone(a[e]))}return d},equalPoints:function(a,b){if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b)for(var c=0;c [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;1e&&(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;zc&&(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(0f.distSq)&&(d=f)}}return null!=d?d.p:null},intersectsPoints:function(a,b){for(var c=0;cc.x&&(a=c.x,k=b.x);k>g&&(k=g);ak)return!1;e=b.y;g=c.y;var l=c.x-b.x;1E-7g&&(b=g,g=e,e=b);g>f&&(g=f);eg?!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(fc)&&(ga)&&(dk)&&(eb)},intersectsHotspot:function(a,b,c,d,e,f){d=null!=d?d:1;e=null!=e?e:0;f=null!=f?f:0;if(0a.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,0a&&(a=0)));return 0>a?-1:0document.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:0a.indexOf("="))?a:""},getStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;ca[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;dmxUtils.indexOfStylename(a,b)&&(null==a?a="":0b.a?("0"+Math.round(255*b.a).toString(16)).slice(-2):""):a},color2hex:function(a,b){b=null!=b?b:"#000000";try{null!=a&&(a=String(a).replace(/\s/g,""),a.toLowerCase()==mxUtils.normalizedValidInvalidColor?b="#000000":(mxUtils.canvasContext.fillStyle=mxUtils.validInvalidColor,mxUtils.canvasContext.fillStyle=a,mxUtils.canvasContext.fillStyle!=mxUtils.validInvalidColor?(b=mxUtils.canvasContext.fillStyle,mxUtils.isRgbColor(b)&&(b=mxUtils.rgba2hex(b))): +1e?";":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&&0f?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"),0a)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";g=document.getElementsByTagName("base");for(c=0;c
')+a.container.innerHTML;b.writeln(d+"
");b.close()}else{b.writeln("");g=document.getElementsByTagName("base");for(c=0;c');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,"
").replace(/ /g," ");c.appendChild(b);c=new mxWindow("Popup Window",c,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight)/2-240,640,480,!1,!0);c.setClosable(!0);c.setVisible(!0)}else mxClient.IS_NS?(c=window.open(), +c.document.writeln("
"+mxUtils.htmlEntities(a)+"").replace(/ /g," "),c.document.body.appendChild(b))},alert:function(a){alert(a)},prompt:function(a,b){return prompt(a,null!=b?b:"")},confirm:function(a){return confirm(a)},error:function(a,b,c,d){var e=document.createElement("div");e.style.padding="20px";var f=document.createElement("img");f.setAttribute("src",
+d||mxUtils.errorImage);f.setAttribute("valign","bottom");f.style.verticalAlign="middle";e.appendChild(f);e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));mxUtils.write(e,a);a=document.body.clientWidth;d=document.body.clientHeight||document.documentElement.clientHeight;var g=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,e,(a-b)/2,d/4,b,null,!1,!0);c&&(mxUtils.br(e),b=document.createElement("p"),
+c=document.createElement("button"),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;bk,!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;kmxEvent.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();(.5navigator.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=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;bthis.indexOfNextAdd)for(var a=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),b=0;bthis.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=0this.dy&&Math.abs(this.dy)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);0this.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.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;ea.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(0m.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",5)+1)),""==a.substring(a.length-7,a.length)&&(a=a.substring(0,a.length-7)))}else{if(null!=document.implementation&&null!=document.implementation.createDocument){b=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null);var c=b.createElement("body");
+b.documentElement.appendChild(c);var d=document.createElement("div");d.innerHTML=a;for(a=d.firstChild;null!=a;)d=a.nextSibling,c.appendChild(b.adoptNode(a)),a=d;return c.innerHTML}b=document.createElement("textarea");b.innerHTML=a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(//g,">");a=b.value.replace(/&/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,
+"&").replace(/
/g,"
").replace(/
/g,"
").replace(/(]+)>/gm,"$1 />")}return a}; +mxSvgCanvas2D.prototype.createDiv=function(a){mxUtils.isNode(a)||(a="
"+this.convertHtml(a)+"
");if(mxClient.IS_IE||mxClient.IS_IE11||!document.createElementNS)return mxUtils.isNode(a)&&(a="
"+mxUtils.getXml(a)+"
"),mxUtils.parseXml('
'+a+"
").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,x,B){a+=this.state.dx;b+=this.state.dy;var C=p.firstChild;"title"==C.nodeName&&(C=C.nextSibling);x+="color: "+this.getLightDarkColor(this.state.fontColor).light+"; ";x+=null!=u?"background-color: "+u.light+"; ":"";x+=null!=v?"border-color: "+v.light+"; ":"";var E=C.firstChild,D=E.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(D.firstChild,B);this.setCssText(D,x);C.setAttribute("width",Math.ceil(1/Math.min(1,q)*100)+"%");C.setAttribute("height",Math.ceil(1/Math.min(1,q)*100)+"%");A=Math.round(b+A);0>A?(C.setAttribute("y",A),z+="padding-top: 0; "):(C.removeAttribute("y"),z+="padding-top: "+A+"px; ");this.setCssText(E,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,0u.y&&g==mxConstants.ALIGN_TOP?t.style.transform="translateY("+-u.y+"em)":0m)d=m;if(null==f||fm)e=m;if(null==g||gk.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"),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,C,E){var D=!1;E&&Math.abs(B-x)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=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&&0mxUtils.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)];lb.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
"));l=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==k?l.replace(/\n/g,"
"):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
");return this.replaceLinefeeds?a.replace(/\n/g,"
"):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=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="
"+k+"
",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;cthis.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,"
 
");b=this.replaceLinefeeds?b.replace(/\n/g,"
"):b;a.innerHTML='
'+b+"
"}}; +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&&0m&&(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=this.replaceLinefeeds?a.replace(/\n/g,"
"):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='
'+a+"
"}this.node.innerHTML= +a;a=this.node.getElementsByTagName("div");0this.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(),fa.weightedValue?-1:b.weightedValuec)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;ek.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&&0this.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;qthis.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;eb)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;gg.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&&(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=a+c)return 0;a=0a?a*d/c-b:0a+c?(c+a)*f/e-(b+d):f-(b+d);return 0g+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;kd/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 +d.theta&&ethis.forceConstant&&(this.forceConstant= +.001);this.forceConstantSquared=this.forceConstant*this.forceConstant;for(d=0;db&&(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;athis.maxDistanceLimit||(gb?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;gmxUtils.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=l.length){k= +new mxGraphHierarchyEdge(l);for(var m=0;mmxUtils.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;bg.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&&1mxUtils.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=m.length){l=new mxGraphHierarchyEdge(m);for(var n=0;nmxUtils.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;cb[d.swimlaneIndex]&&(k=b[d.swimlaneIndex]);d.temp[0]=k;if(null!=f)for(c=0;cg.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>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;fn&&(n=l);k[n]=m}var p=null,q=null,r=null,t=null,u=null;for(l=0;lr[C]&&x++,y[z]t[C]&&x++,A[z]a.medianValue?-1:b.medianValuev+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&&l<=q?g.setGeneralPurposeVariable(a,l):lq&&(g.setGeneralPurposeVariable(a,q),this.currentXDelta+=l-q);d[f].visited=!0}};mxCoordinateAssignment.prototype.calculatedWeightedValue=function(a,b){for(var c=0,d=0;dthis.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;ld.maxRank-d.minRank-1)){for(var e=d.getGeneralPurposeVariable(d.minRank+1),f=!0,g=0,k=d.minRank+2;kd.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;ke)return!1;f=b.getGeneralPurposeVariable(c);if(df){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;ak;k++){if(-1(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;mf/2&&(p-=this.prefVertEdgeOff),t=0;te&&(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;fb.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;ff&&(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=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;cmxUtils.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;eb[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=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.xa.x+a.width&&(g.x=a.x+a.width),c.ya.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))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-t&&rMath.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(mf+k||m>e+g&&ne+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(me+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(na)return new mxPoint(e,f+3*k/4)}else if(m==e+g){if(na)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);mf+k/4&&nf+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&&nf+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(ml)return new mxPoint(e+3*g/4,f)}else if(n==f+k){if(ma)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);ne+g/4&&me+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&&me+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=f&&n<=f+k&&(p=n,d=m-m?(b=new mxPoint(e+g,f),u=new mxPoint(e+g,f+ +k)):p>m&&pr&&pq-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);0m&&pq-m&& +pp&&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='':8 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");p.writeln("");p.writeln("");this.writeHead(p,a);p.writeln("");p.writeln("")}var r=mxRectangle.fromRectangle(null!=g?this.graph.getBoundingBox(g):this.graph.getGraphBounds()),t=this.graph.getView().getScale(),u=t/this.scale,v=this.graph.getView().getTranslate();this.autoOrigin||(this.x0-=v.x*this.scale, +this.y0-=v.y*this.scale,r.width+=r.x,r.height+=r.y,r.x=0,this.border=r.y=0);var y=m-2*this.border,A=n-2*this.border;n+=this.marginTop+this.marginBottom;r.width/=u;r.height/=u;var z=Math.max(1,Math.ceil((r.width+this.x0)/y)),x=Math.max(1,Math.ceil((r.height+this.y0)/A));this.pageCount=z*x;var 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 C=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)}),E=this.getCoverPages(m,n);if(null!=E)for(var D=0;D");a.writeln("");a.close();this.addPendingCss(a);mxEvent.release(a.body)}}catch(b){}}; +mxPrintPreview.prototype.writeHead=function(a,b){null!=this.title&&a.writeln(""+mxUtils.htmlEntities(this.title)+"");mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",a);a.writeln('")};mxPrintPreview.prototype.writePostfix=function(a){};mxPrintPreview.prototype.getRoot=function(){var a=this.graph.view.currentRoot;null==a&&(a=this.graph.getModel().getRoot());return a};mxPrintPreview.prototype.useCssTransforms=function(){return!mxClient.NO_FO&&!mxClient.IS_SF};mxPrintPreview.prototype.isCellVisible=function(a){return!0}; +mxPrintPreview.prototype.drawBackgroundImage=function(a){a.redraw()}; +mxPrintPreview.prototype.addGraphFragment=function(a,b,c,d,e,f){var g=this.graph.getView();d=this.graph.container;this.graph.container=e;var k=g.getCanvas(),l=g.getBackgroundPane(),m=g.getDrawPane(),n=g.getOverlayPane(),p=c;if(this.graph.dialect==mxConstants.DIALECT_SVG){if(g.createSvg(),this.useCssTransforms()){var q=g.getDrawPane().parentNode;q.setAttribute("transformOrigin","0 0");q.setAttribute("transform","scale("+c+","+c+")translate("+a+","+b+")");c=1;b=a=0}}else g.createHtml();q=g.isEventsEnabled(); +g.setEventsEnabled(!1);var r=this.graph.isEnabled();this.graph.setEnabled(!1);var t=g.getTranslate();g.translate=new mxPoint(a,b);var u=this.graph.selectionCellsHandler.updateHandler;this.graph.selectionCellsHandler.updateHandler=function(){};var v=this.graph.cellRenderer.redraw,y=g.states,A=g.scale,z=null;if(this.printBackgroundImage){var x=this.getBackgroundImage();null!=x&&(z=new mxRectangle(Math.round(a*A+x.x),Math.round(b*A+x.y),x.width-1,x.height-1),z=new mxImageShape(z,x.src),z.dialect=this.graph.dialect)}if(this.clipping){var 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),C=this;this.graph.cellRenderer.redraw=function(D,I,F){if(null!=D){var H=y.get(D.cell);if(null!=H&&(H=g.getBoundingBox(H,!1),null!=H&&0f.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":"";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,"

");return a.replace(/\n/g,"
")};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&&"
"!=this.textarea.innerHTML||this.textarea.innerHTML==this.getEmptyLabelText()?this.clearOnChange=!1:(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0"==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=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.xb.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&&0n;k=f.xm}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=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=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=0Math.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,x= +null!=t&&v.x>=t.x&&v.x<=t.x+t.width;t=A||null==u&&z;v=y||null==u&&x;if(0!=q||!(t&&v||y&&A)){if(null!=u&&!A&&!y&&(z||x)){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.yb.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.xb.x+b.width))&&c.push(new mxPoint(d.x,m.y));l?m.y=d.y:m.x=d.x;for(q=0;qg.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.xg.x+g.width))&&c.push(new mxPoint(d.x,m.y)));if(null==f[0]&&null!=b)for(;0=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;dx;x++)mxEdgeStyle.limits[x][1]=f[x][0]-A[x],mxEdgeStyle.limits[x][2]=f[x][1]-A[x],mxEdgeStyle.limits[x][4]=f[x][0]+f[x][2]+A[x],mxEdgeStyle.limits[x][8]=f[x][1]+f[x][3]+A[x];A=f[0][1]+ +f[0][3]/2;n=f[1][1]+f[1][3]/2;x=f[0][0]+f[0][2]/2-(f[1][0]+f[1][2]/2);B=A-n;A=0;0>x?A=0>B?2:1:0>=B&&(A=3,0==x&&(A=2));n=null;null!=g&&(n=l);l=[[.5,.5],[.5,.5]];g||(l[0]=[0,0]);k||(l[1]=[0,0]);for(x=0;2>x;x++)null!=n&&(l[x][0]=(n.x-f[x][0])/f[x][2],1>=Math.abs(n.x-f[x][0])?b[x]=mxConstants.DIRECTION_MASK_WEST:1>=Math.abs(n.x-f[x][0]-f[x][2])&&(b[x]=mxConstants.DIRECTION_MASK_EAST),l[x][1]=(n.y-f[x][1])/f[x][3],1>=Math.abs(n.y-f[x][1])?b[x]=mxConstants.DIRECTION_MASK_NORTH:1>=Math.abs(n.y-f[x][1]-f[x][3])&& +(b[x]=mxConstants.DIRECTION_MASK_SOUTH)),n=null,null!=k&&(n=m);x=f[0][1]-(f[1][1]+f[1][3]);m=f[0][0]-(f[1][0]+f[1][2]);n=f[1][1]-(f[0][1]+f[0][3]);p=f[1][0]-(f[0][0]+f[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(m-z,0);mxEdgeStyle.vertexSeperations[2]=Math.max(x-z,0);mxEdgeStyle.vertexSeperations[4]=Math.max(n-z,0);mxEdgeStyle.vertexSeperations[3]=Math.max(p-z,0);z=[];g=[];k=[];g[0]=m>=p?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST;k[0]=x>=n?mxConstants.DIRECTION_MASK_NORTH: +mxConstants.DIRECTION_MASK_SOUTH;g[1]=mxUtils.reversePortConstraints(g[0]);k[1]=mxUtils.reversePortConstraints(k[0]);m=m>=p?m:p;n=x>=n?x:n;p=[[0,0],[0,0]];q=!1;for(x=0;2>x;x++)0==b[x]&&(0==(g[x]&c[x])&&(g[x]=mxUtils.reversePortConstraints(g[x])),0==(k[x]&c[x])&&(k[x]=mxUtils.reversePortConstraints(k[x])),p[x][0]=k[x],p[x][1]=g[x]);0x;x++)0==b[x]&&(0==(p[x][0]&c[x])&&(p[x][0]=p[x][1]),z[x]=p[x][0]&c[x],z[x]|=(p[x][1]&c[x])<<8,z[x]|=(p[1-x][x]&c[x])<<16,z[x]|=(p[1-x][1-x]&c[x])<<24,0==(z[x]&15)&&(z[x]<<=8),0==(z[x]&3840)&&(z[x]=z[x]&15|z[x]>>8),0==(z[x]&983040)&&(z[x]=z[x]&65535|(z[x]&251658240)>>8),b[x]=z[x]&15,c[x]==mxConstants.DIRECTION_MASK_WEST||c[x]==mxConstants.DIRECTION_MASK_NORTH|| +c[x]==mxConstants.DIRECTION_MASK_EAST||c[x]==mxConstants.DIRECTION_MASK_SOUTH)&&(b[x]=c[x]);c=b[0]==mxConstants.DIRECTION_MASK_EAST?3:b[0];z=b[1]==mxConstants.DIRECTION_MASK_EAST?3:b[1];c-=A;z-=A;1>c&&(c+=4);1>z&&(z+=4);c=mxEdgeStyle.routePatterns[c-1][z-1];mxEdgeStyle.wayPoints1[0][0]=f[0][0];mxEdgeStyle.wayPoints1[0][1]=f[0][1];switch(b[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=y;mxEdgeStyle.wayPoints1[0][1]+=l[0][1]*f[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+= +l[0][0]*f[0][2];mxEdgeStyle.wayPoints1[0][1]+=f[0][3]+y;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=f[0][2]+y;mxEdgeStyle.wayPoints1[0][1]+=l[0][1]*f[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=l[0][0]*f[0][2],mxEdgeStyle.wayPoints1[0][1]-=y}y=0;g=z=0<(b[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1;for(x=0;x>5,n<<=A,15>=4),p=0<(c[x]&mxEdgeStyle.CENTER_MASK),(t||r)&&9>n?(q=t?0:1,n=p&&0==k?f[q][0]+l[q][0]*f[q][2]:p?f[q][1]+l[q][1]*f[q][3]:mxEdgeStyle.limits[q][n],0==k?(n=(n-mxEdgeStyle.wayPoints1[y][0])*m[0],0e&&(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 +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&&0b.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=Math.round(k+g)&&l=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&&0c&&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"+b+""),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=e.scrollLeft&&b>=e.scrollTop&&a<=e.scrollLeft+e.clientWidth&&b<=e.scrollTop+e.clientHeight){var f=e.scrollLeft+e.clientWidth- +a;if(fthis.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&&0this.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"),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;ed.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.xg&&(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; +1b?(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);0g+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")):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 0f.max||bf.max||c")),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,"
"))}),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 0mxUtils.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;ea.width*e||0a.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&&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=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;lk&&(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),0b?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;bthis.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.max)||!this.source&&(0==this.max||f>=this.max))&&(g+=this.countError+"\n"),null!=this.validNeighbors&&null!=this.typeError&&0this.graph.model.getChildCount(g),l=new mxDictionary;a=this.graph.getOpposites(this.graph.getEdges(this.cell),this.cell);for(b=0;b=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;ethis.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&&0this.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)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;dthis.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&&0f||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(0this.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 0d?180:0;0a-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),0k.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;ed&&(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&&0this.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 +mxEvent.VIRTUAL_HANDLE&&null!=this.customHandles)for(c=0;cmxEvent.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)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)0mxEvent.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=mxGraphHandler.prototype.maxCells||this.graph.getSelectionCount()<=mxGraphHandler.prototype.maxCells)}; +mxEdgeHandler.prototype.refresh=function(){if(null!=this.state){var a=this.state.getVisibleTerminalState(!0),b=this.state.getVisibleTerminalState(!1),c=this.graph.getCellGeometry(this.state.cell);this.edgeStyle=null!=c?this.graph.view.getEdgeStyle(this.state,c.points,a,b):null;this.abspoints=this.getSelectionPoints(this.state);this.points=[];null!=this.shape&&(this.shape.isDashed=this.isSelectionDashed(),this.shape.stroke=this.getSelectionColor(),this.shape.isShadow=!1,this.shape.redraw());null!= +this.bends&&(this.destroyBends(this.bends),this.bends=null);this.isHandlesVisible()&&(this.bends=this.createBends());null!=this.virtualBends&&(this.destroyBends(this.virtualBends),this.virtualBends=null);this.isHandlesVisible()&&this.edgeStyle!=mxEdgeStyle.EntityRelation&&(this.virtualBends=this.createVirtualBends());null!=this.customHandles&&(this.destroyBends(this.customHandles),this.customHandles=null);this.isHandlesVisible()&&(this.customHandles=this.createCustomHandles());null!=this.labelShape&& +(this.labelShape.destroy(),this.labelShape=null);this.isHandlesVisible()&&(this.labelShape=this.createLabelShape(),null!=this.labelShape&&null!=this.labelShape.node&&null!=this.labelShape.node.parentNode&&this.labelShape.node.parentNode.appendChild(this.labelShape.node))}};mxEdgeHandler.prototype.isDestroyed=function(){return null==this.shape};mxEdgeHandler.prototype.destroyBends=function(a){if(null!=a)for(var b=0;b=q&&"0"!="01230120022455012603010202"[q]&&("01230120022455012603010202"[q]!=f[l-1]&&(f[l]="01230120022455012603010202"[q],l++),3=l)for(;3>=l;)f[l]="0",l++;return f.join("")}; +Editor.selectFilename=function(b){var f=b.value.lastIndexOf(".");if(0"));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!=D&&(D=mxUtils.button(D,function(){null!=P&&P()}),D.className="geBtn",l.appendChild(D)); +var m=mxUtils.button(u,function(){S&&b.hideDialog();null!=y&&y()});m.className="geBtn";l.appendChild(m);null!=C&&(u=mxUtils.button(C,function(){S&&b.hideDialog();null!=J&&J()}),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=C.checked||D.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,H=1/l.pageScale;if(n){var M=C.checked?1:parseInt(P.value);isNaN(M)||(H=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);H*=x;!n&&l.pageVisible?(x=l.getPageLayout(),M-=x.x*F.width,L-=x.y*F.height): +n=!0;n=PrintDialog.createPrintPreview(l,H,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 C=document.createElement("input");C.setAttribute("type","checkbox");var J=document.createElement("td");J.setAttribute("colspan","2");J.style.fontSize="10pt";J.appendChild(C);var S=document.createElement("span");mxUtils.write(S," "+mxResources.get("fitPage")); +J.appendChild(S);mxEvent.addListener(S,"click",function(m){C.checked=!C.checked;D.checked=!C.checked;mxEvent.consume(m)});mxEvent.addListener(C,"change",function(){D.checked=!C.checked});q.appendChild(J);y.appendChild(q);q=q.cloneNode(!1);var D=document.createElement("input");D.setAttribute("type","checkbox");J=document.createElement("td");J.style.fontSize="10pt";J.appendChild(D);S=document.createElement("span");mxUtils.write(S," "+mxResources.get("posterPrint")+":");J.appendChild(S);mxEvent.addListener(S, +"click",function(m){D.checked=!D.checked;C.checked=!D.checked;mxEvent.consume(m)});q.appendChild(J);var P=document.createElement("input");P.setAttribute("value","1");P.setAttribute("type","number");P.setAttribute("min","1");P.setAttribute("size","4");P.setAttribute("disabled","disabled");P.style.width="50px";J=document.createElement("td");J.style.fontSize="10pt";J.appendChild(P);mxUtils.write(J," "+mxResources.get("pages")+" (max)");q.appendChild(J);y.appendChild(q);mxEvent.addListener(D,"change", +function(){D.checked?P.removeAttribute("disabled"):P.setAttribute("disabled","disabled");C.checked=!D.checked});q=q.cloneNode(!1);J=document.createElement("td");mxUtils.write(J,mxResources.get("pageScale")+":");q.appendChild(J);J=document.createElement("td");var c=document.createElement("input");c.setAttribute("value","100 %");c.setAttribute("size","5");c.style.width="50px";J.appendChild(c);q.appendChild(J);y.appendChild(q);q=document.createElement("tr");J=document.createElement("td");J.colSpan=2; +J.style.paddingTop="20px";J.setAttribute("align","right");S=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});S.className="geBtn";b.editor.cancelFirst&&J.appendChild(S);if(PrintDialog.previewEnabled){var g=mxUtils.button(mxResources.get("preview"),function(){b.hideDialog();f(!1)});g.className="geBtn";J.appendChild(g)}g=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){b.hideDialog();f(!0)});g.className="geBtn gePrimaryBtn";J.appendChild(g);b.editor.cancelFirst|| +J.appendChild(S);q.appendChild(J);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,C){f=new mxPrintPreview(b,f,l,u,y,q);f.title=mxResources.get("preview");f.addPageCss=!mxClient.IS_SF;f.printBackgroundImage=!0;f.autoOrigin=C;C=b.background;if(null==C||""==C||C==mxConstants.NONE)C="#ffffff";f.backgroundColor=C;var J=f.isTextLabel;f.isTextLabel=function(D){return"geHint"==!D.className&&J.apply(this,arguments)};var S=f.getLinkForCellState;f.getLinkForCellState=function(D){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?(P.style.backgroundImage="url("+x.src+")",P.style.display="inline-block"):(P.style.backgroundImage="",P.style.display="none");P.style.backgroundColor="";null!=g&&g!=mxConstants.NONE&&(P.style.backgroundColor=g,P.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 C=document.createElement("td");C.style.verticalAlign="top";C.style.fontSize="10pt";mxUtils.write(C,mxResources.get("paperSize")+":");q.appendChild(C);C=document.createElement("td");C.style.verticalAlign="top";C.style.fontSize="10pt";var J=PageSetupDialog.addPageFormatPanel(C,"pagesetupdialog",l.pageFormat);q.appendChild(C);y.appendChild(q);q=document.createElement("tr");C=document.createElement("td");mxUtils.write(C,mxResources.get("gridSize")+":");q.appendChild(C); +C=document.createElement("td");C.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();C.appendChild(S);mxEvent.addListener(S,"change",function(){var x=parseInt(S.value);S.value=Math.max(1,isNaN(x)?l.getGridSize():x)});q.appendChild(C);y.appendChild(q);q=document.createElement("tr");C=document.createElement("td");mxUtils.write(C,mxResources.get("background")+":"); +q.appendChild(C);C=document.createElement("td");var D=document.createElement("button");D.className="geBtn";D.style.margin="0px";mxUtils.write(D,mxResources.get("change")+"...");var P=document.createElement("div");P.style.display="inline-block";P.style.verticalAlign="middle";P.style.backgroundPosition="center center";P.style.backgroundRepeat="no-repeat";P.style.backgroundSize="contain";P.style.border="1px solid lightGray";P.style.borderRadius="4px";P.style.marginRight="14px";P.style.height="32px"; +P.style.width="64px";P.style.cursor="pointer";P.style.padding="4px";var c=l.backgroundImage,g=l.background,m=l.shadowVisible,n=function(x){b.showBackgroundImageDialog(function(F,H,M,L){H||(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(D,"click",n);mxEvent.addListener(P,"click",n);f();C.appendChild(P);C.appendChild(D);q.appendChild(C);y.appendChild(q);q=document.createElement("tr");C=document.createElement("td"); +C.colSpan=2;C.style.paddingTop="16px";C.setAttribute("align","right");D=mxUtils.button(mxResources.get("cancel"),function(){b.hideDialog()});D.className="geBtn";b.editor.cancelFirst&&C.appendChild(D);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,J.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";C.appendChild(n);b.editor.cancelFirst||C.appendChild(D);q.appendChild(C);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 C=document.createElement("select");C.style.position="relative";C.style.marginBottom="4px";C.style.borderRadius="4px";C.style.borderWidth="1px";C.style.borderStyle="solid"; +C.style.boxSizing="border-box";C.style.padding="2px";C.style.width="210px";var J=document.createElement("div");J.style.whiteSpace="nowrap";J.style.marginLeft="4px";J.style.width="210px";J.style.height="24px";y.style.marginRight="6px";J.appendChild(y);f=document.createElement("span");f.style.maxWidth="100px";mxUtils.write(f,mxResources.get("portrait"));J.appendChild(f);q.style.marginLeft="10px";q.style.marginRight="6px";J.appendChild(q);var S=document.createElement("span");S.style.width="100px";mxUtils.write(S, +mxResources.get("landscape"));J.appendChild(S);var D=document.createElement("div");D.style.whiteSpace="nowrap";D.style.marginLeft="4px";D.style.fontSize="12px";D.style.width="210px";D.style.height="24px";var P=document.createElement("input");P.setAttribute("size","7");P.setAttribute("title",mxResources.get("width"));P.style.textAlign="right";D.appendChild(P);mxUtils.write(D," x ");var c=document.createElement("input");c.setAttribute("size","7");c.setAttribute("title",mxResources.get("height"));c.style.textAlign= +"right";D.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=K)P.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(P.value),g.value)),Math.floor(Editor.fromUnit(parseFloat(c.value),g.value)));Z||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(P,"blur",L);mxEvent.addListener(P,"click",L);mxEvent.addListener(c,"blur",L);mxEvent.addListener(c,"click",L);mxEvent.addListener(q,"change",L);mxEvent.addListener(y,"change",L);mxEvent.addListener(C,"change",function(K){L(K,"custom"==C.value);mxEvent.consume(K)});mxEvent.addListener(g,"change",function(K){P.value=Editor.toUnit(Editor.fromUnit(P.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:P,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,C,J,S,D,P){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==C)if(null!=P?Editor.selectFilename(x):(x.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode?x.select():document.execCommand("selectAll",!1,null)),Graph.fileSupport){var H=g.parentNode;if(null!=H){var M=null;mxEvent.addListener(H,"dragleave",function(L){null!=M&&(M.style.backgroundColor="",M=null);L.stopPropagation();L.preventDefault()});mxEvent.addListener(H,"dragover",mxUtils.bind(this,function(L){null==M&&(!mxClient.IS_IE||10'};var b=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(C,J){b.apply(this,arguments); +if(null!=this.shiftPreview1){var S=this.view.canvas;null!=S.ownerSVGElement&&(S=S.ownerSVGElement);var D=this.gridSize*this.view.scale*this.view.gridSteps;D=-Math.round(D-mxUtils.mod(this.view.translate.x*this.view.scale+C,D))+"px "+-Math.round(D-mxUtils.mod(this.view.translate.y*this.view.scale+J,D))+"px";S.style.backgroundPosition=D}};mxGraph.prototype.updatePageBreaks=function(C,J,S){var D=this.view.scale,P=this.view.translate,c=this.pageFormat,g=D*this.pageScale,m=this.view.getBackgroundPageBounds(); +J=m.width;S=m.height;var n=new mxRectangle(D*P.x,D*P.y,c.width*g,c.height*g),x=(C=C&&Math.min(n.width,n.height)>this.minPageBreakDist)?Math.ceil(S/n.height)-1:0,F=C?Math.ceil(J/n.width)-1:0,H=m.x+J,M=m.y+S;null==this.horizontalPageBreaks&&0document.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 P=y.graphHandler.start;y.graphHandler.start=function(){null!=u.hoverIcons&&u.hoverIcons.reset();P.apply(this,arguments)}}mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(ba){var V=mxUtils.getOffset(this.diagramContainer);0ba?V.style.display="none":V.style.display="";V=V.nextSibling}}),F=!1,H=null,M=null,L=null,K=mxUtils.bind(this,function(){if(null!=this.toolbar&&F!=y.cellEditor.isContentEditing()){for(var ba=this.toolbar.container.firstChild, +V=[];null!=ba;){var k=ba.nextSibling;ba.parentNode.removeChild(ba);V.push(ba);ba=k}ba=this.toolbar.fontMenu;k=this.toolbar.sizeMenu;if(null==L)this.toolbar.createTextToolbar();else{for(var v=0;v=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&&""!=V.getAttribute("filter")&&(T=V.getAttribute("filter"),V.removeAttribute("filter"));I=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=Y||null==v?b.container.scrollLeft+b.container.clientWidth/2:v.x+b.container.scrollLeft- +b.container.offsetLeft;var la=Y||null==v?b.container.scrollTop+b.container.clientHeight/2:v.y+b.container.scrollTop-b.container.offsetTop;V.style.transformOrigin=na+"px "+la+"px";V.style.transform="scale("+U+")";ba.style.transformOrigin=na+"px "+la+"px";ba.style.transform="scale("+U+")";null!=b.view.backgroundPageShape&&null!=b.view.backgroundPageShape.node?(na=b.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(na.style,"transform-origin",(Y||null==v?b.container.clientWidth/2+b.container.scrollLeft- +na.offsetLeft+"px":v.x+b.container.scrollLeft-na.offsetLeft-b.container.offsetLeft+"px")+" "+(Y||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))}W(b.isFastZoomEnabled()?fa:0)};mxEvent.addGestureListeners(b.container,function(U){null!=k&&window.clearTimeout(k)},null,function(U){1!=b.cumulativeZoomFactor&&W(0)});mxEvent.addListener(b.container,"scroll",function(U){null==k||b.isMouseDown||1==b.cumulativeZoomFactor||W(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,function(U,Y,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+(Y?-na:na),fa.y):b.view.setTranslate(fa.x,fa.y+(Y?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(Y,null,na,fa),mxEvent.consume(U),!1;qa=qa.parentNode}}),b.container);b.panningHandler.zoomGraph=function(U){b.cumulativeZoomFactor=U.scale;b.lazyZoom(0f.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 C=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,C-this.getY())}mxWindow.prototype.setSize.apply(this,arguments)});b.window.setLocation=function(y,q){var C=window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth, +J=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight,S=parseInt(this.div.style.width),D=parseInt(this.div.style.height);y=Math.max(0,Math.min(y,C-S));q=Math.max(0,Math.min(q,J-D));this.getX()==y&&this.getY()==q||mxWindow.prototype.setLocation.apply(this,arguments);f&&!this.minimized&&this.setSize(S,D)};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;ql&&(f=b.substring(l,u+21).replace(/>/g,">").replace(/</g,"<").replace(/\\"/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&&0N||Math.abs(C.y-v.getGraphY())>N){var T=null;mxEvent.isShiftDown(v.getEvent())||(T=this.selectionCellsHandler.getHandler(I.cell));if(null!=T&&null!= +T.bends&&0'+l+""));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(),C=null!=q.createElementNS?q.createElementNS(mxConstants.NS_SVG,"svg"):q.createElement("svg");null!=y&&C.setAttribute("style","background: "+y.light+"; background-color: "+y.cssText+";");null==q.createElementNS?(C.setAttribute("xmlns",mxConstants.NS_SVG),C.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):C.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);C.setAttribute("version","1.1");C.setAttribute("width", +l+"px");C.setAttribute("height",u+"px");C.setAttribute("viewBox",b+" "+f+" "+l+" "+u);q.appendChild(C);return C}; +Graph.htmlToPng=function(b,f,l,u,y,q){y=null!=y?y:"";q=null!=q?q:Editor.htmlRasterScale;var C=document.createElement("canvas");C.width=f*q;C.height=l*q;var J=document.createElement("img");J.onload=mxUtils.bind(this,function(){try{var D=C.getContext("2d");D.scale(q,q);D.drawImage(J,0,0);u(C.toDataURL())}catch(P){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);J.onerror= +function(D){u(null)};J.src="data:image/svg+xml,"+encodeURIComponent(''+(""!=y?'":"")+'
'+b+"
")}; +Graph.addLightDarkColors=function(b,f,l,u){function y(g,m,n){return null!=u?u(g,m,n):mxUtils.isValidColor(n)?(null==C&&null!=f&&(C={}),null!=C&&(C[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("*"),C=null,J=!1,S=0;SpageSize){var K=g.startIndex||0;M=H.slice(Math.max(0,K),Math.min(H.length,K+pageSize))}M=u.getOpposites(M,F).concat(M);var Z=c.cloneCells(M);for(L=0;Lha.geometry.x?-.8:.5(g.startIndex||0)+pageSize){var aa=c.createVertex(null,null,mxResources.get("nextPage")+" ("+(Math.ceil((g.startIndex||0)/pageSize)+2)+"/"+Math.ceil(H.length/pageSize)+")",0,0,120,30,"fillColor=green;fontColor=white;strokeColor=green;rounded=1;");aa.referenceCell=x;aa.startIndex=(g.startIndex||0)+pageSize;Z.splice(0,0,aa)}for(var oa in c.getModel().cells){var da=c.getModel().getCell(oa);da!=c.rootCell&& +!c.getModel().isAncestor(c.rootCell,da)&&c.getModel().isVertex(da)&&c.removeCells([da])}c.addCells(Z);var ka=c.getModel().getGeometry(c.rootCell);null!=ka&&(ka=ka.clone(),ka.x=m-ka.width/2,ka.y=n-ka.height/3,c.getModel().setGeometry(c.rootCell,ka));g=[];for(oa in c.getModel().cells)da=c.getModel().getCell(oa),da!=c.rootCell&&c.getModel().isVertex(da)&&c.getModel().getParent(da)==c.getDefaultParent()&&(g.push(da),ka=c.getModel().getGeometry(da),null!=ka&&(ka.x=m-ka.width/2,ka.y=n-ka.height/2));var ba= +g.length,V=2*Math.PI/ba,k=Math.max(minSize,Math.min(c.container.offsetWidth/2-40,c.container.offsetHeight/2-80));for(m=0;mmxUtils.indexOf(S,P)})),this.updateCellStyles(C,J))};Graph.prototype.copyCellStyles=function(C,J,S,D,P,c,g){var m=!1,n=!1;if(0mxUtils.indexOf(Graph.edgeStyles,K))&&(m=mxUtils.setStyle(m,K,da),"fontFamily"==K&&null==n.fontSource&&(m=mxUtils.setStyle(m,"fontSource",null)),oa&&"rounded"==K&&"1"==da&&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 C};Graph.prototype.updateCellStyles=function(C,J){this.model.beginUpdate();try{for(var S=0;Sg?"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:(0y&&"%"==f.charAt(match.index-1))C=q.substring(1);else{var J=q.substring(1,q.length-1),S={mm:mxConstants.MILLIMETERS,"in":mxConstants.INCHES,m:mxConstants.METERS,current:this.view.unit};if("id"==J)C=b.id;else if("width"===J.substring(0,5)&&this.model.isVertex(b)){var D=this.getCellGeometry(b); +null!=D&&(C=D.width,5J.indexOf("{"))for(S=b;null==C&&null!= +S;)null!=S.value&&"object"==typeof S.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(C=S.getAttribute(J+"_"+Graph.diagramLanguage)),null==C&&(C=S.hasAttribute(J)?null!=S.getAttribute(J)?S.getAttribute(J):"":null)),S=this.model.getParent(S);null==C&&(C=this.getGlobalVariable(J));null==C&&null!=l&&(C=l[J])}u.push(f.substring(y,match.index)+(null!=C?C:q));y=match.index+q.length}}u.push(f.substring(y))}return u.join("")}; +Graph.prototype.restoreSelection=function(b){if(null!=b&&0J[0].indexOf("=")&&(J=J.slice(1));this.model.setStyle(f[q],J.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,C,J){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),D=S?b:this.getCompositeParent(b),P=b.geometry.relative&&null!=b.parent.geometry?new mxPoint(b.parent.geometry.width*b.geometry.x,b.parent.geometry.height*b.geometry.y):new mxPoint(D.geometry.x,D.geometry.y);f==mxConstants.DIRECTION_NORTH?(P.x+=D.geometry.width/2,P.y-=l):f== +mxConstants.DIRECTION_SOUTH?(P.x+=D.geometry.width/2,P.y+=D.geometry.height+l):(P.x=f==mxConstants.DIRECTION_WEST?P.x-l:P.x+(D.geometry.width+l),P.y+=D.geometry.height/2);var c=this.view.getState(this.model.getParent(b));l=this.view.scale;var g=this.view.translate;D=g.x*l;g=g.y*l;null!=c&&this.model.isVertex(c.cell)&&(D=c.x,g=c.y);this.model.isVertex(b.parent)&&b.geometry.relative&&(P.x+=b.parent.geometry.x,P.y+=b.parent.geometry.y);q=q?null:(new mxRectangle(D+P.x*l,g+P.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;xthis.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;ymxUtils.indexOf(l,b[y].nodeName))&&0C.name?1:0});for(y= +0;y"+mxUtils.htmlEntities(u[y].name)+": ":"")+mxUtils.htmlEntities(u[y].value)+"\n");0'+f+""))}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'); +HoverIcons.prototype.triangleRight=Graph.createSvgImage(26,18,'');HoverIcons.prototype.triangleDown=Graph.createSvgImage(18,26,''); +HoverIcons.prototype.triangleLeft=Graph.createSvgImage(28,18,'');HoverIcons.prototype.roundDrop=Graph.createSvgImage(26,26,''); +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;fthis.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(//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;qF||Math.abs(ba.y-L.y)>F)&&(Math.abs(ba.x-M.x)>F||Math.abs(ba.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,ka.x,ka.y)>F)&&(null==Z||mxUtils.ptLineDist(L.x,L.y,M.x,M.y,Z.x,Z.y)>F||mxUtils.ptLineDist(L.x, +L.y,M.x,M.y,da.x,da.y)>F)){Z=ba.x-L.x;oa=ba.y-L.y;ba={distSq:Z*Z+oa*oa,x:ba.x,y:ba.y};for(Z=0;Zba.distSq){K.splice(Z,0,ba);ba=null;break}null==ba||0!=K.length&&K[K.length-1].x===ba.x&&K[K.length-1].y===ba.y||K.push(ba)}oa=ka}}}for(ca=0;cax*x&&0x*x&&(oa=new mxPoint(aa.x-Z.x,aa.y-Z.y),ca=new mxPoint(aa.x+ +Z.x,aa.y+Z.y),K.push(oa),this.addPoints(c,K,m,n,!1,null,H),K=0>Math.round(Z.x)||0==Math.round(Z.x)&&0>=Math.round(Z.y)?1:-1,H=!1,"sharp"==F?(c.lineTo(oa.x-Z.y*K,oa.y+Z.x*K),c.lineTo(ca.x-Z.y*K,ca.y+Z.x*K),c.lineTo(ca.x,ca.y)):"line"==F?(c.moveTo(oa.x+Z.y*K,oa.y-Z.x*K),c.lineTo(oa.x-Z.y*K,oa.y+Z.x*K),c.moveTo(ca.x-Z.y*K,ca.y+Z.x*K),c.lineTo(ca.x+Z.y*K,ca.y-Z.x*K),c.moveTo(ca.x,ca.y)):"arc"==F?(K*=1.3,c.curveTo(oa.x-Z.y*K,oa.y+Z.x*K,ca.x-Z.y*K,ca.y+Z.x*K,ca.x,ca.y)):(c.moveTo(ca.x,ca.y),H=!0),K=[ca], +oa=!0))}else Z=null;oa||(K.push(aa),M=aa)}this.addPoints(c,K,m,n,!1,null,H);c.stroke()}};var J=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()):J.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),H=mxUtils.toRadians(Number(g.style[mxConstants.STYLE_ROTATION]||"0")),M=new mxPoint(g.getCenterX(),g.getCenterY());if(0!=H){var L=Math.cos(-H),K=Math.sin(-H);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==H&&F,L);0!=H&&(L=Math.cos(H),K=Math.sin(H),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=q.getStatus()&&eval.call(window,q.getText())}}catch(C){null!=window.console&&console.log("error in getStencil:",b,l,f,y,C)}}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=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').src;mxWindow.prototype.minimizeImage=Graph.createSvgImage(14,10,'').src;mxWindow.prototype.normalizeImage=Graph.createSvgImage(14,10,'').src;mxWindow.prototype.resizeImage=Graph.createSvgImage(10,10,'').src; +mxEdgeHandler.prototype.snapToTerminals=!0;mxGraphHandler.prototype.guidesEnabled=!0;mxGraphHandler.prototype.removeEmptyParents=!0;mxRubberband.prototype.fadeOut=!0;mxGuide.prototype.isEnabledForEvent=function(B){return!mxEvent.isAltDown(B)||mxEvent.isShiftDown(B)};var l=mxGraphLayout.prototype.isVertexIgnored;mxGraphLayout.prototype.isVertexIgnored=function(B){return l.apply(this,arguments)||this.graph.isTableRow(B)||this.graph.isTableCell(B)};var u=mxGraphLayout.prototype.isEdgeIgnored;mxGraphLayout.prototype.isEdgeIgnored= +function(B){return u.apply(this,arguments)||this.graph.isEdgeIgnored(B)};var y=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(B){return this.graph.isCloneEvent(B)!=y.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var B=new mxEllipse(null,this.highlightColor,this.highlightColor,0);B.opacity=mxConstants.HIGHLIGHT_OPACITY;return B};mxConnectionHandler.prototype.livePreview=!0;mxConnectionHandler.prototype.cursor= +"crosshair";mxConnectionHandler.prototype.createEdgeState=function(B){B=this.graph.createCurrentEdgeStyle();B=this.graph.createEdge(null,null,null,null,null,B);B=new mxCellState(this.graph.view,B,this.graph.getCellStyle(B));for(var Q in this.graph.currentEdgeStyle)B.style[Q]=this.graph.currentEdgeStyle[Q];if(null!=this.previous){var R=this.previous.style.newEdgeStyle;if(null!=R)try{var X=JSON.parse(R);for(Q in X)B.style[Q]=X[Q]}catch(ia){}}B.style=this.graph.postProcessCellStyle(B.cell,B.style);return B}; +var q=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var B=q.apply(this,arguments);B.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return B};mxConnectionHandler.prototype.updatePreview=function(B){};var C=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var B=C.apply(this,arguments),Q=B.getCell;B.getCell=mxUtils.bind(this,function(R){var X=Q.apply(this,arguments);this.error=null;return X}); +return B};Graph.prototype.defaultVertexStyle={};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.createCurrentEdgeStyle=function(){for(var B="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";",Q="shape curved rounded comic sketch fillWeight hachureGap hachureAngle jiggle disableMultiStroke disableMultiStrokeFill fillStyle curveFitting simplification comicStyle jumpStyle jumpSize".split(" "),R=0;R=ra.x&&this.model.remove(Za[Oa]);var Pa=this.model.getTerminal(R,!1); +if(null!=Pa){var Ra=this.getCurrentCellStyle(Pa);null!=Ra&&"1"==Ra.snapToPoint&&(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[B]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[B]),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(B,Q,R){if(Q||R)c.apply(this,arguments);else{var X=this.getSelectionCell(),ia=null,ja=[],pa= +mxUtils.bind(this,function(xa){if(null!=this.view.getState(xa)&&(this.model.isVertex(xa)||this.model.isEdge(xa)))if(ja.push(xa),xa==X)ia=ja.length-1;else if(B&&null==X&&0ia||!B&&0Pa)for(Ra=0;Ra>Pa;Ra--)this.model.remove(Ta[Ta.length+Ra-1]);Ta=this.model.getChildCells(B[ra], +!0);for(Ra=0;RamxUtils.indexOf(B,ja)&&0>mxUtils.indexOf(R,ja)&&R.push(ja):this.labelChanged(B[X],"")}else{if(this.isTableRow(B[X])&&(ja=this.model.getParent(B[X]),0>mxUtils.indexOf(B,ja)&&0>mxUtils.indexOf(R,ja))){for(var pa=this.model.getChildCells(ja, +!0),xa=0,ra=0;ramxUtils.indexOf(B,ja))return null}ja=x.apply(this,arguments);var pa=!0;for(ia=0;iaja||ua>ja)&&this.clear());else{for(ra=ua.getSource();null!=ra&&"a"!=ra.nodeName.toLowerCase();)ra=ra.parentNode; +null!=ra?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(ra,ua){var Ka=ua.getSource();for(ra=ua.getEvent();null!=Ka&&"a"!=Ka.nodeName.toLowerCase();)Ka=Ka.parentNode;null==Ka&&Math.abs(this.scrollLeft-pa.container.scrollLeft)< +ja&&Math.abs(this.scrollTop-pa.container.scrollTop)ma&&O++;ta++}ea.length=ja.length)Q.remove(R);else{var pa=ja.length-1;this.isTableCell(B)&&(pa=mxUtils.indexOf(ja,B));for(X=B=0;X=ia.length)Q.remove(R);else{this.isTableRow(X)||(X=ia[ia.length-1]);Q.remove(X);B=0;var ja=this.getCellGeometry(X);null!=ja&&(B=ja.height);var pa=this.getCellGeometry(R);null!=pa&&(pa=pa.clone(),pa.height-=B,Q.setGeometry(R,pa))}}finally{Q.endUpdate()}};Graph.prototype.insertRow=function(B,Q){for(var R=B.tBodies[0],X=R.rows[0].cells,ia=B=0;iaQ&&B[R].deleteCell(Q)}};Graph.prototype.pasteHtmlAtCaret=function(B){if(window.getSelection){var Q=window.getSelection();if(Q.getRangeAt&&Q.rangeCount){Q=Q.getRangeAt(0);Q.deleteContents();var R=document.createElement("div");R.innerHTML=B;B=document.createDocumentFragment();for(var X;X=R.firstChild;)lastNode=B.appendChild(X);Q.insertNode(B)}}else(Q=document.selection)&&"Control"!=Q.type&&Q.createRange().pasteHTML(B)}; +Graph.prototype.createLinkForHint=function(B,Q,R){function X(ja,pa){ja.length>pa&&(ja=ja.substring(0,Math.round(pa/2))+"..."+ja.substring(ja.length-Math.round(pa/4)));return ja}B=null!=B?B:"javascript:void(0);";if(null==Q||0==Q.length)Q=this.isCustomLink(B)?this.getLinkTitle(B):B;var ia=document.createElement("a");ia.setAttribute("rel",this.linkRelation);ia.setAttribute("href",this.getAbsoluteUrl(B));ia.setAttribute("title",X(this.isCustomLink(B)?this.getLinkTitle(B):B,80));null!=this.linkTarget&& +ia.setAttribute("target",this.linkTarget);mxUtils.write(ia,X(Q,40));this.isCustomLink(B)&&mxEvent.addListener(ia,"click",mxUtils.bind(this,function(ja){this.customLinkClicked(B,R);mxEvent.consume(ja)}));return ia};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(ja,pa){this.popupMenuHandler.hideMenu()});var B=this.updateMouseEvent;this.updateMouseEvent=function(ja){ja= +B.apply(this,arguments);if(mxEvent.isTouchEvent(ja.getEvent())&&null==ja.getState()){var pa=this.getCellAt(ja.graphX,ja.graphY);null!=pa&&this.isSwimlane(pa)&&this.hitsSwimlaneContent(pa,ja.graphX,ja.graphY)||(ja.state=this.view.getState(pa),null!=ja.state&&null!=ja.state.shape&&(this.container.style.cursor=ja.state.shape.node.style.cursor))}null==ja.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return ja};var Q=!1,R=!1,X=!1,ia=this.fireMouseEvent;this.fireMouseEvent=function(ja, +pa,xa){ja==mxEvent.MOUSE_DOWN&&(pa=this.updateMouseEvent(pa),Q=this.isCellSelected(pa.getCell()),R=this.isSelectionEmpty(),X=this.popupMenuHandler.isMenuShowing());ia.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(ja,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|| +!X&&!xa&&(R&&null==pa.getCell()&&this.isSelectionEmpty()||Q&&this.isCellSelected(pa.getCell())));xa=!Q||xa?null:mxUtils.bind(this,function(ra){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,ra,pa.getEvent())}}),300)});mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,[ja,pa,xa])}})};Graph.prototype.isTouchPopupMenuEnabled=function(){return!0}; +mxCellEditor.prototype.isContentEditing=function(){var B=this.graph.view.getState(this.editingCell);return null!=B&&1==B.style.html};mxCellEditor.prototype.isTableSelected=function(){return null!=this.graph.getParentByName(this.graph.getSelectedElement(),"TABLE",this.textarea)};mxCellEditor.prototype.isTextSelected=function(){var B="";window.getSelection?B=window.getSelection():document.getSelection?B=document.getSelection():document.selection&&(B=document.selection.createRange().text);return""!= +B};mxCellEditor.prototype.insertTab=function(B){var Q=this.textarea.ownerDocument.defaultView.getSelection(),R=Q.getRangeAt(0);B=Graph.createTabNode(B);R.insertNode(B);R.setStartAfter(B);R.setEndAfter(B);Q.removeAllRanges();Q.addRange(R)};mxCellEditor.prototype.alignText=function(B,Q){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 X=null!=R&&"vertical-"==R.substring(0,9),ia=null!= +Q&&mxEvent.isShiftDown(Q);if(ia||null!=window.getSelection&&null!=window.getSelection().containsNode){var ja=!0;this.graph.processElements(this.textarea,function(pa){ia||X||window.getSelection().containsNode(pa,!0)?(pa.removeAttribute("align"),pa.style.textAlign=null):ja=!1});(ja||X)&&this.graph.cellEditor.setAlign(B)}X||document.execCommand("justify"+B.toLowerCase(),!1,null)}};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var B=window.getSelection();if(B.getRangeAt&&B.rangeCount){for(var Q= +[],R=0,X=B.rangeCount;R"):xa,!0);this.textarea.className="mxCellEditor geContentEditable";ra=mxUtils.getValue(B.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE); +Q=mxUtils.getValue(B.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY);var X=mxUtils.getValue(B.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),ia=(mxUtils.getValue(B.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,ja=(mxUtils.getValue(B.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,pa=[];(mxUtils.getValue(B.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&& +pa.push("underline");(mxUtils.getValue(B.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(ra*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(ra)+"px";this.textarea.style.textDecoration=pa.join(" ");this.textarea.style.fontWeight=ia?"bold":"normal";this.textarea.style.fontStyle=ja?"italic":"";this.textarea.style.fontFamily= +Q;this.textarea.style.textAlign=X;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
"));xa=Graph.sanitizeHtml(Q?xa.replace(/\n/g,"").replace(/<br\s*.?>/g,"
"):xa,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var ra=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(ra*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT; +this.textarea.style.fontSize=Math.round(ra)+"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(B,Q){if(null!=this.textarea)if(B=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=B){var R=B.view.scale;this.bounds=mxRectangle.fromRectangle(B);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*R;this.bounds.height=60*R;var X=null!=B.text?B.text.margin:null;null==X&&(X=mxUtils.getAlignmentAsPoint(mxUtils.getValue(B.style,mxConstants.STYLE_ALIGN, +mxConstants.ALIGN_CENTER),mxUtils.getValue(B.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));this.bounds.x+=X.x*this.bounds.width;this.bounds.y+=X.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/R)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/R)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight"));return Graph.sanitizeHtml(R,!0)};mxCellEditorSetEditingValue=mxCellEditor.prototype.setEditingValue; +mxCellEditor.prototype.setEditingValue=function(B,Q){mxCellEditorSetEditingValue.apply(this,arguments);"1"==mxUtils.getValue(B.style,"html","0")&&Graph.addLightDarkColors(this.textarea,Graph.backupStyleAttribute,"simple"==this.graph.getAdaptiveColors())};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=function(B){if("0"==mxUtils.getValue(B.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);Graph.removeLightDarkColors(this.textarea, +Graph.backupStyleAttribute);var Q=Graph.sanitizeHtml(this.textarea.innerHTML,!0);"1"==mxUtils.getValue(B.style,"nl2Br","1")?(Q=Q.replace(/\r\n/g,"
").replace(/\n/g,"
"),0"==Q.substring(Q.length-5)||"
"==Q.substring(Q.length-4))&&(Q=Q.substring(0,Q.lastIndexOf("
")):Q=Q.replace(/\r\n/g,"").replace(/\n/g,"");return Q};var K=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(B){this.codeViewMode&&this.toggleViewMode();K.apply(this, +arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(B){}};var Z=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(B,Q){this.graph.getModel().beginUpdate();try{Z.apply(this,arguments),""==Q&&this.graph.isCellDeletable(B.cell)&&0==this.graph.model.getChildCount(B.cell)&&this.graph.isTransparentState(B)&&this.graph.removeCells([B.cell],!1)}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor= +function(B){B=mxUtils.getValue(B.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);B==mxConstants.NONE&&(B=null);return B};mxCellEditor.prototype.getBorderColor=function(B){B=mxUtils.getValue(B.style,mxConstants.STYLE_LABEL_BORDERCOLOR,null);B==mxConstants.NONE&&(B=null);return B};mxCellEditor.prototype.getMinimumSize=function(B){var Q=this.graph.getView().scale;return new mxRectangle(0,0,null==B.text?30:B.text.size*Q+20,30)};mxGraphHandlerIsValidDropTarget=mxGraphHandler.prototype.isValidDropTarget; +mxGraphHandler.prototype.isValidDropTarget=function(B,Q){return mxGraphHandlerIsValidDropTarget.apply(this,arguments)&&!mxEvent.isAltDown(Q.getEvent)};mxGraphView.prototype.formatUnitText=function(B){return B?f(B,this.unit):B};mxGraphHandler.prototype.updateHint=function(B){if(null!=this.pBounds&&(null!=this.shape||this.livePreviewActive)){null==this.hint&&(this.hint=b(),this.graph.container.appendChild(this.hint));var Q=this.graph.view.translate,R=this.graph.view.scale;B=this.roundLength((this.bounds.x+ +this.currentDx)/R-Q.x);Q=this.roundLength((this.bounds.y+this.currentDy)/R-Q.y);R=this.graph.view.unit;this.hint.innerHTML=f(B,R)+", "+f(Q,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 ha=mxStackLayout.prototype.resizeCell;mxStackLayout.prototype.resizeCell=function(B,Q){ha.apply(this,arguments);var R=this.graph.getCellStyle(B);if(null==R.childLayout){var X=this.graph.model.getParent(B),ia=null!=X?this.graph.getCellGeometry(X):null;if(null!=ia&&(R=this.graph.getCellStyle(X),"stackLayout"==R.childLayout)){var ja=parseFloat(mxUtils.getValue(R,"stackBorder",mxStackLayout.prototype.border));R="1"==mxUtils.getValue(R,"horizontalStack","1");var pa=this.graph.getActualStartSize(X); +ia=ia.clone();R?ia.height=Q.height+pa.y+pa.height+2*ja:ia.width=Q.width+pa.x+pa.width+2*ja;this.graph.model.setGeometry(X,ia)}}};var ca=mxSelectionCellsHandler.prototype.getHandledSelectionCells;mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){function B(xa){R.get(xa)||(R.put(xa,!0),ia.push(xa))}for(var Q=ca.apply(this,arguments),R=new mxDictionary,X=this.graph.model,ia=[],ja=0;jaB;B++){var Q=new mxRectangleShape(new mxRectangle(0,0,6,6),"#ffffff", +mxConstants.HANDLE_STROKECOLOR);Q.dialect=mxConstants.DIALECT_SVG;Q.init(this.graph.view.getOverlayPane());this.cornerHandles.push(Q)}}this.graph.isTable(this.state.cell)&&this.graph.isCellMovable(this.state.cell)&&this.refreshMoveHandles();B=this.graph.getLinkForCell(this.state.cell);Q=this.graph.getLinksForState(this.state);this.updateLinkHint(B,Q)};var U=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var B=new mxPoint(0,0),Q=this.tolerance,R=this.state.style.shape; +null==mxCellRenderer.defaultShapes[R]&&mxStencilRegistry.getStencil(R);R=this.graph.isTable(this.state.cell)||this.graph.cellEditor.getEditingCell()==this.state.cell;if(!R&&null!=this.customHandles)for(var X=0;X');Graph.prototype.collapsedImage=Graph.createSvgImage(9,9,''); +mxEdgeHandler.prototype.removeHint=mxVertexHandler.prototype.removeHint;HoverIcons.prototype.mainHandle=Graph.createSvgImage(18,18,'');HoverIcons.prototype.endMainHandle=Graph.createSvgImage(18,18,'');HoverIcons.prototype.secondaryHandle=Graph.createSvgImage(16,16,''); +HoverIcons.prototype.fixedHandle=Graph.createSvgImage(22,22,'');HoverIcons.prototype.endFixedHandle=Graph.createSvgImage(22,22,'');HoverIcons.prototype.terminalHandle=Graph.createSvgImage(22,22,'');HoverIcons.prototype.endTerminalHandle=Graph.createSvgImage(22,22,'');HoverIcons.prototype.rotationHandle=Graph.createSvgImage(16,16,'', +24,24);mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'');mxVertexHandler.TABLE_HANDLE_COLOR="#fca000";mxVertexHandler.prototype.handleImage=HoverIcons.prototype.mainHandle;mxVertexHandler.prototype.secondaryHandleImage=HoverIcons.prototype.secondaryHandle;mxVertexHandler.prototype.rowHandleImage=Graph.createSvgImage(14, +12,'');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(B){return!mxEvent.isShiftDown(B.getEvent())};mxEdgeHandler.prototype.isCustomHandleEvent=function(B){return!mxEvent.isShiftDown(B.getEvent())};if(Graph.touchStyle){if(mxClient.IS_TOUCH||0ja||Math.abs(ia)>ja)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(B,R),this.isSpaceEvent(Q)?(B=this.x+this.width,R=this.y+this.height,X=this.graph.view.scale,mxEvent.isAltDown(Q.getEvent())|| +(this.width=this.graph.snap(this.width/X)*X,this.height=this.graph.snap(this.height/X)*X,this.graph.isGridEnabled()||(this.width=this.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)),Q.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(B,Q,R,X){wa.apply(this,arguments);R!=this.currentTerminalState?(qa=(new Date).getTime(),ya=0):ya=(new Date).getTime()-qa;this.currentTerminalState=R};var Ia=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(B){return mxEvent.isShiftDown(B.getEvent())&&mxEvent.isAltDown(B.getEvent())?!1:null!=this.currentTerminalState&&B.getState()==this.currentTerminalState&&2E3=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==B)?this.graph.getConnectionConstraint(this.state,X,Q):null;R=null!=(null!=B?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(Q),B):null)?R?this.endFixedHandleImage:this.fixedHandleImage: +null!=B&&null!=X?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(B,Q,R,X){X=Q==mxEvent.ROTATION_HANDLE? +HoverIcons.prototype.rotationHandle:Q==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:X;return Aa.apply(this,arguments)};var Ba=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(B){if(null!=B&&1==B.length){var Q=this.graph.getModel(),R=Q.getParent(B[0]),X=this.graph.getCellGeometry(B[0]);if(Q.isEdge(R)&&null!=X&&X.relative&&(Q=this.graph.view.getState(B[0]),null!=Q&&2>Q.width&&2>Q.height&&null!=Q.text&&null!=Q.text.boundingBox))return mxRectangle.fromRectangle(Q.text.boundingBox)}return Ba.apply(this, +arguments)};var Ga=mxGraphHandler.prototype.getGuideStates;mxGraphHandler.prototype.getGuideStates=function(){for(var B=Ga.apply(this,arguments),Q=[],R=0;RB.width&&2>B.height&&null!= +B.text&&null!=B.text.boundingBox?(Q=B.text.unrotatedBoundingBox||B.text.boundingBox,new mxRectangle(Math.round(Q.x),Math.round(Q.y),Math.round(Q.width),Math.round(Q.height))):Ma.apply(this,arguments)};var sa=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(B,Q){var R=this.graph.getModel(),X=R.getParent(this.state.cell),ia=this.graph.getCellGeometry(this.state.cell);(this.getHandleForEvent(Q)==mxEvent.ROTATION_HANDLE||!R.isEdge(X)||null==ia||!ia.relative||null==this.state|| +2<=this.state.width||2<=this.state.height)&&sa.apply(this,arguments)};mxVertexHandler.prototype.rotateClick=function(){var B=mxUtils.getValue(this.state.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),Q=mxUtils.getValue(this.state.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);this.state.view.graph.model.isVertex(this.state.cell)&&B==mxConstants.NONE&&Q==mxConstants.NONE?(B=mxUtils.mod(mxUtils.getValue(this.state.style,mxConstants.STYLE_ROTATION,0)+90,360),this.state.view.graph.setCellStyles(mxConstants.STYLE_ROTATION, +B,[this.state.cell])):this.state.view.graph.turnShapes([this.state.cell])};var Ca=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(B,Q){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(B,Q){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(B,Q){try{if(null==B&&(null==Q||0==Q.length))null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint), +this.linkHint=null);else if(null!=B||null!=Q&&0G?"#FFFFFF":"#000000"),d.begin(),d.moveTo(0,0),d.lineTo(t-E,0),d.lineTo(t,E), +d.lineTo(E,E),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(E,E),d.lineTo(E,z),d.lineTo(0,z-E),d.close(),d.fill()),d.begin(),d.moveTo(E,z),d.lineTo(E,E),d.lineTo(0,0),d.moveTo(E,E),d.lineTo(t,E),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 bb=Math.tan(mxUtils.toRadians(30)),db=(.5-bb)/2;mxCellRenderer.registerShape("isoRectangle",C);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 E=Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size))-2)+2*this.strokewidth;d.ellipse(p+.5*(t-E),A+.5*(z-E),E,E);d.fill();d.setFillColor(mxConstants.NONE);d.rect(p,A,t,z);d.fill()};mxCellRenderer.registerShape("waypoint", +q);mxUtils.extend(C,mxActor);C.prototype.size=20;C.prototype.redrawPath=function(d,p,A,t,z){p=Math.min(t,z/bb);d.translate((t-p)/2,(z-p)/2+p/4);d.moveTo(0,.25*p);d.lineTo(.5*p,p*db);d.lineTo(p,.25*p);d.lineTo(.5*p,(.5-db)*p);d.lineTo(0,.25*p);d.close();d.end()};mxCellRenderer.registerShape("isoRectangle",C);mxUtils.extend(J,mxCylinder);J.prototype.size=20;J.prototype.redrawPath=function(d,p,A,t,z,E){p=Math.min(t,z/(.5+bb));E?(d.moveTo(0,.25*p),d.lineTo(.5*p,(.5-db)*p),d.lineTo(p,.25*p),d.moveTo(.5* +p,(.5-db)*p),d.lineTo(.5*p,(1-db)*p)):(d.translate((t-p)/2,(z-p)/2),d.moveTo(0,.25*p),d.lineTo(.5*p,p*db),d.lineTo(p,.25*p),d.lineTo(p,.75*p),d.lineTo(.5*p,(1-db)*p),d.lineTo(0,.75*p),d.close());d.end()};mxCellRenderer.registerShape("isoCube",J);mxUtils.extend(S,mxCylinder);S.prototype.redrawPath=function(d,p,A,t,z,E){p=Math.min(z/2,Math.round(z/8)+this.strokewidth-1);if(E&&null!=this.fill||!E&&null==this.fill)d.moveTo(0,p),d.curveTo(0,2*p,t,2*p,t,p),E||(d.stroke(),d.begin()),d.translate(0,p/2),d.moveTo(0, +p),d.curveTo(0,2*p,t,2*p,t,p),E||(d.stroke(),d.begin()),d.translate(0,p/2),d.moveTo(0,p),d.curveTo(0,2*p,t,2*p,t,p),E||(d.stroke(),d.begin()),d.translate(0,-p);E||(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(D,mxCylinder);D.prototype.size=30;D.prototype.darkOpacity= +0;D.prototype.paintVertexShape=function(d,p,A,t,z){var E=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-E,0);d.lineTo(t,E);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-E,0),d.lineTo(t-E,E),d.lineTo(t,E),d.close(),d.fill()),d.begin(),d.moveTo(t-E,0),d.lineTo(t-E,E),d.lineTo(t,E),d.end(),d.stroke())};mxCellRenderer.registerShape("note",D);mxUtils.extend(P,D);mxCellRenderer.registerShape("note2",P);P.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 E=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style,"isoAngle",this.isoAngle))))*Math.PI/200;E=Math.min(t*Math.tan(E),.5*z);d.translate(p,A);d.begin();d.moveTo(.5*t,0);d.lineTo(t,E);d.lineTo(t,z-E);d.lineTo(.5*t,z);d.lineTo(0,z-E);d.lineTo(0,E);d.close();d.fillAndStroke();d.setShadow(!1);d.begin();d.moveTo(0,E);d.lineTo(.5*t,2*E);d.lineTo(t,E);d.moveTo(.5*t,2*E);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 E=Math.max(0,Math.min(.5*z,parseFloat(mxUtils.getValue(this.style,"size",this.size))));d.translate(p,A);0==E?(d.rect(0,0,t,z),d.fillAndStroke()):(d.begin(),d.moveTo(0,E),d.arcTo(.5*t,E,0,0,1,.5*t,0),d.arcTo(.5*t,E,0,0,1,t,E),d.lineTo(t,z-E),d.arcTo(.5*t,E,0,0,1,.5*t,z),d.arcTo(.5*t,E,0,0,1,0,z-E),d.close(),d.fillAndStroke(),d.setShadow(!1),d.begin(),d.moveTo(t,E),d.arcTo(.5*t,E,0,0,1,.5*t,2*E),d.arcTo(.5* +t,E,0,0,1,0,E),d.stroke())};mxCellRenderer.registerShape("cylinder2",g);mxUtils.extend(m,mxCylinder);m.prototype.size=15;m.prototype.paintVertexShape=function(d,p,A,t,z){var E=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==E?(d.rect(0,0,t,z),d.fillAndStroke()):(d.begin(),G?(d.moveTo(0,E),d.arcTo(.5*t,E,0,0,1,.5*t,0),d.arcTo(.5*t,E,0,0,1,t,E)):(d.moveTo(0,0),d.arcTo(.5*t,E,0,0,0,.5*t,E),d.arcTo(.5*t,E, +0,0,0,t,0)),d.lineTo(t,z-E),d.arcTo(.5*t,E,0,0,1,.5*t,z),d.arcTo(.5*t,E,0,0,1,0,z-E),d.close(),d.fillAndStroke(),d.setShadow(!1),G&&(d.begin(),d.moveTo(t,E),d.arcTo(.5*t,E,0,0,1,.5*t,2*E),d.arcTo(.5*t,E,0,0,1,0,E),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 E=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"==E?(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),E=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));z||(E*=Math.min(d.width,d.height));E=Math.min(E,.5*d.width,.5*(d.height-p));t||(E=0);return"left"==mxUtils.getValue(this.style,"tabPosition", +this.tabPosition)?new mxRectangle(E,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,E,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 E=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);E||(p=0);E=0;null!=A&&(E=10);d.begin();d.moveTo(E,p);d.arcTo(p,p,0,0,1,E+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(E+p,z);d.arcTo(p,p,0,0,1,E,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(H,mxActor);H.prototype.size=30;H.prototype.isRoundable=function(){return!0};H.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",H);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 mb=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)):mb.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),E=parseFloat(mxUtils.getValue(this.style, +"arcSize",this.arcSize));z||(E*=Math.min(d.width,d.height));E=Math.min(E,.5*d.width,.5*(d.height-p));t||(E=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(E,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,E,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};P.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(Z,mxActor);Z.prototype.size= +.2;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(.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",Z);mxUtils.extend(ha,mxActor);ha.prototype.size=.5;ha.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",ha);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);aa.prototype.moveTo=function(d,p){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=p;this.firstX=d;this.firstY=p};aa.prototype.close= +function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};aa.prototype.quadTo=function(d,p,A,t){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=A;this.lastY=t};aa.prototype.curveTo=function(d,p,A,t,z,E){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=z;this.lastY=E};aa.prototype.arcTo=function(d,p,A,t,z,E,G){this.originalArcTo.apply(this.canvas,arguments); +this.lastX=E;this.lastY=G};aa.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),E=Math.sqrt(t*t+z*z);if(2>E){this.originalLineTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=p;return}var G=Math.round(E/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/=E;z/=E;for(E=0;EG+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"),E=z?Z.prototype.fixedSize:Z.prototype.size;null!=p&&(E=mxUtils.getValue(p.style,"size",E));z&&(E*=p.view.scale);var G=d.x,ea=d.y,O=d.width,ta=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,E)):O*Math.max(0,Math.min(1,E)),ea=[new mxPoint(G+z,ea),new mxPoint(G+O-z,ea),new mxPoint(G+O,ea+ta),new mxPoint(G,ea+ta),new mxPoint(G+z,ea)]):p==mxConstants.DIRECTION_WEST?(z=z?Math.max(0,Math.min(O,E)):O*Math.max(0,Math.min(1,E)),ea=[new mxPoint(G,ea),new mxPoint(G+O,ea),new mxPoint(G+O-z,ea+ta),new mxPoint(G+z,ea+ta),new mxPoint(G,ea)]):p==mxConstants.DIRECTION_NORTH?(z=z?Math.max(0,Math.min(ta,E)):ta*Math.max(0,Math.min(1,E)),ea=[new mxPoint(G,ea+z),new mxPoint(G+O,ea),new mxPoint(G+ +O,ea+ta),new mxPoint(G,ea+ta-z),new mxPoint(G,ea+z)]):(z=z?Math.max(0,Math.min(ta,E)):ta*Math.max(0,Math.min(1,E)),ea=[new mxPoint(G,ea),new mxPoint(G+O,ea+z),new mxPoint(G+O,ea+ta-z),new mxPoint(G,ea+ta),new mxPoint(G,ea)]);ta=d.getCenterX();d=d.getCenterY();d=new mxPoint(ta,d);t&&(A.xG+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"),E=z?ba.prototype.fixedSize:ba.prototype.size;null!=p&&(E=mxUtils.getValue(p.style,"size",E));z&&(E*=p.view.scale);var G=d.x,ea=d.y,O=d.width,ta=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,E)):O*Math.max(0,Math.min(1,E)),ea=[new mxPoint(G,ea),new mxPoint(G+O-z,ea),new mxPoint(G+O,d),new mxPoint(G+O-z,ea+ta),new mxPoint(G, +ea+ta),new mxPoint(G+z,d),new mxPoint(G,ea)]):p==mxConstants.DIRECTION_WEST?(z=z?Math.max(0,Math.min(O,E)):O*Math.max(0,Math.min(1,E)),ea=[new mxPoint(G+z,ea),new mxPoint(G+O,ea),new mxPoint(G+O-z,d),new mxPoint(G+O,ea+ta),new mxPoint(G+z,ea+ta),new mxPoint(G,d),new mxPoint(G+z,ea)]):p==mxConstants.DIRECTION_NORTH?(z=z?Math.max(0,Math.min(ta,E)):ta*Math.max(0,Math.min(1,E)),ea=[new mxPoint(G,ea+z),new mxPoint(ma,ea),new mxPoint(G+O,ea+z),new mxPoint(G+O,ea+ta),new mxPoint(ma,ea+ta-z),new mxPoint(G, +ea+ta),new mxPoint(G,ea+z)]):(z=z?Math.max(0,Math.min(ta,E)):ta*Math.max(0,Math.min(1,E)),ea=[new mxPoint(G,ea),new mxPoint(ma,ea+z),new mxPoint(G+O,ea),new mxPoint(G+O,ea+ta-z),new mxPoint(ma,ea+ta),new mxPoint(G,ea+ta-z),new mxPoint(G,ea)]);ma=new mxPoint(ma,d);t&&(A.xG+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"),E=z?V.prototype.fixedSize:V.prototype.size;null!=p&&(E=mxUtils.getValue(p.style,"size",E));z&&(E*=p.view.scale);var G=d.x,ea=d.y,O=d.width,ta=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(ta,E)):ta*Math.max(0,Math.min(1,E)),ea=[new mxPoint(ma,ea),new mxPoint(G+O,ea+z),new mxPoint(G+O,ea+ta-z), +new mxPoint(ma,ea+ta),new mxPoint(G,ea+ta-z),new mxPoint(G,ea+z),new mxPoint(ma,ea)]):(z=z?Math.max(0,Math.min(O,E)):O*Math.max(0,Math.min(1,E)),ea=[new mxPoint(G+z,ea),new mxPoint(G+O-z,ea),new mxPoint(G+O,d),new mxPoint(G+O-z,ea+ta),new mxPoint(G+z,ea+ta),new mxPoint(G,d),new mxPoint(G+z,ea)]);ma=new mxPoint(ma,d);t&&(A.xG+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 E=parseFloat(mxUtils.getValue(this.style,"size",this.size));d.translate(p,A);d.ellipse((t-E)/2,0,E,E);d.fillAndStroke();d.begin();d.moveTo(t/2,E);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 E=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,E+G);d.lineTo(t/2,z);d.end();d.stroke();d.begin();d.moveTo((t-E)/2-G,E/2);d.quadTo((t-E)/2-G,E+G,t/2,E+G);d.quadTo((t+E)/2+G,E+G,(t+E)/2+G,E/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 E=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;d.translate(p,A);d.ellipse(0,E,t-2*E,z-2*E);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(Ia,mxCylinder);Ia.prototype.jettyWidth=20;Ia.prototype.jettyHeight=10;Ia.prototype.redrawPath= +function(d,p,A,t,z,E){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);E?(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",Ia);mxUtils.extend(Aa,mxCylinder);Aa.prototype.jettyWidth=32;Aa.prototype.jettyHeight=12;Aa.prototype.redrawPath=function(d,p,A,t,z,E){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;E?(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 E=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+E,A),new mxPoint(p+t,A+G),new mxPoint(p+E,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 E=Math.min(4,Math.min(t/5,z/5));0=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))];Ka.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;D.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};H.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;ja.prototype.constraints=mxEllipse.prototype.constraints;pa.prototype.constraints=mxEllipse.prototype.constraints;Va.prototype.constraints=mxEllipse.prototype.constraints;Da.prototype.constraints=mxRectangleShape.prototype.constraints;Oa.prototype.constraints=mxRectangleShape.prototype.constraints; +Za.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};Ia.prototype.getConstraints=function(d,p,A){p=parseFloat(mxUtils.getValue(d,"jettyWidth",Ia.prototype.jettyWidth))/2;d=parseFloat(mxUtils.getValue(d,"jettyHeight",Ia.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;X.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)];ba.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5, +0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(.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;Z.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;Ua.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};Sa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0, +1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];Qa.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",Qa.prototype.arrowWidth)))),z=p*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Qa.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 E=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,E));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,E));d.push(new mxConnectionConstraint(new mxPoint(0, +0),!1,null,.5*(p+z),E));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,G,E));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,E));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*G,E));d.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,G,t));return d};fa.prototype.constraints= +null;B.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)];Q.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(D){q.escape();D=q.deleteCells(q.getDeletableCells(q.getSelectionCells()),D);null!=D&&q.setSelectionCells(D)}function f(){if(!q.isSelectionEmpty()){q.getModel().beginUpdate();try{for(var D=q.getSelectionCells(),P=0;PMath.abs(D-q.view.scale)&&5>Math.abs(P-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");J.getTitle=function(){return mxResources.get("fitWindow")+" / "+mxResources.get("resetView")};this.put("smartFit",J);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(D,P){try{var c=mxUtils.parseXml(D);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=C;this.addAction("save",function(){u.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=C;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 D=new EditDiagramDialog(u);u.showDialog(D.container,620,420,!0,!1,null,null,null,new mxRectangle(0, +0,440,280));D.init()}).isEnabled=C;this.addAction("pageSetup...",function(){u.showDialog((new PageSetupDialog(u)).container,320,240,!0,!0)}).isEnabled=C;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 D=null;try{D=u.copyXml(),null!=D&&q.removeCells(D,!1)}catch(P){}try{null==D&&mxClipboard.cut(q)}catch(P){u.handleError(P)}},null,"",Editor.ctrlKey+"+X");this.addAction("copy",function(){try{u.copyXml()}catch(D){}try{mxClipboard.copy(q)}catch(D){u.handleError(D)}},null,"",Editor.ctrlKey+"+C");this.addAction("paste",function(){u.pasteFromClipboard()},!1,"",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(D){u.pasteFromClipboard(q.popupMenuHandler.getTriggerPoint())}); +this.addAction("swap",function(){var D=q.getSelectionCells();2==D.length&&q.swapShapes(D[0],D[1])});this.addAction("copySize",function(){var D=q.getSelectionCell();q.isEnabled()&&null!=D&&q.getModel().isVertex(D)&&(D=q.getCellGeometry(D),null!=D&&(u.copiedSize=new mxRectangle(D.x,D.y,D.width,D.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 D=q.getResizableCells(q.getSelectionCells()), +P=0;P"));q.cellLabelChanged(state.cell,Graph.sanitizeHtml(m));q.setCellStyles("html",D,[P[c]])}}u.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=D?D:"0"],"cells",P))}finally{q.getModel().endUpdate()}});this.addAction("wordWrap",function(){var D=q.getView().getState(q.getSelectionCell()),P="wrap";q.stopEditing();null!=D&&"wrap"==D.style[mxConstants.STYLE_WHITE_SPACE]&&(P=null);q.setCellStyles(mxConstants.STYLE_WHITE_SPACE, +P)});this.addAction("rotation",function(){var D="0",P=q.getView().getState(q.getSelectionCell());null!=P&&(D=P.style[mxConstants.STYLE_ROTATION]||D);D=new FilenameDialog(u,D,mxResources.get("apply"),function(c){null!=c&&0l?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,C,J){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{var S=this.getCurrentUser(),D=null!=S?S.id:"unknown",P=""!=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 +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",H="unknown",M="unknown";try{var L=null!=m.initialData&&0F?this.ui.insertPage(n[x],Math.min(x,this.ui.pages.length)):this.ui.movePage(F,x)}for(x=0;xmxUtils.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);J.checkDefaultParent()}finally{J.container.style.visibility="";J.model.endUpdate();J.cellRenderer.redraw=c;this.changeListenerEnabled=S;l||(y.history=q,y.indexOfNextAdd=C,y.fireEvent(new mxEventObject(mxEvent.CLEAR)));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)P!=J.mathEnabled?(this.ui.editor.updateGraphComponents(),J.refresh()):(D!=J.foldingEnabled? +J.view.revalidate():J.view.validate(),J.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(C){if(null!=l)l(C);else throw C;}};DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var 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+(this.isLocked()?' ':"")+"")}}; +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('
'+f+" ("+mxUtils.htmlEntities(b.message)+ +")
")})):(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+"")})),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('
'+b+'
',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'+mxUtils.htmlEntities(mxResources.get("error"))+ +(null!=l?" ("+mxUtils.htmlEntities(l)+")":"")+"")}))))}; +DrawioFile.prototype.handleConflictError=function(b,f){var l=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),u=mxUtils.bind(this,function(C){this.handleFileError(C,!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;lthis.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');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.defaultTextStyle="text;html=1;whiteSpace=wrap;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;rounded=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(I,N){return 1==I.vertices.length?(N=N.editorUi.editor.graph.model,I=N.getParent(I.vertices[0]),N.isEdge(I)||N.isVertex(I)):!1},getValue:function(I,N){return"inherit"== +mxUtils.getValue(I.style,v)},valueChanged:function(I,N,T,W){N=W.editorUi.editor.graph;"1"==I?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%position%
Email\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://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\nEdward Morrison,Brand Manager,emo,Office 2,Tessa Miller,me@example.com,default,#82b366,,https://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png\nAlison Donovan,System Admin,rdo,Office 3,Tessa Miller,me@example.com,default,#82b366,"emo,tva",https://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png\nEvan Valet,HR Director,tva,Office 4,Tessa Miller,me@example.com,default,#82b366,,https://app.diagrams.net,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\n'; +Editor.canvasSupported=!1;(function(){try{var 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 I=k.toDataURL("image/png");Editor.useCanvasForExport=null!=I&&6
')))}catch(I){}})(); +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(I){}})();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 I=document.createElement("style"); +I.type="text/css";var N=I.appendChild,T=document,W=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(I,W.call(T,v));document.head.appendChild(I)}}))};Editor.createRoughCanvas=function(k){var v= +rough.canvas({getContext:function(){return k}});v.draw=function(I){var N=I.sets||[];I=I.options||this.getDefaultOptions();for(var T=0;Tna&&(na=T.strokeWidth/2);k.setStrokeAlpha(k.state.fillAlpha); +k.setStrokeColor(T.fill||"");k.setStrokeWidth(na);k.setDashed(!1);this._drawToContext(I,N,T);k.setDashed(fa);k.setStrokeWidth(U);k.setStrokeColor(W);k.setStrokeAlpha(Y)};v._drawToContext=function(I,N,T){I.begin();for(var W=0;W",T));if(null!=I){v=I;I=[];for(N=0;NT){v=k.substring(T,fa);break}}10==Y&&("endobj"==I?U=null:"obj"==I.substring(I.length-3,I.length)||"xref"==I||"trailer"==I?(U=[],W[I.split(" ")[0]]=U):null!=U&&U.push(I),I="")}}null==v&&null!=W&&(v=Editor.extractGraphModelFromXref(W));null!=v&&(v=decodeURIComponent(v.replace(/\\\(/g,"(").replace(/\\\)/g,")")));return v};Editor.extractGraphModelFromXref=function(k){var v= +k.trailer,I=null;null!=v&&(v=/.* \/Info (\d+) (\d+) R/g.exec(v.join("\n")),null!=v&&0 1 expected for zoomFactor"));null!=k.defaultGridSize&&(v=parseInt(k.defaultGridSize),!isNaN(v)&&0 0 expected for defaultGridSize"));null!=k.gridSteps&&(v=parseInt(k.gridSteps),!isNaN(v)&&0 0 expected for gridSteps")); +null!=k.pageFormat&&(v=parseInt(k.pageFormat.width),I=parseInt(k.pageFormat.height),!isNaN(v)&&0 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 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 I=document.createElement("style");I.setAttribute("type","text/css");I.appendChild(document.createTextNode(k));v.parentNode.insertBefore(I,v);k=k.split("url(");for(I=1;Ina.getStatus()|| +299>2);v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((T& +3)<<4);v+="==";break}W=k.charCodeAt(I++);if(I==N){v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(T>>2);v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((T&3)<<4|(W&240)>>4);v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((W&15)<<2);v+="=";break}U=k.charCodeAt(I++);v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(T>>2);v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((T& +3)<<4|(W&240)>>4);v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((W&15)<<2|(U&192)>>6);v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(U&63)}return v};Editor.prototype.loadUrl=function(k,v,I,N,T,W,U,Y){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&&(W=null!=W?W:"data:image/png;base64,",la=W+Editor.base64Encode(la)),v(la)):null!=I&&(0==la.getStatus()?I({message:mxResources.get("accessDenied")},la):404==la.getStatus()?I({message:mxResources.get("fileNotFound"),code:la.getStatus()},la):I({message:this.getErrorMessage(la)},la))}),function(la){null!=I&&I({message:mxResources.get("error")+" "+la.getStatus()})},fa,this.timeout,function(){T&&null!=I&&I({code:App.ERROR_TIMEOUT,retry:na})},Y)});na()}catch(la){null!= +I&&I(la)}};Editor.prototype.getErrorMessage=function(k){var v=mxResources.get("error")+" "+k.getStatus();try{var I=k.getText(),N=JSON.parse(I);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 I=k.split("url(");if(0N.indexOf("mxPageSelector")&&0y;y++)for(var q=y,C=0;8>C;C++)q=1==(q&1)?3988292384^q>>>1:q>>>1,Editor.crcTable[y]=q;Editor.updateCRC=function(k,v,I,N){for(var T=0;T>>8;return k};Editor.crc32=function(k){for(var v=-1,I=0;I>>8^Editor.crcTable[(v^k.charCodeAt(I))&255];return(v^-1)>>>0};Editor.writeGraphModelToPng=function(k,v,I,N,T){function W(la,qa){var ya=fa;fa+=qa;return la.substring(ya,fa)}function U(la){la=W(la,4);return la.charCodeAt(3)+(la.charCodeAt(2)<<8)+(la.charCodeAt(1)<<16)+(la.charCodeAt(0)<<24)}function Y(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(W(k,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=T&&T();else if(W(k,4),"IHDR"!=W(k,4))null!=T&&T();else{W(k,17);T=k.substring(0,fa);do{var na=U(k);if("IDAT"==W(k,4)){T=k.substring(0,fa-8);"pHYs"==v&&"dpi"==I?(I=Math.round(N/.0254),I=Y(I)+Y(I)+String.fromCharCode(1)):I=I+String.fromCharCode(0)+("zTXt"==v?String.fromCharCode(0):"")+N;N=4294967295;N=Editor.updateCRC(N,v,0,4);N=Editor.updateCRC(N,I,0,I.length);T+=Y(I.length)+ +v+I+Y(N^4294967295);T+=k.substring(fa-8,k.length);break}T+=k.substring(fa-8,fa-4+na);W(k,na);W(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 J=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(k,v){J.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 I=null;null!=k.editor.graph.getModel().getParent(v)?I=v.getId():null!=k.currentPage&&(I=k.currentPage.getId());return I});if(null!=window.StyleFormatPanel){var D=Format.prototype.init;Format.prototype.init=function(){D.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)}; +var P=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?P.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isMathOptionVisible=function(k){return"simple"==Editor.currentTheme||"sketch"==Editor.currentTheme||"min"==Editor.currentTheme};var c=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(k){k=c.apply(this,arguments);var v=this.editorUi,I=v.editor.graph; +if(I.isEnabled()){var N=v.getCurrentFile();null!=N&&N.isAutosaveOptional()&&k.appendChild(this.createOption(mxResources.get("autosave"),function(){return v.editor.autosave},function(W){v.editor.setAutosave(W);v.editor.autosave&&N.isModified()&&N.fileChanged()},{install:function(W){this.listener=function(){W(v.editor.autosave)};v.editor.addListener("autosaveChanged",this.listener)},destroy:function(){v.editor.removeListener(this.listener)}}))}if(this.isMathOptionVisible()&&I.isEnabled()&&"undefined"!== +typeof MathJax){var T=this.createOption(mxResources.get("mathematicalTypesetting"),function(){return I.mathEnabled},function(W){v.actions.get("mathematicalTypesetting").funct()},{install:function(W){this.listener=function(){W(I.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&&0Ea.size&&(X=X.slice(0,Ea.size));za=X.join(",");null!=Ea.countProperty&&(ya.setCellStyles(Ea.countProperty,X.length, +ya.getSelectionCells()),Q.push(Ea.countProperty),R.push(X.length))}ya.setCellStyles(Qa,za,ya.getSelectionCells());Q.push(Qa);R.push(za);if(null!=Ea.dependentProps)for(Qa=0;Qaza)pa=pa.slice(0,za);else for(var xa=pa.length;xaEa.max&&(Ta=Ea.max);var Za=null;try{Za="numbers"==X?Ta.match(/\d+/g).map(Number).join(" "):encodeURIComponent(("int"==X?parseInt(Ta):Ta)+"")}catch(Pa){}T(Qa,Za,Ea,null,Oa)}var Va=mxEvent.getSource(ua);if(!(Va!=ja&&Va!=ra||mxEvent.isConsumed(ua))){ra.innerHTML="";var Oa=document.createElement("input");W(ra,Oa);Oa.value=decodeURIComponent(za);Oa.className="gePropEditor";"int"!=X&&"float"!=X||Ea.allowAuto||(Oa.type="number",Oa.step="int"==X?"1":"any",null!= +Ea.min&&(Oa.min=parseFloat(Ea.min)),null!=Ea.max&&(Oa.max=parseFloat(Ea.max)));ra.appendChild(Oa);mxEvent.addListener(Oa,"keypress",function(Ta){13==Ta.keyCode&&Ka()});Oa.focus();mxEvent.addListener(Oa,"blur",function(){Ka()})}}))}Ea.isDeletable&&(Q=mxUtils.button("-",mxUtils.bind(qa,function(ua){T(Qa,"",Ea,Ea.index);mxEvent.consume(ua)})),Q.style.height="16px",Q.style.width="25px",Q.style.float="right",Q.className="geColorBtn",ja.appendChild(Q));ia.appendChild(ja);return ia}var qa=this,ya=this.editorUi.editor.graph, +wa=[],Ia=document.createElement("table");Ia.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 Qa=Ia.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 B=k.childNodes[Ea],Q=B.nodeName.toUpperCase();"INPUT"!=Q&&"SELECT"!=Q||k.removeChild(B)}catch(R){}}else Ba.style.backgroundImage="url('"+Editor.arrowDownImage+"')",za="";for(Ea=0;Ea=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 sa=mxUtils.getLightDarkColor(Ba.fill);Ga.style.backgroundImage="linear-gradient(to right bottom, "+sa.cssText+" 50%, "+sa.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:(sa=mxUtils.getLightDarkColor(Ba.stroke),Ga.style.border=Ma+" "+sa.cssText,Ga.style.borderRightColor=sa.light,Ga.style.borderBottomColor=Ga.style.borderRightColor);null!=Ba.title&&Ga.setAttribute("title",Ba.title)}else Ma=mxUtils.getValue(wa,mxConstants.STYLE_FILLCOLOR,"#ffffff"),sa=mxUtils.getValue(wa,mxConstants.STYLE_STROKECOLOR,"#000000"),Ga.style.backgroundColor=Ma,Ga.style.border="1px solid "+sa; +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=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(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 I=Graph.fontMapping[v];null==I&&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==I&&(I='@font-face {\nfont-family: "'+k+'";\nsrc: url("'+v+'");\n}'),k=document.createElement("style"),mxUtils.write(k,I));return k};Graph.addRecentCustomFont=function(k,v){};Graph.addFont=function(k,v,I,N){if(null!=k&&0mxUtils.indexOf(Y.hiddenTags,Ca),Na=document.createElement("tr"),Sa=document.createElement("td");Sa.style.align="center";Sa.style.width="16px";var Ua=document.createElement("img");Ua.setAttribute("src",va?Editor.visibleImage:Editor.hiddenImage);Ua.setAttribute("title",mxResources.get(va?"hideIt": +"show",[Ca]));mxUtils.setOpacity(Ua,va?75:25);Ua.className="geAdaptiveAsset";Ua.style.verticalAlign="middle";Ua.style.cursor="pointer";Ua.style.width="16px";if(v||Editor.isDarkMode())Ua.style.filter="invert(100%)";Sa.appendChild(Ua);mxEvent.addListener(Ua,"click",function(za){mxEvent.isShiftDown(za)?W(0<=mxUtils.indexOf(Y.hiddenTags,Ca)):(Y.toggleHiddenTag(Ca),T(),Y.refresh());mxEvent.consume(za)});Na.appendChild(Sa);Sa=document.createElement("td");Sa.style.align="center";Sa.style.width="16px";Ua= +document.createElement("img");Ua.setAttribute("src",Editor.selectImage);Ua.setAttribute("title",mxResources.get("select"));mxUtils.setOpacity(Ua,va?75:25);Ua.className="geAdaptiveAsset";Ua.style.verticalAlign="middle";Ua.style.cursor="pointer";Ua.style.width="16px";if(v||Editor.isDarkMode())Ua.style.filter="invert(100%)";mxEvent.addListener(Ua,"click",function(za){W(!0);Da();mxEvent.consume(za)});Sa.appendChild(Ua);Na.appendChild(Sa);Sa=document.createElement("td");Sa.style.overflow="hidden";Sa.style.whiteSpace= +"nowrap";Sa.style.textOverflow="ellipsis";Sa.style.verticalAlign="middle";Sa.style.cursor="pointer";Sa.setAttribute("title",Ca);a=document.createElement("a");mxUtils.write(a,Ca);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,va?100:40);Sa.appendChild(a);mxEvent.addListener(Sa,"click",function(za){if(mxEvent.isShiftDown(za))W(!0),Da();else if(va&&0mxUtils.indexOf(fa,Aa[Ba])&&fa.push(Aa[Ba]);fa.sort();Y.isSelectionEmpty()?U(fa):U(fa,Y.getCommonTagsForCells(Y.getSelectionCells()))}}); +Y.selectionModel.addListener(mxEvent.CHANGE,qa);Y.model.addListener(mxEvent.CHANGE,qa);Y.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(Y.isEnabled()){la.style.bottom="32px";var wa=document.createElement("a");wa.className="geButton";var Ia=wa.cloneNode(!1);Ia.style.backgroundImage="url("+Editor.visibleImage+")";Ia.setAttribute("title",mxResources.get("reset"));mxEvent.addListener(Ia,"click",function(Aa){Y.setHiddenTags([]);mxEvent.isShiftDown(Aa)||(fa=Y.hiddenTags.slice());T();Y.refresh();mxEvent.consume(Aa)});ya.appendChild(Ia);null!=I&&(wa=wa.cloneNode(!1),wa.style.backgroundImage="url("+Editor.plusImage+")",wa.setAttribute("title", +mxResources.get("add")),mxEvent.addListener(wa,"click",function(Aa){I(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 I=Graph.customFontElements[v];k.push({name:I.name,url:I.url})}return k};Graph.prototype.setFont=function(k,v){Graph.addFont(k,v);var I=Editor.guid();document.execCommand("fontname", +!1,I);for(var N=this.cellEditor.textarea.getElementsByTagName("font"),T=!1,W=0;W'+mxUtils.htmlEntities(k)+ +""};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 I=k.view.scale, +N=this.createEnumerationValue(k);k=this.graph.model.isVertex(k.cell)?new mxRectangle(k.x+k.width-4*I,k.y+4*I,0,0):mxRectangle.fromPoint(k.view.getPoint(k));v.bounds.equals(k)&&v.value==N&&v.scale==I||(v.bounds=k,v.value=N,v.scale=I,v.redraw())}};var aa=Graph.prototype.refresh;Graph.prototype.refresh=function(){this.refreshBackgroundImage();aa.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,I){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&& +window.clearTimeout(this.pendingWaitThread),null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var N=!1,T=0,W=0,U=mxUtils.bind(this,function(){N||(N=!0,this.model.beginUpdate())}),Y=mxUtils.bind(this,function(){N&&(N=!1,this.model.endUpdate())}),fa=mxUtils.bind(this,function(){0mxUtils.indexOf(qa.tags.visible, +Aa[wa])&&0>mxUtils.indexOf(Ia,Aa[wa])&&Ia.push(Aa[wa])}null!=Ia&&this.setHiddenTags(Ia);this.refresh()}0k.excludeCells.indexOf(v[N].id)&&I.push(v[N]);v=I}return v};Graph.prototype.getCellsById=function(k){var v=[];if(null!=k)for(var I=0;Iv?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;vmxUtils.indexOf(this.hiddenTags,k[v]))return!1;return!0};Graph.prototype.getCellsForTags=function(k,v,I,N){var T=[];if(null!=k){v=null!=v?v:this.model.getDescendants(this.model.getRoot());for(var W=0,U={},Y=0;Y=k.length)){for(var la= +na=0;lamxUtils.indexOf(T,Y)&&(N=0?-=[];'./,\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:{useWidth:1E3,useMaxWidth:!0,titleTopMargin:25, +barHeight:20,barGap:4,topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};EditorUi.logError=function(c,g,m,n,x,F,H){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(":")&&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{H||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=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("<mxfile ");if(0<=m){var n=c.lastIndexOf("</mxfile>");n>m&&(g=c.substring(m,n+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/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(H){}return g};EditorUi.prototype.validateFileData= +function(c){if(null!=c&&0');0<=g&&(c=c.slice(0,g)+''+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\n':">")+"\n\n"+(null==x?null!=m?""+mxUtils.htmlEntities(m)+"\n":"":"draw.io\n")+(null!=x?'\n":"")+"\n':">")+'\n
\n
'+n+"
\n
\n"+(null==x?'