ddb6360152
Former-commit-id: f0047dcbca
1868 lines
No EOL
850 KiB
JavaScript
1868 lines
No EOL
850 KiB
JavaScript
(function(){var a=void 0,b=!0,c=null,d=!1,e=["aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkturquoise darkviolet deeppink deepskyblue dimgray dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray green greenyellow honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgreen lightgrey lightpink lightsalmon lightseagreen lightskyblue lightslategray lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray snow springgreen steelblue tan teal thistle tomato transparent turquoise violet wheat white whitesmoke yellow yellowgreen".split(" "),
|
|
"all-scroll col-resize crosshair default e-resize hand help move n-resize ne-resize no-drop not-allowed nw-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait".split(" "),"armenian decimal decimal-leading-zero disc georgian lower-alpha lower-greek lower-latin lower-roman square upper-alpha upper-latin upper-roman".split(" "),"100 200 300 400 500 600 700 800 900 bold bolder lighter".split(" "),"block-level inline-level table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group".split(" "),
|
|
"condensed expanded extra-condensed extra-expanded narrower semi-condensed semi-expanded ultra-condensed ultra-expanded wider".split(" "),"inherit inline inline-block inline-box inline-flex inline-grid inline-list-item inline-stack inline-table run-in".split(" "),"behind center-left center-right far-left far-right left-side leftwards right-side rightwards".split(" "),"large larger small smaller x-large x-small xx-large xx-small".split(" "),"dashed dotted double groove outset ridge solid".split(" "),
|
|
"ease ease-in ease-in-out ease-out linear step-end step-start".split(" "),"at closest-corner closest-side ellipse farthest-corner farthest-side".split(" "),"baseline middle sub super text-bottom text-top".split(" "),"caption icon menu message-box small-caption status-bar".split(" "),"fast faster slow slower x-fast x-slow".split(" "),["above","below","higher","level","lower"],["cursive","fantasy","monospace","sans-serif","serif"],["loud","silent","soft","x-loud","x-soft"],["no-repeat","repeat-x","repeat-y",
|
|
"round","space"],["blink","line-through","overline","underline"],["block","flex","grid","table"],["high","low","x-high","x-low"],["nowrap","pre","pre-line","pre-wrap"],["absolute","relative","static"],["alternate","alternate-reverse","reverse"],["border-box","content-box","padding-box"],["capitalize","lowercase","uppercase"],["child","female","male"],["\x3d","opacity"],["backwards","forwards"],["bidi-override","embed"],["bottom","top"],["break-all","keep-all"],["clip","ellipsis"],["contain","cover"],
|
|
["continuous","digits"],["end","start"],["flat","preserve-3d"],["hide","show"],["horizontal","vertical"],["inside","outside"],["italic","oblique"],["left","right"],["ltr","rtl"],["no-content","no-display"],["paused","running"],["suppress","unrestricted"],["thick","thin"],[","],["/"],["all"],["always"],["auto"],["avoid"],["both"],["break-word"],["center"],["circle"],["code"],["collapse"],["contents"],["fixed"],["hidden"],["infinite"],["inset"],["invert"],["justify"],["list-item"],["local"],["medium"],
|
|
["mix"],["none"],["normal"],["once"],["repeat"],["scroll"],["separate"],["small-caps"],["spell-out"],["to"],["visible"]],f={animation:{cssPropBits:517,cssLitGroup:[e[10],e[24],e[29],e[45],e[48],e[54],e[63],e[71],e[72]],cssFns:["cubic-bezier()","steps()"]},"animation-delay":{cssPropBits:5,cssLitGroup:[e[48]],cssFns:[]},"animation-direction":{cssPropBits:0,cssLitGroup:[e[24],e[48],e[72]],cssFns:[]},"animation-duration":"animation-delay","animation-fill-mode":{cssPropBits:0,cssLitGroup:[e[29],e[48],
|
|
e[54],e[71]],cssFns:[]},"animation-iteration-count":{cssPropBits:5,cssLitGroup:[e[48],e[63]],cssFns:[]},"animation-name":{cssPropBits:512,cssLitGroup:[e[48],e[71]],cssFns:[]},"animation-play-state":{cssPropBits:0,cssLitGroup:[e[45],e[48]],cssFns:[]},"animation-timing-function":{cssPropBits:0,cssLitGroup:[e[10],e[48]],cssFns:["cubic-bezier()","steps()"]},appearance:{cssPropBits:0,cssLitGroup:[e[71]],cssFns:[]},azimuth:{cssPropBits:5,cssLitGroup:[e[7],e[42],e[56]],cssFns:[]},"backface-visibility":{cssPropBits:0,
|
|
cssLitGroup:[e[59],e[62],e[80]],cssFns:[]},background:{cssPropBits:23,cssLitGroup:[e[0],e[18],e[25],e[31],e[34],e[42],e[48],e[49],e[52],e[56],e[61],e[68],e[71],e[74],e[75]],cssFns:"image() linear-gradient() radial-gradient() repeating-linear-gradient() repeating-radial-gradient() rgb() rgba()".split(" ")},"background-attachment":{cssPropBits:0,cssLitGroup:[e[48],e[61],e[68],e[75]],cssFns:[]},"background-color":{cssPropBits:2,cssLitGroup:[e[0]],cssFns:["rgb()","rgba()"]},"background-image":{cssPropBits:16,
|
|
cssLitGroup:[e[48],e[71]],cssFns:["image()","linear-gradient()","radial-gradient()","repeating-linear-gradient()","repeating-radial-gradient()"]},"background-position":{cssPropBits:5,cssLitGroup:[e[31],e[42],e[48],e[56]],cssFns:[]},"background-repeat":{cssPropBits:0,cssLitGroup:[e[18],e[48],e[74]],cssFns:[]},"background-size":{cssPropBits:5,cssLitGroup:[e[34],e[48],e[52]],cssFns:[]},border:{cssPropBits:7,cssLitGroup:[e[0],e[9],e[47],e[62],e[64],e[69],e[71]],cssFns:["rgb()","rgba()"]},"border-bottom":"border",
|
|
"border-bottom-color":"background-color","border-bottom-left-radius":{cssPropBits:5,cssFns:[]},"border-bottom-right-radius":"border-bottom-left-radius","border-bottom-style":{cssPropBits:0,cssLitGroup:[e[9],e[62],e[64],e[71]],cssFns:[]},"border-bottom-width":{cssPropBits:5,cssLitGroup:[e[47],e[69]],cssFns:[]},"border-collapse":{cssPropBits:0,cssLitGroup:[e[59],e[76]],cssFns:[]},"border-color":"background-color","border-left":"border","border-left-color":"background-color","border-left-style":"border-bottom-style",
|
|
"border-left-width":"border-bottom-width","border-radius":{cssPropBits:5,cssLitGroup:[e[49]],cssFns:[]},"border-right":"border","border-right-color":"background-color","border-right-style":"border-bottom-style","border-right-width":"border-bottom-width","border-spacing":"border-bottom-left-radius","border-style":"border-bottom-style","border-top":"border","border-top-color":"background-color","border-top-left-radius":"border-bottom-left-radius","border-top-right-radius":"border-bottom-left-radius",
|
|
"border-top-style":"border-bottom-style","border-top-width":"border-bottom-width","border-width":"border-bottom-width",bottom:{cssPropBits:5,cssLitGroup:[e[52]],cssFns:[]},box:{cssPropBits:0,cssLitGroup:[e[60],e[71],e[72]],cssFns:[]},"box-shadow":{cssPropBits:7,cssLitGroup:[e[0],e[48],e[64],e[71]],cssFns:["rgb()","rgba()"]},"box-sizing":{cssPropBits:0,cssLitGroup:[e[25]],cssFns:[]},"caption-side":{cssPropBits:0,cssLitGroup:[e[31]],cssFns:[]},clear:{cssPropBits:0,cssLitGroup:[e[42],e[54],e[71]],cssFns:[]},
|
|
clip:{cssPropBits:0,cssLitGroup:[e[52]],cssFns:["rect()"]},color:"background-color",content:{cssPropBits:8,cssLitGroup:[e[71],e[72]],cssFns:[]},cue:{cssPropBits:16,cssLitGroup:[e[71]],cssFns:[]},"cue-after":"cue","cue-before":"cue",cursor:{cssPropBits:16,cssLitGroup:[e[1],e[48],e[52]],cssFns:[]},direction:{cssPropBits:0,cssLitGroup:[e[43]],cssFns:[]},display:{cssPropBits:0,cssLitGroup:[e[4],e[6],e[20],e[52],e[67],e[71]],cssFns:[]},"display-extras":{cssPropBits:0,cssLitGroup:[e[67],e[71]],cssFns:[]},
|
|
"display-inside":{cssPropBits:0,cssLitGroup:[e[20],e[52]],cssFns:[]},"display-outside":{cssPropBits:0,cssLitGroup:[e[4],e[71]],cssFns:[]},elevation:{cssPropBits:5,cssLitGroup:[e[15]],cssFns:[]},"empty-cells":{cssPropBits:0,cssLitGroup:[e[38]],cssFns:[]},filter:{cssPropBits:0,cssFns:["alpha()"]},"float":{cssPropBits:0,cssLitGroup:[e[42],e[71]],cssFns:[]},font:{cssPropBits:73,cssLitGroup:[e[3],e[8],e[13],e[16],e[41],e[48],e[49],e[69],e[72],e[77]],cssFns:[]},"font-family":{cssPropBits:72,cssLitGroup:[e[16],
|
|
e[48]],cssFns:[]},"font-size":{cssPropBits:1,cssLitGroup:[e[8],e[69]],cssFns:[]},"font-stretch":{cssPropBits:0,cssLitGroup:[e[5],e[72]],cssFns:[]},"font-style":{cssPropBits:0,cssLitGroup:[e[41],e[72]],cssFns:[]},"font-variant":{cssPropBits:0,cssLitGroup:[e[72],e[77]],cssFns:[]},"font-weight":{cssPropBits:0,cssLitGroup:[e[3],e[72]],cssFns:[]},height:"bottom",left:"bottom","letter-spacing":{cssPropBits:5,cssLitGroup:[e[72]],cssFns:[]},"line-height":{cssPropBits:1,cssLitGroup:[e[72]],cssFns:[]},"list-style":{cssPropBits:16,
|
|
cssLitGroup:[e[2],e[40],e[57],e[71]],cssFns:["image()","linear-gradient()","radial-gradient()","repeating-linear-gradient()","repeating-radial-gradient()"]},"list-style-image":{cssPropBits:16,cssLitGroup:[e[71]],cssFns:["image()","linear-gradient()","radial-gradient()","repeating-linear-gradient()","repeating-radial-gradient()"]},"list-style-position":{cssPropBits:0,cssLitGroup:[e[40]],cssFns:[]},"list-style-type":{cssPropBits:0,cssLitGroup:[e[2],e[57],e[71]],cssFns:[]},margin:"bottom","margin-bottom":"bottom",
|
|
"margin-left":"bottom","margin-right":"bottom","margin-top":"bottom","max-height":{cssPropBits:1,cssLitGroup:[e[52],e[71]],cssFns:[]},"max-width":"max-height","min-height":{cssPropBits:1,cssLitGroup:[e[52]],cssFns:[]},"min-width":"min-height",opacity:{cssPropBits:1,cssFns:[]},outline:{cssPropBits:7,cssLitGroup:[e[0],e[9],e[47],e[62],e[64],e[65],e[69],e[71]],cssFns:["rgb()","rgba()"]},"outline-color":{cssPropBits:2,cssLitGroup:[e[0],e[65]],cssFns:["rgb()","rgba()"]},"outline-style":"border-bottom-style",
|
|
"outline-width":"border-bottom-width",overflow:{cssPropBits:0,cssLitGroup:[e[52],e[62],e[75],e[80]],cssFns:[]},"overflow-wrap":{cssPropBits:0,cssLitGroup:[e[55],e[72]],cssFns:[]},"overflow-x":{cssPropBits:0,cssLitGroup:[e[44],e[52],e[62],e[75],e[80]],cssFns:[]},"overflow-y":"overflow-x",padding:"opacity","padding-bottom":"opacity","padding-left":"opacity","padding-right":"opacity","padding-top":"opacity","page-break-after":{cssPropBits:0,cssLitGroup:[e[42],e[51],e[52],e[53]],cssFns:[]},"page-break-before":"page-break-after",
|
|
"page-break-inside":{cssPropBits:0,cssLitGroup:[e[52],e[53]],cssFns:[]},pause:"border-bottom-left-radius","pause-after":"border-bottom-left-radius","pause-before":"border-bottom-left-radius",perspective:{cssPropBits:5,cssLitGroup:[e[71]],cssFns:[]},"perspective-origin":{cssPropBits:5,cssLitGroup:[e[31],e[42],e[56]],cssFns:[]},pitch:{cssPropBits:5,cssLitGroup:[e[21],e[69]],cssFns:[]},"pitch-range":"border-bottom-left-radius","play-during":{cssPropBits:16,cssLitGroup:[e[52],e[70],e[71],e[74]],cssFns:[]},
|
|
position:{cssPropBits:0,cssLitGroup:[e[23]],cssFns:[]},quotes:{cssPropBits:8,cssLitGroup:[e[71]],cssFns:[]},resize:{cssPropBits:0,cssLitGroup:[e[39],e[54],e[71]],cssFns:[]},richness:"border-bottom-left-radius",right:"bottom",speak:{cssPropBits:0,cssLitGroup:[e[71],e[72],e[78]],cssFns:[]},"speak-header":{cssPropBits:0,cssLitGroup:[e[51],e[73]],cssFns:[]},"speak-numeral":{cssPropBits:0,cssLitGroup:[e[35]],cssFns:[]},"speak-punctuation":{cssPropBits:0,cssLitGroup:[e[58],e[71]],cssFns:[]},"speech-rate":{cssPropBits:5,
|
|
cssLitGroup:[e[14],e[69]],cssFns:[]},stress:"border-bottom-left-radius","table-layout":{cssPropBits:0,cssLitGroup:[e[52],e[61]],cssFns:[]},"text-align":{cssPropBits:0,cssLitGroup:[e[42],e[56],e[66]],cssFns:[]},"text-decoration":{cssPropBits:0,cssLitGroup:[e[19],e[71]],cssFns:[]},"text-indent":"border-bottom-left-radius","text-overflow":{cssPropBits:8,cssLitGroup:[e[33]],cssFns:[]},"text-shadow":"box-shadow","text-transform":{cssPropBits:0,cssLitGroup:[e[26],e[71]],cssFns:[]},"text-wrap":{cssPropBits:0,
|
|
cssLitGroup:[e[46],e[71],e[72]],cssFns:[]},top:"bottom",transform:{cssPropBits:0,cssLitGroup:[e[71]],cssFns:"matrix() perspective() rotate() rotate3d() rotatex() rotatey() rotatez() scale() scale3d() scalex() scaley() scalez() skew() skewx() skewy() translate() translate3d() translatex() translatey() translatez()".split(" ")},"transform-origin":"perspective-origin","transform-style":{cssPropBits:0,cssLitGroup:[e[37]],cssFns:[]},transition:{cssPropBits:1029,cssLitGroup:[e[10],e[48],e[50],e[71]],cssFns:["cubic-bezier()",
|
|
"steps()"]},"transition-delay":"animation-delay","transition-duration":"animation-delay","transition-property":{cssPropBits:1024,cssLitGroup:[e[48],e[50]],cssFns:[]},"transition-timing-function":"animation-timing-function","unicode-bidi":{cssPropBits:0,cssLitGroup:[e[30],e[72]],cssFns:[]},"vertical-align":{cssPropBits:5,cssLitGroup:[e[12],e[31]],cssFns:[]},visibility:"backface-visibility","voice-family":{cssPropBits:8,cssLitGroup:[e[27],e[48]],cssFns:[]},volume:{cssPropBits:1,cssLitGroup:[e[17],e[69]],
|
|
cssFns:[]},"white-space":{cssPropBits:0,cssLitGroup:[e[22],e[72]],cssFns:[]},width:"min-height","word-break":{cssPropBits:0,cssLitGroup:[e[32],e[72]],cssFns:[]},"word-spacing":"letter-spacing","word-wrap":"overflow-wrap","z-index":"bottom",zoom:"line-height","cubic-bezier()":"animation-delay","steps()":{cssPropBits:5,cssLitGroup:[e[36],e[48]],cssFns:[]},"image()":{cssPropBits:18,cssLitGroup:[e[0],e[48]],cssFns:["rgb()","rgba()"]},"linear-gradient()":{cssPropBits:7,cssLitGroup:[e[0],e[31],e[42],e[48],
|
|
e[79]],cssFns:["rgb()","rgba()"]},"radial-gradient()":{cssPropBits:7,cssLitGroup:[e[0],e[11],e[31],e[42],e[48],e[56],e[57]],cssFns:["rgb()","rgba()"]},"repeating-linear-gradient()":"linear-gradient()","repeating-radial-gradient()":"radial-gradient()","rgb()":{cssPropBits:1,cssLitGroup:[e[48]],cssFns:[]},"rgba()":"rgb()","rect()":{cssPropBits:5,cssLitGroup:[e[48],e[52]],cssFns:[]},"alpha()":{cssPropBits:1,cssLitGroup:[e[28]],cssFns:[]},"matrix()":"animation-delay","perspective()":"border-bottom-left-radius",
|
|
"rotate()":"border-bottom-left-radius","rotate3d()":"animation-delay","rotatex()":"border-bottom-left-radius","rotatey()":"border-bottom-left-radius","rotatez()":"border-bottom-left-radius","scale()":"animation-delay","scale3d()":"animation-delay","scalex()":"border-bottom-left-radius","scaley()":"border-bottom-left-radius","scalez()":"border-bottom-left-radius","skew()":"animation-delay","skewx()":"border-bottom-left-radius","skewy()":"border-bottom-left-radius","translate()":"animation-delay","translate3d()":"animation-delay",
|
|
"translatex()":"border-bottom-left-radius","translatey()":"border-bottom-left-radius","translatez()":"border-bottom-left-radius"},g;for(g in f)"string"===typeof f[g]&&Object.hasOwnProperty.call(f,g)&&(f[g]=f[f[g]]);"undefined"!==typeof window&&(window.cssSchema=f);var h,k;(function(){function a(b){var c=parseInt(b.substring(1),16);return 65535<c?(c-=65536,String.fromCharCode(55296+(c>>10),56320+(c&1023))):c==c?String.fromCharCode(c):" ">b[1]?"":b[1]}function b(a,c){return'"'+a.replace(/[\u0000-\u001f\\\"<>]/g,
|
|
c)+'"'}function c(a){return e[a]||(e[a]="\\"+a.charCodeAt(0).toString(16)+" ")}function d(a){return f[a]||(f[a]=("\u0010">a?"%0":"%")+a.charCodeAt(0).toString(16))}var e={"\\":"\\\\"},f={"\\":"%5c"},g=RegExp("\\uFEFF|U[+][0-9A-F?]{1,6}(?:-[0-9A-F]{1,6})?|url[(][\\t\\n\\f ]*(?:\"(?:'|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*\"|'(?:\"|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*'|(?:[\\t\\x21\\x23-\\x26\\x28-\\x5b\\x5d-\\x7e]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*)[\\t\\n\\f ]*[)]|(?!url[(])-?(?:[a-zA-Z_]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))(?:[a-zA-Z0-9_-]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*[(]|(?:@?-?(?:[a-zA-Z_]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))|#)(?:[a-zA-Z0-9_-]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*|\"(?:'|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*\"|'(?:\"|[^'\"\\n\\f\\\\]|\\\\[\\s\\S])*'|[-+]?(?:[0-9]+(?:[.][0-9]+)?|[.][0-9]+)(?:%|-?(?:[a-zA-Z_]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))(?:[a-zA-Z0-9_-]|[\\u0080-\\ud7ff\\ue000-\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]|\\\\(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff]))*)?|\x3c!--|--\x3e|[\\t\\n\\f ]+|/(?:[*][^*]*[*]+(?:[^/][^*]*[*]+)*/|/[^\\n\\f]*)|[~|^$*]\x3d|[^\"'\\\\/]|/(?![/*])",
|
|
"gi"),m=RegExp("\\\\(?:(?:[0-9a-fA-F]{1,6}[\\t\\n\\f ]?|[\\u0020-\\u007e\\u0080-\\ud7ff\\ue000\\ufffd]|[\\ud800-\\udbff][\\udc00-\\udfff])|[\\n\\f])","g"),l=RegExp("^url\\([\\t\\n\\f ]*[\"']?|[\"']?[\\t\\n\\f ]*\\)$","gi");k=function(b){return b.replace(m,a)};h=function(a){a=(""+a).replace(/\r\n?/g,"\n").match(g)||[];for(var e=0,f=" ",h=0,m=a.length;h<m;++h){var n=k(a[h]),p=n.length,q=n.charCodeAt(0),n=34==q||39==q?b(n.substring(1,p-1),c):47==q&&1<p||"\\"==n||"--\x3e"==n||"\x3c!--"==n||"\ufeff"==
|
|
n||32>=q?" ":/url\(/i.test(n)?"url("+b(n.replace(l,""),d)+")":n;if(f!=n||" "!=n)a[e++]=f=n}a.length=e;return a}})();"undefined"!==typeof window&&(window.lexCss=h,window.decodeCss=k);var m=function(){function a(b){b=(""+b).match(l);return!b?c:new g(h(b[1]),h(b[2]),h(b[3]),h(b[4]),h(b[5]),h(b[6]),h(b[7]))}function b(a,e){return"string"==typeof a?encodeURI(a).replace(e,d):c}function d(a){a=a.charCodeAt(0);return"%"+"0123456789ABCDEF".charAt(a>>4&15)+"0123456789ABCDEF".charAt(a&15)}function e(a){if(a===
|
|
c)return c;a=a.replace(/(^|\/)\.(?:\/|$)/g,"$1").replace(/\/{2,}/g,"/");for(var b=k,d;(d=a.replace(b,"$1"))!=a;a=d);return a}function f(a,b){var c=a.T(),d=b.K();d?c.ga(b.j):d=b.X();d?c.da(b.n):d=b.Y();d?c.ea(b.k):d=b.$();var g=b.g,h=e(g);if(d)c.ca(b.V()),h=h&&h.replace(m,"");else if(d=!!g){if(47!==h.charCodeAt(0))var h=e(c.g||"").replace(m,""),k=h.lastIndexOf("/")+1,h=e((k?h.substring(0,k):"")+e(g)).replace(m,"")}else h=h&&h.replace(m,""),h!==g&&c.G(h);d?c.G(h):d=b.aa();d?c.O(b.l):d=b.Z();d&&c.fa(b.o);
|
|
return c}function g(a,b,c,d,e,f,h){this.j=a;this.n=b;this.k=c;this.h=d;this.g=e;this.l=f;this.o=h}function h(a){return"string"==typeof a&&0<a.length?a:c}var k=RegExp(/(\/|^)(?:[^./][^/]*|\.{2,}(?:[^./][^/]*)|\.{3,}[^/]*)\/\.\.(?:\/|$)/),m=/^(?:\.\.\/)*(?:\.\.$)?/;g.prototype.toString=function(){var a=[];c!==this.j&&a.push(this.j,":");c!==this.k&&(a.push("//"),c!==this.n&&a.push(this.n,"@"),a.push(this.k),c!==this.h&&a.push(":",this.h.toString()));c!==this.g&&a.push(this.g);c!==this.l&&a.push("?",
|
|
this.l);c!==this.o&&a.push("#",this.o);return a.join("")};g.prototype.T=function(){return new g(this.j,this.n,this.k,this.h,this.g,this.l,this.o)};g.prototype.W=function(){return this.j&&decodeURIComponent(this.j).toLowerCase()};g.prototype.ga=function(a){this.j=a?a:c};g.prototype.K=function(){return c!==this.j};g.prototype.da=function(a){this.n=a?a:c};g.prototype.X=function(){return c!==this.n};g.prototype.ea=function(a){this.k=a?a:c;this.G(this.g)};g.prototype.Y=function(){return c!==this.k};g.prototype.V=
|
|
function(){return this.h&&decodeURIComponent(this.h)};g.prototype.ca=function(a){if(a){a=Number(a);if(a!==(a&65535))throw Error("Bad port number "+a);this.h=""+a}else this.h=c};g.prototype.$=function(){return c!==this.h};g.prototype.U=function(){return this.g&&decodeURIComponent(this.g)};g.prototype.G=function(a){a?(a=""+a,this.g=!this.k||/^\//.test(a)?a:"/"+a):this.g=c};g.prototype.O=function(a){this.l=a?a:c};g.prototype.aa=function(){return c!==this.l};g.prototype.ba=function(a){if("object"===typeof a&&
|
|
!(a instanceof Array)&&(a instanceof Object||"[object Array]"!==Object.prototype.toString.call(a))){var b=[],c=-1,d;for(d in a){var e=a[d];"string"===typeof e&&(b[++c]=d,b[++c]=e)}a=b}for(var b=[],c="",f=0;f<a.length;)d=a[f++],e=a[f++],b.push(c,encodeURIComponent(d.toString())),c="\x26",e&&b.push("\x3d",encodeURIComponent(e.toString()));this.l=b.join("")};g.prototype.fa=function(a){this.o=a?a:c};g.prototype.Z=function(){return c!==this.o};var l=/^(?:([^:/?#]+):)?(?:\/\/(?:([^/?#]*)@)?([^/?#:@]*)(?::([0-9]+))?)?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/,
|
|
n=/[#\/\?@]/g,p=/[\#\?]/g;g.parse=a;g.create=function(a,e,f,h,k,m,l){a=new g(b(a,n),b(e,n),"string"==typeof f?encodeURIComponent(f):c,0<h?h.toString():c,b(k,p),c,"string"==typeof l?encodeURIComponent(l):c);m&&("string"===typeof m?a.O(m.replace(/[^?&=0-9A-Za-z_\-~.%]/g,d)):a.ba(m));return a};g.N=f;g.ma=e;g.ha={ua:function(b){return/\.html$/.test(a(b).U())?"text/html":"application/javascript"},N:function(b,c){return b?f(a(b),a(c)).toString():""+c}};return g}();"undefined"!==typeof window&&(window.URI=
|
|
m);var l=a,n=a,p=a,r=a;(function(){function e(a){return"string"===typeof a?'url("'+a.replace(F,g)+'")':'url("about:blank")'}function g(a){return H[a]}function h(a,b){return a?m.ha.N(a,b):b}function s(a,b,d){if(!d)return c;var e=(""+a).match(B);return e&&(!e[1]||A.test(e[1]))?d(a,b):c}function K(a){return a.replace(/^-(?:apple|css|epub|khtml|moz|mso?|o|rim|wap|webkit|xv)-(?=[a-z])/,"")}var F=/[\n\f\r\"\'()*<>]/g,H={"\n":"%0a","\f":"%0c","\r":"%0d",'"':"%22","'":"%27","(":"%28",")":"%29","*":"%2a",
|
|
"\x3c":"%3c","\x3e":"%3e"},B=/^(?:([^:/?# ]+):)?/,A=/^(?:https?|mailto|data)$/i;l=function(){var a={};return function T(b,c,d,g,m){b=K(b);var l=f[b];if(!l||"object"!==typeof l)c.length=0;else{for(var n=l.cssPropBits,D=n&80,p=n&1536,q=NaN,r=0,B=0;r<c.length;++r){var A=c[r].toLowerCase(),u=A.charCodeAt(0),J,z,H,S,L,fa;if(32===u)A="";else if(34===u)A=16===D?d?e(s(h(g,k(c[r].substring(1,A.length-1))),b,d)):"":n&8&&!(D&D-1)?A:"";else if("inherit"!==A){if(L=l.cssLitGroup){var ca;if(!(ca=l.cssLitMap)){ca=
|
|
{};for(var U=L.length;0<=--U;)for(var ea=L[U],ia=ea.length;0<=--ia;)ca[ea[ia]]=a;ca=l.cssLitMap=ca}L=ca}else L=a;if(!(fa=L,fa[K(A)]===a))if(35===u&&/^#(?:[0-9a-f]{3}){1,2}$/.test(A))A=n&2?A:"";else if(48<=u&&57>=u)A=n&1?A:"";else if(J=A.charCodeAt(1),z=A.charCodeAt(2),H=48<=J&&57>=J,S=48<=z&&57>=z,43===u&&(H||46===J&&S))A=n&1?(H?"":"0")+A.substring(1):"";else if(45===u&&(H||46===J&&S))A=n&4?(H?"-":"-0")+A.substring(1):n&1?"0":"";else if(46===u&&H)A=n&1?"0"+A:"";else if('url("'===A.substring(0,5))A=
|
|
d&&n&16?e(s(h(g,c[r].substring(5,A.length-2)),b,d)):"";else if("("===A.charAt(A.length-1))a:{L=c;ca=r;A=1;U=ca+1;for(u=L.length;U<u&&A;)ea=L[U++],A+=")"===ea?-1:/^[^"']*\($/.test(ea);if(!A){A=L[ca].toLowerCase();u=K(A);L=L.splice(ca,U-ca,"");ca=l.cssFns;U=0;for(ea=ca.length;U<ea;++U)if(ca[U].substring(0,u.length)==u){L[0]=L[L.length-1]="";T(ca[U],L,d,g);A=A+L.join(" ")+")";break a}}A=""}else A=p&&/^-?[a-z_][\w\-]*$/.test(A)&&!/__$/.test(A)?m&&512===p?c[r]+m:1024===p&&f[A]&&"number"===typeof f[A].oa?
|
|
A:"":/^\w+$/.test(A)&&64===D&&n&8?q+1===B?(c[q]=c[q].substring(0,c[q].length-1)+" "+A+'"',""):(q=B,'"'+A+'"'):""}A&&(c[B++]=A)}1===B&&'url("about:blank")'===c[0]&&(B=0);c.length=B}}}();var D=RegExp("^(active|after|before|blank|checked|default|disabled|drop|empty|enabled|first|first-child|first-letter|first-line|first-of-type|fullscreen|focus|hover|in-range|indeterminate|invalid|last-child|last-of-type|left|link|only-child|only-of-type|optional|out-of-range|placeholder-shown|read-only|read-write|required|right|root|scope|user-error|valid|visited)$"),
|
|
J={};J["\x3e"]=J["+"]=J["~"]=J;n=function(a,e,f){function g(n,p){function G(c,f,g){var h,l,n,p,r,C=b;h="";if(c<f)if(r=a[c],"*"===r)++c,h=r;else if(/^[a-zA-Z]/.test(r)&&(l=m(r.toLowerCase(),[])))"tagName"in l&&(r=l.tagName),++c,h=r;for(p=n=l="";C&&c<f;++c)if(r=a[c],"#"===r.charAt(0))/^#_|__$|[^\w#:\-]/.test(r)?C=d:l+=r+k;else if("."===r)++c<f&&/^[0-9A-Za-z:_\-]+$/.test(r=a[c])&&!/^_|__$/.test(r)?l+="."+r:C=d;else if(c+1<f&&"["===a[c]){++c;var B=a[c++].toLowerCase();r=u.m[h+"::"+B];r!==+r&&(r=u.m["*::"+
|
|
B]);var A;e.ia?(A=e.ia(h,B),"string"!==typeof A&&(C=d,A=B),C&&r!==+r&&(r=u.d.NONE)):(A=B,r!==+r&&(C=d));var t=B="",E=d;/^[~^$*|]?=$/.test(a[c])&&(B=a[c++],t=a[c++],/^[0-9A-Za-z:_\-]+$/.test(t)?t='"'+t+'"':"]"===t&&(t='""',--c),/^"([^\"\\]|\\.)*"$/.test(t)||(C=d),(E="i"===a[c])&&++c);"]"!==a[c]&&(++c,C=d);switch(r){case u.d.CLASSES:case u.d.LOCAL_NAME:case u.d.NONE:break;case u.d.GLOBAL_NAME:case u.d.ID:case u.d.IDREF:("\x3d"===B||"~\x3d"===B||"$\x3d"===B)&&'""'!=t&&!E?t='"'+t.substring(1,t.length-
|
|
1)+k+'"':"|\x3d"===B||""===B||(C=d);break;case u.d.URI:case u.d.URI_FRAGMENT:""!==B&&(C=d);break;default:C=d}C&&(n+="["+A.replace(/[^\w-]/g,"\\$\x26")+B+t+(E?" i]":"]"))}else if(c<f&&":"===a[c])if(r=a[++c],D.test(r))p+=":"+r;else break;else break;c!==f&&(C=d);C&&(c=(h+l).replace(/[^ .*#\w-]/g,"\\$\x26")+n+p+g)&&q.push(c);return C}" "===a[n]&&++n;p-1!==n&&" "===a[p]&&--p;for(var q=[],r=n,B=b,C=n;B&&C<p;++C){var A=a[C];if(J[A]===J||" "===A)G(r,C,A)?r=C+1:B=d}G(r,p,"")||(B=d);return B?(q.length&&(r=
|
|
q.join(""),h!==c&&(r="."+h+" "+r),l.push(r)),b):!f||f(a.slice(n,p))}var h=e.na,k=e.L,m=e.Aa,l=[],n=0,p,G=0,q;for(p=0;p<a.length;++p)if(q=a[p],"("==q||"["==q?(++G,b):")"==q||"]"==q?(G&&--G,b):!(" "==a[p]&&(G||J[a[p-1]]===J||J[a[p+1]]===J)))a[n++]=a[p];a.length=n;n=a.length;for(p=G=0;p<n;++p)if(","===a[p]){if(!g(G,p))return c;G=p+1}return!g(G,n)?c:l};(function(){var a=/^\w/,b=RegExp("^(?:(?:(?:(?:only|not) )?(?:all|aural|braille|embossed|handheld|print|projection|screen|speech|tty|tv)|\\( (?:(?:min-|max-)?(?:(?:device-)?(?:aspect-ratio|height|width)|color(?:-index)?|monochrome|orientation|resolution)|grid|hover|luminosity|pointer|scan|script) (?:: -?(?:[a-z]\\w+(?:-\\w+)*|\\d+(?: / \\d+|(?:\\.\\d+)?(?:p[cxt]|[cem]m|in|dpi|dppx|dpcm|%)?)) )?\\))(?: and ?\\( (?:(?:min-|max-)?(?:(?:device-)?(?:aspect-ratio|height|width)|color(?:-index)?|monochrome|orientation|resolution)|grid|hover|luminosity|pointer|scan|script) (?:: -?(?:[a-z]\\w+(?:-\\w+)*|\\d+(?: / \\d+|(?:\\.\\d+)?(?:p[cxt]|[cem]m|in|dpi|dppx|dpcm|%)?)) )?\\))*)(?: , (?:(?:(?:(?:only|not) )?(?:all|aural|braille|embossed|handheld|print|projection|screen|speech|tty|tv)|\\( (?:(?:min-|max-)?(?:(?:device-)?(?:aspect-ratio|height|width)|color(?:-index)?|monochrome|orientation|resolution)|grid|hover|luminosity|pointer|scan|script) (?:: -?(?:[a-z]\\w+(?:-\\w+)*|\\d+(?: / \\d+|(?:\\.\\d+)?(?:p[cxt]|[cem]m|in|dpi|dppx|dpcm|%)?)) )?\\))(?: and ?\\( (?:(?:min-|max-)?(?:(?:device-)?(?:aspect-ratio|height|width)|color(?:-index)?|monochrome|orientation|resolution)|grid|hover|luminosity|pointer|scan|script) (?:: -?(?:[a-z]\\w+(?:-\\w+)*|\\d+(?: / \\d+|(?:\\.\\d+)?(?:p[cxt]|[cem]m|in|dpi|dppx|dpcm|%)?)) )?\\))*))*$",
|
|
"i");r=function(c){c=c.slice();for(var d=c.length,e=0,f=0;f<d;++f){var g=c[f];" "!=g&&(c[e++]=g)}c.length=e;c=c.join(" ");return!c.length?"":!b.test(c)?"not all":a.test(c)?c:"not all , "+c}})();(function(){function e(a){var b=/^\s*[']([^']*)[']\s*$/,d=/^\s*url\s*[(]["]([^"]*)["][)]\s*$/,f=/^\s*url\s*[(][']([^']*)['][)]\s*$/,g=/^\s*url\s*[(]([^)]*)[)]\s*$/,h;return(h=/^\s*["]([^"]*)["]\s*$/.exec(a))||(h=b.exec(a))||(h=d.exec(a))||(h=f.exec(a))||(h=g.exec(a))?h[1]:c}function f(g,k,m,D,p,B,A){function t(){u=
|
|
E.length&&E[E.length-1]===c}var G=a,C=A||[0],E=[],u=d;q(k,{startStylesheet:function(){G=[]},endStylesheet:function(){},startAtrule:function(a,b){if(u)a=c;else if("@media"===a)G.push("@media"," ",r(b));else if("@keyframes"===a||"@-webkit-keyframes"===a){var d=b[0];1===b.length&&!/__$|[^\w\-]/.test(d)?(G.push(a," ",d+m.L),a="@keyframes"):a=c}else if("@import"===a&&0<b.length)if(a=c,"function"===typeof B){var k=r(b.slice(1));if("not all"!==k){++C[0];var l=[];G.push(l);var n=s(h(g,e(b[0])),function(a){var b=
|
|
f(n,a.qa,m,D,p,B,C);--C[0];a=k?{toString:function(){return"@media "+k+" {"+b.result+"}"}}:b.result;l[0]=a;B(a,!!C[0])},p)}}else window.console&&window.console.log("@import "+b.join(" ")+" elided");u=!a;E.push(a)},endAtrule:function(){E.pop();u||G.push(";");t()},startBlock:function(){u||G.push("{")},endBlock:function(){u||(G.push("}"),u=b)},startRuleset:function(d){if(!u){var e=a;"@keyframes"===E[E.length-1]?(e=d.join(" ").match(/^ *(?:from|to|\d+(?:\.\d+)?%) *(?:, *(?:from|to|\d+(?:\.\d+)?%) *)*$/i),
|
|
u=!e,e&&(e=e[0].replace(/ +/g,""))):(d=n(d,m),!d||!d.length?u=b:e=d.join(", "));u||G.push(e,"{")}E.push(c)},endRuleset:function(){E.pop();u||G.push("}");t()},declaration:function(a,c){if(!u){var e=d,f=c.length;2<=f&&"!"===c[f-2]&&"important"===c[f-1].toLowerCase()&&(e=b,c.length-=2);l(a,c,D,g,m.L);c.length&&G.push(a,":",c.join(" "),e?" !important;":";")}}});return{result:{toString:function(){return G.join("")}},va:!!C[0]}}p=function(b,c,d,e){return f(b,c,d,e,a,a).result.toString()}})()})();"undefined"!==
|
|
typeof window&&(window.sanitizeCssProperty=l,window.sanitizeCssSelectorList=n,window.sanitizeStylesheet=p,window.sanitizeMediaQuery=r);var q,s;(function(){function a(b,d,e,f,g){for(var h=d++;d<e&&"{"!==b[d]&&";"!==b[d];)++d;if(d<e&&(g||";"===b[d])){g=h+1;var k=d;g<e&&" "===b[g]&&++g;k>g&&" "===b[k-1]&&--k;f.startAtrule&&f.startAtrule(b[h].toLowerCase(),b.slice(g,k));d="{"===b[d]?c(b,d,e,f):d+1;f.endAtrule&&f.endAtrule()}return d}function c(b,f,g,h){++f;for(h.startBlock&&h.startBlock();f<g;){var k=
|
|
b[f].charAt(0);if("}"==k){++f;break}f=" "===k||";"===k?f+1:"@"===k?a(b,f,g,h,d):"{"===k?c(b,f,g,h):e(b,f,g,h)}h.endBlock&&h.endBlock();return f}function e(a,c,d,g){var h=c,m=f(a,c,d,b);if(0>m)return m=~m,m===h?m+1:m;var l=a[m];if("{"!==l)return m===h?m+1:m;c=m+1;m>h&&" "===a[m-1]&&--m;for(g.startRuleset&&g.startRuleset(a.slice(h,m));c<d;){l=a[c];if("}"===l){++c;break}c=" "===l?c+1:k(a,c,d,g)}g.endRuleset&&g.endRuleset();return c}function f(a,b,c,d){for(var e,g=[],h=-1;b<c;++b)if(e=a[b].charAt(0),
|
|
"["===e||"("===e)g[++h]=e;else if("]"===e&&"["===g[h]||")"===e&&"("===g[h])--h;else if("{"===e||"}"===e||";"===e||"@"===e||":"===e&&!d)break;0<=h&&(b=~(b+1));return b}function g(a,b,c){for(;b<c&&";"!==a[b]&&"}"!==a[b];)++b;return b<c&&";"===a[b]?b+1:b}function k(a,b,c,e){var h=a[b++];if(!m.test(h))return g(a,b,c);b<c&&" "===a[b]&&++b;if(b==c||":"!==a[b])return g(a,b,c);++b;b<c&&" "===a[b]&&++b;var l=f(a,b,c,d);if(0>l)l=~l;else{for(var n=[],p=0,q=b;q<l;++q)b=a[q]," "!==b&&(n[p++]=b);if(l<c){do{b=a[l];
|
|
if(";"===b||"}"===b)break;p=0}while(++l<c);";"===b&&++l}p&&e.declaration&&e.declaration(h.toLowerCase(),n)}return l}q=function(c,d){var f=h(c);d.startStylesheet&&d.startStylesheet();for(var g=0,k=f.length;g<k;)g=" "===f[g]?g+1:g<k?"@"===f[g].charAt(0)?a(f,g,k,d,b):e(f,g,k,d):g;d.endStylesheet&&d.endStylesheet()};var m=/^-?[a-z]/i;s=function(a,b){for(var c=h(a),d=0,e=c.length;d<e;)d=" "!==c[d]?k(c,d,e,b):d+1}})();"undefined"!==typeof window&&(window.parseCssStylesheet=q,window.parseCssDeclarations=
|
|
s);var u={d:{NONE:0,URI:1,URI_FRAGMENT:11,SCRIPT:2,STYLE:3,HTML:12,ID:4,IDREF:5,IDREFS:6,GLOBAL_NAME:7,LOCAL_NAME:8,CLASSES:9,FRAME_TARGET:10,MEDIA_QUERY:13}};u.atype=u.d;u.m={"*::class":9,"*::dir":0,"*::draggable":0,"*::hidden":0,"*::id":4,"*::inert":0,"*::itemprop":0,"*::itemref":6,"*::itemscope":0,"*::lang":0,"*::onblur":2,"*::onchange":2,"*::onclick":2,"*::ondblclick":2,"*::onerror":2,"*::onfocus":2,"*::onkeydown":2,"*::onkeypress":2,"*::onkeyup":2,"*::onload":2,"*::onmousedown":2,"*::onmousemove":2,
|
|
"*::onmouseout":2,"*::onmouseover":2,"*::onmouseup":2,"*::onreset":2,"*::onscroll":2,"*::onselect":2,"*::onsubmit":2,"*::ontouchcancel":2,"*::ontouchend":2,"*::ontouchenter":2,"*::ontouchleave":2,"*::ontouchmove":2,"*::ontouchstart":2,"*::onunload":2,"*::spellcheck":0,"*::style":3,"*::tabindex":0,"*::title":0,"*::translate":0,"a::accesskey":0,"a::coords":0,"a::href":1,"a::hreflang":0,"a::name":7,"a::onblur":2,"a::onfocus":2,"a::shape":0,"a::target":10,"a::type":0,"area::accesskey":0,"area::alt":0,
|
|
"area::coords":0,"area::href":1,"area::nohref":0,"area::onblur":2,"area::onfocus":2,"area::shape":0,"area::target":10,"audio::controls":0,"audio::loop":0,"audio::mediagroup":5,"audio::muted":0,"audio::preload":0,"audio::src":1,"bdo::dir":0,"blockquote::cite":1,"br::clear":0,"button::accesskey":0,"button::disabled":0,"button::name":8,"button::onblur":2,"button::onfocus":2,"button::type":0,"button::value":0,"canvas::height":0,"canvas::width":0,"caption::align":0,"col::align":0,"col::char":0,"col::charoff":0,
|
|
"col::span":0,"col::valign":0,"col::width":0,"colgroup::align":0,"colgroup::char":0,"colgroup::charoff":0,"colgroup::span":0,"colgroup::valign":0,"colgroup::width":0,"command::checked":0,"command::command":5,"command::disabled":0,"command::icon":1,"command::label":0,"command::radiogroup":0,"command::type":0,"data::value":0,"del::cite":1,"del::datetime":0,"details::open":0,"dir::compact":0,"div::align":0,"dl::compact":0,"fieldset::disabled":0,"font::color":0,"font::face":0,"font::size":0,"form::accept":0,
|
|
"form::action":1,"form::autocomplete":0,"form::enctype":0,"form::method":0,"form::name":7,"form::novalidate":0,"form::onreset":2,"form::onsubmit":2,"form::target":10,"h1::align":0,"h2::align":0,"h3::align":0,"h4::align":0,"h5::align":0,"h6::align":0,"hr::align":0,"hr::noshade":0,"hr::size":0,"hr::width":0,"iframe::align":0,"iframe::frameborder":0,"iframe::height":0,"iframe::marginheight":0,"iframe::marginwidth":0,"iframe::width":0,"img::align":0,"img::alt":0,"img::border":0,"img::height":0,"img::hspace":0,
|
|
"img::ismap":0,"img::name":7,"img::src":1,"img::usemap":11,"img::vspace":0,"img::width":0,"input::accept":0,"input::accesskey":0,"input::align":0,"input::alt":0,"input::autocomplete":0,"input::checked":0,"input::disabled":0,"input::inputmode":0,"input::ismap":0,"input::list":5,"input::max":0,"input::maxlength":0,"input::min":0,"input::multiple":0,"input::name":8,"input::onblur":2,"input::onchange":2,"input::onfocus":2,"input::onselect":2,"input::pattern":0,"input::placeholder":0,"input::readonly":0,
|
|
"input::required":0,"input::size":0,"input::src":1,"input::step":0,"input::type":0,"input::usemap":11,"input::value":0,"ins::cite":1,"ins::datetime":0,"label::accesskey":0,"label::for":5,"label::onblur":2,"label::onfocus":2,"legend::accesskey":0,"legend::align":0,"li::type":0,"li::value":0,"map::name":7,"menu::compact":0,"menu::label":0,"menu::type":0,"meter::high":0,"meter::low":0,"meter::max":0,"meter::min":0,"meter::value":0,"ol::compact":0,"ol::reversed":0,"ol::start":0,"ol::type":0,"optgroup::disabled":0,
|
|
"optgroup::label":0,"option::disabled":0,"option::label":0,"option::selected":0,"option::value":0,"output::for":6,"output::name":8,"p::align":0,"pre::width":0,"progress::max":0,"progress::min":0,"progress::value":0,"q::cite":1,"select::autocomplete":0,"select::disabled":0,"select::multiple":0,"select::name":8,"select::onblur":2,"select::onchange":2,"select::onfocus":2,"select::required":0,"select::size":0,"source::type":0,"table::align":0,"table::bgcolor":0,"table::border":0,"table::cellpadding":0,
|
|
"table::cellspacing":0,"table::frame":0,"table::rules":0,"table::summary":0,"table::width":0,"tbody::align":0,"tbody::char":0,"tbody::charoff":0,"tbody::valign":0,"td::abbr":0,"td::align":0,"td::axis":0,"td::bgcolor":0,"td::char":0,"td::charoff":0,"td::colspan":0,"td::headers":6,"td::height":0,"td::nowrap":0,"td::rowspan":0,"td::scope":0,"td::valign":0,"td::width":0,"textarea::accesskey":0,"textarea::autocomplete":0,"textarea::cols":0,"textarea::disabled":0,"textarea::inputmode":0,"textarea::name":8,
|
|
"textarea::onblur":2,"textarea::onchange":2,"textarea::onfocus":2,"textarea::onselect":2,"textarea::placeholder":0,"textarea::readonly":0,"textarea::required":0,"textarea::rows":0,"textarea::wrap":0,"tfoot::align":0,"tfoot::char":0,"tfoot::charoff":0,"tfoot::valign":0,"th::abbr":0,"th::align":0,"th::axis":0,"th::bgcolor":0,"th::char":0,"th::charoff":0,"th::colspan":0,"th::headers":6,"th::height":0,"th::nowrap":0,"th::rowspan":0,"th::scope":0,"th::valign":0,"th::width":0,"thead::align":0,"thead::char":0,
|
|
"thead::charoff":0,"thead::valign":0,"tr::align":0,"tr::bgcolor":0,"tr::char":0,"tr::charoff":0,"tr::valign":0,"track::default":0,"track::kind":0,"track::label":0,"track::srclang":0,"ul::compact":0,"ul::type":0,"video::controls":0,"video::height":0,"video::loop":0,"video::mediagroup":5,"video::muted":0,"video::poster":1,"video::preload":0,"video::src":1,"video::width":0};u.ATTRIBS=u.m;u.c={OPTIONAL_ENDTAG:1,EMPTY:2,CDATA:4,RCDATA:8,UNSAFE:16,FOLDABLE:32,SCRIPT:64,STYLE:128,VIRTUALIZED:256};u.eflags=
|
|
u.c;u.f={a:0,abbr:0,acronym:0,address:0,applet:272,area:2,article:0,aside:0,audio:0,b:0,base:274,basefont:274,bdi:0,bdo:0,big:0,blockquote:0,body:305,br:2,button:0,canvas:0,caption:0,center:0,cite:0,code:0,col:2,colgroup:1,command:2,data:0,datalist:0,dd:1,del:0,details:0,dfn:0,dialog:272,dir:0,div:0,dl:0,dt:1,em:0,fieldset:0,figcaption:0,figure:0,font:0,footer:0,form:0,frame:274,frameset:272,h1:0,h2:0,h3:0,h4:0,h5:0,h6:0,head:305,header:0,hgroup:0,hr:2,html:305,i:0,iframe:4,img:2,input:2,ins:0,isindex:274,
|
|
kbd:0,keygen:274,label:0,legend:0,li:1,link:274,map:0,mark:0,menu:0,meta:274,meter:0,nav:0,nobr:0,noembed:276,noframes:276,noscript:276,object:272,ol:0,optgroup:0,option:1,output:0,p:1,param:274,pre:0,progress:0,q:0,s:0,samp:0,script:84,section:0,select:0,small:0,source:2,span:0,strike:0,strong:0,style:148,sub:0,summary:0,sup:0,table:0,tbody:1,td:1,textarea:8,tfoot:1,th:1,thead:1,time:0,title:280,tr:1,track:2,tt:0,u:0,ul:0,"var":0,video:0,wbr:2};u.ELEMENTS=u.f;u.Q={a:"HTMLAnchorElement",abbr:"HTMLElement",
|
|
acronym:"HTMLElement",address:"HTMLElement",applet:"HTMLAppletElement",area:"HTMLAreaElement",article:"HTMLElement",aside:"HTMLElement",audio:"HTMLAudioElement",b:"HTMLElement",base:"HTMLBaseElement",basefont:"HTMLBaseFontElement",bdi:"HTMLElement",bdo:"HTMLElement",big:"HTMLElement",blockquote:"HTMLQuoteElement",body:"HTMLBodyElement",br:"HTMLBRElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElement",caption:"HTMLTableCaptionElement",center:"HTMLElement",cite:"HTMLElement",code:"HTMLElement",
|
|
col:"HTMLTableColElement",colgroup:"HTMLTableColElement",command:"HTMLCommandElement",data:"HTMLElement",datalist:"HTMLDataListElement",dd:"HTMLElement",del:"HTMLModElement",details:"HTMLDetailsElement",dfn:"HTMLElement",dialog:"HTMLDialogElement",dir:"HTMLDirectoryElement",div:"HTMLDivElement",dl:"HTMLDListElement",dt:"HTMLElement",em:"HTMLElement",fieldset:"HTMLFieldSetElement",figcaption:"HTMLElement",figure:"HTMLElement",font:"HTMLFontElement",footer:"HTMLElement",form:"HTMLFormElement",frame:"HTMLFrameElement",
|
|
frameset:"HTMLFrameSetElement",h1:"HTMLHeadingElement",h2:"HTMLHeadingElement",h3:"HTMLHeadingElement",h4:"HTMLHeadingElement",h5:"HTMLHeadingElement",h6:"HTMLHeadingElement",head:"HTMLHeadElement",header:"HTMLElement",hgroup:"HTMLElement",hr:"HTMLHRElement",html:"HTMLHtmlElement",i:"HTMLElement",iframe:"HTMLIFrameElement",img:"HTMLImageElement",input:"HTMLInputElement",ins:"HTMLModElement",isindex:"HTMLUnknownElement",kbd:"HTMLElement",keygen:"HTMLKeygenElement",label:"HTMLLabelElement",legend:"HTMLLegendElement",
|
|
li:"HTMLLIElement",link:"HTMLLinkElement",map:"HTMLMapElement",mark:"HTMLElement",menu:"HTMLMenuElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",nav:"HTMLElement",nobr:"HTMLElement",noembed:"HTMLElement",noframes:"HTMLElement",noscript:"HTMLElement",object:"HTMLObjectElement",ol:"HTMLOListElement",optgroup:"HTMLOptGroupElement",option:"HTMLOptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement",param:"HTMLParamElement",pre:"HTMLPreElement",progress:"HTMLProgressElement",q:"HTMLQuoteElement",
|
|
s:"HTMLElement",samp:"HTMLElement",script:"HTMLScriptElement",section:"HTMLElement",select:"HTMLSelectElement",small:"HTMLElement",source:"HTMLSourceElement",span:"HTMLSpanElement",strike:"HTMLElement",strong:"HTMLElement",style:"HTMLStyleElement",sub:"HTMLElement",summary:"HTMLElement",sup:"HTMLElement",table:"HTMLTableElement",tbody:"HTMLTableSectionElement",td:"HTMLTableDataCellElement",textarea:"HTMLTextAreaElement",tfoot:"HTMLTableSectionElement",th:"HTMLTableHeaderCellElement",thead:"HTMLTableSectionElement",
|
|
time:"HTMLTimeElement",title:"HTMLTitleElement",tr:"HTMLTableRowElement",track:"HTMLTrackElement",tt:"HTMLElement",u:"HTMLElement",ul:"HTMLUListElement","var":"HTMLElement",video:"HTMLVideoElement",wbr:"HTMLElement"};u.ELEMENT_DOM_INTERFACES=u.Q;u.P={NOT_LOADED:0,SAME_DOCUMENT:1,NEW_DOCUMENT:2};u.ueffects=u.P;u.J={"a::href":2,"area::href":2,"audio::src":1,"blockquote::cite":0,"command::icon":1,"del::cite":0,"form::action":2,"img::src":1,"input::src":1,"ins::cite":0,"q::cite":0,"video::poster":1,"video::src":1};
|
|
u.URIEFFECTS=u.J;u.M={UNSANDBOXED:2,SANDBOXED:1,DATA:0};u.ltypes=u.M;u.I={"a::href":2,"area::href":2,"audio::src":2,"blockquote::cite":2,"command::icon":1,"del::cite":2,"form::action":2,"img::src":1,"input::src":1,"ins::cite":2,"q::cite":2,"video::poster":1,"video::src":2};u.LOADERTYPES=u.I;"undefined"!==typeof window&&(window.html4=u);e=function(e){function f(a,b){var c;if(N.hasOwnProperty(b))c=N[b];else{var d=b.match(I);c=d?String.fromCharCode(parseInt(d[1],10)):(d=b.match(G))?String.fromCharCode(parseInt(d[1],
|
|
16)):E&&C.test(b)?(E.innerHTML="\x26"+b+";",d=E.textContent,N[b]=d):"\x26"+b+";"}return c}function g(a){return a.replace(R,f)}function h(a){return(""+a).replace(Y,"\x26amp;").replace(W,"\x26lt;").replace(X,"\x26gt;").replace(S,"\x26#34;")}function k(a){return a.replace(Q,"\x26amp;$1").replace(W,"\x26lt;").replace(X,"\x26gt;")}function l(a){var b={z:a.z||a.cdata,A:a.A||a.comment,B:a.B||a.endDoc,t:a.t||a.endTag,e:a.e||a.pcdata,F:a.F||a.rcdata,H:a.H||a.startDoc,w:a.w||a.startTag};return function(a,e){var f,
|
|
g=/(<\/|<\!--|<[!?]|[&<>])/g;f=a+"";if(fa)f=f.split(g);else{for(var h=[],k=0,m;(m=g.exec(f))!==c;)h.push(f.substring(k,m.index)),h.push(m[0]),k=m.index+m[0].length;h.push(f.substring(k));f=h}p(b,f,0,{r:d,C:d},e)}}function n(a,b,c,d,e){return function(){p(a,b,c,d,e)}}function p(a,c,d,f,g){try{a.H&&0==d&&a.H(g);for(var h,k,m,l=c.length;d<l;){var L=c[d++],G=c[d];switch(L){case "\x26":$.test(G)?(a.e&&a.e("\x26"+G,g,U,n(a,c,d,f,g)),d++):a.e&&a.e("\x26amp;",g,U,n(a,c,d,f,g));break;case "\x3c/":if(h=/^([-\w:]+)[^\'\"]*/.exec(G))if(h[0].length===
|
|
G.length&&"\x3e"===c[d+1])d+=2,m=h[1].toLowerCase(),a.t&&a.t(m,g,U,n(a,c,d,f,g));else{var r=c,C=d,B=a,E=g,u=U,s=f,v=D(r,C);v?(B.t&&B.t(v.name,E,u,n(B,r,C,s,E)),d=v.next):d=r.length}else a.e&&a.e("\x26lt;/",g,U,n(a,c,d,f,g));break;case "\x3c":if(h=/^([-\w:]+)\s*\/?/.exec(G))if(h[0].length===G.length&&"\x3e"===c[d+1]){d+=2;m=h[1].toLowerCase();a.w&&a.w(m,[],g,U,n(a,c,d,f,g));var M=e.f[m];M&ca&&(d=q(c,{name:m,next:d,c:M},a,g,U,f))}else{var r=c,C=a,B=g,E=U,u=f,R=D(r,d);R?(C.w&&C.w(R.name,R.R,B,E,n(C,
|
|
r,R.next,u,B)),d=R.c&ca?q(r,R,C,B,E,u):R.next):d=r.length}else a.e&&a.e("\x26lt;",g,U,n(a,c,d,f,g));break;case "\x3c!--":if(!f.C){for(k=d+1;k<l&&!("\x3e"===c[k]&&/--$/.test(c[k-1]));k++);if(k<l){if(a.A){var z=c.slice(d,k).join("");a.A(z.substr(0,z.length-2),g,U,n(a,c,k+1,f,g))}d=k+1}else f.C=b}f.C&&a.e&&a.e("\x26lt;!--",g,U,n(a,c,d,f,g));break;case "\x3c!":if(/^\w/.test(G)){if(!f.r){for(k=d+1;k<l&&"\x3e"!==c[k];k++);k<l?d=k+1:f.r=b}f.r&&a.e&&a.e("\x26lt;!",g,U,n(a,c,d,f,g))}else a.e&&a.e("\x26lt;!",
|
|
g,U,n(a,c,d,f,g));break;case "\x3c?":if(!f.r){for(k=d+1;k<l&&"\x3e"!==c[k];k++);k<l?d=k+1:f.r=b}f.r&&a.e&&a.e("\x26lt;?",g,U,n(a,c,d,f,g));break;case "\x3e":a.e&&a.e("\x26gt;",g,U,n(a,c,d,f,g));break;case "":break;default:a.e&&a.e(L,g,U,n(a,c,d,f,g))}}a.B&&a.B(g)}catch(J){if(J!==U)throw J;}}function q(a,b,c,d,f,g){var h=a.length;ea.hasOwnProperty(b.name)||(ea[b.name]=RegExp("^"+b.name+"(?:[\\s\\/]|$)","i"));for(var m=ea[b.name],l=b.next,L=b.next+1;L<h&&!("\x3c/"===a[L-1]&&m.test(a[L]));L++);L<h&&
|
|
(L-=1);h=a.slice(l,L).join("");if(b.c&e.c.CDATA)c.z&&c.z(h,d,f,n(c,a,L,g,d));else if(b.c&e.c.RCDATA)c.F&&c.F(k(h),d,f,n(c,a,L,g,d));else throw Error("bug");return L}function D(a,c){var f=/^([-\w:]+)/.exec(a[c]),h={};h.name=f[1].toLowerCase();h.c=e.f[h.name];for(var k=a[c].substr(f[0].length),m=c+1,l=a.length;m<l&&"\x3e"!==a[m];m++)k+=a[m];if(!(l<=m)){for(var n=[];""!==k;)if(f=L.exec(k))if(f[4]&&!f[5]||f[6]&&!f[7]){for(var f=f[4]||f[6],p=d,k=[k,a[m++]];m<l;m++){if(p){if("\x3e"===a[m])break}else 0<=
|
|
a[m].indexOf(f)&&(p=b);k.push(a[m])}if(l<=m)break;k=k.join("")}else{var p=f[1].toLowerCase(),D;if(f[2]){D=f[3];var G=D.charCodeAt(0);if(34===G||39===G)D=D.substr(1,D.length-2);D=g(D.replace(M,""))}else D="";n.push(p,D);k=k.substr(f[0].length)}else k=k.replace(/^[\s\S][^a-z\s]*/,"");h.R=n;h.next=m+1;return h}}function r(b){function f(a,b){k||b.push(a)}var g,k;return l({startDoc:function(){g=[];k=d},startTag:function(d,f,m){if(!k&&e.f.hasOwnProperty(d)){var l=e.f[d];if(!(l&e.c.FOLDABLE)){var n=b(d,
|
|
f);if(n){if("object"!==typeof n)throw Error("tagPolicy did not return object (old API?)");if("attribs"in n)f=n.attribs;else throw Error("tagPolicy gave no attribs");var L;"tagName"in n?(L=n.tagName,n=e.f[L]):(L=d,n=l);if(l&e.c.OPTIONAL_ENDTAG){var p=g[g.length-1];p&&p.D===d&&(p.v!==L||d!==L)&&m.push("\x3c/",p.v,"\x3e")}l&e.c.EMPTY||g.push({D:d,v:L});m.push("\x3c",L);d=0;for(p=f.length;d<p;d+=2){var D=f[d],G=f[d+1];G!==c&&G!==a&&m.push(" ",D,'\x3d"',h(G),'"')}m.push("\x3e");l&e.c.EMPTY&&!(n&e.c.EMPTY)&&
|
|
m.push("\x3c/",L,"\x3e")}else k=!(l&e.c.EMPTY)}}},endTag:function(a,b){if(k)k=d;else if(e.f.hasOwnProperty(a)){var c=e.f[a];if(!(c&(e.c.EMPTY|e.c.FOLDABLE))){if(c&e.c.OPTIONAL_ENDTAG)for(c=g.length;0<=--c;){var f=g[c].D;if(f===a)break;if(!(e.f[f]&e.c.OPTIONAL_ENDTAG))return}else for(c=g.length;0<=--c&&g[c].D!==a;);if(!(0>c)){for(f=g.length;--f>c;){var h=g[f].v;e.f[h]&e.c.OPTIONAL_ENDTAG||b.push("\x3c/",h,"\x3e")}c<g.length&&(a=g[c].v);g.length=c;b.push("\x3c/",a,"\x3e")}}}},pcdata:f,rcdata:f,cdata:f,
|
|
endDoc:function(a){for(;g.length;g.length--)a.push("\x3c/",g[g.length-1].v,"\x3e")}})}function u(a,b,d,e,f){if(!f)return c;try{var g=m.parse(""+a);if(g&&(!g.K()||ia.test(g.W()))){var h=f(g,b,d,e);return h?h.toString():c}}catch(k){}return c}function s(a,b,c,d,e){c||a(b+" removed",{S:"removed",tagName:b});if(d!==e){var f="changed";d&&!e?f="removed":!d&&e&&(f="added");a(b+"."+c+" "+f,{S:f,tagName:b,la:c,oldValue:d,newValue:e})}}function T(a,b,c){b=b+"::"+c;if(a.hasOwnProperty(b))return a[b];b="*::"+
|
|
c;if(a.hasOwnProperty(b))return a[b]}function V(b,d,f,g,h){for(var k=0;k<d.length;k+=2){var m=d[k],l=d[k+1],n=l,L=c,p;if((p=b+"::"+m,e.m.hasOwnProperty(p))||(p="*::"+m,e.m.hasOwnProperty(p)))L=e.m[p];if(L!==c)switch(L){case e.d.NONE:break;case e.d.SCRIPT:l=c;h&&s(h,b,m,n,l);break;case e.d.STYLE:if("undefined"===typeof x){l=c;h&&s(h,b,m,n,l);break}var D=[];x(l,{declaration:function(a,b){var d=a.toLowerCase();ba(d,b,f?function(a){return u(a,e.P.ja,e.M.ka,{TYPE:"CSS",CSS_PROP:d},f)}:c);b.length&&D.push(d+
|
|
": "+b.join(" "))}});l=0<D.length?D.join(" ; "):c;h&&s(h,b,m,n,l);break;case e.d.ID:case e.d.IDREF:case e.d.IDREFS:case e.d.GLOBAL_NAME:case e.d.LOCAL_NAME:case e.d.CLASSES:l=g?g(l):l;h&&s(h,b,m,n,l);break;case e.d.URI:l=u(l,T(e.J,b,m),T(e.I,b,m),{TYPE:"MARKUP",XML_ATTR:m,XML_TAG:b},f);h&&s(h,b,m,n,l);break;case e.d.URI_FRAGMENT:l&&"#"===l.charAt(0)?(l=l.substring(1),l=g?g(l):l,l!==c&&l!==a&&(l="#"+l)):l=c;h&&s(h,b,m,n,l);break;default:l=c,h&&s(h,b,m,n,l)}else l=c,h&&s(h,b,m,n,l);d[k+1]=l}return d}
|
|
function aa(b,c,d){return function(f,g){if(e.f[f]&e.c.UNSAFE)d&&s(d,f,a,a,a);else return{attribs:V(f,g,b,c,d)}}}function w(a,b){var c=[];r(b)(a,c);return c.join("")}var x,ba;"undefined"!==typeof window&&(x=window.parseCssDeclarations,ba=window.sanitizeCssProperty);var N={lt:"\x3c",LT:"\x3c",gt:"\x3e",GT:"\x3e",amp:"\x26",AMP:"\x26",quot:'"',apos:"'",nbsp:"\u00a0"},I=/^#(\d+)$/,G=/^#x([0-9A-Fa-f]+)$/,C=/^[A-Za-z][A-za-z0-9]+$/,E="undefined"!==typeof window&&window.document?window.document.createElement("textarea"):
|
|
c,M=/\0/g,R=/&(#[0-9]+|#[xX][0-9A-Fa-f]+|\w+);/g,$=/^(#[0-9]+|#[xX][0-9A-Fa-f]+|\w+);/,Y=/&/g,Q=/&([^a-z#]|#(?:[^0-9x]|x(?:[^0-9a-f]|$)|$)|$)/gi,W=/[<]/g,X=/>/g,S=/\"/g,L=/^\s*([-.:\w]+)(?:\s*(=)\s*((")[^"]*("|$)|(')[^']*('|$)|(?=[a-z][-\w]*\s*=)|[^"'\s]*))?/i,fa=3==="a,b".split(/(,)/).length,ca=e.c.CDATA|e.c.RCDATA,U={},ea={},ia=/^(?:https?|mailto|data)$/i,Z={};Z.pa=Z.escapeAttrib=h;Z.ra=Z.makeHtmlSanitizer=r;Z.sa=Z.makeSaxParser=l;Z.ta=Z.makeTagPolicy=aa;Z.wa=Z.normalizeRCData=k;Z.xa=Z.sanitize=
|
|
function(a,b,c,d){return w(a,aa(b,c,d))};Z.ya=Z.sanitizeAttribs=V;Z.za=Z.sanitizeWithPolicy=w;Z.Ba=Z.unescapeEntities=g;return Z}(u);g=e.sanitize;"undefined"!==typeof window&&(window.html=e,window.html_sanitize=g)})();var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d",encode:function(a,b){var c="",d,e,f,g,h,k,m=0;for(null!=b&&b||(a=Base64._utf8_encode(a));m<a.length;)d=a.charCodeAt(m++),e=a.charCodeAt(m++),f=a.charCodeAt(m++),g=d>>2,d=(d&3)<<4|e>>4,h=(e&15)<<2|f>>6,k=f&63,isNaN(e)?h=k=64:isNaN(f)&&(k=64),c=c+this._keyStr.charAt(g)+this._keyStr.charAt(d)+this._keyStr.charAt(h)+this._keyStr.charAt(k);return c},decode:function(a,b){b=null!=b?b:!1;var c="",d,e,f,g,h,k=0;for(a=
|
|
a.replace(/[^A-Za-z0-9\+\/\=]/g,"");k<a.length;)d=this._keyStr.indexOf(a.charAt(k++)),e=this._keyStr.indexOf(a.charAt(k++)),g=this._keyStr.indexOf(a.charAt(k++)),h=this._keyStr.indexOf(a.charAt(k++)),d=d<<2|e>>4,e=(e&15)<<4|g>>2,f=(g&3)<<6|h,c+=String.fromCharCode(d),64!=g&&(c+=String.fromCharCode(e)),64!=h&&(c+=String.fromCharCode(f));b||(c=Base64._utf8_decode(c));return c},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);128>d?b+=String.fromCharCode(d):
|
|
(127<d&&2048>d?b+=String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){for(var b="",c=0,d=c1=c2=0;c<a.length;)d=a.charCodeAt(c),128>d?(b+=String.fromCharCode(d),c++):191<d&&224>d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3);return b}};!function(a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a():"function"==typeof define&&define.amd?define([],a):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pako=a()}(function(){return function b(c,d,e){function f(h,m){if(!d[h]){if(!c[h]){var l="function"==typeof require&&require;if(!m&&l)return l(h,!0);if(g)return g(h,!0);l=Error("Cannot find module '"+h+"'");throw l.code="MODULE_NOT_FOUND",l;}l=d[h]={exports:{}};
|
|
c[h][0].call(l.exports,function(b){var d=c[h][1][b];return f(d?d:b)},l,l.exports,b,c,d,e)}return d[h].exports}for(var g="function"==typeof require&&require,h=0;h<e.length;h++)f(e[h]);return f}({1:[function(b,c,d){function e(b){if(!(this instanceof e))return new e(b);b=this.options=h.assign({level:r,method:s,chunkSize:16384,windowBits:15,memLevel:8,strategy:q,to:""},b||{});b.raw&&0<b.windowBits?b.windowBits=-b.windowBits:b.gzip&&0<b.windowBits&&16>b.windowBits&&(b.windowBits+=16);this.err=0;this.msg=
|
|
"";this.ended=!1;this.chunks=[];this.strm=new l;this.strm.avail_out=0;var c=g.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(c!==p)throw Error(m[c]);if(b.header&&g.deflateSetHeader(this.strm,b.header),b.dictionary){var d;if(d="string"==typeof b.dictionary?k.string2buf(b.dictionary):"[object ArrayBuffer]"===n.call(b.dictionary)?new Uint8Array(b.dictionary):b.dictionary,c=g.deflateSetDictionary(this.strm,d),c!==p)throw Error(m[c]);this._dict_set=!0}}function f(b,c){var d=
|
|
new e(c);if(d.push(b,!0),d.err)throw d.msg;return d.result}var g=b("./zlib/deflate"),h=b("./utils/common"),k=b("./utils/strings"),m=b("./zlib/messages"),l=b("./zlib/zstream"),n=Object.prototype.toString,p=0,r=-1,q=0,s=8;e.prototype.push=function(b,c){var d,e,f=this.strm,m=this.options.chunkSize;if(this.ended)return!1;e=c===~~c?c:!0===c?4:0;"string"==typeof b?f.input=k.string2buf(b):"[object ArrayBuffer]"===n.call(b)?f.input=new Uint8Array(b):f.input=b;f.next_in=0;f.avail_in=f.input.length;do{if(0===
|
|
f.avail_out&&(f.output=new h.Buf8(m),f.next_out=0,f.avail_out=m),d=g.deflate(f,e),1!==d&&d!==p)return this.onEnd(d),this.ended=!0,!1;0!==f.avail_out&&(0!==f.avail_in||4!==e&&2!==e)||("string"===this.options.to?this.onData(k.buf2binstring(h.shrinkBuf(f.output,f.next_out))):this.onData(h.shrinkBuf(f.output,f.next_out)))}while((0<f.avail_in||0===f.avail_out)&&1!==d);return 4===e?(d=g.deflateEnd(this.strm),this.onEnd(d),this.ended=!0,d===p):2!==e||(this.onEnd(p),f.avail_out=0,!0)};e.prototype.onData=
|
|
function(b){this.chunks.push(b)};e.prototype.onEnd=function(b){b===p&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=h.flattenChunks(this.chunks));this.chunks=[];this.err=b;this.msg=this.strm.msg};d.Deflate=e;d.deflate=f;d.deflateRaw=function(b,c){return c=c||{},c.raw=!0,f(b,c)};d.gzip=function(b,c){return c=c||{},c.gzip=!0,f(b,c)}},{"./utils/common":3,"./utils/strings":4,"./zlib/deflate":8,"./zlib/messages":13,"./zlib/zstream":15}],2:[function(b,c,d){function e(b){if(!(this instanceof
|
|
e))return new e(b);var c=this.options=h.assign({chunkSize:16384,windowBits:0,to:""},b||{});c.raw&&0<=c.windowBits&&16>c.windowBits&&(c.windowBits=-c.windowBits,0===c.windowBits&&(c.windowBits=-15));!(0<=c.windowBits&&16>c.windowBits)||b&&b.windowBits||(c.windowBits+=32);15<c.windowBits&&48>c.windowBits&&0===(15&c.windowBits)&&(c.windowBits|=15);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new n;this.strm.avail_out=0;b=g.inflateInit2(this.strm,c.windowBits);if(b!==m.Z_OK)throw Error(l[b]);
|
|
this.header=new p;g.inflateGetHeader(this.strm,this.header)}function f(b,c){var d=new e(c);if(d.push(b,!0),d.err)throw d.msg;return d.result}var g=b("./zlib/inflate"),h=b("./utils/common"),k=b("./utils/strings"),m=b("./zlib/constants"),l=b("./zlib/messages"),n=b("./zlib/zstream"),p=b("./zlib/gzheader"),r=Object.prototype.toString;e.prototype.push=function(b,c){var d,e,f,l,n,p,F=this.strm,H=this.options.chunkSize,B=this.options.dictionary,A=!1;if(this.ended)return!1;e=c===~~c?c:!0===c?m.Z_FINISH:m.Z_NO_FLUSH;
|
|
"string"==typeof b?F.input=k.binstring2buf(b):"[object ArrayBuffer]"===r.call(b)?F.input=new Uint8Array(b):F.input=b;F.next_in=0;F.avail_in=F.input.length;do{if(0===F.avail_out&&(F.output=new h.Buf8(H),F.next_out=0,F.avail_out=H),d=g.inflate(F,m.Z_NO_FLUSH),d===m.Z_NEED_DICT&&B&&(p="string"==typeof B?k.string2buf(B):"[object ArrayBuffer]"===r.call(B)?new Uint8Array(B):B,d=g.inflateSetDictionary(this.strm,p)),d===m.Z_BUF_ERROR&&!0===A&&(d=m.Z_OK,A=!1),d!==m.Z_STREAM_END&&d!==m.Z_OK)return this.onEnd(d),
|
|
this.ended=!0,!1;F.next_out&&(0!==F.avail_out&&d!==m.Z_STREAM_END&&(0!==F.avail_in||e!==m.Z_FINISH&&e!==m.Z_SYNC_FLUSH)||("string"===this.options.to?(f=k.utf8border(F.output,F.next_out),l=F.next_out-f,n=k.buf2string(F.output,f),F.next_out=l,F.avail_out=H-l,l&&h.arraySet(F.output,F.output,f,l,0),this.onData(n)):this.onData(h.shrinkBuf(F.output,F.next_out))));0===F.avail_in&&0===F.avail_out&&(A=!0)}while((0<F.avail_in||0===F.avail_out)&&d!==m.Z_STREAM_END);return d===m.Z_STREAM_END&&(e=m.Z_FINISH),
|
|
e===m.Z_FINISH?(d=g.inflateEnd(this.strm),this.onEnd(d),this.ended=!0,d===m.Z_OK):e!==m.Z_SYNC_FLUSH||(this.onEnd(m.Z_OK),F.avail_out=0,!0)};e.prototype.onData=function(b){this.chunks.push(b)};e.prototype.onEnd=function(b){b===m.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=h.flattenChunks(this.chunks));this.chunks=[];this.err=b;this.msg=this.strm.msg};d.Inflate=e;d.inflate=f;d.inflateRaw=function(b,c){return c=c||{},c.raw=!0,f(b,c)};d.ungzip=f},{"./utils/common":3,
|
|
"./utils/strings":4,"./zlib/constants":6,"./zlib/gzheader":9,"./zlib/inflate":11,"./zlib/messages":13,"./zlib/zstream":15}],3:[function(b,c,d){b="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;d.assign=function(b){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var d=c.shift();if(d){if("object"!=typeof d)throw new TypeError(d+"must be non-object");for(var e in d)d.hasOwnProperty(e)&&(b[e]=d[e])}}return b};d.shrinkBuf=function(b,c){return b.length===
|
|
c?b:b.subarray?b.subarray(0,c):(b.length=c,b)};var e={arraySet:function(b,c,d,e,f){if(c.subarray&&b.subarray)return void b.set(c.subarray(d,d+e),f);for(var n=0;n<e;n++)b[f+n]=c[d+n]},flattenChunks:function(b){var c,d,e,f,n;c=e=0;for(d=b.length;c<d;c++)e+=b[c].length;n=new Uint8Array(e);c=e=0;for(d=b.length;c<d;c++)f=b[c],n.set(f,e),e+=f.length;return n}},f={arraySet:function(b,c,d,e,f){for(var n=0;n<e;n++)b[f+n]=c[d+n]},flattenChunks:function(b){return[].concat.apply([],b)}};d.setTyped=function(b){b?
|
|
(d.Buf8=Uint8Array,d.Buf16=Uint16Array,d.Buf32=Int32Array,d.assign(d,e)):(d.Buf8=Array,d.Buf16=Array,d.Buf32=Array,d.assign(d,f))};d.setTyped(b)},{}],4:[function(b,c,d){function e(b,c){if(65537>c&&(b.subarray&&h||!b.subarray&&g))return String.fromCharCode.apply(null,f.shrinkBuf(b,c));for(var d="",e=0;e<c;e++)d+=String.fromCharCode(b[e]);return d}var f=b("./common"),g=!0,h=!0;try{String.fromCharCode.apply(null,[0])}catch(k){g=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(m){h=!1}var l=
|
|
new f.Buf8(256);for(b=0;256>b;b++)l[b]=252<=b?6:248<=b?5:240<=b?4:224<=b?3:192<=b?2:1;l[254]=l[254]=1;d.string2buf=function(b){var c,d,e,g,h,k=b.length,m=0;for(g=0;g<k;g++)d=b.charCodeAt(g),55296===(64512&d)&&g+1<k&&(e=b.charCodeAt(g+1),56320===(64512&e)&&(d=65536+(d-55296<<10)+(e-56320),g++)),m+=128>d?1:2048>d?2:65536>d?3:4;c=new f.Buf8(m);for(g=h=0;h<m;g++)d=b.charCodeAt(g),55296===(64512&d)&&g+1<k&&(e=b.charCodeAt(g+1),56320===(64512&e)&&(d=65536+(d-55296<<10)+(e-56320),g++)),128>d?c[h++]=d:2048>
|
|
d?(c[h++]=192|d>>>6,c[h++]=128|63&d):65536>d?(c[h++]=224|d>>>12,c[h++]=128|d>>>6&63,c[h++]=128|63&d):(c[h++]=240|d>>>18,c[h++]=128|d>>>12&63,c[h++]=128|d>>>6&63,c[h++]=128|63&d);return c};d.buf2binstring=function(b){return e(b,b.length)};d.binstring2buf=function(b){for(var c=new f.Buf8(b.length),d=0,e=c.length;d<e;d++)c[d]=b.charCodeAt(d);return c};d.buf2string=function(b,c){var d,f,g,h,k=c||b.length,m=Array(2*k);for(d=f=0;d<k;)if(g=b[d++],128>g)m[f++]=g;else if(h=l[g],4<h)m[f++]=65533,d+=h-1;else{for(g&=
|
|
2===h?31:3===h?15:7;1<h&&d<k;)g=g<<6|63&b[d++],h--;1<h?m[f++]=65533:65536>g?m[f++]=g:(g-=65536,m[f++]=55296|g>>10&1023,m[f++]=56320|1023&g)}return e(m,f)};d.utf8border=function(b,c){var d;c=c||b.length;c>b.length&&(c=b.length);for(d=c-1;0<=d&&128===(192&b[d]);)d--;return 0>d?c:0===d?c:d+l[b[d]]>c?d:c}},{"./common":3}],5:[function(b,c,d){c.exports=function(b,c,d,h){var k=65535&b|0;b=b>>>16&65535|0;for(var m=0;0!==d;){m=2E3<d?2E3:d;d-=m;do k=k+c[h++]|0,b=b+k|0;while(--m);k%=65521;b%=65521}return k|
|
|
b<<16|0}},{}],6:[function(b,c,d){c.exports={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_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}},{}],7:[function(b,c,d){var e=function(){for(var b,c=[],d=0;256>d;d++){b=d;
|
|
for(var e=0;8>e;e++)b=1&b?3988292384^b>>>1:b>>>1;c[d]=b}return c}();c.exports=function(b,c,d,k){d=k+d;for(b^=-1;k<d;k++)b=b>>>8^e[255&(b^c[k])];return b^-1}},{}],8:[function(b,c,d){function e(b,c){return b.msg=B[c],c}function f(b){for(var c=b.length;0<=--c;)b[c]=0}function g(b){var c=b.state,d=c.pending;d>b.avail_out&&(d=b.avail_out);0!==d&&(v.arraySet(b.output,c.pending_buf,c.pending_out,d,b.next_out),b.next_out+=d,c.pending_out+=d,b.total_out+=d,b.avail_out-=d,c.pending-=d,0===c.pending&&(c.pending_out=
|
|
0))}function h(b,c){K._tr_flush_block(b,0<=b.block_start?b.block_start:-1,b.strstart-b.block_start,c);b.block_start=b.strstart;g(b.strm)}function k(b,c){b.pending_buf[b.pending++]=c}function m(b,c){b.pending_buf[b.pending++]=c>>>8&255;b.pending_buf[b.pending++]=255&c}function l(b,c){var d,e,f=b.max_chain_length,g=b.strstart,h=b.prev_length,k=b.nice_match,m=b.strstart>b.w_size-R?b.strstart-(b.w_size-R):0,l=b.window,n=b.w_mask,D=b.prev,p=b.strstart+M,G=l[g+h-1],q=l[g+h];b.prev_length>=b.good_match&&
|
|
(f>>=2);k>b.lookahead&&(k=b.lookahead);do if(d=c,l[d+h]===q&&l[d+h-1]===G&&l[d]===l[g]&&l[++d]===l[g+1]){g+=2;d++;do;while(l[++g]===l[++d]&&l[++g]===l[++d]&&l[++g]===l[++d]&&l[++g]===l[++d]&&l[++g]===l[++d]&&l[++g]===l[++d]&&l[++g]===l[++d]&&l[++g]===l[++d]&&g<p);if(e=M-(p-g),g=p-M,e>h){if(b.match_start=c,h=e,e>=k)break;G=l[g+h-1];q=l[g+h]}}while((c=D[c&n])>m&&0!==--f);return h<=b.lookahead?h:b.lookahead}function n(b){var c,d,e,f,g=b.w_size;do{if(f=b.window_size-b.lookahead-b.strstart,b.strstart>=
|
|
g+(g-R)){v.arraySet(b.window,b.window,g,g,0);b.match_start-=g;b.strstart-=g;b.block_start-=g;c=d=b.hash_size;do e=b.head[--c],b.head[c]=e>=g?e-g:0;while(--d);c=d=g;do e=b.prev[--c],b.prev[c]=e>=g?e-g:0;while(--d);f+=g}if(0===b.strm.avail_in)break;c=b.strm;e=b.window;var h=b.strstart+b.lookahead,k=c.avail_in;if(d=(k>f&&(k=f),0===k?0:(c.avail_in-=k,v.arraySet(e,c.input,c.next_in,k,h),1===c.state.wrap?c.adler=F(c.adler,e,k,h):2===c.state.wrap&&(c.adler=H(c.adler,e,k,h)),c.next_in+=k,c.total_in+=k,k)),
|
|
b.lookahead+=d,b.lookahead+b.insert>=E){f=b.strstart-b.insert;b.ins_h=b.window[f];for(b.ins_h=(b.ins_h<<b.hash_shift^b.window[f+1])&b.hash_mask;b.insert&&(b.ins_h=(b.ins_h<<b.hash_shift^b.window[f+E-1])&b.hash_mask,b.prev[f&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=f,f++,b.insert--,!(b.lookahead+b.insert<E)););}}while(b.lookahead<R&&0!==b.strm.avail_in)}function p(b,c){for(var d,e;;){if(b.lookahead<R){if(n(b),b.lookahead<R&&c===A)return Q;if(0===b.lookahead)break}if(d=0,b.lookahead>=E&&(b.ins_h=(b.ins_h<<
|
|
b.hash_shift^b.window[b.strstart+E-1])&b.hash_mask,d=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart),0!==d&&b.strstart-d<=b.w_size-R&&(b.match_length=l(b,d)),b.match_length>=E)if(e=K._tr_tally(b,b.strstart-b.match_start,b.match_length-E),b.lookahead-=b.match_length,b.match_length<=b.max_lazy_match&&b.lookahead>=E){b.match_length--;do b.strstart++,b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+E-1])&b.hash_mask,d=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=
|
|
b.strstart;while(0!==--b.match_length);b.strstart++}else b.strstart+=b.match_length,b.match_length=0,b.ins_h=b.window[b.strstart],b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+1])&b.hash_mask;else e=K._tr_tally(b,0,b.window[b.strstart]),b.lookahead--,b.strstart++;if(e&&(h(b,!1),0===b.strm.avail_out))return Q}return b.insert=b.strstart<E-1?b.strstart:E-1,c===D?(h(b,!0),0===b.strm.avail_out?X:S):b.last_lit&&(h(b,!1),0===b.strm.avail_out)?Q:W}function r(b,c){for(var d,e,f;;){if(b.lookahead<R){if(n(b),
|
|
b.lookahead<R&&c===A)return Q;if(0===b.lookahead)break}if(d=0,b.lookahead>=E&&(b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+E-1])&b.hash_mask,d=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart),b.prev_length=b.match_length,b.prev_match=b.match_start,b.match_length=E-1,0!==d&&b.prev_length<b.max_lazy_match&&b.strstart-d<=b.w_size-R&&(b.match_length=l(b,d),5>=b.match_length&&(b.strategy===T||b.match_length===E&&4096<b.strstart-b.match_start)&&(b.match_length=E-1)),b.prev_length>=
|
|
E&&b.match_length<=b.prev_length){f=b.strstart+b.lookahead-E;e=K._tr_tally(b,b.strstart-1-b.prev_match,b.prev_length-E);b.lookahead-=b.prev_length-1;b.prev_length-=2;do++b.strstart<=f&&(b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+E-1])&b.hash_mask,d=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart);while(0!==--b.prev_length);if(b.match_available=0,b.match_length=E-1,b.strstart++,e&&(h(b,!1),0===b.strm.avail_out))return Q}else if(b.match_available){if(e=K._tr_tally(b,0,
|
|
b.window[b.strstart-1]),e&&h(b,!1),b.strstart++,b.lookahead--,0===b.strm.avail_out)return Q}else b.match_available=1,b.strstart++,b.lookahead--}return b.match_available&&(K._tr_tally(b,0,b.window[b.strstart-1]),b.match_available=0),b.insert=b.strstart<E-1?b.strstart:E-1,c===D?(h(b,!0),0===b.strm.avail_out?X:S):b.last_lit&&(h(b,!1),0===b.strm.avail_out)?Q:W}function q(b,c,d,e,f){this.good_length=b;this.max_lazy=c;this.nice_length=d;this.max_chain=e;this.func=f}function s(){this.strm=null;this.status=
|
|
0;this.pending_buf=null;this.wrap=this.pending=this.pending_out=this.pending_buf_size=0;this.gzhead=null;this.gzindex=0;this.method=w;this.last_flush=-1;this.w_mask=this.w_bits=this.w_size=0;this.window=null;this.window_size=0;this.head=this.prev=null;this.nice_match=this.good_match=this.strategy=this.level=this.max_lazy_match=this.max_chain_length=this.prev_length=this.lookahead=this.match_start=this.strstart=this.match_available=this.prev_match=this.match_length=this.block_start=this.hash_shift=
|
|
this.hash_mask=this.hash_bits=this.hash_size=this.ins_h=0;this.dyn_ltree=new v.Buf16(2*G);this.dyn_dtree=new v.Buf16(2*(2*N+1));this.bl_tree=new v.Buf16(2*(2*I+1));f(this.dyn_ltree);f(this.dyn_dtree);f(this.bl_tree);this.bl_desc=this.d_desc=this.l_desc=null;this.bl_count=new v.Buf16(C+1);this.heap=new v.Buf16(2*ba+1);f(this.heap);this.heap_max=this.heap_len=0;this.depth=new v.Buf16(2*ba+1);f(this.depth);this.bi_valid=this.bi_buf=this.insert=this.matches=this.static_len=this.opt_len=this.d_buf=this.last_lit=
|
|
this.lit_bufsize=this.l_buf=0}function u(b){var c;return b&&b.state?(b.total_in=b.total_out=0,b.data_type=aa,c=b.state,c.pending=0,c.pending_out=0,0>c.wrap&&(c.wrap=-c.wrap),c.status=c.wrap?$:Y,b.adler=2===c.wrap?0:1,c.last_flush=A,K._tr_init(c),J):e(b,P)}function t(b){var c=u(b);c===J&&(b=b.state,b.window_size=2*b.w_size,f(b.head),b.max_lazy_match=y[b.level].max_lazy,b.good_match=y[b.level].good_length,b.nice_match=y[b.level].nice_length,b.max_chain_length=y[b.level].max_chain,b.strstart=0,b.block_start=
|
|
0,b.lookahead=0,b.insert=0,b.match_length=b.prev_length=E-1,b.match_available=0,b.ins_h=0);return c}function z(b,c,d,f,g,h){if(!b)return P;var k=1;if(c===O&&(c=6),0>f?(k=0,f=-f):15<f&&(k=2,f-=16),1>g||g>x||d!==w||8>f||15<f||0>c||9<c||0>h||h>V)return e(b,P);8===f&&(f=9);var m=new s;return b.state=m,m.strm=b,m.wrap=k,m.gzhead=null,m.w_bits=f,m.w_size=1<<m.w_bits,m.w_mask=m.w_size-1,m.hash_bits=g+7,m.hash_size=1<<m.hash_bits,m.hash_mask=m.hash_size-1,m.hash_shift=~~((m.hash_bits+E-1)/E),m.window=new v.Buf8(2*
|
|
m.w_size),m.head=new v.Buf16(m.hash_size),m.prev=new v.Buf16(m.w_size),m.lit_bufsize=1<<g+6,m.pending_buf_size=4*m.lit_bufsize,m.pending_buf=new v.Buf8(m.pending_buf_size),m.d_buf=1*m.lit_bufsize,m.l_buf=3*m.lit_bufsize,m.level=c,m.strategy=h,m.method=d,t(b)}var y,v=b("../utils/common"),K=b("./trees"),F=b("./adler32"),H=b("./crc32"),B=b("./messages"),A=0,D=4,J=0,P=-2,O=-1,T=1,V=4,aa=2,w=8,x=9,ba=286,N=30,I=19,G=2*ba+1,C=15,E=3,M=258,R=M+E+1,$=42,Y=113,Q=1,W=2,X=3,S=4;y=[new q(0,0,0,0,function(b,c){var d=
|
|
65535;for(d>b.pending_buf_size-5&&(d=b.pending_buf_size-5);;){if(1>=b.lookahead){if(n(b),0===b.lookahead&&c===A)return Q;if(0===b.lookahead)break}b.strstart+=b.lookahead;b.lookahead=0;var e=b.block_start+d;if((0===b.strstart||b.strstart>=e)&&(b.lookahead=b.strstart-e,b.strstart=e,h(b,!1),0===b.strm.avail_out)||b.strstart-b.block_start>=b.w_size-R&&(h(b,!1),0===b.strm.avail_out))return Q}return b.insert=0,c===D?(h(b,!0),0===b.strm.avail_out?X:S):(b.strstart>b.block_start&&h(b,!1),Q)}),new q(4,4,8,
|
|
4,p),new q(4,5,16,8,p),new q(4,6,32,32,p),new q(4,4,16,16,r),new q(8,16,32,32,r),new q(8,16,128,128,r),new q(8,32,128,256,r),new q(32,128,258,1024,r),new q(32,258,258,4096,r)];d.deflateInit=function(b,c){return z(b,c,w,15,8,0)};d.deflateInit2=z;d.deflateReset=t;d.deflateResetKeep=u;d.deflateSetHeader=function(b,c){return b&&b.state?2!==b.state.wrap?P:(b.state.gzhead=c,J):P};d.deflate=function(b,c){var d,l,p,G;if(!b||!b.state||5<c||0>c)return b?e(b,P):P;if(l=b.state,!b.output||!b.input&&0!==b.avail_in||
|
|
666===l.status&&c!==D)return e(b,0===b.avail_out?-5:P);if(l.strm=b,d=l.last_flush,l.last_flush=c,l.status===$)2===l.wrap?(b.adler=0,k(l,31),k(l,139),k(l,8),l.gzhead?(k(l,(l.gzhead.text?1:0)+(l.gzhead.hcrc?2:0)+(l.gzhead.extra?4:0)+(l.gzhead.name?8:0)+(l.gzhead.comment?16:0)),k(l,255&l.gzhead.time),k(l,l.gzhead.time>>8&255),k(l,l.gzhead.time>>16&255),k(l,l.gzhead.time>>24&255),k(l,9===l.level?2:2<=l.strategy||2>l.level?4:0),k(l,255&l.gzhead.os),l.gzhead.extra&&l.gzhead.extra.length&&(k(l,255&l.gzhead.extra.length),
|
|
k(l,l.gzhead.extra.length>>8&255)),l.gzhead.hcrc&&(b.adler=H(b.adler,l.pending_buf,l.pending,0)),l.gzindex=0,l.status=69):(k(l,0),k(l,0),k(l,0),k(l,0),k(l,0),k(l,9===l.level?2:2<=l.strategy||2>l.level?4:0),k(l,3),l.status=Y)):(p=w+(l.w_bits-8<<4)<<8,G=-1,G=2<=l.strategy||2>l.level?0:6>l.level?1:6===l.level?2:3,p|=G<<6,0!==l.strstart&&(p|=32),l.status=Y,m(l,p+(31-p%31)),0!==l.strstart&&(m(l,b.adler>>>16),m(l,65535&b.adler)),b.adler=1);if(69===l.status)if(l.gzhead.extra){for(p=l.pending;l.gzindex<(65535&
|
|
l.gzhead.extra.length)&&(l.pending!==l.pending_buf_size||(l.gzhead.hcrc&&l.pending>p&&(b.adler=H(b.adler,l.pending_buf,l.pending-p,p)),g(b),p=l.pending,l.pending!==l.pending_buf_size));)k(l,255&l.gzhead.extra[l.gzindex]),l.gzindex++;l.gzhead.hcrc&&l.pending>p&&(b.adler=H(b.adler,l.pending_buf,l.pending-p,p));l.gzindex===l.gzhead.extra.length&&(l.gzindex=0,l.status=73)}else l.status=73;if(73===l.status)if(l.gzhead.name){p=l.pending;do{if(l.pending===l.pending_buf_size&&(l.gzhead.hcrc&&l.pending>p&&
|
|
(b.adler=H(b.adler,l.pending_buf,l.pending-p,p)),g(b),p=l.pending,l.pending===l.pending_buf_size)){G=1;break}G=l.gzindex<l.gzhead.name.length?255&l.gzhead.name.charCodeAt(l.gzindex++):0;k(l,G)}while(0!==G);l.gzhead.hcrc&&l.pending>p&&(b.adler=H(b.adler,l.pending_buf,l.pending-p,p));0===G&&(l.gzindex=0,l.status=91)}else l.status=91;if(91===l.status)if(l.gzhead.comment){p=l.pending;do{if(l.pending===l.pending_buf_size&&(l.gzhead.hcrc&&l.pending>p&&(b.adler=H(b.adler,l.pending_buf,l.pending-p,p)),g(b),
|
|
p=l.pending,l.pending===l.pending_buf_size)){G=1;break}G=l.gzindex<l.gzhead.comment.length?255&l.gzhead.comment.charCodeAt(l.gzindex++):0;k(l,G)}while(0!==G);l.gzhead.hcrc&&l.pending>p&&(b.adler=H(b.adler,l.pending_buf,l.pending-p,p));0===G&&(l.status=103)}else l.status=103;if(103===l.status&&(l.gzhead.hcrc?(l.pending+2>l.pending_buf_size&&g(b),l.pending+2<=l.pending_buf_size&&(k(l,255&b.adler),k(l,b.adler>>8&255),b.adler=0,l.status=Y)):l.status=Y),0!==l.pending){if(g(b),0===b.avail_out)return l.last_flush=
|
|
-1,J}else if(0===b.avail_in&&(c<<1)-(4<c?9:0)<=(d<<1)-(4<d?9:0)&&c!==D)return e(b,-5);if(666===l.status&&0!==b.avail_in)return e(b,-5);if(0!==b.avail_in||0!==l.lookahead||c!==A&&666!==l.status){var q;if(2===l.strategy)a:{for(var r;;){if(0===l.lookahead&&(n(l),0===l.lookahead)){if(c===A){q=Q;break a}break}if(l.match_length=0,r=K._tr_tally(l,0,l.window[l.strstart]),l.lookahead--,l.strstart++,r&&(h(l,!1),0===l.strm.avail_out)){q=Q;break a}}q=(l.insert=0,c===D?(h(l,!0),0===l.strm.avail_out?X:S):l.last_lit&&
|
|
(h(l,!1),0===l.strm.avail_out)?Q:W)}else if(3===l.strategy)a:{var C,B;for(r=l.window;;){if(l.lookahead<=M){if(n(l),l.lookahead<=M&&c===A){q=Q;break a}if(0===l.lookahead)break}if(l.match_length=0,l.lookahead>=E&&0<l.strstart&&(B=l.strstart-1,C=r[B],C===r[++B]&&C===r[++B]&&C===r[++B])){d=l.strstart+M;do;while(C===r[++B]&&C===r[++B]&&C===r[++B]&&C===r[++B]&&C===r[++B]&&C===r[++B]&&C===r[++B]&&C===r[++B]&&B<d);l.match_length=M-(d-B);l.match_length>l.lookahead&&(l.match_length=l.lookahead)}if(l.match_length>=
|
|
E?(q=K._tr_tally(l,1,l.match_length-E),l.lookahead-=l.match_length,l.strstart+=l.match_length,l.match_length=0):(q=K._tr_tally(l,0,l.window[l.strstart]),l.lookahead--,l.strstart++),q&&(h(l,!1),0===l.strm.avail_out)){q=Q;break a}}q=(l.insert=0,c===D?(h(l,!0),0===l.strm.avail_out?X:S):l.last_lit&&(h(l,!1),0===l.strm.avail_out)?Q:W)}else q=y[l.level].func(l,c);if(q!==X&&q!==S||(l.status=666),q===Q||q===X)return 0===b.avail_out&&(l.last_flush=-1),J;if(q===W&&(1===c?K._tr_align(l):5!==c&&(K._tr_stored_block(l,
|
|
0,0,!1),3===c&&(f(l.head),0===l.lookahead&&(l.strstart=0,l.block_start=0,l.insert=0))),g(b),0===b.avail_out))return l.last_flush=-1,J}return c!==D?J:0>=l.wrap?1:(2===l.wrap?(k(l,255&b.adler),k(l,b.adler>>8&255),k(l,b.adler>>16&255),k(l,b.adler>>24&255),k(l,255&b.total_in),k(l,b.total_in>>8&255),k(l,b.total_in>>16&255),k(l,b.total_in>>24&255)):(m(l,b.adler>>>16),m(l,65535&b.adler)),g(b),0<l.wrap&&(l.wrap=-l.wrap),0!==l.pending?J:1)};d.deflateEnd=function(b){var c;return b&&b.state?(c=b.state.status,
|
|
c!==$&&69!==c&&73!==c&&91!==c&&103!==c&&c!==Y&&666!==c?e(b,P):(b.state=null,c===Y?e(b,-3):J)):P};d.deflateSetDictionary=function(b,c){var d,e,g,h,k,l,m;e=c.length;if(!b||!b.state||(d=b.state,h=d.wrap,2===h||1===h&&d.status!==$||d.lookahead))return P;1===h&&(b.adler=F(b.adler,c,e,0));d.wrap=0;e>=d.w_size&&(0===h&&(f(d.head),d.strstart=0,d.block_start=0,d.insert=0),k=new v.Buf8(d.w_size),v.arraySet(k,c,e-d.w_size,d.w_size,0),c=k,e=d.w_size);k=b.avail_in;l=b.next_in;m=b.input;b.avail_in=e;b.next_in=
|
|
0;b.input=c;for(n(d);d.lookahead>=E;){e=d.strstart;g=d.lookahead-(E-1);do d.ins_h=(d.ins_h<<d.hash_shift^d.window[e+E-1])&d.hash_mask,d.prev[e&d.w_mask]=d.head[d.ins_h],d.head[d.ins_h]=e,e++;while(--g);d.strstart=e;d.lookahead=E-1;n(d)}return d.strstart+=d.lookahead,d.block_start=d.strstart,d.insert=d.lookahead,d.lookahead=0,d.match_length=d.prev_length=E-1,d.match_available=0,b.next_in=l,b.input=m,b.avail_in=k,d.wrap=h,J};d.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":3,"./adler32":5,
|
|
"./crc32":7,"./messages":13,"./trees":14}],9:[function(b,c,d){c.exports=function(){this.os=this.xflags=this.time=this.text=0;this.extra=null;this.extra_len=0;this.comment=this.name="";this.hcrc=0;this.done=!1}},{}],10:[function(b,c,d){c.exports=function(b,c){var d,h,k,m,l,n,p,r,q,s,u,t,z,y,v,K,F,H,B,A,D,J,P,O;d=b.state;h=b.next_in;P=b.input;k=h+(b.avail_in-5);m=b.next_out;O=b.output;l=m-(c-b.avail_out);n=m+(b.avail_out-257);p=d.dmax;r=d.wsize;q=d.whave;s=d.wnext;u=d.window;t=d.hold;z=d.bits;y=d.lencode;
|
|
v=d.distcode;K=(1<<d.lenbits)-1;F=(1<<d.distbits)-1;a:do{15>z&&(t+=P[h++]<<z,z+=8,t+=P[h++]<<z,z+=8);H=y[t&K];b:for(;;){if(B=H>>>24,t>>>=B,z-=B,B=H>>>16&255,0===B)O[m++]=65535&H;else{if(!(16&B)){if(0===(64&B)){H=y[(65535&H)+(t&(1<<B)-1)];continue b}if(32&B){d.mode=12;break a}b.msg="invalid literal/length code";d.mode=30;break a}A=65535&H;(B&=15)&&(z<B&&(t+=P[h++]<<z,z+=8),A+=t&(1<<B)-1,t>>>=B,z-=B);15>z&&(t+=P[h++]<<z,z+=8,t+=P[h++]<<z,z+=8);H=v[t&F];c:for(;;){if(B=H>>>24,t>>>=B,z-=B,B=H>>>16&255,
|
|
!(16&B)){if(0===(64&B)){H=v[(65535&H)+(t&(1<<B)-1)];continue c}b.msg="invalid distance code";d.mode=30;break a}if(D=65535&H,B&=15,z<B&&(t+=P[h++]<<z,z+=8,z<B&&(t+=P[h++]<<z,z+=8)),D+=t&(1<<B)-1,D>p){b.msg="invalid distance too far back";d.mode=30;break a}if(t>>>=B,z-=B,B=m-l,D>B){if(B=D-B,B>q&&d.sane){b.msg="invalid distance too far back";d.mode=30;break a}if(H=0,J=u,0===s){if(H+=r-B,B<A){A-=B;do O[m++]=u[H++];while(--B);H=m-D;J=O}}else if(s<B){if(H+=r+s-B,B-=s,B<A){A-=B;do O[m++]=u[H++];while(--B);
|
|
if(H=0,s<A){B=s;A-=B;do O[m++]=u[H++];while(--B);H=m-D;J=O}}}else if(H+=s-B,B<A){A-=B;do O[m++]=u[H++];while(--B);H=m-D;J=O}for(;2<A;)O[m++]=J[H++],O[m++]=J[H++],O[m++]=J[H++],A-=3;A&&(O[m++]=J[H++],1<A&&(O[m++]=J[H++]))}else{H=m-D;do O[m++]=O[H++],O[m++]=O[H++],O[m++]=O[H++],A-=3;while(2<A);A&&(O[m++]=O[H++],1<A&&(O[m++]=O[H++]))}break}}break}}while(h<k&&m<n);A=z>>3;h-=A;z-=A<<3;b.next_in=h;b.next_out=m;b.avail_in=h<k?5+(k-h):5-(h-k);b.avail_out=m<n?257+(n-m):257-(m-n);d.hold=t&(1<<z)-1;d.bits=z}},
|
|
{}],11:[function(b,c,d){function e(b){return(b>>>24&255)+(b>>>8&65280)+((65280&b)<<8)+((255&b)<<24)}function f(){this.mode=0;this.last=!1;this.wrap=0;this.havedict=!1;this.total=this.check=this.dmax=this.flags=0;this.head=null;this.wnext=this.whave=this.wsize=this.wbits=0;this.window=null;this.extra=this.offset=this.length=this.bits=this.hold=0;this.distcode=this.lencode=null;this.have=this.ndist=this.nlen=this.ncode=this.distbits=this.lenbits=0;this.next=null;this.lens=new r.Buf16(320);this.work=
|
|
new r.Buf16(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function g(b){var c;return b&&b.state?(c=b.state,b.total_in=b.total_out=c.total=0,b.msg="",c.wrap&&(b.adler=1&c.wrap),c.mode=v,c.last=0,c.havedict=0,c.dmax=32768,c.head=null,c.hold=0,c.bits=0,c.lencode=c.lendyn=new r.Buf32(K),c.distcode=c.distdyn=new r.Buf32(F),c.sane=1,c.back=-1,z):y}function h(b){var c;return b&&b.state?(c=b.state,c.wsize=0,c.whave=0,c.wnext=0,g(b)):y}function k(b,c){var d,e;return b&&b.state?(e=b.state,
|
|
0>c?(d=0,c=-c):(d=(c>>4)+1,48>c&&(c&=15)),c&&(8>c||15<c)?y:(null!==e.window&&e.wbits!==c&&(e.window=null),e.wrap=d,e.wbits=c,h(b))):y}function m(b,c){var d,e;return b?(e=new f,b.state=e,e.window=null,d=k(b,c),d!==z&&(b.state=null),d):y}function l(b,c,d,e){var f;b=b.state;return null===b.window&&(b.wsize=1<<b.wbits,b.wnext=0,b.whave=0,b.window=new r.Buf8(b.wsize)),e>=b.wsize?(r.arraySet(b.window,c,d-b.wsize,b.wsize,0),b.wnext=0,b.whave=b.wsize):(f=b.wsize-b.wnext,f>e&&(f=e),r.arraySet(b.window,c,d-
|
|
e,f,b.wnext),e-=f,e?(r.arraySet(b.window,c,d-e,e,0),b.wnext=e,b.whave=b.wsize):(b.wnext+=f,b.wnext===b.wsize&&(b.wnext=0),b.whave<b.wsize&&(b.whave+=f))),0}var n,p,r=b("../utils/common"),q=b("./adler32"),s=b("./crc32"),u=b("./inffast"),t=b("./inftrees"),z=0,y=-2,v=1,K=852,F=592,H=!0;d.inflateReset=h;d.inflateReset2=k;d.inflateResetKeep=g;d.inflateInit=function(b){return m(b,15)};d.inflateInit2=m;d.inflate=function(b,c){var d,f,g,h,k,m,F,w,x,K,N,I,G,C,E,M,R,$,Y,Q,W,X,S=0,L=new r.Buf8(4),fa=[16,17,
|
|
18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!b||!b.state||!b.output||!b.input&&0!==b.avail_in)return y;d=b.state;12===d.mode&&(d.mode=13);k=b.next_out;g=b.output;F=b.avail_out;h=b.next_in;f=b.input;m=b.avail_in;w=d.hold;x=d.bits;K=m;N=F;W=z;a:for(;;)switch(d.mode){case v:if(0===d.wrap){d.mode=13;break}for(;16>x;){if(0===m)break a;m--;w+=f[h++]<<x;x+=8}if(2&d.wrap&&35615===w){d.check=0;L[0]=255&w;L[1]=w>>>8&255;d.check=s(d.check,L,2,0);x=w=0;d.mode=2;break}if(d.flags=0,d.head&&(d.head.done=!1),!(1&
|
|
d.wrap)||(((255&w)<<8)+(w>>8))%31){b.msg="incorrect header check";d.mode=30;break}if(8!==(15&w)){b.msg="unknown compression method";d.mode=30;break}if(w>>>=4,x-=4,Q=(15&w)+8,0===d.wbits)d.wbits=Q;else if(Q>d.wbits){b.msg="invalid window size";d.mode=30;break}d.dmax=1<<Q;b.adler=d.check=1;d.mode=512&w?10:12;x=w=0;break;case 2:for(;16>x;){if(0===m)break a;m--;w+=f[h++]<<x;x+=8}if(d.flags=w,8!==(255&d.flags)){b.msg="unknown compression method";d.mode=30;break}if(57344&d.flags){b.msg="unknown header flags set";
|
|
d.mode=30;break}d.head&&(d.head.text=w>>8&1);512&d.flags&&(L[0]=255&w,L[1]=w>>>8&255,d.check=s(d.check,L,2,0));x=w=0;d.mode=3;case 3:for(;32>x;){if(0===m)break a;m--;w+=f[h++]<<x;x+=8}d.head&&(d.head.time=w);512&d.flags&&(L[0]=255&w,L[1]=w>>>8&255,L[2]=w>>>16&255,L[3]=w>>>24&255,d.check=s(d.check,L,4,0));x=w=0;d.mode=4;case 4:for(;16>x;){if(0===m)break a;m--;w+=f[h++]<<x;x+=8}d.head&&(d.head.xflags=255&w,d.head.os=w>>8);512&d.flags&&(L[0]=255&w,L[1]=w>>>8&255,d.check=s(d.check,L,2,0));x=w=0;d.mode=
|
|
5;case 5:if(1024&d.flags){for(;16>x;){if(0===m)break a;m--;w+=f[h++]<<x;x+=8}d.length=w;d.head&&(d.head.extra_len=w);512&d.flags&&(L[0]=255&w,L[1]=w>>>8&255,d.check=s(d.check,L,2,0));x=w=0}else d.head&&(d.head.extra=null);d.mode=6;case 6:if(1024&d.flags&&(I=d.length,I>m&&(I=m),I&&(d.head&&(Q=d.head.extra_len-d.length,d.head.extra||(d.head.extra=Array(d.head.extra_len)),r.arraySet(d.head.extra,f,h,I,Q)),512&d.flags&&(d.check=s(d.check,f,I,h)),m-=I,h+=I,d.length-=I),d.length))break a;d.length=0;d.mode=
|
|
7;case 7:if(2048&d.flags){if(0===m)break a;I=0;do Q=f[h+I++],d.head&&Q&&65536>d.length&&(d.head.name+=String.fromCharCode(Q));while(Q&&I<m);if(512&d.flags&&(d.check=s(d.check,f,I,h)),m-=I,h+=I,Q)break a}else d.head&&(d.head.name=null);d.length=0;d.mode=8;case 8:if(4096&d.flags){if(0===m)break a;I=0;do Q=f[h+I++],d.head&&Q&&65536>d.length&&(d.head.comment+=String.fromCharCode(Q));while(Q&&I<m);if(512&d.flags&&(d.check=s(d.check,f,I,h)),m-=I,h+=I,Q)break a}else d.head&&(d.head.comment=null);d.mode=
|
|
9;case 9:if(512&d.flags){for(;16>x;){if(0===m)break a;m--;w+=f[h++]<<x;x+=8}if(w!==(65535&d.check)){b.msg="header crc mismatch";d.mode=30;break}x=w=0}d.head&&(d.head.hcrc=d.flags>>9&1,d.head.done=!0);b.adler=d.check=0;d.mode=12;break;case 10:for(;32>x;){if(0===m)break a;m--;w+=f[h++]<<x;x+=8}b.adler=d.check=e(w);x=w=0;d.mode=11;case 11:if(0===d.havedict)return b.next_out=k,b.avail_out=F,b.next_in=h,b.avail_in=m,d.hold=w,d.bits=x,2;b.adler=d.check=1;d.mode=12;case 12:if(5===c||6===c)break a;case 13:if(d.last){w>>>=
|
|
7&x;x-=7&x;d.mode=27;break}for(;3>x;){if(0===m)break a;m--;w+=f[h++]<<x;x+=8}switch(d.last=1&w,w>>>=1,x-=1,3&w){case 0:d.mode=14;break;case 1:C=d;if(H){M=void 0;n=new r.Buf32(512);p=new r.Buf32(32);for(M=0;144>M;)C.lens[M++]=8;for(;256>M;)C.lens[M++]=9;for(;280>M;)C.lens[M++]=7;for(;288>M;)C.lens[M++]=8;t(1,C.lens,0,288,n,0,C.work,{bits:9});for(M=0;32>M;)C.lens[M++]=5;t(2,C.lens,0,32,p,0,C.work,{bits:5});H=!1}C.lencode=n;C.lenbits=9;C.distcode=p;C.distbits=5;if(d.mode=20,6===c){w>>>=2;x-=2;break a}break;
|
|
case 2:d.mode=17;break;case 3:b.msg="invalid block type",d.mode=30}w>>>=2;x-=2;break;case 14:w>>>=7&x;for(x-=7&x;32>x;){if(0===m)break a;m--;w+=f[h++]<<x;x+=8}if((65535&w)!==(w>>>16^65535)){b.msg="invalid stored block lengths";d.mode=30;break}if(d.length=65535&w,w=0,x=0,d.mode=15,6===c)break a;case 15:d.mode=16;case 16:if(I=d.length){if(I>m&&(I=m),I>F&&(I=F),0===I)break a;r.arraySet(g,f,h,I,k);m-=I;h+=I;F-=I;k+=I;d.length-=I;break}d.mode=12;break;case 17:for(;14>x;){if(0===m)break a;m--;w+=f[h++]<<
|
|
x;x+=8}if(d.nlen=(31&w)+257,w>>>=5,x-=5,d.ndist=(31&w)+1,w>>>=5,x-=5,d.ncode=(15&w)+4,w>>>=4,x-=4,286<d.nlen||30<d.ndist){b.msg="too many length or distance symbols";d.mode=30;break}d.have=0;d.mode=18;case 18:for(;d.have<d.ncode;){for(;3>x;){if(0===m)break a;m--;w+=f[h++]<<x;x+=8}d.lens[fa[d.have++]]=7&w;w>>>=3;x-=3}for(;19>d.have;)d.lens[fa[d.have++]]=0;if(d.lencode=d.lendyn,d.lenbits=7,X={bits:d.lenbits},W=t(0,d.lens,0,19,d.lencode,0,d.work,X),d.lenbits=X.bits,W){b.msg="invalid code lengths set";
|
|
d.mode=30;break}d.have=0;d.mode=19;case 19:for(;d.have<d.nlen+d.ndist;){for(;S=d.lencode[w&(1<<d.lenbits)-1],E=S>>>24,M=65535&S,!(E<=x);){if(0===m)break a;m--;w+=f[h++]<<x;x+=8}if(16>M)w>>>=E,x-=E,d.lens[d.have++]=M;else{if(16===M){for(C=E+2;x<C;){if(0===m)break a;m--;w+=f[h++]<<x;x+=8}if(w>>>=E,x-=E,0===d.have){b.msg="invalid bit length repeat";d.mode=30;break}Q=d.lens[d.have-1];I=3+(3&w);w>>>=2;x-=2}else if(17===M){for(C=E+3;x<C;){if(0===m)break a;m--;w+=f[h++]<<x;x+=8}w>>>=E;x-=E;Q=0;I=3+(7&w);
|
|
w>>>=3;x-=3}else{for(C=E+7;x<C;){if(0===m)break a;m--;w+=f[h++]<<x;x+=8}w>>>=E;x-=E;Q=0;I=11+(127&w);w>>>=7;x-=7}if(d.have+I>d.nlen+d.ndist){b.msg="invalid bit length repeat";d.mode=30;break}for(;I--;)d.lens[d.have++]=Q}}if(30===d.mode)break;if(0===d.lens[256]){b.msg="invalid code -- missing end-of-block";d.mode=30;break}if(d.lenbits=9,X={bits:d.lenbits},W=t(1,d.lens,0,d.nlen,d.lencode,0,d.work,X),d.lenbits=X.bits,W){b.msg="invalid literal/lengths set";d.mode=30;break}if(d.distbits=6,d.distcode=d.distdyn,
|
|
X={bits:d.distbits},W=t(2,d.lens,d.nlen,d.ndist,d.distcode,0,d.work,X),d.distbits=X.bits,W){b.msg="invalid distances set";d.mode=30;break}if(d.mode=20,6===c)break a;case 20:d.mode=21;case 21:if(6<=m&&258<=F){b.next_out=k;b.avail_out=F;b.next_in=h;b.avail_in=m;d.hold=w;d.bits=x;u(b,N);k=b.next_out;g=b.output;F=b.avail_out;h=b.next_in;f=b.input;m=b.avail_in;w=d.hold;x=d.bits;12===d.mode&&(d.back=-1);break}for(d.back=0;S=d.lencode[w&(1<<d.lenbits)-1],E=S>>>24,C=S>>>16&255,M=65535&S,!(E<=x);){if(0===
|
|
m)break a;m--;w+=f[h++]<<x;x+=8}if(C&&0===(240&C)){R=E;$=C;for(Y=M;S=d.lencode[Y+((w&(1<<R+$)-1)>>R)],E=S>>>24,C=S>>>16&255,M=65535&S,!(R+E<=x);){if(0===m)break a;m--;w+=f[h++]<<x;x+=8}w>>>=R;x-=R;d.back+=R}if(w>>>=E,x-=E,d.back+=E,d.length=M,0===C){d.mode=26;break}if(32&C){d.back=-1;d.mode=12;break}if(64&C){b.msg="invalid literal/length code";d.mode=30;break}d.extra=15&C;d.mode=22;case 22:if(d.extra){for(C=d.extra;x<C;){if(0===m)break a;m--;w+=f[h++]<<x;x+=8}d.length+=w&(1<<d.extra)-1;w>>>=d.extra;
|
|
x-=d.extra;d.back+=d.extra}d.was=d.length;d.mode=23;case 23:for(;S=d.distcode[w&(1<<d.distbits)-1],E=S>>>24,C=S>>>16&255,M=65535&S,!(E<=x);){if(0===m)break a;m--;w+=f[h++]<<x;x+=8}if(0===(240&C)){R=E;$=C;for(Y=M;S=d.distcode[Y+((w&(1<<R+$)-1)>>R)],E=S>>>24,C=S>>>16&255,M=65535&S,!(R+E<=x);){if(0===m)break a;m--;w+=f[h++]<<x;x+=8}w>>>=R;x-=R;d.back+=R}if(w>>>=E,x-=E,d.back+=E,64&C){b.msg="invalid distance code";d.mode=30;break}d.offset=M;d.extra=15&C;d.mode=24;case 24:if(d.extra){for(C=d.extra;x<C;){if(0===
|
|
m)break a;m--;w+=f[h++]<<x;x+=8}d.offset+=w&(1<<d.extra)-1;w>>>=d.extra;x-=d.extra;d.back+=d.extra}if(d.offset>d.dmax){b.msg="invalid distance too far back";d.mode=30;break}d.mode=25;case 25:if(0===F)break a;if(I=N-F,d.offset>I){if(I=d.offset-I,I>d.whave&&d.sane){b.msg="invalid distance too far back";d.mode=30;break}I>d.wnext?(I-=d.wnext,G=d.wsize-I):G=d.wnext-I;I>d.length&&(I=d.length);C=d.window}else C=g,G=k-d.offset,I=d.length;I>F&&(I=F);F-=I;d.length-=I;do g[k++]=C[G++];while(--I);0===d.length&&
|
|
(d.mode=21);break;case 26:if(0===F)break a;g[k++]=d.length;F--;d.mode=21;break;case 27:if(d.wrap){for(;32>x;){if(0===m)break a;m--;w|=f[h++]<<x;x+=8}if(N-=F,b.total_out+=N,d.total+=N,N&&(b.adler=d.check=d.flags?s(d.check,g,N,k-N):q(d.check,g,N,k-N)),N=F,(d.flags?w:e(w))!==d.check){b.msg="incorrect data check";d.mode=30;break}x=w=0}d.mode=28;case 28:if(d.wrap&&d.flags){for(;32>x;){if(0===m)break a;m--;w+=f[h++]<<x;x+=8}if(w!==(4294967295&d.total)){b.msg="incorrect length check";d.mode=30;break}x=w=
|
|
0}d.mode=29;case 29:W=1;break a;case 30:W=-3;break a;case 31:return-4;default:return y}return b.next_out=k,b.avail_out=F,b.next_in=h,b.avail_in=m,d.hold=w,d.bits=x,(d.wsize||N!==b.avail_out&&30>d.mode&&(27>d.mode||4!==c))&&l(b,b.output,b.next_out,N-b.avail_out)?(d.mode=31,-4):(K-=b.avail_in,N-=b.avail_out,b.total_in+=K,b.total_out+=N,d.total+=N,d.wrap&&N&&(b.adler=d.check=d.flags?s(d.check,g,N,b.next_out-N):q(d.check,g,N,b.next_out-N)),b.data_type=d.bits+(d.last?64:0)+(12===d.mode?128:0)+(20===d.mode||
|
|
15===d.mode?256:0),(0===K&&0===N||4===c)&&W===z&&(W=-5),W)};d.inflateEnd=function(b){if(!b||!b.state)return y;var c=b.state;return c.window&&(c.window=null),b.state=null,z};d.inflateGetHeader=function(b,c){var d;return b&&b.state?(d=b.state,0===(2&d.wrap)?y:(d.head=c,c.done=!1,z)):y};d.inflateSetDictionary=function(b,c){var d,e,f=c.length;return b&&b.state?(d=b.state,0!==d.wrap&&11!==d.mode?y:11===d.mode&&(e=1,e=q(e,c,f,0),e!==d.check)?-3:l(b,c,f,f)?(d.mode=31,-4):(d.havedict=1,z)):y};d.inflateInfo=
|
|
"pako inflate (from Nodeca project)"},{"../utils/common":3,"./adler32":5,"./crc32":7,"./inffast":10,"./inftrees":12}],12:[function(b,c,d){var e=b("../utils/common"),f=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],g=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],h=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],k=[16,16,16,16,17,17,18,18,
|
|
19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];c.exports=function(b,c,d,p,r,q,s,u){var t,z,y,v,K,F,H,B;v=u.bits;for(var A=0,D=0,J=0,P=0,O=0,T=0,V=0,aa=t=0,w=0,x=null,ba=0,N=new e.Buf16(16),T=new e.Buf16(16),I=null,G=0,A=0;15>=A;A++)N[A]=0;for(D=0;D<p;D++)N[c[d+D]]++;O=v;for(P=15;1<=P&&0===N[P];P--);if(O>P&&(O=P),0===P)return r[q++]=20971520,r[q++]=20971520,u.bits=1,0;for(J=1;J<P&&0===N[J];J++);O<J&&(O=J);for(A=t=1;15>=A;A++)if(t<<=1,t-=N[A],0>t)return-1;if(0<t&&(0===b||1!==
|
|
P))return-1;T[1]=0;for(A=1;15>A;A++)T[A+1]=T[A]+N[A];for(D=0;D<p;D++)0!==c[d+D]&&(s[T[c[d+D]]++]=D);if(0===b?(x=I=s,K=19):1===b?(x=f,ba-=257,I=g,G-=257,K=256):(x=h,I=k,K=-1),w=0,D=0,A=J,v=q,T=O,V=0,y=-1,aa=1<<O,p=aa-1,1===b&&852<aa||2===b&&592<aa)return 1;for(var C=0;;){C++;F=A-V;s[D]<K?(H=0,B=s[D]):s[D]>K?(H=I[G+s[D]],B=x[ba+s[D]]):(H=96,B=0);t=1<<A-V;J=z=1<<T;do z-=t,r[v+(w>>V)+z]=F<<24|H<<16|B|0;while(0!==z);for(t=1<<A-1;w&t;)t>>=1;if(0!==t?(w&=t-1,w+=t):w=0,D++,0===--N[A]){if(A===P)break;A=c[d+
|
|
s[D]]}if(A>O&&(w&p)!==y){0===V&&(V=O);v+=J;T=A-V;for(t=1<<T;T+V<P&&(t-=N[T+V],!(0>=t));)T++,t<<=1;if(aa+=1<<T,1===b&&852<aa||2===b&&592<aa)return 1;y=w&p;r[y]=O<<24|T<<16|v-q|0}}return 0!==w&&(r[v+w]=A-V<<24|4194304),u.bits=O,0}},{"../utils/common":3}],13:[function(b,c,d){c.exports={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"}},{}],14:[function(b,c,d){function e(b){for(var c=
|
|
b.length;0<=--c;)b[c]=0}function f(b,c,d,e,f){this.static_tree=b;this.extra_bits=c;this.extra_base=d;this.elems=e;this.max_length=f;this.has_stree=b&&b.length}function g(b,c){this.dyn_tree=b;this.max_code=0;this.stat_desc=c}function h(b,c){b.pending_buf[b.pending++]=255&c;b.pending_buf[b.pending++]=c>>>8&255}function k(b,c,d){b.bi_valid>aa-d?(b.bi_buf|=c<<b.bi_valid&65535,h(b,b.bi_buf),b.bi_buf=c>>aa-b.bi_valid,b.bi_valid+=d-aa):(b.bi_buf|=c<<b.bi_valid&65535,b.bi_valid+=d)}function m(b,c,d){k(b,
|
|
d[2*c],d[2*c+1])}function l(b,c){var d=0;do d|=1&b,b>>>=1,d<<=1;while(0<--c);return d>>>1}function n(b,c,d){var e,f=Array(V+1),g=0;for(e=1;e<=V;e++)f[e]=g=g+d[e-1]<<1;for(d=0;d<=c;d++)e=b[2*d+1],0!==e&&(b[2*d]=l(f[e]++,e))}function p(b){var c;for(c=0;c<J;c++)b.dyn_ltree[2*c]=0;for(c=0;c<P;c++)b.dyn_dtree[2*c]=0;for(c=0;c<O;c++)b.bl_tree[2*c]=0;b.dyn_ltree[2*w]=1;b.opt_len=b.static_len=0;b.last_lit=b.matches=0}function r(b){8<b.bi_valid?h(b,b.bi_buf):0<b.bi_valid&&(b.pending_buf[b.pending++]=b.bi_buf);
|
|
b.bi_buf=0;b.bi_valid=0}function q(b,c,d,e){var f=2*c,g=2*d;return b[f]<b[g]||b[f]===b[g]&&e[c]<=e[d]}function s(b,c,d){for(var e=b.heap[d],f=d<<1;f<=b.heap_len&&(f<b.heap_len&&q(c,b.heap[f+1],b.heap[f],b.depth)&&f++,!q(c,e,b.heap[f],b.depth));)b.heap[d]=b.heap[f],d=f,f<<=1;b.heap[d]=e}function u(b,c,d){var e,f,g,h,l=0;if(0!==b.last_lit){do e=b.pending_buf[b.d_buf+2*l]<<8|b.pending_buf[b.d_buf+2*l+1],f=b.pending_buf[b.l_buf+l],l++,0===e?m(b,f,c):(g=Y[f],m(b,g+D+1,c),h=I[g],0!==h&&(f-=Q[g],k(b,f,h)),
|
|
e--,g=256>e?$[e]:$[256+(e>>>7)],m(b,g,d),h=G[g],0!==h&&(e-=W[g],k(b,e,h)));while(l<b.last_lit)}m(b,w,c)}function t(b,c){var d,e,f,g=c.dyn_tree;e=c.stat_desc.static_tree;var h=c.stat_desc.has_stree,k=c.stat_desc.elems,m=-1;b.heap_len=0;b.heap_max=T;for(d=0;d<k;d++)0!==g[2*d]?(b.heap[++b.heap_len]=m=d,b.depth[d]=0):g[2*d+1]=0;for(;2>b.heap_len;)f=b.heap[++b.heap_len]=2>m?++m:0,g[2*f]=1,b.depth[f]=0,b.opt_len--,h&&(b.static_len-=e[2*f+1]);c.max_code=m;for(d=b.heap_len>>1;1<=d;d--)s(b,g,d);f=k;do d=b.heap[1],
|
|
b.heap[1]=b.heap[b.heap_len--],s(b,g,1),e=b.heap[1],b.heap[--b.heap_max]=d,b.heap[--b.heap_max]=e,g[2*f]=g[2*d]+g[2*e],b.depth[f]=(b.depth[d]>=b.depth[e]?b.depth[d]:b.depth[e])+1,g[2*d+1]=g[2*e+1]=f,b.heap[1]=f++,s(b,g,1);while(2<=b.heap_len);b.heap[--b.heap_max]=b.heap[1];var l,p,h=c.dyn_tree,k=c.max_code,G=c.stat_desc.static_tree,q=c.stat_desc.has_stree,r=c.stat_desc.extra_bits,C=c.stat_desc.extra_base,E=c.stat_desc.max_length,t=0;for(e=0;e<=V;e++)b.bl_count[e]=0;h[2*b.heap[b.heap_max]+1]=0;for(d=
|
|
b.heap_max+1;d<T;d++)f=b.heap[d],e=h[2*h[2*f+1]+1]+1,e>E&&(e=E,t++),h[2*f+1]=e,f>k||(b.bl_count[e]++,l=0,f>=C&&(l=r[f-C]),p=h[2*f],b.opt_len+=p*(e+l),q&&(b.static_len+=p*(G[2*f+1]+l)));if(0!==t){do{for(e=E-1;0===b.bl_count[e];)e--;b.bl_count[e]--;b.bl_count[e+1]+=2;b.bl_count[E]--;t-=2}while(0<t);for(e=E;0!==e;e--)for(f=b.bl_count[e];0!==f;)l=b.heap[--d],l>k||(h[2*l+1]!==e&&(b.opt_len+=(e-h[2*l+1])*h[2*l],h[2*l+1]=e),f--)}n(g,m,b.bl_count)}function z(b,c,d){var e,f,g=-1,h=c[1],k=0,m=7,l=4;0===h&&
|
|
(m=138,l=3);c[2*(d+1)+1]=65535;for(e=0;e<=d;e++)f=h,h=c[2*(e+1)+1],++k<m&&f===h||(k<l?b.bl_tree[2*f]+=k:0!==f?(f!==g&&b.bl_tree[2*f]++,b.bl_tree[2*x]++):10>=k?b.bl_tree[2*ba]++:b.bl_tree[2*N]++,k=0,g=f,0===h?(m=138,l=3):f===h?(m=6,l=3):(m=7,l=4))}function y(b,c,d){var e,f,g=-1,h=c[1],l=0,n=7,p=4;0===h&&(n=138,p=3);for(e=0;e<=d;e++)if(f=h,h=c[2*(e+1)+1],!(++l<n&&f===h)){if(l<p){do m(b,f,b.bl_tree);while(0!==--l)}else 0!==f?(f!==g&&(m(b,f,b.bl_tree),l--),m(b,x,b.bl_tree),k(b,l-3,2)):10>=l?(m(b,ba,b.bl_tree),
|
|
k(b,l-3,3)):(m(b,N,b.bl_tree),k(b,l-11,7));l=0;g=f;0===h?(n=138,p=3):f===h?(n=6,p=3):(n=7,p=4)}}function v(b){var c,d=4093624447;for(c=0;31>=c;c++,d>>>=1)if(1&d&&0!==b.dyn_ltree[2*c])return H;if(0!==b.dyn_ltree[18]||0!==b.dyn_ltree[20]||0!==b.dyn_ltree[26])return B;for(c=32;c<D;c++)if(0!==b.dyn_ltree[2*c])return B;return H}function K(b,c,d,e){k(b,(A<<1)+(e?1:0),3);r(b);h(b,d);h(b,~d);F.arraySet(b.pending_buf,b.window,c,d,b.pending);b.pending+=d}var F=b("../utils/common"),H=0,B=1,A=0,D=256,J=D+1+29,
|
|
P=30,O=19,T=2*J+1,V=15,aa=16,w=256,x=16,ba=17,N=18,I=[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],G=[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],C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],E=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],M=Array(2*(J+2));e(M);var R=Array(2*P);e(R);var $=Array(512);e($);var Y=Array(256);e(Y);var Q=Array(29);e(Q);var W=Array(P);e(W);var X,S,L,fa=!1;d._tr_init=function(b){if(!fa){var c,d,e,h=Array(V+1);for(e=d=0;28>e;e++){Q[e]=
|
|
d;for(c=0;c<1<<I[e];c++)Y[d++]=e}Y[d-1]=e;for(e=d=0;16>e;e++){W[e]=d;for(c=0;c<1<<G[e];c++)$[d++]=e}for(d>>=7;e<P;e++){W[e]=d<<7;for(c=0;c<1<<G[e]-7;c++)$[256+d++]=e}for(c=0;c<=V;c++)h[c]=0;for(c=0;143>=c;)M[2*c+1]=8,c++,h[8]++;for(;255>=c;)M[2*c+1]=9,c++,h[9]++;for(;279>=c;)M[2*c+1]=7,c++,h[7]++;for(;287>=c;)M[2*c+1]=8,c++,h[8]++;n(M,J+1,h);for(c=0;c<P;c++)R[2*c+1]=5,R[2*c]=l(c,5);X=new f(M,I,D+1,J,V);S=new f(R,G,0,P,V);L=new f([],C,0,O,7);fa=!0}b.l_desc=new g(b.dyn_ltree,X);b.d_desc=new g(b.dyn_dtree,
|
|
S);b.bl_desc=new g(b.bl_tree,L);b.bi_buf=0;b.bi_valid=0;p(b)};d._tr_stored_block=K;d._tr_flush_block=function(b,c,d,e){var f,g,h=0;if(0<b.level){2===b.strm.data_type&&(b.strm.data_type=v(b));t(b,b.l_desc);t(b,b.d_desc);z(b,b.dyn_ltree,b.l_desc.max_code);z(b,b.dyn_dtree,b.d_desc.max_code);t(b,b.bl_desc);for(h=O-1;3<=h&&0===b.bl_tree[2*E[h]+1];h--);h=(b.opt_len+=3*(h+1)+14,h);f=b.opt_len+3+7>>>3;g=b.static_len+3+7>>>3;g<=f&&(f=g)}else f=g=d+5;if(d+4<=f&&-1!==c)K(b,c,d,e);else if(4===b.strategy||g===
|
|
f)k(b,2+(e?1:0),3),u(b,M,R);else{k(b,4+(e?1:0),3);c=b.l_desc.max_code+1;d=b.d_desc.max_code+1;h+=1;k(b,c-257,5);k(b,d-1,5);k(b,h-4,4);for(f=0;f<h;f++)k(b,b.bl_tree[2*E[f]+1],3);y(b,b.dyn_ltree,c-1);y(b,b.dyn_dtree,d-1);u(b,b.dyn_ltree,b.dyn_dtree)}p(b);e&&r(b)};d._tr_tally=function(b,c,d){return b.pending_buf[b.d_buf+2*b.last_lit]=c>>>8&255,b.pending_buf[b.d_buf+2*b.last_lit+1]=255&c,b.pending_buf[b.l_buf+b.last_lit]=255&d,b.last_lit++,0===c?b.dyn_ltree[2*d]++:(b.matches++,c--,b.dyn_ltree[2*(Y[d]+
|
|
D+1)]++,b.dyn_dtree[2*(256>c?$[c]:$[256+(c>>>7)])]++),b.last_lit===b.lit_bufsize-1};d._tr_align=function(b){k(b,2,3);m(b,w,M);16===b.bi_valid?(h(b,b.bi_buf),b.bi_buf=0,b.bi_valid=0):8<=b.bi_valid&&(b.pending_buf[b.pending++]=255&b.bi_buf,b.bi_buf>>=8,b.bi_valid-=8)}},{"../utils/common":3}],15:[function(b,c,d){c.exports=function(){this.input=null;this.total_in=this.avail_in=this.next_in=0;this.output=null;this.total_out=this.avail_out=this.next_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=
|
|
0}},{}],"/":[function(b,c,d){d=b("./lib/utils/common").assign;var e=b("./lib/deflate"),f=b("./lib/inflate");b=b("./lib/zlib/constants");var g={};d(g,e,f,b);c.exports=g},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")});var JSON;JSON||(JSON={});
|
|
(function(){function a(a){return 10>a?"0"+a:a}function b(a){e.lastIndex=0;return e.test(a)?'"'+a.replace(e,function(a){var b=h[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function c(a,d){var e,h,r,q,s=f,u,t=d[a];t&&"object"===typeof t&&"function"===typeof t.toJSON&&(t=t.toJSON(a));"function"===typeof k&&(t=k.call(d,a,t));switch(typeof t){case "string":return b(t);case "number":return isFinite(t)?""+t:"null";case "boolean":case "null":return""+t;
|
|
case "object":if(!t)return"null";f+=g;u=[];if("[object Array]"===Object.prototype.toString.apply(t)){q=t.length;for(e=0;e<q;e+=1)u[e]=c(e,t)||"null";r=0===u.length?"[]":f?"[\n"+f+u.join(",\n"+f)+"\n"+s+"]":"["+u.join(",")+"]";f=s;return r}if(k&&"object"===typeof k){q=k.length;for(e=0;e<q;e+=1)"string"===typeof k[e]&&(h=k[e],(r=c(h,t))&&u.push(b(h)+(f?": ":":")+r))}else for(h in t)Object.prototype.hasOwnProperty.call(t,h)&&(r=c(h,t))&&u.push(b(h)+(f?": ":":")+r);r=0===u.length?"{}":f?"{\n"+f+u.join(",\n"+
|
|
f)+"\n"+s+"}":"{"+u.join(",")+"}";f=s;return r}}"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var d=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
|
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
|
|
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
|
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();var mxBasePath="https://www.draw.io/mxgraph/",mxLoadStylesheets=mxLoadResources=!1,mxLanguage="en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||1E8;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||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"5.7.0.1",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
|
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT: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:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
|
|
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
|
|
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
|
|
0<=navigator.userAgent.indexOf("Epiphany/")||0<=navigator.userAgent.indexOf("AppleWebKit/")||0<=navigator.userAgent.indexOf("Gecko/")||0<=navigator.userAgent.indexOf("Opera/")||null!=document.documentMode&&9<=document.documentMode,NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!=document.createElementNS("http://www.w3.org/2000/svg","foreignObject")||0<=navigator.userAgent.indexOf("Opera/"),IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_WIN:0<navigator.appVersion.indexOf("Win"),
|
|
IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:null!=window.PointerEvent,IS_LOCAL:0>document.location.href.indexOf("http://")&&0>document.location.href.indexOf("https://"),isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(a,b,c){c=c||document;if(mxClient.IS_IE6)c.write('\x3clink rel\x3d"'+a+'" href\x3d"'+b+'" charset\x3d"ISO-8859-1" type\x3d"text/css"/\x3e');else{var d=c.createElement("link");d.setAttribute("rel",
|
|
a);d.setAttribute("href",b);d.setAttribute("charset","ISO-8859-1");d.setAttribute("type","text/css");c.getElementsByTagName("head")[0].appendChild(d)}},include:function(a){document.write('\x3cscript src\x3d"'+a+'"\x3e\x3c/script\x3e')},dispose:function(){for(var a=0;a<mxEvent.objects.length;a++)null!=mxEvent.objects[a].mxListenerList&&mxEvent.removeAllListeners(mxEvent.objects[a])}};"undefined"==typeof mxLoadResources&&(mxLoadResources=!0);
|
|
"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt");"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0);"undefined"!=typeof mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".";
|
|
"undefined"!=typeof mxImageBasePath&&0<mxImageBasePath.length?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images";mxClient.language="undefined"!=typeof mxLanguage&&null!=mxLanguage?mxLanguage:mxClient.IS_IE?navigator.userLanguage:navigator.language;
|
|
mxClient.defaultLanguage="undefined"!=typeof mxDefaultLanguage&&null!=mxDefaultLanguage?mxDefaultLanguage:"en";mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css");"undefined"!=typeof mxLanguages&&null!=mxLanguages&&(mxClient.languages=mxLanguages);
|
|
mxClient.IS_VML&&(mxClient.IS_SVG?mxClient.IS_VML=!1:(8==document.documentMode?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office")),mxClient.IS_QUIRKS&&30<=document.styleSheets.length?function(){var a=
|
|
document.createElement("style");a.type="text/css";a.styleSheet.cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}";document.getElementsByTagName("head")[0].appendChild(a)}():document.createStyleSheet().cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css"),window.attachEvent("onunload",
|
|
mxClient.dispose)));
|
|
var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(null==mxLog.window&&null!=document.body){var a=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,b=document.createElement("table");b.setAttribute("width","100%");b.setAttribute("height","100%");var c=document.createElement("tbody"),d=document.createElement("tr"),e=document.createElement("td");e.style.verticalAlign="top";mxLog.textarea=document.createElement("textarea");mxLog.textarea.setAttribute("readOnly","true");
|
|
mxLog.textarea.style.height="100%";mxLog.textarea.style.resize="none";mxLog.textarea.value=mxLog.buffer;mxLog.textarea.style.width=mxClient.IS_NS&&"BackCompat"!=document.compatMode?"99%":"100%";e.appendChild(mxLog.textarea);d.appendChild(e);c.appendChild(d);d=document.createElement("tr");mxLog.td=document.createElement("td");mxLog.td.style.verticalAlign="top";mxLog.td.setAttribute("height","30px");d.appendChild(mxLog.td);c.appendChild(d);b.appendChild(c);mxLog.addButton("Info",function(a){mxLog.info()});
|
|
mxLog.addButton("DOM",function(a){a=mxUtils.getInnerHtml(document.body);mxLog.debug(a)});mxLog.addButton("Trace",function(a){mxLog.TRACE=!mxLog.TRACE;mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")});mxLog.addButton("Copy",function(a){try{mxUtils.copy(mxLog.textarea.value)}catch(b){mxUtils.alert(b)}});mxLog.addButton("Show",function(a){try{mxUtils.popup(mxLog.textarea.value)}catch(b){mxUtils.alert(b)}});mxLog.addButton("Clear",function(a){mxLog.textarea.value=""});d=c=0;
|
|
"number"===typeof window.innerWidth?(c=window.innerHeight,d=window.innerWidth):(c=document.documentElement.clientHeight||document.body.clientHeight,d=document.body.clientWidth);mxLog.window=new mxWindow(a,b,Math.max(0,d-320),Math.max(0,c-210),300,160);mxLog.window.setMaximizable(!0);mxLog.window.setScrollable(!1);mxLog.window.setResizable(!0);mxLog.window.setClosable(!0);mxLog.window.destroyOnClose=!1;if((mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&"BackCompat"!=document.compatMode||
|
|
11==document.documentMode){var f=mxLog.window.getElement(),a=function(a,b){mxLog.textarea.style.height=Math.max(0,f.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,a);mxLog.window.addListener(mxEvent.MAXIMIZE,a);mxLog.window.addListener(mxEvent.NORMALIZE,a);mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(a,b){var c=document.createElement("button");mxUtils.write(c,a);mxEvent.addListener(c,"click",b);mxLog.td.appendChild(c)},
|
|
isVisible:function(){return null!=mxLog.window?mxLog.window.isVisible():!1},show:function(){mxLog.setVisible(!0)},setVisible:function(a){null==mxLog.window&&mxLog.init();null!=mxLog.window&&mxLog.window.setVisible(a)},enter:function(a){if(mxLog.TRACE)return mxLog.writeln("Entering "+a),(new Date).getTime()},leave:function(a,b){if(mxLog.TRACE){var c=0!=b?" ("+((new Date).getTime()-b)+" ms)":"";mxLog.writeln("Leaving "+a+c)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&
|
|
mxLog.writeln.apply(this,arguments)},write:function(){for(var a="",b=0;b<arguments.length;b++)a+=arguments[b],b<arguments.length-1&&(a+=" ");null!=mxLog.textarea?(mxLog.textarea.value+=a,0<=navigator.userAgent.indexOf("Presto/2.5")&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=a},writeln:function(){for(var a="",b=0;b<arguments.length;b++)a+=arguments[b],b<arguments.length-1&&(a+=" ");mxLog.write(a+
|
|
"\n")}},mxObjectIdentity={FIELD_NAME:"mxObjectId",counter:0,get:function(a){if(null!=a){if(null==a[mxObjectIdentity.FIELD_NAME])if("object"===typeof a){var b=mxUtils.getFunctionName(a.constructor);a[mxObjectIdentity.FIELD_NAME]=b+"#"+mxObjectIdentity.counter++}else"function"===typeof a&&(a[mxObjectIdentity.FIELD_NAME]="Function#"+mxObjectIdentity.counter++);return a[mxObjectIdentity.FIELD_NAME]}return null},clear:function(a){("object"===typeof a||"function"===typeof a)&&delete a[mxObjectIdentity.FIELD_NAME]}};
|
|
function mxDictionary(){this.clear()}mxDictionary.prototype.map=null;mxDictionary.prototype.clear=function(){this.map={}};mxDictionary.prototype.get=function(a){a=mxObjectIdentity.get(a);return this.map[a]};mxDictionary.prototype.put=function(a,b){var c=mxObjectIdentity.get(a),d=this.map[c];this.map[c]=b;return d};mxDictionary.prototype.remove=function(a){a=mxObjectIdentity.get(a);var b=this.map[a];delete this.map[a];return b};
|
|
mxDictionary.prototype.getKeys=function(){var a=[],b;for(b in this.map)a.push(b);return a};mxDictionary.prototype.getValues=function(){var a=[],b;for(b in this.map)a.push(this.map[b]);return a};mxDictionary.prototype.visit=function(a){for(var b in this.map)a(b,this.map[b])};
|
|
var mxResources={resources:[],extension:mxResourceExtension,resourcesEncoded:!1,loadDefaultBundle:!0,loadSpecialBundle:!0,isLanguageSupported:function(a){return null!=mxClient.languages?0<=mxUtils.indexOf(mxClient.languages,a):!0},getDefaultBundle:function(a,b){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(b)?a+mxResources.extension:null},getSpecialBundle:function(a,b){if(null==mxClient.languages||!this.isLanguageSupported(b)){var c=b.indexOf("-");0<c&&(b=b.substring(0,c))}return mxResources.loadSpecialBundle&&
|
|
mxResources.isLanguageSupported(b)&&b!=mxClient.defaultLanguage?a+"_"+b+mxResources.extension:null},add:function(a,b,c){b=null!=b?b:null!=mxClient.language?mxClient.language.toLowerCase():mxConstants.NONE;if(b!=mxConstants.NONE){var d=mxResources.getDefaultBundle(a,b),e=mxResources.getSpecialBundle(a,b),f=function(){if(null!=e)if(c)mxUtils.get(e,function(a){mxResources.parse(a.getText());c()},function(){c()});else try{var a=mxUtils.load(e);a.isReady()&&mxResources.parse(a.getText())}catch(b){}else null!=
|
|
c&&c()};if(null!=d)if(c)mxUtils.get(d,function(a){mxResources.parse(a.getText());f()},function(){f()});else try{var g=mxUtils.load(d);g.isReady()&&mxResources.parse(g.getText());f()}catch(h){}else f()}},parse:function(a){if(null!=a){a=a.split("\n");for(var b=0;b<a.length;b++)if("#"!=a[b].charAt(0)){var c=a[b].indexOf("\x3d");if(0<c){var d=a[b].substring(0,c),e=a[b].length;13==a[b].charCodeAt(e-1)&&e--;c=a[b].substring(c+1,e);this.resourcesEncoded?(c=c.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[d]=
|
|
unescape(c)):mxResources.resources[d]=c}}}},get:function(a,b,c){a=mxResources.resources[a];null==a&&(a=c);null!=a&&null!=b&&(a=mxResources.replacePlaceholders(a,b));return a},replacePlaceholders:function(a,b){for(var c=[],d=null,e=0;e<a.length;e++){var f=a.charAt(e);"{"==f?d="":null!=d&&"}"==f?(d=parseInt(d)-1,0<=d&&d<b.length&&c.push(b[d]),d=null):null!=d?d+=f:c.push(f)}return c.join("")},loadResources:function(a){mxResources.add(mxClient.basePath+"/resources/editor",null,function(){mxResources.add(mxClient.basePath+
|
|
"/resources/graph",null,a)})}};function mxPoint(a,b){this.x=null!=a?a:0;this.y=null!=b?b:0}mxPoint.prototype.x=null;mxPoint.prototype.y=null;mxPoint.prototype.equals=function(a){return null!=a&&a.x==this.x&&a.y==this.y};mxPoint.prototype.clone=function(){return mxUtils.clone(this)};function mxRectangle(a,b,c,d){mxPoint.call(this,a,b);this.width=null!=c?c:0;this.height=null!=d?d:0}mxRectangle.prototype=new mxPoint;mxRectangle.prototype.constructor=mxRectangle;mxRectangle.prototype.width=null;
|
|
mxRectangle.prototype.height=null;mxRectangle.prototype.setRect=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d};mxRectangle.prototype.getCenterX=function(){return this.x+this.width/2};mxRectangle.prototype.getCenterY=function(){return this.y+this.height/2};
|
|
mxRectangle.prototype.add=function(a){if(null!=a){var b=Math.min(this.x,a.x),c=Math.min(this.y,a.y),d=Math.max(this.x+this.width,a.x+a.width);a=Math.max(this.y+this.height,a.y+a.height);this.x=b;this.y=c;this.width=d-b;this.height=a-c}};mxRectangle.prototype.intersect=function(a){if(null!=a){var b=this.x+this.width,c=a.x+a.width,d=this.y+this.height,e=a.y+a.height;this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.width=Math.min(b,c)-this.x;this.height=Math.min(d,e)-this.y}};
|
|
mxRectangle.prototype.grow=function(a){this.x-=a;this.y-=a;this.width+=2*a;this.height+=2*a};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.fromRectangle=function(a){return new mxRectangle(a.x,a.y,a.width,a.height)};
|
|
var mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(a){null!=a.style&&(a.style.cursor="");a=a.childNodes;if(null!=a)for(var b=a.length,c=0;c<b;c+=1)mxUtils.removeCursors(a[c])},getCurrentStyle:function(){return mxClient.IS_IE?function(a){return null!=a?a.currentStyle:null}:function(a){return null!=a?window.getComputedStyle(a,""):null}}(),parseCssNumber:function(a){"thin"==
|
|
a?a="2":"medium"==a?a="4":"thick"==a&&(a="6");a=parseFloat(a);isNaN(a)&&(a=0);return a},setPrefixedStyle:function(){var a=null;mxClient.IS_OT?a="O":mxClient.IS_SF||mxClient.IS_GC?a="Webkit":mxClient.IS_MT?a="Moz":mxClient.IS_IE&&(9<=document.documentMode&&10>document.documentMode)&&(a="ms");return function(b,c,d){b[c]=d;null!=a&&0<c.length&&(c=a+c.substring(0,1).toUpperCase()+c.substring(1),b[c]=d)}}(),hasScrollbars:function(a){a=mxUtils.getCurrentStyle(a);return null!=a&&("scroll"==a.overflow||"auto"==
|
|
a.overflow)},bind:function(a,b){return function(){return b.apply(a,arguments)}},eval:function(a){var b=null;if(0<=a.indexOf("function"))try{eval("var _mxJavaScriptExpression\x3d"+a),b=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(c){mxLog.warn(c.message+" while evaluating "+a)}else try{b=eval(a)}catch(d){mxLog.warn(d.message+" while evaluating "+a)}return b},findNode:function(a,b,c){if(a.nodeType==mxConstants.NODETYPE_ELEMENT){var d=a.getAttribute(b);if(null!=d&&d==c)return a}for(a=a.firstChild;null!=
|
|
a;){d=mxUtils.findNode(a,b,c);if(null!=d)return d;a=a.nextSibling}return null},getFunctionName:function(a){var b=null;null!=a&&(null!=a.name?b=a.name:(b=mxUtils.trim(a.toString()),/^function\s/.test(b)&&(b=mxUtils.ltrim(b.substring(9)),a=b.indexOf("("),0<a&&(b=b.substring(0,a)))));return b},indexOf:function(a,b){if(null!=a&&null!=b)for(var c=0;c<a.length;c++)if(a[c]==b)return c;return-1},forEach:function(a,b){if(null!=a&&null!=b)for(var c=0;c<a.length;c++)b(a[c]);return a},remove:function(a,b){var c=
|
|
null;if("object"==typeof b)for(var d=mxUtils.indexOf(b,a);0<=d;)b.splice(d,1),c=a,d=mxUtils.indexOf(b,a);for(var e in b)b[e]==a&&(delete b[e],c=a);return c},isNode:function(a,b,c,d){return null!=a&&!isNaN(a.nodeType)&&(null==b||a.nodeName.toLowerCase()==b.toLowerCase())?null==c||a.getAttribute(c)==d:!1},isAncestorNode:function(a,b){for(var c=b;null!=c;){if(c==a)return!0;c=c.parentNode}return!1},getChildNodes:function(a,b){b=b||mxConstants.NODETYPE_ELEMENT;for(var c=[],d=a.firstChild;null!=d;)d.nodeType==
|
|
b&&c.push(d),d=d.nextSibling;return c},importNode:function(a,b,c){if(mxClient.IS_IE&&(null==document.documentMode||10>document.documentMode))switch(b.nodeType){case 1:var d=a.createElement(b.nodeName);if(b.attributes&&0<b.attributes.length){for(var e=0;e<b.attributes.length;e++)d.setAttribute(b.attributes[e].nodeName,b.getAttribute(b.attributes[e].nodeName));if(c&&b.childNodes&&0<b.childNodes.length)for(e=0;e<b.childNodes.length;e++)d.appendChild(mxUtils.importNode(a,b.childNodes[e],c))}return d;
|
|
case 3:case 4:case 8:return a.createTextNode(b.value)}else return a.importNode(b,c)},createXmlDocument:function(){var a=null;document.implementation&&document.implementation.createDocument?a=document.implementation.createDocument("","",null):window.ActiveXObject&&(a=new ActiveXObject("Microsoft.XMLDOM"));return a},parseXml:function(){return window.DOMParser?function(a){return(new DOMParser).parseFromString(a,"text/xml")}:function(a){var b=mxUtils.createXmlDocument();b.async=!1;b.validateOnParse=!1;
|
|
b.resolveExternals=!1;b.loadXML(a);return b}}(),clearSelection:function(){return document.selection?function(){document.selection.empty()}:window.getSelection?function(){window.getSelection().removeAllRanges()}:function(){}}(),getPrettyXml:function(a,b,c){var d=[];if(null!=a)if(b=b||" ",c=c||"",a.nodeType==mxConstants.NODETYPE_TEXT)d.push(a.value);else{d.push(c+"\x3c"+a.nodeName);var e=a.attributes;if(null!=e)for(var f=0;f<e.length;f++){var g=mxUtils.htmlEntities(e[f].value);d.push(" "+e[f].nodeName+
|
|
'\x3d"'+g+'"')}e=a.firstChild;if(null!=e){for(d.push("\x3e\n");null!=e;)d.push(mxUtils.getPrettyXml(e,b,c+b)),e=e.nextSibling;d.push(c+"\x3c/"+a.nodeName+"\x3e\n")}else d.push("/\x3e\n")}return d.join("")},removeWhitespace:function(a,b){for(var c=b?a.previousSibling:a.nextSibling;null!=c&&c.nodeType==mxConstants.NODETYPE_TEXT;){var d=b?c.previousSibling:c.nextSibling,e=mxUtils.getTextContent(c);0==mxUtils.trim(e).length&&c.parentNode.removeChild(c);c=d}},htmlEntities:function(a,b){a=(a||"").replace(/&/g,
|
|
"\x26amp;");a=a.replace(/"/g,"\x26quot;");a=a.replace(/\'/g,"\x26#39;");a=a.replace(/</g,"\x26lt;");a=a.replace(/>/g,"\x26gt;");if(null==b||b)a=a.replace(/\n/g,"\x26#xa;");return a},isVml:function(a){return null!=a&&"urn:schemas-microsoft-com:vml"==a.tagUrn},getXml:function(a,b){var c="";null!=window.XMLSerializer?c=(new XMLSerializer).serializeToString(a):null!=a.xml&&(c=a.xml.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,"\x3e").replace(/\r\n/g,"\n"));return c=c.replace(/\n/g,b||"\x26#xa;")},extractTextWithWhitespace:function(a){for(var b=
|
|
!1,c=[],d=0;a[d];d++){var e=a[d];if(3===e.nodeType||4===e.nodeType){if(11==document.documentMode&&d==a.length-1&&0==e.nodeValue.length)break;c.push(e.nodeValue+(null==e.nextSibling||3!=e.nextSibling.nodeType?"\n":""));b=!0}else 8!==e.nodeType&&((mxClient.IS_IE||mxClient.IS_IE11)&&"P"==e.nodeName&&0==e.innerHTML.length||!b&&"BR"==e.nodeName||"DIV"==e.nodeName&&"\x3cbr\x3e"==e.innerHTML?c.push("\n"):c.push(mxUtils.extractTextWithWhitespace(e.childNodes)),b=!1)}return c.join("")},replaceTrailingNewlines:function(a,
|
|
b){for(var c="";0<a.length&&"\n"==a.charAt(a.length-1);)a=a.substring(0,a.length-1),c+=b;return a+c},getTextContent:function(a){return void 0!==a.innerText?a.innerText:null!=a?a[void 0===a.textContent?"text":"textContent"]:""},setTextContent:function(a,b){void 0!==a.innerText?a.innerText=b:a[void 0===a.textContent?"text":"textContent"]=b},getInnerHtml:function(){return mxClient.IS_IE?function(a){return null!=a?a.innerHTML:""}:function(a){return null!=a?(new XMLSerializer).serializeToString(a):""}}(),
|
|
getOuterHtml:function(){return mxClient.IS_IE?function(a){if(null!=a){if(null!=a.outerHTML)return a.outerHTML;var b=[];b.push("\x3c"+a.nodeName);var c=a.attributes;if(null!=c)for(var d=0;d<c.length;d++){var e=c[d].value;null!=e&&0<e.length&&(b.push(" "),b.push(c[d].nodeName),b.push('\x3d"'),b.push(e),b.push('"'))}0==a.innerHTML.length?b.push("/\x3e"):(b.push("\x3e"),b.push(a.innerHTML),b.push("\x3c/"+a.nodeName+"\x3e"));return b.join("")}return""}:function(a){return null!=a?(new XMLSerializer).serializeToString(a):
|
|
""}}(),write:function(a,b){var c=a.ownerDocument.createTextNode(b);null!=a&&a.appendChild(c);return c},writeln:function(a,b){var c=a.ownerDocument.createTextNode(b);null!=a&&(a.appendChild(c),a.appendChild(document.createElement("br")));return c},br:function(a,b){b=b||1;for(var c=null,d=0;d<b;d++)null!=a&&(c=a.ownerDocument.createElement("br"),a.appendChild(c));return c},button:function(a,b,c){c=null!=c?c:document;c=c.createElement("button");mxUtils.write(c,a);mxEvent.addListener(c,"click",function(a){b(a)});
|
|
return c},para:function(a,b){var c=document.createElement("p");mxUtils.write(c,b);null!=a&&a.appendChild(c);return c},addTransparentBackgroundFilter:function(a){a.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src\x3d'"+mxClient.imageBasePath+"/transparent.gif', sizingMethod\x3d'scale')"},linkAction:function(a,b,c,d,e){return mxUtils.link(a,b,function(){c.execute(d)},e)},linkInvoke:function(a,b,c,d,e,f){return mxUtils.link(a,b,function(){c[d](e)},f)},link:function(a,b,c,d){var e=
|
|
document.createElement("span");e.style.color="blue";e.style.textDecoration="underline";e.style.cursor="pointer";null!=d&&(e.style.paddingLeft=d+"px");mxEvent.addListener(e,"click",c);mxUtils.write(e,b);null!=a&&a.appendChild(e);return e},fit:function(a){var b=parseInt(a.offsetLeft),c=parseInt(a.offsetWidth),d=mxUtils.getDocumentScrollOrigin(a.ownerDocument),e=d.x,d=d.y,f=document.body,g=document.documentElement,h=e+(f.clientWidth||g.clientWidth);b+c>h&&(a.style.left=Math.max(e,h-c)+"px");b=parseInt(a.offsetTop);
|
|
c=parseInt(a.offsetHeight);f=d+Math.max(f.clientHeight||0,g.clientHeight);b+c>f&&(a.style.top=Math.max(d,f-c)+"px")},load:function(a){a=new mxXmlRequest(a,null,"GET",!1);a.send();return a},get:function(a,b,c,d,e,f){a=new mxXmlRequest(a,null,"GET");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++},h=0;h<a.length;h++)(function(a,c){mxUtils.get(a,function(a){var f=a.getStatus();200>f||299<f?g():(e[c]=a,d--,0==d&&
|
|
b(e))},g)})(a[h],h);0==d&&b(e)},post:function(a,b,c,d){return(new mxXmlRequest(a,b)).send(c,d)},submit:function(a,b,c,d){return(new mxXmlRequest(a,b)).simulate(c,d)},loadInto:function(a,b,c){mxClient.IS_IE?b.onreadystatechange=function(){4==b.readyState&&c()}:b.addEventListener("load",c,!1);b.load(a)},getValue:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c);return a},getNumber:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c||0);return Number(a)},getColor:function(a,b,c){a=null!=a?a[b]:null;null==
|
|
a?a=c:a==mxConstants.NONE&&(a=null);return a},clone:function(a,b,c){c=null!=c?c:!1;var d=null;if(null!=a&&"function"==typeof a.constructor){var d=new a.constructor,e;for(e in a)if(e!=mxObjectIdentity.FIELD_NAME&&(null==b||0>mxUtils.indexOf(b,e)))d[e]=!c&&"object"==typeof a[e]?mxUtils.clone(a[e]):a[e]}return d},equalPoints:function(a,b){if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b)for(var c=0;c<a.length;c++)if(a[c]==b[c]||null!=a[c]&&!a[c].equals(b[c]))return!1;
|
|
return!0},equalEntries: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){var c=0,d;for(d in b)c++;for(d in a)if(c--,(!mxUtils.isNaN(a[d])||!mxUtils.isNaN(b[d]))&&a[d]!=b[d])return!1}return 0==c},removeDuplicates:function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++)b.get(a[d])||(c.push(a[d]),b.put(a[d],!0));return c},isNaN:function(a){return"number"==typeof a&&isNaN(a)},extend:function(a,b){var c=function(){};c.prototype=
|
|
b.prototype;a.prototype=new c;a.prototype.constructor=a},toString:function(a){var b="",c;for(c in a)try{if(null==a[c])b+=c+" \x3d [null]\n";else if("function"==typeof a[c])b+=c+" \x3d\x3e [Function]\n";else if("object"==typeof a[c])var d=mxUtils.getFunctionName(a[c].constructor),b=b+(c+" \x3d\x3e ["+d+"]\n");else b+=c+" \x3d "+a[c]+"\n"}catch(e){b+=c+"\x3d"+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,
|
|
h,k){h-=a;k-=b;if(0===c||0===d)return p;c=Math.abs(c);d=Math.abs(d);var m=-h/2,l=-k/2,n=Math.cos(e*Math.PI/180),p=Math.sin(e*Math.PI/180);e=n*m+p*l;var m=-1*p*m+n*l,l=e*e,r=m*m,q=c*c,s=d*d,u=l/q+r/s;1<u?(c*=Math.sqrt(u),d*=Math.sqrt(u),f=0):(u=1,f===g&&(u=-1),f=u*Math.sqrt((q*s-q*r-s*l)/(q*r+s*l)));l=f*c*m/d;r=-1*f*d*e/c;h=n*l-p*r+h/2;k=p*l+n*r+k/2;q=Math.atan2((m-r)/d,(e-l)/c)-Math.atan2(0,1);f=0<=q?q:2*Math.PI+q;q=Math.atan2((-m-r)/d,(-e-l)/c)-Math.atan2((m-r)/d,(e-l)/c);e=0<=q?q:2*Math.PI+q;0==
|
|
g&&0<e?e-=2*Math.PI:0!=g&&0>e&&(e+=2*Math.PI);g=2*e/Math.PI;g=Math.ceil(0>g?-1*g:g);e/=g;m=8/3*Math.sin(e/4)*Math.sin(e/4)/Math.sin(e/2);l=n*c;n*=d;c*=p;d*=p;for(var t=Math.cos(f),z=Math.sin(f),r=-m*(l*z+d*t),q=-m*(c*z-n*t),u=s=0,p=[],y=0;y<g;++y){f+=e;var t=Math.cos(f),z=Math.sin(f),s=l*t-d*z+h,u=c*t+n*z+k,v=-m*(l*z+d*t),t=-m*(c*z-n*t),z=6*y;p[z]=Number(r+a);p[z+1]=Number(q+b);p[z+2]=Number(s-v+a);p[z+3]=Number(u-t+b);p[z+4]=Number(s+a);p[z+5]=Number(u+b);r=s+v;q=u+t}return p},getBoundingBox:function(a,
|
|
b,c){var d=null;if(null!=a&&null!=b&&0!=b){b=mxUtils.toRadians(b);var d=Math.cos(b),e=Math.sin(b);c=null!=c?c:new mxPoint(a.x+a.width/2,a.y+a.height/2);var f=new mxPoint(a.x,a.y);b=new mxPoint(a.x+a.width,a.y);var g=new mxPoint(b.x,a.y+a.height);a=new mxPoint(a.x,g.y);f=mxUtils.getRotatedPoint(f,d,e,c);b=mxUtils.getRotatedPoint(b,d,e,c);g=mxUtils.getRotatedPoint(g,d,e,c);a=mxUtils.getRotatedPoint(a,d,e,c);d=new mxRectangle(f.x,f.y,0,0);d.add(new mxRectangle(b.x,b.y,0,0));d.add(new mxRectangle(g.x,
|
|
g.y,0,0));d.add(new mxRectangle(a.x,a.y,0,0))}return d},getRotatedPoint:function(a,b,c,d){d=null!=d?d:new mxPoint;var e=a.x-d.x;a=a.y-d.y;return new mxPoint(e*b-a*c+d.x,a*b+e*c+d.y)},getPortConstraints:function(a,b,c,d){b=mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT,null);if(null==b)return d;d=b.toString();b=mxConstants.DIRECTION_MASK_NONE;c=0;1==mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0)&&(c=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0));a=0;45<
|
|
c?(a=1,135<=c&&(a=2)):-45>c&&(a=3,-135>=c&&(a=2));if(0<=d.indexOf(mxConstants.DIRECTION_NORTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:b|=mxConstants.DIRECTION_MASK_EAST;break;case 2:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:b|=mxConstants.DIRECTION_MASK_WEST}if(0<=d.indexOf(mxConstants.DIRECTION_WEST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_WEST;break;case 1:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:b|=mxConstants.DIRECTION_MASK_EAST;break;case 3:b|=
|
|
mxConstants.DIRECTION_MASK_SOUTH}if(0<=d.indexOf(mxConstants.DIRECTION_SOUTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:b|=mxConstants.DIRECTION_MASK_WEST;break;case 2:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:b|=mxConstants.DIRECTION_MASK_EAST}if(0<=d.indexOf(mxConstants.DIRECTION_EAST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_EAST;break;case 1:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:b|=mxConstants.DIRECTION_MASK_WEST;break;case 3:b|=mxConstants.DIRECTION_MASK_NORTH}return b},
|
|
reversePortConstraints:function(a){var b=0,b=(a&mxConstants.DIRECTION_MASK_WEST)<<3,b=b|(a&mxConstants.DIRECTION_MASK_NORTH)<<1,b=b|(a&mxConstants.DIRECTION_MASK_SOUTH)>>1;return b|=(a&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(a,b,c){var d=-1;if(0<a.absolutePoints.length)for(var e=a.absolutePoints[0],f=null,g=1;g<a.absolutePoints.length;g++){var h=a.absolutePoints[g],e=mxUtils.ptSegDistSq(e.x,e.y,h.x,h.y,b,c);if(null==f||e<f)f=e,d=g-1;e=h}return d},rectangleIntersectsSegment:function(a,
|
|
b,c){var d=a.y,e=a.x,f=d+a.height,g=e+a.width;a=b.x;var h=c.x;b.x>c.x&&(a=c.x,h=b.x);h>g&&(h=g);a<e&&(a=e);if(a>h)return!1;var e=b.y,g=c.y,k=c.x-b.x;1E-7<Math.abs(k)&&(c=(c.y-b.y)/k,b=b.y-c*b.x,e=c*a+b,g=c*h+b);e>g&&(b=g,g=e,e=b);g>f&&(g=f);e<d&&(e=d);return e>g?!1:!0},contains:function(a,b,c){return a.x<=b&&a.x+a.width>=b&&a.y<=c&&a.y+a.height>=c},intersects:function(a,b){var c=a.width,d=a.height,e=b.width,f=b.height;if(0>=e||0>=f||0>=c||0>=d)return!1;var g=a.x,h=a.y,k=b.x,m=b.y,e=e+k,f=f+m,c=c+
|
|
g,d=d+h;return(e<k||e>g)&&(f<m||f>h)&&(c<g||c>k)&&(d<h||d>m)},intersectsHotspot:function(a,b,c,d,e,f){d=null!=d?d:1;e=null!=e?e:0;f=null!=f?f:0;if(0<d){var g=a.getCenterX(),h=a.getCenterY(),k=a.width,m=a.height,l=mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE)*a.view.scale;0<l&&(mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,!0)?(h=a.y+l/2,m=l):(g=a.x+l/2,k=l));k=Math.max(e,k*d);m=Math.max(e,m*d);0<f&&(k=Math.min(k,f),m=Math.min(m,f));d=new mxRectangle(g-k/2,h-m/2,k,m);g=mxUtils.toRadians(mxUtils.getValue(a.style,
|
|
mxConstants.STYLE_ROTATION)||0);0!=g&&(e=Math.cos(-g),f=Math.sin(-g),g=new mxPoint(a.getCenterX(),a.getCenterY()),a=mxUtils.getRotatedPoint(new mxPoint(b,c),e,f,g),b=a.x,c=a.y);return mxUtils.contains(d,b,c)}return!0},getOffset:function(a,b){var c=0,d=0;if(null!=b&&b)var e=mxUtils.getDocumentScrollOrigin(a.ownerDocument),c=c+e.x,d=d+e.y;e=a.getBoundingClientRect();null!=e&&(c+=e.left,d+=e.top);return new mxPoint(c,d)},getDocumentScrollOrigin:function(a){if(mxClient.IS_QUIRKS)return new mxPoint(a.body.scrollLeft,
|
|
a.body.scrollTop);a=a.defaultView||a.parentWindow;return new mxPoint(null!=a&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=a&&void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},getScrollOrigin:function(a){for(var b=document.body,c=document.documentElement,d=mxUtils.getDocumentScrollOrigin(null!=a?a.ownerDocument:document);null!=a&&a!=b&&
|
|
a!=c;)!isNaN(a.scrollLeft)&&!isNaN(a.scrollTop)&&(d.x+=a.scrollLeft,d.y+=a.scrollTop),a=a.parentNode;return d},convertPoint:function(a,b,c){var d=mxUtils.getScrollOrigin(a);a=mxUtils.getOffset(a);a.x-=d.x;a.y-=d.y;return new mxPoint(b-a.x,c-a.y)},ltrim:function(a,b){return a.replace(RegExp("^["+(b||"\\s")+"]+","g"),"")},rtrim:function(a,b){return a.replace(RegExp("["+(b||"\\s")+"]+$","g"),"")},trim:function(a,b){return mxUtils.ltrim(mxUtils.rtrim(a,b),b)},isNumeric:function(a){return!isNaN(parseFloat(a))&&
|
|
isFinite(a)&&("string"!=typeof a||0>a.toLowerCase().indexOf("0x"))},isInteger:function(a){return String(parseInt(a))===String(a)},mod:function(a,b){return(a%b+b)%b},intersection:function(a,b,c,d,e,f,g,h){var k=(h-f)*(c-a)-(g-e)*(d-b);g=((g-e)*(b-f)-(h-f)*(a-e))/k;e=((c-a)*(b-f)-(d-b)*(a-e))/k;return 0<=g&&1>=g&&0<=e&&1>=e?new mxPoint(a+g*(c-a),b+g*(d-b)):null},ptSegDistSq:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;0>=e*c+f*d?c=0:(e=c-e,f=d-f,a=e*c+f*d,c=0>=a?0:a*a/(c*c+d*d));e=e*e+f*f-c;0>e&&(e=0);
|
|
return e},ptLineDist:function(a,b,c,d,e,f){return Math.abs((d-b)*e-(c-a)*f+c*b-d*a)/Math.sqrt((d-b)*(d-b)+(c-a)*(c-a))},relativeCcw:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;a=e*d-f*c;0==a&&(a=e*c+f*d,0<a&&(a=(e-c)*c+(f-d)*d,0>a&&(a=0)));return 0>a?-1:0<a?1:0},animateChanges:function(a,b){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(a,b,c){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(a,b,c,d,e,f){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(a,
|
|
b){mxUtils.isVml(a)?a.style.filter=100<=b?"":"alpha(opacity\x3d"+b/5+")":mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?a.style.filter=100<=b?"":"alpha(opacity\x3d"+b+")":a.style.opacity=b/100},createImage:function(a){var b=null;mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?(b=document.createElement(mxClient.VML_PREFIX+":image"),b.setAttribute("src",a),b.style.borderStyle="none"):(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(a,e){var f=c.get(a);null==f&&(f=mxCellPath.create(a).split(mxCellPath.PATH_SEPARATOR),c.put(a,f));var g=c.get(e);null==g&&(g=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),c.put(e,g));f=mxCellPath.compare(f,g);return 0==f?0:0<f==b?1:-1});return a},getStylename:function(a){return null!=a&&(a=a.split(";")[0],0>a.indexOf("\x3d"))?a:""},getStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=
|
|
0;c<a.length;c++)0>a[c].indexOf("\x3d")&&b.push(a[c])}return b},indexOfStylename:function(a,b){if(null!=a&&null!=b)for(var c=a.split(";"),d=0,e=0;e<c.length;e++){if(c[e]==b)return d;d+=c[e].length+1}return-1},addStylename:function(a,b){0>mxUtils.indexOfStylename(a,b)&&(null==a?a="":0<a.length&&";"!=a.charAt(a.length-1)&&(a+=";"),a+=b);return a},removeStylename:function(a,b){var c=[];if(null!=a)for(var d=a.split(";"),e=0;e<d.length;e++)d[e]!=b&&c.push(d[e]);return c.join(";")},removeAllStylenames:function(a){var b=
|
|
[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0<=a[c].indexOf("\x3d")&&b.push(a[c])}return b.join(";")},setCellStyles:function(a,b,c,d){if(null!=b&&0<b.length){a.beginUpdate();try{for(var e=0;e<b.length;e++)if(null!=b[e]){var f=mxUtils.setStyle(a.getStyle(b[e]),c,d);a.setStyle(b[e],f)}}finally{a.endUpdate()}}},setStyle:function(a,b,c){var d=null!=c&&("undefined"==typeof c.length||0<c.length);if(null==a||0==a.length)d&&(a=b+"\x3d"+c+";");else if(a.substring(0,b.length+1)==b+"\x3d"){var e=
|
|
a.indexOf(";");a=d?b+"\x3d"+c+(0>e?";":a.substring(e)):0>e||e==a.length-1?"":a.substring(e+1)}else{var f=a.indexOf(";"+b+"\x3d");0>f?d&&(d=";"==a.charAt(a.length-1)?"":";",a=a+d+b+"\x3d"+c+";"):(e=a.indexOf(";",f+1),a=d?a.substring(0,f+1)+b+"\x3d"+c+(0>e?";":a.substring(e)):a.substring(0,f)+(0>e?";":a.substring(e)))}return a},setCellStyleFlags:function(a,b,c,d,e){if(null!=b&&0<b.length){a.beginUpdate();try{for(var f=0;f<b.length;f++)if(null!=b[f]){var g=mxUtils.setStyleFlag(a.getStyle(b[f]),c,d,e);
|
|
a.setStyle(b[f],g)}}finally{a.endUpdate()}}},setStyleFlag:function(a,b,c,d){if(null==a||0==a.length)a=d||null==d?b+"\x3d"+c:b+"\x3d0";else{var e=a.indexOf(b+"\x3d");if(0>e)e=";"==a.charAt(a.length-1)?"":";",a=d||null==d?a+e+b+"\x3d"+c:a+e+b+"\x3d0";else{var f=a.indexOf(";",e),g="",g=0>f?a.substring(e+b.length+1):a.substring(e+b.length+1,f),g=null==d?parseInt(g)^c:d?parseInt(g)|c:parseInt(g)&~c;a=a.substring(0,e)+b+"\x3d"+g+(0<=f?a.substring(f):"")}}return a},getAlignmentAsPoint:function(a,b){var c=
|
|
0,d=0;a==mxConstants.ALIGN_CENTER?c=-0.5:a==mxConstants.ALIGN_RIGHT&&(c=-1);b==mxConstants.ALIGN_MIDDLE?d=-0.5:b==mxConstants.ALIGN_BOTTOM&&(d=-1);return new mxPoint(c,d)},getSizeForString:function(a,b,c,d){b=null!=b?b:mxConstants.DEFAULT_FONTSIZE;c=null!=c?c:mxConstants.DEFAULT_FONTFAMILY;var e=document.createElement("div");e.style.fontFamily=c;e.style.fontSize=Math.round(b)+"px";e.style.lineHeight=Math.round(b*mxConstants.LINE_HEIGHT)+"px";e.style.position="absolute";e.style.visibility="hidden";
|
|
e.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";e.style.zoom="1";null!=d?(e.style.width=d+"px",e.style.whiteSpace="normal"):e.style.whiteSpace="nowrap";e.innerHTML=a;document.body.appendChild(e);a=new mxRectangle(0,0,e.offsetWidth,e.offsetHeight);document.body.removeChild(e);return a},getViewXml:function(a,b,c,d,e){d=null!=d?d:0;e=null!=e?e:0;b=null!=b?b:1;null==c&&(c=[a.getModel().getRoot()]);var f=a.getView(),g=null,h=f.isEventsEnabled();f.setEventsEnabled(!1);var k=f.drawPane,m=f.overlayPane;
|
|
a.dialect==mxConstants.DIALECT_SVG?(f.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),f.canvas.appendChild(f.drawPane),f.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(f.drawPane=f.drawPane.cloneNode(!1),f.canvas.appendChild(f.drawPane),f.overlayPane=f.overlayPane.cloneNode(!1));f.canvas.appendChild(f.overlayPane);var l=f.getTranslate();f.translate=new mxPoint(d,e);b=new mxTemporaryCellStates(a.getView(),b,c);try{g=(new mxCodec).encode(a.getView())}finally{b.destroy(),f.translate=
|
|
l,f.canvas.removeChild(f.drawPane),f.canvas.removeChild(f.overlayPane),f.drawPane=k,f.overlayPane=m,f.setEventsEnabled(h)}return g},getScaleForPageCount:function(a,b,c,d){if(1>a)return 1;c=null!=c?c:mxConstants.PAGE_FORMAT_A4_PORTRAIT;d=null!=d?d:0;var e=c.width-2*d;c=c.height-2*d;d=b.getGraphBounds().clone();b=b.getView().getScale();d.width/=b;d.height/=b;b=d.width;c=b/d.height/(e/c);d=Math.sqrt(a);var f=Math.sqrt(c);c=d*f;d/=f;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;){var g=Math.floor(c)/c,h=Math.floor(d)/d;1==g&&(g=Math.floor(c-1)/c);1==h&&(h=Math.floor(d-1)/d);g=g>h?g:h;c*=g;d*=g;g=Math.ceil(c)*Math.ceil(d);f++;if(10<f)break}return 0.99999*(e*c/b)},show:function(a,b,c,d,e,f){c=null!=c?c:0;d=null!=d?d:0;null==b?b=window.open().document:b.open();9==document.documentMode&&b.writeln('\x3c!--[if IE]\x3e\x3cmeta http-equiv\x3d"X-UA-Compatible" content\x3d"IE\x3d9"\x3e\x3c![endif]--\x3e');var g=a.getGraphBounds(),h=Math.ceil(c-g.x),k=Math.ceil(d-
|
|
g.y);null==e&&(e=Math.ceil(g.width+c)+Math.ceil(Math.ceil(g.x)-g.x));null==f&&(f=Math.ceil(g.height+d)+Math.ceil(Math.ceil(g.y)-g.y));if(mxClient.IS_IE||11==document.documentMode){d="\x3chtml\x3e\x3chead\x3e";g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)d+=g[c].outerHTML;d+="\x3cstyle\x3e";for(c=0;c<document.styleSheets.length;c++)try{d+=document.styleSheets[c].cssText}catch(m){}d=d+'\x3c/style\x3e\x3c/head\x3e\x3cbody style\x3d"margin:0px;"\x3e'+('\x3cdiv style\x3d"position:absolute;overflow:hidden;width:'+
|
|
e+"px;height:"+f+'px;"\x3e\x3cdiv style\x3d"position:relative;left:'+h+"px;top:"+k+'px;"\x3e');d+=a.container.innerHTML;d+="\x3c/div\x3e\x3c/div\x3e\x3c/body\x3e\x3chtml\x3e";b.writeln(d);b.close()}else{b.writeln("\x3chtml\x3e\x3chead\x3e");g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)b.writeln(mxUtils.getOuterHtml(g[c]));d=document.getElementsByTagName("link");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));d=document.getElementsByTagName("style");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));
|
|
b.writeln('\x3c/head\x3e\x3cbody style\x3d"margin:0px;"\x3e\x3c/body\x3e\x3c/html\x3e');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=h+"px";e.style.top=k+"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("+h+","+k+")"))}mxUtils.removeCursors(b.body);return b},printScreen:function(a){var b=window.open();a.getGraphBounds();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";var d=document.createElement("pre");d.innerHTML=
|
|
mxUtils.htmlEntities(a,!1).replace(/\n/g,"\x3cbr\x3e").replace(/ /g,"\x26nbsp;");c.appendChild(d);var d=document.body.clientWidth,e=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight),c=new mxWindow("Popup Window",c,d/2-320,e/2-240,640,480,!1,!0);c.setClosable(!0);c.setVisible(!0)}else mxClient.IS_NS?(c=window.open(),c.document.writeln("\x3cpre\x3e"+mxUtils.htmlEntities(a)+"\x3c/pre"),c.document.close()):(c=window.open(),d=c.document.createElement("pre"),d.innerHTML=mxUtils.htmlEntities(a,
|
|
!1).replace(/\n/g,"\x3cbr\x3e").replace(/ /g,"\x26nbsp;"),c.document.body.appendChild(d))},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("\u00a0"));
|
|
e.appendChild(document.createTextNode("\u00a0"));e.appendChild(document.createTextNode("\u00a0"));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(a){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,h,k,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!=k&&(a.highlightDropTargets=k);null!=m&&(a.getDropTarget=m);a.getGraphForEvent=function(a){return"function"==
|
|
typeof b?b(a):b};null!=d&&(a.createDragElement=function(){return d.cloneNode(!0)},h&&(a.createPreviewElement=function(a){var b=d.cloneNode(!0),c=parseInt(b.style.width),e=parseInt(b.style.height);b.style.width=Math.round(c*a.view.scale)+"px";b.style.height=Math.round(e*a.view.scale)+"px";return b}));return a}},mxConstants={DEFAULT_HOTSPOT:0.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_VML:"vml",
|
|
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:"gray",VML_SHADOWCOLOR:"gray",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,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:0.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,
|
|
PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,826,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,826),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_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_STROKE_OPACITY:"strokeOpacity",
|
|
STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",STYLE_OVERFLOW:"overflow",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",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_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_ENDFILL:"endFill",STYLE_STARTFILL:"startFill",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",
|
|
STYLE_ARCSIZE:"arcSize",STYLE_SMOOTH:"smooth",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_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",
|
|
STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",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",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,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",
|
|
TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",
|
|
EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};function mxEventObject(a){this.name=a;this.properties=[];for(var b=1;b<arguments.length;b+=2)null!=arguments[b+1]&&(this.properties[arguments[b]]=arguments[b+1])}mxEventObject.prototype.name=null;mxEventObject.prototype.properties=null;mxEventObject.prototype.consumed=!1;
|
|
mxEventObject.prototype.getName=function(){return this.name};mxEventObject.prototype.getProperties=function(){return this.properties};mxEventObject.prototype.getProperty=function(a){return this.properties[a]};mxEventObject.prototype.isConsumed=function(){return this.consumed};mxEventObject.prototype.consume=function(){this.consumed=!0};function mxMouseEvent(a,b){this.evt=a;this.sourceState=this.state=b}mxMouseEvent.prototype.consumed=!1;mxMouseEvent.prototype.evt=null;
|
|
mxMouseEvent.prototype.graphX=null;mxMouseEvent.prototype.graphY=null;mxMouseEvent.prototype.state=null;mxMouseEvent.prototype.sourceState=null;mxMouseEvent.prototype.getEvent=function(){return this.evt};mxMouseEvent.prototype.getSource=function(){return mxEvent.getSource(this.evt)};mxMouseEvent.prototype.isSource=function(a){return null!=a?mxUtils.isAncestorNode(a.node,this.getSource()):!1};mxMouseEvent.prototype.getX=function(){return mxEvent.getClientX(this.getEvent())};
|
|
mxMouseEvent.prototype.getY=function(){return mxEvent.getClientY(this.getEvent())};mxMouseEvent.prototype.getGraphX=function(){return this.graphX};mxMouseEvent.prototype.getGraphY=function(){return this.graphY};mxMouseEvent.prototype.getState=function(){return this.state};mxMouseEvent.prototype.getCell=function(){var a=this.getState();return null!=a?a.cell:null};mxMouseEvent.prototype.isPopupTrigger=function(){return mxEvent.isPopupTrigger(this.getEvent())};mxMouseEvent.prototype.isConsumed=function(){return this.consumed};
|
|
mxMouseEvent.prototype.consume=function(a){(null!=a?a:1)&&this.evt.preventDefault&&this.evt.preventDefault();mxClient.IS_IE&&(this.evt.returnValue=!0);this.consumed=!0};function mxEventSource(a){this.setEventSource(a)}mxEventSource.prototype.eventListeners=null;mxEventSource.prototype.eventsEnabled=!0;mxEventSource.prototype.eventSource=null;mxEventSource.prototype.isEventsEnabled=function(){return this.eventsEnabled};mxEventSource.prototype.setEventsEnabled=function(a){this.eventsEnabled=a};
|
|
mxEventSource.prototype.getEventSource=function(){return this.eventSource};mxEventSource.prototype.setEventSource=function(a){this.eventSource=a};mxEventSource.prototype.addListener=function(a,b){null==this.eventListeners&&(this.eventListeners=[]);this.eventListeners.push(a);this.eventListeners.push(b)};mxEventSource.prototype.removeListener=function(a){if(null!=this.eventListeners)for(var b=0;b<this.eventListeners.length;)this.eventListeners[b+1]==a?this.eventListeners.splice(b,2):b+=2};
|
|
mxEventSource.prototype.fireEvent=function(a,b){if(null!=this.eventListeners&&this.isEventsEnabled()){null==a&&(a=new mxEventObject);null==b&&(b=this.getEventSource());null==b&&(b=this);for(var c=[b,a],d=0;d<this.eventListeners.length;d+=2){var e=this.eventListeners[d];(null==e||e==a.getName())&&this.eventListeners[d+1].apply(this,c)}}};
|
|
var mxEvent={objects:[],addListener:function(){var a=function(a,c,d){null==a.mxListenerList&&(a.mxListenerList=[],mxEvent.objects.push(a));a.mxListenerList.push({name:c,f:d})};return window.addEventListener?function(b,c,d){b.addEventListener(c,d,!1);a(b,c,d)}:function(b,c,d){b.attachEvent("on"+c,d);a(b,c,d)}}(),removeListener:function(){var a=function(a,c,d){if(null!=a.mxListenerList){c=a.mxListenerList.length;for(var e=0;e<c;e++)if(a.mxListenerList[e].f==d){a.mxListenerList.splice(e,1);break}0==
|
|
a.mxListenerList.length&&(a.mxListenerList=null,a=mxUtils.indexOf(mxEvent.objects,a),0<=a&&mxEvent.objects.splice(a,1))}};return window.removeEventListener?function(b,c,d){b.removeEventListener(c,d,!1);a(b,c,d)}:function(b,c,d){b.detachEvent("on"+c,d);a(b,c,d)}}(),removeAllListeners:function(a){var b=a.mxListenerList;if(null!=b)for(;0<b.length;){var c=b[0];mxEvent.removeListener(a,c.name,c.f)}},addGestureListeners:function(a,b,c,d){null!=b&&mxEvent.addListener(a,mxClient.IS_POINTER?"pointerdown":
|
|
"mousedown",b);null!=c&&mxEvent.addListener(a,mxClient.IS_POINTER?"pointermove":"mousemove",c);null!=d&&mxEvent.addListener(a,mxClient.IS_POINTER?"pointerup":"mouseup",d);!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=b&&mxEvent.addListener(a,"touchstart",b),null!=c&&mxEvent.addListener(a,"touchmove",c),null!=d&&mxEvent.addListener(a,"touchend",d))},removeGestureListeners:function(a,b,c,d){null!=b&&mxEvent.removeListener(a,mxClient.IS_POINTER?"pointerdown":"mousedown",b);null!=c&&mxEvent.removeListener(a,
|
|
mxClient.IS_POINTER?"pointermove":"mousemove",c);null!=d&&mxEvent.removeListener(a,mxClient.IS_POINTER?"pointerup":"mouseup",d);!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=b&&mxEvent.removeListener(a,"touchstart",b),null!=c&&mxEvent.removeListener(a,"touchmove",c),null!=d&&mxEvent.removeListener(a,"touchend",d))},redirectMouseEvents:function(a,b,c,d,e,f,g){var h=function(a){return"function"==typeof c?c(a):c};mxEvent.addGestureListeners(a,function(a){null!=d?d(a):mxEvent.isConsumed(a)||b.fireMouseEvent(mxEvent.MOUSE_DOWN,
|
|
new mxMouseEvent(a,h(a)))},function(a){null!=e?e(a):mxEvent.isConsumed(a)||b.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(a,h(a)))},function(a){null!=f?f(a):mxEvent.isConsumed(a)||b.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(a,h(a)))});mxEvent.addListener(a,"dblclick",function(a){if(null!=g)g(a);else if(!mxEvent.isConsumed(a)){var c=h(a);b.dblClick(a,null!=c?c.cell:null)}})},release:function(a){if(null!=a&&(mxEvent.removeAllListeners(a),a=a.childNodes,null!=a))for(var b=a.length,c=0;c<
|
|
b;c+=1)mxEvent.release(a[c])},addMouseWheelListener:function(a){if(null!=a){var b=function(b){null==b&&(b=window.event);var d=0,d=mxClient.IS_FF?-b.detail/2:b.wheelDelta/120;0!=d&&a(b,0<d)};mxClient.IS_NS&&null==document.documentMode?mxEvent.addListener(window,mxClient.IS_SF||mxClient.IS_GC?"mousewheel":"DOMMouseScroll",b):mxEvent.addListener(document,"mousewheel",b)}},disableContextMenu:function(){return mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?function(a){mxEvent.addListener(a,
|
|
"contextmenu",function(){return!1})}:function(a){a.setAttribute("oncontextmenu","return false;")}}(),getSource:function(a){return null!=a.srcElement?a.srcElement:a.target},isConsumed:function(a){return null!=a.isConsumed&&a.isConsumed},isTouchEvent:function(a){return null!=a.pointerType?"touch"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_TOUCH:null!=a.mozInputSource?5==a.mozInputSource:0==a.type.indexOf("touch")},isMultiTouchEvent:function(a){return null!=a.type&&0==a.type.indexOf("touch")&&
|
|
null!=a.touches&&1<a.touches.length},isMouseEvent:function(a){return null!=a.pointerType?"mouse"==a.pointerType||a.pointerType===a.MSPOINTER_TYPE_MOUSE:null!=a.mozInputSource?1==a.mozInputSource:0==a.type.indexOf("mouse")},isLeftMouseButton:function(a){return"buttons"in a&&("mousedown"==a.type||"mousemove"==a.type)?1==a.buttons:"which"in a?1===a.which:1===a.button},isMiddleMouseButton:function(a){return"which"in a?2===a.which:4===a.button},isRightMouseButton:function(a){return"which"in a?3===a.which:
|
|
2===a.button},isPopupTrigger:function(a){return mxEvent.isRightMouseButton(a)||mxClient.IS_MAC&&mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)&&!mxEvent.isMetaDown(a)&&!mxEvent.isAltDown(a)},isShiftDown:function(a){return null!=a?a.shiftKey:!1},isAltDown:function(a){return null!=a?a.altKey:!1},isControlDown:function(a){return null!=a?a.ctrlKey:!1},isMetaDown:function(a){return null!=a?a.metaKey:!1},getMainEvent:function(a){("touchstart"==a.type||"touchmove"==a.type)&&null!=a.touches&&null!=a.touches[0]?
|
|
a=a.touches[0]:"touchend"==a.type&&(null!=a.changedTouches&&null!=a.changedTouches[0])&&(a=a.changedTouches[0]);return a},getClientX:function(a){return mxEvent.getMainEvent(a).clientX},getClientY:function(a){return mxEvent.getMainEvent(a).clientY},consume:function(a,b,c){c=null!=c?c:!0;if(null!=b?b:1)a.preventDefault?(c&&a.stopPropagation(),a.preventDefault()):c&&(a.cancelBubble=!0);a.isConsumed=!0;a.preventDefault||(a.returnValue=!1)},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,CUSTOM_HANDLE:-100,VIRTUAL_HANDLE:-1E5,
|
|
MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",FIRE_MOUSE_EVENT:"fireMouseEvent",GESTURE:"gesture",TAP_AND_HOLD:"tapAndHold",
|
|
GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",
|
|
CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",
|
|
REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",EDITING_STARTED:"editingStarted",EDITING_STOPPED:"editingStopped",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",CLICK:"click",DOUBLE_CLICK:"doubleClick",START:"start",
|
|
RESET:"reset"};function mxXmlRequest(a,b,c,d,e,f){this.url=a;this.params=b;this.method=c||"POST";this.async=null!=d?d:!0;this.username=e;this.password=f}mxXmlRequest.prototype.url=null;mxXmlRequest.prototype.params=null;mxXmlRequest.prototype.method=null;mxXmlRequest.prototype.async=null;mxXmlRequest.prototype.binary=!1;mxXmlRequest.prototype.withCredentials=!1;mxXmlRequest.prototype.username=null;mxXmlRequest.prototype.password=null;mxXmlRequest.prototype.request=null;
|
|
mxXmlRequest.prototype.decodeSimulateValues=!1;mxXmlRequest.prototype.isBinary=function(){return this.binary};mxXmlRequest.prototype.setBinary=function(a){this.binary=a};mxXmlRequest.prototype.getText=function(){return this.request.responseText};mxXmlRequest.prototype.isReady=function(){return 4==this.request.readyState};mxXmlRequest.prototype.getDocumentElement=function(){var a=this.getXml();return null!=a?a.documentElement:null};
|
|
mxXmlRequest.prototype.getXml=function(){var a=this.request.responseXML;if(9<=document.documentMode||null==a||null==a.documentElement)a=mxUtils.parseXml(this.request.responseText);return a};mxXmlRequest.prototype.getText=function(){return this.request.responseText};mxXmlRequest.prototype.getStatus=function(){return this.request.status};
|
|
mxXmlRequest.prototype.create=function(){if(window.XMLHttpRequest)return function(){var a=new XMLHttpRequest;this.isBinary()&&a.overrideMimeType&&a.overrideMimeType("text/plain; charset\x3dx-user-defined");return a};if("undefined"!=typeof ActiveXObject)return function(){return new ActiveXObject("Microsoft.XMLHTTP")}}();
|
|
mxXmlRequest.prototype.send=function(a,b,c,d){this.request=this.create();if(null!=this.request){null!=a&&(this.request.onreadystatechange=mxUtils.bind(this,function(){this.isReady()&&(a(this),this.onreadystatechaange=null)}));this.request.open(this.method,this.url,this.async,this.username,this.password);this.setRequestHeaders(this.request,this.params);window.XMLHttpRequest&&this.withCredentials&&(this.request.withCredentials="true");if(!mxClient.IS_QUIRKS&&(null==document.documentMode||9<document.documentMode)&&
|
|
window.XMLHttpRequest&&null!=c&&null!=d)this.request.timeout=c,this.request.ontimeout=d;this.request.send(this.params)}};mxXmlRequest.prototype.setRequestHeaders=function(a,b){null!=b&&a.setRequestHeader("Content-Type","application/x-www-form-urlencoded")};
|
|
mxXmlRequest.prototype.simulate=function(a,b){a=a||document;var c=null;a==document&&(c=window.onbeforeunload,window.onbeforeunload=null);var d=a.createElement("form");d.setAttribute("method",this.method);d.setAttribute("action",this.url);null!=b&&d.setAttribute("target",b);d.style.display="none";d.style.visibility="hidden";for(var e=0<this.params.indexOf("\x26")?this.params.split("\x26"):this.params.split(),f=0;f<e.length;f++){var g=e[f].indexOf("\x3d");if(0<g){var h=e[f].substring(0,g),g=e[f].substring(g+
|
|
1);this.decodeSimulateValues&&(g=decodeURIComponent(g));var k=a.createElement("textarea");k.setAttribute("name",h);mxUtils.write(k,g);d.appendChild(k)}}a.body.appendChild(d);d.submit();a.body.removeChild(d);null!=c&&(window.onbeforeunload=c)};function mxImage(a,b,c){this.src=a;this.width=b;this.height=c}mxImage.prototype.src=null;mxImage.prototype.width=null;mxImage.prototype.height=null;function mxUndoableEdit(a,b){this.source=a;this.changes=[];this.significant=null!=b?b:!0}
|
|
mxUndoableEdit.prototype.source=null;mxUndoableEdit.prototype.changes=null;mxUndoableEdit.prototype.significant=null;mxUndoableEdit.prototype.undone=!1;mxUndoableEdit.prototype.redone=!1;mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length};mxUndoableEdit.prototype.isSignificant=function(){return this.significant};mxUndoableEdit.prototype.add=function(a){this.changes.push(a)};mxUndoableEdit.prototype.notify=function(){};mxUndoableEdit.prototype.die=function(){};
|
|
mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var a=this.changes.length-1;0<=a;a--){var b=this.changes[a];null!=b.execute?b.execute():null!=b.undo&&b.undo();this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",b))}this.undone=!0;this.redone=!1;this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()};
|
|
mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var a=this.changes.length,b=0;b<a;b++){var c=this.changes[b];null!=c.execute?c.execute():null!=c.redo&&c.redo();this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",c))}this.undone=!1;this.redone=!0;this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()};var mxUrlConverter=function(){};mxUrlConverter.prototype.enabled=!0;
|
|
mxUrlConverter.prototype.baseUrl=null;mxUrlConverter.prototype.baseDomain=null;mxUrlConverter.prototype.updateBaseUrl=function(){this.baseDomain=location.protocol+"//"+location.host;this.baseUrl=this.baseDomain+location.pathname;var a=this.baseUrl.lastIndexOf("/");0<a&&(this.baseUrl=this.baseUrl.substring(0,a+1))};mxUrlConverter.prototype.isEnabled=function(){return this.enabled};mxUrlConverter.prototype.setEnabled=function(a){this.enabled=a};mxUrlConverter.prototype.getBaseUrl=function(){return this.baseUrl};
|
|
mxUrlConverter.prototype.setBaseUrl=function(a){this.baseUrl=a};mxUrlConverter.prototype.getBaseDomain=function(){return this.baseDomain};mxUrlConverter.prototype.setBaseDomain=function(a){this.baseDomain=a};mxUrlConverter.prototype.isRelativeUrl=function(a){return"//"!=a.substring(0,2)&&"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&"data:image"!=a.substring(0,10)};
|
|
mxUrlConverter.prototype.convert=function(a){this.isEnabled()&&this.isRelativeUrl(a)&&(null==this.getBaseUrl()&&this.updateBaseUrl(),a="/"==a.charAt(0)?this.getBaseDomain()+a:this.getBaseUrl()+a);return a};
|
|
function mxPanningManager(a){this.thread=null;this.active=!1;this.dy=this.dx=this.t0y=this.t0x=this.tdy=this.tdx=0;this.scrollbars=!1;this.scrollTop=this.scrollLeft=0;this.mouseListener={mouseDown:function(a,b){},mouseMove:function(a,b){},mouseUp:mxUtils.bind(this,function(a,b){this.active&&this.stop()})};a.addMouseListener(this.mouseListener);mxEvent.addListener(document,"mouseup",mxUtils.bind(this,function(){this.active&&this.stop()}));var b=mxUtils.bind(this,function(){this.scrollbars=mxUtils.hasScrollbars(a.container);
|
|
this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop;return window.setInterval(mxUtils.bind(this,function(){this.tdx-=this.dx;this.tdy-=this.dy;if(this.scrollbars){var b=-a.container.scrollLeft-Math.ceil(this.dx),d=-a.container.scrollTop-Math.ceil(this.dy);a.panGraph(b,d);a.panDx=this.scrollLeft-a.container.scrollLeft;a.panDy=this.scrollTop-a.container.scrollTop;a.fireEvent(new mxEventObject(mxEvent.PAN))}else a.panGraph(this.getDx(),this.getDy())}),this.delay)});this.isActive=
|
|
function(){return active};this.getDx=function(){return Math.round(this.tdx)};this.getDy=function(){return Math.round(this.tdy)};this.start=function(){this.t0x=a.view.translate.x;this.t0y=a.view.translate.y;this.active=!0};this.panTo=function(c,d,e,f){this.active||this.start();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop;f=null!=f?f:0;var g=a.container;this.dx=c+(null!=e?e:0)-g.scrollLeft-g.clientWidth;0>this.dx&&Math.abs(this.dx)<this.border?this.dx=this.border+this.dx:
|
|
this.dx=this.handleMouseOut?Math.max(this.dx,0):0;0==this.dx&&(this.dx=c-g.scrollLeft,this.dx=0<this.dx&&this.dx<this.border?this.dx-this.border:this.handleMouseOut?Math.min(0,this.dx):0);this.dy=d+f-g.scrollTop-g.clientHeight;0>this.dy&&Math.abs(this.dy)<this.border?this.dy=this.border+this.dy:this.dy=this.handleMouseOut?Math.max(this.dy,0):0;0==this.dy&&(this.dy=d-g.scrollTop,this.dy=0<this.dy&&this.dy<this.border?this.dy-this.border:this.handleMouseOut?Math.min(0,this.dy):0);0!=this.dx||0!=this.dy?
|
|
(this.dx*=this.damper,this.dy*=this.damper,null==this.thread&&(this.thread=b())):null!=this.thread&&(window.clearInterval(this.thread),this.thread=null)};this.stop=function(){if(this.active)if(this.active=!1,null!=this.thread&&(window.clearInterval(this.thread),this.thread=null),this.tdy=this.tdx=0,this.scrollbars)a.panDx=0,a.panDy=0,a.fireEvent(new mxEventObject(mxEvent.PAN));else{var b=a.panDx,d=a.panDy;if(0!=b||0!=d)a.panGraph(0,0),a.view.setTranslate(this.t0x+b/a.view.scale,this.t0y+d/a.view.scale)}};
|
|
this.destroy=function(){a.removeMouseListener(this.mouseListener)}}mxPanningManager.prototype.damper=1/6;mxPanningManager.prototype.delay=10;mxPanningManager.prototype.handleMouseOut=!0;mxPanningManager.prototype.border=0;function mxPopupMenu(a){this.factoryMethod=a;null!=a&&this.init()}mxPopupMenu.prototype=new mxEventSource;mxPopupMenu.prototype.constructor=mxPopupMenu;mxPopupMenu.prototype.submenuImage=mxClient.imageBasePath+"/submenu.gif";mxPopupMenu.prototype.zIndex=10006;
|
|
mxPopupMenu.prototype.factoryMethod=null;mxPopupMenu.prototype.useLeftButtonForPopup=!1;mxPopupMenu.prototype.enabled=!0;mxPopupMenu.prototype.itemCount=0;mxPopupMenu.prototype.autoExpand=!1;mxPopupMenu.prototype.smartSeparators=!1;mxPopupMenu.prototype.labels=!0;
|
|
mxPopupMenu.prototype.init=function(){this.table=document.createElement("table");this.table.className="mxPopupMenu";this.tbody=document.createElement("tbody");this.table.appendChild(this.tbody);this.div=document.createElement("div");this.div.className="mxPopupMenu";this.div.style.display="inline";this.div.style.zIndex=this.zIndex;this.div.appendChild(this.table);mxEvent.disableContextMenu(this.div)};mxPopupMenu.prototype.isEnabled=function(){return this.enabled};
|
|
mxPopupMenu.prototype.setEnabled=function(a){this.enabled=a};mxPopupMenu.prototype.isPopupTrigger=function(a){return a.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(a.getEvent())};
|
|
mxPopupMenu.prototype.addItem=function(a,b,c,d,e,f,g){d=d||this;this.itemCount++;d.willAddSeparator&&(d.containsItems&&this.addSeparator(d,!0),d.willAddSeparator=!1);d.containsItems=!0;var h=document.createElement("tr");h.className="mxPopupMenuItem";var k=document.createElement("td");k.className="mxPopupMenuIcon";null!=b?(e=document.createElement("img"),e.src=b,k.appendChild(e)):null!=e&&(b=document.createElement("div"),b.className=e,k.appendChild(b));h.appendChild(k);this.labels&&(k=document.createElement("td"),
|
|
k.className="mxPopupMenuItem"+(null!=f&&!f?" mxDisabled":""),mxUtils.write(k,a),k.align="left",h.appendChild(k),a=document.createElement("td"),a.className="mxPopupMenuItem"+(null!=f&&!f?" mxDisabled":""),a.style.paddingRight="6px",a.style.textAlign="right",h.appendChild(a),null==d.div&&this.createSubmenu(d));d.tbody.appendChild(h);if(!1!=g&&!1!=f){var m=null;mxEvent.addGestureListeners(h,mxUtils.bind(this,function(a){this.eventReceiver=h;d.activeRow!=h&&d.activeRow!=d&&(null!=d.activeRow&&null!=d.activeRow.div.parentNode&&
|
|
this.hideSubmenu(d),null!=h.div&&(this.showSubmenu(d,h),d.activeRow=h));if(mxClient.IS_QUIRKS||8==document.documentMode)m=document.selection.createRange();mxEvent.consume(a)}),mxUtils.bind(this,function(a){d.activeRow!=h&&d.activeRow!=d&&(null!=d.activeRow&&null!=d.activeRow.div.parentNode&&this.hideSubmenu(d),this.autoExpand&&null!=h.div&&(this.showSubmenu(d,h),d.activeRow=h));h.className="mxPopupMenuItemHover"}),mxUtils.bind(this,function(a){if(this.eventReceiver==h){d.activeRow!=h&&this.hideMenu();
|
|
if(null!=m){try{m.select()}catch(b){}m=null}null!=c&&c(a)}this.eventReceiver=null;mxEvent.consume(a)}));mxEvent.addListener(h,"mouseout",mxUtils.bind(this,function(a){h.className="mxPopupMenuItem"}))}return h};mxPopupMenu.prototype.addCheckmark=function(a,b){var c=a.firstChild.nextSibling;c.style.backgroundImage="url('"+b+"')";c.style.backgroundRepeat="no-repeat";c.style.backgroundPosition="2px 50%"};
|
|
mxPopupMenu.prototype.createSubmenu=function(a){a.table=document.createElement("table");a.table.className="mxPopupMenu";a.tbody=document.createElement("tbody");a.table.appendChild(a.tbody);a.div=document.createElement("div");a.div.className="mxPopupMenu";a.div.style.position="absolute";a.div.style.display="inline";a.div.style.zIndex=this.zIndex;a.div.appendChild(a.table);var b=document.createElement("img");b.setAttribute("src",this.submenuImage);td=a.firstChild.nextSibling.nextSibling;td.appendChild(b)};
|
|
mxPopupMenu.prototype.showSubmenu=function(a,b){if(null!=b.div){b.div.style.left=a.div.offsetLeft+b.offsetLeft+b.offsetWidth-1+"px";b.div.style.top=a.div.offsetTop+b.offsetTop+"px";document.body.appendChild(b.div);var c=parseInt(b.div.offsetLeft),d=parseInt(b.div.offsetWidth),e=mxUtils.getDocumentScrollOrigin(document),f=document.documentElement;if(c+d>e.x+(document.body.clientWidth||f.clientWidth))b.div.style.left=a.div.offsetLeft-d+(mxClient.IS_IE?6:-6)+"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;var c=document.createElement("tr"),d=document.createElement("td");d.className="mxPopupMenuIcon";d.style.padding="0 0 0 0px";c.appendChild(d);d=document.createElement("td");d.style.padding="0 0 0 0px";d.setAttribute("colSpan","2");var e=document.createElement("hr");e.setAttribute("size","1");d.appendChild(e);c.appendChild(d);a.tbody.appendChild(c)}};
|
|
mxPopupMenu.prototype.popup=function(a,b,c,d){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){this.div.style.left=a+"px";for(this.div.style.top=b+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0;this.factoryMethod(this,c,d);0<this.itemCount&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}};
|
|
mxPopupMenu.prototype.isMenuShowing=function(){return null!=this.div&&this.div.parentNode==document.body};mxPopupMenu.prototype.showMenu=function(){9<=document.documentMode&&(this.div.style.filter="none");document.body.appendChild(this.div);mxUtils.fit(this.div)};mxPopupMenu.prototype.hideMenu=function(){null!=this.div&&(null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1,this.fireEvent(new mxEventObject(mxEvent.HIDE)))};
|
|
mxPopupMenu.prototype.hideSubmenu=function(a){null!=a.activeRow&&(this.hideSubmenu(a.activeRow),null!=a.activeRow.div.parentNode&&a.activeRow.div.parentNode.removeChild(a.activeRow.div),a.activeRow=null)};mxPopupMenu.prototype.destroy=function(){null!=this.div&&(mxEvent.release(this.div),null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null)};function mxImageExport(){}mxImageExport.prototype.includeOverlays=!1;
|
|
mxImageExport.prototype.drawState=function(a,b){null!=a&&(this.visitStatesRecursive(a,b,mxUtils.bind(this,function(){this.drawCellState.apply(this,arguments)})),this.includeOverlays&&this.visitStatesRecursive(a,b,mxUtils.bind(this,function(){this.drawOverlays.apply(this,arguments)})))};
|
|
mxImageExport.prototype.visitStatesRecursive=function(a,b,c){if(null!=a){c(a,b);for(var d=a.view.graph,e=d.model.getChildCount(a.cell),f=0;f<e;f++){var g=d.view.getState(d.model.getChildAt(a.cell,f));this.visitStatesRecursive(g,b,c)}}};mxImageExport.prototype.getLinkForCellState=function(a,b){return null};mxImageExport.prototype.drawCellState=function(a,b){var c=this.getLinkForCellState(a,b);null!=c&&b.setLink(c);this.drawShape(a,b);this.drawText(a,b);null!=c&&b.setLink(null)};
|
|
mxImageExport.prototype.drawShape=function(a,b){a.shape instanceof mxShape&&a.shape.checkBounds()&&(b.save(),a.shape.paint(b),b.restore())};mxImageExport.prototype.drawText=function(a,b){null!=a.text&&a.text.checkBounds()&&(b.save(),a.text.paint(b),b.restore())};mxImageExport.prototype.drawOverlays=function(a,b){null!=a.overlays&&a.overlays.visit(function(a,d){d instanceof mxShape&&d.paint(b)})};function mxAbstractCanvas2D(){this.converter=this.createUrlConverter();this.reset()}
|
|
mxAbstractCanvas2D.prototype.state=null;mxAbstractCanvas2D.prototype.states=null;mxAbstractCanvas2D.prototype.path=null;mxAbstractCanvas2D.prototype.rotateHtml=!0;mxAbstractCanvas2D.prototype.lastX=0;mxAbstractCanvas2D.prototype.lastY=0;mxAbstractCanvas2D.prototype.moveOp="M";mxAbstractCanvas2D.prototype.lineOp="L";mxAbstractCanvas2D.prototype.quadOp="Q";mxAbstractCanvas2D.prototype.curveOp="C";mxAbstractCanvas2D.prototype.closeOp="Z";mxAbstractCanvas2D.prototype.pointerEvents=!1;
|
|
mxAbstractCanvas2D.prototype.createUrlConverter=function(){return new mxUrlConverter};mxAbstractCanvas2D.prototype.reset=function(){this.state=this.createState();this.states=[]};
|
|
mxAbstractCanvas2D.prototype.createState=function(){return{dx:0,dy:0,scale:1,alpha:1,fillAlpha:1,strokeAlpha:1,fillColor:null,gradientFillAlpha:1,gradientColor:null,gradientAlpha:1,gradientDirection:null,strokeColor:null,strokeWidth:1,dashed:!1,dashPattern:"3 3",lineCap:"flat",lineJoin:"miter",miterLimit:10,fontColor:"#000000",fontBackgroundColor:null,fontBorderColor:null,fontSize:mxConstants.DEFAULT_FONTSIZE,fontFamily:mxConstants.DEFAULT_FONTFAMILY,fontStyle:0,shadow:!1,shadowColor:mxConstants.SHADOWCOLOR,
|
|
shadowAlpha:mxConstants.SHADOW_OPACITY,shadowDx:mxConstants.SHADOW_OFFSET_X,shadowDy:mxConstants.SHADOW_OFFSET_Y,rotation:0,rotationCx:0,rotationCy:0}};mxAbstractCanvas2D.prototype.format=function(a){return Math.round(parseFloat(a))};
|
|
mxAbstractCanvas2D.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var a=this.state,b=2;b<arguments.length;b+=2)this.lastX=arguments[b-1],this.lastY=arguments[b],this.path.push(this.format((this.lastX+a.dx)*a.scale)),this.path.push(this.format((this.lastY+a.dy)*a.scale))};mxAbstractCanvas2D.prototype.rotatePoint=function(a,b,c,d,e){c*=Math.PI/180;return mxUtils.getRotatedPoint(new mxPoint(a,b),Math.cos(c),Math.sin(c),new mxPoint(d,e))};
|
|
mxAbstractCanvas2D.prototype.save=function(){this.states.push(this.state);this.state=mxUtils.clone(this.state)};mxAbstractCanvas2D.prototype.restore=function(){0<this.states.length&&(this.state=this.states.pop())};mxAbstractCanvas2D.prototype.setLink=function(a){};mxAbstractCanvas2D.prototype.scale=function(a){this.state.scale*=a;this.state.strokeWidth*=a};mxAbstractCanvas2D.prototype.translate=function(a,b){this.state.dx+=a;this.state.dy+=b};mxAbstractCanvas2D.prototype.rotate=function(a,b,c,d,e){};
|
|
mxAbstractCanvas2D.prototype.setAlpha=function(a){this.state.alpha=a};mxAbstractCanvas2D.prototype.setFillAlpha=function(a){this.state.fillAlpha=a};mxAbstractCanvas2D.prototype.setStrokeAlpha=function(a){this.state.strokeAlpha=a};mxAbstractCanvas2D.prototype.setFillColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fillColor=a;this.state.gradientColor=null};
|
|
mxAbstractCanvas2D.prototype.setGradient=function(a,b,c,d,e,f,g,h,k){c=this.state;c.fillColor=a;c.gradientFillAlpha=null!=h?h:1;c.gradientColor=b;c.gradientAlpha=null!=k?k:1;c.gradientDirection=g};mxAbstractCanvas2D.prototype.setStrokeColor=function(a){a==mxConstants.NONE&&(a=null);this.state.strokeColor=a};mxAbstractCanvas2D.prototype.setStrokeWidth=function(a){this.state.strokeWidth=a};mxAbstractCanvas2D.prototype.setDashed=function(a){this.state.dashed=a};
|
|
mxAbstractCanvas2D.prototype.setDashPattern=function(a){this.state.dashPattern=a};mxAbstractCanvas2D.prototype.setLineCap=function(a){this.state.lineCap=a};mxAbstractCanvas2D.prototype.setLineJoin=function(a){this.state.lineJoin=a};mxAbstractCanvas2D.prototype.setMiterLimit=function(a){this.state.miterLimit=a};mxAbstractCanvas2D.prototype.setFontColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontColor=a};
|
|
mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBackgroundColor=a};mxAbstractCanvas2D.prototype.setFontBorderColor=function(a){a==mxConstants.NONE&&(a=null);this.state.fontBorderColor=a};mxAbstractCanvas2D.prototype.setFontSize=function(a){this.state.fontSize=parseFloat(a)};mxAbstractCanvas2D.prototype.setFontFamily=function(a){this.state.fontFamily=a};
|
|
mxAbstractCanvas2D.prototype.setFontStyle=function(a){null==a&&(a=0);this.state.fontStyle=a};mxAbstractCanvas2D.prototype.setShadow=function(a){this.state.shadow=a};mxAbstractCanvas2D.prototype.setShadowColor=function(a){a==mxConstants.NONE&&(a=null);this.state.shadowColor=a};mxAbstractCanvas2D.prototype.setShadowAlpha=function(a){this.state.shadowAlpha=a};mxAbstractCanvas2D.prototype.setShadowOffset=function(a,b){this.state.shadowDx=a;this.state.shadowDy=b};
|
|
mxAbstractCanvas2D.prototype.begin=function(){this.lastY=this.lastX=0;this.path=[]};mxAbstractCanvas2D.prototype.moveTo=function(a,b){this.addOp(this.moveOp,a,b)};mxAbstractCanvas2D.prototype.lineTo=function(a,b){this.addOp(this.lineOp,a,b)};mxAbstractCanvas2D.prototype.quadTo=function(a,b,c,d){this.addOp(this.quadOp,a,b,c,d)};mxAbstractCanvas2D.prototype.curveTo=function(a,b,c,d,e,f){this.addOp(this.curveOp,a,b,c,d,e,f)};
|
|
mxAbstractCanvas2D.prototype.arcTo=function(a,b,c,d,e,f,g){a=mxUtils.arcToCurves(this.lastX,this.lastY,a,b,c,d,e,f,g);if(null!=a)for(b=0;b<a.length;b+=6)this.curveTo(a[b],a[b+1],a[b+2],a[b+3],a[b+4],a[b+5])};mxAbstractCanvas2D.prototype.close=function(a,b,c,d,e,f){this.addOp(this.closeOp)};mxAbstractCanvas2D.prototype.end=function(){};
|
|
function mxSvgCanvas2D(a,b){mxAbstractCanvas2D.call(this);this.root=a;this.gradients=[];this.defs=null;this.styleEnabled=null!=b?b:!1;var c=null;if(a.ownerDocument!=document)for(c=a;null!=c&&"svg"!=c.nodeName;)c=c.parentNode;null!=c&&(0<c.getElementsByTagName("defs").length&&(this.defs=c.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=c.firstChild?c.insertBefore(this.defs,c.firstChild):c.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}
|
|
mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D);(function(){mxSvgCanvas2D.prototype.useDomParser=!mxClient.IS_IE&&"function"===typeof DOMParser&&"function"===typeof XMLSerializer;if(mxSvgCanvas2D.prototype.useDomParser)try{var a=(new DOMParser).parseFromString("test text","text/html");mxSvgCanvas2D.prototype.useDomParser=null!=a}catch(b){mxSvgCanvas2D.prototype.useDomParser=!1}})();mxSvgCanvas2D.prototype.node=null;mxSvgCanvas2D.prototype.matchHtmlAlignment=!0;
|
|
mxSvgCanvas2D.prototype.textEnabled=!0;mxSvgCanvas2D.prototype.foEnabled=!0;mxSvgCanvas2D.prototype.foAltText="[Object]";mxSvgCanvas2D.prototype.foOffset=0;mxSvgCanvas2D.prototype.textOffset=0;mxSvgCanvas2D.prototype.strokeTolerance=0;mxSvgCanvas2D.prototype.refCount=0;mxSvgCanvas2D.prototype.blockImagePointerEvents=!1;mxSvgCanvas2D.prototype.lineHeightCorrection=1;mxSvgCanvas2D.prototype.pointerEventsValue="all";mxSvgCanvas2D.prototype.fontMetricsPadding=10;
|
|
mxSvgCanvas2D.prototype.cacheOffsetSize=!0;mxSvgCanvas2D.prototype.format=function(a){return parseFloat(parseFloat(a).toFixed(2))};mxSvgCanvas2D.prototype.getBaseUrl=function(){var a=window.location.href,b=a.lastIndexOf("#");0<b&&(a=a.substring(0,b));return a};mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments);this.gradients=[]};
|
|
mxSvgCanvas2D.prototype.createStyle=function(a){a=this.createElement("style");a.setAttribute("type","text/css");mxUtils.write(a,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}");return a};
|
|
mxSvgCanvas2D.prototype.createElement=function(a,b){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(b||mxConstants.NS_SVG,a);var c=this.root.ownerDocument.createElement(a);null!=b&&c.setAttribute("xmlns",b);return c};
|
|
mxSvgCanvas2D.prototype.createAlternateContent=function(a,b,c,d,e,f,g,h,k,m,l,n,p){return null!=this.foAltText?(a=this.state,b=this.createElement("text"),b.setAttribute("x",Math.round(d/2)),b.setAttribute("y",Math.round((e+a.fontSize)/2)),b.setAttribute("fill",a.fontColor||"black"),b.setAttribute("text-anchor","middle"),b.setAttribute("font-size",a.fontSize+"px"),b.setAttribute("font-family",a.fontFamily),(a.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&b.setAttribute("font-weight","bold"),
|
|
(a.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&b.setAttribute("font-style","italic"),(a.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.setAttribute("text-decoration","underline"),mxUtils.write(b,this.foAltText),b):null};
|
|
mxSvgCanvas2D.prototype.createGradientId=function(a,b,c,d,e){"#"==a.charAt(0)&&(a=a.substring(1));"#"==b.charAt(0)&&(b=b.substring(1));a=a.toLowerCase()+"-"+c;b=b.toLowerCase()+"-"+d;c=null;null==e||e==mxConstants.DIRECTION_SOUTH?c="s":e==mxConstants.DIRECTION_EAST?c="e":(d=a,a=b,b=d,e==mxConstants.DIRECTION_NORTH?c="s":e==mxConstants.DIRECTION_WEST&&(c="e"));return"mx-gradient-"+a+"-"+b+"-"+c};
|
|
mxSvgCanvas2D.prototype.getSvgGradient=function(a,b,c,d,e){var f=this.createGradientId(a,b,c,d,e),g=this.gradients[f];if(null==g){var h=this.root.ownerSVGElement,k=0,m=f+"-"+k;if(null!=h)for(g=h.ownerDocument.getElementById(m);null!=g&&g.ownerSVGElement!=h;)m=f+"-"+k++,g=h.ownerDocument.getElementById(m);else m="id"+ ++this.refCount;null==g&&(g=this.createSvgGradient(a,b,c,d,e),g.setAttribute("id",m),null!=this.defs?this.defs.appendChild(g):h.appendChild(g));this.gradients[f]=g}return g.getAttribute("id")};
|
|
mxSvgCanvas2D.prototype.createSvgGradient=function(a,b,c,d,e){var f=this.createElement("linearGradient");f.setAttribute("x1","0%");f.setAttribute("y1","0%");f.setAttribute("x2","0%");f.setAttribute("y2","0%");null==e||e==mxConstants.DIRECTION_SOUTH?f.setAttribute("y2","100%"):e==mxConstants.DIRECTION_EAST?f.setAttribute("x2","100%"):e==mxConstants.DIRECTION_NORTH?f.setAttribute("y1","100%"):e==mxConstants.DIRECTION_WEST&&f.setAttribute("x1","100%");c=1>c?";stop-opacity:"+c:"";e=this.createElement("stop");
|
|
e.setAttribute("offset","0%");e.setAttribute("style","stop-color:"+a+c);f.appendChild(e);c=1>d?";stop-opacity:"+d:"";e=this.createElement("stop");e.setAttribute("offset","100%");e.setAttribute("style","stop-color:"+b+c);f.appendChild(e);return f};
|
|
mxSvgCanvas2D.prototype.addNode=function(a,b){var c=this.node,d=this.state;if(null!=c){if("path"==c.nodeName)if(null!=this.path&&0<this.path.length)c.setAttribute("d",this.path.join(" "));else return;a&&null!=d.fillColor?this.updateFill():this.styleEnabled||("ellipse"==c.nodeName&&mxClient.IS_FF?c.setAttribute("fill","transparent"):c.setAttribute("fill","none"),a=!1);b&&null!=d.strokeColor?this.updateStroke():this.styleEnabled||c.setAttribute("stroke","none");null!=d.transform&&0<d.transform.length&&
|
|
c.setAttribute("transform",d.transform);d.shadow&&this.root.appendChild(this.createShadow(c));0<this.strokeTolerance&&!a&&this.root.appendChild(this.createTolerance(c));this.pointerEvents&&("path"!=c.nodeName||this.path[this.path.length-1]==this.closeOp)?c.setAttribute("pointer-events",this.pointerEventsValue):!this.pointerEvents&&null==this.originalRoot&&c.setAttribute("pointer-events","none");("rect"!=c.nodeName&&"path"!=c.nodeName&&"ellipse"!=c.nodeName||"none"!=c.getAttribute("fill")&&"transparent"!=
|
|
c.getAttribute("fill")||"none"!=c.getAttribute("stroke")||"none"!=c.getAttribute("pointer-events"))&&this.root.appendChild(c);this.node=null}};
|
|
mxSvgCanvas2D.prototype.updateFill=function(){var a=this.state;(1>a.alpha||1>a.fillAlpha)&&this.node.setAttribute("fill-opacity",a.alpha*a.fillAlpha);if(null!=a.fillColor)if(null!=a.gradientColor)if(a=this.getSvgGradient(a.fillColor,a.gradientColor,a.gradientFillAlpha,a.gradientAlpha,a.gradientDirection),!mxClient.IS_CHROME_APP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&this.root.ownerDocument==document){var b=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");this.node.setAttribute("fill",
|
|
"url("+b+"#"+a+")")}else this.node.setAttribute("fill","url(#"+a+")");else this.node.setAttribute("fill",a.fillColor.toLowerCase())};mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(1,this.format(this.state.strokeWidth*this.state.scale))};
|
|
mxSvgCanvas2D.prototype.updateStroke=function(){var a=this.state;this.node.setAttribute("stroke",a.strokeColor.toLowerCase());(1>a.alpha||1>a.strokeAlpha)&&this.node.setAttribute("stroke-opacity",a.alpha*a.strokeAlpha);var 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.strokeWidth*a.scale))};
|
|
mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var a=this.state;null!=a.lineJoin&&"miter"!=a.lineJoin&&this.node.setAttribute("stroke-linejoin",a.lineJoin);if(null!=a.lineCap){var b=a.lineCap;"flat"==b&&(b="butt");"butt"!=b&&this.node.setAttribute("stroke-linecap",b)}null!=a.miterLimit&&(!this.styleEnabled||10!=a.miterLimit)&&this.node.setAttribute("stroke-miterlimit",a.miterLimit)};
|
|
mxSvgCanvas2D.prototype.createDashPattern=function(a){var b=[];if("string"===typeof this.state.dashPattern){var c=this.state.dashPattern.split(" ");if(0<c.length)for(var d=0;d<c.length;d++)b[d]=Number(c[d])*a}return b.join(" ")};
|
|
mxSvgCanvas2D.prototype.createTolerance=function(a){a=a.cloneNode(!0);var b=parseFloat(a.getAttribute("stroke-width")||1)+this.strokeTolerance;a.setAttribute("pointer-events","stroke");a.setAttribute("visibility","hidden");a.removeAttribute("stroke-dasharray");a.setAttribute("stroke-width",b);a.setAttribute("fill","none");a.setAttribute("stroke",mxClient.IS_OT?"none":"white");return a};
|
|
mxSvgCanvas2D.prototype.createShadow=function(a){a=a.cloneNode(!0);var b=this.state;"none"!=a.getAttribute("fill")&&(!mxClient.IS_FF||"transparent"!=a.getAttribute("fill"))&&a.setAttribute("fill",b.shadowColor);"none"!=a.getAttribute("stroke")&&a.setAttribute("stroke",b.shadowColor);a.setAttribute("transform","translate("+this.format(b.shadowDx*b.scale)+","+this.format(b.shadowDy*b.scale)+")"+(b.transform||""));a.setAttribute("opacity",b.shadowAlpha);return a};
|
|
mxSvgCanvas2D.prototype.setLink=function(a){if(null==a)this.root=this.originalRoot;else{this.originalRoot=this.root;var b=this.createElement("a");null==b.setAttributeNS||this.root.ownerDocument!=document&&null==document.documentMode?b.setAttribute("xlink:href",a):b.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",a);this.root.appendChild(b);this.root=b}};
|
|
mxSvgCanvas2D.prototype.rotate=function(a,b,c,d,e){if(0!=a||b||c){var f=this.state;d+=f.dx;e+=f.dy;d*=f.scale;e*=f.scale;f.transform=f.transform||"";if(b&&c)a+=180;else if(b!=c){var g=b?d:0,h=b?-1:1,k=c?e:0,m=c?-1:1;f.transform+="translate("+this.format(g)+","+this.format(k)+")scale("+this.format(h)+","+this.format(m)+")translate("+this.format(-g)+","+this.format(-k)+")"}if(b?!c:c)a*=-1;0!=a&&(f.transform+="rotate("+this.format(a)+","+this.format(d)+","+this.format(e)+")");f.rotation+=a;f.rotationCx=
|
|
d;f.rotationCy=e}};mxSvgCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments);this.node=this.createElement("path")};mxSvgCanvas2D.prototype.rect=function(a,b,c,d){var e=this.state,f=this.createElement("rect");f.setAttribute("x",this.format((a+e.dx)*e.scale));f.setAttribute("y",this.format((b+e.dy)*e.scale));f.setAttribute("width",this.format(c*e.scale));f.setAttribute("height",this.format(d*e.scale));this.node=f};
|
|
mxSvgCanvas2D.prototype.roundrect=function(a,b,c,d,e,f){this.rect(a,b,c,d);0<e&&this.node.setAttribute("rx",this.format(e*this.state.scale));0<f&&this.node.setAttribute("ry",this.format(f*this.state.scale))};mxSvgCanvas2D.prototype.ellipse=function(a,b,c,d){var e=this.state,f=this.createElement("ellipse");f.setAttribute("cx",Math.round((a+c/2+e.dx)*e.scale));f.setAttribute("cy",Math.round((b+d/2+e.dy)*e.scale));f.setAttribute("rx",c/2*e.scale);f.setAttribute("ry",d/2*e.scale);this.node=f};
|
|
mxSvgCanvas2D.prototype.image=function(a,b,c,d,e,f,g,h){e=this.converter.convert(e);f=null!=f?f:!0;g=null!=g?g:!1;h=null!=h?h:!1;var k=this.state;a+=k.dx;b+=k.dy;var m=this.createElement("image");m.setAttribute("x",this.format(a*k.scale));m.setAttribute("y",this.format(b*k.scale));m.setAttribute("width",this.format(c*k.scale));m.setAttribute("height",this.format(d*k.scale));null==m.setAttributeNS?m.setAttribute("xlink:href",e):m.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",e);f||m.setAttribute("preserveAspectRatio",
|
|
"none");(1>k.alpha||1>k.fillAlpha)&&m.setAttribute("opacity",k.alpha*k.fillAlpha);e=this.state.transform||"";if(g||h){var l=f=1,n=0,p=0;g&&(f=-1,n=-c-2*a);h&&(l=-1,p=-d-2*b);e+="scale("+f+","+l+")translate("+n*k.scale+","+p*k.scale+")"}0<e.length&&m.setAttribute("transform",e);this.pointerEvents||m.setAttribute("pointer-events","none");this.root.appendChild(m);this.blockImagePointerEvents&&(m.setAttribute("style","pointer-events:none"),m=this.createElement("rect"),m.setAttribute("visibility","hidden"),
|
|
m.setAttribute("pointer-events","fill"),m.setAttribute("x",this.format(a*k.scale)),m.setAttribute("y",this.format(b*k.scale)),m.setAttribute("width",this.format(c*k.scale)),m.setAttribute("height",this.format(d*k.scale)),this.root.appendChild(m))};
|
|
mxSvgCanvas2D.prototype.convertHtml=function(a){if(this.useDomParser){var b=(new DOMParser).parseFromString(a,"text/html");null!=b&&(a=(new XMLSerializer).serializeToString(b.body),"\x3cbody"==a.substring(0,5)&&(a=a.substring(a.indexOf("\x3e",5)+1)),"\x3c/body\x3e"==a.substring(a.length-7,a.length)&&(a=a.substring(0,a.length-7)))}else{if(null!=document.implementation&&null!=document.implementation.createDocument){var b=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null),
|
|
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,"\x26amp;amp;").replace(/</g,"\x26amp;lt;").replace(/>/g,"\x26amp;gt;").replace(/</g,"\x26amp;lt;").replace(/>/g,"\x26amp;gt;").replace(/</g,"\x26lt;").replace(/>/g,"\x26gt;");a=b.value.replace(/&/g,"\x26amp;").replace(/&lt;/g,
|
|
"\x26lt;").replace(/&gt;/g,"\x26gt;").replace(/&amp;/g,"\x26amp;").replace(/<br>/g,"\x3cbr /\x3e").replace(/<hr>/g,"\x3chr /\x3e").replace(/(<img[^>]+)>/gm,"$1 /\x3e")}return a};
|
|
mxSvgCanvas2D.prototype.createDiv=function(a,b,c,d,e){c=this.state;d="display:inline-block;font-size:"+c.fontSize+"px;font-family:"+c.fontFamily+";color:"+c.fontColor+";line-height:"+(mxConstants.ABSOLUTE_LINE_HEIGHT?c.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*this.lineHeightCorrection)+";"+d;(c.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(d+="font-weight:bold;");(c.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(d+="font-style:italic;");(c.fontStyle&
|
|
mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(d+="text-decoration:underline;");b==mxConstants.ALIGN_CENTER?d+="text-align:center;":b==mxConstants.ALIGN_RIGHT&&(d+="text-align:right;");b="";null!=c.fontBackgroundColor&&(b+="background-color:"+c.fontBackgroundColor+";");null!=c.fontBorderColor&&(b+="border:1px solid "+c.fontBorderColor+";");mxUtils.isNode(a)||(a=this.convertHtml(a),"fill"!=e&&"width"!=e?a='\x3cdiv xmlns\x3d"http://www.w3.org/1999/xhtml" style\x3d"display:inline-block;text-align:inherit;text-decoration:inherit;'+
|
|
b+'"\x3e'+a+"\x3c/div\x3e":d+=b);if(!mxClient.IS_IE&&document.createElementNS)return e=document.createElementNS("http://www.w3.org/1999/xhtml","div"),e.setAttribute("style",d),mxUtils.isNode(a)?this.root.ownerDocument!=document?e.appendChild(a.cloneNode(!0)):e.appendChild(a):e.innerHTML=a,e;mxUtils.isNode(a)&&this.root.ownerDocument!=document&&(a=a.outerHTML);return mxUtils.parseXml('\x3cdiv xmlns\x3d"http://www.w3.org/1999/xhtml" style\x3d"'+d+'"\x3e'+a+"\x3c/div\x3e").documentElement};
|
|
mxSvgCanvas2D.prototype.invalidateCachedOffsetSize=function(a){delete a.firstChild.mxCachedOffsetWidth;delete a.firstChild.mxCachedFinalOffsetWidth;delete a.firstChild.mxCachedFinalOffsetHeight};
|
|
mxSvgCanvas2D.prototype.updateText=function(a,b,c,d,e,f,g,h,k,m,l){if(null!=l&&null!=l.firstChild&&null!=l.firstChild.firstChild&&null!=l.firstChild.firstChild.firstChild){l=l.firstChild;var n=l.firstChild,p=n.firstChild;m=null!=m?m:0;var r=this.state;a+=r.dx;b+=r.dy;k?(p.style.maxHeight=Math.round(d)+"px",p.style.maxWidth=Math.round(c)+"px"):"fill"==h?(p.style.width=Math.round(c+1)+"px",p.style.height=Math.round(d+1)+"px"):"width"==h&&(p.style.width=Math.round(c+1)+"px",0<d&&(p.style.maxHeight=Math.round(d)+
|
|
"px"));g&&0<c&&(p.style.width=Math.round(c+1)+"px");var q=0,s=0,s=p;null!=s.firstChild&&"DIV"==s.firstChild.nodeName&&(s=s.firstChild);q=(null!=l.mxCachedOffsetWidth?l.mxCachedOffsetWidth:s.offsetWidth)+2;g&&"fill"!=h&&(k&&(q=Math.min(q,c)),p.style.width=q+"px");q=(null!=l.mxCachedFinalOffsetWidth?l.mxCachedFinalOffsetWidth:s.offsetWidth)+2;s=(null!=l.mxCachedFinalOffsetHeight?l.mxCachedFinalOffsetHeight:s.offsetHeight)-2;k&&(s=Math.min(s,d),q=Math.min(q,c));"width"==h?d=s:"fill"!=h&&(c=q,d=s);k=
|
|
g=0;e==mxConstants.ALIGN_CENTER?g-=c/2:e==mxConstants.ALIGN_RIGHT&&(g-=c);a+=g;f==mxConstants.ALIGN_MIDDLE?k-=d/2:f==mxConstants.ALIGN_BOTTOM&&(k-=d);"fill"!=h&&(mxClient.IS_FF&&mxClient.IS_WIN)&&(k-=2);b+=k;e=1!=r.scale?"scale("+r.scale+")":"";0!=r.rotation&&this.rotateHtml?(e+="rotate("+r.rotation+","+c/2+","+d/2+")",b=this.rotatePoint((a+c/2)*r.scale,(b+d/2)*r.scale,r.rotation,r.rotationCx,r.rotationCy),a=b.x-c*r.scale/2,b=b.y-d*r.scale/2):(a*=r.scale,b*=r.scale);0!=m&&(e+="rotate("+m+","+-g+","+
|
|
-k+")");l.setAttribute("transform","translate("+Math.round(a)+","+Math.round(b)+")"+e);n.setAttribute("width",Math.round(Math.max(1,c)));n.setAttribute("height",Math.round(Math.max(1,d)))}};
|
|
mxSvgCanvas2D.prototype.text=function(a,b,c,d,e,f,g,h,k,m,l,n,p){if(this.textEnabled&&null!=e){n=null!=n?n:0;var r=this.state;a+=r.dx;b+=r.dy;if(this.foEnabled&&"html"==k){var q="vertical-align:top;";l?q+="overflow:hidden;max-height:"+Math.round(d)+"px;max-width:"+Math.round(c)+"px;":"fill"==m?q+="width:"+Math.round(c+1)+"px;height:"+Math.round(d+1)+"px;overflow:hidden;":"width"==m&&(q+="width:"+Math.round(c+1)+"px;",0<d&&(q+="max-height:"+Math.round(d)+"px;overflow:hidden;"));var q=h&&0<c?q+("width:"+
|
|
Math.round(c+1)+"px;white-space:normal;word-wrap:"+mxConstants.WORD_WRAP+";"):q+"white-space:nowrap;",s=this.createElement("g");1>r.alpha&&s.setAttribute("opacity",r.alpha);var u=this.createElement("foreignObject");u.setAttribute("style","overflow:visible;");u.setAttribute("pointer-events","all");q=this.createDiv(e,f,g,q,m);if(null!=q){null!=p&&q.setAttribute("dir",p);s.appendChild(u);this.root.appendChild(s);var t=0,z=0;p=t=2;if(mxClient.IS_IE&&(9==document.documentMode||!mxClient.IS_SVG)){var y=
|
|
document.createElement("div");y.style.cssText=q.getAttribute("style");y.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";y.style.position="absolute";y.style.visibility="hidden";z=document.createElement("div");z.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";z.style.wordWrap=mxConstants.WORD_WRAP;z.innerHTML=mxUtils.isNode(e)?e.outerHTML:e;y.appendChild(z);document.body.appendChild(y);8!=document.documentMode&&(9!=document.documentMode&&null!=r.fontBorderColor)&&(t+=2,p+=2);if(h&&
|
|
0<c){var v=z.offsetWidth;if(!l&&h&&0<c&&this.root.ownerDocument!=document&&"fill"!=m){var K=y.style.whiteSpace;z.style.whiteSpace="nowrap";v<z.offsetWidth&&(y.style.whiteSpace=K)}l&&(v=Math.min(v,c));y.style.width=v+"px";t=z.offsetWidth+t+0;z=z.offsetHeight+p;y.style.display="inline-block";y.style.position="";y.style.visibility="";y.style.width=t+"px";q.setAttribute("style",y.style.cssText)}else t=z.offsetWidth+t,z=z.offsetHeight+p;y.parentNode.removeChild(y);u.appendChild(q)}else this.root.ownerDocument!=
|
|
document?(q.style.visibility="hidden",document.body.appendChild(q)):u.appendChild(q),y=q,null!=y.firstChild&&"DIV"==y.firstChild.nodeName&&(y=y.firstChild,h&&"break-word"==q.style.wordWrap&&(y.style.width="100%")),v=y.offsetWidth,0==v&&q.parentNode==u&&(q.style.visibility="hidden",document.body.appendChild(q),v=y.offsetWidth),this.cacheOffsetSize&&(s.mxCachedOffsetWidth=v),!l&&(h&&0<c&&this.root.ownerDocument!=document&&"fill"!=m&&"width"!=m)&&(K=q.style.whiteSpace,q.style.whiteSpace="nowrap",v<y.offsetWidth&&
|
|
(q.style.whiteSpace=K)),t=v+t-1,h&&("fill"!=m&&"width"!=m)&&(l&&(t=Math.min(t,c)),q.style.width=t+"px"),t=y.offsetWidth,z=y.offsetHeight,this.cacheOffsetSize&&(s.mxCachedFinalOffsetWidth=t,s.mxCachedFinalOffsetHeight=z),z-=p,q.parentNode!=u&&(u.appendChild(q),q.style.visibility="");l&&(z=Math.min(z,d),t=Math.min(t,c));"width"==m?d=z:"fill"!=m&&(c=t,d=z);1>r.alpha&&s.setAttribute("opacity",r.alpha);p=q=0;f==mxConstants.ALIGN_CENTER?q-=c/2:f==mxConstants.ALIGN_RIGHT&&(q-=c);a+=q;g==mxConstants.ALIGN_MIDDLE?
|
|
p-=d/2:g==mxConstants.ALIGN_BOTTOM&&(p-=d);"fill"!=m&&(mxClient.IS_FF&&mxClient.IS_WIN)&&(p-=2);b+=p;y=1!=r.scale?"scale("+r.scale+")":"";0!=r.rotation&&this.rotateHtml?(y+="rotate("+r.rotation+","+c/2+","+d/2+")",b=this.rotatePoint((a+c/2)*r.scale,(b+d/2)*r.scale,r.rotation,r.rotationCx,r.rotationCy),a=b.x-c*r.scale/2,b=b.y-d*r.scale/2):(a*=r.scale,b*=r.scale);0!=n&&(y+="rotate("+n+","+-q+","+-p+")");s.setAttribute("transform","translate("+(Math.round(a)+this.foOffset)+","+(Math.round(b)+this.foOffset)+
|
|
")"+y);u.setAttribute("width",Math.round(Math.max(1,c)));u.setAttribute("height",Math.round(Math.max(1,d)));this.root.ownerDocument!=document&&(a=this.createAlternateContent(u,a,b,c,d,e,f,g,h,k,m,l,n),null!=a&&(u.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility"),c=this.createElement("switch"),c.appendChild(u),c.appendChild(a),s.appendChild(c)))}}else this.plainText(a,b,c,d,e,f,g,h,m,l,n,p)}};
|
|
mxSvgCanvas2D.prototype.createClip=function(a,b,c,d){a=Math.round(a);b=Math.round(b);c=Math.round(c);d=Math.round(d);for(var e="mx-clip-"+a+"-"+b+"-"+c+"-"+d,f=0,g=e+"-"+f;null!=document.getElementById(g);)g=e+"-"+ ++f;clip=this.createElement("clipPath");clip.setAttribute("id",g);e=this.createElement("rect");e.setAttribute("x",a);e.setAttribute("y",b);e.setAttribute("width",c);e.setAttribute("height",d);clip.appendChild(e);return clip};
|
|
mxSvgCanvas2D.prototype.plainText=function(a,b,c,d,e,f,g,h,k,m,l,n){l=null!=l?l:0;h=this.state;var p=h.fontSize,r=this.createElement("g"),q=h.transform||"";this.updateFont(r);0!=l&&(q+="rotate("+l+","+this.format(a*h.scale)+","+this.format(b*h.scale)+")");null!=n&&r.setAttribute("direction",n);m&&(0<c&&0<d)&&(n=a,l=b,f==mxConstants.ALIGN_CENTER?n-=c/2:f==mxConstants.ALIGN_RIGHT&&(n-=c),"fill"!=k&&(g==mxConstants.ALIGN_MIDDLE?l-=d/2:g==mxConstants.ALIGN_BOTTOM&&(l-=d)),l=this.createClip(n*h.scale-
|
|
2,l*h.scale-2,c*h.scale+4,d*h.scale+4),null!=this.defs?this.defs.appendChild(l):this.root.appendChild(l),!mxClient.IS_CHROME_APP&&!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_EDGE&&this.root.ownerDocument==document?(n=this.getBaseUrl().replace(/([\(\)])/g,"\\$1"),r.setAttribute("clip-path","url("+n+"#"+l.getAttribute("id")+")")):r.setAttribute("clip-path","url(#"+l.getAttribute("id")+")"));l=f==mxConstants.ALIGN_RIGHT?"end":f==mxConstants.ALIGN_CENTER?"middle":"start";"start"!=l&&r.setAttribute("text-anchor",
|
|
l);(!this.styleEnabled||p!=mxConstants.DEFAULT_FONTSIZE)&&r.setAttribute("font-size",p*h.scale+"px");0<q.length&&r.setAttribute("transform",q);1>h.alpha&&r.setAttribute("opacity",h.alpha);q=e.split("\n");n=Math.round(p*mxConstants.LINE_HEIGHT);var s=p+(q.length-1)*n;l=b+p-1;g==mxConstants.ALIGN_MIDDLE?"fill"==k?l-=d/2:(m=(this.matchHtmlAlignment&&m&&0<d?Math.min(s,d):s)/2,l-=m+1):g==mxConstants.ALIGN_BOTTOM&&("fill"==k?l-=d:(m=this.matchHtmlAlignment&&m&&0<d?Math.min(s,d):s,l-=m+2));for(m=0;m<q.length;m++)0<
|
|
q[m].length&&0<mxUtils.trim(q[m]).length&&(p=this.createElement("text"),p.setAttribute("x",this.format(a*h.scale)+this.textOffset),p.setAttribute("y",this.format(l*h.scale)+this.textOffset),mxUtils.write(p,q[m]),r.appendChild(p)),l+=n;this.root.appendChild(r);this.addTextBackground(r,e,a,b,c,"fill"==k?d:s,f,g,k)};
|
|
mxSvgCanvas2D.prototype.updateFont=function(a){var b=this.state;a.setAttribute("fill",b.fontColor);(!this.styleEnabled||b.fontFamily!=mxConstants.DEFAULT_FONTFAMILY)&&a.setAttribute("font-family",b.fontFamily);(b.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&a.setAttribute("font-weight","bold");(b.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&a.setAttribute("font-style","italic");(b.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&a.setAttribute("text-decoration",
|
|
"underline")};
|
|
mxSvgCanvas2D.prototype.addTextBackground=function(a,b,c,d,e,f,g,h,k){var m=this.state;if(null!=m.fontBackgroundColor||null!=m.fontBorderColor){var l=null;if("fill"==k||"width"==k)g==mxConstants.ALIGN_CENTER?c-=e/2:g==mxConstants.ALIGN_RIGHT&&(c-=e),h==mxConstants.ALIGN_MIDDLE?d-=f/2:h==mxConstants.ALIGN_BOTTOM&&(d-=f),l=new mxRectangle((c+1)*m.scale,d*m.scale,(e-2)*m.scale,(f+2)*m.scale);else if(null!=a.getBBox&&this.root.ownerDocument==document)try{var l=a.getBBox(),n=mxClient.IS_IE&&mxClient.IS_SVG,
|
|
l=new mxRectangle(l.x,l.y+(n?0:1),l.width,l.height+(n?1:0))}catch(p){}else l=document.createElement("div"),l.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?m.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,l.style.fontSize=m.fontSize+"px",l.style.fontFamily=m.fontFamily,l.style.whiteSpace="nowrap",l.style.position="absolute",l.style.visibility="hidden",l.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",l.style.zoom="1",(m.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&
|
|
(l.style.fontWeight="bold"),(m.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(l.style.fontStyle="italic"),b=mxUtils.htmlEntities(b,!1),l.innerHTML=b.replace(/\n/g,"\x3cbr/\x3e"),document.body.appendChild(l),e=l.offsetWidth,f=l.offsetHeight,l.parentNode.removeChild(l),g==mxConstants.ALIGN_CENTER?c-=e/2:g==mxConstants.ALIGN_RIGHT&&(c-=e),h==mxConstants.ALIGN_MIDDLE?d-=f/2:h==mxConstants.ALIGN_BOTTOM&&(d-=f),l=new mxRectangle((c+1)*m.scale,(d+2)*m.scale,e*m.scale,(f+1)*m.scale);null!=
|
|
l&&(b=this.createElement("rect"),b.setAttribute("fill",m.fontBackgroundColor||"none"),b.setAttribute("stroke",m.fontBorderColor||"none"),b.setAttribute("x",Math.floor(l.x-1)),b.setAttribute("y",Math.floor(l.y-1)),b.setAttribute("width",Math.ceil(l.width+2)),b.setAttribute("height",Math.ceil(l.height)),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)};var mxVmlCanvas2D=function(a){mxAbstractCanvas2D.call(this);this.root=a};mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D);mxVmlCanvas2D.prototype.node=null;mxVmlCanvas2D.prototype.textEnabled=!0;mxVmlCanvas2D.prototype.moveOp="m";mxVmlCanvas2D.prototype.lineOp="l";
|
|
mxVmlCanvas2D.prototype.curveOp="c";mxVmlCanvas2D.prototype.closeOp="x";mxVmlCanvas2D.prototype.rotatedHtmlBackground="";mxVmlCanvas2D.prototype.vmlScale=1;mxVmlCanvas2D.prototype.createElement=function(a){return document.createElement(a)};mxVmlCanvas2D.prototype.createVmlElement=function(a){return this.createElement(mxClient.VML_PREFIX+":"+a)};
|
|
mxVmlCanvas2D.prototype.addNode=function(a,b){var c=this.node,d=this.state;if(null!=c){if("shape"==c.nodeName)if(null!=this.path&&0<this.path.length)c.path=this.path.join(" ")+" e",c.style.width=this.root.style.width,c.style.height=this.root.style.height,c.coordsize=parseInt(c.style.width)+" "+parseInt(c.style.height);else return;c.strokeweight=this.format(Math.max(1,d.strokeWidth*d.scale/this.vmlScale))+"px";d.shadow&&this.root.appendChild(this.createShadow(c,a&&null!=d.fillColor,b&&null!=d.strokeColor));
|
|
b&&null!=d.strokeColor?(c.stroked="true",c.strokecolor=d.strokeColor):c.stroked="false";c.appendChild(this.createStroke());a&&null!=d.fillColor?c.appendChild(this.createFill()):this.pointerEvents&&("shape"!=c.nodeName||this.path[this.path.length-1]==this.closeOp)?c.appendChild(this.createTransparentFill()):c.filled="false";this.root.appendChild(c)}};
|
|
mxVmlCanvas2D.prototype.createTransparentFill=function(){var a=this.createVmlElement("fill");a.src=mxClient.imageBasePath+"/transparent.gif";a.type="tile";return a};
|
|
mxVmlCanvas2D.prototype.createFill=function(){var a=this.state,b=this.createVmlElement("fill");b.color=a.fillColor;if(null!=a.gradientColor){b.type="gradient";b.method="none";b.color2=a.gradientColor;var c=180-a.rotation,c=a.gradientDirection==mxConstants.DIRECTION_WEST?c-(90+("x"==this.root.style.flip?180:0)):a.gradientDirection==mxConstants.DIRECTION_EAST?c+(90+("x"==this.root.style.flip?180:0)):a.gradientDirection==mxConstants.DIRECTION_NORTH?c-(180+("y"==this.root.style.flip?-180:0)):c+("y"==
|
|
this.root.style.flip?-180:0);if("x"==this.root.style.flip||"y"==this.root.style.flip)c*=-1;b.angle=mxUtils.mod(c,360);b.opacity=100*a.alpha*a.gradientFillAlpha+"%";b.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",100*a.alpha*a.gradientAlpha+"%")}else if(1>a.alpha||1>a.fillAlpha)b.opacity=100*a.alpha*a.fillAlpha+"%";return b};
|
|
mxVmlCanvas2D.prototype.createStroke=function(){var a=this.state,b=this.createVmlElement("stroke");b.endcap=a.lineCap||"flat";b.joinstyle=a.lineJoin||"miter";b.miterlimit=a.miterLimit||"10";if(1>a.alpha||1>a.strokeAlpha)b.opacity=100*a.alpha*a.strokeAlpha+"%";a.dashed&&(b.dashstyle=this.getVmlDashStyle());return b};mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var a="dash";if("string"===typeof this.state.dashPattern){var b=this.state.dashPattern.split(" ");0<b.length&&1==b[0]&&(a="0 2")}return a};
|
|
mxVmlCanvas2D.prototype.createShadow=function(a,b,c){var d=this.state,e=-d.rotation*(Math.PI/180),f=Math.cos(e),e=Math.sin(e),g=d.shadowDx*d.scale,h=d.shadowDy*d.scale;"x"==this.root.style.flip?g*=-1:"y"==this.root.style.flip&&(h*=-1);var k=a.cloneNode(!0);k.style.marginLeft=Math.round(g*f-h*e)+"px";k.style.marginTop=Math.round(g*e+h*f)+"px";8==document.documentMode&&(k.strokeweight=a.strokeweight,"shape"==a.nodeName&&(k.path=this.path.join(" ")+" e",k.style.width=this.root.style.width,k.style.height=
|
|
this.root.style.height,k.coordsize=parseInt(a.style.width)+" "+parseInt(a.style.height)));c?(k.strokecolor=d.shadowColor,k.appendChild(this.createShadowStroke())):k.stroked="false";b?k.appendChild(this.createShadowFill()):k.filled="false";return k};mxVmlCanvas2D.prototype.createShadowFill=function(){var a=this.createVmlElement("fill");a.color=this.state.shadowColor;a.opacity=100*this.state.alpha*this.state.shadowAlpha+"%";return a};
|
|
mxVmlCanvas2D.prototype.createShadowStroke=function(){var a=this.createStroke();a.opacity=100*this.state.alpha*this.state.shadowAlpha+"%";return a};mxVmlCanvas2D.prototype.rotate=function(a,b,c,d,e){b&&c?a+=180:b?this.root.style.flip="x":c&&(this.root.style.flip="y");if(b?!c:c)a*=-1;this.root.style.rotation=a;this.state.rotation+=a;this.state.rotationCx=d;this.state.rotationCy=e};
|
|
mxVmlCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments);this.node=this.createVmlElement("shape");this.node.style.position="absolute"};
|
|
mxVmlCanvas2D.prototype.quadTo=function(a,b,c,d){var e=this.state,f=(this.lastX+e.dx)*e.scale,g=(this.lastY+e.dy)*e.scale;a=(a+e.dx)*e.scale;b=(b+e.dy)*e.scale;c=(c+e.dx)*e.scale;d=(d+e.dy)*e.scale;var g=g+2/3*(b-g),h=c+2/3*(a-c);b=d+2/3*(b-d);this.path.push("c "+this.format(f+2/3*(a-f))+" "+this.format(g)+" "+this.format(h)+" "+this.format(b)+" "+this.format(c)+" "+this.format(d));this.lastX=c/e.scale-e.dx;this.lastY=d/e.scale-e.dy};
|
|
mxVmlCanvas2D.prototype.createRect=function(a,b,c,d,e){var f=this.state;a=this.createVmlElement(a);a.style.position="absolute";a.style.left=this.format((b+f.dx)*f.scale)+"px";a.style.top=this.format((c+f.dy)*f.scale)+"px";a.style.width=this.format(d*f.scale)+"px";a.style.height=this.format(e*f.scale)+"px";return a};mxVmlCanvas2D.prototype.rect=function(a,b,c,d){this.node=this.createRect("rect",a,b,c,d)};
|
|
mxVmlCanvas2D.prototype.roundrect=function(a,b,c,d,e,f){this.node=this.createRect("roundrect",a,b,c,d);this.node.setAttribute("arcsize",Math.max(100*e/c,100*f/d)+"%")};mxVmlCanvas2D.prototype.ellipse=function(a,b,c,d){this.node=this.createRect("oval",a,b,c,d)};
|
|
mxVmlCanvas2D.prototype.image=function(a,b,c,d,e,f,g,h){var k=null;f?(k=this.createRect("rect",a,b,c,d),k.stroked="false",a=this.createVmlElement("fill"),a.aspect=f?"atmost":"ignore",a.rotate="true",a.type="frame",a.src=e,k.appendChild(a)):(k=this.createRect("image",a,b,c,d),k.src=e);g&&h?k.style.rotation="180":g?k.style.flip="x":h&&(k.style.flip="y");if(1>this.state.alpha||1>this.state.fillAlpha)k.style.filter+="alpha(opacity\x3d"+100*this.state.alpha*this.state.fillAlpha+")";this.root.appendChild(k)};
|
|
mxVmlCanvas2D.prototype.createDiv=function(a,b,c,d){c=this.createElement("div");var e=this.state,f="";null!=e.fontBackgroundColor&&(f+="background-color:"+e.fontBackgroundColor+";");null!=e.fontBorderColor&&(f+="border:1px solid "+e.fontBorderColor+";");mxUtils.isNode(a)?c.appendChild(a):"fill"!=d&&"width"!=d?(d=this.createElement("div"),d.style.cssText=f,d.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",d.style.zoom="1",d.style.textDecoration="inherit",d.innerHTML=a,c.appendChild(d)):(c.style.cssText=
|
|
f,c.innerHTML=a);a=c.style;a.fontSize=e.fontSize/this.vmlScale+"px";a.fontFamily=e.fontFamily;a.color=e.fontColor;a.verticalAlign="top";a.textAlign=b||"left";a.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?e.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale+"px":mxConstants.LINE_HEIGHT;(e.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a.fontWeight="bold");(e.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a.fontStyle="italic");(e.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&
|
|
(a.textDecoration="underline");return c};
|
|
mxVmlCanvas2D.prototype.text=function(a,b,c,d,e,f,g,h,k,m,l,n,p){if(this.textEnabled&&null!=e){var r=this.state;if("html"==k){null!=r.rotation&&(b=this.rotatePoint(a,b,r.rotation,r.rotationCx,r.rotationCy),a=b.x,b=b.y);8==document.documentMode&&!mxClient.IS_EM?(a+=r.dx,b+=r.dy,"fill"!=m&&g==mxConstants.ALIGN_TOP&&(b-=1)):(a*=r.scale,b*=r.scale);k=8==document.documentMode&&!mxClient.IS_EM?this.createVmlElement("group"):this.createElement("div");k.style.position="absolute";k.style.display="inline";
|
|
k.style.left=this.format(a)+"px";k.style.top=this.format(b)+"px";k.style.zoom=r.scale;var q=this.createElement("div");q.style.position="relative";q.style.display="inline";var s=mxUtils.getAlignmentAsPoint(f,g),u=s.x,s=s.y;e=this.createDiv(e,f,g,m);f=this.createElement("div");null!=p&&e.setAttribute("dir",p);if(h&&0<c){if(l||(e.style.width=Math.round(c)+"px"),e.style.wordWrap=mxConstants.WORD_WRAP,e.style.whiteSpace="normal","break-word"==e.style.wordWrap){var t=e;null!=t.firstChild&&"DIV"==t.firstChild.nodeName&&
|
|
(t.firstChild.style.width="100%")}}else e.style.whiteSpace="nowrap";n=r.rotation+(n||0);this.rotateHtml&&0!=n?(f.style.display="inline",f.style.zoom="1",f.appendChild(e),8==document.documentMode&&!mxClient.IS_EM&&"DIV"!=this.root.nodeName?(q.appendChild(f),k.appendChild(q)):k.appendChild(f)):8==document.documentMode&&!mxClient.IS_EM?(q.appendChild(e),k.appendChild(q)):(e.style.display="inline",k.appendChild(e));"DIV"!=this.root.nodeName?(p=this.createVmlElement("rect"),p.stroked="false",p.filled=
|
|
"false",p.appendChild(k),this.root.appendChild(p)):this.root.appendChild(k);l?(e.style.overflow="hidden",e.style.width=Math.round(c)+"px",mxClient.IS_QUIRKS||(e.style.maxHeight=Math.round(d)+"px")):"fill"==m?(e.style.overflow="hidden",e.style.width=Math.max(0,c)+1+"px",e.style.height=Math.max(0,d)+1+"px"):"width"==m&&(e.style.overflow="hidden",e.style.width=Math.max(0,c)+1+"px",e.style.maxHeight=Math.max(0,d)+1+"px");if(this.rotateHtml&&0!=n){t=n*(Math.PI/180);n=parseFloat(parseFloat(Math.cos(t)).toFixed(8));
|
|
p=parseFloat(parseFloat(Math.sin(-t)).toFixed(8));t%=2*Math.PI;0>t&&(t+=2*Math.PI);t%=Math.PI;t>Math.PI/2&&(t=Math.PI-t);g=Math.cos(t);var z=Math.sin(t);8==document.documentMode&&!mxClient.IS_EM&&(e.style.display="inline-block",f.style.display="inline-block",q.style.display="inline-block");e.style.visibility="hidden";e.style.position="absolute";document.body.appendChild(e);q=e;null!=q.firstChild&&"DIV"==q.firstChild.nodeName&&(q=q.firstChild);t=q.offsetWidth+3;q=q.offsetHeight;l?(c=Math.min(c,t),
|
|
q=Math.min(q,d)):c=t;h&&(e.style.width=c+"px");if(mxClient.IS_QUIRKS&&(l||"width"==m)&&q>d)q=d,e.style.height=q+"px";d=q;l=(d-d*g+c*-z)/2-p*c*(u+0.5)+n*d*(s+0.5);h=(c-c*g+d*-z)/2+n*c*(u+0.5)+p*d*(s+0.5);"group"==k.nodeName&&"DIV"==this.root.nodeName?(m=this.createElement("div"),m.style.display="inline-block",m.style.position="absolute",m.style.left=this.format(a+(h-c/2)*r.scale)+"px",m.style.top=this.format(b+(l-d/2)*r.scale)+"px",k.parentNode.appendChild(m),m.appendChild(k)):(r=8==document.documentMode&&
|
|
!mxClient.IS_EM?1:r.scale,k.style.left=this.format(a+(h-c/2)*r)+"px",k.style.top=this.format(b+(l-d/2)*r)+"px");f.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11\x3d"+n+", M12\x3d"+p+", M21\x3d"+-p+", M22\x3d"+n+", sizingMethod\x3d'auto expand')";f.style.backgroundColor=this.rotatedHtmlBackground;1>this.state.alpha&&(f.style.filter+="alpha(opacity\x3d"+100*this.state.alpha+")");f.appendChild(e);e.style.position="";e.style.visibility=""}else 8!=document.documentMode||mxClient.IS_EM?(e.style.verticalAlign=
|
|
"top",1>this.state.alpha&&(k.style.filter="alpha(opacity\x3d"+100*this.state.alpha+")"),r=e.parentNode,e.style.visibility="hidden",document.body.appendChild(e),c=e.offsetWidth,q=e.offsetHeight,mxClient.IS_QUIRKS&&(l&&q>d)&&(q=d,e.style.height=q+"px"),d=q,e.style.visibility="",r.appendChild(e),k.style.left=this.format(a+c*u*this.state.scale)+"px",k.style.top=this.format(b+d*s*this.state.scale)+"px"):(1>this.state.alpha&&(e.style.filter="alpha(opacity\x3d"+100*this.state.alpha+")"),q.style.left=100*
|
|
u+"%",q.style.top=100*s+"%")}else this.plainText(a,b,c,d,mxUtils.htmlEntities(e,!1),f,g,h,k,m,l,n,p)}};
|
|
mxVmlCanvas2D.prototype.plainText=function(a,b,c,d,e,f,g,h,k,m,l,n,p){h=this.state;a=(a+h.dx)*h.scale;b=(b+h.dy)*h.scale;c=this.createVmlElement("shape");c.style.width="1px";c.style.height="1px";c.stroked="false";d=this.createVmlElement("fill");d.color=h.fontColor;d.opacity=100*h.alpha+"%";c.appendChild(d);d=this.createVmlElement("path");d.textpathok="true";d.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0);c.appendChild(d);d=this.createVmlElement("textpath");d.style.cssText=
|
|
"v-text-align:"+f;d.style.align=f;d.style.fontFamily=h.fontFamily;d.string=e;d.on="true";f=h.fontSize*h.scale/this.vmlScale;d.style.fontSize=f+"px";(h.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(d.style.fontWeight="bold");(h.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(d.style.fontStyle="italic");(h.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(d.style.textDecoration="underline");e=e.split("\n");h=f+(e.length-1)*f*mxConstants.LINE_HEIGHT;f=e=0;
|
|
g==mxConstants.ALIGN_BOTTOM?f=-h/2:g!=mxConstants.ALIGN_MIDDLE&&(f=h/2);null!=n&&(c.style.rotation=n,g=n*(Math.PI/180),e=Math.sin(g)*f,f*=Math.cos(g));c.appendChild(d);c.style.left=this.format(a-e)+"px";c.style.top=this.format(b+f)+"px";this.root.appendChild(c)};mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)};mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)};mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)};
|
|
function mxStencil(a){this.desc=a;this.parseDescription();this.parseConstraints()}mxStencil.defaultLocalized=!1;mxStencil.allowEval=!1;mxStencil.prototype.desc=null;mxStencil.prototype.constraints=null;mxStencil.prototype.aspect=null;mxStencil.prototype.w0=null;mxStencil.prototype.h0=null;mxStencil.prototype.bgNode=null;mxStencil.prototype.fgNode=null;mxStencil.prototype.strokewidth=null;
|
|
mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0];this.bgNode=this.desc.getElementsByTagName("background")[0];this.w0=Number(this.desc.getAttribute("w")||100);this.h0=Number(this.desc.getAttribute("h")||100);var a=this.desc.getAttribute("aspect");this.aspect=null!=a?a:"variable";a=this.desc.getAttribute("strokewidth");this.strokewidth=null!=a?a:"1"};
|
|
mxStencil.prototype.parseConstraints=function(){var a=this.desc.getElementsByTagName("connections")[0];if(null!=a&&(a=mxUtils.getChildNodes(a),null!=a&&0<a.length)){this.constraints=[];for(var b=0;b<a.length;b++)this.constraints.push(this.parseConstraint(a[b]))}};mxStencil.prototype.parseConstraint=function(a){var b=Number(a.getAttribute("x")),c=Number(a.getAttribute("y"));a="1"==a.getAttribute("perimeter");return new mxConnectionConstraint(new mxPoint(b,c),a)};
|
|
mxStencil.prototype.evaluateTextAttribute=function(a,b,c){b=this.evaluateAttribute(a,b,c);a=a.getAttribute("localized");if(mxStencil.defaultLocalized&&null==a||"1"==a)b=mxResources.get(b);return b};mxStencil.prototype.evaluateAttribute=function(a,b,c){b=a.getAttribute(b);null==b&&(a=mxUtils.getTextContent(a),null!=a&&mxStencil.allowEval&&(a=mxUtils.eval(a),"function"==typeof a&&(b=a(c))));return b};
|
|
mxStencil.prototype.drawShape=function(a,b,c,d,e,f){var g=mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,null),g=this.computeAspect(b.style,c,d,e,f,g),h=Math.min(g.width,g.height),h="inherit"==this.strokewidth?Number(mxUtils.getNumber(b.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*h;a.setStrokeWidth(h);this.drawChildren(a,b,c,d,e,f,this.bgNode,g,!1);this.drawChildren(a,b,c,d,e,f,this.fgNode,g,!0)};
|
|
mxStencil.prototype.drawChildren=function(a,b,c,d,e,f,g,h,k){if(null!=g&&0<e&&0<f)for(c=g.firstChild;null!=c;)c.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,c,h,k),c=c.nextSibling};
|
|
mxStencil.prototype.computeAspect=function(a,b,c,d,e,f){a=b;b=d/this.w0;var g=e/this.h0;if(f=f==mxConstants.DIRECTION_NORTH||f==mxConstants.DIRECTION_SOUTH){g=d/this.h0;b=e/this.w0;var h=(d-e)/2;a+=h;c-=h}"fixed"==this.aspect&&(b=g=Math.min(b,g),f?(a+=(e-this.w0*b)/2,c+=(d-this.h0*g)/2):(a+=(d-this.w0*b)/2,c+=(e-this.h0*g)/2));return new mxRectangle(a,c,b,g)};
|
|
mxStencil.prototype.drawNode=function(a,b,c,d,e){var f=c.nodeName,g=d.x,h=d.y,k=d.width,m=d.height,l=Math.min(k,m);if("save"==f)a.save();else if("restore"==f)a.restore();else if("path"==f){a.begin();for(c=c.firstChild;null!=c;)c.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(a,b,c,d,e),c=c.nextSibling}else if("close"==f)a.close();else if("move"==f)a.moveTo(g+Number(c.getAttribute("x"))*k,h+Number(c.getAttribute("y"))*m);else if("line"==f)a.lineTo(g+Number(c.getAttribute("x"))*k,h+Number(c.getAttribute("y"))*
|
|
m);else if("quad"==f)a.quadTo(g+Number(c.getAttribute("x1"))*k,h+Number(c.getAttribute("y1"))*m,g+Number(c.getAttribute("x2"))*k,h+Number(c.getAttribute("y2"))*m);else if("curve"==f)a.curveTo(g+Number(c.getAttribute("x1"))*k,h+Number(c.getAttribute("y1"))*m,g+Number(c.getAttribute("x2"))*k,h+Number(c.getAttribute("y2"))*m,g+Number(c.getAttribute("x3"))*k,h+Number(c.getAttribute("y3"))*m);else if("arc"==f)a.arcTo(Number(c.getAttribute("rx"))*k,Number(c.getAttribute("ry"))*m,Number(c.getAttribute("x-axis-rotation")),
|
|
Number(c.getAttribute("large-arc-flag")),Number(c.getAttribute("sweep-flag")),g+Number(c.getAttribute("x"))*k,h+Number(c.getAttribute("y"))*m);else if("rect"==f)a.rect(g+Number(c.getAttribute("x"))*k,h+Number(c.getAttribute("y"))*m,Number(c.getAttribute("w"))*k,Number(c.getAttribute("h"))*m);else if("roundrect"==f)b=Number(c.getAttribute("arcsize")),0==b&&(b=100*mxConstants.RECTANGLE_ROUNDING_FACTOR),l=Number(c.getAttribute("w"))*k,d=Number(c.getAttribute("h"))*m,b=Number(b)/100,b=Math.min(l*b,d*
|
|
b),a.roundrect(g+Number(c.getAttribute("x"))*k,h+Number(c.getAttribute("y"))*m,l,d,b,b);else if("ellipse"==f)a.ellipse(g+Number(c.getAttribute("x"))*k,h+Number(c.getAttribute("y"))*m,Number(c.getAttribute("w"))*k,Number(c.getAttribute("h"))*m);else if("image"==f)b.outline||(b=this.evaluateAttribute(c,"src",b),a.image(g+Number(c.getAttribute("x"))*k,h+Number(c.getAttribute("y"))*m,Number(c.getAttribute("w"))*k,Number(c.getAttribute("h"))*m,b,!1,"1"==c.getAttribute("flipH"),"1"==c.getAttribute("flipV")));
|
|
else if("text"==f){if(!b.outline){l=this.evaluateTextAttribute(c,"str",b);d="1"==c.getAttribute("vertical")?-90:0;if("0"==c.getAttribute("align-shape")){var n=b.rotation,p=1==mxUtils.getValue(b.style,mxConstants.STYLE_FLIPH,0);b=1==mxUtils.getValue(b.style,mxConstants.STYLE_FLIPV,0);d=p&&b?d-n:p||b?d+n:d-n}d-=c.getAttribute("rotation");a.text(g+Number(c.getAttribute("x"))*k,h+Number(c.getAttribute("y"))*m,0,0,l,c.getAttribute("align")||"left",c.getAttribute("valign")||"top",!1,"",null,!1,d)}}else if("include-shape"==
|
|
f)n=mxStencilRegistry.getStencil(c.getAttribute("name")),null!=n&&(g+=Number(c.getAttribute("x"))*k,h+=Number(c.getAttribute("y"))*m,l=Number(c.getAttribute("w"))*k,d=Number(c.getAttribute("h"))*m,n.drawShape(a,b,g,h,l,d));else if("fillstroke"==f)a.fillAndStroke();else if("fill"==f)a.fill();else if("stroke"==f)a.stroke();else if("strokewidth"==f)k="1"==c.getAttribute("fixed")?1:l,a.setStrokeWidth(Number(c.getAttribute("width"))*k);else if("dashed"==f)a.setDashed("1"==c.getAttribute("dashed"));else if("dashpattern"==
|
|
f){if(c=c.getAttribute("pattern"),null!=c){c=c.split(" ");k=[];for(m=0;m<c.length;m++)0<c[m].length&&k.push(Number(c[m])*l);c=k.join(" ");a.setDashPattern(c)}}else"strokecolor"==f?a.setStrokeColor(c.getAttribute("color")):"linecap"==f?a.setLineCap(c.getAttribute("cap")):"linejoin"==f?a.setLineJoin(c.getAttribute("join")):"miterlimit"==f?a.setMiterLimit(Number(c.getAttribute("limit"))):"fillcolor"==f?a.setFillColor(c.getAttribute("color")):"alpha"==f?a.setAlpha(c.getAttribute("alpha")):"fontcolor"==
|
|
f?a.setFontColor(c.getAttribute("color")):"fontstyle"==f?a.setFontStyle(c.getAttribute("style")):"fontfamily"==f?a.setFontFamily(c.getAttribute("family")):"fontsize"==f&&a.setFontSize(Number(c.getAttribute("size"))*l);e&&("fillstroke"==f||"fill"==f||"stroke"==f)&&a.setShadow(!1)};function mxShape(a){this.stencil=a;this.initStyles()}mxShape.prototype.dialect=null;mxShape.prototype.scale=1;mxShape.prototype.antiAlias=!0;mxShape.prototype.bounds=null;mxShape.prototype.points=null;
|
|
mxShape.prototype.node=null;mxShape.prototype.state=null;mxShape.prototype.style=null;mxShape.prototype.boundingBox=null;mxShape.prototype.stencil=null;mxShape.prototype.svgStrokeTolerance=8;mxShape.prototype.pointerEvents=!0;mxShape.prototype.svgPointerEvents="all";mxShape.prototype.shapePointerEvents=!1;mxShape.prototype.stencilPointerEvents=!1;mxShape.prototype.vmlScale=1;mxShape.prototype.outline=!1;mxShape.prototype.visible=!0;mxShape.prototype.useSvgBoundingBox=!1;
|
|
mxShape.prototype.init=function(a){null==this.node&&(this.node=this.create(a),null!=a&&a.appendChild(this.node))};mxShape.prototype.initStyles=function(a){this.strokewidth=1;this.rotation=0;this.strokeOpacity=this.fillOpacity=this.opacity=100;this.flipV=this.flipH=!1};mxShape.prototype.isParseVml=function(){return!0};mxShape.prototype.isHtmlAllowed=function(){return!1};
|
|
mxShape.prototype.getSvgScreenOffset=function(){return 1==mxUtils.mod(Math.max(1,Math.round((this.stencil&&"inherit"!=this.stencil.strokewidth?Number(this.stencil.strokewidth):this.strokewidth)*this.scale)),2)?0.5:0};mxShape.prototype.create=function(a){var b=null;return b=null!=a&&null!=a.ownerSVGElement?this.createSvg(a):8==document.documentMode||!mxClient.IS_VML||this.dialect!=mxConstants.DIALECT_VML&&this.isHtmlAllowed()?this.createHtml(a):this.createVml(a)};
|
|
mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")};mxShape.prototype.createVml=function(){var a=document.createElement(mxClient.VML_PREFIX+":group");a.style.position="absolute";return a};mxShape.prototype.createHtml=function(){var a=document.createElement("div");a.style.position="absolute";return a};mxShape.prototype.reconfigure=function(){this.redraw()};
|
|
mxShape.prototype.redraw=function(){this.updateBoundsFromPoints();this.visible&&this.checkBounds()?(this.node.style.visibility="visible",this.clear(),"DIV"==this.node.nodeName&&(this.isHtmlAllowed()||!mxClient.IS_VML)?this.redrawHtmlShape():this.redrawShape(),this.updateBoundingBox()):(this.node.style.visibility="hidden",this.boundingBox=null)};
|
|
mxShape.prototype.clear=function(){if(null!=this.node.ownerSVGElement)for(;null!=this.node.lastChild;)this.node.removeChild(this.node.lastChild);else this.node.style.cssText="position:absolute;"+(null!=this.cursor?"cursor:"+this.cursor+";":""),this.node.innerHTML=""};
|
|
mxShape.prototype.updateBoundsFromPoints=function(){var a=this.points;if(null!=a&&0<a.length&&null!=a[0]){this.bounds=new mxRectangle(Number(a[0].x),Number(a[0].y),1,1);for(var b=1;b<this.points.length;b++)null!=a[b]&&this.bounds.add(new mxRectangle(Number(a[b].x),Number(a[b].y),1,1))}};mxShape.prototype.getLabelBounds=function(a){return a};
|
|
mxShape.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&0<this.scale&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&0<this.bounds.width&&0<this.bounds.height};mxShape.prototype.createVmlGroup=function(){var a=document.createElement(mxClient.VML_PREFIX+":group");a.style.position="absolute";a.style.width=this.node.style.width;a.style.height=this.node.style.height;return a};
|
|
mxShape.prototype.redrawShape=function(){var a=this.createCanvas();null!=a&&(a.pointerEvents=this.pointerEvents,this.paint(a),this.node!=a.root&&this.node.insertAdjacentHTML("beforeend",a.root.outerHTML),"DIV"==this.node.nodeName&&8==document.documentMode&&(this.node.style.filter="",mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(a))};
|
|
mxShape.prototype.createCanvas=function(){var a=null;null!=this.node.ownerSVGElement?a=this.createSvgCanvas():mxClient.IS_VML&&(this.updateVmlContainer(),a=this.createVmlCanvas());this.outline&&(a.setStrokeWidth(this.strokewidth),a.setStrokeColor(this.stroke),null!=this.isDashed&&a.setDashed(this.isDashed),a.setStrokeWidth=function(){},a.setStrokeColor=function(){},a.setFillColor=function(){},a.setGradient=function(){},a.setDashed=function(){});return a};
|
|
mxShape.prototype.createSvgCanvas=function(){var a=new mxSvgCanvas2D(this.node,!1);a.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0;a.pointerEventsValue=this.svgPointerEvents;a.blockImagePointerEvents=mxClient.IS_FF;var b=this.getSvgScreenOffset();0!=b?this.node.setAttribute("transform","translate("+b+","+b+")"):this.node.removeAttribute("transform");this.antiAlias||(a.format=function(a){return Math.round(parseFloat(a))});return a};
|
|
mxShape.prototype.createVmlCanvas=function(){var a=8==document.documentMode&&this.isParseVml()?this.createVmlGroup():this.node,b=new mxVmlCanvas2D(a,!1);if(""!=a.tagUrn){var c=Math.max(1,Math.round(this.bounds.width)),d=Math.max(1,Math.round(this.bounds.height));a.coordsize=c*this.vmlScale+","+d*this.vmlScale;b.scale(this.vmlScale);b.vmlScale=this.vmlScale}a=this.scale;b.translate(-Math.round(this.bounds.x/a),-Math.round(this.bounds.y/a));return b};
|
|
mxShape.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px";this.node.style.top=Math.round(this.bounds.y)+"px";var a=Math.max(1,Math.round(this.bounds.width)),b=Math.max(1,Math.round(this.bounds.height));this.node.style.width=a+"px";this.node.style.height=b+"px";this.node.style.overflow="visible"};mxShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node);this.updateHtmlFilters(this.node);this.updateHtmlColors(this.node)};
|
|
mxShape.prototype.updateHtmlFilters=function(a){var b="";100>this.opacity&&(b+="alpha(opacity\x3d"+this.opacity+")");this.isShadow&&(b+="progid:DXImageTransform.Microsoft.dropShadow (OffX\x3d'"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY\x3d'"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color\x3d'"+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\x3d'"+c+"', endColorStr\x3d'"+d+"', gradientType\x3d'"+e+"')"}a.style.filter=b};
|
|
mxShape.prototype.updateHtmlColors=function(a){var b=this.stroke;null!=b&&b!=mxConstants.NONE?(a.style.borderColor=b,this.isDashed?a.style.borderStyle="dashed":0<this.strokewidth&&(a.style.borderStyle="solid"),a.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):a.style.borderWidth="0px";b=this.outline?null:this.fill;null!=b&&b!=mxConstants.NONE?(a.style.backgroundColor=b,a.style.backgroundImage="none"):this.pointerEvents?a.style.backgroundColor="transparent":8==document.documentMode?
|
|
mxUtils.addTransparentBackgroundFilter(a):this.setTransparentBackgroundImage(a)};
|
|
mxShape.prototype.updateHtmlBounds=function(a){var b=9<=document.documentMode?0:Math.ceil(this.strokewidth*this.scale);a.style.borderWidth=Math.max(1,b)+"px";a.style.overflow="hidden";a.style.left=Math.round(this.bounds.x-b/2)+"px";a.style.top=Math.round(this.bounds.y-b/2)+"px";"CSS1Compat"==document.compatMode&&(b=-b);a.style.width=Math.round(Math.max(0,this.bounds.width+b))+"px";a.style.height=Math.round(Math.max(0,this.bounds.height+b))+"px"};
|
|
mxShape.prototype.destroyCanvas=function(a){if(a instanceof mxSvgCanvas2D){for(var b in a.gradients){var c=a.gradients[b];null!=c&&(c.mxRefCount=(c.mxRefCount||0)+1)}this.releaseSvgGradients(this.oldGradients);this.oldGradients=a.gradients}};
|
|
mxShape.prototype.paint=function(a){var b=this.scale,c=this.bounds.x/b,d=this.bounds.y/b,e=this.bounds.width/b,f=this.bounds.height/b;if(this.isPaintBoundsInverted())var g=(e-f)/2,c=c+g,d=d-g,g=e,e=f,f=g;this.updateTransform(a,c,d,e,f);this.configureCanvas(a,c,d,e,f);g=null;if(null==this.stencil&&null==this.points&&this.shapePointerEvents||null!=this.stencil&&this.stencilPointerEvents){var h=this.createBoundingBox();this.dialect==mxConstants.DIALECT_SVG?(g=this.createTransparentSvgRectangle(h.x,h.y,
|
|
h.width,h.height),this.node.appendChild(g)):(h=a.createRect("rect",h.x/b,h.y/b,h.width/b,h.height/b),h.appendChild(a.createTransparentFill()),h.stroked="false",a.root.appendChild(h))}if(null!=this.stencil)this.stencil.drawShape(a,this,c,d,e,f);else if(a.setStrokeWidth(this.strokewidth),null!=this.points){c=[];for(d=0;d<this.points.length;d++)null!=this.points[d]&&c.push(new mxPoint(this.points[d].x/b,this.points[d].y/b));this.paintEdgeShape(a,c)}else this.paintVertexShape(a,c,d,e,f);null!=g&&(null!=
|
|
a.state&&null!=a.state.transform)&&g.setAttribute("transform",a.state.transform)};
|
|
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);null!=this.isDashed&&a.setDashed(this.isDashed);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.setStrokeColor(this.stroke)};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);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){var c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;return Math.min(a*c,b*c)};
|
|
mxShape.prototype.paintGlassEffect=function(a,b,c,d,e,f){var g=Math.ceil(this.strokewidth/2);a.setGradient("#ffffff","#ffffff",b,c,d,0.6*e,"south",0.9,0.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+0.4*e),a.quadTo(b+0.5*d,c+0.7*e,b+d+g,c+0.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+0.4*e),a.quadTo(b+0.5*d,c+0.7*e,b+d+g,c+0.4*e),a.lineTo(b+d+g,c-g));a.close();a.fill()};
|
|
mxShape.prototype.addPoints=function(a,b,c,d,e){var f=b[b.length-1];if(e&&c){b=b.slice();var g=b[0],g=new mxPoint(f.x+(g.x-f.x)/2,f.y+(g.y-f.y)/2);b.splice(0,0,g)}var h=b[0],g=1;for(a.moveTo(h.x,h.y);g<(e?b.length:b.length-1);){var k=b[mxUtils.mod(g,b.length)],m=h.x-k.x,h=h.y-k.y;if(c&&(0!=m||0!=h)){var l=Math.sqrt(m*m+h*h),m=m*Math.min(d,l/2)/l,h=h*Math.min(d,l/2)/l;a.lineTo(k.x+m,k.y+h);for(h=b[mxUtils.mod(g+1,b.length)];g<b.length-2&&0==Math.round(h.x-k.x)&&0==Math.round(h.y-k.y);)h=b[mxUtils.mod(g+
|
|
2,b.length)],g++;m=h.x-k.x;h=h.y-k.y;l=Math.max(1,Math.sqrt(m*m+h*h));m=m*Math.min(d,l/2)/l;h=h*Math.min(d,l/2)/l;m=k.x+m;h=k.y+h;a.quadTo(k.x,k.y,m,h);k=new mxPoint(m,h)}else a.lineTo(k.x,k.y);h=k;g++}e?a.close():a.lineTo(f.x,f.y)};
|
|
mxShape.prototype.resetStyles=function(){this.initStyles();this.spacing=0;delete this.fill;delete this.gradient;delete this.gradientDirection;delete this.stroke;delete this.startSize;delete this.endSize;delete this.startArrow;delete this.endArrow;delete this.direction;delete this.isShadow;delete this.isDashed;delete this.isRounded;delete this.glass};
|
|
mxShape.prototype.apply=function(a){this.state=a;this.style=a.style;if(null!=this.style){this.fill=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,this.fill);this.gradient=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENTCOLOR,this.gradient);this.gradientDirection=mxUtils.getValue(this.style,mxConstants.STYLE_GRADIENT_DIRECTION,this.gradientDirection);this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_OPACITY,this.opacity);this.fillOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_FILL_OPACITY,
|
|
this.fillOpacity);this.strokeOpacity=mxUtils.getValue(this.style,mxConstants.STYLE_STROKE_OPACITY,this.strokeOpacity);this.stroke=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,this.stroke);this.strokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth);this.arrowStrokewidth=mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth);this.spacing=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing);this.startSize=mxUtils.getNumber(this.style,
|
|
mxConstants.STYLE_STARTSIZE,this.startSize);this.endSize=mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,this.endSize);this.startArrow=mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,this.startArrow);this.endArrow=mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,this.endArrow);this.rotation=mxUtils.getValue(this.style,mxConstants.STYLE_ROTATION,this.rotation);this.direction=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,this.direction);this.flipH=1==mxUtils.getValue(this.style,
|
|
mxConstants.STYLE_FLIPH,0);this.flipV=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0);null!=this.stencil&&(this.flipH=1==mxUtils.getValue(this.style,"stencilFlipH",0)||this.flipH,this.flipV=1==mxUtils.getValue(this.style,"stencilFlipV",0)||this.flipV);if(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)a=this.flipH,this.flipH=this.flipV,this.flipV=a;this.isShadow=1==mxUtils.getValue(this.style,mxConstants.STYLE_SHADOW,this.isShadow);this.isDashed=
|
|
1==mxUtils.getValue(this.style,mxConstants.STYLE_DASHED,this.isDashed);this.isRounded=1==mxUtils.getValue(this.style,mxConstants.STYLE_ROUNDED,this.isRounded);this.glass=1==mxUtils.getValue(this.style,mxConstants.STYLE_GLASS,this.glass);this.fill==mxConstants.NONE&&(this.fill=null);this.gradient==mxConstants.NONE&&(this.gradient=null);this.stroke==mxConstants.NONE&&(this.stroke=null)}};mxShape.prototype.setCursor=function(a){null==a&&(a="");this.cursor=a;null!=this.node&&(this.node.style.cursor=a)};
|
|
mxShape.prototype.getCursor=function(){return this.cursor};
|
|
mxShape.prototype.updateBoundingBox=function(){if(this.useSvgBoundingBox&&null!=this.node&&null!=this.node.ownerSVGElement)try{var a=this.node.getBBox();if(0<a.width&&0<a.height){this.boundingBox=new mxRectangle(a.x,a.y,a.width,a.height);this.boundingBox.grow(this.strokewidth*this.scale/2);return}}catch(b){}if(null!=this.bounds){a=this.createBoundingBox();if(null!=a){this.augmentBoundingBox(a);var c=this.getShapeRotation();0!=c&&(a=mxUtils.getBoundingBox(a,c))}this.boundingBox=a}};
|
|
mxShape.prototype.createBoundingBox=function(){var a=this.bounds.clone();(null!=this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted())&&a.rotate90();return a};mxShape.prototype.augmentBoundingBox=function(a){this.isShadow&&(a.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale),a.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale));a.grow(this.strokewidth*this.scale/2)};
|
|
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.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.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.oldGradients=null};
|
|
var mxStencilRegistry={stencils:{},addStencil:function(a,b){mxStencilRegistry.stencils[a]=b},getStencil:function(a){return mxStencilRegistry.stencils[a]}},mxMarker={markers:[],addMarker:function(a,b){mxMarker.markers[a]=b},createMarker:function(a,b,c,d,e,f,g,h,k,m){var l=mxMarker.markers[c];return null!=l?l(a,b,c,d,e,f,g,h,k,m):null}};
|
|
(function(){function a(a){a=null!=a?a:2;return function(b,c,g,h,k,m,l,n,p,r){c=1.118*k*p;n=1.118*m*p;k*=l+p;m*=l+p;var q=h.clone();q.x-=c;q.y-=n;l=g!=mxConstants.ARROW_CLASSIC&&g!=mxConstants.ARROW_CLASSIC_THIN?1:0.75;h.x+=-k*l-c;h.y+=-m*l-n;return function(){b.begin();b.moveTo(q.x,q.y);b.lineTo(q.x-k-m/a,q.y-m+k/a);(g==mxConstants.ARROW_CLASSIC||g==mxConstants.ARROW_CLASSIC_THIN)&&b.lineTo(q.x-3*k/4,q.y-3*m/4);b.lineTo(q.x+m/a-k,q.y-m-k/a);b.close();r?b.fillAndStroke():b.stroke()}}}function b(a){a=
|
|
null!=a?a:2;return function(b,c,g,h,k,m,l,n,p,r){c=1.118*k*p;g=1.118*m*p;k*=l+p;m*=l+p;var q=h.clone();q.x-=c;q.y-=g;h.x+=2*-c;h.y+=2*-g;return function(){b.begin();b.moveTo(q.x-k-m/a,q.y-m+k/a);b.lineTo(q.x,q.y);b.lineTo(q.x+m/a-k,q.y-m-k/a);b.stroke()}}}function c(a,b,c,g,h,k,m,l,n,p){l=c==mxConstants.ARROW_DIAMOND?0.7071:0.9862;b=h*n*l;l*=k*n;h*=m+n;k*=m+n;var r=g.clone();r.x-=b;r.y-=l;g.x+=-h-b;g.y+=-k-l;var q=c==mxConstants.ARROW_DIAMOND?2:3.4;return function(){a.begin();a.moveTo(r.x,r.y);a.lineTo(r.x-
|
|
h/2-k/q,r.y+h/q-k/2);a.lineTo(r.x-h,r.y-k);a.lineTo(r.x-h/2+k/q,r.y-k/2-h/q);a.close();p?a.fillAndStroke():a.stroke()}}mxMarker.addMarker("classic",a(2));mxMarker.addMarker("classicThin",a(3));mxMarker.addMarker("block",a(2));mxMarker.addMarker("blockThin",a(3));mxMarker.addMarker("open",b(2));mxMarker.addMarker("openThin",b(3));mxMarker.addMarker("oval",function(a,b,c,g,h,k,m,l,n,p){var r=m/2,q=g.clone();g.x-=h*r;g.y-=k*r;return function(){a.ellipse(q.x-r,q.y-r,m,m);p?a.fillAndStroke():a.stroke()}});
|
|
mxMarker.addMarker("diamond",c);mxMarker.addMarker("diamondThin",c)})();function mxActor(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxActor,mxShape);mxActor.prototype.paintVertexShape=function(a,b,c,d,e){a.translate(b,c);a.begin();this.redrawPath(a,b,c,d,e);a.fillAndStroke()};
|
|
mxActor.prototype.redrawPath=function(a,b,c,d,e){b=d/3;a.moveTo(0,e);a.curveTo(0,3*e/5,0,2*e/5,d/2,2*e/5);a.curveTo(d/2-b,2*e/5,d/2-b,0,d/2,0);a.curveTo(d/2+b,0,d/2+b,2*e/5,d/2,2*e/5);a.curveTo(d,2*e/5,d,3*e/5,d,e);a.close()};function mxCloud(a,b,c,d){mxActor.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxCloud,mxActor);
|
|
mxCloud.prototype.redrawPath=function(a,b,c,d,e){a.moveTo(0.25*d,0.25*e);a.curveTo(0.05*d,0.25*e,0,0.5*e,0.16*d,0.55*e);a.curveTo(0,0.66*e,0.18*d,0.9*e,0.31*d,0.8*e);a.curveTo(0.4*d,e,0.7*d,e,0.8*d,0.8*e);a.curveTo(d,0.8*e,d,0.6*e,0.875*d,0.5*e);a.curveTo(d,0.3*e,0.8*d,0.1*e,0.625*d,0.2*e);a.curveTo(0.5*d,0.05*e,0.3*d,0.05*e,0.25*d,0.25*e);a.close()};function mxRectangleShape(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}
|
|
mxUtils.extend(mxRectangleShape,mxShape);mxRectangleShape.prototype.isHtmlAllowed=function(){var a=!0;null!=this.style&&(a="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));return!this.isRounded&&!this.glass&&0==this.rotation&&(a||null!=this.fill&&this.fill!=mxConstants.NONE)};
|
|
mxRectangleShape.prototype.paintBackground=function(a,b,c,d,e){var f=!0;null!=this.style&&(f="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(f||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE){if(!f&&(null==this.fill||this.fill==mxConstants.NONE))a.pointerEvents=!1;this.isRounded?(f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,f=Math.min(d*f,e*f),a.roundrect(b,c,d,e,f,
|
|
f)):a.rect(b,c,d,e);a.fillAndStroke()}};mxRectangleShape.prototype.paintForeground=function(a,b,c,d,e){this.glass&&(!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE)&&this.paintGlassEffect(a,b,c,d,e,this.getArcSize(d+this.strokewidth,e+this.strokewidth))};function mxEllipse(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxEllipse,mxShape);mxEllipse.prototype.paintVertexShape=function(a,b,c,d,e){a.ellipse(b,c,d,e);a.fillAndStroke()};
|
|
function mxDoubleEllipse(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxDoubleEllipse,mxShape);mxDoubleEllipse.prototype.vmlScale=10;mxDoubleEllipse.prototype.paintBackground=function(a,b,c,d,e){a.ellipse(b,c,d,e);a.fillAndStroke()};
|
|
mxDoubleEllipse.prototype.paintForeground=function(a,b,c,d,e){if(!this.outline){var f=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(d/5,e/5)));d-=2*f;e-=2*f;0<d&&0<e&&a.ellipse(b+f,c+f,d,e);a.stroke()}};
|
|
mxDoubleEllipse.prototype.getLabelBounds=function(a){var b=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(a.width/5/this.scale,a.height/5/this.scale)))*this.scale;return new mxRectangle(a.x+b,a.y+b,a.width-2*b,a.height-2*b)};function mxRhombus(a,b,c,d){mxShape.call(this);this.bounds=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1}mxUtils.extend(mxRhombus,mxShape);
|
|
mxRhombus.prototype.paintVertexShape=function(a,b,c,d,e){var f=d/2,g=e/2,h=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;a.begin();this.addPoints(a,[new mxPoint(b+f,c),new mxPoint(b+d,c+g),new mxPoint(b+f,c+e),new mxPoint(b,c+g)],this.isRounded,h,!0);a.fillAndStroke()};function mxPolyline(a,b,c){mxShape.call(this);this.points=a;this.stroke=b;this.strokewidth=null!=c?c:1}mxUtils.extend(mxPolyline,mxShape);mxPolyline.prototype.getRotation=function(){return 0};
|
|
mxPolyline.prototype.getShapeRotation=function(){return 0};mxPolyline.prototype.isPaintBoundsInverted=function(){return!1};mxPolyline.prototype.paintEdgeShape=function(a,b){null==this.style||1!=this.style[mxConstants.STYLE_CURVED]?this.paintLine(a,b,this.isRounded):this.paintCurvedLine(a,b)};mxPolyline.prototype.paintLine=function(a,b,c){var d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;a.begin();this.addPoints(a,b,c,d,!1);a.stroke()};
|
|
mxPolyline.prototype.paintCurvedLine=function(a,b){a.begin();var c=b[0],d=b.length;a.moveTo(c.x,c.y);for(c=1;c<d-2;c++){var e=b[c],f=b[c+1];a.quadTo(e.x,e.y,(e.x+f.x)/2,(e.y+f.y)/2)}e=b[d-2];f=b[d-1];a.quadTo(e.x,e.y,f.x,f.y);a.stroke()};
|
|
function mxArrow(a,b,c,d,e,f,g){mxShape.call(this);this.points=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1;this.arrowWidth=null!=e?e:mxConstants.ARROW_WIDTH;this.spacing=null!=f?f:mxConstants.ARROW_SPACING;this.endSize=null!=g?g:mxConstants.ARROW_SIZE}mxUtils.extend(mxArrow,mxShape);mxArrow.prototype.augmentBoundingBox=function(a){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var b=Math.max(this.arrowWidth,this.endSize);a.grow((b/2+this.strokewidth)*this.scale)};
|
|
mxArrow.prototype.paintEdgeShape=function(a,b){var c=mxConstants.ARROW_SPACING,d=mxConstants.ARROW_WIDTH,e=mxConstants.ARROW_SIZE,f=b[0],g=b[b.length-1],h=g.x-f.x,k=g.y-f.y,m=Math.sqrt(h*h+k*k),l=m-2*c-e,h=h/m,k=k/m,m=d*k/3,d=-d*h/3,e=f.x-m/2+c*h,f=f.y-d/2+c*k,n=e+m,p=f+d,r=n+l*h,l=p+l*k,q=r+m,s=l+d,u=q-3*m,t=s-3*d;a.begin();a.moveTo(e,f);a.lineTo(n,p);a.lineTo(r,l);a.lineTo(q,s);a.lineTo(g.x-c*h,g.y-c*k);a.lineTo(u,t);a.lineTo(u+m,t+d);a.close();a.fillAndStroke()};
|
|
function mxArrowConnector(a,b,c,d,e,f,g){mxShape.call(this);this.points=a;this.fill=b;this.stroke=c;this.strokewidth=null!=d?d:1;this.arrowWidth=null!=e?e:mxConstants.ARROW_WIDTH;this.arrowSpacing=null!=f?f:mxConstants.ARROW_SPACING;this.startSize=mxConstants.ARROW_SIZE/5;this.endSize=mxConstants.ARROW_SIZE/5}mxUtils.extend(mxArrowConnector,mxShape);mxArrowConnector.prototype.useSvgBoundingBox=!0;
|
|
mxArrowConnector.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments);this.arrowSpacing=mxConstants.ARROW_SPACING};mxArrowConnector.prototype.apply=function(a){mxShape.prototype.apply.apply(this,arguments);null!=this.style&&(this.startSize=3*mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5),this.endSize=3*mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5))};
|
|
mxArrowConnector.prototype.augmentBoundingBox=function(a){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var b=this.getEdgeWidth();this.isMarkerStart()&&(b=Math.max(b,this.getStartArrowWidth()));this.isMarkerEnd()&&(b=Math.max(b,this.getEndArrowWidth()));a.grow((b/2+this.strokewidth)*this.scale)};
|
|
mxArrowConnector.prototype.paintEdgeShape=function(a,b){var c=this.strokewidth;this.outline&&(c=Math.max(1,mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth)));for(var d=this.getStartArrowWidth()+c,e=this.getEndArrowWidth()+c,f=this.outline?this.getEdgeWidth()+c:this.getEdgeWidth(),g=this.isOpenEnded(),h=this.isMarkerStart(),k=this.isMarkerEnd(),m=g?0:this.arrowSpacing+c/2,l=this.startSize+c,c=this.endSize+c,n=this.isArrowRounded(),p=b[b.length-1],r=1;r<b.length-1&&b[r].x==
|
|
b[0].x&&b[r].y==b[0].y;)r++;var q=b[r].x-b[0].x,r=b[r].y-b[0].y,s=Math.sqrt(q*q+r*r);if(0!=s){var u=q/s,t,z=u,y=r/s,v,K=y,s=f*y,F=-f*u,H=[];n?a.setLineJoin("round"):2<b.length&&a.setMiterLimit(1.42);a.begin();q=u;r=y;if(h&&!g)this.paintMarker(a,b[0].x,b[0].y,u,y,l,d,f,m,!0);else{t=b[0].x+s/2+m*u;v=b[0].y+F/2+m*y;var B=b[0].x-s/2+m*u,A=b[0].y-F/2+m*y;g?(a.moveTo(t,v),H.push(function(){a.lineTo(B,A)})):(a.moveTo(B,A),a.lineTo(t,v))}for(var D=v=t=0,s=0;s<b.length-2;s++)if(F=mxUtils.relativeCcw(b[s].x,
|
|
b[s].y,b[s+1].x,b[s+1].y,b[s+2].x,b[s+2].y),t=b[s+2].x-b[s+1].x,v=b[s+2].y-b[s+1].y,D=Math.sqrt(t*t+v*v),0!=D&&(z=t/D,K=v/D,tmp=Math.max(Math.sqrt((u*z+y*K+1)/2),0.04),t=u+z,v=y+K,D=Math.sqrt(t*t+v*v),0!=D)){t/=D;v/=D;var D=Math.max(tmp,Math.min(this.strokewidth/200+0.04,0.35)),D=0!=F&&n?Math.max(0.1,D):Math.max(tmp,0.06),J=b[s+1].x+v*f/2/D,P=b[s+1].y-t*f/2/D;v=b[s+1].x-v*f/2/D;t=b[s+1].y+t*f/2/D;0==F||!n?(a.lineTo(J,P),function(b,c){H.push(function(){a.lineTo(b,c)})}(v,t)):-1==F?(F=v+K*f,D=t-z*f,
|
|
a.lineTo(v+y*f,t-u*f),a.quadTo(J,P,F,D),function(b,c){H.push(function(){a.lineTo(b,c)})}(v,t)):(a.lineTo(J,P),function(b,c){var d=J-y*f,e=P+u*f,g=J-K*f,h=P+z*f;H.push(function(){a.quadTo(b,c,d,e)});H.push(function(){a.lineTo(g,h)})}(v,t));u=z;y=K}s=f*K;F=-f*z;if(k&&!g)this.paintMarker(a,p.x,p.y,-u,-y,c,e,f,m,!1);else{a.lineTo(p.x-m*z+s/2,p.y-m*K+F/2);var O=p.x-m*z-s/2,T=p.y-m*K-F/2;g?(a.moveTo(O,T),H.splice(0,0,function(){a.moveTo(O,T)})):a.lineTo(O,T)}for(s=H.length-1;0<=s;s--)H[s]();g?(a.end(),
|
|
a.stroke()):(a.close(),a.fillAndStroke());a.setShadow(!1);a.setMiterLimit(4);n&&a.setLineJoin("flat");2<b.length&&(a.setMiterLimit(4),h&&!g&&(a.begin(),this.paintMarker(a,b[0].x,b[0].y,q,r,l,d,f,m,!0),a.stroke(),a.end()),k&&!g&&(a.begin(),this.paintMarker(a,p.x,p.y,-u,-y,c,e,f,m,!0),a.stroke(),a.end()))}};
|
|
mxArrowConnector.prototype.paintMarker=function(a,b,c,d,e,f,g,h,k,m){g=h/g;var l=h*e/2;h=-h*d/2;var n=(k+f)*d;f=(k+f)*e;m?a.moveTo(b-l+n,c-h+f):a.lineTo(b-l+n,c-h+f);a.lineTo(b-l/g+n,c-h/g+f);a.lineTo(b+k*d,c+k*e);a.lineTo(b+l/g+n,c+h/g+f);a.lineTo(b+l+n,c+h+f)};mxArrowConnector.prototype.isArrowRounded=function(){return this.isRounded};mxArrowConnector.prototype.getStartArrowWidth=function(){return mxConstants.ARROW_WIDTH};mxArrowConnector.prototype.getEndArrowWidth=function(){return mxConstants.ARROW_WIDTH};
|
|
mxArrowConnector.prototype.getEdgeWidth=function(){return mxConstants.ARROW_WIDTH/3};mxArrowConnector.prototype.isOpenEnded=function(){return!1};mxArrowConnector.prototype.isMarkerStart=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE};mxArrowConnector.prototype.isMarkerEnd=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE};
|
|
function mxText(a,b,c,d,e,f,g,h,k,m,l,n,p,r,q,s,u,t,z,y,v){mxShape.call(this);this.value=a;this.bounds=b;this.color=null!=e?e:"black";this.align=null!=c?c:"";this.valign=null!=d?d:"";this.family=null!=f?f:mxConstants.DEFAULT_FONTFAMILY;this.size=null!=g?g:mxConstants.DEFAULT_FONTSIZE;this.fontStyle=null!=h?h:mxConstants.DEFAULT_FONTSTYLE;this.spacing=parseInt(k||2);this.spacingTop=this.spacing+parseInt(m||0);this.spacingRight=this.spacing+parseInt(l||0);this.spacingBottom=this.spacing+parseInt(n||
|
|
0);this.spacingLeft=this.spacing+parseInt(p||0);this.horizontal=null!=r?r:!0;this.background=q;this.border=s;this.wrap=null!=u?u:!1;this.clipped=null!=t?t:!1;this.overflow=null!=z?z:"visible";this.labelPadding=null!=y?y:0;this.textDirection=v;this.rotation=0;this.updateMargin()}mxUtils.extend(mxText,mxShape);mxText.prototype.baseSpacingTop=0;mxText.prototype.baseSpacingBottom=0;mxText.prototype.baseSpacingLeft=0;mxText.prototype.baseSpacingRight=0;mxText.prototype.replaceLinefeeds=!0;
|
|
mxText.prototype.verticalTextRotation=-90;mxText.prototype.ignoreClippedStringSize=!0;mxText.prototype.ignoreStringSize=!1;mxText.prototype.textWidthPadding=8==document.documentMode&&!mxClient.IS_EM?4:3;mxText.prototype.lastValue=null;mxText.prototype.cacheEnabled=!0;mxText.prototype.isParseVml=function(){return!1};mxText.prototype.isHtmlAllowed=function(){return 8!=document.documentMode||mxClient.IS_EM};mxText.prototype.getSvgScreenOffset=function(){return 0};
|
|
mxText.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&0<this.scale&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)};
|
|
mxText.prototype.paint=function(a,b){var c=this.scale,d=this.bounds.x/c,e=this.bounds.y/c,f=this.bounds.width/c,c=this.bounds.height/c;this.updateTransform(a,d,e,f,c);this.configureCanvas(a,d,e,f,c);if(b){var g=null!=this.state?this.state.unscaledWidth:null;null!=this.node.firstChild&&this.lastUnscaledWidth!=g&&a.invalidateCachedOffsetSize(this.node);a.updateText(d,e,f,c,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),this.node)}else{var h=(g=mxUtils.isNode(this.value)||
|
|
this.dialect==mxConstants.DIALECT_STRICTHTML)||a instanceof mxVmlCanvas2D?"html":"",k=this.value;!g&&"html"==h&&(k=mxUtils.htmlEntities(k,!1));"html"==h&&!mxUtils.isNode(this.value)&&(k=mxUtils.replaceTrailingNewlines(k,"\x3cdiv\x3e\x3cbr\x3e\x3c/div\x3e"));var k=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==h?k.replace(/\n/g,"\x3cbr/\x3e"):k,m=this.textDirection;m==mxConstants.TEXT_DIRECTION_AUTO&&!g&&(m=this.getAutoDirection());m!=mxConstants.TEXT_DIRECTION_LTR&&m!=mxConstants.TEXT_DIRECTION_RTL&&
|
|
(m=null);a.text(d,e,f,c,k,this.align,this.valign,this.wrap,h,this.overflow,this.clipped,this.getTextRotation(),m)}this.lastUnscaledWidth=null!=this.state?this.state.unscaledWidth:null};
|
|
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&&(this.isHtmlAllowed()||!mxClient.IS_VML))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(),this.updateBoundingBox();else{var a=this.createCanvas();
|
|
null!=a&&null!=a.updateText&&null!=a.invalidateCachedOffsetSize?(this.paint(a,!0),this.destroyCanvas(a),this.updateBoundingBox()):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.valign=this.align="";this.family=mxConstants.DEFAULT_FONTFAMILY;this.size=mxConstants.DEFAULT_FONTSIZE;this.fontStyle=mxConstants.DEFAULT_FONTSTYLE;this.spacing=2;this.spacingLeft=this.spacingBottom=this.spacingRight=this.spacingTop=0;this.horizontal=!0;delete this.background;delete this.border;this.textDirection=mxConstants.DEFAULT_TEXT_DIRECTION;delete this.margin};
|
|
mxText.prototype.apply=function(a){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=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing),this.spacingTop=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,this.spacingTop)+this.spacing,this.spacingRight=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,this.spacingRight)+this.spacing,this.spacingBottom=mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,this.spacingBottom)+this.spacing,this.spacingLeft=mxUtils.getValue(this.style,
|
|
mxConstants.STYLE_SPACING_LEFT,this.spacingLeft)+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.updateMargin());this.flipH=this.flipV=
|
|
null};mxText.prototype.getAutoDirection=function(){var a=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(this.value);return null!=a&&0<a.length&&"z"<a[0]?mxConstants.TEXT_DIRECTION_RTL:mxConstants.TEXT_DIRECTION_LTR};
|
|
mxText.prototype.updateBoundingBox=function(){var a=this.node;this.boundingBox=this.bounds.clone();var b=this.getTextRotation(),c=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER):null,d=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE):null;if(!this.ignoreStringSize&&null!=a&&"fill"!=this.overflow&&(!this.clipped||!this.ignoreClippedStringSize||c!=mxConstants.ALIGN_CENTER||d!=mxConstants.ALIGN_MIDDLE)){d=
|
|
c=null;if(null!=a.ownerSVGElement)if(null!=a.firstChild&&null!=a.firstChild.firstChild&&"foreignObject"==a.firstChild.firstChild.nodeName)a=a.firstChild.firstChild,c=parseInt(a.getAttribute("width"))*this.scale,d=parseInt(a.getAttribute("height"))*this.scale;else try{var e=a.getBBox();if("string"==typeof this.value&&0==mxUtils.trim(this.value)){this.boundingBox=null;return}if(0==e.width&&0==e.height){this.boundingBox=null;return}this.boundingBox=new mxRectangle(e.x,e.y,e.width,e.height);b=0}catch(f){}else c=
|
|
null!=this.state?this.state.view.textDiv:null,null!=this.offsetWidth&&null!=this.offsetHeight||(null!=c&&(this.updateFont(c),this.updateSize(c,!1),this.updateInnerHtml(c),a=c),e=a,8==document.documentMode&&!mxClient.IS_EM?(d=Math.round(this.bounds.width/this.scale),this.wrap&&0<d?(a.style.wordWrap=mxConstants.WORD_WRAP,a.style.whiteSpace="normal","break-word"!=a.style.wordWrap&&(a=e.getElementsByTagName("div"),0<a.length&&(e=a[a.length-1]),c=e.offsetWidth+2,a=this.node.getElementsByTagName("div"),
|
|
this.clipped&&(c=Math.min(d,c)),1<a.length&&(a[a.length-2].style.width=c+"px"))):a.style.whiteSpace="nowrap"):null!=e.firstChild&&"DIV"==e.firstChild.nodeName&&(e=e.firstChild),this.offsetWidth=e.offsetWidth+this.textWidthPadding,this.offsetHeight=e.offsetHeight),c=this.offsetWidth*this.scale,d=this.offsetHeight*this.scale;null!=c&&null!=d&&(this.boundingBox=new mxRectangle(this.bounds.x+this.margin.x*c,this.bounds.y+this.margin.y*d,c,d))}else this.boundingBox.x+=this.margin.x*this.boundingBox.width,
|
|
this.boundingBox.y+=this.margin.y*this.boundingBox.height;null!=this.boundingBox&&(0!=b?(this.unrotatedBoundingBox=mxRectangle.fromRectangle(this.boundingBox),b=mxUtils.getBoundingBox(this.boundingBox,b),this.boundingBox.x=b.x,this.boundingBox.y=b.y,mxClient.IS_QUIRKS||(this.boundingBox.width=b.width,this.boundingBox.height=b.height)):this.unrotatedBoundingBox=null)};mxText.prototype.getShapeRotation=function(){return 0};
|
|
mxText.prototype.getTextRotation=function(){return null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0};mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)};
|
|
mxText.prototype.configureCanvas=function(a,b,c,d,e){mxShape.prototype.configureCanvas.apply(this,arguments);a.setFontColor(this.color);a.setFontBackgroundColor(this.background);a.setFontBorderColor(this.border);a.setFontFamily(this.family);a.setFontSize(this.size);a.setFontStyle(this.fontStyle)};
|
|
mxText.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px";this.node.style.top=Math.round(this.bounds.y)+"px";this.node.style.width="1px";this.node.style.height="1px";this.node.style.overflow="visible"};
|
|
mxText.prototype.redrawHtmlShape=function(){var a=this.node.style;a.whiteSpace="normal";a.overflow="";a.width="";a.height="";this.updateValue();this.updateFont(this.node);this.updateSize(this.node,null==this.state||null==this.state.view.textDiv);this.offsetHeight=this.offsetWidth=null;mxClient.IS_IE&&(null==document.documentMode||8>=document.documentMode)?this.updateHtmlFilter():this.updateHtmlTransform()};
|
|
mxText.prototype.updateHtmlTransform=function(){var a=this.getTextRotation(),b=this.node.style,c=this.margin.x,d=this.margin.y;0!=a?(mxUtils.setPrefixedStyle(b,"transformOrigin",100*-c+"% "+100*-d+"%"),mxUtils.setPrefixedStyle(b,"transform","translate("+100*c+"%,"+100*d+"%)scale("+this.scale+") rotate("+a+"deg)")):(mxUtils.setPrefixedStyle(b,"transformOrigin","0% 0%"),mxUtils.setPrefixedStyle(b,"transform","scale("+this.scale+")translate("+100*c+"%,"+100*d+"%)"));b.left=Math.round(this.bounds.x-Math.ceil(c*
|
|
("fill"!=this.overflow&&"width"!=this.overflow?3:1)))+"px";b.top=Math.round(this.bounds.y-d*("fill"!=this.overflow?3:1))+"px";b.opacity=100>this.opacity?this.opacity/100:""};
|
|
mxText.prototype.updateInnerHtml=function(a){if(mxUtils.isNode(this.value))a.innerHTML=this.value.outerHTML;else{var b=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(b=mxUtils.htmlEntities(b,!1));b=mxUtils.replaceTrailingNewlines(b,"\x3cdiv\x3e\x26nbsp;\x3c/div\x3e");b=this.replaceLinefeeds?b.replace(/\n/g,"\x3cbr/\x3e"):b;a.innerHTML='\x3cdiv style\x3d"display:inline-block;_display:inline;"\x3e'+b+"\x3c/div\x3e"}};
|
|
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=0,g=null!=this.state?this.state.view.textDiv:null,h=this.node;if(null!=g){g.style.overflow="";g.style.height="";g.style.width="";this.updateFont(g);this.updateSize(g,!1);this.updateInnerHtml(g);var k=Math.round(this.bounds.width/this.scale);this.wrap&&0<k?(g.style.whiteSpace="normal",g.style.wordWrap=mxConstants.WORD_WRAP,e=k,this.clipped&&
|
|
(e=Math.min(e,this.bounds.width)),g.style.width=e+"px"):g.style.whiteSpace="nowrap";h=g;null!=h.firstChild&&"DIV"==h.firstChild.nodeName&&(h=h.firstChild,this.wrap&&"break-word"==g.style.wordWrap&&(h.style.width="100%"));!this.clipped&&(this.wrap&&0<k)&&(e=h.offsetWidth+this.textWidthPadding,g.style.width=e+"px");f=h.offsetHeight+2;mxClient.IS_QUIRKS&&(null!=this.border&&this.border!=mxConstants.NONE)&&(f+=3)}else null!=h.firstChild&&"DIV"==h.firstChild.nodeName&&(h=h.firstChild,f=h.offsetHeight);
|
|
e=h.offsetWidth+this.textWidthPadding;this.clipped&&(f=Math.min(f,this.bounds.height));k=this.bounds.width/d;g=this.bounds.height/d;"fill"==this.overflow?(f=g,e=k):"width"==this.overflow&&(f=h.scrollHeight,e=k);this.offsetWidth=e;this.offsetHeight=f;mxClient.IS_QUIRKS&&(this.clipped||"width"==this.overflow&&0<g)?(g=Math.min(g,f),a.height=Math.round(g)+"px"):g=f;if("fill"!=this.overflow&&"width"!=this.overflow&&(this.clipped&&(e=Math.min(k,e)),k=e,mxClient.IS_QUIRKS&&this.clipped||this.wrap))a.width=
|
|
Math.round(k)+"px";var g=g*d,k=k*d,m=this.getTextRotation()*(Math.PI/180),e=parseFloat(parseFloat(Math.cos(m)).toFixed(8)),f=parseFloat(parseFloat(Math.sin(-m)).toFixed(8)),m=m%(2*Math.PI);0>m&&(m+=2*Math.PI);m%=Math.PI;m>Math.PI/2&&(m=Math.PI-m);var h=Math.cos(m),l=Math.sin(-m),b=k*-(b+0.5),n=g*-(c+0.5),p=(g-g*h+k*l)/2+f*b-e*n;0!=m&&(c="progid:DXImageTransform.Microsoft.Matrix(M11\x3d"+e+", M12\x3d"+f+", M21\x3d"+-f+", M22\x3d"+e+", sizingMethod\x3d'auto expand')",a.filter=null!=a.filter&&0<a.filter.length?
|
|
a.filter+(" "+c):c);c=0;"fill"!=this.overflow&&mxClient.IS_QUIRKS&&(c=this.valign==mxConstants.ALIGN_TOP?c-1:this.valign==mxConstants.ALIGN_BOTTOM?c+2:c+1);a.zoom=d;a.left=Math.round(this.bounds.x+((k-k*h+g*l)/2-e*b-f*n)-k/2)+"px";a.top=Math.round(this.bounds.y+p-g/2+c)+"px"};
|
|
mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var a=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(a=mxUtils.htmlEntities(a,!1));var a=mxUtils.replaceTrailingNewlines(a,"\x3cdiv\x3e\x3cbr\x3e\x3c/div\x3e"),a=this.replaceLinefeeds?a.replace(/\n/g,"\x3cbr/\x3e"):a,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:"+b+";");null!=c&&(d+="border:1px solid "+c+";");a='\x3cdiv style\x3d"zoom:1;'+d+"display:inline-block;_display:inline;text-decoration:inherit;padding-bottom:1px;padding-right:1px;line-height:"+(mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT)+'"\x3e'+a+"\x3c/div\x3e"}this.node.innerHTML=
|
|
a;a=this.node.getElementsByTagName("div");0<a.length&&(b=this.textDirection,b==mxConstants.TEXT_DIRECTION_AUTO&&this.dialect!=mxConstants.DIALECT_STRICTHTML&&(b=this.getAutoDirection()),b==mxConstants.TEXT_DIRECTION_LTR||b==mxConstants.TEXT_DIRECTION_RTL?a[a.length-1].setAttribute("dir",b):a[a.length-1].removeAttribute("dir"))}};
|
|
mxText.prototype.updateFont=function(a){a=a.style;a.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;a.fontSize=this.size+"px";a.fontFamily=this.family;a.verticalAlign="top";a.color=this.color;a.fontWeight=(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?"bold":"";a.fontStyle=(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?"italic":"";a.textDecoration=(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE?
|
|
"underline":"";a.textAlign=this.align==mxConstants.ALIGN_CENTER?"center":this.align==mxConstants.ALIGN_RIGHT?"right":"left"};
|
|
mxText.prototype.updateSize=function(a,b){var c=Math.max(0,Math.round(this.bounds.width/this.scale)),d=Math.max(0,Math.round(this.bounds.height/this.scale)),e=a.style;this.clipped?(e.overflow="hidden",mxClient.IS_QUIRKS?e.width=c+"px":(e.maxHeight=d+"px",e.maxWidth=c+"px")):"fill"==this.overflow?(e.width=c+1+"px",e.height=d+1+"px",e.overflow="hidden"):"width"==this.overflow&&(e.width=c+1+"px",e.maxHeight=d+1+"px",e.overflow="hidden");if(this.wrap&&0<c){if(e.wordWrap=mxConstants.WORD_WRAP,e.whiteSpace=
|
|
"normal",e.width=c+"px",b&&"fill"!=this.overflow&&"width"!=this.overflow){d=a;null!=d.firstChild&&"DIV"==d.firstChild.nodeName&&(d=d.firstChild,"break-word"==a.style.wordWrap&&(d.style.width="100%"));var f=d.offsetWidth;if(0==f){var g=a.parentNode;a.style.visibility="hidden";document.body.appendChild(a);f=d.offsetWidth;a.style.visibility="";g.appendChild(a)}f+=3;this.clipped&&(f=Math.min(f,c));e.width=f+"px"}}else e.whiteSpace="nowrap"};
|
|
mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)};
|
|
mxText.prototype.getSpacing=function(){var a=0,b=0,a=this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-this.baseSpacingRight:this.spacingLeft+this.baseSpacingLeft,b=this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-this.baseSpacingBottom:this.spacingTop+this.baseSpacingTop;return new mxPoint(a,b)};
|
|
function mxTriangle(){mxActor.call(this)}mxUtils.extend(mxTriangle,mxActor);mxTriangle.prototype.redrawPath=function(a,b,c,d,e){b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d,0.5*e),new mxPoint(0,e)],this.isRounded,b,!0)};function mxHexagon(){mxActor.call(this)}mxUtils.extend(mxHexagon,mxActor);
|
|
mxHexagon.prototype.redrawPath=function(a,b,c,d,e){b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0.25*d,0),new mxPoint(0.75*d,0),new mxPoint(d,0.5*e),new mxPoint(0.75*d,e),new mxPoint(0.25*d,e),new mxPoint(0,0.5*e)],this.isRounded,b,!0)};function mxLine(a,b,c){mxShape.call(this);this.bounds=a;this.stroke=b;this.strokewidth=null!=c?c:1}mxUtils.extend(mxLine,mxShape);
|
|
mxLine.prototype.paintVertexShape=function(a,b,c,d,e){c+=e/2;a.begin();a.moveTo(b,c);a.lineTo(b+d,c);a.stroke()};function mxImageShape(a,b,c,d,e){mxShape.call(this);this.bounds=a;this.image=b;this.fill=c;this.stroke=d;this.strokewidth=null!=e?e:1;this.shadow=!1}mxUtils.extend(mxImageShape,mxRectangleShape);mxImageShape.prototype.preserveImageAspect=!0;mxImageShape.prototype.getSvgScreenOffset=function(){return 0};
|
|
mxImageShape.prototype.apply=function(a){mxShape.prototype.apply.apply(this,arguments);this.gradient=this.stroke=this.fill=null;null!=this.style&&(this.preserveImageAspect=1==mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1),this.flipH=this.flipH||1==mxUtils.getValue(this.style,"imageFlipH",0),this.flipV=this.flipV||1==mxUtils.getValue(this.style,"imageFlipV",0))};mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect};
|
|
mxImageShape.prototype.createHtml=function(){var a=document.createElement("div");a.style.position="absolute";return a};
|
|
mxImageShape.prototype.paintVertexShape=function(a,b,c,d,e){if(null!=this.image){var f=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),g=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);null!=f&&(a.setFillColor(f),a.setStrokeColor(g),a.rect(b,c,d,e),a.fillAndStroke());a.image(b,c,d,e,this.image,this.preserveImageAspect,!1,!1);g=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);null!=g&&(a.setShadow(!1),a.setStrokeColor(g),a.rect(b,c,d,e),a.stroke())}else mxRectangleShape.prototype.paintBackground.apply(this,
|
|
arguments)};
|
|
mxImageShape.prototype.redrawHtmlShape=function(){this.node.style.left=Math.round(this.bounds.x)+"px";this.node.style.top=Math.round(this.bounds.y)+"px";this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px";this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px";this.node.innerHTML="";if(null!=this.image){var a=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,""),b=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,"");this.node.style.backgroundColor=a;
|
|
this.node.style.borderColor=b;a=document.createElement(mxClient.IS_IE6||(null==document.documentMode||8>=document.documentMode)&&0!=this.rotation?mxClient.VML_PREFIX+":image":"img");a.setAttribute("border","0");a.style.position="absolute";a.src=this.image;b=100>this.opacity?"alpha(opacity\x3d"+this.opacity+")":"";this.node.style.filter=b;this.flipH&&this.flipV?b+="progid:DXImageTransform.Microsoft.BasicImage(rotation\x3d2)":this.flipH?b+="progid:DXImageTransform.Microsoft.BasicImage(mirror\x3d1)":
|
|
this.flipV&&(b+="progid:DXImageTransform.Microsoft.BasicImage(rotation\x3d2, mirror\x3d1)");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);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),a.image(b.x,b.y,b.width,b.height,this.image,!1,!1,!1))};
|
|
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),h=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),k=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-k):a+k;b=f==mxConstants.ALIGN_TOP?b+k:f==mxConstants.ALIGN_BOTTOM?b+(d-h-k):b+(d-h)/2;return new mxRectangle(a,b,g,h)};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),h=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),k=this.spacing+5;a=e==mxConstants.ALIGN_RIGHT?a+(c-g-k):e==mxConstants.ALIGN_CENTER?a+(c-g)/
|
|
2:a+k;b=f==mxConstants.ALIGN_BOTTOM?b+(d-h-k):f==mxConstants.ALIGN_TOP?b+k:b+(d-h)/2;return new mxRectangle(a,b,g,h)};
|
|
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.svgStrokeTolerance=0;
|
|
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();a.setShadow(!1);a.begin();this.redrawPath(a,b,c,d,e,!0);a.stroke()};
|
|
mxCylinder.prototype.redrawPath=function(a,b,c,d,e,f){b=Math.min(this.maxHeight,Math.round(e/5));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.setFillColor(this.stroke);a.setShadow(!1);a.setDashed(!1);null!=c&&c();null!=d&&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],h=c?b[0]:b[e-1];if(null!=f&&null!=g&&null!=h){for(d=1;d<e-1&&0==Math.round(g.x-h.x)&&0==Math.round(g.y-h.y);)g=c?b[1+d]:b[e-2-d],d++;b=h.x-g.x;e=h.y-g.y;d=Math.max(1,Math.sqrt(b*b+e*e));g=b/d;b=e/d;e=mxUtils.getNumber(this.style,c?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE);d=mxMarker.createMarker(a,
|
|
this,f,h,g,b,e,c,this.arrowStrokewidth,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.getTitleSize=function(){return Math.max(0,mxUtils.getValue(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE))};
|
|
mxSwimlane.prototype.getLabelBounds=function(a){var b=this.getTitleSize();a=new mxRectangle(a.x,a.y,a.width,a.height);var c=this.isHorizontal(),d=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),e=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0),f=this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH,c=c==!f,d=!c&&d!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST),e=c&&e!=(this.direction==mxConstants.DIRECTION_SOUTH||
|
|
this.direction==mxConstants.DIRECTION_WEST);if(f){b=Math.min(a.width,b*this.scale);if(d||e)a.x+=a.width-b;a.width=b}else{b=Math.min(a.height,b*this.scale);if(d||e)a.y+=a.height-b;a.height=b}return a};mxSwimlane.prototype.getGradientBounds=function(a,b,c,d,e){a=this.getTitleSize();if(this.isHorizontal())return a=Math.min(a,e),new mxRectangle(b,c,d,a);a=Math.min(a,d);return new mxRectangle(b,c,a,e)};
|
|
mxSwimlane.prototype.getArcSize=function(a,b,c){a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;return 3*c*a};mxSwimlane.prototype.isHorizontal=function(){return 1==mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)};
|
|
mxSwimlane.prototype.paintVertexShape=function(a,b,c,d,e){var f=this.getTitleSize(),g=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE),h=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),k=0,f=this.isHorizontal()?Math.min(f,e):Math.min(f,d);a.translate(b,c);this.isRounded?(k=this.getArcSize(d,e,f),this.paintRoundedSwimlane(a,b,c,d,e,f,k,g,h)):this.paintSwimlane(a,b,c,d,e,f,g,h);g=mxUtils.getValue(this.style,mxConstants.STYLE_SEPARATORCOLOR,mxConstants.NONE);
|
|
this.paintSeparator(a,b,c,d,e,f,g);null!=this.image&&(e=this.getImageBounds(b,c,d,e),a.image(e.x-b,e.y-c,e.width,e.height,this.image,!1,!1,!1));this.glass&&(a.setShadow(!1),this.paintGlassEffect(a,0,0,d,f,k))};
|
|
mxSwimlane.prototype.paintSwimlane=function(a,b,c,d,e,f,g,h){g!=mxConstants.NONE&&(a.save(),a.setFillColor(g),a.rect(0,0,d,e),a.fillAndStroke(),a.restore(),a.setShadow(!1));a.begin();this.isHorizontal()?(a.moveTo(0,f),a.lineTo(0,0),a.lineTo(d,0),a.lineTo(d,f),(h||f>=e)&&a.close(),a.fillAndStroke(),f<e&&g==mxConstants.NONE&&(a.pointerEvents=!1,a.begin(),a.moveTo(0,f),a.lineTo(0,e),a.lineTo(d,e),a.lineTo(d,f),a.stroke())):(a.moveTo(f,0),a.lineTo(0,0),a.lineTo(0,e),a.lineTo(f,e),(h||f>=d)&&a.close(),
|
|
a.fillAndStroke(),f<d&&g==mxConstants.NONE&&(a.pointerEvents=!1,a.begin(),a.moveTo(f,0),a.lineTo(d,0),a.lineTo(d,e),a.lineTo(f,e),a.stroke()))};
|
|
mxSwimlane.prototype.paintRoundedSwimlane=function(a,b,c,d,e,f,g,h,k){h!=mxConstants.NONE&&(a.save(),a.setFillColor(h),a.roundrect(0,0,d,e,g,g),a.fillAndStroke(),a.restore(),a.setShadow(!1));a.begin();this.isHorizontal()?(a.moveTo(d,f),a.lineTo(d,g),a.quadTo(d,0,d-Math.min(d/2,g),0),a.lineTo(Math.min(d/2,g),0),a.quadTo(0,0,0,g),a.lineTo(0,f),(k||f>=e)&&a.close(),a.fillAndStroke(),f<e&&h==mxConstants.NONE&&(a.pointerEvents=!1,a.begin(),a.moveTo(0,f),a.lineTo(0,e-g),a.quadTo(0,e,Math.min(d/2,g),e),
|
|
a.lineTo(d-Math.min(d/2,g),e),a.quadTo(d,e,d,e-g),a.lineTo(d,f),a.stroke())):(a.moveTo(f,0),a.lineTo(g,0),a.quadTo(0,0,0,Math.min(e/2,g)),a.lineTo(0,e-Math.min(e/2,g)),a.quadTo(0,e,g,e),a.lineTo(f,e),(k||f>=d)&&a.close(),a.fillAndStroke(),f<d&&h==mxConstants.NONE&&(a.pointerEvents=!1,a.begin(),a.moveTo(f,e),a.lineTo(d-g,e),a.quadTo(d,e,d,e-Math.min(e/2,g)),a.lineTo(d,Math.min(e/2,g)),a.quadTo(d,0,d-g,0),a.lineTo(f,0),a.stroke()))};
|
|
mxSwimlane.prototype.paintSeparator=function(a,b,c,d,e,f,g){g!=mxConstants.NONE&&(a.setStrokeColor(g),a.setDashed(!0),a.begin(),this.isHorizontal()?(a.moveTo(d,f),a.lineTo(d,e)):(a.moveTo(f,0),a.lineTo(d,0)),a.stroke(),a.setDashed(!1))};mxSwimlane.prototype.getImageBounds=function(a,b,c,d){return this.isHorizontal()?new mxRectangle(a+c-this.imageSize,b,this.imageSize,this.imageSize):new mxRectangle(a,b,this.imageSize,this.imageSize)};function mxGraphLayout(a){this.graph=a}
|
|
mxGraphLayout.prototype.graph=null;mxGraphLayout.prototype.useBoundingBox=!0;mxGraphLayout.prototype.parent=null;mxGraphLayout.prototype.moveCell=function(a,b,c){};mxGraphLayout.prototype.execute=function(a){};mxGraphLayout.prototype.getGraph=function(){return this.graph};mxGraphLayout.prototype.getConstraint=function(a,b,c,d){c=this.graph.view.getState(b);b=null!=c?c.style:this.graph.getCellStyle(b);return null!=b?b[a]:null};
|
|
mxGraphLayout.traverse=function(a,b,c,d,e){if(null!=c&&null!=a&&(b=null!=b?b:!0,e=e||new mxDictionary,!e.get(a)&&(e.put(a,!0),d=c(a,d),null==d||d)))if(d=this.graph.model.getEdgeCount(a),0<d)for(var f=0;f<d;f++){var g=this.graph.model.getEdgeAt(a,f),h=this.graph.model.getTerminal(g,!0)==a;if(!b||h)h=this.graph.view.getVisibleTerminal(g,!h),this.traverse(h,b,c,g,e)}};mxGraphLayout.prototype.isVertexMovable=function(a){return this.graph.isCellMovable(a)};
|
|
mxGraphLayout.prototype.isVertexIgnored=function(a){return!this.graph.getModel().isVertex(a)||!this.graph.isCellVisible(a)};mxGraphLayout.prototype.isEdgeIgnored=function(a){var b=this.graph.getModel();return!b.isEdge(a)||!this.graph.isCellVisible(a)||null==b.getTerminal(a,!0)||null==b.getTerminal(a,!1)};mxGraphLayout.prototype.setEdgeStyleEnabled=function(a,b){this.graph.setCellStyles(mxConstants.STYLE_NOEDGESTYLE,b?"0":"1",[a])};
|
|
mxGraphLayout.prototype.setOrthogonalEdge=function(a,b){this.graph.setCellStyles(mxConstants.STYLE_ORTHOGONAL,b?"1":"0",[a])};mxGraphLayout.prototype.getParentOffset=function(a){var b=new mxPoint;if(null!=a&&a!=this.parent){var c=this.graph.getModel();if(c.isAncestor(this.parent,a))for(var d=c.getGeometry(a);a!=this.parent;)b.x+=d.x,b.y+=d.y,a=c.getParent(a),d=c.getGeometry(a)}return b};
|
|
mxGraphLayout.prototype.setEdgePoints=function(a,b){if(null!=a){var c=this.graph.model,d=c.getGeometry(a);null==d?(d=new mxGeometry,d.setRelative(!0)):d=d.clone();if(null!=this.parent&&null!=b)for(var e=c.getParent(a),e=this.getParentOffset(e),f=0;f<b.length;f++)b[f].x-=e.x,b[f].y-=e.y;d.points=b;c.setGeometry(a,d)}};
|
|
mxGraphLayout.prototype.setVertexLocation=function(a,b,c){var d=this.graph.getModel(),e=d.getGeometry(a),f=null;if(null!=e){f=new mxRectangle(b,c,e.width,e.height);if(this.useBoundingBox){var g=this.graph.getView().getState(a);if(null!=g&&null!=g.text&&null!=g.text.boundingBox){var h=this.graph.getView().scale,k=g.text.boundingBox;g.text.boundingBox.x<g.x&&(b+=(g.x-k.x)/h,f.width=k.width);g.text.boundingBox.y<g.y&&(c+=(g.y-k.y)/h,f.height=k.height)}}null!=this.parent&&(g=d.getParent(a),null!=g&&g!=
|
|
this.parent&&(g=this.getParentOffset(g),b-=g.x,c-=g.y));if(e.x!=b||e.y!=c)e=e.clone(),e.x=b,e.y=c,d.setGeometry(a,e)}return f};
|
|
mxGraphLayout.prototype.getVertexBounds=function(a){var b=this.graph.getModel().getGeometry(a);if(this.useBoundingBox){var c=this.graph.getView().getState(a);if(null!=c&&null!=c.text&&null!=c.text.boundingBox)var d=this.graph.getView().scale,e=c.text.boundingBox,f=Math.max(c.x-e.x,0)/d,g=Math.max(c.y-e.y,0)/d,h=Math.max(e.x+e.width-(c.x+c.width),0)/d,c=Math.max(e.y+e.height-(c.y+c.height),0)/d,b=new mxRectangle(b.x-f,b.y-g,b.width+f+h,b.height+g+c)}null!=this.parent&&(a=this.graph.getModel().getParent(a),
|
|
b=b.clone(),null!=a&&a!=this.parent&&(a=this.getParentOffset(a),b.x+=a.x,b.y+=a.y));return new mxRectangle(b.x,b.y,b.width,b.height)};mxGraphLayout.prototype.arrangeGroups=function(a,b,c,d,e,f){return this.graph.updateGroupBounds(a,b,!0,c,d,e,f)};function mxStackLayout(a,b,c,d,e,f){mxGraphLayout.call(this,a);this.horizontal=null!=b?b:!0;this.spacing=null!=c?c:0;this.x0=null!=d?d:0;this.y0=null!=e?e:0;this.border=null!=f?f:0}mxStackLayout.prototype=new mxGraphLayout;
|
|
mxStackLayout.prototype.constructor=mxStackLayout;mxStackLayout.prototype.horizontal=null;mxStackLayout.prototype.spacing=null;mxStackLayout.prototype.x0=null;mxStackLayout.prototype.y0=null;mxStackLayout.prototype.border=0;mxStackLayout.prototype.marginTop=0;mxStackLayout.prototype.marginLeft=0;mxStackLayout.prototype.marginRight=0;mxStackLayout.prototype.marginBottom=0;mxStackLayout.prototype.keepFirstLocation=!1;mxStackLayout.prototype.fill=!1;mxStackLayout.prototype.resizeParent=!1;
|
|
mxStackLayout.prototype.resizeParentMax=!1;mxStackLayout.prototype.resizeLast=!1;mxStackLayout.prototype.wrap=null;mxStackLayout.prototype.borderCollapse=!0;mxStackLayout.prototype.isHorizontal=function(){return this.horizontal};
|
|
mxStackLayout.prototype.moveCell=function(a,b,c){var d=this.graph.getModel(),e=d.getParent(a),f=this.isHorizontal();if(null!=a&&null!=e){var g=0,h=0,k=d.getChildCount(e);b=f?b:c;g=this.graph.getView().getState(e);null!=g&&(b-=f?g.x:g.y);b/=this.graph.view.scale;for(g=0;g<k;g++)if(c=d.getChildAt(e,g),c!=a&&(c=d.getGeometry(c),null!=c)){c=f?c.x+c.width/2:c.y+c.height/2;if(h<=b&&c>b)break;h=c}f=e.getIndex(a);f=Math.max(0,g-(g>f?1:0));d.add(e,a,f)}};
|
|
mxStackLayout.prototype.getParentSize=function(a){var b=this.graph.getModel(),c=b.getGeometry(a);if(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.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);var e=e-(2*this.spacing+2*this.border),f=this.x0+this.border+this.marginLeft,g=this.y0+this.border+this.marginTop;if(this.graph.isSwimlane(a)){var h=this.graph.getCellStyle(a),k=mxUtils.getNumber(h,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE),h=1==mxUtils.getValue(h,
|
|
mxConstants.STYLE_HORIZONTAL,!0);null!=b&&(k=h?Math.min(k,b.height):Math.min(k,b.width));c==h&&(e-=k);h?g+=k:f+=k}d.beginUpdate();try{for(var k=0,h=null,m=0,l=null,n=d.getChildCount(a),p=0;p<n;p++){var r=d.getChildAt(a,p);if(!this.isVertexIgnored(r)&&this.isVertexMovable(r)){var q=d.getGeometry(r);if(null!=q){q=q.clone();if(null!=this.wrap&&null!=h&&(c&&h.x+h.width+q.width+2*this.spacing>this.wrap||!c&&h.y+h.height+q.height+2*this.spacing>this.wrap))h=null,c?g+=k+this.spacing:f+=k+this.spacing,k=
|
|
0;var k=Math.max(k,c?q.height:q.width),s=0;if(!this.borderCollapse)var u=this.graph.getCellStyle(r),s=mxUtils.getNumber(u,mxConstants.STYLE_STROKEWIDTH,1);null!=h?c?q.x=m+this.spacing+Math.floor(s/2):q.y=m+this.spacing+Math.floor(s/2):this.keepFirstLocation||(c?q.x=f:q.y=g);c?q.y=g:q.x=f;this.fill&&null!=e&&(c?q.height=e:q.width=e);this.setChildGeometry(r,q);l=r;h=q;m=c?h.x+h.width+Math.floor(s/2):h.y+h.height+Math.floor(s/2)}}}this.resizeParent&&null!=b&&null!=h&&!this.graph.isCellCollapsed(a)?this.updateParentGeometry(a,
|
|
b,h):this.resizeLast&&(null!=b&&null!=h&&null!=l)&&(c?h.width=b.width-h.x-this.spacing-this.marginRight-this.marginLeft:h.height=b.height-h.y-this.spacing-this.marginBottom,this.setChildGeometry(l,h))}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.spacing+this.marginRight,f.width=this.resizeParentMax?Math.max(f.width,c):c):(c=c.y+c.height+this.spacing+this.marginBottom,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){for(var e=0,f=0,g=c.getChildCount(d),e=0;e<g;e++){var h=c.getChildAt(d,e),h=this.getVertexBounds(h);if(null!=h){h=h.x+h.width/2;if(f<b&&h>b)break;f=h}}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);if(null!=this.graph.container&&(null==d&&c.isLayer(a)||a==this.graph.getView().currentRoot))d=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1);if(null!=d){for(var e=[],f=c.getChildCount(a),g=0;g<f;g++){var h=c.getChildAt(a,g);!this.isVertexIgnored(h)&&this.isVertexMovable(h)&&e.push(h)}f=e.length;if(0<f){var k=this.border,m=this.border,l=b?
|
|
d.height:d.width,l=l-2*this.border;a=this.graph.isSwimlane(a)?this.graph.getStartSize(a):new mxRectangle;l-=b?a.height:a.width;k+=a.width;m+=a.height;a=this.border+(f-1)*this.spacing;d=b?(d.width-k-a)/f:(d.height-m-a)/f;if(0<d){c.beginUpdate();try{for(g=0;g<f;g++){var h=e[g],n=c.getGeometry(h);null!=n&&(n=n.clone(),n.x=k,n.y=m,b?(this.resizeVertices&&(n.width=d,n.height=l),k+=d+this.spacing):(this.resizeVertices&&(n.height=d,n.width=l),m+=d+this.spacing),c.setGeometry(h,n))}}finally{c.endUpdate()}}}}};
|
|
function mxCompactTreeLayout(a,b,c){mxGraphLayout.call(this,a);this.horizontal=null!=b?b:!0;this.invert=null!=c?c:!1}mxCompactTreeLayout.prototype=new mxGraphLayout;mxCompactTreeLayout.prototype.constructor=mxCompactTreeLayout;mxCompactTreeLayout.prototype.horizontal=null;mxCompactTreeLayout.prototype.invert=null;mxCompactTreeLayout.prototype.resizeParent=!0;mxCompactTreeLayout.prototype.maintainParentLocation=!1;mxCompactTreeLayout.prototype.groupPadding=10;
|
|
mxCompactTreeLayout.prototype.groupPaddingTop=0;mxCompactTreeLayout.prototype.groupPaddingRight=0;mxCompactTreeLayout.prototype.groupPaddingBottom=0;mxCompactTreeLayout.prototype.groupPaddingLeft=0;mxCompactTreeLayout.prototype.parentsChanged=null;mxCompactTreeLayout.prototype.moveTree=!1;mxCompactTreeLayout.prototype.visited=null;mxCompactTreeLayout.prototype.levelDistance=10;mxCompactTreeLayout.prototype.nodeDistance=20;mxCompactTreeLayout.prototype.resetEdges=!0;
|
|
mxCompactTreeLayout.prototype.prefHozEdgeSep=5;mxCompactTreeLayout.prototype.prefVertEdgeOff=4;mxCompactTreeLayout.prototype.minEdgeJetty=8;mxCompactTreeLayout.prototype.channelBuffer=4;mxCompactTreeLayout.prototype.edgeRouting=!0;mxCompactTreeLayout.prototype.sortEdges=!1;mxCompactTreeLayout.prototype.alignRanks=!1;mxCompactTreeLayout.prototype.maxRankHeight=null;mxCompactTreeLayout.prototype.root=null;mxCompactTreeLayout.prototype.node=null;
|
|
mxCompactTreeLayout.prototype.isVertexIgnored=function(a){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(a).length};mxCompactTreeLayout.prototype.isHorizontal=function(){return this.horizontal};
|
|
mxCompactTreeLayout.prototype.execute=function(a,b){this.parent=a;var c=this.graph.getModel();if(null==b)if(0<this.graph.getEdges(a,c.getParent(a),this.invert,!this.invert,!1).length)this.root=a;else{var d=this.graph.findTreeRoots(a,!0,this.invert);if(0<d.length)for(var e=0;e<d.length;e++)if(!this.isVertexIgnored(d[e])&&0<this.graph.getEdges(d[e],null,this.invert,!this.invert,!1).length){this.root=d[e];break}}else this.root=b;if(null!=this.root){this.parentsChanged=this.resizeParent?{}:null;this.parentY=
|
|
this.parentX=null;if(a!=this.root&&null!=c.isVertex(a)&&this.maintainParentLocation){var f=this.graph.getCellGeometry(a);null!=f&&(this.parentX=f.x,this.parentY=f.y)}c.beginUpdate();try{if(this.visited={},this.node=this.dfs(this.root,a),this.alignRanks&&(this.maxRankHeight=[],this.findRankHeights(this.node,0),this.setCellHeights(this.node,0)),null!=this.node){this.layout(this.node);var g=this.graph.gridSize,d=g;if(!this.moveTree){var h=this.getVertexBounds(this.root);null!=h&&(g=h.x,d=h.y)}h=null;
|
|
h=this.isHorizontal()?this.horizontalLayout(this.node,g,d):this.verticalLayout(this.node,null,g,d);if(null!=h){var k=e=0;0>h.x&&(e=Math.abs(g-h.x));0>h.y&&(k=Math.abs(d-h.y));(0!=e||0!=k)&&this.moveNode(this.node,e,k);this.resizeParent&&this.adjustParents();this.edgeRouting&&this.localEdgeProcessing(this.node)}null!=this.parentX&&null!=this.parentY&&(f=this.graph.getCellGeometry(a),null!=f&&(f=f.clone(),f.x=this.parentX,f.y=this.parentY,c.setGeometry(a,f)))}}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(b,e){var f=b.getTerminal(b.getTerminal(!1)==a),g=c.get(f);null==g&&(g=mxCellPath.create(f).split(mxCellPath.PATH_SEPARATOR),c.put(f,g));var f=e.getTerminal(e.getTerminal(!1)==a),h=c.get(f);null==h&&(h=mxCellPath.create(f).split(mxCellPath.PATH_SEPARATOR),c.put(f,h));return mxCellPath.compare(g,h)})};
|
|
mxCompactTreeLayout.prototype.findRankHeights=function(a,b){if(null==this.maxRankHeight[b]||this.maxRankHeight[b]<a.height)this.maxRankHeight[b]=a.height;for(var c=a.child;null!=c;)this.findRankHeights(c,b+1),c=c.next};mxCompactTreeLayout.prototype.setCellHeights=function(a,b){null!=this.maxRankHeight[b]&&this.maxRankHeight[b]>a.height&&(a.height=this.maxRankHeight[b]);for(var c=a.child;null!=c;)this.setCellHeights(c,b+1),c=c.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;var d=this.createNode(a),c=this.graph.getModel(),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(var h=0;h<f.length;h++){var k=f[h];if(!this.isEdgeIgnored(k)){this.resetEdges&&this.setEdgePoints(k,null);this.edgeRouting&&(this.setEdgeStyleEnabled(k,!1),
|
|
this.setEdgePoints(k,null));var m=g.getState(k),k=null!=m?m.getVisibleTerminal(this.invert):g.getVisibleTerminal(k,this.invert),m=this.dfs(k,b);null!=m&&null!=c.getGeometry(k)&&(null==e?d.child=m:e.next=m,e=m)}}}return d};mxCompactTreeLayout.prototype.layout=function(a){if(null!=a){for(var b=a.child;null!=b;)this.layout(b),b=b.next;null!=a.child?this.attachParent(a,this.join(a)):this.layoutLeaf(a)}};
|
|
mxCompactTreeLayout.prototype.horizontalLayout=function(a,b,c,d){a.x+=b+a.offsetX;a.y+=c+a.offsetY;d=this.apply(a,d);b=a.child;if(null!=b){d=this.horizontalLayout(b,a.x,a.y,d);c=a.y+b.offsetY;for(var e=b.next;null!=e;)d=this.horizontalLayout(e,a.x+b.offsetX,c,d),c+=e.offsetY,e=e.next}return d};
|
|
mxCompactTreeLayout.prototype.verticalLayout=function(a,b,c,d,e){a.x+=c+a.offsetY;a.y+=d+a.offsetX;e=this.apply(a,e);b=a.child;if(null!=b){e=this.verticalLayout(b,a,a.x,a.y,e);c=a.x+b.offsetY;for(d=b.next;null!=d;)e=this.verticalLayout(d,a,c,a.y+b.offsetX,e),c+=d.offsetY,d=d.next}return e};
|
|
mxCompactTreeLayout.prototype.attachParent=function(a,b){var c=this.nodeDistance+this.levelDistance,d=(b-a.width)/2-this.nodeDistance,e=d+a.width+2*this.nodeDistance-b;a.child.offsetX=c+a.height;a.child.offsetY=e;a.contour.upperHead=this.createLine(a.height,0,this.createLine(c,e,a.contour.upperHead));a.contour.lowerHead=this.createLine(a.height,0,this.createLine(c,d,a.contour.lowerHead))};
|
|
mxCompactTreeLayout.prototype.layoutLeaf=function(a){var b=2*this.nodeDistance;a.contour.upperTail=this.createLine(a.height+b,0);a.contour.upperHead=a.contour.upperTail;a.contour.lowerTail=this.createLine(0,-a.width-b);a.contour.lowerHead=this.createLine(a.height+b,0,a.contour.lowerTail)};
|
|
mxCompactTreeLayout.prototype.join=function(a){var b=2*this.nodeDistance,c=a.child;a.contour=c.contour;for(var d=c.width+b,e=d,c=c.next;null!=c;){var f=this.merge(a.contour,c.contour);c.offsetY=f+d;c.offsetX=0;d=c.width+b;e+=f+d;c=c.next}return e};
|
|
mxCompactTreeLayout.prototype.merge=function(a,b){for(var c=0,d=0,e=0,f=a.lowerHead,g=b.upperHead;null!=g&&null!=f;){var h=this.offset(c,d,g.dx,g.dy,f.dx,f.dy),d=d+h,e=e+h;c+g.dx<=f.dx?(c+=g.dx,d+=g.dy,g=g.next):(c-=f.dx,d-=f.dy,f=f.next)}null!=g?(c=this.bridge(a.upperTail,0,0,g,c,d),a.upperTail=null!=c.next?b.upperTail:c,a.lowerTail=b.lowerTail):(c=this.bridge(b.lowerTail,c,d,f,0,0),null==c.next&&(a.lowerTail=c));a.lowerHead=b.lowerHead;return e};
|
|
mxCompactTreeLayout.prototype.offset=function(a,b,c,d,e,f){var g=0;if(e<=a||0>=a+c)return 0;g=0<e*d-c*f?0>a?a*d/c-b:0<a?a*f/e-b:-b:e<a+c?f-(b+(e-a)*d/c):e>a+c?(c+a)*f/e-(b+d):f-(b+d);return 0<g?g:0};mxCompactTreeLayout.prototype.bridge=function(a,b,c,d,e,f){b=e+d.dx-b;e=e=0;0==d.dx?e=d.dy:(e=b*d.dy,e/=d.dx);b=this.createLine(b,e,d.next);a.next=this.createLine(0,f+d.dy-e-c,b);return b};
|
|
mxCompactTreeLayout.prototype.createNode=function(a){var b={};b.cell=a;b.x=0;b.y=0;b.width=0;b.height=0;a=this.getVertexBounds(a);null!=a&&(this.isHorizontal()?(b.width=a.height,b.height=a.width):(b.width=a.width,b.height=a.height));b.offsetX=0;b.offsetY=0;b.contour={};return b};
|
|
mxCompactTreeLayout.prototype.apply=function(a,b){var c=this.graph.getModel(),d=a.cell,e=c.getGeometry(d);null!=d&&null!=e&&(this.isVertexMovable(d)&&(e=this.setVertexLocation(d,a.x,a.y),this.resizeParent&&(c=c.getParent(d),d=mxCellPath.create(c),null==this.parentsChanged[d]&&(this.parentsChanged[d]=c))),b=null==b?new mxRectangle(e.x,e.y,e.width,e.height):new mxRectangle(Math.min(b.x,e.x),Math.min(b.y,e.y),Math.max(b.x+b.width,e.x+e.width),Math.max(b.y+b.height,e.y+e.height)));return b};
|
|
mxCompactTreeLayout.prototype.createLine=function(a,b,c){var d={};d.dx=a;d.dy=b;d.next=c;return d};mxCompactTreeLayout.prototype.adjustParents=function(){var a=[],b;for(b in this.parentsChanged)a.push(this.parentsChanged[b]);this.arrangeGroups(mxUtils.sortCells(a,!0),this.groupPadding,this.groupPaddingTop,this.groupPaddingRight,this.groupPaddingBottom,this.groupPaddingLeft)};
|
|
mxCompactTreeLayout.prototype.localEdgeProcessing=function(a){this.processNodeOutgoing(a);for(a=a.child;null!=a;)this.localEdgeProcessing(a),a=a.next};
|
|
mxCompactTreeLayout.prototype.processNodeOutgoing=function(a){for(var b=a.child,c=a.cell,d=0,e=[];null!=b;){d++;var f=b.x;this.horizontal&&(f=b.y);e.push(new WeightedCellSorter(b,f));b=b.next}e.sort(WeightedCellSorter.prototype.compare);var f=a.width,g=(d+1)*this.prefHozEdgeSep;f>g+2*this.prefHozEdgeSep&&(f-=2*this.prefHozEdgeSep);a=f/d;b=a/2;f>g+2*this.prefHozEdgeSep&&(b+=this.prefHozEdgeSep);for(var f=this.minEdgeJetty-this.prefVertEdgeOff,g=0,h=this.getVertexBounds(c),k=0;k<e.length;k++){for(var m=
|
|
e[k].cell.cell,l=this.getVertexBounds(m),m=this.graph.getEdgesBetween(c,m,!1),n=[],p=0,r=0,q=0;q<m.length;q++)this.horizontal?(p=h.x+h.width,r=h.y+b,n.push(new mxPoint(p,r)),p=h.x+h.width+f,n.push(new mxPoint(p,r)),r=l.y+l.height/2):(p=h.x+b,r=h.y+h.height,n.push(new mxPoint(p,r)),r=h.y+h.height+f,n.push(new mxPoint(p,r)),p=l.x+l.width/2),n.push(new mxPoint(p,r)),this.setEdgePoints(m[q],n);k<d/2?f+=this.prefVertEdgeOff:k>d/2&&(f-=this.prefVertEdgeOff);b+=a;g=Math.max(g,f)}};
|
|
function WeightedCellSorter(a,b){this.cell=a;this.weightedValue=b}WeightedCellSorter.prototype.weightedValue=0;WeightedCellSorter.prototype.nudge=!1;WeightedCellSorter.prototype.visited=!1;WeightedCellSorter.prototype.rankIndex=null;WeightedCellSorter.prototype.cell=null;WeightedCellSorter.prototype.compare=function(a,b){return null!=a&&null!=b?b.weightedValue>a.weightedValue?1:b.weightedValue<a.weightedValue?-1:b.nudge?1:-1:0};function mxRadialTreeLayout(a){mxCompactTreeLayout.call(this,a,!1)}
|
|
mxUtils.extend(mxRadialTreeLayout,mxCompactTreeLayout);mxRadialTreeLayout.prototype.angleOffset=0.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);for(var g=0,h=0,c=0;c<this.row.length;c++)e=(this.rowMaxX[c]-this.centerX-this.nodeDistance)/this.rowRadi[c],
|
|
g=Math.max(g,(this.centerX-this.rowMinX[c]-this.nodeDistance)/this.rowRadi[c]),h=Math.max(h,e);for(c=0;c<this.row.length;c++){var k=this.centerX-this.nodeDistance-g*this.rowRadi[c],m=this.centerX+this.nodeDistance+h*this.rowRadi[c]-k;for(e=0;e<this.row[c].length;e++)f=this.row[c],d=f[e],f=this.getVertexBounds(d.cell),d.theta=2*Math.PI*((f.x+f.width/2-k)/m)}for(c=this.row.length-2;0<=c;c--){f=this.row[c];for(e=0;e<f.length;e++){d=f[e];g=d.child;for(k=h=0;null!=g;)k+=g.theta,h++,g=g.next;0<h&&(g=k/
|
|
h,g>d.theta&&e<f.length-1?d.theta=Math.min(g,f[e+1].theta-Math.PI/10):g<d.theta&&0<e&&(d.theta=Math.max(g,f[e-1].theta+Math.PI/10)))}}for(c=0;c<this.row.length;c++)for(e=0;e<this.row[c].length;e++)f=this.row[c],d=f[e],f=this.getVertexBounds(d.cell),this.setVertexLocation(d.cell,this.centerX-f.width/2+this.rowRadi[c]*Math.cos(d.theta),this.centerY-f.height/2+this.rowRadi[c]*Math.sin(d.theta))};
|
|
mxRadialTreeLayout.prototype.calcRowDims=function(a,b){if(!(null==a||0==a.length)){this.rowMinX[b]=this.centerX;this.rowMaxX[b]=this.centerX;this.rowMinCenX[b]=this.centerX;this.rowMaxCenX[b]=this.centerX;this.row[b]=[];for(var c=!1,d=0;d<a.length;d++)for(var e=a[d].child;null!=e;)vertexBounds=this.getVertexBounds(e.cell),this.rowMinX[b]=Math.min(vertexBounds.x,this.rowMinX[b]),this.rowMaxX[b]=Math.max(vertexBounds.x+vertexBounds.width,this.rowMaxX[b]),this.rowMinCenX[b]=Math.min(vertexBounds.x+vertexBounds.width/
|
|
2,this.rowMinCenX[b]),this.rowMaxCenX[b]=Math.max(vertexBounds.x+vertexBounds.width/2,this.rowMaxCenX[b]),this.rowRadi[b]=vertexBounds.y-this.getVertexBounds(this.root).y,null!=e.child&&(c=!0),this.row[b].push(e),e=e.next;c&&this.calcRowDims(this.row[b],b+1)}};function mxFastOrganicLayout(a){mxGraphLayout.call(this,a)}mxFastOrganicLayout.prototype=new mxGraphLayout;mxFastOrganicLayout.prototype.constructor=mxFastOrganicLayout;mxFastOrganicLayout.prototype.useInputOrigin=!0;
|
|
mxFastOrganicLayout.prototype.resetEdges=!0;mxFastOrganicLayout.prototype.disableEdgeStyle=!0;mxFastOrganicLayout.prototype.forceConstant=50;mxFastOrganicLayout.prototype.forceConstantSquared=0;mxFastOrganicLayout.prototype.minDistanceLimit=2;mxFastOrganicLayout.prototype.maxDistanceLimit=500;mxFastOrganicLayout.prototype.minDistanceLimitSquared=4;mxFastOrganicLayout.prototype.initialTemp=200;mxFastOrganicLayout.prototype.temperature=0;mxFastOrganicLayout.prototype.maxIterations=0;
|
|
mxFastOrganicLayout.prototype.iteration=0;mxFastOrganicLayout.prototype.allowedToRun=!0;mxFastOrganicLayout.prototype.isVertexIgnored=function(a){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(a).length};
|
|
mxFastOrganicLayout.prototype.execute=function(a){var b=this.graph.getModel();this.vertexArray=[];for(var c=this.graph.getChildVertices(a),d=0;d<c.length;d++)this.isVertexIgnored(c[d])||this.vertexArray.push(c[d]);var e=this.useInputOrigin?this.graph.getBoundingBoxFromGeometry(this.vertexArray):null,f=this.vertexArray.length;this.indices=[];this.dispX=[];this.dispY=[];this.cellLocation=[];this.isMoveable=[];this.neighbours=[];this.radius=[];this.radiusSquared=[];0.001>this.forceConstant&&(this.forceConstant=
|
|
0.001);this.forceConstantSquared=this.forceConstant*this.forceConstant;for(d=0;d<this.vertexArray.length;d++){var g=this.vertexArray[d];this.cellLocation[d]=[];var h=mxObjectIdentity.get(g);this.indices[h]=d;var k=this.getVertexBounds(g),m=k.width,l=k.height,n=k.x,p=k.y;this.cellLocation[d][0]=n+m/2;this.cellLocation[d][1]=p+l/2;this.radius[d]=Math.min(m,l);this.radiusSquared[d]=this.radius[d]*this.radius[d]}b.beginUpdate();try{for(d=0;d<f;d++){this.dispX[d]=0;this.dispY[d]=0;this.isMoveable[d]=this.isVertexMovable(this.vertexArray[d]);
|
|
var r=this.graph.getConnections(this.vertexArray[d],a),c=this.graph.getOpposites(r,this.vertexArray[d]);this.neighbours[d]=[];for(m=0;m<c.length;m++){this.resetEdges&&this.graph.resetEdge(r[m]);this.disableEdgeStyle&&this.setEdgeStyleEnabled(r[m],!1);var h=mxObjectIdentity.get(c[m]),q=this.indices[h];this.neighbours[d][m]=null!=q?q:d}}this.temperature=this.initialTemp;0==this.maxIterations&&(this.maxIterations=20*Math.sqrt(f));for(this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun)return;
|
|
this.calcRepulsion();this.calcAttraction();this.calcPositions();this.reduceTemperature()}a=c=null;for(d=0;d<this.vertexArray.length;d++)g=this.vertexArray[d],this.isVertexMovable(g)&&(k=this.getVertexBounds(g),null!=k&&(this.cellLocation[d][0]-=k.width/2,this.cellLocation[d][1]-=k.height/2,n=this.graph.snap(this.cellLocation[d][0]),p=this.graph.snap(this.cellLocation[d][1]),this.setVertexLocation(g,n,p),c=null==c?n:Math.min(c,n),a=null==a?p:Math.min(a,p)));d=-(c||0)+1;g=-(a||0)+1;null!=e&&(d+=e.x,
|
|
g+=e.y);this.graph.moveCells(this.vertexArray,d,g)}finally{b.endUpdate()}};mxFastOrganicLayout.prototype.calcPositions=function(){for(var a=0;a<this.vertexArray.length;a++)if(this.isMoveable[a]){var b=Math.sqrt(this.dispX[a]*this.dispX[a]+this.dispY[a]*this.dispY[a]);0.001>b&&(b=0.001);var c=this.dispX[a]/b*Math.min(b,this.temperature),b=this.dispY[a]/b*Math.min(b,this.temperature);this.dispX[a]=0;this.dispY[a]=0;this.cellLocation[a][0]+=c;this.cellLocation[a][1]+=b}};
|
|
mxFastOrganicLayout.prototype.calcAttraction=function(){for(var a=0;a<this.vertexArray.length;a++)for(var b=0;b<this.neighbours[a].length;b++){var c=this.neighbours[a][b];if(a!=c&&this.isMoveable[a]&&this.isMoveable[c]){var d=this.cellLocation[a][0]-this.cellLocation[c][0],e=this.cellLocation[a][1]-this.cellLocation[c][1],f=d*d+e*e-this.radiusSquared[a]-this.radiusSquared[c];f<this.minDistanceLimitSquared&&(f=this.minDistanceLimitSquared);var g=Math.sqrt(f),f=f/this.forceConstant,d=d/g*f,e=e/g*f;
|
|
this.dispX[a]-=d;this.dispY[a]-=e;this.dispX[c]+=d;this.dispY[c]+=e}}};
|
|
mxFastOrganicLayout.prototype.calcRepulsion=function(){for(var a=this.vertexArray.length,b=0;b<a;b++)for(var c=b;c<a;c++){if(!this.allowedToRun)return;if(c!=b&&this.isMoveable[b]&&this.isMoveable[c]){var d=this.cellLocation[b][0]-this.cellLocation[c][0],e=this.cellLocation[b][1]-this.cellLocation[c][1];0==d&&(d=0.01+Math.random());0==e&&(e=0.01+Math.random());var f=Math.sqrt(d*d+e*e),g=f-this.radius[b]-this.radius[c];g>this.maxDistanceLimit||(g<this.minDistanceLimit&&(g=this.minDistanceLimit),g=this.forceConstantSquared/
|
|
g,d=d/f*g,e=e/f*g,this.dispX[b]+=d,this.dispY[b]+=e,this.dispX[c]-=d,this.dispY[c]-=e)}}};mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)};function mxCircleLayout(a,b){mxGraphLayout.call(this,a);this.radius=null!=b?b:100}mxCircleLayout.prototype=new mxGraphLayout;mxCircleLayout.prototype.constructor=mxCircleLayout;mxCircleLayout.prototype.radius=null;mxCircleLayout.prototype.moveCircle=!1;
|
|
mxCircleLayout.prototype.x0=0;mxCircleLayout.prototype.y0=0;mxCircleLayout.prototype.resetEdges=!0;mxCircleLayout.prototype.disableEdgeStyle=!0;
|
|
mxCircleLayout.prototype.execute=function(a){var b=this.graph.getModel();b.beginUpdate();try{for(var c=0,d=null,e=null,f=[],g=b.getChildCount(a),h=0;h<g;h++){var k=b.getChildAt(a,h);if(this.isVertexIgnored(k))this.isEdgeIgnored(k)||(this.resetEdges&&this.graph.resetEdge(k),this.disableEdgeStyle&&this.setEdgeStyleEnabled(k,!1));else{f.push(k);var m=this.getVertexBounds(k),d=null==d?m.y:Math.min(d,m.y),e=null==e?m.x:Math.min(e,m.x),c=Math.max(c,Math.max(m.width,m.height))}}var l=this.getRadius(f.length,
|
|
c);this.moveCircle&&(e=this.x0,d=this.y0);this.circle(f,l,e,d)}finally{b.endUpdate()}};mxCircleLayout.prototype.getRadius=function(a,b){return Math.max(a*b/Math.PI,this.radius)};mxCircleLayout.prototype.circle=function(a,b,c,d){for(var e=a.length,f=2*Math.PI/e,g=0;g<e;g++)this.isVertexMovable(a[g])&&this.setVertexLocation(a[g],c+b+b*Math.sin(g*f),d+b+b*Math.cos(g*f))};function mxParallelEdgeLayout(a){mxGraphLayout.call(this,a)}mxParallelEdgeLayout.prototype=new mxGraphLayout;
|
|
mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout;mxParallelEdgeLayout.prototype.spacing=20;mxParallelEdgeLayout.prototype.execute=function(a){a=this.findParallels(a);this.graph.model.beginUpdate();try{for(var b in a){var c=a[b];1<c.length&&this.layout(c)}}finally{this.graph.model.endUpdate()}};
|
|
mxParallelEdgeLayout.prototype.findParallels=function(a){for(var b=this.graph.getModel(),c=[],d=b.getChildCount(a),e=0;e<d;e++){var f=b.getChildAt(a,e);if(!this.isEdgeIgnored(f)){var g=this.getEdgeId(f);null!=g&&(null==c[g]&&(c[g]=[]),c[g].push(f))}}return c};mxParallelEdgeLayout.prototype.getEdgeId=function(a){var b=this.graph.getView(),c=b.getVisibleTerminal(a,!0);a=b.getVisibleTerminal(a,!1);return null!=c&&null!=a?(c=mxObjectIdentity.get(c),a=mxObjectIdentity.get(a),c>a?a+"-"+c:c+"-"+a):null};
|
|
mxParallelEdgeLayout.prototype.layout=function(a){var b=a[0],c=this.graph.getView(),d=this.graph.getModel(),e=d.getGeometry(c.getVisibleTerminal(b,!0)),d=d.getGeometry(c.getVisibleTerminal(b,!1));if(e==d)for(var b=e.x+e.width+this.spacing,c=e.y+e.height/2,f=0;f<a.length;f++)this.route(a[f],b,c),b+=this.spacing;else if(null!=e&&null!=d){var b=e.x+e.width/2,c=e.y+e.height/2,f=d.x+d.width/2-b,g=d.y+d.height/2-c,d=Math.sqrt(f*f+g*g);if(0<d){e=g*this.spacing/d;d=f*this.spacing/d;b=b+f/2+e*(a.length-1)/
|
|
2;c=c+g/2-d*(a.length-1)/2;for(f=0;f<a.length;f++)this.route(a[f],b,c),b-=e,c+=d}}};mxParallelEdgeLayout.prototype.route=function(a,b,c){this.graph.isCellMovable(a)&&this.setEdgePoints(a,[new mxPoint(b,c)])};function mxCompositeLayout(a,b,c){mxGraphLayout.call(this,a);this.layouts=b;this.master=c}mxCompositeLayout.prototype=new mxGraphLayout;mxCompositeLayout.prototype.constructor=mxCompositeLayout;mxCompositeLayout.prototype.layouts=null;mxCompositeLayout.prototype.master=null;
|
|
mxCompositeLayout.prototype.moveCell=function(a,b,c){null!=this.master?this.master.move.apply(this.master,arguments):this.layouts[0].move.apply(this.layouts[0],arguments)};mxCompositeLayout.prototype.execute=function(a){var b=this.graph.getModel();b.beginUpdate();try{for(var c=0;c<this.layouts.length;c++)this.layouts[c].execute.apply(this.layouts[c],arguments)}finally{b.endUpdate()}};function mxEdgeLabelLayout(a,b){mxGraphLayout.call(this,a)}mxEdgeLabelLayout.prototype=new mxGraphLayout;
|
|
mxEdgeLabelLayout.prototype.constructor=mxEdgeLabelLayout;mxEdgeLabelLayout.prototype.execute=function(a){for(var b=this.graph.view,c=this.graph.getModel(),d=[],e=[],f=c.getChildCount(a),g=0;g<f;g++){var h=c.getChildAt(a,g),k=b.getState(h);null!=k&&(this.isVertexIgnored(h)?this.isEdgeIgnored(h)||d.push(k):e.push(k))}this.placeLabels(e,d)};
|
|
mxEdgeLabelLayout.prototype.placeLabels=function(a,b){var c=this.graph.getModel();c.beginUpdate();try{for(var d=0;d<b.length;d++){var e=b[d];if(null!=e&&null!=e.text&&null!=e.text.boundingBox)for(var f=0;f<a.length;f++){var g=a[f];null!=g&&this.avoid(e,g)}}}finally{c.endUpdate()}};
|
|
mxEdgeLabelLayout.prototype.avoid=function(a,b){var c=this.graph.getModel(),d=a.text.boundingBox;if(mxUtils.intersects(d,b)){var e=-d.y-d.height+b.y,f=-d.y+b.y+b.height,e=Math.abs(e)<Math.abs(f)?e:f,f=-d.x-d.width+b.x,d=-d.x+b.x+b.width,d=Math.abs(f)<Math.abs(d)?f:d;Math.abs(d)<Math.abs(e)?e=0:d=0;f=c.getGeometry(a.cell);null!=f&&(f=f.clone(),null!=f.offset?(f.offset.x+=d,f.offset.y+=e):f.offset=new mxPoint(d,e),c.setGeometry(a.cell,f))}};
|
|
function mxGraphAbstractHierarchyCell(){this.x=[];this.y=[];this.temp=[]}mxGraphAbstractHierarchyCell.prototype.maxRank=-1;mxGraphAbstractHierarchyCell.prototype.minRank=-1;mxGraphAbstractHierarchyCell.prototype.x=null;mxGraphAbstractHierarchyCell.prototype.y=null;mxGraphAbstractHierarchyCell.prototype.width=0;mxGraphAbstractHierarchyCell.prototype.height=0;mxGraphAbstractHierarchyCell.prototype.nextLayerConnectedCells=null;mxGraphAbstractHierarchyCell.prototype.previousLayerConnectedCells=null;
|
|
mxGraphAbstractHierarchyCell.prototype.temp=null;mxGraphAbstractHierarchyCell.prototype.getNextLayerConnectedCells=function(a){return null};mxGraphAbstractHierarchyCell.prototype.getPreviousLayerConnectedCells=function(a){return null};mxGraphAbstractHierarchyCell.prototype.isEdge=function(){return!1};mxGraphAbstractHierarchyCell.prototype.isVertex=function(){return!1};mxGraphAbstractHierarchyCell.prototype.getGeneralPurposeVariable=function(a){return null};
|
|
mxGraphAbstractHierarchyCell.prototype.setGeneralPurposeVariable=function(a,b){return null};mxGraphAbstractHierarchyCell.prototype.setX=function(a,b){this.isVertex()?this.x[0]=b:this.isEdge()&&(this.x[a-this.minRank-1]=b)};mxGraphAbstractHierarchyCell.prototype.getX=function(a){return this.isVertex()?this.x[0]:this.isEdge()?this.x[a-this.minRank-1]:0};mxGraphAbstractHierarchyCell.prototype.setY=function(a,b){this.isVertex()?this.y[0]=b:this.isEdge()&&(this.y[a-this.minRank-1]=b)};
|
|
function mxGraphHierarchyNode(a){mxGraphAbstractHierarchyCell.apply(this,arguments);this.cell=a;this.id=mxObjectIdentity.get(a);this.connectsAsTarget=[];this.connectsAsSource=[]}mxGraphHierarchyNode.prototype=new mxGraphAbstractHierarchyCell;mxGraphHierarchyNode.prototype.constructor=mxGraphHierarchyNode;mxGraphHierarchyNode.prototype.cell=null;mxGraphHierarchyNode.prototype.id=null;mxGraphHierarchyNode.prototype.connectsAsTarget=null;mxGraphHierarchyNode.prototype.connectsAsSource=null;
|
|
mxGraphHierarchyNode.prototype.hashCode=!1;mxGraphHierarchyNode.prototype.getRankValue=function(a){return this.maxRank};mxGraphHierarchyNode.prototype.getNextLayerConnectedCells=function(a){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[];this.nextLayerConnectedCells[0]=[];for(var b=0;b<this.connectsAsTarget.length;b++){var c=this.connectsAsTarget[b];-1==c.maxRank||c.maxRank==a+1?this.nextLayerConnectedCells[0].push(c.source):this.nextLayerConnectedCells[0].push(c)}}return this.nextLayerConnectedCells[0]};
|
|
mxGraphHierarchyNode.prototype.getPreviousLayerConnectedCells=function(a){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[];this.previousLayerConnectedCells[0]=[];for(var b=0;b<this.connectsAsSource.length;b++){var c=this.connectsAsSource[b];-1==c.minRank||c.minRank==a-1?this.previousLayerConnectedCells[0].push(c.target):this.previousLayerConnectedCells[0].push(c)}}return this.previousLayerConnectedCells[0]};mxGraphHierarchyNode.prototype.isVertex=function(){return!0};
|
|
mxGraphHierarchyNode.prototype.getGeneralPurposeVariable=function(a){return this.temp[0]};mxGraphHierarchyNode.prototype.setGeneralPurposeVariable=function(a,b){this.temp[0]=b};mxGraphHierarchyNode.prototype.isAncestor=function(a){if(null!=a&&null!=this.hashCode&&null!=a.hashCode&&this.hashCode.length<a.hashCode.length){if(this.hashCode==a.hashCode)return!0;if(null==this.hashCode||null==this.hashCode)return!1;for(var b=0;b<this.hashCode.length;b++)if(this.hashCode[b]!=a.hashCode[b])return!1;return!0}return!1};
|
|
mxGraphHierarchyNode.prototype.getCoreCell=function(){return this.cell};function mxGraphHierarchyEdge(a){mxGraphAbstractHierarchyCell.apply(this,arguments);this.edges=a;this.ids=[];for(var b=0;b<a.length;b++)this.ids.push(mxObjectIdentity.get(a[b]))}mxGraphHierarchyEdge.prototype=new mxGraphAbstractHierarchyCell;mxGraphHierarchyEdge.prototype.constructor=mxGraphHierarchyEdge;mxGraphHierarchyEdge.prototype.edges=null;mxGraphHierarchyEdge.prototype.ids=null;mxGraphHierarchyEdge.prototype.source=null;
|
|
mxGraphHierarchyEdge.prototype.target=null;mxGraphHierarchyEdge.prototype.isReversed=!1;mxGraphHierarchyEdge.prototype.invert=function(a){a=this.source;this.source=this.target;this.target=a;this.isReversed=!this.isReversed};
|
|
mxGraphHierarchyEdge.prototype.getNextLayerConnectedCells=function(a){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[];for(var b=0;b<this.temp.length;b++)this.nextLayerConnectedCells[b]=[],b==this.temp.length-1?this.nextLayerConnectedCells[b].push(this.source):this.nextLayerConnectedCells[b].push(this)}return this.nextLayerConnectedCells[a-this.minRank-1]};
|
|
mxGraphHierarchyEdge.prototype.getPreviousLayerConnectedCells=function(a){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[];for(var b=0;b<this.temp.length;b++)this.previousLayerConnectedCells[b]=[],0==b?this.previousLayerConnectedCells[b].push(this.target):this.previousLayerConnectedCells[b].push(this)}return this.previousLayerConnectedCells[a-this.minRank-1]};mxGraphHierarchyEdge.prototype.isEdge=function(){return!0};
|
|
mxGraphHierarchyEdge.prototype.getGeneralPurposeVariable=function(a){return this.temp[a-this.minRank-1]};mxGraphHierarchyEdge.prototype.setGeneralPurposeVariable=function(a,b){this.temp[a-this.minRank-1]=b};mxGraphHierarchyEdge.prototype.getCoreCell=function(){return null!=this.edges&&0<this.edges.length?this.edges[0]:null};
|
|
function mxGraphHierarchyModel(a,b,c,d,e){a.getGraph();this.tightenToSource=e;this.roots=c;this.parent=d;this.vertexMapper=new mxDictionary;this.edgeMapper=new mxDictionary;this.maxRank=0;c=[];null==b&&(b=this.graph.getChildVertices(d));this.maxRank=this.SOURCESCANSTARTRANK;this.createInternalCells(a,b,c);for(d=0;d<b.length;d++){e=c[d].connectsAsSource;for(var f=0;f<e.length;f++){var g=e[f],h=g.edges;if(null!=h&&0<h.length){var h=h[0],k=a.getVisibleTerminal(h,!1),k=this.vertexMapper.get(k);c[d]==
|
|
k&&(k=a.getVisibleTerminal(h,!0),k=this.vertexMapper.get(k));null!=k&&c[d]!=k&&(g.target=k,0==k.connectsAsTarget.length&&(k.connectsAsTarget=[]),0>mxUtils.indexOf(k.connectsAsTarget,g)&&k.connectsAsTarget.push(g))}}c[d].temp[0]=1}}mxGraphHierarchyModel.prototype.maxRank=null;mxGraphHierarchyModel.prototype.vertexMapper=null;mxGraphHierarchyModel.prototype.edgeMapper=null;mxGraphHierarchyModel.prototype.ranks=null;mxGraphHierarchyModel.prototype.roots=null;mxGraphHierarchyModel.prototype.parent=null;
|
|
mxGraphHierarchyModel.prototype.dfsCount=0;mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1E8;mxGraphHierarchyModel.prototype.tightenToSource=!1;
|
|
mxGraphHierarchyModel.prototype.createInternalCells=function(a,b,c){for(var d=a.getGraph(),e=0;e<b.length;e++){c[e]=new mxGraphHierarchyNode(b[e]);this.vertexMapper.put(b[e],c[e]);var f=a.getEdges(b[e]);c[e].connectsAsSource=[];for(var g=0;g<f.length;g++){var h=a.getVisibleTerminal(f[g],!1);if(h!=b[e]&&a.graph.model.isVertex(h)&&!a.isVertexIgnored(h)){var k=a.getEdgesBetween(b[e],h,!1),h=a.getEdgesBetween(b[e],h,!0);if(null!=k&&0<k.length&&null==this.edgeMapper.get(k[0])&&2*h.length>=k.length){for(var h=
|
|
new mxGraphHierarchyEdge(k),m=0;m<k.length;m++){var l=k[m];this.edgeMapper.put(l,h);d.resetEdge(l);a.disableEdgeStyle&&(a.setEdgeStyleEnabled(l,!1),a.setOrthogonalEdge(l,!0))}h.source=c[e];0>mxUtils.indexOf(c[e].connectsAsSource,h)&&c[e].connectsAsSource.push(h)}}}c[e].temp[0]=0}};
|
|
mxGraphHierarchyModel.prototype.initialRank=function(){var a=[];if(null!=this.roots)for(var b=0;b<this.roots.length;b++){var c=this.vertexMapper.get(this.roots[b]);null!=c&&a.push(c)}for(var d=this.vertexMapper.getValues(),b=0;b<d.length;b++)d[b].temp[0]=-1;for(var e=a.slice();0<a.length;){var c=a[0],f,g;f=c.connectsAsTarget;g=c.connectsAsSource;for(var h=!0,k=this.SOURCESCANSTARTRANK,b=0;b<f.length;b++){var m=f[b];if(5270620==m.temp[0])m=m.source,k=Math.min(k,m.temp[0]-1);else{h=!1;break}}if(h){c.temp[0]=
|
|
k;this.maxRank=Math.min(this.maxRank,k);if(null!=g)for(b=0;b<g.length;b++)m=g[b],m.temp[0]=5270620,m=m.target,-1==m.temp[0]&&(a.push(m),m.temp[0]=-2);a.shift()}else if(b=a.shift(),a.push(c),b==c&&1==a.length)break}for(b=0;b<d.length;b++)d[b].temp[0]-=this.maxRank;for(b=0;b<e.length;b++){c=e[b];a=0;f=c.connectsAsSource;for(d=0;d<f.length;d++)m=f[d],m=m.target,c.temp[0]=Math.max(a,m.temp[0]+1),a=c.temp[0]}this.maxRank=this.SOURCESCANSTARTRANK-this.maxRank};
|
|
mxGraphHierarchyModel.prototype.fixRanks=function(){var a=[];this.ranks=[];for(var b=0;b<this.maxRank+1;b++)a[b]=[],this.ranks[b]=a[b];var c=null;if(null!=this.roots)for(var d=this.roots,c=[],b=0;b<d.length;b++){var e=this.vertexMapper.get(d[b]);c[b]=e}this.visit(function(b,c,d,e,m){0==m&&(0>c.maxRank&&0>c.minRank)&&(a[c.temp[0]].push(c),c.maxRank=c.temp[0],c.minRank=c.temp[0],c.temp[0]=a[c.maxRank].length-1);if(null!=b&&null!=d&&1<b.maxRank-c.maxRank){d.maxRank=b.maxRank;d.minRank=c.maxRank;d.temp=
|
|
[];d.x=[];d.y=[];for(b=d.minRank+1;b<d.maxRank;b++)a[b].push(d),d.setGeneralPurposeVariable(b,a[b].length-1)}},c,!1,null)};mxGraphHierarchyModel.prototype.visit=function(a,b,c,d){if(null!=b){for(var e=0;e<b.length;e++){var f=b[e];null!=f&&(null==d&&(d={}),c?(f.hashCode=[],f.hashCode[0]=this.dfsCount,f.hashCode[1]=e,this.extendedDfs(null,f,null,a,d,f.hashCode,e,0)):this.dfs(null,f,null,a,d,0))}this.dfsCount++}};
|
|
mxGraphHierarchyModel.prototype.dfs=function(a,b,c,d,e,f){if(null!=b){var g=b.id;if(null==e[g]){e[g]=b;d(a,b,c,f,0);a=b.connectsAsSource.slice();for(c=0;c<a.length;c++)g=a[c],this.dfs(b,g.target,g,d,e,f+1)}else d(a,b,c,f,1)}};
|
|
mxGraphHierarchyModel.prototype.extendedDfs=function(a,b,c,d,e,f,g,h){if(null!=b){if(null!=a&&(null==b.hashCode||b.hashCode[0]!=a.hashCode[0]))f=a.hashCode.length+1,b.hashCode=a.hashCode.slice(),b.hashCode[f-1]=g;g=b.id;if(null==e[g]){e[g]=b;d(a,b,c,h,0);a=b.connectsAsSource.slice();for(c=0;c<a.length;c++)g=a[c],this.extendedDfs(b,g.target,g,d,e,b.hashCode,c,h+1)}else d(a,b,c,h,1)}};
|
|
function mxSwimlaneModel(a,b,c,d,e){a.getGraph();this.tightenToSource=e;this.roots=c;this.parent=d;this.vertexMapper=new mxDictionary;this.edgeMapper=new mxDictionary;this.maxRank=0;c=[];null==b&&(b=this.graph.getChildVertices(d));this.maxRank=this.SOURCESCANSTARTRANK;this.createInternalCells(a,b,c);for(d=0;d<b.length;d++){e=c[d].connectsAsSource;for(var f=0;f<e.length;f++){var g=e[f],h=g.edges;if(null!=h&&0<h.length){var h=h[0],k=a.getVisibleTerminal(h,!1),k=this.vertexMapper.get(k);c[d]==k&&(k=
|
|
a.getVisibleTerminal(h,!0),k=this.vertexMapper.get(k));null!=k&&c[d]!=k&&(g.target=k,0==k.connectsAsTarget.length&&(k.connectsAsTarget=[]),0>mxUtils.indexOf(k.connectsAsTarget,g)&&k.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;mxGraphHierarchyModel.prototype.tightenToSource=!1;mxSwimlaneModel.prototype.ranksPerGroup=null;
|
|
mxSwimlaneModel.prototype.createInternalCells=function(a,b,c){for(var d=a.getGraph(),e=a.swimlanes,f=0;f<b.length;f++){c[f]=new mxGraphHierarchyNode(b[f]);this.vertexMapper.put(b[f],c[f]);c[f].swimlaneIndex=-1;for(var g=0;g<e.length;g++)if(d.model.getParent(b[f])==e[g]){c[f].swimlaneIndex=g;break}g=a.getEdges(b[f]);c[f].connectsAsSource=[];for(var h=0;h<g.length;h++){var k=a.getVisibleTerminal(g[h],!1);if(k!=b[f]&&a.graph.model.isVertex(k)&&!a.isVertexIgnored(k)){var m=a.getEdgesBetween(b[f],k,!1),
|
|
k=a.getEdgesBetween(b[f],k,!0);if(null!=m&&0<m.length&&null==this.edgeMapper.get(m[0])&&2*k.length>=m.length){for(var k=new mxGraphHierarchyEdge(m),l=0;l<m.length;l++){var n=m[l];this.edgeMapper.put(n,k);d.resetEdge(n);a.disableEdgeStyle&&(a.setEdgeStyleEnabled(n,!1),a.setOrthogonalEdge(n,!0))}k.source=c[f];0>mxUtils.indexOf(c[f].connectsAsSource,k)&&c[f].connectsAsSource.push(k)}}}c[f].temp[0]=0}};
|
|
mxSwimlaneModel.prototype.initialRank=function(){this.ranksPerGroup=[];var a=[],b={};if(null!=this.roots)for(var c=0;c<this.roots.length;c++){var d=this.vertexMapper.get(this.roots[c]);this.maxChainDfs(null,d,null,b,0);null!=d&&a.push(d)}d=[];b=[];for(c=this.ranksPerGroup.length-1;0<=c;c--)d[c]=c==this.ranksPerGroup.length-1?0:b[c+1]+1,b[c]=d[c]+this.ranksPerGroup[c];this.maxRank=b[0];d=this.vertexMapper.getValues();for(c=0;c<d.length;c++)d[c].temp[0]=-1;for(a.slice();0<a.length;){var d=a[0],e,f;
|
|
e=d.connectsAsTarget;f=d.connectsAsSource;for(var g=!0,h=b[0],c=0;c<e.length;c++){var k=e[c];if(5270620==k.temp[0])k=k.source,h=Math.min(h,k.temp[0]-1);else{g=!1;break}}if(g){h>b[d.swimlaneIndex]&&(h=b[d.swimlaneIndex]);d.temp[0]=h;if(null!=f)for(c=0;c<f.length;c++)k=f[c],k.temp[0]=5270620,k=k.target,-1==k.temp[0]&&(a.push(k),k.temp[0]=-2);a.shift()}else if(c=a.shift(),a.push(d),c==d&&1==a.length)break}};
|
|
mxSwimlaneModel.prototype.maxChainDfs=function(a,b,c,d,e){if(null!=b&&(a=mxCellPath.create(b.cell),null==d[a])){d[a]=b;a=b.swimlaneIndex;if(null==this.ranksPerGroup[a]||this.ranksPerGroup[a]<e)this.ranksPerGroup[a]=e;a=b.connectsAsSource.slice();for(c=0;c<a.length;c++){var f=a[c],g=f.target;b.swimlaneIndex<g.swimlaneIndex?this.maxChainDfs(b,g,f,mxUtils.clone(d,null,!0),0):b.swimlaneIndex==g.swimlaneIndex&&this.maxChainDfs(b,g,f,mxUtils.clone(d,null,!0),e+1)}}};
|
|
mxSwimlaneModel.prototype.fixRanks=function(){var a=[];this.ranks=[];for(var b=0;b<this.maxRank+1;b++)a[b]=[],this.ranks[b]=a[b];var c=null;if(null!=this.roots)for(var d=this.roots,c=[],b=0;b<d.length;b++){var e=this.vertexMapper.get(d[b]);c[b]=e}this.visit(function(b,c,d,e,m){0==m&&(0>c.maxRank&&0>c.minRank)&&(a[c.temp[0]].push(c),c.maxRank=c.temp[0],c.minRank=c.temp[0],c.temp[0]=a[c.maxRank].length-1);if(null!=b&&null!=d&&1<b.maxRank-c.maxRank){d.maxRank=b.maxRank;d.minRank=c.maxRank;d.temp=[];
|
|
d.x=[];d.y=[];for(b=d.minRank+1;b<d.maxRank;b++)a[b].push(d),d.setGeneralPurposeVariable(b,a[b].length-1)}},c,!1,null)};mxSwimlaneModel.prototype.visit=function(a,b,c,d){if(null!=b){for(var e=0;e<b.length;e++){var f=b[e];null!=f&&(null==d&&(d={}),c?(f.hashCode=[],f.hashCode[0]=this.dfsCount,f.hashCode[1]=e,this.extendedDfs(null,f,null,a,d,f.hashCode,e,0)):this.dfs(null,f,null,a,d,0))}this.dfsCount++}};
|
|
mxSwimlaneModel.prototype.dfs=function(a,b,c,d,e,f){if(null!=b){var g=b.id;if(null==e[g]){e[g]=b;d(a,b,c,f,0);a=b.connectsAsSource.slice();for(c=0;c<a.length;c++)g=a[c],this.dfs(b,g.target,g,d,e,f+1)}else d(a,b,c,f,1)}};
|
|
mxSwimlaneModel.prototype.extendedDfs=function(a,b,c,d,e,f,g,h){if(null!=b){if(null!=a&&(null==b.hashCode||b.hashCode[0]!=a.hashCode[0]))f=a.hashCode.length+1,b.hashCode=a.hashCode.slice(),b.hashCode[f-1]=g;g=b.id;if(null==e[g]){e[g]=b;d(a,b,c,h,0);a=b.connectsAsSource.slice();c=b.connectsAsTarget.slice();for(g=0;g<a.length;g++){f=a[g];var k=f.target;b.swimlaneIndex<=k.swimlaneIndex&&this.extendedDfs(b,k,f,d,e,b.hashCode,g,h+1)}for(g=0;g<c.length;g++)f=c[g],k=f.source,b.swimlaneIndex<k.swimlaneIndex&&
|
|
this.extendedDfs(b,k,f,d,e,b.hashCode,g,h+1)}else d(a,b,c,h,1)}};function mxHierarchicalLayoutStage(){}mxHierarchicalLayoutStage.prototype.execute=function(a){};function mxMedianHybridCrossingReduction(a){this.layout=a}mxMedianHybridCrossingReduction.prototype=new mxHierarchicalLayoutStage;mxMedianHybridCrossingReduction.prototype.constructor=mxMedianHybridCrossingReduction;mxMedianHybridCrossingReduction.prototype.layout=null;mxMedianHybridCrossingReduction.prototype.maxIterations=24;
|
|
mxMedianHybridCrossingReduction.prototype.nestedBestRanks=null;mxMedianHybridCrossingReduction.prototype.currentBestCrossings=0;mxMedianHybridCrossingReduction.prototype.iterationsWithoutImprovement=0;mxMedianHybridCrossingReduction.prototype.maxNoImprovementIterations=2;
|
|
mxMedianHybridCrossingReduction.prototype.execute=function(a){a=this.layout.getModel();this.nestedBestRanks=[];for(var b=0;b<a.ranks.length;b++)this.nestedBestRanks[b]=a.ranks[b].slice();for(var c=0,d=this.calculateCrossings(a),b=0;b<this.maxIterations&&c<this.maxNoImprovementIterations;b++){this.weightedMedian(b,a);this.transpose(b,a);var e=this.calculateCrossings(a);if(e<d){d=e;for(e=c=0;e<this.nestedBestRanks.length;e++)for(var f=a.ranks[e],g=0;g<f.length;g++){var h=f[g];this.nestedBestRanks[e][h.getGeneralPurposeVariable(e)]=
|
|
h}}else{c++;for(e=0;e<this.nestedBestRanks.length;e++){f=a.ranks[e];for(g=0;g<f.length;g++)h=f[g],h.setGeneralPurposeVariable(e,g)}}if(0==d)break}c=[];d=[];for(b=0;b<a.maxRank+1;b++)d[b]=[],c[b]=d[b];for(b=0;b<this.nestedBestRanks.length;b++)for(e=0;e<this.nestedBestRanks[b].length;e++)d[b].push(this.nestedBestRanks[b][e]);a.ranks=c};mxMedianHybridCrossingReduction.prototype.calculateCrossings=function(a){for(var b=a.ranks.length,c=0,d=1;d<b;d++)c+=this.calculateRankCrossing(d,a);return c};
|
|
mxMedianHybridCrossingReduction.prototype.calculateRankCrossing=function(a,b){for(var c=0,d=b.ranks[a],e=b.ranks[a-1],f=[],g=0;g<d.length;g++){for(var h=d[g],k=h.getGeneralPurposeVariable(a),h=h.getPreviousLayerConnectedCells(a),m=[],l=0;l<h.length;l++){var n=h[l].getGeneralPurposeVariable(a-1);m.push(n)}m.sort(function(a,b){return a-b});f[k]=m}d=[];for(g=0;g<f.length;g++)d=d.concat(f[g]);for(f=1;f<e.length;)f<<=1;k=2*f-1;f-=1;e=[];for(g=0;g<k;++g)e[g]=0;for(g=0;g<d.length;g++){k=d[g]+f;for(++e[k];0<
|
|
k;)k%2&&(c+=e[k+1]),k=k-1>>1,++e[k]}return c};
|
|
mxMedianHybridCrossingReduction.prototype.transpose=function(a,b){for(var c=!0,d=0;c&&10>d++;)for(var e=1==a%2&&1==d%2,c=!1,f=0;f<b.ranks.length;f++){for(var g=b.ranks[f],h=[],k=0;k<g.length;k++){var m=g[k],l=m.getGeneralPurposeVariable(f);0>l&&(l=k);h[l]=m}for(var n=l=m=null,p=null,r=null,q=null,s=null,u=null,t=null,z=null,k=0;k<g.length-1;k++){if(0==k){for(var t=h[k],m=t.getNextLayerConnectedCells(f),l=t.getPreviousLayerConnectedCells(f),r=[],q=[],y=0;y<m.length;y++)r[y]=m[y].getGeneralPurposeVariable(f+
|
|
1);for(y=0;y<l.length;y++)q[y]=l[y].getGeneralPurposeVariable(f-1)}else m=n,l=p,r=s,q=u,t=z;z=h[k+1];n=z.getNextLayerConnectedCells(f);p=z.getPreviousLayerConnectedCells(f);s=[];u=[];for(y=0;y<n.length;y++)s[y]=n[y].getGeneralPurposeVariable(f+1);for(y=0;y<p.length;y++)u[y]=p[y].getGeneralPurposeVariable(f-1);for(var v=0,K=0,y=0;y<r.length;y++)for(var F=0;F<s.length;F++)r[y]>s[F]&&v++,r[y]<s[F]&&K++;for(y=0;y<q.length;y++)for(F=0;F<u.length;F++)q[y]>u[F]&&v++,q[y]<u[F]&&K++;if(K<v||K==v&&e)n=t.getGeneralPurposeVariable(f),
|
|
t.setGeneralPurposeVariable(f,z.getGeneralPurposeVariable(f)),z.setGeneralPurposeVariable(f,n),n=m,p=l,s=r,u=q,z=t,e||(c=!0)}}};mxMedianHybridCrossingReduction.prototype.weightedMedian=function(a,b){var c=0==a%2;if(c)for(var d=b.maxRank-1;0<=d;d--)this.medianRank(d,c);else for(d=1;d<b.maxRank;d++)this.medianRank(d,c)};
|
|
mxMedianHybridCrossingReduction.prototype.medianRank=function(a,b){for(var c=this.nestedBestRanks[a].length,d=[],e=[],f=0;f<c;f++){var g=this.nestedBestRanks[a][f],h=new MedianCellSorter;h.cell=g;var k;k=b?g.getNextLayerConnectedCells(a):g.getPreviousLayerConnectedCells(a);var m;m=b?a+1:a-1;null!=k&&0!=k.length?(h.medianValue=this.medianValue(k,m),d.push(h)):e[g.getGeneralPurposeVariable(a)]=!0}d.sort(MedianCellSorter.prototype.compare);for(f=0;f<c;f++)null==e[f]&&(g=d.shift().cell,g.setGeneralPurposeVariable(a,
|
|
f))};mxMedianHybridCrossingReduction.prototype.medianValue=function(a,b){for(var c=[],d=0,e=0;e<a.length;e++){var f=a[e];c[d++]=f.getGeneralPurposeVariable(b)}c.sort(function(a,b){return a-b});if(1==d%2)return c[Math.floor(d/2)];if(2==d)return(c[0]+c[1])/2;e=d/2;f=c[e-1]-c[0];d=c[d-1]-c[e];return(c[e-1]*d+c[e]*f)/(f+d)};function MedianCellSorter(){}MedianCellSorter.prototype.medianValue=0;MedianCellSorter.prototype.cell=!1;
|
|
MedianCellSorter.prototype.compare=function(a,b){return null!=a&&null!=b?b.medianValue>a.medianValue?-1:b.medianValue<a.medianValue?1:0:0};function mxMinimumCycleRemover(a){this.layout=a}mxMinimumCycleRemover.prototype=new mxHierarchicalLayoutStage;mxMinimumCycleRemover.prototype.constructor=mxMinimumCycleRemover;mxMinimumCycleRemover.prototype.layout=null;
|
|
mxMinimumCycleRemover.prototype.execute=function(a){a=this.layout.getModel();for(var b={},c=a.vertexMapper.getValues(),d={},e=0;e<c.length;e++)d[c[e].id]=c[e];c=null;if(null!=a.roots)for(var f=a.roots,c=[],e=0;e<f.length;e++)c[e]=a.vertexMapper.get(f[e]);a.visit(function(a,c,e,f,l){c.isAncestor(a)&&(e.invert(),mxUtils.remove(e,a.connectsAsSource),a.connectsAsTarget.push(e),mxUtils.remove(e,c.connectsAsTarget),c.connectsAsSource.push(e));b[c.id]=c;delete d[c.id]},c,!0,null);e=mxUtils.clone(b,null,
|
|
!0);a.visit(function(a,c,e,f,l){c.isAncestor(a)&&(e.invert(),mxUtils.remove(e,a.connectsAsSource),c.connectsAsSource.push(e),a.connectsAsTarget.push(e),mxUtils.remove(e,c.connectsAsTarget));b[c.id]=c;delete d[c.id]},d,!0,e)};function mxCoordinateAssignment(a,b,c,d,e,f){this.layout=a;this.intraCellSpacing=b;this.interRankCellSpacing=c;this.orientation=d;this.initialX=e;this.parallelEdgeSpacing=f}mxCoordinateAssignment.prototype=new mxHierarchicalLayoutStage;
|
|
mxCoordinateAssignment.prototype.constructor=mxCoordinateAssignment;mxCoordinateAssignment.prototype.layout=null;mxCoordinateAssignment.prototype.intraCellSpacing=30;mxCoordinateAssignment.prototype.interRankCellSpacing=100;mxCoordinateAssignment.prototype.parallelEdgeSpacing=10;mxCoordinateAssignment.prototype.maxIterations=8;mxCoordinateAssignment.prototype.prefHozEdgeSep=5;mxCoordinateAssignment.prototype.prefVertEdgeOff=2;mxCoordinateAssignment.prototype.minEdgeJetty=12;
|
|
mxCoordinateAssignment.prototype.channelBuffer=4;mxCoordinateAssignment.prototype.jettyPositions=null;mxCoordinateAssignment.prototype.orientation=mxConstants.DIRECTION_NORTH;mxCoordinateAssignment.prototype.initialX=null;mxCoordinateAssignment.prototype.limitX=null;mxCoordinateAssignment.prototype.currentXDelta=null;mxCoordinateAssignment.prototype.widestRank=null;mxCoordinateAssignment.prototype.rankTopY=null;mxCoordinateAssignment.prototype.rankBottomY=null;
|
|
mxCoordinateAssignment.prototype.widestRankValue=null;mxCoordinateAssignment.prototype.rankWidths=null;mxCoordinateAssignment.prototype.rankY=null;mxCoordinateAssignment.prototype.fineTuning=!0;mxCoordinateAssignment.prototype.nextLayerConnectedCache=null;mxCoordinateAssignment.prototype.previousLayerConnectedCache=null;mxCoordinateAssignment.prototype.groupPadding=10;
|
|
mxCoordinateAssignment.prototype.printStatus=function(){var a=this.layout.getModel();mxLog.show();mxLog.writeln("\x3d\x3d\x3d\x3d\x3d\x3dCoord assignment debug\x3d\x3d\x3d\x3d\x3d\x3d\x3d");for(var b=0;b<a.ranks.length;b++){mxLog.write("Rank ",b," : ");for(var c=a.ranks[b],d=0;d<c.length;d++)mxLog.write(c[d].getGeneralPurposeVariable(b)," ");mxLog.writeln()}mxLog.writeln("\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d")};
|
|
mxCoordinateAssignment.prototype.execute=function(a){this.jettyPositions={};a=this.layout.getModel();this.currentXDelta=0;this.initialCoords(this.layout.getGraph(),a);this.fineTuning&&this.minNode(a);var b=1E8;if(this.fineTuning)for(var c=0;c<this.maxIterations;c++){0!=c&&(this.medianPos(c,a),this.minNode(a));if(this.currentXDelta<b){for(var d=0;d<a.ranks.length;d++)for(var e=a.ranks[d],f=0;f<e.length;f++){var g=e[f];g.setX(d,g.getGeneralPurposeVariable(d))}b=this.currentXDelta}else for(d=0;d<a.ranks.length;d++){e=
|
|
a.ranks[d];for(f=0;f<e.length;f++)g=e[f],g.setGeneralPurposeVariable(d,g.getX(d))}this.minPath(this.layout.getGraph(),a);this.currentXDelta=0}this.setCellLocations(this.layout.getGraph(),a)};
|
|
mxCoordinateAssignment.prototype.minNode=function(a){for(var b=[],c=new mxDictionary,d=[],e=0;e<=a.maxRank;e++){d[e]=a.ranks[e];for(var f=0;f<d[e].length;f++){var g=d[e][f],h=new WeightedCellSorter(g,e);h.rankIndex=f;h.visited=!0;b.push(h);c.put(g,h)}}a=10*b.length;for(f=0;0<b.length&&f<=a;){var g=b.shift(),e=g.cell,k=g.weightedValue,m=parseInt(g.rankIndex),h=e.getNextLayerConnectedCells(k),l=e.getPreviousLayerConnectedCells(k),n=h.length,p=l.length,r=this.medianXValue(h,k+1),q=this.medianXValue(l,
|
|
k-1),s=n+p,u=e.getGeneralPurposeVariable(k),t=u;0<s&&(t=(r*n+q*p)/s);n=!1;t<u-1?0==m?(e.setGeneralPurposeVariable(k,t),n=!0):(m=d[k][m-1],u=m.getGeneralPurposeVariable(k),u=u+m.width/2+this.intraCellSpacing+e.width/2,u<t?(e.setGeneralPurposeVariable(k,t),n=!0):u<e.getGeneralPurposeVariable(k)-1&&(e.setGeneralPurposeVariable(k,u),n=!0)):t>u+1&&(m==d[k].length-1?(e.setGeneralPurposeVariable(k,t),n=!0):(m=d[k][m+1],u=m.getGeneralPurposeVariable(k),u=u-m.width/2-this.intraCellSpacing-e.width/2,u>t?(e.setGeneralPurposeVariable(k,
|
|
t),n=!0):u>e.getGeneralPurposeVariable(k)+1&&(e.setGeneralPurposeVariable(k,u),n=!0)));if(n){for(e=0;e<h.length;e++)k=h[e],k=c.get(k),null!=k&&!1==k.visited&&(k.visited=!0,b.push(k));for(e=0;e<l.length;e++)k=l[e],k=c.get(k),null!=k&&!1==k.visited&&(k.visited=!0,b.push(k))}g.visited=!1;f++}};mxCoordinateAssignment.prototype.medianPos=function(a,b){if(0==a%2)for(var c=b.maxRank;0<c;c--)this.rankMedianPosition(c-1,b,c);else for(c=0;c<b.maxRank-1;c++)this.rankMedianPosition(c+1,b,c)};
|
|
mxCoordinateAssignment.prototype.rankMedianPosition=function(a,b,c){b=b.ranks[a];for(var d=[],e={},f=0;f<b.length;f++){var g=b[f];d[f]=new WeightedCellSorter;d[f].cell=g;d[f].rankIndex=f;e[g.id]=d[f];var h=null,h=c<a?g.getPreviousLayerConnectedCells(a):g.getNextLayerConnectedCells(a);d[f].weightedValue=this.calculatedWeightedValue(g,h)}d.sort(WeightedCellSorter.prototype.compare);for(f=0;f<d.length;f++){var k=0,g=d[f].cell,k=0,h=c<a?g.getPreviousLayerConnectedCells(a).slice():g.getNextLayerConnectedCells(a).slice();
|
|
null!=h&&(k=h.length,k=0<k?this.medianXValue(h,c):g.getGeneralPurposeVariable(a));for(var m=0,h=-1E8,l=d[f].rankIndex-1;0<=l;){var n=e[b[l].id];if(null!=n){var p=n.cell;n.visited?(h=p.getGeneralPurposeVariable(a)+p.width/2+this.intraCellSpacing+m+g.width/2,l=-1):(m+=p.width+this.intraCellSpacing,l--)}}m=0;p=1E8;for(l=d[f].rankIndex+1;l<d.length;)if(n=e[b[l].id],null!=n){var r=n.cell;n.visited?(p=r.getGeneralPurposeVariable(a)-r.width/2-this.intraCellSpacing-m-g.width/2,l=d.length):(m+=r.width+this.intraCellSpacing,
|
|
l++)}k>=h&&k<=p?g.setGeneralPurposeVariable(a,k):k<h?(g.setGeneralPurposeVariable(a,h),this.currentXDelta+=h-k):k>p&&(g.setGeneralPurposeVariable(a,p),this.currentXDelta+=k-p);d[f].visited=!0}};mxCoordinateAssignment.prototype.calculatedWeightedValue=function(a,b){for(var c=0,d=0;d<b.length;d++){var e=b[d];a.isVertex()&&e.isVertex()?c++:c=a.isEdge()&&e.isEdge()?c+8:c+2}return c};
|
|
mxCoordinateAssignment.prototype.medianXValue=function(a,b){if(0==a.length)return 0;for(var c=[],d=0;d<a.length;d++)c[d]=a[d].getGeneralPurposeVariable(b);c.sort(function(a,b){return a-b});if(1==a.length%2)return c[Math.floor(a.length/2)];d=a.length/2;return(c[d-1]+c[d])/2};
|
|
mxCoordinateAssignment.prototype.initialCoords=function(a,b){this.calculateWidestRank(a,b);for(var c=this.widestRank;0<=c;c--)c<b.maxRank&&this.rankCoordinates(c,a,b);for(c=this.widestRank+1;c<=b.maxRank;c++)0<c&&this.rankCoordinates(c,a,b)};
|
|
mxCoordinateAssignment.prototype.rankCoordinates=function(a,b,c){b=c.ranks[a];c=0;for(var d=this.initialX+(this.widestRankValue-this.rankWidths[a])/2,e=!1,f=0;f<b.length;f++){var g=b[f];if(g.isVertex()){var h=this.layout.getVertexBounds(g.cell);null!=h?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(g.width=h.width,g.height=h.height):(g.width=h.height,g.height=h.width):e=!0;c=Math.max(c,g.height)}else g.isEdge()&&(h=1,null!=g.edges?h=g.edges.length:mxLog.warn("edge.edges is null"),
|
|
g.width=(h-1)*this.parallelEdgeSpacing);d+=g.width/2;g.setX(a,d);g.setGeneralPurposeVariable(a,d);d+=g.width/2;d+=this.intraCellSpacing}!0==e&&mxLog.warn("At least one cell has no bounds")};
|
|
mxCoordinateAssignment.prototype.calculateWidestRank=function(a,b){var c=-this.interRankCellSpacing,d=0;this.rankWidths=[];this.rankY=[];for(var e=b.maxRank;0<=e;e--){for(var f=0,g=b.ranks[e],h=this.initialX,k=!1,m=0;m<g.length;m++){var l=g[m];if(l.isVertex()){var n=this.layout.getVertexBounds(l.cell);null!=n?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(l.width=n.width,l.height=n.height):(l.width=n.height,l.height=n.width):k=!0;f=Math.max(f,l.height)}else l.isEdge()&&
|
|
(n=1,null!=l.edges?n=l.edges.length:mxLog.warn("edge.edges is null"),l.width=(n-1)*this.parallelEdgeSpacing);h+=l.width/2;l.setX(e,h);l.setGeneralPurposeVariable(e,h);h+=l.width/2;h+=this.intraCellSpacing;h>this.widestRankValue&&(this.widestRankValue=h,this.widestRank=e);this.rankWidths[e]=h}!0==k&&mxLog.warn("At least one cell has no bounds");this.rankY[e]=c;h=f/2+d/2+this.interRankCellSpacing;d=f;c=this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?c+h:c-
|
|
h;for(m=0;m<g.length;m++)g[m].setY(e,c)}};
|
|
mxCoordinateAssignment.prototype.minPath=function(a,b){for(var c=b.edgeMapper.getValues(),d=0;d<c.length;d++){var e=c[d];if(!(1>e.maxRank-e.minRank-1)){for(var f=e.getGeneralPurposeVariable(e.minRank+1),g=!0,h=0,k=e.minRank+2;k<e.maxRank;k++){var m=e.getGeneralPurposeVariable(k);f!=m?(g=!1,f=m):h++}if(!g){for(var g=f=0,m=[],l=[],n=e.getGeneralPurposeVariable(e.minRank+1),k=e.minRank+1;k<e.maxRank-1;k++){var p=e.getX(k+1);n==p?(m[k-e.minRank-1]=n,f++):this.repositionValid(b,e,k+1,n)?(m[k-e.minRank-
|
|
1]=n,f++):n=m[k-e.minRank-1]=p}n=e.getX(k);for(k=e.maxRank-1;k>e.minRank+1;k--)p=e.getX(k-1),n==p?(l[k-e.minRank-2]=n,g++):this.repositionValid(b,e,k-1,n)?(l[k-e.minRank-2]=n,g++):(l[k-e.minRank-2]=e.getX(k-1),n=p);if(g>h||f>h)if(g>=f)for(k=e.maxRank-2;k>e.minRank;k--)e.setX(k,l[k-e.minRank-1]);else if(f>g)for(k=e.minRank+2;k<e.maxRank;k++)e.setX(k,m[k-e.minRank-2])}}}};
|
|
mxCoordinateAssignment.prototype.repositionValid=function(a,b,c,d){a=a.ranks[c];for(var e=-1,f=0;f<a.length;f++)if(b==a[f]){e=f;break}if(0>e)return!1;f=b.getGeneralPurposeVariable(c);if(d<f){if(0==e)return!0;a=a[e-1];c=a.getGeneralPurposeVariable(c);c=c+a.width/2+this.intraCellSpacing+b.width/2;if(!(c<=d))return!1}else if(d>f){if(e==a.length-1)return!0;a=a[e+1];c=a.getGeneralPurposeVariable(c);c=c-a.width/2-this.intraCellSpacing-b.width/2;if(!(c>=d))return!1}return!0};
|
|
mxCoordinateAssignment.prototype.setCellLocations=function(a,b){this.rankTopY=[];this.rankBottomY=[];for(var c=0;c<b.ranks.length;c++)this.rankTopY[c]=Number.MAX_VALUE,this.rankBottomY[c]=-Number.MAX_VALUE;for(var d=b.vertexMapper.getValues(),c=0;c<d.length;c++)this.setVertexLocation(d[c]);(this.layout.edgeStyle==mxHierarchicalEdgeStyle.ORTHOGONAL||this.layout.edgeStyle==mxHierarchicalEdgeStyle.POLYLINE||this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE)&&this.localEdgeProcessing(b);d=b.edgeMapper.getValues();
|
|
for(c=0;c<d.length;c++)this.setEdgePosition(d[c])};
|
|
mxCoordinateAssignment.prototype.localEdgeProcessing=function(a){for(var b=0;b<a.ranks.length;b++)for(var c=a.ranks[b],d=0;d<c.length;d++){var e=c[d];if(e.isVertex())for(var f=e.getPreviousLayerConnectedCells(b),g=b-1,h=0;2>h;h++){if(-1<g&&g<a.ranks.length&&null!=f&&0<f.length){for(var k=[],m=0;m<f.length;m++){var l=new WeightedCellSorter(f[m],f[m].getX(g));k.push(l)}k.sort(WeightedCellSorter.prototype.compare);for(var l=e.x[0]-e.width/2,n=l+e.width,p=f=0,g=[],m=0;m<k.length;m++){var r=k[m].cell,
|
|
q;if(r.isVertex()){q=0==h?e.connectsAsSource:e.connectsAsTarget;for(var s=0;s<q.length;s++)if(q[s].source==r||q[s].target==r)f+=q[s].edges.length,p++,g.push(q[s])}else f+=r.edges.length,p++,g.push(r)}e.width>(f+1)*this.prefHozEdgeSep+2*this.prefHozEdgeSep&&(l+=this.prefHozEdgeSep,n-=this.prefHozEdgeSep);k=(n-l)/f;l+=k/2;n=this.minEdgeJetty-this.prefVertEdgeOff;for(m=p=0;m<g.length;m++){r=g[m].edges.length;q=this.jettyPositions[g[m].ids[0]];null==q&&(q=[],this.jettyPositions[g[m].ids[0]]=q);m<f/2?
|
|
n+=this.prefVertEdgeOff:m>f/2&&(n-=this.prefVertEdgeOff);for(s=0;s<r;s++)q[4*s+2*h]=l,l+=k,q[4*s+2*h+1]=n;p=Math.max(p,n)}}f=e.getNextLayerConnectedCells(b);g=b+1}}};
|
|
mxCoordinateAssignment.prototype.setEdgePosition=function(a){var b=0;if(101207!=a.temp[0]){var c=a.maxRank,d=a.minRank;c==d&&(c=a.source.maxRank,d=a.target.minRank);for(var e=0,f=this.jettyPositions[a.ids[0]],g=a.isReversed?a.target.cell:a.source.cell,h=this.layout.graph,k=this.orientation==mxConstants.DIRECTION_EAST||this.orientation==mxConstants.DIRECTION_SOUTH,m=0;m<a.edges.length;m++){var l=a.edges[m],n=this.layout.getVisibleTerminal(l,!0),p=[],r=a.isReversed;n!=g&&(r=!r);if(null!=f){var q=r?
|
|
2:0,s=r?k?this.rankBottomY[d]:this.rankTopY[d]:k?this.rankTopY[c]:this.rankBottomY[c],u=f[4*e+1+q];r!=k&&(u=-u);var s=s+u,q=f[4*e+q],t=h.model.getTerminal(l,!0);this.layout.isPort(t)&&h.model.getParent(t)==n&&(q=h.view.getState(t),q=null!=q?q.x:n.geometry.x+a.source.width*t.geometry.x);this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(p.push(new mxPoint(q,s)),this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&p.push(new mxPoint(q,s+u))):(p.push(new mxPoint(s,
|
|
q)),this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&p.push(new mxPoint(s+u,q)))}q=a.x.length-1;s=u=-1;n=a.maxRank-1;r&&(q=0,u=a.x.length,s=1,n=a.minRank+1);for(;a.maxRank!=a.minRank&&q!=u;q+=s){var t=a.x[q]+b,z=(this.rankTopY[n]+this.rankBottomY[n+1])/2,y=(this.rankTopY[n-1]+this.rankBottomY[n])/2;if(r)var v=z,z=y,y=v;this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(p.push(new mxPoint(t,z)),p.push(new mxPoint(t,y))):(p.push(new mxPoint(z,t)),p.push(new mxPoint(y,
|
|
t)));this.limitX=Math.max(this.limitX,t);n+=s}null!=f&&(q=r?2:0,s=r?k?this.rankTopY[c]:this.rankBottomY[c]:k?this.rankBottomY[d]:this.rankTopY[d],u=f[4*e+3-q],r!=k&&(u=-u),s-=u,q=f[4*e+2-q],r=h.model.getTerminal(l,!1),n=this.layout.getVisibleTerminal(l,!1),this.layout.isPort(r)&&h.model.getParent(r)==n&&(q=h.view.getState(r),q=null!=q?q.x:n.geometry.x+a.target.width*r.geometry.x),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&
|
|
p.push(new mxPoint(q,s-u)),p.push(new mxPoint(q,s))):(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&p.push(new mxPoint(s-u,q)),p.push(new mxPoint(s,q))));a.isReversed&&this.processReversedEdge(a,l);this.layout.setEdgePoints(l,p);b=0==b?this.parallelEdgeSpacing:0<b?-b:-b+this.parallelEdgeSpacing;e++}a.temp[0]=101207}};
|
|
mxCoordinateAssignment.prototype.setVertexLocation=function(a){var b=a.cell,c=a.x[0]-a.width/2,d=a.y[0]-a.height/2;this.rankTopY[a.minRank]=Math.min(this.rankTopY[a.minRank],d);this.rankBottomY[a.minRank]=Math.max(this.rankBottomY[a.minRank],d+a.height);this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(b,c,d):this.layout.setVertexLocation(b,d,c);this.limitX=Math.max(this.limitX,c+a.width)};
|
|
mxCoordinateAssignment.prototype.processReversedEdge=function(a,b){};function WeightedCellSorter(a,b){this.cell=a;this.weightedValue=b}WeightedCellSorter.prototype.weightedValue=0;WeightedCellSorter.prototype.nudge=!1;WeightedCellSorter.prototype.visited=!1;WeightedCellSorter.prototype.rankIndex=null;WeightedCellSorter.prototype.cell=null;WeightedCellSorter.prototype.compare=function(a,b){return null!=a&&null!=b?b.weightedValue>a.weightedValue?-1:b.weightedValue<a.weightedValue?1:b.nudge?-1:1:0};
|
|
function mxSwimlaneOrdering(a){this.layout=a}mxSwimlaneOrdering.prototype=new mxHierarchicalLayoutStage;mxSwimlaneOrdering.prototype.constructor=mxSwimlaneOrdering;mxSwimlaneOrdering.prototype.layout=null;
|
|
mxSwimlaneOrdering.prototype.execute=function(a){a=this.layout.getModel();var b=mxUtils.clone(a.vertexMapper,null,!0),c=null;if(null!=a.roots)for(var d=a.roots,c=[],e=0;e<d.length;e++)mxCellPath.create(d[e]),c[e]=a.vertexMapper.get(d[e]);a.visit(function(a,c,d,e,m){e=null!=a&&a.swimlaneIndex==c.swimlaneIndex&&c.isAncestor(a);m=null!=a&&null!=d&&a.swimlaneIndex<c.swimlaneIndex&&d.source==c;e?(d.invert(),mxUtils.remove(d,a.connectsAsSource),c.connectsAsSource.push(d),a.connectsAsTarget.push(d),mxUtils.remove(d,
|
|
c.connectsAsTarget)):m&&(d.invert(),mxUtils.remove(d,a.connectsAsTarget),c.connectsAsTarget.push(d),a.connectsAsSource.push(d),mxUtils.remove(d,c.connectsAsSource));a=mxCellPath.create(c.cell);delete b[a]},c,!0,null)};function mxHierarchicalLayout(a,b,c){mxGraphLayout.call(this,a);this.orientation=null!=b?b:mxConstants.DIRECTION_NORTH;this.deterministic=null!=c?c:!0}var mxHierarchicalEdgeStyle={ORTHOGONAL:1,POLYLINE:2,STRAIGHT:3,CURVE:4};mxHierarchicalLayout.prototype=new mxGraphLayout;
|
|
mxHierarchicalLayout.prototype.constructor=mxHierarchicalLayout;mxHierarchicalLayout.prototype.roots=null;mxHierarchicalLayout.prototype.resizeParent=!1;mxHierarchicalLayout.prototype.maintainParentLocation=!1;mxHierarchicalLayout.prototype.moveParent=!1;mxHierarchicalLayout.prototype.parentBorder=0;mxHierarchicalLayout.prototype.intraCellSpacing=30;mxHierarchicalLayout.prototype.interRankCellSpacing=100;mxHierarchicalLayout.prototype.interHierarchySpacing=60;
|
|
mxHierarchicalLayout.prototype.parallelEdgeSpacing=10;mxHierarchicalLayout.prototype.orientation=mxConstants.DIRECTION_NORTH;mxHierarchicalLayout.prototype.fineTuning=!0;mxHierarchicalLayout.prototype.tightenToSource=!0;mxHierarchicalLayout.prototype.disableEdgeStyle=!0;mxHierarchicalLayout.prototype.traverseAncestors=!0;mxHierarchicalLayout.prototype.model=null;mxHierarchicalLayout.prototype.edgesCache=null;mxHierarchicalLayout.prototype.edgeSourceTermCache=null;
|
|
mxHierarchicalLayout.prototype.edgesTargetTermCache=null;mxHierarchicalLayout.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE;mxHierarchicalLayout.prototype.getModel=function(){return this.model};
|
|
mxHierarchicalLayout.prototype.execute=function(a,b){this.parent=a;var c=this.graph.model;this.edgesCache=new mxDictionary;this.edgeSourceTermCache=new mxDictionary;this.edgesTargetTermCache=new mxDictionary;null!=b&&!(b instanceof Array)&&(b=[b]);if(!(null==b&&null==a)){this.parentY=this.parentX=null;if(a!=this.root&&null!=c.isVertex(a)&&this.maintainParentLocation){var d=this.graph.getCellGeometry(a);null!=d&&(this.parentX=d.x,this.parentY=d.y)}if(null!=b){for(var e=[],f=0;f<b.length;f++)(null!=
|
|
a?c.isAncestor(a,b[f]):1)&&c.isVertex(b[f])&&e.push(b[f]);this.roots=e}c.beginUpdate();try{this.run(a),this.resizeParent&&!this.graph.isCellCollapsed(a)&&this.graph.updateGroupBounds([a],this.parentBorder,this.moveParent),null!=this.parentX&&null!=this.parentY&&(d=this.graph.getCellGeometry(a),null!=d&&(d=d.clone(),d.x=this.parentX,d.y=this.parentY,c.setGeometry(a,d)))}finally{c.endUpdate()}}};
|
|
mxHierarchicalLayout.prototype.findRoots=function(a,b){var c=[];if(null!=a&&null!=b){var d=this.graph.model,e=null,f=-1E5,g;for(g in b){var h=b[g];if(d.isVertex(h)&&this.graph.isCellVisible(h)){for(var k=this.getEdges(h),m=0,l=0,n=0;n<k.length;n++)this.getVisibleTerminal(k[n],!0)==h?m++:l++;0==l&&0<m&&c.push(h);k=m-l;k>f&&(f=k,e=h)}}0==c.length&&null!=e&&c.push(e)}return c};
|
|
mxHierarchicalLayout.prototype.getEdges=function(a){var b=this.edgesCache.get(a);if(null!=b)return b;for(var c=this.graph.model,b=[],d=this.graph.isCellCollapsed(a),e=c.getChildCount(a),f=0;f<e;f++){var g=c.getChildAt(a,f);if(this.isPort(g))b=b.concat(c.getEdges(g,!0,!0));else if(d||!this.graph.isCellVisible(g))b=b.concat(c.getEdges(g,!0,!0))}b=b.concat(c.getEdges(a,!0,!0));c=[];for(f=0;f<b.length;f++)d=this.getVisibleTerminal(b[f],!0),e=this.getVisibleTerminal(b[f],!1),(d==e||d!=e&&(e==a&&(null==
|
|
this.parent||this.graph.isValidAncestor(d,this.parent,this.traverseAncestors))||d==a&&(null==this.parent||this.graph.isValidAncestor(e,this.parent,this.traverseAncestors))))&&c.push(b[f]);this.edgesCache.put(a,c);return c};
|
|
mxHierarchicalLayout.prototype.getVisibleTerminal=function(a,b){var c=this.edgesTargetTermCache;b&&(c=this.edgeSourceTermCache);var d=c.get(a);if(null!=d)return d;var d=this.graph.view.getState(a),e=null!=d?d.getVisibleTerminal(b):this.graph.view.getVisibleTerminal(a,b);null==e&&(e=null!=d?d.getVisibleTerminal(b):this.graph.view.getVisibleTerminal(a,b));null!=e&&(this.isPort(e)&&(e=this.graph.model.getParent(e)),c.put(a,e));return e};
|
|
mxHierarchicalLayout.prototype.run=function(a){var b=[],c=[];if(null==this.roots&&null!=a){var d={};this.filterDescendants(a,d);this.roots=[];var e=!0,f;for(f in d)if(null!=d[f]){e=!1;break}for(;!e;){for(var g=this.findRoots(a,d),e=0;e<g.length;e++){var h={};b.push(h);this.traverse(g[e],!0,null,c,h,b,d)}for(e=0;e<g.length;e++)this.roots.push(g[e]);e=!0;for(f in d)if(null!=d[f]){e=!1;break}}}else for(e=0;e<this.roots.length;e++)h={},b.push(h),this.traverse(this.roots[e],!0,null,c,h,b,null);for(e=c=
|
|
0;e<b.length;e++){h=b[e];d=[];for(f in h)d.push(h[f]);this.model=new mxGraphHierarchyModel(this,d,this.roots,a,this.tightenToSource);this.cycleStage(a);this.layeringStage();this.crossingStage(a);c=this.placementStage(c,a)}};
|
|
mxHierarchicalLayout.prototype.filterDescendants=function(a,b){var c=this.graph.model;c.isVertex(a)&&(a!=this.parent&&this.graph.isCellVisible(a))&&(b[mxObjectIdentity.get(a)]=a);if(this.traverseAncestors||a==this.parent&&this.graph.isCellVisible(a))for(var d=c.getChildCount(a),e=0;e<d;e++){var f=c.getChildAt(a,e);this.isPort(f)||this.filterDescendants(f,b)}};mxHierarchicalLayout.prototype.isPort=function(a){return a.geometry.relative?!0:!1};
|
|
mxHierarchicalLayout.prototype.getEdgesBetween=function(a,b,c){c=null!=c?c:!1;for(var d=this.getEdges(a),e=[],f=0;f<d.length;f++){var g=this.getVisibleTerminal(d[f],!0),h=this.getVisibleTerminal(d[f],!1);(g==a&&h==b||!c&&g==b&&h==a)&&e.push(d[f])}return e};
|
|
mxHierarchicalLayout.prototype.traverse=function(a,b,c,d,e,f,g){if(null!=a&&null!=d){var h=mxObjectIdentity.get(a);if(null==d[h]&&(null==g||null!=g[h])){null==e[h]&&(e[h]=a);null==d[h]&&(d[h]=a);null!==g&&delete g[h];var k=this.getEdges(a),h=[];for(c=0;c<k.length;c++)h[c]=this.getVisibleTerminal(k[c],!0)==a;for(c=0;c<k.length;c++)if(!b||h[c]){a=this.getVisibleTerminal(k[c],!h[c]);for(var m=1,l=0;l<k.length;l++)if(l!=c){var n=h[l];this.getVisibleTerminal(k[l],!n)==a&&(n?m++:m--)}0<=m&&(e=this.traverse(a,
|
|
b,k[c],d,e,f,g))}}else if(null==e[h])for(c=0;c<f.length;c++)if(b=f[c],null!=b[h]){for(k in b)e[k]=b[k];f.splice(c,1);break}}return e};mxHierarchicalLayout.prototype.cycleStage=function(a){(new mxMinimumCycleRemover(this)).execute(a)};mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank();this.model.fixRanks()};mxHierarchicalLayout.prototype.crossingStage=function(a){(new mxMedianHybridCrossingReduction(this)).execute(a)};
|
|
mxHierarchicalLayout.prototype.placementStage=function(a,b){var c=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,a,this.parallelEdgeSpacing);c.fineTuning=this.fineTuning;c.execute(b);return c.limitX+this.interHierarchySpacing};function mxSwimlaneLayout(a,b,c){mxGraphLayout.call(this,a);this.orientation=null!=b?b:mxConstants.DIRECTION_NORTH;this.deterministic=null!=c?c:!0}mxSwimlaneLayout.prototype=new mxGraphLayout;
|
|
mxSwimlaneLayout.prototype.constructor=mxSwimlaneLayout;mxSwimlaneLayout.prototype.roots=null;mxSwimlaneLayout.prototype.swimlanes=null;mxSwimlaneLayout.prototype.dummyVertices=null;mxSwimlaneLayout.prototype.dummyVertexWidth=50;mxSwimlaneLayout.prototype.resizeParent=!1;mxSwimlaneLayout.prototype.maintainParentLocation=!1;mxSwimlaneLayout.prototype.moveParent=!1;mxSwimlaneLayout.prototype.parentBorder=30;mxSwimlaneLayout.prototype.intraCellSpacing=30;
|
|
mxSwimlaneLayout.prototype.interRankCellSpacing=100;mxSwimlaneLayout.prototype.interHierarchySpacing=60;mxSwimlaneLayout.prototype.parallelEdgeSpacing=10;mxSwimlaneLayout.prototype.orientation=mxConstants.DIRECTION_NORTH;mxSwimlaneLayout.prototype.fineTuning=!0;mxSwimlaneLayout.prototype.tightenToSource=!0;mxSwimlaneLayout.prototype.disableEdgeStyle=!0;mxSwimlaneLayout.prototype.traverseAncestors=!0;mxSwimlaneLayout.prototype.model=null;mxSwimlaneLayout.prototype.edgesCache=null;
|
|
mxHierarchicalLayout.prototype.edgeSourceTermCache=null;mxHierarchicalLayout.prototype.edgesTargetTermCache=null;mxHierarchicalLayout.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE;mxSwimlaneLayout.prototype.getModel=function(){return this.model};
|
|
mxSwimlaneLayout.prototype.execute=function(a,b){this.parent=a;var c=this.graph.model;this.edgesCache=new mxDictionary;this.edgeSourceTermCache=new mxDictionary;this.edgesTargetTermCache=new mxDictionary;if(!(null==b||1>b.length)){null==a&&(a=c.getParent(b[0]));this.parentY=this.parentX=null;if(a!=this.root&&null!=c.isVertex(a)&&this.maintainParentLocation){var d=this.graph.getCellGeometry(a);null!=d&&(this.parentX=d.x,this.parentY=d.y)}this.swimlanes=b;this.dummyVertices=[];for(var e=0;e<b.length;e++){var f=
|
|
this.graph.getChildCells(b[e]);if(null==f||0==f.length)f=this.graph.insertVertex(b[e],null,null,0,0,this.dummyVertexWidth,0),this.dummyVertices.push(f)}c.beginUpdate();try{this.run(a),this.resizeParent&&!this.graph.isCellCollapsed(a)&&this.graph.updateGroupBounds([a],this.parentBorder,this.moveParent),null!=this.parentX&&null!=this.parentY&&(d=this.graph.getCellGeometry(a),null!=d&&(d=d.clone(),d.x=this.parentX,d.y=this.parentY,c.setGeometry(a,d))),this.graph.removeCells(this.dummyVertices)}finally{c.endUpdate()}}};
|
|
mxSwimlaneLayout.prototype.updateGroupBounds=function(){var a=[],b=this.model,c;for(c in b.edgeMapper)for(var d=b.edgeMapper[c],e=0;e<d.edges.length;e++)a.push(d.edges[e]);a=this.graph.getBoundingBoxFromGeometry(a,!0);b=[];for(e=0;e<this.swimlanes.length;e++){var f=this.swimlanes[e];c=this.graph.getCellGeometry(f);if(null!=c){var g=this.graph.getChildCells(f),d=this.graph.isSwimlane(f)?this.graph.getStartSize(f):new mxRectangle,f=this.graph.getBoundingBoxFromGeometry(g);b[e]=f;d=f.y+c.y-d.height-
|
|
this.parentBorder;c=f.y+c.y+f.height;null==a?a=new mxRectangle(0,d,0,c-d):(a.y=Math.min(a.y,d),c=Math.max(a.y+a.height,c),a.height=c-a.y)}}for(e=0;e<this.swimlanes.length;e++)if(f=this.swimlanes[e],c=this.graph.getCellGeometry(f),null!=c){var g=this.graph.getChildCells(f),d=this.graph.isSwimlane(f)?this.graph.getStartSize(f):new mxRectangle,h=c.clone(),k=0==e?this.parentBorder:this.interRankCellSpacing/2;h.x+=b[e].x-d.width-k;h.y=h.y+a.y-c.y-this.parentBorder;h.width=b[e].width+d.width+this.interRankCellSpacing/
|
|
2+k;h.height=a.height+d.height+2*this.parentBorder;this.graph.model.setGeometry(f,h);this.graph.moveCells(g,-b[e].x+d.width+k,c.y-a.y+this.parentBorder)}};
|
|
mxSwimlaneLayout.prototype.findRoots=function(a,b){var c=[];if(null!=a&&null!=b){var d=this.graph.model,e=null,f=-1E5,g;for(g in b){var h=b[g];if(null!=h&&d.isVertex(h)&&this.graph.isCellVisible(h)&&d.isAncestor(a,h)){for(var k=this.getEdges(h),m=0,l=0,n=0;n<k.length;n++){var p=this.getVisibleTerminal(k[n],!0);p==h?(p=this.getVisibleTerminal(k[n],!1),d.isAncestor(a,p)&&m++):d.isAncestor(a,p)&&l++}0==l&&0<m&&c.push(h);k=m-l;k>f&&(f=k,e=h)}}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;for(var c=this.graph.model,b=[],d=this.graph.isCellCollapsed(a),e=c.getChildCount(a),f=0;f<e;f++){var g=c.getChildAt(a,f);if(this.isPort(g))b=b.concat(c.getEdges(g,!0,!0));else if(d||!this.graph.isCellVisible(g))b=b.concat(c.getEdges(g,!0,!0))}b=b.concat(c.getEdges(a,!0,!0));c=[];for(f=0;f<b.length;f++)d=this.getVisibleTerminal(b[f],!0),e=this.getVisibleTerminal(b[f],!1),(d==e||d!=e&&(e==a&&(null==this.parent||
|
|
this.graph.isValidAncestor(d,this.parent,this.traverseAncestors))||d==a&&(null==this.parent||this.graph.isValidAncestor(e,this.parent,this.traverseAncestors))))&&c.push(b[f]);this.edgesCache.put(a,c);return c};
|
|
mxSwimlaneLayout.prototype.getVisibleTerminal=function(a,b){var c=this.edgesTargetTermCache;b&&(c=this.edgeSourceTermCache);var d=c.get(a);if(null!=d)return d;var d=this.graph.view.getState(a),e=null!=d?d.getVisibleTerminal(b):this.graph.view.getVisibleTerminal(a,b);null==e&&(e=null!=d?d.getVisibleTerminal(b):this.graph.view.getVisibleTerminal(a,b));null!=e&&(this.isPort(e)&&(e=this.graph.model.getParent(e)),c.put(a,e));return e};
|
|
mxSwimlaneLayout.prototype.run=function(a){var b=[],c=[];if(null!=this.swimlanes&&0<this.swimlanes.length&&null!=a){for(var d={},e=0;e<this.swimlanes.length;e++)this.filterDescendants(this.swimlanes[e],d);this.roots=[];var e=!0,f;for(f in d)if(null!=d[f]){e=!1;break}for(var g=0;!e&&g<this.swimlanes.length;){var h=this.findRoots(this.swimlanes[g],d);if(0==h.length)g++;else{for(e=0;e<h.length;e++){var k={};b.push(k);this.traverse(h[e],!0,null,c,k,b,d,g)}for(e=0;e<h.length;e++)this.roots.push(h[e]);
|
|
e=!0;for(f in d)if(null!=d[f]){e=!1;break}}}}else for(e=0;e<this.roots.length;e++)k={},b.push(k),this.traverse(this.roots[e],!0,null,c,k,b,null);b=[];for(f in c)b.push(c[f]);this.model=new mxSwimlaneModel(this,b,this.roots,a,this.tightenToSource);this.cycleStage(a);this.layeringStage();this.crossingStage(a);initialX=this.placementStage(0,a)};
|
|
mxSwimlaneLayout.prototype.filterDescendants=function(a,b){var c=this.graph.model;c.isVertex(a)&&(a!=this.parent&&c.getParent(a)!=this.parent&&this.graph.isCellVisible(a))&&(b[mxObjectIdentity.get(a)]=a);if(this.traverseAncestors||a==this.parent&&this.graph.isCellVisible(a))for(var d=c.getChildCount(a),e=0;e<d;e++){var f=c.getChildAt(a,e);this.isPort(f)||this.filterDescendants(f,b)}};mxSwimlaneLayout.prototype.isPort=function(a){return a.geometry.relative?!0:!1};
|
|
mxSwimlaneLayout.prototype.getEdgesBetween=function(a,b,c){c=null!=c?c:!1;for(var d=this.getEdges(a),e=[],f=0;f<d.length;f++){var g=this.getVisibleTerminal(d[f],!0),h=this.getVisibleTerminal(d[f],!1);(g==a&&h==b||!c&&g==b&&h==a)&&e.push(d[f])}return e};
|
|
mxSwimlaneLayout.prototype.traverse=function(a,b,c,d,e,f,g,h){if(null!=a&&null!=d){var k=mxObjectIdentity.get(a);if(null==d[k]&&(null==g||null!=g[k])){null==e[k]&&(e[k]=a);null==d[k]&&(d[k]=a);null!==g&&delete g[k];var m=this.getEdges(a),k=this.graph.model;for(c=0;c<m.length;c++){var l=this.getVisibleTerminal(m[c],!0),n=l==a;n&&(l=this.getVisibleTerminal(m[c],!1));for(var p=0,p=0;p<this.swimlanes.length&&!k.isAncestor(this.swimlanes[p],l);p++);if(!(p>=this.swimlanes.length)&&(p>h||(!b||n)&&p==h))e=
|
|
this.traverse(l,b,m[c],d,e,f,g,p)}}else if(null==e[k])for(c=0;c<f.length;c++)if(a=f[c],null!=a[k]){for(m in a)e[m]=a[m];f.splice(c,1);break}}return e};mxSwimlaneLayout.prototype.cycleStage=function(a){(new mxSwimlaneOrdering(this)).execute(a)};mxSwimlaneLayout.prototype.layeringStage=function(){this.model.initialRank();this.model.fixRanks()};mxSwimlaneLayout.prototype.crossingStage=function(a){(new mxMedianHybridCrossingReduction(this)).execute(a)};
|
|
mxSwimlaneLayout.prototype.placementStage=function(a,b){var c=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,a,this.parallelEdgeSpacing);c.fineTuning=this.fineTuning;c.execute(b);return c.limitX+this.interHierarchySpacing};function mxGraphModel(a){this.currentEdit=this.createUndoableEdit();null!=a?this.setRoot(a):this.clear()}mxGraphModel.prototype=new mxEventSource;mxGraphModel.prototype.constructor=mxGraphModel;mxGraphModel.prototype.root=null;
|
|
mxGraphModel.prototype.cells=null;mxGraphModel.prototype.maintainEdgeParent=!0;mxGraphModel.prototype.ignoreRelativeEdgeParent=!0;mxGraphModel.prototype.createIds=!0;mxGraphModel.prototype.prefix="";mxGraphModel.prototype.postfix="";mxGraphModel.prototype.nextId=0;mxGraphModel.prototype.currentEdit=null;mxGraphModel.prototype.updateLevel=0;mxGraphModel.prototype.endingUpdate=!1;mxGraphModel.prototype.clear=function(){this.setRoot(this.createRoot())};mxGraphModel.prototype.isCreateIds=function(){return this.createIds};
|
|
mxGraphModel.prototype.setCreateIds=function(a){this.createIds=a};mxGraphModel.prototype.createRoot=function(){var a=new mxCell;a.insert(new mxCell);return a};mxGraphModel.prototype.getCell=function(a){return null!=this.cells?this.cells[a]:null};mxGraphModel.prototype.filterCells=function(a,b){var c=null;if(null!=a)for(var c=[],d=0;d<a.length;d++)b(a[d])&&c.push(a[d]);return c};mxGraphModel.prototype.getDescendants=function(a){return this.filterDescendants(null,a)};
|
|
mxGraphModel.prototype.filterDescendants=function(a,b){var c=[];b=b||this.getRoot();(null==a||a(b))&&c.push(b);for(var d=this.getChildCount(b),e=0;e<d;e++)var f=this.getChildAt(b,e),c=c.concat(this.filterDescendants(a,f));return c};mxGraphModel.prototype.getRoot=function(a){var b=a||this.root;if(null!=a)for(;null!=a;)b=a,a=this.getParent(a);return b};mxGraphModel.prototype.setRoot=function(a){this.execute(new mxRootChange(this,a));return a};
|
|
mxGraphModel.prototype.rootChanged=function(a){var b=this.root;this.root=a;this.nextId=0;this.cells=null;this.cellAdded(a);return b};mxGraphModel.prototype.isRoot=function(a){return null!=a&&this.root==a};mxGraphModel.prototype.isLayer=function(a){return this.isRoot(this.getParent(a))};mxGraphModel.prototype.isAncestor=function(a,b){for(;null!=b&&b!=a;)b=this.getParent(b);return b==a};mxGraphModel.prototype.contains=function(a){return this.isAncestor(this.root,a)};
|
|
mxGraphModel.prototype.getParent=function(a){return null!=a?a.getParent():null};mxGraphModel.prototype.add=function(a,b,c){if(b!=a&&null!=a&&null!=b){null==c&&(c=this.getChildCount(a));var d=a!=this.getParent(b);this.execute(new mxChildChange(this,a,b,c));this.maintainEdgeParent&&d&&this.updateEdgeParents(b)}return b};
|
|
mxGraphModel.prototype.cellAdded=function(a){if(null!=a){null==a.getId()&&this.createIds&&a.setId(this.createId(a));if(null!=a.getId()){var b=this.getCell(a.getId());if(b!=a){for(;null!=b;)a.setId(this.createId(a)),b=this.getCell(a.getId());null==this.cells&&(this.cells={});this.cells[a.getId()]=a}}mxUtils.isNumeric(a.getId())&&(this.nextId=Math.max(this.nextId,a.getId()));for(var b=this.getChildCount(a),c=0;c<b;c++)this.cellAdded(this.getChildAt(a,c))}};
|
|
mxGraphModel.prototype.createId=function(a){a=this.nextId;this.nextId++;return this.prefix+a+this.postfix};mxGraphModel.prototype.updateEdgeParents=function(a,b){b=b||this.getRoot(a);for(var c=this.getChildCount(a),d=0;d<c;d++){var e=this.getChildAt(a,d);this.updateEdgeParents(e,b)}e=this.getEdgeCount(a);c=[];for(d=0;d<e;d++)c.push(this.getEdgeAt(a,d));for(d=0;d<c.length;d++)e=c[d],this.isAncestor(b,e)&&this.updateEdgeParent(e,b)};
|
|
mxGraphModel.prototype.updateEdgeParent=function(a,b){for(var c=this.getTerminal(a,!0),d=this.getTerminal(a,!1),e=null;null!=c&&!this.isEdge(c)&&null!=c.geometry&&c.geometry.relative;)c=this.getParent(c);for(;null!=d&&this.ignoreRelativeEdgeParent&&!this.isEdge(d)&&null!=d.geometry&&d.geometry.relative;)d=this.getParent(d);if(this.isAncestor(b,c)&&this.isAncestor(b,d)&&(e=c==d?this.getParent(c):this.getNearestCommonAncestor(c,d),null!=e&&(this.getParent(e)!=this.root||this.isAncestor(e,a))&&this.getParent(a)!=
|
|
e)){c=this.getGeometry(a);if(null!=c){var f=this.getOrigin(this.getParent(a)),g=this.getOrigin(e),d=g.x-f.x,f=g.y-f.y,c=c.clone();c.translate(-d,-f);this.setGeometry(a,c)}this.add(e,a,this.getChildCount(e))}};mxGraphModel.prototype.getOrigin=function(a){var b=null;null!=a?(b=this.getOrigin(this.getParent(a)),this.isEdge(a)||(a=this.getGeometry(a),null!=a&&(b.x+=a.x,b.y+=a.y))):b=new mxPoint;return b};
|
|
mxGraphModel.prototype.getNearestCommonAncestor=function(a,b){if(null!=a&&null!=b){var c=mxCellPath.create(b);if(null!=c&&0<c.length){var d=a,e=mxCellPath.create(d);if(c.length<e.length)var d=b,f=e,e=c,c=f;for(;null!=d;){f=this.getParent(d);if(0==c.indexOf(e+mxCellPath.PATH_SEPARATOR)&&null!=f)return d;e=mxCellPath.getParentPath(e);d=f}}}return null};mxGraphModel.prototype.remove=function(a){a==this.root?this.setRoot(null):null!=this.getParent(a)&&this.execute(new mxChildChange(this,null,a));return a};
|
|
mxGraphModel.prototype.cellRemoved=function(a){if(null!=a&&null!=this.cells){for(var b=this.getChildCount(a)-1;0<=b;b--)this.cellRemoved(this.getChildAt(a,b));null!=this.cells&&null!=a.getId()&&delete this.cells[a.getId()]}};mxGraphModel.prototype.parentForCellChanged=function(a,b,c){var d=this.getParent(a);null!=b?(b!=d||d.getIndex(a)!=c)&&b.insert(a,c):null!=d&&(c=d.getIndex(a),d.remove(c));!this.contains(d)&&null!=b?this.cellAdded(a):null==b&&this.cellRemoved(a);return d};
|
|
mxGraphModel.prototype.getChildCount=function(a){return null!=a?a.getChildCount():0};mxGraphModel.prototype.getChildAt=function(a,b){return null!=a?a.getChildAt(b):null};mxGraphModel.prototype.getChildren=function(a){return null!=a?a.children:null};mxGraphModel.prototype.getChildVertices=function(a){return this.getChildCells(a,!0,!1)};mxGraphModel.prototype.getChildEdges=function(a){return this.getChildCells(a,!1,!0)};
|
|
mxGraphModel.prototype.getChildCells=function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!1;for(var d=this.getChildCount(a),e=[],f=0;f<d;f++){var g=this.getChildAt(a,f);(!c&&!b||c&&this.isEdge(g)||b&&this.isVertex(g))&&e.push(g)}return e};mxGraphModel.prototype.getTerminal=function(a,b){return null!=a?a.getTerminal(b):null};
|
|
mxGraphModel.prototype.setTerminal=function(a,b,c){var d=b!=this.getTerminal(a,c);this.execute(new mxTerminalChange(this,a,b,c));this.maintainEdgeParent&&d&&this.updateEdgeParent(a,this.getRoot());return b};mxGraphModel.prototype.setTerminals=function(a,b,c){this.beginUpdate();try{this.setTerminal(a,b,!0),this.setTerminal(a,c,!1)}finally{this.endUpdate()}};
|
|
mxGraphModel.prototype.terminalForCellChanged=function(a,b,c){var d=this.getTerminal(a,c);null!=b?b.insertEdge(a,c):null!=d&&d.removeEdge(a,c);return d};mxGraphModel.prototype.getEdgeCount=function(a){return null!=a?a.getEdgeCount():0};mxGraphModel.prototype.getEdgeAt=function(a,b){return null!=a?a.getEdgeAt(b):null};mxGraphModel.prototype.getDirectedEdgeCount=function(a,b,c){for(var d=0,e=this.getEdgeCount(a),f=0;f<e;f++){var g=this.getEdgeAt(a,f);g!=c&&this.getTerminal(g,b)==a&&d++}return d};
|
|
mxGraphModel.prototype.getConnections=function(a){return this.getEdges(a,!0,!0,!1)};mxGraphModel.prototype.getIncomingEdges=function(a){return this.getEdges(a,!0,!1,!1)};mxGraphModel.prototype.getOutgoingEdges=function(a){return this.getEdges(a,!1,!0,!1)};
|
|
mxGraphModel.prototype.getEdges=function(a,b,c,d){b=null!=b?b:!0;c=null!=c?c:!0;d=null!=d?d:!0;for(var e=this.getEdgeCount(a),f=[],g=0;g<e;g++){var h=this.getEdgeAt(a,g),k=this.getTerminal(h,!0),m=this.getTerminal(h,!1);(d&&k==m||k!=m&&(b&&m==a||c&&k==a))&&f.push(h)}return f};
|
|
mxGraphModel.prototype.getEdgesBetween=function(a,b,c){c=null!=c?c:!1;var d=this.getEdgeCount(a),e=this.getEdgeCount(b),f=a,g=d;e<d&&(g=e,f=b);d=[];for(e=0;e<g;e++){var h=this.getEdgeAt(f,e),k=this.getTerminal(h,!0),m=this.getTerminal(h,!1),l=m==a&&k==b;(k==a&&m==b||!c&&l)&&d.push(h)}return d};
|
|
mxGraphModel.prototype.getOpposites=function(a,b,c,d){c=null!=c?c:!0;d=null!=d?d:!0;var e=[];if(null!=a)for(var f=0;f<a.length;f++){var g=this.getTerminal(a[f],!0),h=this.getTerminal(a[f],!1);g==b&&null!=h&&h!=b&&d?e.push(h):h==b&&(null!=g&&g!=b&&c)&&e.push(g)}return e};
|
|
mxGraphModel.prototype.getTopmostCells=function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++)b.put(a[d],!0);for(d=0;d<a.length;d++){for(var e=a[d],f=!0,g=this.getParent(e);null!=g;){if(b.get(g)){f=!1;break}g=this.getParent(g)}f&&c.push(e)}return c};mxGraphModel.prototype.isVertex=function(a){return null!=a?a.isVertex():!1};mxGraphModel.prototype.isEdge=function(a){return null!=a?a.isEdge():!1};mxGraphModel.prototype.isConnectable=function(a){return null!=a?a.isConnectable():!1};
|
|
mxGraphModel.prototype.getValue=function(a){return null!=a?a.getValue():null};mxGraphModel.prototype.setValue=function(a,b){this.execute(new mxValueChange(this,a,b));return b};mxGraphModel.prototype.valueForCellChanged=function(a,b){return a.valueChanged(b)};mxGraphModel.prototype.getGeometry=function(a){return null!=a?a.getGeometry():null};mxGraphModel.prototype.setGeometry=function(a,b){b!=this.getGeometry(a)&&this.execute(new mxGeometryChange(this,a,b));return b};
|
|
mxGraphModel.prototype.geometryForCellChanged=function(a,b){var c=this.getGeometry(a);a.setGeometry(b);return c};mxGraphModel.prototype.getStyle=function(a){return null!=a?a.getStyle():null};mxGraphModel.prototype.setStyle=function(a,b){b!=this.getStyle(a)&&this.execute(new mxStyleChange(this,a,b));return b};mxGraphModel.prototype.styleForCellChanged=function(a,b){var c=this.getStyle(a);a.setStyle(b);return c};mxGraphModel.prototype.isCollapsed=function(a){return null!=a?a.isCollapsed():!1};
|
|
mxGraphModel.prototype.setCollapsed=function(a,b){b!=this.isCollapsed(a)&&this.execute(new mxCollapseChange(this,a,b));return b};mxGraphModel.prototype.collapsedStateForCellChanged=function(a,b){var c=this.isCollapsed(a);a.setCollapsed(b);return c};mxGraphModel.prototype.isVisible=function(a){return null!=a?a.isVisible():!1};mxGraphModel.prototype.setVisible=function(a,b){b!=this.isVisible(a)&&this.execute(new mxVisibleChange(this,a,b));return b};
|
|
mxGraphModel.prototype.visibleStateForCellChanged=function(a,b){var c=this.isVisible(a);a.setVisible(b);return c};mxGraphModel.prototype.execute=function(a){a.execute();this.beginUpdate();this.currentEdit.add(a);this.fireEvent(new mxEventObject(mxEvent.EXECUTE,"change",a));this.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",a));this.endUpdate()};mxGraphModel.prototype.beginUpdate=function(){this.updateLevel++;this.fireEvent(new mxEventObject(mxEvent.BEGIN_UPDATE));1==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.START_EDIT))};
|
|
mxGraphModel.prototype.endUpdate=function(){this.updateLevel--;0==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.END_EDIT));if(!this.endingUpdate){this.endingUpdate=0==this.updateLevel;this.fireEvent(new mxEventObject(mxEvent.END_UPDATE,"edit",this.currentEdit));try{if(this.endingUpdate&&!this.currentEdit.isEmpty()){this.fireEvent(new mxEventObject(mxEvent.BEFORE_UNDO,"edit",this.currentEdit));var a=this.currentEdit;this.currentEdit=this.createUndoableEdit();a.notify();this.fireEvent(new mxEventObject(mxEvent.UNDO,
|
|
"edit",a))}}finally{this.endingUpdate=!1}}};mxGraphModel.prototype.createUndoableEdit=function(){var a=new mxUndoableEdit(this,!0);a.notify=function(){a.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",a,"changes",a.changes));a.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",a,"changes",a.changes))};return a};
|
|
mxGraphModel.prototype.mergeChildren=function(a,b,c){c=null!=c?c:!0;this.beginUpdate();try{var d={};this.mergeChildrenImpl(a,b,c,d);for(var e in d){var f=d[e],g=this.getTerminal(f,!0);null!=g&&(g=d[mxCellPath.create(g)],this.setTerminal(f,g,!0));g=this.getTerminal(f,!1);null!=g&&(g=d[mxCellPath.create(g)],this.setTerminal(f,g,!1))}}finally{this.endUpdate()}};
|
|
mxGraphModel.prototype.mergeChildrenImpl=function(a,b,c,d){this.beginUpdate();try{for(var e=a.getChildCount(),f=0;f<e;f++){var g=a.getChildAt(f);if("function"==typeof g.getId){var h=g.getId(),k=null!=h&&(!this.isEdge(g)||!c)?this.getCell(h):null;if(null==k){var m=g.clone();m.setId(h);m.setTerminal(g.getTerminal(!0),!0);m.setTerminal(g.getTerminal(!1),!1);k=b.insert(m);this.cellAdded(k)}d[mxCellPath.create(g)]=k;this.mergeChildrenImpl(g,k,c,d)}}}finally{this.endUpdate()}};
|
|
mxGraphModel.prototype.getParents=function(a){var b=[];if(null!=a)for(var c=new mxDictionary,d=0;d<a.length;d++){var e=this.getParent(a[d]);null!=e&&!c.get(e)&&(c.put(e,!0),b.push(e))}return b};mxGraphModel.prototype.cloneCell=function(a){return null!=a?this.cloneCells([a],!0)[0]:null};
|
|
mxGraphModel.prototype.cloneCells=function(a,b,c){c=null!=c?c:{};for(var d=[],e=0;e<a.length;e++)null!=a[e]?d.push(this.cloneCellImpl(a[e],c,b)):d.push(null);for(e=0;e<d.length;e++)null!=d[e]&&this.restoreClone(d[e],a[e],c);return d};mxGraphModel.prototype.cloneCellImpl=function(a,b,c){var d=this.cellCloned(a);b[mxObjectIdentity.get(a)]=d;if(c){c=this.getChildCount(a);for(var e=0;e<c;e++){var f=this.cloneCellImpl(this.getChildAt(a,e),b,!0);d.insert(f)}}return d};
|
|
mxGraphModel.prototype.cellCloned=function(a){return a.clone()};mxGraphModel.prototype.restoreClone=function(a,b,c){var d=this.getTerminal(b,!0);null!=d&&(d=c[mxObjectIdentity.get(d)],null!=d&&d.insertEdge(a,!0));d=this.getTerminal(b,!1);null!=d&&(d=c[mxObjectIdentity.get(d)],null!=d&&d.insertEdge(a,!1));for(var d=this.getChildCount(a),e=0;e<d;e++)this.restoreClone(this.getChildAt(a,e),this.getChildAt(b,e),c)};function mxRootChange(a,b){this.model=a;this.previous=this.root=b}
|
|
mxRootChange.prototype.execute=function(){this.root=this.previous;this.previous=this.model.rootChanged(this.previous)};function mxChildChange(a,b,c,d){this.model=a;this.previous=this.parent=b;this.child=c;this.previousIndex=this.index=d}
|
|
mxChildChange.prototype.execute=function(){var a=this.model.getParent(this.child),b=null!=a?a.getIndex(this.child):0;null==this.previous&&this.connect(this.child,!1);a=this.model.parentForCellChanged(this.child,this.previous,this.previousIndex);null!=this.previous&&this.connect(this.child,!0);this.parent=this.previous;this.previous=a;this.index=this.previousIndex;this.previousIndex=b};
|
|
mxChildChange.prototype.connect=function(a,b){b=null!=b?b:!0;var c=a.getTerminal(!0),d=a.getTerminal(!1);null!=c&&(b?this.model.terminalForCellChanged(a,c,!0):this.model.terminalForCellChanged(a,null,!0));null!=d&&(b?this.model.terminalForCellChanged(a,d,!1):this.model.terminalForCellChanged(a,null,!1));a.setTerminal(c,!0);a.setTerminal(d,!1);c=this.model.getChildCount(a);for(d=0;d<c;d++)this.connect(this.model.getChildAt(a,d),b)};
|
|
function mxTerminalChange(a,b,c,d){this.model=a;this.cell=b;this.previous=this.terminal=c;this.source=d}mxTerminalChange.prototype.execute=function(){this.terminal=this.previous;this.previous=this.model.terminalForCellChanged(this.cell,this.previous,this.source)};function mxValueChange(a,b,c){this.model=a;this.cell=b;this.previous=this.value=c}mxValueChange.prototype.execute=function(){this.value=this.previous;this.previous=this.model.valueForCellChanged(this.cell,this.previous)};
|
|
function mxStyleChange(a,b,c){this.model=a;this.cell=b;this.previous=this.style=c}mxStyleChange.prototype.execute=function(){this.style=this.previous;this.previous=this.model.styleForCellChanged(this.cell,this.previous)};function mxGeometryChange(a,b,c){this.model=a;this.cell=b;this.previous=this.geometry=c}mxGeometryChange.prototype.execute=function(){this.geometry=this.previous;this.previous=this.model.geometryForCellChanged(this.cell,this.previous)};
|
|
function mxCollapseChange(a,b,c){this.model=a;this.cell=b;this.previous=this.collapsed=c}mxCollapseChange.prototype.execute=function(){this.collapsed=this.previous;this.previous=this.model.collapsedStateForCellChanged(this.cell,this.previous)};function mxVisibleChange(a,b,c){this.model=a;this.cell=b;this.previous=this.visible=c}mxVisibleChange.prototype.execute=function(){this.visible=this.previous;this.previous=this.model.visibleStateForCellChanged(this.cell,this.previous)};
|
|
function mxCellAttributeChange(a,b,c){this.cell=a;this.attribute=b;this.previous=this.value=c}mxCellAttributeChange.prototype.execute=function(){var a=this.cell.getAttribute(this.attribute);null==this.previous?this.cell.value.removeAttribute(this.attribute):this.cell.setAttribute(this.attribute,this.previous);this.previous=a};function mxCell(a,b,c){this.value=a;this.setGeometry(b);this.setStyle(c);if(null!=this.onInit)this.onInit()}mxCell.prototype.id=null;mxCell.prototype.value=null;
|
|
mxCell.prototype.geometry=null;mxCell.prototype.style=null;mxCell.prototype.vertex=!1;mxCell.prototype.edge=!1;mxCell.prototype.connectable=!0;mxCell.prototype.visible=!0;mxCell.prototype.collapsed=!1;mxCell.prototype.parent=null;mxCell.prototype.source=null;mxCell.prototype.target=null;mxCell.prototype.children=null;mxCell.prototype.edges=null;mxCell.prototype.mxTransient="id value parent source target children edges".split(" ");mxCell.prototype.getId=function(){return this.id};
|
|
mxCell.prototype.setId=function(a){this.id=a};mxCell.prototype.getValue=function(){return this.value};mxCell.prototype.setValue=function(a){this.value=a};mxCell.prototype.valueChanged=function(a){var b=this.getValue();this.setValue(a);return b};mxCell.prototype.getGeometry=function(){return this.geometry};mxCell.prototype.setGeometry=function(a){this.geometry=a};mxCell.prototype.getStyle=function(){return this.style};mxCell.prototype.setStyle=function(a){this.style=a};
|
|
mxCell.prototype.isVertex=function(){return 0!=this.vertex};mxCell.prototype.setVertex=function(a){this.vertex=a};mxCell.prototype.isEdge=function(){return 0!=this.edge};mxCell.prototype.setEdge=function(a){this.edge=a};mxCell.prototype.isConnectable=function(){return 0!=this.connectable};mxCell.prototype.setConnectable=function(a){this.connectable=a};mxCell.prototype.isVisible=function(){return 0!=this.visible};mxCell.prototype.setVisible=function(a){this.visible=a};
|
|
mxCell.prototype.isCollapsed=function(){return 0!=this.collapsed};mxCell.prototype.setCollapsed=function(a){this.collapsed=a};mxCell.prototype.getParent=function(){return this.parent};mxCell.prototype.setParent=function(a){this.parent=a};mxCell.prototype.getTerminal=function(a){return a?this.source:this.target};mxCell.prototype.setTerminal=function(a,b){b?this.source=a:this.target=a;return a};mxCell.prototype.getChildCount=function(){return null==this.children?0:this.children.length};
|
|
mxCell.prototype.getIndex=function(a){return mxUtils.indexOf(this.children,a)};mxCell.prototype.getChildAt=function(a){return null==this.children?null:this.children[a]};mxCell.prototype.insert=function(a,b){null!=a&&(null==b&&(b=this.getChildCount(),a.getParent()==this&&b--),a.removeFromParent(),a.setParent(this),null==this.children?(this.children=[],this.children.push(a)):this.children.splice(b,0,a));return a};
|
|
mxCell.prototype.remove=function(a){var b=null;null!=this.children&&0<=a&&(b=this.getChildAt(a),null!=b&&(this.children.splice(a,1),b.setParent(null)));return b};mxCell.prototype.removeFromParent=function(){if(null!=this.parent){var a=this.parent.getIndex(this);this.parent.remove(a)}};mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length};mxCell.prototype.getEdgeIndex=function(a){return mxUtils.indexOf(this.edges,a)};
|
|
mxCell.prototype.getEdgeAt=function(a){return null==this.edges?null:this.edges[a]};mxCell.prototype.insertEdge=function(a,b){if(null!=a&&(a.removeFromTerminal(b),a.setTerminal(this,b),null==this.edges||a.getTerminal(!b)!=this||0>mxUtils.indexOf(this.edges,a)))null==this.edges&&(this.edges=[]),this.edges.push(a);return a};mxCell.prototype.removeEdge=function(a,b){if(null!=a){if(a.getTerminal(!b)!=this&&null!=this.edges){var c=this.getEdgeIndex(a);0<=c&&this.edges.splice(c,1)}a.setTerminal(null,b)}return a};
|
|
mxCell.prototype.removeFromTerminal=function(a){var b=this.getTerminal(a);null!=b&&b.removeEdge(this,a)};mxCell.prototype.hasAttribute=function(a){var b=this.getValue();return null!=b&&b.nodeType==mxConstants.NODETYPE_ELEMENT?b.hasAttribute(a):!1};mxCell.prototype.getAttribute=function(a,b){var c=this.getValue();return(null!=c&&c.nodeType==mxConstants.NODETYPE_ELEMENT?c.getAttribute(a):null)||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(){var 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),d=Math.cos(c),c=Math.sin(c);if(!this.relative){var e=new mxPoint(this.getCenterX(),this.getCenterY()),e=mxUtils.getRotatedPoint(e,d,c,b);this.x=Math.round(e.x-this.width/2);this.y=Math.round(e.y-this.height/2)}null!=this.sourcePoint&&(e=mxUtils.getRotatedPoint(this.sourcePoint,d,c,b),this.sourcePoint.x=Math.round(e.x),this.sourcePoint.y=Math.round(e.y));null!=this.targetPoint&&(e=mxUtils.getRotatedPoint(this.targetPoint,d,c,b),this.targetPoint.x=
|
|
Math.round(e.x),this.targetPoint.y=Math.round(e.y));if(null!=this.points)for(var f=0;f<this.points.length;f++)null!=this.points[f]&&(e=mxUtils.getRotatedPoint(this.points[f],d,c,b),this.points[f].x=Math.round(e.x),this.points[f].y=Math.round(e.y))};
|
|
mxGeometry.prototype.translate=function(a,b){a=parseFloat(a);b=parseFloat(b);this.relative||(this.x=parseFloat(this.x)+a,this.y=parseFloat(this.y)+b);null!=this.sourcePoint&&(this.sourcePoint.x=parseFloat(this.sourcePoint.x)+a,this.sourcePoint.y=parseFloat(this.sourcePoint.y)+b);null!=this.targetPoint&&(this.targetPoint.x=parseFloat(this.targetPoint.x)+a,this.targetPoint.y=parseFloat(this.targetPoint.y)+b);if(this.TRANSLATE_CONTROL_POINTS&&null!=this.points)for(var c=0;c<this.points.length;c++)null!=
|
|
this.points[c]&&(this.points[c].x=parseFloat(this.points[c].x)+a,this.points[c].y=parseFloat(this.points[c].y)+b)};
|
|
mxGeometry.prototype.scale=function(a,b,c){a=parseFloat(a);b=parseFloat(b);null!=this.sourcePoint&&(this.sourcePoint.x=parseFloat(this.sourcePoint.x)*a,this.sourcePoint.y=parseFloat(this.sourcePoint.y)*b);null!=this.targetPoint&&(this.targetPoint.x=parseFloat(this.targetPoint.x)*a,this.targetPoint.y=parseFloat(this.targetPoint.y)*b);if(null!=this.points)for(var d=0;d<this.points.length;d++)null!=this.points[d]&&(this.points[d].x=parseFloat(this.points[d].x)*a,this.points[d].y=parseFloat(this.points[d].y)*
|
|
b);this.relative||(this.x=parseFloat(this.x)*a,this.y=parseFloat(this.y)*b,c&&(b=a=Math.min(a,b)),this.width=parseFloat(this.width)*a,this.height=parseFloat(this.height)*b)};
|
|
mxGeometry.prototype.equals=function(a){return mxRectangle.prototype.equals.apply(this,arguments)&&this.relative==a.relative&&(null==this.sourcePoint&&null==a.sourcePoint||null!=this.sourcePoint&&this.sourcePoint.equals(a.sourcePoint))&&(null==this.targetPoint&&null==a.targetPoint||null!=this.targetPoint&&this.targetPoint.equals(a.targetPoint))&&(null==this.points&&null==a.points||null!=this.points&&mxUtils.equalPoints(this.points,a.points))&&(null==this.alternateBounds&&null==a.alternateBounds||
|
|
null!=this.alternateBounds&&this.alternateBounds.equals(a.alternateBounds))&&(null==this.offset&&null==a.offset||null!=this.offset&&this.offset.equals(a.offset))};
|
|
var mxCellPath={PATH_SEPARATOR:".",create:function(a){var b="";if(null!=a)for(var c=a.getParent();null!=c;)b=c.getIndex(a)+mxCellPath.PATH_SEPARATOR+b,a=c,c=a.getParent();a=b.length;1<a&&(b=b.substring(0,a-1));return b},getParentPath:function(a){if(null!=a){var b=a.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(0<=b)return a.substring(0,b);if(0<a.length)return""}return null},resolve:function(a,b){var c=a;if(null!=b)for(var d=b.split(mxCellPath.PATH_SEPARATOR),e=0;e<d.length;e++)c=c.getChildAt(parseInt(d[e]));
|
|
return c},compare:function(a,b){for(var c=Math.min(a.length,b.length),d=0,e=0;e<c;e++)if(a[e]!=b[e]){0==a[e].length||0==b[e].length?d=a[e]==b[e]?0:a[e]>b[e]?1:-1:(c=parseInt(a[e]),e=parseInt(b[e]),d=c==e?0:c>e?1:-1);break}0==d&&(c=a.length,e=b.length,c!=e&&(d=c>e?1:-1));return d}},mxPerimeter={RectanglePerimeter:function(a,b,c,d){b=a.getCenterX();var e=a.getCenterY(),f=Math.atan2(c.y-e,c.x-b),g=new mxPoint(0,0),h=Math.PI,k=Math.PI/2-f,m=Math.atan2(a.height,a.width);f<-h+m||f>h-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(k)/2):f<m?(g.x=a.x+a.width,g.y=e+a.width*Math.tan(f)/2):(g.y=a.y+a.height,g.x=b+a.height*Math.tan(k)/2);d&&(c.x>=a.x&&c.x<=a.x+a.width?g.x=c.x:c.y>=a.y&&c.y<=a.y+a.height&&(g.y=c.y),c.x<a.x?g.x=a.x:c.x>a.x+a.width&&(g.x=a.x+a.width),c.y<a.y?g.y=a.y:c.y>a.y+a.height&&(g.y=a.y+a.height));return g},EllipsePerimeter:function(a,b,c,d){var e=a.x,f=a.y,g=a.width/2,h=a.height/2,k=e+g,m=f+h;b=c.x;c=c.y;var l=parseInt(b-k),n=parseInt(c-m);if(0==l&&0!=n)return new mxPoint(k,
|
|
m+h*n/Math.abs(n));if(0==l&&0==n)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/(h*h)))||0,b<=e&&(a=-a),new mxPoint(k+a,c);if(b>=e&&b<=e+a.width)return a=b-k,a=Math.sqrt(h*h*(1-a*a/(g*g)))||0,c<=f&&(a=-a),new mxPoint(b,m+a)}e=n/l;m-=e*k;f=g*g*e*e+h*h;a=-2*k*f;h=Math.sqrt(a*a-4*f*(g*g*e*e*k*k+h*h*k*k-g*g*h*h));g=(-a+h)/(2*f);h=(-a-h)/(2*f);k=e*g+m;m=e*h+m;e=Math.sqrt(Math.pow(g-b,2)+Math.pow(k-c,2));b=Math.sqrt(Math.pow(h-b,2)+Math.pow(m-c,2));f=c=0;e<b?(c=
|
|
g,f=k):(c=h,f=m);return new mxPoint(c,f)},RhombusPerimeter:function(a,b,c,d){b=a.x;var e=a.y,f=a.width;a=a.height;var g=b+f/2,h=e+a/2,k=c.x;c=c.y;if(g==k)return h>c?new mxPoint(g,e):new mxPoint(g,e+a);if(h==c)return g>k?new mxPoint(b,h):new mxPoint(b+f,h);var m=g,l=h;d&&(k>=b&&k<=b+f?m=k:c>=e&&c<=e+a&&(l=c));return k<g?c<h?mxUtils.intersection(k,c,m,l,g,e,b,h):mxUtils.intersection(k,c,m,l,g,e+a,b,h):c<h?mxUtils.intersection(k,c,m,l,g,e,b+f,h):mxUtils.intersection(k,c,m,l,g,e+a,b+f,h)},TrianglePerimeter:function(a,
|
|
b,c,d){b=null!=b?b.style[mxConstants.STYLE_DIRECTION]:null;var e=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH,f=a.x,g=a.y,h=a.width;a=a.height;var k=f+h/2,m=g+a/2,l=new mxPoint(f,g),n=new mxPoint(f+h,m),p=new mxPoint(f,g+a);b==mxConstants.DIRECTION_NORTH?(l=p,n=new mxPoint(k,g),p=new mxPoint(f+h,g+a)):b==mxConstants.DIRECTION_SOUTH?(n=new mxPoint(k,g+a),p=new mxPoint(f+h,g)):b==mxConstants.DIRECTION_WEST&&(l=new mxPoint(f+h,g),n=new mxPoint(f,m),p=new mxPoint(f+h,g+a));var r=c.x-
|
|
k,q=c.y-m,r=e?Math.atan2(r,q):Math.atan2(q,r),s=e?Math.atan2(h,a):Math.atan2(a,h),q=!1,q=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?r>-s&&r<s:r<-Math.PI+s||r>Math.PI-s,s=null;q?s=d&&(e&&c.x>=l.x&&c.x<=p.x||!e&&c.y>=l.y&&c.y<=p.y)?e?new mxPoint(c.x,l.y):new mxPoint(l.x,c.y):b==mxConstants.DIRECTION_NORTH?new mxPoint(f+h/2+a*Math.tan(r)/2,g+a):b==mxConstants.DIRECTION_SOUTH?new mxPoint(f+h/2-a*Math.tan(r)/2,g):b==mxConstants.DIRECTION_WEST?new mxPoint(f+h,g+a/2+h*Math.tan(r)/2):new mxPoint(f,
|
|
g+a/2-h*Math.tan(r)/2):(d&&(d=new mxPoint(k,m),c.y>=g&&c.y<=g+a?(d.x=e?k:b==mxConstants.DIRECTION_WEST?f+h:f,d.y=c.y):c.x>=f&&c.x<=f+h&&(d.x=c.x,d.y=!e?m:b==mxConstants.DIRECTION_NORTH?g+a:g),k=d.x,m=d.y),s=e&&c.x<=f+h/2||!e&&c.y<=g+a/2?mxUtils.intersection(c.x,c.y,k,m,l.x,l.y,n.x,n.y):mxUtils.intersection(c.x,c.y,k,m,n.x,n.y,p.x,p.y));null==s&&(s=new mxPoint(k,m));return s},HexagonPerimeter:function(a,b,c,d){var e=a.x,f=a.y,g=a.width,h=a.height,k=a.getCenterX();a=a.getCenterY();var m=c.x,l=c.y,n=
|
|
-Math.atan2(l-a,m-k),p=Math.PI,r=Math.PI/2,q=new mxPoint(k,a);b=null!=b?mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;var s=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH;b=new mxPoint;q=new mxPoint;if(m<e&&l<f||m<e&&l>f+h||m>e+g&&l<f||m>e+g&&l>f+h)d=!1;if(d){if(s){if(m==k){if(l<=f)return new mxPoint(k,f);if(l>=f+h)return new mxPoint(k,f+h)}else if(m<e){if(l==f+h/4)return new mxPoint(e,f+h/4);if(l==f+3*h/4)return new mxPoint(e,
|
|
f+3*h/4)}else if(m>e+g){if(l==f+h/4)return new mxPoint(e+g,f+h/4);if(l==f+3*h/4)return new mxPoint(e+g,f+3*h/4)}else if(m==e){if(l<a)return new mxPoint(e,f+h/4);if(l>a)return new mxPoint(e,f+3*h/4)}else if(m==e+g){if(l<a)return new mxPoint(e+g,f+h/4);if(l>a)return new mxPoint(e+g,f+3*h/4)}if(l==f)return new mxPoint(k,f);if(l==f+h)return new mxPoint(k,f+h);m<k?l>f+h/4&&l<f+3*h/4?(b=new mxPoint(e,f),q=new mxPoint(e,f+h)):l<f+h/4?(b=new mxPoint(e-Math.floor(0.5*g),f+Math.floor(0.5*h)),q=new mxPoint(e+
|
|
g,f-Math.floor(0.25*h))):l>f+3*h/4&&(b=new mxPoint(e-Math.floor(0.5*g),f+Math.floor(0.5*h)),q=new mxPoint(e+g,f+Math.floor(1.25*h))):m>k&&(l>f+h/4&&l<f+3*h/4?(b=new mxPoint(e+g,f),q=new mxPoint(e+g,f+h)):l<f+h/4?(b=new mxPoint(e,f-Math.floor(0.25*h)),q=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(0.5*h))):l>f+3*h/4&&(b=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(0.5*h)),q=new mxPoint(e,f+Math.floor(1.25*h))))}else{if(l==a){if(m<=e)return new mxPoint(e,f+h/2);if(m>=e+g)return new mxPoint(e+g,f+h/
|
|
2)}else if(l<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(l>f+h){if(m==e+g/4)return new mxPoint(e+g/4,f+h);if(m==e+3*g/4)return new mxPoint(e+3*g/4,f+h)}else if(l==f){if(m<k)return new mxPoint(e+g/4,f);if(m>k)return new mxPoint(e+3*g/4,f)}else if(l==f+h){if(m<k)return new mxPoint(e+g/4,f+h);if(l>a)return new mxPoint(e+3*g/4,f+h)}if(m==e)return new mxPoint(e,a);if(m==e+g)return new mxPoint(e+g,a);l<a?m>e+g/4&&m<e+3*g/4?(b=new mxPoint(e,f),q=new mxPoint(e+
|
|
g,f)):m<e+g/4?(b=new mxPoint(e-Math.floor(0.25*g),f+h),q=new mxPoint(e+Math.floor(0.5*g),f-Math.floor(0.5*h))):m>e+3*g/4&&(b=new mxPoint(e+Math.floor(0.5*g),f-Math.floor(0.5*h)),q=new mxPoint(e+Math.floor(1.25*g),f+h)):l>a&&(m>e+g/4&&m<e+3*g/4?(b=new mxPoint(e,f+h),q=new mxPoint(e+g,f+h)):m<e+g/4?(b=new mxPoint(e-Math.floor(0.25*g),f),q=new mxPoint(e+Math.floor(0.5*g),f+Math.floor(1.5*h))):m>e+3*g/4&&(b=new mxPoint(e+Math.floor(0.5*g),f+Math.floor(1.5*h)),q=new mxPoint(e+Math.floor(1.25*g),f)))}d=
|
|
k;n=a;m>=e&&m<=e+g?(d=m,n=l<a?f+h:f):l>=f&&l<=f+h&&(n=l,d=m<k?e+g:e);q=mxUtils.intersection(d,n,c.x,c.y,b.x,b.y,q.x,q.y)}else{if(s){m=Math.atan2(h/4,g/2);if(n==m)return new mxPoint(e+g,f+Math.floor(0.25*h));if(n==r)return new mxPoint(e+Math.floor(0.5*g),f);if(n==p-m)return new mxPoint(e,f+Math.floor(0.25*h));if(n==-m)return new mxPoint(e+g,f+Math.floor(0.75*h));if(n==-r)return new mxPoint(e+Math.floor(0.5*g),f+h);if(n==-p+m)return new mxPoint(e,f+Math.floor(0.75*h));n<m&&n>-m?(b=new mxPoint(e+g,f),
|
|
q=new mxPoint(e+g,f+h)):n>m&&n<r?(b=new mxPoint(e,f-Math.floor(0.25*h)),q=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(0.5*h))):n>r&&n<p-m?(b=new mxPoint(e-Math.floor(0.5*g),f+Math.floor(0.5*h)),q=new mxPoint(e+g,f-Math.floor(0.25*h))):n>p-m&&n<=p||n<-p+m&&n>=-p?(b=new mxPoint(e,f),q=new mxPoint(e,f+h)):n<-m&&n>-r?(b=new mxPoint(e+Math.floor(1.5*g),f+Math.floor(0.5*h)),q=new mxPoint(e,f+Math.floor(1.25*h))):n<-r&&n>-p+m&&(b=new mxPoint(e-Math.floor(0.5*g),f+Math.floor(0.5*h)),q=new mxPoint(e+g,f+
|
|
Math.floor(1.25*h)))}else{m=Math.atan2(h/2,g/4);if(n==m)return new mxPoint(e+Math.floor(0.75*g),f);if(n==p-m)return new mxPoint(e+Math.floor(0.25*g),f);if(n==p||n==-p)return new mxPoint(e,f+Math.floor(0.5*h));if(0==n)return new mxPoint(e+g,f+Math.floor(0.5*h));if(n==-m)return new mxPoint(e+Math.floor(0.75*g),f+h);if(n==-p+m)return new mxPoint(e+Math.floor(0.25*g),f+h);0<n&&n<m?(b=new mxPoint(e+Math.floor(0.5*g),f-Math.floor(0.5*h)),q=new mxPoint(e+Math.floor(1.25*g),f+h)):n>m&&n<p-m?(b=new mxPoint(e,
|
|
f),q=new mxPoint(e+g,f)):n>p-m&&n<p?(b=new mxPoint(e-Math.floor(0.25*g),f+h),q=new mxPoint(e+Math.floor(0.5*g),f-Math.floor(0.5*h))):0>n&&n>-m?(b=new mxPoint(e+Math.floor(0.5*g),f+Math.floor(1.5*h)),q=new mxPoint(e+Math.floor(1.25*g),f)):n<-m&&n>-p+m?(b=new mxPoint(e,f+h),q=new mxPoint(e+g,f+h)):n<-p+m&&n>-p&&(b=new mxPoint(e-Math.floor(0.25*g),f),q=new mxPoint(e+Math.floor(0.5*g),f+Math.floor(1.5*h)))}q=mxUtils.intersection(k,a,c.x,c.y,b.x,b.y,q.x,q.y)}return null==q?new mxPoint(k,a):q}};
|
|
function mxStylesheet(){this.styles={};this.putDefaultVertexStyle(this.createDefaultVertexStyle());this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}
|
|
mxStylesheet.prototype.createDefaultVertexStyle=function(){var a={};a[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE;a[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter;a[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE;a[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER;a[mxConstants.STYLE_FILLCOLOR]="#C3D9FF";a[mxConstants.STYLE_STROKECOLOR]="#6482B9";a[mxConstants.STYLE_FONTCOLOR]="#774400";return a};
|
|
mxStylesheet.prototype.createDefaultEdgeStyle=function(){var a={};a[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR;a[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC;a[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE;a[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER;a[mxConstants.STYLE_STROKECOLOR]="#6482B9";a[mxConstants.STYLE_FONTCOLOR]="#446299";return a};mxStylesheet.prototype.putDefaultVertexStyle=function(a){this.putCellStyle("defaultVertex",a)};
|
|
mxStylesheet.prototype.putDefaultEdgeStyle=function(a){this.putCellStyle("defaultEdge",a)};mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex};mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge};mxStylesheet.prototype.putCellStyle=function(a,b){this.styles[a]=b};
|
|
mxStylesheet.prototype.getCellStyle=function(a,b){var c=b;if(null!=a&&0<a.length)for(var d=a.split(";"),c=null!=c&&";"!=a.charAt(0)?mxUtils.clone(c):{},e=0;e<d.length;e++){var f=d[e],g=f.indexOf("\x3d");if(0<=g){var h=f.substring(0,g),f=f.substring(g+1);f==mxConstants.NONE?delete c[h]:mxUtils.isNumeric(f)?c[h]=parseFloat(f):c[h]=f}else if(f=this.styles[f],null!=f)for(h in f)c[h]=f[h]}return c};
|
|
function mxCellState(a,b,c){this.view=a;this.cell=b;this.style=c;this.origin=new mxPoint;this.absoluteOffset=new mxPoint}mxCellState.prototype=new mxRectangle;mxCellState.prototype.constructor=mxCellState;mxCellState.prototype.view=null;mxCellState.prototype.cell=null;mxCellState.prototype.style=null;mxCellState.prototype.invalid=!0;mxCellState.prototype.origin=null;mxCellState.prototype.absolutePoints=null;mxCellState.prototype.absoluteOffset=null;mxCellState.prototype.visibleSourceState=null;
|
|
mxCellState.prototype.visibleTargetState=null;mxCellState.prototype.terminalDistance=0;mxCellState.prototype.length=0;mxCellState.prototype.segments=null;mxCellState.prototype.shape=null;mxCellState.prototype.text=null;mxCellState.prototype.unscaledWidth=null;
|
|
mxCellState.prototype.getPerimeterBounds=function(a,b){a=a||0;b=null!=b?b:new mxRectangle(this.x,this.y,this.width,this.height);if(null!=this.shape&&null!=this.shape.stencil&&"fixed"==this.shape.stencil.aspect){var c=this.shape.stencil.computeAspect(this.style,b.x,b.y,b.width,b.height);b.x=c.x;b.y=c.y;b.width=this.shape.stencil.w0*c.width;b.height=this.shape.stencil.h0*c.height}0!=a&&b.grow(a);return b};
|
|
mxCellState.prototype.setAbsoluteTerminalPoint=function(a,b){b?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(a):this.absolutePoints[0]=a):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(a)):1==this.absolutePoints.length?this.absolutePoints.push(a):this.absolutePoints[this.absolutePoints.length-1]=a};
|
|
mxCellState.prototype.setCursor=function(a){null!=this.shape&&this.shape.setCursor(a);null!=this.text&&this.text.setCursor(a)};mxCellState.prototype.getVisibleTerminal=function(a){a=this.getVisibleTerminalState(a);return null!=a?a.cell:null};mxCellState.prototype.getVisibleTerminalState=function(a){return a?this.visibleSourceState:this.visibleTargetState};mxCellState.prototype.setVisibleTerminalState=function(a,b){b?this.visibleSourceState=a:this.visibleTargetState=a};
|
|
mxCellState.prototype.getCellBounds=function(){return this.cellBounds};mxCellState.prototype.getPaintBounds=function(){return this.paintBounds};mxCellState.prototype.updateCachedBounds=function(){var a=this.view.translate,b=this.view.scale;this.cellBounds=new mxRectangle(this.x/b-a.x,this.y/b-a.y,this.width/b,this.height/b);this.paintBounds=mxRectangle.fromRectangle(this.cellBounds);null!=this.shape&&this.shape.isPaintBoundsInverted()&&this.paintBounds.rotate90()};
|
|
mxCellState.prototype.setState=function(a){this.view=a.view;this.cell=a.cell;this.style=a.style;this.absolutePoints=a.absolutePoints;this.origin=a.origin;this.absoluteOffset=a.absoluteOffset;this.boundingBox=a.boundingBox;this.terminalDistance=a.terminalDistance;this.segments=a.segments;this.length=a.length;this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;this.unscaledWidth=a.unscaledWidth};
|
|
mxCellState.prototype.clone=function(){var a=new mxCellState(this.view,this.cell,this.style);if(null!=this.absolutePoints){a.absolutePoints=[];for(var b=0;b<this.absolutePoints.length;b++)a.absolutePoints[b]=this.absolutePoints[b].clone()}null!=this.origin&&(a.origin=this.origin.clone());null!=this.absoluteOffset&&(a.absoluteOffset=this.absoluteOffset.clone());null!=this.boundingBox&&(a.boundingBox=this.boundingBox.clone());a.terminalDistance=this.terminalDistance;a.segments=this.segments;a.length=
|
|
this.length;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;a.unscaledWidth=this.unscaledWidth;return a};mxCellState.prototype.destroy=function(){this.view.graph.cellRenderer.destroy(this)};function mxGraphSelectionModel(a){this.graph=a;this.cells=[]}mxGraphSelectionModel.prototype=new mxEventSource;mxGraphSelectionModel.prototype.constructor=mxGraphSelectionModel;mxGraphSelectionModel.prototype.doneResource="none"!=mxClient.language?"done":"";
|
|
mxGraphSelectionModel.prototype.updatingSelectionResource="none"!=mxClient.language?"updatingSelection":"";mxGraphSelectionModel.prototype.graph=null;mxGraphSelectionModel.prototype.singleSelection=!1;mxGraphSelectionModel.prototype.isSingleSelection=function(){return this.singleSelection};mxGraphSelectionModel.prototype.setSingleSelection=function(a){this.singleSelection=a};mxGraphSelectionModel.prototype.isSelected=function(a){return null!=a?0<=mxUtils.indexOf(this.cells,a):!1};
|
|
mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length};mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)};mxGraphSelectionModel.prototype.setCell=function(a){null!=a&&this.setCells([a])};mxGraphSelectionModel.prototype.setCells=function(a){if(null!=a){this.singleSelection&&(a=[this.getFirstSelectableCell(a)]);for(var b=[],c=0;c<a.length;c++)this.graph.isCellSelectable(a[c])&&b.push(a[c]);this.changeSelection(b,this.cells)}};
|
|
mxGraphSelectionModel.prototype.getFirstSelectableCell=function(a){if(null!=a)for(var b=0;b<a.length;b++)if(this.graph.isCellSelectable(a[b]))return a[b];return null};mxGraphSelectionModel.prototype.addCell=function(a){null!=a&&this.addCells([a])};
|
|
mxGraphSelectionModel.prototype.addCells=function(a){if(null!=a){var b=null;this.singleSelection&&(b=this.cells,a=[this.getFirstSelectableCell(a)]);for(var c=[],d=0;d<a.length;d++)!this.isSelected(a[d])&&this.graph.isCellSelectable(a[d])&&c.push(a[d]);this.changeSelection(c,b)}};mxGraphSelectionModel.prototype.removeCell=function(a){null!=a&&this.removeCells([a])};
|
|
mxGraphSelectionModel.prototype.removeCells=function(a){if(null!=a){for(var b=[],c=0;c<a.length;c++)this.isSelected(a[c])&&b.push(a[c]);this.changeSelection(null,b)}};mxGraphSelectionModel.prototype.changeSelection=function(a,b){if(null!=a&&0<a.length&&null!=a[0]||null!=b&&0<b.length&&null!=b[0]){var c=new mxSelectionChange(this,a,b);c.execute();var d=new mxUndoableEdit(this,!1);d.add(c);this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",d))}};
|
|
mxGraphSelectionModel.prototype.cellAdded=function(a){null!=a&&!this.isSelected(a)&&this.cells.push(a)};mxGraphSelectionModel.prototype.cellRemoved=function(a){null!=a&&(a=mxUtils.indexOf(this.cells,a),0<=a&&this.cells.splice(a,1))};function mxSelectionChange(a,b,c){this.selectionModel=a;this.added=null!=b?b.slice():null;this.removed=null!=c?c.slice():null}
|
|
mxSelectionChange.prototype.execute=function(){var a=mxLog.enter("mxSelectionChange.execute");window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource;if(null!=this.removed)for(var b=0;b<this.removed.length;b++)this.selectionModel.cellRemoved(this.removed[b]);if(null!=this.added)for(b=0;b<this.added.length;b++)this.selectionModel.cellAdded(this.added[b]);b=this.added;this.added=this.removed;this.removed=b;window.status=mxResources.get(this.selectionModel.doneResource)||
|
|
this.selectionModel.doneResource;mxLog.leave("mxSelectionChange.execute",a);this.selectionModel.fireEvent(new mxEventObject(mxEvent.CHANGE,"added",this.added,"removed",this.removed))};
|
|
function mxCellEditor(a){this.graph=a;this.zoomHandler=mxUtils.bind(this,function(){this.graph.isEditing()&&this.resize()});this.graph.view.addListener(mxEvent.SCALE,this.zoomHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.zoomHandler);this.changeHandler=mxUtils.bind(this,function(a){null!=this.editingCell&&null==this.graph.getView().getState(this.editingCell)&&this.stopEditing(!0)});this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)}
|
|
mxCellEditor.prototype.graph=null;mxCellEditor.prototype.textarea=null;mxCellEditor.prototype.editingCell=null;mxCellEditor.prototype.trigger=null;mxCellEditor.prototype.modified=!1;mxCellEditor.prototype.autoSize=!0;mxCellEditor.prototype.selectText=!0;mxCellEditor.prototype.emptyLabelText=mxClient.IS_FF?"\x3cbr\x3e":"";mxCellEditor.prototype.escapeCancelsEditing=!0;mxCellEditor.prototype.textNode="";mxCellEditor.prototype.zIndex=5;mxCellEditor.prototype.minResize=new mxRectangle(0,20);
|
|
mxCellEditor.prototype.wordWrapPadding=mxClient.IS_QUIRKS?2:!mxClient.IS_IE11?1:0;mxCellEditor.prototype.blurEnabled=!1;mxCellEditor.prototype.initialValue=null;mxCellEditor.prototype.init=function(){this.textarea=document.createElement("div");this.textarea.className="mxCellEditor mxPlainTextEditor";this.textarea.contentEditable=!0;this.installListeners(this.textarea)};mxCellEditor.prototype.applyValue=function(a,b){this.graph.labelChanged(a.cell,b,this.trigger)};
|
|
mxCellEditor.prototype.getInitialValue=function(a,b){var c=mxUtils.htmlEntities(this.graph.getEditingValue(a.cell,b),!1);!mxClient.IS_QUIRKS&&(8!=document.documentMode&&9!=document.documentMode&&10!=document.documentMode)&&(c=mxUtils.replaceTrailingNewlines(c,"\x3cdiv\x3e\x3cbr\x3e\x3c/div\x3e"));return c.replace(/\n/g,"\x3cbr\x3e")};
|
|
mxCellEditor.prototype.getCurrentValue=function(a){a=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<a.length&&"\n"==a.charAt(a.length-1)&&(a=a.substring(0,a.length-1));return a};
|
|
mxCellEditor.prototype.installListeners=function(a){mxEvent.addListener(a,"blur",mxUtils.bind(this,function(a){this.blurEnabled&&this.focusLost(a)}));mxEvent.addListener(a,"keydown",mxUtils.bind(this,function(a){mxEvent.isConsumed(a)||(this.isStopEditingEvent(a)?(this.graph.stopEditing(!1),mxEvent.consume(a)):27==a.keyCode&&(this.graph.stopEditing(this.escapeCancelsEditing||mxEvent.isShiftDown(a)),mxEvent.consume(a)))}));var b=mxUtils.bind(this,function(b){if(null!=this.editingCell&&this.clearOnChange&&
|
|
a.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||8!=b.keyCode&&46!=b.keyCode))this.clearOnChange=!1,a.innerHTML=""});mxEvent.addListener(a,"keypress",b);mxEvent.addListener(a,"paste",b);b=mxUtils.bind(this,function(a){null!=this.editingCell&&(0==this.textarea.innerHTML.length||"\x3cbr\x3e"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length):this.clearOnChange=!1)});mxEvent.addListener(a,!mxClient.IS_IE11&&!mxClient.IS_IE?
|
|
"input":"keyup",b);mxEvent.addListener(a,"cut",b);mxEvent.addListener(a,"paste",b);var b=!mxClient.IS_IE11&&!mxClient.IS_IE?"input":"keydown",c=mxUtils.bind(this,function(a){null!=this.editingCell&&(this.autoSize&&!mxEvent.isConsumed(a))&&(null!=this.resizeThread&&window.clearTimeout(this.resizeThread),this.resizeThread=window.setTimeout(mxUtils.bind(this,function(){this.resizeThread=null;this.resize()}),0))});mxEvent.addListener(a,b,c);9<=document.documentMode?(mxEvent.addListener(a,"DOMNodeRemoved",
|
|
c),mxEvent.addListener(a,"DOMNodeInserted",c)):(mxEvent.addListener(a,"cut",c),mxEvent.addListener(a,"paste",c))};mxCellEditor.prototype.isStopEditingEvent=function(a){return 113==a.keyCode||this.graph.isEnterStopsCellEditing()&&13==a.keyCode&&!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)};mxCellEditor.prototype.isEventSource=function(a){return mxEvent.getSource(a)==this.textarea};
|
|
mxCellEditor.prototype.resize=function(){var a=this.graph.getView().getState(this.editingCell);if(null==a)this.stopEditing(!0);else if(null!=this.textarea){var b=this.graph.getModel().isEdge(a.cell),c=this.graph.getView().scale,d=null;if(!this.autoSize||"fill"==a.style[mxConstants.STYLE_OVERFLOW])this.bounds=this.getEditorBounds(a),this.textarea.style.width=Math.round(this.bounds.width/c)+"px",this.textarea.style.height=Math.round(this.bounds.height/c)+"px",8==document.documentMode||mxClient.IS_QUIRKS?
|
|
(this.textarea.style.left=Math.round(this.bounds.x)+"px",this.textarea.style.top=Math.round(this.bounds.y)+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x+1))+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y+1))+"px"),this.graph.isWrapping(a.cell)&&(2<=this.bounds.width||2<=this.bounds.height)&&this.textarea.innerHTML!=this.getEmptyLabelText()?(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal","fill"!=a.style[mxConstants.STYLE_OVERFLOW]&&
|
|
(this.textarea.style.width=Math.round(this.bounds.width/c)+this.wordWrapPadding+"px")):(this.textarea.style.whiteSpace="nowrap","fill"!=a.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=""));else{var e=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null),d=null!=a.text?a.text.margin:null;null==d&&(d=mxUtils.getAlignmentAsPoint(mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));
|
|
if(b)this.bounds=new mxRectangle(a.absoluteOffset.x,a.absoluteOffset.y,0,0),null!=e&&(e=(parseFloat(e)+2)*c,this.bounds.width=e,this.bounds.x+=d.x*e);else{var b=mxRectangle.fromRectangle(a),f=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),g=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),b=null!=a.shape&&f==mxConstants.ALIGN_CENTER&&g==mxConstants.ALIGN_MIDDLE?a.shape.getLabelBounds(b):b;null!=e&&(b.width=parseFloat(e)*
|
|
c);if(!a.view.graph.cellRenderer.legacySpacing||"width"!=a.style[mxConstants.STYLE_OVERFLOW])var f=parseInt(a.style[mxConstants.STYLE_SPACING]||2)*c,h=(parseInt(a.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*c+f,k=(parseInt(a.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*c+f,m=(parseInt(a.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*c+f,l=(parseInt(a.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*
|
|
c+f,f=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),g=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),b=new mxRectangle(b.x+l,b.y+h,b.width-(f==mxConstants.ALIGN_CENTER&&null==e?l+k:0),b.height-(g==mxConstants.ALIGN_MIDDLE?h+m:0));this.bounds=new mxRectangle(b.x+a.absoluteOffset.x,b.y+a.absoluteOffset.y,b.width,b.height)}this.graph.isWrapping(a.cell)&&(2<=this.bounds.width||2<=this.bounds.height)&&this.textarea.innerHTML!=
|
|
this.getEmptyLabelText()?(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal",e=Math.round(this.bounds.width/c)+this.wordWrapPadding,this.textarea.style.width=e+"px",this.textarea.scrollWidth>e&&(this.textarea.style.width=this.textarea.scrollWidth+"px")):(this.textarea.style.whiteSpace="nowrap",this.textarea.style.width="");8==document.documentMode&&(this.textarea.style.zoom="1",this.textarea.style.height="auto");a=this.textarea.scrollWidth;e=this.textarea.scrollHeight;
|
|
8==document.documentMode?(this.textarea.style.left=Math.max(0,Math.ceil((this.bounds.x-d.x*(this.bounds.width-(a+1)*c)+0*a*(c-1)+2*(d.x+0.5))/c))+"px",this.textarea.style.top=Math.max(0,Math.ceil((this.bounds.y-d.y*(this.bounds.height-(e+0.5)*c)+0*e*(c-1)+1*Math.abs(d.y+0.5))/c))+"px",this.textarea.style.width=Math.round(a*c)+"px",this.textarea.style.height=Math.round(e*c)+"px"):mxClient.IS_QUIRKS?(this.textarea.style.left=Math.max(0,Math.ceil(this.bounds.x-d.x*(this.bounds.width-(a+1)*c)+0*a*(c-
|
|
1)+2*(d.x+0.5)))+"px",this.textarea.style.top=Math.max(0,Math.ceil(this.bounds.y-d.y*(this.bounds.height-(e+0.5)*c)+0*e*(c-1)+1*Math.abs(d.y+0.5)))+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-d.x*(this.bounds.width-2))+1)+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-d.y*(this.bounds.height-4)+(-1==d.y?3:0))+1)+"px")}mxClient.IS_VML?this.textarea.style.zoom=c:(mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px"),mxUtils.setPrefixedStyle(this.textarea.style,
|
|
"transform","scale("+c+","+c+")"+(null==d?"":" translate("+100*d.x+"%,"+100*d.y+"%)")))}};mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())};mxCellEditor.prototype.getBackgroundColor=function(a){return null};
|
|
mxCellEditor.prototype.startEditing=function(a,b){null==this.textarea&&this.init();null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.hideTooltip();this.stopEditing(!0);var c=this.graph.getView().getState(a);if(null!=c){this.graph.getView();var d=mxUtils.getValue(c.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),e=mxUtils.getValue(c.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),f=mxUtils.getValue(c.style,mxConstants.STYLE_FONTCOLOR,"black"),g=mxUtils.getValue(c.style,
|
|
mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),h=(mxUtils.getValue(c.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,k=(mxUtils.getValue(c.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,m=(mxUtils.getValue(c.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(d*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;
|
|
this.textarea.style.backgroundColor=this.getBackgroundColor(c);this.textarea.style.textDecoration=m?"underline":"";this.textarea.style.fontWeight=h?"bold":"normal";this.textarea.style.fontStyle=k?"italic":"";this.textarea.style.fontSize=Math.round(d)+"px";this.textarea.style.zIndex=this.zIndex;this.textarea.style.fontFamily=e;this.textarea.style.textAlign=g;this.textarea.style.outline="none";this.textarea.style.color=f;d=this.textDirection=mxUtils.getValue(c.style,mxConstants.STYLE_TEXT_DIRECTION,
|
|
mxConstants.DEFAULT_TEXT_DIRECTION);d==mxConstants.TEXT_DIRECTION_AUTO&&null!=c&&(null!=c.text&&c.text.dialect!=mxConstants.DIALECT_STRICTHTML&&!mxUtils.isNode(c.text.value))&&(d=c.text.getAutoDirection());d==mxConstants.TEXT_DIRECTION_LTR||d==mxConstants.TEXT_DIRECTION_RTL?this.textarea.setAttribute("dir",d):this.textarea.removeAttribute("dir");this.textarea.innerHTML=this.getInitialValue(c,b)||"";this.initialValue=this.textarea.innerHTML;0==this.textarea.innerHTML.length||"\x3cbr\x3e"==this.textarea.innerHTML?
|
|
(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=this.textarea.innerHTML==this.getEmptyLabelText();this.graph.container.appendChild(this.textarea);this.editingCell=a;this.trigger=b;this.textNode=null;null!=c.text&&this.isHideLabel(c)&&(this.textNode=c.text.node,this.textNode.style.visibility="hidden");this.autoSize&&(this.graph.model.isEdge(c.cell)||"fill"!=c.style[mxConstants.STYLE_OVERFLOW])&&window.setTimeout(mxUtils.bind(this,function(){this.resize()}),
|
|
0);this.resize();try{this.textarea.focus(),this.isSelectText()&&(0<this.textarea.innerHTML.length&&(this.textarea.innerHTML!=this.getEmptyLabelText()||!this.clearOnChange))&&document.execCommand("selectAll",!1,null)}catch(l){}}};mxCellEditor.prototype.isSelectText=function(){return this.selectText};
|
|
mxCellEditor.prototype.stopEditing=function(a){if(null!=this.editingCell){null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null);a=!a?this.graph.view.getState(this.editingCell):null;var b=this.initialValue;this.bounds=this.trigger=this.editingCell=this.initialValue=null;this.textarea.blur();null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea);this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.textarea.innerHTML="",
|
|
this.clearOnChange=!1);null!=a&&this.textarea.innerHTML!=b&&(b=this.getCurrentValue(a),null!=b&&this.applyValue(a,b));mxEvent.release(this.textarea);this.textarea=null}};mxCellEditor.prototype.isHideLabel=function(a){return!0};mxCellEditor.prototype.getMinimumSize=function(a){var b=this.graph.getView().scale;return new mxRectangle(0,0,null==a.text?30:a.text.size*b+20,"left"==this.textarea.style.textAlign?120:40)};
|
|
mxCellEditor.prototype.getEditorBounds=function(a){var b=this.graph.getModel().isEdge(a.cell),c=this.graph.getView().scale,d=this.getMinimumSize(a),e=d.width,d=d.height,f=null;if(!b&&a.view.graph.cellRenderer.legacySpacing&&"fill"==a.style[mxConstants.STYLE_OVERFLOW])f=a.shape.getLabelBounds(mxRectangle.fromRectangle(a));else{var g=parseInt(a.style[mxConstants.STYLE_SPACING]||0)*c,h=(parseInt(a.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*c+g,f=(parseInt(a.style[mxConstants.STYLE_SPACING_RIGHT]||
|
|
0)+mxText.prototype.baseSpacingRight)*c+g,k=(parseInt(a.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*c+g,c=(parseInt(a.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*c+g,f=new mxRectangle(a.x,a.y,Math.max(e,a.width-c-f),Math.max(d,a.height-h-k)),k=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),g=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),f=null!=a.shape&&
|
|
k==mxConstants.ALIGN_CENTER&&g==mxConstants.ALIGN_MIDDLE?a.shape.getLabelBounds(f):f;b?(f.x=a.absoluteOffset.x,f.y=a.absoluteOffset.y,null!=a.text&&null!=a.text.boundingBox&&(0<a.text.boundingBox.x&&(f.x=a.text.boundingBox.x),0<a.text.boundingBox.y&&(f.y=a.text.boundingBox.y))):null!=a.text&&null!=a.text.boundingBox&&(f.x=Math.min(f.x,a.text.boundingBox.x),f.y=Math.min(f.y,a.text.boundingBox.y));f.x+=c;f.y+=h;null!=a.text&&null!=a.text.boundingBox&&(b?(f.width=Math.max(e,a.text.boundingBox.width),
|
|
f.height=Math.max(d,a.text.boundingBox.height)):(f.width=Math.max(f.width,a.text.boundingBox.width),f.height=Math.max(f.height,a.text.boundingBox.height)));this.graph.getModel().isVertex(a.cell)&&(b=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),b==mxConstants.ALIGN_LEFT?f.x-=a.width:b==mxConstants.ALIGN_RIGHT&&(f.x+=a.width),b=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),b==mxConstants.ALIGN_TOP?f.y-=a.height:b==
|
|
mxConstants.ALIGN_BOTTOM&&(f.y+=a.height))}return new mxRectangle(Math.round(f.x),Math.round(f.y),Math.round(f.width),Math.round(f.height))};mxCellEditor.prototype.getEmptyLabelText=function(a){return this.emptyLabelText};mxCellEditor.prototype.getEditingCell=function(){return this.editingCell};
|
|
mxCellEditor.prototype.destroy=function(){null!=this.textarea&&(mxEvent.release(this.textarea),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);this.zoomHandler&&(this.graph.view.removeListener(this.zoomHandler),this.zoomHandler=null)};function mxCellRenderer(){}mxCellRenderer.prototype.defaultEdgeShape=mxConnector;
|
|
mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape;mxCellRenderer.prototype.defaultTextShape=mxText;mxCellRenderer.prototype.legacyControlPosition=!0;mxCellRenderer.prototype.legacySpacing=!0;mxCellRenderer.prototype.defaultShapes={};mxCellRenderer.prototype.antiAlias=!0;mxCellRenderer.prototype.forceControlClickHandler=!1;mxCellRenderer.registerShape=function(a,b){mxCellRenderer.prototype.defaultShapes[a]=b};mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape);
|
|
mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse);mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus);mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder);mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector);mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor);mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle);mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon);
|
|
mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud);mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine);mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow);mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW_CONNECTOR,mxArrowConnector);mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse);mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane);mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape);
|
|
mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel);mxCellRenderer.prototype.initializeShape=function(a){a.shape.dialect=a.view.graph.dialect;this.configureShape(a);a.shape.init(a.view.getDrawPane())};mxCellRenderer.prototype.createShape=function(a){var b=null;null!=a.style&&(b=mxStencilRegistry.getStencil(a.style[mxConstants.STYLE_SHAPE]),b=null!=b?new mxShape(b):new (this.getShapeConstructor(a)));return b};
|
|
mxCellRenderer.prototype.createIndicatorShape=function(a){a.shape.indicatorShape=this.getShape(a.view.graph.getIndicatorShape(a))};mxCellRenderer.prototype.getShape=function(a){return null!=a?mxCellRenderer.prototype.defaultShapes[a]:null};mxCellRenderer.prototype.getShapeConstructor=function(a){var b=this.getShape(a.style[mxConstants.STYLE_SHAPE]);null==b&&(b=a.view.graph.getModel().isEdge(a.cell)?this.defaultEdgeShape:this.defaultVertexShape);return b};
|
|
mxCellRenderer.prototype.configureShape=function(a){a.shape.apply(a);a.shape.image=a.view.graph.getImage(a);a.shape.indicatorColor=a.view.graph.getIndicatorColor(a);a.shape.indicatorStrokeColor=a.style[mxConstants.STYLE_INDICATOR_STROKECOLOR];a.shape.indicatorGradientColor=a.view.graph.getIndicatorGradientColor(a);a.shape.indicatorDirection=a.style[mxConstants.STYLE_INDICATOR_DIRECTION];a.shape.indicatorImage=a.view.graph.getIndicatorImage(a);this.postConfigureShape(a)};
|
|
mxCellRenderer.prototype.postConfigureShape=function(a){null!=a.shape&&(this.resolveColor(a,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(a,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(a,"fill",mxConstants.STYLE_FILLCOLOR),this.resolveColor(a,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(a,"gradient",mxConstants.STYLE_GRADIENTCOLOR))};
|
|
mxCellRenderer.prototype.resolveColor=function(a,b,c){var d=a.shape[b],e=a.view.graph,f=null;"inherit"==d?f=e.model.getParent(a.cell):"swimlane"==d?(f=null!=e.model.getTerminal(a.cell,!1)?e.model.getTerminal(a.cell,!1):a.cell,f=e.getSwimlane(f),c=e.swimlaneIndicatorColorAttribute):"indicated"==d&&(a.shape[b]=a.shape.indicatorColor);null!=f&&(d=e.getView().getState(f),a.shape[b]=null,null!=d&&(a.shape[b]=null!=d.shape&&"indicatorColor"!=b?d.shape[b]:d.style[c]))};
|
|
mxCellRenderer.prototype.getLabelValue=function(a){return a.view.graph.getLabel(a.cell)};
|
|
mxCellRenderer.prototype.createLabel=function(a,b){var c=a.view.graph;c.getModel().isEdge(a.cell);if(0<a.style[mxConstants.STYLE_FONTSIZE]||null==a.style[mxConstants.STYLE_FONTSIZE]){var d=c.isHtmlLabel(a.cell)||null!=b&&mxUtils.isNode(b);a.text=new this.defaultTextShape(b,new mxRectangle,a.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,c.getVerticalAlign(a),a.style[mxConstants.STYLE_FONTCOLOR],a.style[mxConstants.STYLE_FONTFAMILY],a.style[mxConstants.STYLE_FONTSIZE],a.style[mxConstants.STYLE_FONTSTYLE],
|
|
a.style[mxConstants.STYLE_SPACING],a.style[mxConstants.STYLE_SPACING_TOP],a.style[mxConstants.STYLE_SPACING_RIGHT],a.style[mxConstants.STYLE_SPACING_BOTTOM],a.style[mxConstants.STYLE_SPACING_LEFT],a.style[mxConstants.STYLE_HORIZONTAL],a.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],a.style[mxConstants.STYLE_LABEL_BORDERCOLOR],c.isWrapping(a.cell)&&c.isHtmlLabel(a.cell),c.isLabelClipped(a.cell),a.style[mxConstants.STYLE_OVERFLOW],a.style[mxConstants.STYLE_LABEL_PADDING],mxUtils.getValue(a.style,mxConstants.STYLE_TEXT_DIRECTION,
|
|
mxConstants.DEFAULT_TEXT_DIRECTION));a.text.opacity=mxUtils.getValue(a.style,mxConstants.STYLE_TEXT_OPACITY,100);a.text.dialect=d?mxConstants.DIALECT_STRICTHTML:a.view.graph.dialect;a.text.style=a.style;a.text.state=a;this.initializeLabel(a,a.text);var e=!1,f=function(b){var d=a;if(mxClient.IS_TOUCH||e)d=mxEvent.getClientX(b),b=mxEvent.getClientY(b),b=mxUtils.convertPoint(c.container,d,b),d=c.view.getState(c.getCellAt(b.x,b.y));return d};mxEvent.addGestureListeners(a.text.node,mxUtils.bind(this,function(b){this.isLabelEvent(a,
|
|
b)&&(c.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(b,a)),e=c.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(b).nodeName)}),mxUtils.bind(this,function(b){this.isLabelEvent(a,b)&&c.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(b,f(b)))}),mxUtils.bind(this,function(b){this.isLabelEvent(a,b)&&(c.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(b,f(b))),e=!1)}));c.nativeDblClickEnabled&&mxEvent.addListener(a.text.node,"dblclick",mxUtils.bind(this,function(b){this.isLabelEvent(a,
|
|
b)&&(c.dblClick(b,a.cell),mxEvent.consume(b))}))}};mxCellRenderer.prototype.initializeLabel=function(a,b){mxClient.IS_SVG&&mxClient.NO_FO&&b.dialect!=mxConstants.DIALECT_SVG?b.init(a.view.graph.container):b.init(a.view.getDrawPane())};
|
|
mxCellRenderer.prototype.createCellOverlays=function(a){var b=a.view.graph.getCellOverlays(a.cell),c=null;if(null!=b)for(var c=new mxDictionary,d=0;d<b.length;d++){var e=null!=a.overlays?a.overlays.remove(b[d]):null;null==e&&(e=new mxImageShape(new mxRectangle,b[d].image.src),e.dialect=a.view.graph.dialect,e.preserveImageAspect=!1,e.overlay=b[d],this.initializeOverlay(a,e),this.installCellOverlayListeners(a,b[d],e),null!=b[d].cursor&&(e.node.style.cursor=b[d].cursor));c.put(b[d],e)}null!=a.overlays&&
|
|
a.overlays.visit(function(a,b){b.destroy()});a.overlays=c};mxCellRenderer.prototype.initializeOverlay=function(a,b){b.init(a.view.getOverlayPane())};
|
|
mxCellRenderer.prototype.installCellOverlayListeners=function(a,b,c){var d=a.view.graph;mxEvent.addListener(c.node,"click",function(c){d.isEditing()&&d.stopEditing(!d.isInvokesStopCellEditing());b.fireEvent(new mxEventObject(mxEvent.CLICK,"event",c,"cell",a.cell))});mxEvent.addGestureListeners(c.node,function(a){mxEvent.consume(a)},function(b){d.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(b,a))});mxClient.IS_TOUCH&&mxEvent.addListener(c.node,"touchend",function(c){b.fireEvent(new mxEventObject(mxEvent.CLICK,
|
|
"event",c,"cell",a.cell))})};mxCellRenderer.prototype.createControl=function(a){var b=a.view.graph,c=b.getFoldingImage(a);if(b.foldingEnabled&&null!=c){if(null==a.control){var d=new mxRectangle(0,0,c.width,c.height);a.control=new mxImageShape(d,c.src);a.control.preserveImageAspect=!1;a.control.dialect=b.dialect;this.initControl(a,a.control,!0,this.createControlClickHandler(a))}}else null!=a.control&&(a.control.destroy(),a.control=null)};
|
|
mxCellRenderer.prototype.createControlClickHandler=function(a){var b=a.view.graph;return mxUtils.bind(this,function(c){if(this.forceControlClickHandler||b.isEnabled()){var d=!b.isCellCollapsed(a.cell);b.foldCells(d,!1,[a.cell],null,c);mxEvent.consume(c)}})};
|
|
mxCellRenderer.prototype.initControl=function(a,b,c,d){var e=a.view.graph;e.isHtmlLabel(a.cell)&&mxClient.NO_FO&&e.dialect==mxConstants.DIALECT_SVG?(b.dialect=mxConstants.DIALECT_PREFERHTML,b.init(e.container),b.node.style.zIndex=1):b.init(a.view.getOverlayPane());b=b.innerNode||b.node;null!=d&&!mxClient.IS_IOS&&(e.isEnabled()&&(b.style.cursor="pointer"),mxEvent.addListener(b,"click",d));if(c){var f=null;mxEvent.addGestureListeners(b,function(b){f=new mxPoint(mxEvent.getClientX(b),mxEvent.getClientY(b));
|
|
e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(b,a));mxEvent.consume(b)},function(b){e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(b,a))},function(b){e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(b,a));mxEvent.consume(b)});null!=d&&mxClient.IS_IOS&&b.addEventListener("touchend",function(a){if(null!=f){var b=e.tolerance;Math.abs(f.x-mxEvent.getClientX(a))<b&&Math.abs(f.y-mxEvent.getClientY(a))<b&&(d.call(d,a),mxEvent.consume(a))}},!0)}return b};
|
|
mxCellRenderer.prototype.isShapeEvent=function(a,b){return!0};mxCellRenderer.prototype.isLabelEvent=function(a,b){return!0};
|
|
mxCellRenderer.prototype.installListeners=function(a){var b=a.view.graph,c=function(c){var e=a;if(b.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(c).nodeName||mxClient.IS_TOUCH)e=mxEvent.getClientX(c),c=mxEvent.getClientY(c),c=mxUtils.convertPoint(b.container,e,c),e=b.view.getState(b.getCellAt(c.x,c.y));return e};mxEvent.addGestureListeners(a.shape.node,mxUtils.bind(this,function(c){this.isShapeEvent(a,c)&&b.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(c,a))}),mxUtils.bind(this,
|
|
function(d){this.isShapeEvent(a,d)&&b.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(d,c(d)))}),mxUtils.bind(this,function(d){this.isShapeEvent(a,d)&&b.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(d,c(d)))}));b.nativeDblClickEnabled&&mxEvent.addListener(a.shape.node,"dblclick",mxUtils.bind(this,function(c){this.isShapeEvent(a,c)&&(b.dblClick(c,a.cell),mxEvent.consume(c))}))};
|
|
mxCellRenderer.prototype.redrawLabel=function(a,b){var c=this.getLabelValue(a);if(null==a.text&&null!=c&&(mxUtils.isNode(c)||0<c.length))this.createLabel(a,c);else if(null!=a.text&&(null==c||0==c.length))a.text.destroy(),a.text=null;if(null!=a.text){var d=a.view.graph;b&&(null!=a.text.lastValue&&this.isTextShapeInvalid(a,a.text)&&(a.text.lastValue=null),a.text.resetStyles(),a.text.apply(a),a.text.opacity=mxUtils.getValue(a.style,mxConstants.STYLE_TEXT_OPACITY,100));var e=this.getLabelBounds(a),f=
|
|
d.isWrapping(a.cell),d=d.isLabelClipped(a.cell),g=a.view.graph.isHtmlLabel(a.cell)||null!=c&&mxUtils.isNode(c)?mxConstants.DIALECT_STRICTHTML:a.view.graph.dialect,h=a.style[mxConstants.STYLE_OVERFLOW]||"visible";if(b||a.text.value!=c||a.text.isWrapping!=f||a.text.overflow!=h||a.text.isClipping!=d||a.text.scale!=this.getTextScale(a)||a.text.dialect!=g||!a.text.bounds.equals(e))a.text.dialect=g,a.text.value=c,a.text.bounds=e,a.text.scale=this.getTextScale(a),a.text.wrap=f,a.text.clipped=d,a.text.overflow=
|
|
h,c=a.text.node.style.visibility,this.redrawLabelShape(a.text),a.text.node.style.visibility=c}};
|
|
mxCellRenderer.prototype.isTextShapeInvalid=function(a,b){function c(c,e,f){return b[c]!=(a.style[e]||f)}return c("fontStyle",mxConstants.STYLE_FONTSTYLE,mxConstants.DEFAULT_FONTSTYLE)||c("family",mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)||c("size",mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)||c("color",mxConstants.STYLE_FONTCOLOR,"black")||c("align",mxConstants.STYLE_ALIGN,"")||c("valign",mxConstants.STYLE_VERTICAL_ALIGN,"")||c("spacing",mxConstants.STYLE_SPACING,2)||
|
|
c("spacingTop",mxConstants.STYLE_SPACING_TOP,2)||c("spacingRight",mxConstants.STYLE_SPACING_RIGHT,2)||c("spacingBottom",mxConstants.STYLE_SPACING_BOTTOM,2)||c("spacingLeft",mxConstants.STYLE_SPACING_LEFT,2)||c("horizontal",mxConstants.STYLE_HORIZONTAL,!0)||c("background",mxConstants.STYLE_LABEL_BACKGROUNDCOLOR)||c("border",mxConstants.STYLE_LABEL_BORDERCOLOR)||c("opacity",mxConstants.STYLE_TEXT_OPACITY,100)||c("textDirection",mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)};
|
|
mxCellRenderer.prototype.redrawLabelShape=function(a){a.redraw()};mxCellRenderer.prototype.getTextScale=function(a){return a.view.scale};
|
|
mxCellRenderer.prototype.getLabelBounds=function(a){var b=a.view.graph,c=a.view.scale,d=b.getModel().isEdge(a.cell),e=new mxRectangle(a.absoluteOffset.x,a.absoluteOffset.y);if(d){var f=a.text.getSpacing();e.x+=f.x*c;e.y+=f.y*c;b=b.getCellGeometry(a.cell);null!=b&&(e.width=Math.max(0,b.width*c),e.height=Math.max(0,b.height*c))}else a.text.isPaintBoundsInverted()&&(b=e.x,e.x=e.y,e.y=b),e.x+=a.x,e.y+=a.y,e.width=Math.max(1,a.width),e.height=Math.max(1,a.height),b=mxUtils.getValue(a.style,mxConstants.STYLE_STROKECOLOR,
|
|
mxConstants.NONE),b!=mxConstants.NONE&&""!=b&&(f=parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_STROKEWIDTH,1))*c,b=1+Math.floor((f-1)/2),f=Math.floor(f+1),e.x+=b,e.y+=b,e.width-=f,e.height-=f);a.text.isPaintBoundsInverted()&&(b=(a.width-a.height)/2,e.x+=b,e.y-=b,b=e.width,e.width=e.height,e.height=b);null!=a.shape&&(b=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),f=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),
|
|
b==mxConstants.ALIGN_CENTER&&f==mxConstants.ALIGN_MIDDLE&&(e=a.shape.getLabelBounds(e)));b=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_WIDTH,null);null!=b&&(e.width=parseFloat(b)*c);d||this.rotateLabelBounds(a,e);return e};
|
|
mxCellRenderer.prototype.rotateLabelBounds=function(a,b){b.y-=a.text.margin.y*b.height;b.x-=a.text.margin.x*b.width;if(!this.legacySpacing||"fill"!=a.style[mxConstants.STYLE_OVERFLOW]&&"width"!=a.style[mxConstants.STYLE_OVERFLOW]){var c=a.view.scale,d=a.text.getSpacing();b.x+=d.x*c;b.y+=d.y*c;var d=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),e=mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),f=mxUtils.getValue(a.style,
|
|
mxConstants.STYLE_LABEL_WIDTH,null);b.width=Math.max(0,b.width-(d==mxConstants.ALIGN_CENTER&&null==f?a.text.spacingLeft*c+a.text.spacingRight*c:0));b.height=Math.max(0,b.height-(e==mxConstants.ALIGN_MIDDLE?a.text.spacingTop*c+a.text.spacingBottom*c:0))}e=a.text.getTextRotation();if(0!=e&&(null!=a&&a.view.graph.model.isVertex(a.cell))&&(c=a.getCenterX(),d=a.getCenterY(),b.x!=c||b.y!=d))e*=Math.PI/180,pt=mxUtils.getRotatedPoint(new mxPoint(b.x,b.y),Math.cos(e),Math.sin(e),new mxPoint(c,d)),b.x=pt.x,
|
|
b.y=pt.y};
|
|
mxCellRenderer.prototype.redrawCellOverlays=function(a,b){this.createCellOverlays(a);if(null!=a.overlays){var c=mxUtils.mod(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0),90),d=mxUtils.toRadians(c),e=Math.cos(d),f=Math.sin(d);a.overlays.visit(function(d,h){var k=h.overlay.getBounds(a);if(!a.view.graph.getModel().isEdge(a.cell)&&null!=a.shape&&0!=c){var m=k.getCenterX(),l=k.getCenterY(),l=mxUtils.getRotatedPoint(new mxPoint(m,l),e,f,new mxPoint(a.getCenterX(),a.getCenterY())),m=l.x,l=l.y;k.x=
|
|
Math.round(m-k.width/2);k.y=Math.round(l-k.height/2)}if(b||null==h.bounds||h.scale!=a.view.scale||!h.bounds.equals(k))h.bounds=k,h.scale=a.view.scale,h.redraw()})}};
|
|
mxCellRenderer.prototype.redrawControl=function(a,b){var c=a.view.graph.getFoldingImage(a);if(null!=a.control&&null!=c){var c=this.getControlBounds(a,c.width,c.height),d=this.legacyControlPosition?mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0):a.shape.getTextRotation(),e=a.view.scale;if(b||a.control.scale!=e||!a.control.bounds.equals(c)||a.control.rotation!=d)a.control.rotation=d,a.control.bounds=c,a.control.scale=e,a.control.redraw()}};
|
|
mxCellRenderer.prototype.getControlBounds=function(a,b,c){if(null!=a.control){var d=a.view.scale,e=a.getCenterX(),f=a.getCenterY();if(!a.view.graph.getModel().isEdge(a.cell)&&(e=a.x+b*d,f=a.y+c*d,null!=a.shape)){var g=a.shape.getShapeRotation();if(this.legacyControlPosition)g=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0);else if(a.shape.isPaintBoundsInverted())var h=(a.width-a.height)/2,e=e+h,f=f-h;0!=g&&(h=mxUtils.toRadians(g),g=Math.cos(h),h=Math.sin(h),f=mxUtils.getRotatedPoint(new mxPoint(e,
|
|
f),g,h,new mxPoint(a.getCenterX(),a.getCenterY())),e=f.x,f=f.y)}return a.view.graph.getModel().isEdge(a.cell),new mxRectangle(Math.round(e-b/2*d),Math.round(f-c/2*d),Math.round(b*d),Math.round(c*d))}return null};
|
|
mxCellRenderer.prototype.insertStateAfter=function(a,b,c){for(var d=this.getShapesForState(a),e=0;e<d.length;e++)if(null!=d[e]&&null!=d[e].node){var f=d[e].node.parentNode!=a.view.getDrawPane()&&d[e].node.parentNode!=a.view.getOverlayPane(),g=f?c:b;if(null!=g&&g.nextSibling!=d[e].node)null==g.nextSibling?g.parentNode.appendChild(d[e].node):g.parentNode.insertBefore(d[e].node,g.nextSibling);else if(null==g)if(d[e].node.parentNode==a.view.graph.container){for(g=a.view.canvas;null!=g&&g.parentNode!=
|
|
a.view.graph.container;)g=g.parentNode;null!=g&&null!=g.nextSibling?g.nextSibling!=d[e].node&&d[e].node.parentNode.insertBefore(d[e].node,g.nextSibling):d[e].node.parentNode.appendChild(d[e].node)}else null!=d[e].node.parentNode.firstChild&&d[e].node.parentNode.firstChild!=d[e].node&&d[e].node.parentNode.insertBefore(d[e].node,d[e].node.parentNode.firstChild);f?c=d[e].node:b=d[e].node}return[b,c]};mxCellRenderer.prototype.getShapesForState=function(a){return[a.shape,a.text,a.control]};
|
|
mxCellRenderer.prototype.redraw=function(a,b,c){b=this.redrawShape(a,b,c);if(null!=a.shape&&(null==c||c))this.redrawLabel(a,b),this.redrawCellOverlays(a,b),this.redrawControl(a,b)};
|
|
mxCellRenderer.prototype.redrawShape=function(a,b,c){var d=a.view.graph.model,e=!1;null!=a.shape&&(null!=a.shape.style&&null!=a.style&&a.shape.style[mxConstants.STYLE_SHAPE]!=a.style[mxConstants.STYLE_SHAPE])&&(a.shape.destroy(),a.shape=null);null==a.shape&&null!=a.view.graph.container&&a.cell!=a.view.currentRoot&&(d.isVertex(a.cell)||d.isEdge(a.cell))?(a.shape=this.createShape(a),null!=a.shape&&(a.shape.antiAlias=this.antiAlias,this.createIndicatorShape(a),this.initializeShape(a),this.createCellOverlays(a),
|
|
this.installListeners(a),a.view.graph.selectionCellsHandler.updateHandler(a))):null!=a.shape&&!mxUtils.equalEntries(a.shape.style,a.style)&&(a.shape.resetStyles(),this.configureShape(a),a.view.graph.selectionCellsHandler.updateHandler(a),b=!0);if(null!=a.shape&&(this.createControl(a),b||null==a.shape.bounds||a.shape.scale!=a.view.scale||null==a.absolutePoints&&!a.shape.bounds.equals(a)||null!=a.absolutePoints&&!mxUtils.equalPoints(a.shape.points,a.absolutePoints)))null!=a.absolutePoints?(a.shape.points=
|
|
a.absolutePoints.slice(),a.shape.bounds=null):(a.shape.points=null,a.shape.bounds=new mxRectangle(a.x,a.y,a.width,a.height)),a.shape.scale=a.view.scale,null==c||c?a.shape.redraw():a.shape.updateBoundingBox(),e=!0;return e};mxCellRenderer.prototype.destroy=function(a){null!=a.shape&&(null!=a.text&&(a.text.destroy(),a.text=null),null!=a.overlays&&(a.overlays.visit(function(a,c){c.destroy()}),a.overlays=null),null!=a.control&&(a.control.destroy(),a.control=null),a.shape.destroy(),a.shape=null)};
|
|
var mxEdgeStyle={EntityRelation:function(a,b,c,d,e){var f=a.view,g=f.graph;d=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*f.scale;var h=a.absolutePoints,k=h[0],m=h[h.length-1],h=!1;if(null!=k)b=new mxCellState,b.x=k.x,b.y=k.y;else if(null!=b){var l=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_NONE);l!=mxConstants.DIRECTION_MASK_NONE&&l!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST?h=l==mxConstants.DIRECTION_MASK_WEST:(k=g.getCellGeometry(b.cell),
|
|
k.relative?h=0.5>=k.x:null!=c&&(h=c.x+c.width<b.x))}else return;k=!0;null!=m?(c=new mxCellState,c.x=m.x,c.y=m.y):null!=c&&(l=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_NONE),l!=mxConstants.DIRECTION_MASK_NONE&&l!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST?k=l==mxConstants.DIRECTION_MASK_WEST:(a=g.getCellGeometry(c.cell),a.relative?k=0.5>=a.x:null!=b&&(k=b.x+b.width<c.x)));null!=b&&null!=c&&(a=h?b.x:b.x+b.width,b=f.getRoutingCenterY(b),g=k?c.x:c.x+c.width,c=f.getRoutingCenterY(c),
|
|
f=new mxPoint(a+(h?-d:d),b),m=new mxPoint(g+(k?-d:d),c),h==k?(d=h?Math.min(a,g)-d:Math.max(a,g)+d,e.push(new mxPoint(d,b)),e.push(new mxPoint(d,c))):(f.x<m.x==h?(d=b+(c-b)/2,e.push(f),e.push(new mxPoint(f.x,d)),e.push(new mxPoint(m.x,d))):e.push(f),e.push(m)))},Loop:function(a,b,c,d,e){c=a.absolutePoints;var f=c[c.length-1];if(null!=c[0]&&null!=f){if(null!=d&&0<d.length)for(b=0;b<d.length;b++)c=d[b],c=a.view.transformControlPoint(a,c),e.push(new mxPoint(c.x,c.y))}else if(null!=b){var f=a.view,g=f.graph;
|
|
c=null!=d&&0<d.length?d[0]:null;null!=c&&(c=f.transformControlPoint(a,c),mxUtils.contains(b,c.x,c.y)&&(c=null));var h=d=0,k=0,m=0,g=mxUtils.getValue(a.style,mxConstants.STYLE_SEGMENT,g.gridSize)*f.scale;a=mxUtils.getValue(a.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);a==mxConstants.DIRECTION_NORTH||a==mxConstants.DIRECTION_SOUTH?(d=f.getRoutingCenterX(b),h=g):(k=f.getRoutingCenterY(b),m=g);null==c||c.x<b.x||c.x>b.x+b.width?null!=c?(d=c.x,m=Math.max(Math.abs(k-c.y),m)):a==mxConstants.DIRECTION_NORTH?
|
|
k=b.y-2*h:a==mxConstants.DIRECTION_SOUTH?k=b.y+b.height+2*h:d=a==mxConstants.DIRECTION_EAST?b.x-2*m:b.x+b.width+2*m:null!=c&&(d=f.getRoutingCenterX(b),h=Math.max(Math.abs(d-c.x),m),k=c.y,m=0);e.push(new mxPoint(d-h,k-m));e.push(new mxPoint(d+h,k+m))}},ElbowConnector:function(a,b,c,d,e){var f=null!=d&&0<d.length?d[0]:null,g=!1,h=!1;if(null!=b&&null!=c)if(null!=f)var k=Math.min(b.x,c.x),m=Math.max(b.x+b.width,c.x+c.width),h=Math.min(b.y,c.y),l=Math.max(b.y+b.height,c.y+c.height),f=a.view.transformControlPoint(a,
|
|
f),g=f.y<h||f.y>l,h=f.x<k||f.x>m;else k=Math.max(b.x,c.x),m=Math.min(b.x+b.width,c.x+c.width),g=k==m,g||(h=Math.max(b.y,c.y),l=Math.min(b.y+b.height,c.y+c.height),h=h==l);!h&&(g||a.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL)?mxEdgeStyle.TopToBottom(a,b,c,d,e):mxEdgeStyle.SideToSide(a,b,c,d,e)},SideToSide:function(a,b,c,d,e){var f=a.view;d=null!=d&&0<d.length?d[0]:null;var g=a.absolutePoints,h=g[0],g=g[g.length-1];null!=d&&(d=f.transformControlPoint(a,d));null!=h&&(b=new mxCellState,
|
|
b.x=h.x,b.y=h.y);null!=g&&(c=new mxCellState,c.x=g.x,c.y=g.y);null!=b&&null!=c&&(a=Math.max(b.x,c.x),h=Math.min(b.x+b.width,c.x+c.width),a=null!=d?d.x:Math.round(h+(a-h)/2),h=f.getRoutingCenterY(b),f=f.getRoutingCenterY(c),null!=d&&(d.y>=b.y&&d.y<=b.y+b.height&&(h=d.y),d.y>=c.y&&d.y<=c.y+c.height&&(f=d.y)),!mxUtils.contains(c,a,h)&&!mxUtils.contains(b,a,h)&&e.push(new mxPoint(a,h)),!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),b=Math.min(b.y+b.height,c.y+c.height),e.push(new mxPoint(a,f+(b-f)/2)))))},TopToBottom:function(a,b,c,d,e){var f=a.view;d=null!=d&&0<d.length?d[0]:null;var g=a.absolutePoints,h=g[0],g=g[g.length-1];null!=d&&(d=f.transformControlPoint(a,d));null!=h&&(b=new mxCellState,b.x=h.x,b.y=h.y);null!=g&&(c=new mxCellState,c.x=g.x,c.y=g.y);null!=b&&null!=c&&(h=Math.max(b.y,c.y),g=Math.min(b.y+b.height,c.y+c.height),a=f.getRoutingCenterX(b),
|
|
null!=d&&(d.x>=b.x&&d.x<=b.x+b.width)&&(a=d.x),h=null!=d?d.y:Math.round(g+(h-g)/2),!mxUtils.contains(c,a,h)&&!mxUtils.contains(b,a,h)&&e.push(new mxPoint(a,h)),a=null!=d&&d.x>=c.x&&d.x<=c.x+c.width?d.x:f.getRoutingCenterX(c),!mxUtils.contains(c,a,h)&&!mxUtils.contains(b,a,h)&&e.push(new mxPoint(a,h)),1==e.length&&(null!=d&&1==e.length?!mxUtils.contains(c,d.x,h)&&!mxUtils.contains(b,d.x,h)&&e.push(new mxPoint(d.x,h)):(f=Math.max(b.x,c.x),b=Math.min(b.x+b.width,c.x+c.width),e.push(new mxPoint(f+(b-
|
|
f)/2,h)))))},SegmentConnector:function(a,b,c,d,e){function f(a){if(null==k||Math.abs(k.x-a.x)>=h||Math.abs(k.y-a.y)>=h)e.push(a),k=a;return k}var g=a.absolutePoints,h=Math.max(1,a.view.scale),k=0<e.length?e[0]:null,m=!0,l=null,n=g[0];null==n&&null!=b?n=new mxPoint(a.view.getRoutingCenterX(b),a.view.getRoutingCenterY(b)):null!=n&&(n=n.clone());n.x=Math.round(n.x);n.y=Math.round(n.y);var p=g.length-1;if(null!=d&&0<d.length){for(var l=[],r=0;r<d.length;r++){var q=a.view.transformControlPoint(a,d[r]);
|
|
null!=q&&(q.x=Math.round(q.x),q.y=Math.round(q.y),l.push(q))}if(0==l.length)return;d=l;null!=n&&null!=d[0]&&(Math.abs(d[0].x-n.x)<h&&(d[0].x=n.x),Math.abs(d[0].y-n.y)<h&&(d[0].y=n.y));q=g[p];null!=q&&null!=d[d.length-1]&&(Math.abs(d[d.length-1].x-q.x)<h&&(d[d.length-1].x=q.x),Math.abs(d[d.length-1].y-q.y)<h&&(d[d.length-1].y=q.y));var l=d[0],s=b,u=g[0],t=!1,z=!1,t=l;null!=u&&(u.x=Math.round(u.x),u.y=Math.round(u.y),s=null);for(r=0;2>r;r++){var y=null!=u&&u.x==t.x,v=null!=u&&u.y==t.y,K=null!=s&&t.y>=
|
|
s.y&&t.y<=s.y+s.height,s=null!=s&&t.x>=s.x&&t.x<=s.x+s.width,t=v||null==u&&K,z=y||null==u&&s;if(!(0==r&&(t&&z||y&&v))){if(null!=u&&!v&&!y&&(K||s)){m=K?!1:!0;break}if(z||t){m=t;1==r&&(m=0==d.length%2?t:z);break}}s=c;u=g[p];null!=u&&(u.x=Math.round(u.x),u.y=Math.round(u.y),s=null);t=d[d.length-1];y&&v&&(d=d.slice(1))}m&&(null!=g[0]&&g[0].y!=l.y||null==g[0]&&null!=b&&(l.y<b.y||l.y>b.y+b.height))?f(new mxPoint(n.x,l.y)):!m&&(null!=g[0]&&g[0].x!=l.x||null==g[0]&&null!=b&&(l.x<b.x||l.x>b.x+b.width))&&f(new mxPoint(l.x,
|
|
n.y));m?n.y=l.y:n.x=l.x;for(r=0;r<d.length;r++)m=!m,l=d[r],m?n.y=l.y:n.x=l.x,f(n.clone())}else l=n,m=!0;n=g[p];null==n&&null!=c&&(n=new mxPoint(a.view.getRoutingCenterX(c),a.view.getRoutingCenterY(c)));null!=n&&(n.x=Math.round(n.x),n.y=Math.round(n.y),null!=l&&(m&&(null!=g[p]&&g[p].y!=l.y||null==g[p]&&null!=c&&(l.y<c.y||l.y>c.y+c.height))?f(new mxPoint(n.x,l.y)):!m&&(null!=g[p]&&g[p].x!=l.x||null==g[p]&&null!=c&&(l.x<c.x||l.x>c.x+c.width))&&f(new mxPoint(l.x,n.y))));if(null==g[0]&&null!=b)for(;1<
|
|
e.length&&null!=e[1]&&mxUtils.contains(b,e[1].x,e[1].y);)e.splice(1,1);if(null==g[p]&&null!=c)for(;1<e.length&&null!=e[e.length-1]&&mxUtils.contains(c,e[e.length-1].x,e[e.length-1].y);)e.splice(e.length-1,1);null!=q&&(null!=e[e.length-1]&&Math.abs(q.x-e[e.length-1].x)<h&&Math.abs(q.y-e[e.length-1].y)<h)&&(e.splice(e.length-1,1),null!=e[e.length-1]&&(Math.abs(e[e.length-1].x-q.x)<h&&(e[e.length-1].x=q.x),Math.abs(e[e.length-1].y-q.y)<h&&(e[e.length-1].y=q.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,c,d,e){b=mxUtils.getValue(a.style,e?mxConstants.STYLE_SOURCE_JETTY_SIZE:mxConstants.STYLE_TARGET_JETTY_SIZE,mxUtils.getValue(a.style,mxConstants.STYLE_JETTY_SIZE,mxEdgeStyle.orthBuffer));"auto"==b&&(mxUtils.getValue(a.style,e?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE?(a=mxUtils.getNumber(a.style,e?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE),b=Math.max(2,Math.ceil((a+
|
|
mxEdgeStyle.orthBuffer)/mxEdgeStyle.orthBuffer))*mxEdgeStyle.orthBuffer):b=2*mxEdgeStyle.orthBuffer);return b},OrthConnector:function(a,b,c,d,e){var f=a.view.graph,g=null==b?!1:f.getModel().isEdge(b.cell),h=null==c?!1:f.getModel().isEdge(c.cell),f=a.absolutePoints,k=f[0],m=f[f.length-1],l=null!=b?b.x:k.x,n=null!=b?b.y:k.y,p=null!=b?b.width:0,r=null!=b?b.height:0,q=null!=c?c.x:m.x,s=null!=c?c.y:m.y,u=null!=c?c.width:0,t=null!=c?c.height:0,f=a.view.scale*mxEdgeStyle.getJettySize(a,b,c,d,!0),z=a.view.scale*
|
|
mxEdgeStyle.getJettySize(a,b,c,d,!1);null!=b&&c==b&&(f=z=Math.max(f,z));var y=z+f,v=!1;if(null!=k&&null!=m)var v=m.x-k.x,K=m.y-k.y,v=v*v+K*K<y*y;if(v||mxEdgeStyle.orthPointsFallback&&null!=d&&0<d.length||g||h)mxEdgeStyle.SegmentConnector(a,b,c,d,e);else{d=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL];v=0;null!=b&&(d[0]=mxUtils.getPortConstraints(b,a,!0,mxConstants.DIRECTION_MASK_ALL),v=mxUtils.getValue(b.style,mxConstants.STYLE_ROTATION,0),0!=v&&(v=mxUtils.getBoundingBox(new mxRectangle(l,
|
|
n,p,r),v),l=v.x,n=v.y,p=v.width,r=v.height));null!=c&&(d[1]=mxUtils.getPortConstraints(c,a,!1,mxConstants.DIRECTION_MASK_ALL),v=mxUtils.getValue(c.style,mxConstants.STYLE_ROTATION,0),0!=v&&(v=mxUtils.getBoundingBox(new mxRectangle(q,s,u,t),v),q=v.x,s=v.y,u=v.width,t=v.height));l=Math.round(10*l)/10;n=Math.round(10*n)/10;p=Math.round(10*p)/10;r=Math.round(10*r)/10;q=Math.round(10*q)/10;s=Math.round(10*s)/10;u=Math.round(10*u)/10;t=Math.round(10*t)/10;a=[0,0];l=[[l,n,p,r],[q,s,u,t]];z=[f,z];for(v=0;2>
|
|
v;v++)mxEdgeStyle.limits[v][1]=l[v][0]-z[v],mxEdgeStyle.limits[v][2]=l[v][1]-z[v],mxEdgeStyle.limits[v][4]=l[v][0]+l[v][2]+z[v],mxEdgeStyle.limits[v][8]=l[v][1]+l[v][3]+z[v];z=l[0][1]+l[0][3]/2;n=l[1][1]+l[1][3]/2;v=l[0][0]+l[0][2]/2-(l[1][0]+l[1][2]/2);K=z-n;z=0;0>v?z=0>K?2:1:0>=K&&(z=3,0==v&&(z=2));n=null;null!=b&&(n=k);b=[[0.5,0.5],[0.5,0.5]];for(v=0;2>v;v++)null!=n&&(b[v][0]=(n.x-l[v][0])/l[v][2],1>=Math.abs(n.x-l[v][0])?a[v]=mxConstants.DIRECTION_MASK_WEST:1>=Math.abs(n.x-l[v][0]-l[v][2])&&(a[v]=
|
|
mxConstants.DIRECTION_MASK_EAST),b[v][1]=(n.y-l[v][1])/l[v][3],1>=Math.abs(n.y-l[v][1])?a[v]=mxConstants.DIRECTION_MASK_NORTH:1>=Math.abs(n.y-l[v][1]-l[v][3])&&(a[v]=mxConstants.DIRECTION_MASK_SOUTH)),n=null,null!=c&&(n=m);v=l[0][1]-(l[1][1]+l[1][3]);m=l[0][0]-(l[1][0]+l[1][2]);n=l[1][1]-(l[0][1]+l[0][3]);p=l[1][0]-(l[0][0]+l[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(m-y,0);mxEdgeStyle.vertexSeperations[2]=Math.max(v-y,0);mxEdgeStyle.vertexSeperations[4]=Math.max(n-y,0);mxEdgeStyle.vertexSeperations[3]=
|
|
Math.max(p-y,0);y=[];c=[];k=[];c[0]=m>=p?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST;k[0]=v>=n?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH;c[1]=mxUtils.reversePortConstraints(c[0]);k[1]=mxUtils.reversePortConstraints(k[0]);m=m>=p?m:p;n=v>=n?v:n;p=[[0,0],[0,0]];r=!1;for(v=0;2>v;v++)0==a[v]&&(0==(c[v]&d[v])&&(c[v]=mxUtils.reversePortConstraints(c[v])),0==(k[v]&d[v])&&(k[v]=mxUtils.reversePortConstraints(k[v])),p[v][0]=k[v],p[v][1]=c[v]);0<n&&0<m&&(0<(c[0]&d[0])&&
|
|
0<(k[1]&d[1])?(p[0][0]=c[0],p[0][1]=k[0],p[1][0]=k[1],p[1][1]=c[1],r=!0):0<(k[0]&d[0])&&0<(c[1]&d[1])&&(p[0][0]=k[0],p[0][1]=c[0],p[1][0]=c[1],p[1][1]=k[1],r=!0));0<n&&!r&&(p[0][0]=k[0],p[0][1]=c[0],p[1][0]=k[1],p[1][1]=c[1],r=!0);0<m&&!r&&(p[0][0]=c[0],p[0][1]=k[0],p[1][0]=c[1],p[1][1]=k[1]);for(v=0;2>v;v++)if(0==a[v]&&(0==(p[v][0]&d[v])&&(p[v][0]=p[v][1]),y[v]=p[v][0]&d[v],y[v]|=(p[v][1]&d[v])<<8,y[v]|=(p[1-v][v]&d[v])<<16,y[v]|=(p[1-v][1-v]&d[v])<<24,0==(y[v]&15)&&(y[v]<<=8),0==(y[v]&3840)&&(y[v]=
|
|
y[v]&15|y[v]>>8),0==(y[v]&983040)&&(y[v]=y[v]&65535|(y[v]&251658240)>>8),a[v]=y[v]&15,d[v]==mxConstants.DIRECTION_MASK_WEST||d[v]==mxConstants.DIRECTION_MASK_NORTH||d[v]==mxConstants.DIRECTION_MASK_EAST||d[v]==mxConstants.DIRECTION_MASK_SOUTH))a[v]=d[v];d=a[0]==mxConstants.DIRECTION_MASK_EAST?3:a[0];y=a[1]==mxConstants.DIRECTION_MASK_EAST?3:a[1];d-=z;y-=z;1>d&&(d+=4);1>y&&(y+=4);d=mxEdgeStyle.routePatterns[d-1][y-1];mxEdgeStyle.wayPoints1[0][0]=l[0][0];mxEdgeStyle.wayPoints1[0][1]=l[0][1];switch(a[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=
|
|
f;mxEdgeStyle.wayPoints1[0][1]+=b[0][1]*l[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=b[0][0]*l[0][2];mxEdgeStyle.wayPoints1[0][1]+=l[0][3]+f;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=l[0][2]+f;mxEdgeStyle.wayPoints1[0][1]+=b[0][1]*l[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=b[0][0]*l[0][2],mxEdgeStyle.wayPoints1[0][1]-=f}f=0;c=y=0<(a[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?
|
|
0:1;for(v=k=0;v<d.length;v++)k=d[v]&15,q=k==mxConstants.DIRECTION_MASK_EAST?3:k,q+=z,4<q&&(q-=4),m=mxEdgeStyle.dirVectors[q-1],k=0<q%2?0:1,k!=y&&(f++,mxEdgeStyle.wayPoints1[f][0]=mxEdgeStyle.wayPoints1[f-1][0],mxEdgeStyle.wayPoints1[f][1]=mxEdgeStyle.wayPoints1[f-1][1]),s=0<(d[v]&mxEdgeStyle.TARGET_MASK),r=0<(d[v]&mxEdgeStyle.SOURCE_MASK),n=(d[v]&mxEdgeStyle.SIDE_MASK)>>5,n<<=z,15<n&&(n>>=4),p=0<(d[v]&mxEdgeStyle.CENTER_MASK),(r||s)&&9>n?(q=0,r=r?0:1,q=p&&0==k?l[r][0]+b[r][0]*l[r][2]:p?l[r][1]+b[r][1]*
|
|
l[r][3]:mxEdgeStyle.limits[r][n],0==k?(n=(q-mxEdgeStyle.wayPoints1[f][0])*m[0],0<n&&(mxEdgeStyle.wayPoints1[f][0]+=m[0]*n)):(n=(q-mxEdgeStyle.wayPoints1[f][1])*m[1],0<n&&(mxEdgeStyle.wayPoints1[f][1]+=m[1]*n))):p&&(mxEdgeStyle.wayPoints1[f][0]+=m[0]*Math.abs(mxEdgeStyle.vertexSeperations[q]/2),mxEdgeStyle.wayPoints1[f][1]+=m[1]*Math.abs(mxEdgeStyle.vertexSeperations[q]/2)),0<f&&mxEdgeStyle.wayPoints1[f][k]==mxEdgeStyle.wayPoints1[f-1][k]?f--:y=k;for(v=0;v<=f&&!(v==f&&((0<(a[1]&(mxConstants.DIRECTION_MASK_EAST|
|
|
mxConstants.DIRECTION_MASK_WEST))?0:1)==c?0:1)!=(f+1)%2);v++)e.push(new mxPoint(Math.round(mxEdgeStyle.wayPoints1[v][0]),Math.round(mxEdgeStyle.wayPoints1[v][1])));for(a=1;a<e.length;)null==e[a-1]||null==e[a]||e[a-1].x!=e[a].x||e[a-1].y!=e[a].y?a++:e.splice(a,1)}},getRoutePattern:function(a,b,c,d){var e=a[0]==mxConstants.DIRECTION_MASK_EAST?3:a[0];a=a[1]==mxConstants.DIRECTION_MASK_EAST?3:a[1];e-=b;a-=b;1>e&&(e+=4);1>a&&(a+=4);b=routePatterns[e-1][a-1];if(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.optimizeVmlReflows=!0;mxGraphView.prototype.rendering=!0;mxGraphView.prototype.graph=null;mxGraphView.prototype.currentRoot=null;
|
|
mxGraphView.prototype.graphBounds=null;mxGraphView.prototype.scale=1;mxGraphView.prototype.translate=null;mxGraphView.prototype.states=null;mxGraphView.prototype.updateStyle=!1;mxGraphView.prototype.lastNode=null;mxGraphView.prototype.lastHtmlNode=null;mxGraphView.prototype.lastForegroundNode=null;mxGraphView.prototype.lastForegroundHtmlNode=null;mxGraphView.prototype.getGraphBounds=function(){return this.graphBounds};mxGraphView.prototype.setGraphBounds=function(a){this.graphBounds=a};
|
|
mxGraphView.prototype.getBounds=function(a){var b=null;if(null!=a&&0<a.length)for(var c=this.graph.getModel(),d=0;d<a.length;d++)if(c.isVertex(a[d])||c.isEdge(a[d])){var e=this.getState(a[d]);null!=e&&(null==b?b=mxRectangle.fromRectangle(e):b.add(e))}return b};mxGraphView.prototype.setCurrentRoot=function(a){if(this.currentRoot!=a){var b=new mxCurrentRootChange(this,a);b.execute();var c=new mxUndoableEdit(this,!1);c.add(b);this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",c));this.graph.sizeDidChange()}return a};
|
|
mxGraphView.prototype.scaleAndTranslate=function(a,b,c){var d=this.scale,e=new mxPoint(this.translate.x,this.translate.y);if(this.scale!=a||this.translate.x!=b||this.translate.y!=c)this.scale=a,this.translate.x=b,this.translate.y=c,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange());this.fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE,"scale",a,"previousScale",d,"translate",this.translate,"previousTranslate",e))};mxGraphView.prototype.getScale=function(){return this.scale};
|
|
mxGraphView.prototype.setScale=function(a){var b=this.scale;this.scale!=a&&(this.scale=a,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange()));this.fireEvent(new mxEventObject(mxEvent.SCALE,"scale",a,"previousScale",b))};mxGraphView.prototype.getTranslate=function(){return this.translate};
|
|
mxGraphView.prototype.setTranslate=function(a,b){var c=new mxPoint(this.translate.x,this.translate.y);if(this.translate.x!=a||this.translate.y!=b)this.translate.x=a,this.translate.y=b,this.isEventsEnabled()&&(this.revalidate(),this.graph.sizeDidChange());this.fireEvent(new mxEventObject(mxEvent.TRANSLATE,"translate",this.translate,"previousTranslate",c))};mxGraphView.prototype.refresh=function(){null!=this.currentRoot&&this.clear();this.revalidate()};
|
|
mxGraphView.prototype.revalidate=function(){this.invalidate();this.validate()};mxGraphView.prototype.clear=function(a,b,c){var d=this.graph.getModel();a=a||d.getRoot();b=null!=b?b:!1;c=null!=c?c:!0;this.removeState(a);if(c&&(b||a!=this.currentRoot)){c=d.getChildCount(a);for(var e=0;e<c;e++)this.clear(d.getChildAt(a,e),b)}else this.invalidate(a)};
|
|
mxGraphView.prototype.invalidate=function(a,b,c){var d=this.graph.getModel();a=a||d.getRoot();b=null!=b?b:!0;c=null!=c?c:!0;var e=this.getState(a);null!=e&&(e.invalid=!0);if(!a.invalidating){a.invalidating=!0;if(b)for(var f=d.getChildCount(a),e=0;e<f;e++){var g=d.getChildAt(a,e);this.invalidate(g,b,c)}if(c){f=d.getEdgeCount(a);for(e=0;e<f;e++)this.invalidate(d.getEdgeAt(a,e),b,c)}delete a.invalidating}};
|
|
mxGraphView.prototype.validate=function(a){var b=mxLog.enter("mxGraphView.validate");window.status=mxResources.get(this.updatingDocumentResource)||this.updatingDocumentResource;this.resetValidationState();var c=null;if(this.optimizeVmlReflows&&null!=this.canvas&&null==this.textDiv&&(8==document.documentMode&&!mxClient.IS_EM||mxClient.IS_QUIRKS))this.placeholder=document.createElement("div"),this.placeholder.style.position="absolute",this.placeholder.style.width=this.canvas.clientWidth+"px",this.placeholder.style.height=
|
|
this.canvas.clientHeight+"px",this.canvas.parentNode.appendChild(this.placeholder),c=this.drawPane.style.display,this.canvas.style.display="none",this.textDiv=document.createElement("div"),this.textDiv.style.position="absolute",this.textDiv.style.whiteSpace="nowrap",this.textDiv.style.visibility="hidden",this.textDiv.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",this.textDiv.style.zoom="1",document.body.appendChild(this.textDiv);a=this.getBoundingBox(this.validateCellState(this.validateCell(a||
|
|
(null!=this.currentRoot?this.currentRoot:this.graph.getModel().getRoot()))));this.setGraphBounds(null!=a?a:this.getEmptyBounds());this.validateBackground();null!=c&&(this.canvas.style.display=c,this.textDiv.parentNode.removeChild(this.textDiv),null!=this.placeholder&&this.placeholder.parentNode.removeChild(this.placeholder),this.textDiv=null);this.resetValidationState();window.status=mxResources.get(this.doneResource)||this.doneResource;mxLog.leave("mxGraphView.validate",b)};
|
|
mxGraphView.prototype.getEmptyBounds=function(){return new mxRectangle(this.translate.x*this.scale,this.translate.y*this.scale)};
|
|
mxGraphView.prototype.getBoundingBox=function(a,b){b=null!=b?b:!0;var c=null;if(null!=a&&(null!=a.shape&&null!=a.shape.boundingBox&&(c=a.shape.boundingBox.clone()),null!=a.text&&null!=a.text.boundingBox&&(null!=c?c.add(a.text.boundingBox):c=a.text.boundingBox.clone()),b))for(var d=this.graph.getModel(),e=d.getChildCount(a.cell),f=0;f<e;f++){var g=this.getBoundingBox(this.getState(d.getChildAt(a.cell,f)));null!=g&&(null==c?c=g:c.add(g))}return c};
|
|
mxGraphView.prototype.createBackgroundPageShape=function(a){return new mxRectangleShape(a,"white","black")};mxGraphView.prototype.validateBackground=function(){this.validateBackgroundImage();this.validateBackgroundPage()};
|
|
mxGraphView.prototype.validateBackgroundImage=function(){var a=this.graph.getBackgroundImage();if(null!=a){if(null==this.backgroundImage||this.backgroundImage.image!=a.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var b=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(b,a.src);this.backgroundImage.dialect=this.graph.dialect;this.backgroundImage.init(this.backgroundPane);this.backgroundImage.redraw();8==document.documentMode&&!mxClient.IS_EM&&mxEvent.addGestureListeners(this.backgroundImage.node,
|
|
mxUtils.bind(this,function(a){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(a))}),mxUtils.bind(this,function(a){this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(a))}),mxUtils.bind(this,function(a){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(a))}))}this.redrawBackgroundImage(this.backgroundImage,a)}else null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null)};
|
|
mxGraphView.prototype.validateBackgroundPage=function(){if(this.graph.pageVisible){var a=this.getBackgroundPageBounds();null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(a),this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.isShadow=!0,this.backgroundPageShape.dialect=this.graph.dialect,this.backgroundPageShape.init(this.backgroundPane),this.backgroundPageShape.redraw(),this.graph.nativeDblClickEnabled&&mxEvent.addListener(this.backgroundPageShape.node,
|
|
"dblclick",mxUtils.bind(this,function(a){this.graph.dblClick(a)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(a){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(a))}),mxUtils.bind(this,function(a){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide();this.graph.isMouseDown&&!mxEvent.isConsumed(a)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(a))}),mxUtils.bind(this,function(a){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,
|
|
new mxMouseEvent(a))}))):(this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.bounds=a,this.backgroundPageShape.redraw())}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)};mxGraphView.prototype.getBackgroundPageBounds=function(){var a=this.graph.pageFormat,b=this.scale*this.graph.pageScale;return new mxRectangle(this.scale*this.translate.x,this.scale*this.translate.y,a.width*b,a.height*b)};
|
|
mxGraphView.prototype.redrawBackgroundImage=function(a,b){a.scale=this.scale;a.bounds.x=this.scale*this.translate.x;a.bounds.y=this.scale*this.translate.y;a.bounds.width=this.scale*b.width;a.bounds.height=this.scale*b.height;a.redraw()};
|
|
mxGraphView.prototype.validateCell=function(a,b){if(null!=a)if(b=(null!=b?b:!0)&&this.graph.isCellVisible(a),null!=this.getState(a,b)&&!b)this.removeState(a);else for(var c=this.graph.getModel(),d=c.getChildCount(a),e=0;e<d;e++)this.validateCell(c.getChildAt(a,e),b&&(!this.isCellCollapsed(a)||a==this.currentRoot));return a};
|
|
mxGraphView.prototype.validateCellState=function(a,b){b=null!=b?b:!0;var c=null;if(null!=a&&(c=this.getState(a),null!=c)){var d=this.graph.getModel();c.invalid&&(c.invalid=!1,null==c.style&&(c.style=this.graph.getCellStyle(c.cell)),a!=this.currentRoot&&this.validateCellState(d.getParent(a),!1),c.setVisibleTerminalState(this.validateCellState(this.getVisibleTerminal(a,!0),!1),!0),c.setVisibleTerminalState(this.validateCellState(this.getVisibleTerminal(a,!1),!1),!1),this.updateCellState(c),a!=this.currentRoot&&
|
|
!c.invalid&&this.graph.cellRenderer.redraw(c,!1,this.isRendering()));if(b&&!c.invalid){null!=c.shape&&this.stateValidated(c);for(var e=d.getChildCount(a),f=0;f<e;f++)this.validateCellState(d.getChildAt(a,f))}}return c};
|
|
mxGraphView.prototype.updateCellState=function(a){a.absoluteOffset.x=0;a.absoluteOffset.y=0;a.origin.x=0;a.origin.y=0;a.length=0;if(a.cell!=this.currentRoot){var b=this.graph.getModel(),c=this.getState(b.getParent(a.cell));null!=c&&c.cell!=this.currentRoot&&(a.origin.x+=c.origin.x,a.origin.y+=c.origin.y);var d=this.graph.getChildOffsetForCell(a.cell);null!=d&&(a.origin.x+=d.x,a.origin.y+=d.y);var e=this.graph.getCellGeometry(a.cell);null!=e&&(b.isEdge(a.cell)||(d=e.offset||this.EMPTY_POINT,e.relative&&
|
|
null!=c?b.isEdge(c.cell)?(d=this.getPoint(c,e),null!=d&&(a.origin.x+=d.x/this.scale-c.origin.x-this.translate.x,a.origin.y+=d.y/this.scale-c.origin.y-this.translate.y)):(a.origin.x+=e.x*c.width/this.scale+d.x,a.origin.y+=e.y*c.height/this.scale+d.y):(a.absoluteOffset.x=this.scale*d.x,a.absoluteOffset.y=this.scale*d.y,a.origin.x+=e.x,a.origin.y+=e.y)),a.x=this.scale*(this.translate.x+a.origin.x),a.y=this.scale*(this.translate.y+a.origin.y),a.width=this.scale*e.width,a.unscaledWidth=e.width,a.height=
|
|
this.scale*e.height,b.isVertex(a.cell)&&this.updateVertexState(a,e),b.isEdge(a.cell)&&this.updateEdgeState(a,e))}a.updateCachedBounds()};mxGraphView.prototype.isCellCollapsed=function(a){return this.graph.isCellCollapsed(a)};
|
|
mxGraphView.prototype.updateVertexState=function(a,b){var c=this.graph.getModel(),d=this.getState(c.getParent(a.cell));if(b.relative&&null!=d&&!c.isEdge(d.cell)){var e=mxUtils.toRadians(d.style[mxConstants.STYLE_ROTATION]||"0");if(0!=e){var c=Math.cos(e),e=Math.sin(e),f=new mxPoint(a.getCenterX(),a.getCenterY()),d=new mxPoint(d.getCenterX(),d.getCenterY()),d=mxUtils.getRotatedPoint(f,c,e,d);a.x=d.x-a.width/2;a.y=d.y-a.height/2}}this.updateVertexLabelOffset(a)};
|
|
mxGraphView.prototype.updateEdgeState=function(a,b){var c=a.getVisibleTerminalState(!0),d=a.getVisibleTerminalState(!1);null!=this.graph.model.getTerminal(a.cell,!0)&&null==c||null==c&&null==b.getTerminalPoint(!0)||null!=this.graph.model.getTerminal(a.cell,!1)&&null==d||null==d&&null==b.getTerminalPoint(!1)?this.clear(a.cell,!0):(this.updateFixedTerminalPoints(a,c,d),this.updatePoints(a,b.points,c,d),this.updateFloatingTerminalPoints(a,c,d),c=a.absolutePoints,a.cell!=this.currentRoot&&(null==c||2>
|
|
c.length||null==c[0]||null==c[c.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=0.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));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){var b=mxRectangle.fromRectangle(a),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){var e=[];e.push(a.absolutePoints[0]);var f=this.getEdgeStyle(a,b,c,d);if(null!=f){c=this.getTerminalPort(a,c,!0);d=this.getTerminalPort(a,d,!1);var g=this.updateBoundsFromStencil(c),h=this.updateBoundsFromStencil(d);f(a,c,d,b,e);null!=g&&c.setRect(g.x,g.y,g.width,g.height);null!=h&&d.setRect(h.x,h.y,h.width,h.height)}else if(null!=b)for(f=0;f<b.length;f++)null!=b[f]&&(c=mxUtils.clone(b[f]),e.push(this.transformControlPoint(a,c)));b=
|
|
a.absolutePoints;e.push(b[b.length-1]);a.absolutePoints=e}};mxGraphView.prototype.transformControlPoint=function(a,b){if(null!=a&&null!=b){var c=a.origin;return new mxPoint(this.scale*(b.x+this.translate.x+c.x),this.scale*(b.y+this.translate.y+c.y))}return null};
|
|
mxGraphView.prototype.isLoopStyleEnabled=function(a,b,c,d){b=this.graph.getConnectionConstraint(a,c,!0);var e=this.graph.getConnectionConstraint(a,d,!1);return!mxUtils.getValue(a.style,mxConstants.STYLE_ORTHOGONAL_LOOP,!1)||(null==b||null==b.point)&&(null==e||null==e.point)?null!=c&&c==d:!1};
|
|
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)?a.style[mxConstants.STYLE_EDGE]:null;"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,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 h=Math.cos(-c),k=Math.sin(-c),e=mxUtils.getRotatedPoint(e,h,k,g);h=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);h+=parseFloat(a.style[d?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||
|
|
0);a=this.getPerimeterPoint(b,e,0==c&&f,h);0!=c&&(h=Math.cos(c),k=Math.sin(c),a=mxUtils.getRotatedPoint(a,h,k,g));return a};mxGraphView.prototype.getTerminalPort=function(a,b,c){a=mxUtils.getValue(a.style,c?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT);null!=a&&(a=this.getState(this.graph.getModel().getCell(a)),null!=a&&(b=a));return b};
|
|
mxGraphView.prototype.getPerimeterPoint=function(a,b,c,d){var e=null;if(null!=a){var f=this.getPerimeterFunction(a);if(null!=f&&null!=b&&(d=this.getPerimeterBounds(a,d),0<d.width||0<d.height))e=f(d,a,b,c);null==e&&(e=this.getPoint(a))}return e};mxGraphView.prototype.getRoutingCenterX=function(a){var b=null!=a.style?parseFloat(a.style[mxConstants.STYLE_ROUTING_CENTER_X])||0:0;return a.getCenterX()+b*a.width};
|
|
mxGraphView.prototype.getRoutingCenterY=function(a){var b=null!=a.style?parseFloat(a.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0:0;return a.getCenterY()+b*a.height};mxGraphView.prototype.getPerimeterBounds=function(a,b){b=null!=b?b:0;null!=a&&(b+=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0));return a.getPerimeterBounds(b*this.scale)};
|
|
mxGraphView.prototype.getPerimeterFunction=function(a){a=a.style[mxConstants.STYLE_PERIMETER];if("string"==typeof a){var b=mxStyleRegistry.getValue(a);null==b&&this.isAllowEval()&&(b=mxUtils.eval(a));a=b}return"function"==typeof a?a:null};mxGraphView.prototype.getNextPoint=function(a,b,c){a=a.absolutePoints;var d=null;null!=a&&2<=a.length&&(d=a.length,d=a[c?Math.min(1,d-1):Math.max(0,d-2)]);null==d&&null!=b&&(d=new mxPoint(b.getCenterX(),b.getCenterY()));return d};
|
|
mxGraphView.prototype.getVisibleTerminal=function(a,b){for(var c=this.graph.getModel(),d=c.getTerminal(a,b),e=d;null!=d&&d!=this.currentRoot;){if(!this.graph.isCellVisible(e)||this.isCellCollapsed(d))e=d;d=c.getParent(d)}c.getParent(e)==c.getRoot()&&(e=null);return e};
|
|
mxGraphView.prototype.updateEdgeBounds=function(a){var b=a.absolutePoints,c=b[0],d=b[b.length-1];if(c.x!=d.x||c.y!=d.y){var e=d.x-c.x,f=d.y-c.y;a.terminalDistance=Math.sqrt(e*e+f*f)}else a.terminalDistance=0;var d=0,g=[],f=c;if(null!=f){for(var c=f.x,h=f.y,k=c,m=h,l=1;l<b.length;l++){var n=b[l];null!=n&&(e=f.x-n.x,f=f.y-n.y,e=Math.sqrt(e*e+f*f),g.push(e),d+=e,f=n,c=Math.min(f.x,c),h=Math.min(f.y,h),k=Math.max(f.x,k),m=Math.max(f.y,m))}a.length=d;a.segments=g;a.x=c;a.y=h;a.width=Math.max(1,k-c);a.height=
|
|
Math.max(1,m-h)}};
|
|
mxGraphView.prototype.getPoint=function(a,b){var c=a.getCenterX(),d=a.getCenterY();if(null!=a.segments&&(null==b||b.relative)){for(var e=a.absolutePoints.length,f=Math.round(((null!=b?b.x/2:0)+0.5)*a.length),g=a.segments[0],h=0,k=1;f>=Math.round(h+g)&&k<e-1;)h+=g,g=a.segments[k++];e=0==g?0:(f-h)/g;f=a.absolutePoints[k-1];k=a.absolutePoints[k];if(null!=f&&null!=k){h=c=d=0;if(null!=b){var d=b.y,m=b.offset;null!=m&&(c=m.x,h=m.y)}m=k.x-f.x;k=k.y-f.y;c=f.x+m*e+((0==g?0:k/g)*d+c)*this.scale;d=f.y+k*e-((0==
|
|
g?0:m/g)*d-h)*this.scale}}else null!=b&&(m=b.offset,null!=m&&(c+=m.x,d+=m.y));return new mxPoint(c,d)};
|
|
mxGraphView.prototype.getRelativePoint=function(a,b,c){var d=this.graph.getModel().getGeometry(a.cell);if(null!=d){var e=a.absolutePoints.length;if(d.relative&&1<e){for(var d=a.length,f=a.segments,g=a.absolutePoints[0],h=a.absolutePoints[1],k=mxUtils.ptSegDistSq(g.x,g.y,h.x,h.y,b,c),m=0,l=0,n=0,p=2;p<e;p++)l+=f[p-2],h=a.absolutePoints[p],g=mxUtils.ptSegDistSq(g.x,g.y,h.x,h.y,b,c),g<=k&&(k=g,m=p-1,n=l),g=h;e=f[m];g=a.absolutePoints[m];h=a.absolutePoints[m+1];k=h.x;f=h.y;a=g.x-k;m=g.y-f;k=b-k;f=c-f;
|
|
k=a-k;f=m-f;f=k*a+f*m;a=Math.sqrt(0>=f?0:f*f/(a*a+m*m));a>e&&(a=e);e=Math.sqrt(mxUtils.ptSegDistSq(g.x,g.y,h.x,h.y,b,c));-1==mxUtils.relativeCcw(g.x,g.y,h.x,h.y,b,c)&&(e=-e);return new mxPoint(-2*((d/2-n-a)/d),e/this.scale)}}return new mxPoint};
|
|
mxGraphView.prototype.updateEdgeLabelOffset=function(a){var b=a.absolutePoints;a.absoluteOffset.x=a.getCenterX();a.absoluteOffset.y=a.getCenterY();if(null!=b&&0<b.length&&null!=a.segments){var c=this.graph.getCellGeometry(a.cell);if(c.relative){var d=this.getPoint(a,c);null!=d&&(a.absoluteOffset=d)}else{var d=b[0],e=b[b.length-1];if(null!=d&&null!=e){var b=e.x-d.x,f=e.y-d.y,g=e=0,c=c.offset;null!=c&&(e=c.x,g=c.y);c=d.y+f/2+g*this.scale;a.absoluteOffset.x=d.x+b/2+e*this.scale;a.absoluteOffset.y=c}}}};
|
|
mxGraphView.prototype.getState=function(a,b){b=b||!1;var c=null;if(null!=a&&(c=this.states.get(a),b&&(null==c||this.updateStyle)&&this.graph.isCellVisible(a)))null==c?(c=this.createState(a),this.states.put(a,c)):c.style=this.graph.getCellStyle(a);return c};mxGraphView.prototype.isRendering=function(){return this.rendering};mxGraphView.prototype.setRendering=function(a){this.rendering=a};mxGraphView.prototype.isAllowEval=function(){return this.allowEval};
|
|
mxGraphView.prototype.setAllowEval=function(a){this.allowEval=a};mxGraphView.prototype.getStates=function(){return this.states};mxGraphView.prototype.setStates=function(a){this.states=a};mxGraphView.prototype.getCellStates=function(a){if(null==a)return this.states;for(var b=[],c=0;c<a.length;c++){var d=this.getState(a[c]);null!=d&&b.push(d)}return b};
|
|
mxGraphView.prototype.removeState=function(a){var b=null;null!=a&&(b=this.states.remove(a),null!=b&&(this.graph.cellRenderer.destroy(b),b.invalid=!0,b.destroy()));return b};mxGraphView.prototype.createState=function(a){return new mxCellState(this,a,this.graph.getCellStyle(a))};mxGraphView.prototype.getCanvas=function(){return this.canvas};mxGraphView.prototype.getBackgroundPane=function(){return this.backgroundPane};mxGraphView.prototype.getDrawPane=function(){return this.drawPane};
|
|
mxGraphView.prototype.getOverlayPane=function(){return this.overlayPane};mxGraphView.prototype.getDecoratorPane=function(){return this.decoratorPane};mxGraphView.prototype.isContainerEvent=function(a){a=mxEvent.getSource(a);return a==this.graph.container||a.parentNode==this.backgroundPane||null!=a.parentNode&&a.parentNode.parentNode==this.backgroundPane||a==this.canvas.parentNode||a==this.canvas||a==this.backgroundPane||a==this.drawPane||a==this.overlayPane||a==this.decoratorPane};
|
|
mxGraphView.prototype.isScrollEvent=function(a){var b=mxUtils.getOffset(this.graph.container);a=new mxPoint(a.clientX-b.x,a.clientY-b.y);var b=this.graph.container.offsetWidth,c=this.graph.container.clientWidth;if(b>c&&a.x>c+2&&a.x<=b)return!0;b=this.graph.container.offsetHeight;c=this.graph.container.clientHeight;return b>c&&a.y>c+2&&a.y<=b?!0:!1};
|
|
mxGraphView.prototype.init=function(){this.installListeners();var a=this.graph;a.dialect==mxConstants.DIALECT_SVG?this.createSvg():a.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()};
|
|
mxGraphView.prototype.installListeners=function(){var a=this.graph,b=a.container;if(null!=b){mxClient.IS_TOUCH&&(mxEvent.addListener(b,"gesturestart",mxUtils.bind(this,function(b){a.fireGestureEvent(b);mxEvent.consume(b)})),mxEvent.addListener(b,"gesturechange",mxUtils.bind(this,function(b){a.fireGestureEvent(b);mxEvent.consume(b)})),mxEvent.addListener(b,"gestureend",mxUtils.bind(this,function(b){a.fireGestureEvent(b);mxEvent.consume(b)})));mxEvent.addGestureListeners(b,mxUtils.bind(this,function(b){this.isContainerEvent(b)&&
|
|
(!mxClient.IS_IE&&!mxClient.IS_IE11&&!mxClient.IS_GC&&!mxClient.IS_OP&&!mxClient.IS_SF||!this.isScrollEvent(b))&&a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(b))}),mxUtils.bind(this,function(b){this.isContainerEvent(b)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(b))}),mxUtils.bind(this,function(b){this.isContainerEvent(b)&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(b))}));mxEvent.addListener(b,"dblclick",mxUtils.bind(this,function(b){this.isContainerEvent(b)&&a.dblClick(b)}));
|
|
var c=function(c){var e=null;mxClient.IS_TOUCH&&(e=mxEvent.getClientX(c),c=mxEvent.getClientY(c),c=mxUtils.convertPoint(b,e,c),e=a.view.getState(a.getCellAt(c.x,c.y)));return e};a.addMouseListener({mouseDown:function(b,c){a.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}});this.moveHandler=mxUtils.bind(this,function(b){null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide();this.captureDocumentGesture&&(a.isMouseDown&&null!=a.container&&!this.isContainerEvent(b)&&
|
|
"none"!=a.container.style.display&&"hidden"!=a.container.style.visibility&&!mxEvent.isConsumed(b))&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(b,c(b)))});this.endHandler=mxUtils.bind(this,function(b){this.captureDocumentGesture&&(a.isMouseDown&&null!=a.container&&!this.isContainerEvent(b)&&"none"!=a.container.style.display&&"hidden"!=a.container.style.visibility)&&a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(b))});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),mxClient.IS_QUIRKS&&(a=mxUtils.bind(this,function(a){a=this.getGraphBounds();this.updateHtmlCanvasSize(a.x+a.width+this.graph.border,a.y+a.height+this.graph.border)}),mxEvent.addListener(window,"resize",a)))};
|
|
mxGraphView.prototype.updateHtmlCanvasSize=function(a,b){if(null!=this.graph.container){var c=this.graph.container.offsetHeight;this.canvas.style.width=this.graph.container.offsetWidth<a?a+"px":"100%";this.canvas.style.height=c<b?b+"px":"100%"}};mxGraphView.prototype.createHtmlPane=function(a,b){var c=document.createElement("DIV");null!=a&&null!=b?(c.style.position="absolute",c.style.left="0px",c.style.top="0px",c.style.width=a,c.style.height=b):c.style.position="relative";return c};
|
|
mxGraphView.prototype.createVml=function(){var a=this.graph.container;if(null!=a){var b=a.offsetWidth,c=a.offsetHeight;this.canvas=this.createVmlPane(b,c);this.canvas.style.overflow="hidden";this.backgroundPane=this.createVmlPane(b,c);this.drawPane=this.createVmlPane(b,c);this.overlayPane=this.createVmlPane(b,c);this.decoratorPane=this.createVmlPane(b,c);this.canvas.appendChild(this.backgroundPane);this.canvas.appendChild(this.drawPane);this.canvas.appendChild(this.overlayPane);this.canvas.appendChild(this.decoratorPane);
|
|
a.appendChild(this.canvas)}};mxGraphView.prototype.createVmlPane=function(a,b){var c=document.createElement(mxClient.VML_PREFIX+":group");c.style.position="absolute";c.style.left="0px";c.style.top="0px";c.style.width=a+"px";c.style.height=b+"px";c.setAttribute("coordsize",a+","+b);c.setAttribute("coordorigin","0,0");return c};
|
|
mxGraphView.prototype.createSvg=function(){var a=this.graph.container;this.canvas=document.createElementNS(mxConstants.NS_SVG,"g");this.backgroundPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.backgroundPane);this.drawPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.drawPane);this.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g");this.canvas.appendChild(this.overlayPane);this.decoratorPane=document.createElementNS(mxConstants.NS_SVG,
|
|
"g");this.canvas.appendChild(this.decoratorPane);var b=document.createElementNS(mxConstants.NS_SVG,"svg");b.style.width="100%";b.style.height="100%";b.style.display="block";b.appendChild(this.canvas);if(mxClient.IS_IE||mxClient.IS_IE11)b.style.overflow="hidden";null!=a&&(a.appendChild(b),this.updateContainerStyle(a))};
|
|
mxGraphView.prototype.updateContainerStyle=function(a){var b=mxUtils.getCurrentStyle(a);null!=b&&"static"==b.position&&(a.style.position="relative");mxClient.IS_POINTER&&(a.style.touchAction="none")};
|
|
mxGraphView.prototype.destroy=function(){var a=null!=this.canvas?this.canvas.ownerSVGElement:null;null==a&&(a=this.canvas);null!=a&&null!=a.parentNode&&(this.clear(this.currentRoot,!0),mxEvent.removeGestureListeners(document,null,this.moveHandler,this.endHandler),mxEvent.release(this.graph.container),a.parentNode.removeChild(a),this.decoratorPane=this.overlayPane=this.drawPane=this.backgroundPane=this.canvas=this.endHandler=this.moveHandler=null)};
|
|
function mxCurrentRootChange(a,b){this.view=a;this.previous=this.root=b;this.isUp=null==b;if(!this.isUp)for(var c=this.view.currentRoot,d=this.view.graph.getModel();null!=c;){if(c==b){this.isUp=!0;break}c=d.getParent(c)}}
|
|
mxCurrentRootChange.prototype.execute=function(){var a=this.view.currentRoot;this.view.currentRoot=this.previous;this.previous=a;a=this.view.graph.getTranslateForRoot(this.view.currentRoot);null!=a&&(this.view.translate=new mxPoint(-a.x,-a.y));this.isUp?(this.view.clear(this.view.currentRoot,!0),this.view.validate()):this.view.refresh();this.view.fireEvent(new mxEventObject(this.isUp?mxEvent.UP:mxEvent.DOWN,"root",this.view.currentRoot,"previous",this.previous));this.isUp=!this.isUp};
|
|
function mxGraph(a,b,c,d){this.mouseListeners=null;this.renderHint=c;this.dialect=mxClient.IS_SVG?mxConstants.DIALECT_SVG:c==mxConstants.RENDERING_HINT_EXACT&&mxClient.IS_VML?mxConstants.DIALECT_VML:c==mxConstants.RENDERING_HINT_FASTEST?mxConstants.DIALECT_STRICTHTML:c==mxConstants.RENDERING_HINT_FASTER?mxConstants.DIALECT_PREFERHTML:mxConstants.DIALECT_MIXEDHTML;this.model=null!=b?b:new mxGraphModel;this.multiplicities=[];this.imageBundles=[];this.cellRenderer=this.createCellRenderer();this.setSelectionModel(this.createSelectionModel());
|
|
this.setStylesheet(null!=d?d:this.createStylesheet());this.view=this.createGraphView();this.graphModelChangeListener=mxUtils.bind(this,function(a,b){this.graphModelChanged(b.getProperty("edit").changes)});this.model.addListener(mxEvent.CHANGE,this.graphModelChangeListener);this.createHandlers();null!=a&&this.init(a);this.view.revalidate()}mxLoadResources&&mxResources.add(mxClient.basePath+"/resources/graph");mxGraph.prototype=new mxEventSource;mxGraph.prototype.constructor=mxGraph;
|
|
mxGraph.prototype.EMPTY_ARRAY=[];mxGraph.prototype.mouseListeners=null;mxGraph.prototype.isMouseDown=!1;mxGraph.prototype.model=null;mxGraph.prototype.view=null;mxGraph.prototype.stylesheet=null;mxGraph.prototype.selectionModel=null;mxGraph.prototype.cellEditor=null;mxGraph.prototype.cellRenderer=null;mxGraph.prototype.multiplicities=null;mxGraph.prototype.renderHint=null;mxGraph.prototype.dialect=null;mxGraph.prototype.gridSize=10;mxGraph.prototype.gridEnabled=!0;mxGraph.prototype.portsEnabled=!0;
|
|
mxGraph.prototype.nativeDblClickEnabled=!0;mxGraph.prototype.doubleTapEnabled=!0;mxGraph.prototype.doubleTapTimeout=500;mxGraph.prototype.doubleTapTolerance=25;mxGraph.prototype.lastTouchY=0;mxGraph.prototype.lastTouchY=0;mxGraph.prototype.lastTouchTime=0;mxGraph.prototype.tapAndHoldEnabled=!0;mxGraph.prototype.tapAndHoldDelay=500;mxGraph.prototype.tapAndHoldInProgress=!1;mxGraph.prototype.tapAndHoldValid=!1;mxGraph.prototype.initialTouchX=0;mxGraph.prototype.initialTouchY=0;
|
|
mxGraph.prototype.tolerance=4;mxGraph.prototype.defaultOverlap=0.5;mxGraph.prototype.defaultParent=null;mxGraph.prototype.alternateEdgeStyle=null;mxGraph.prototype.backgroundImage=null;mxGraph.prototype.pageVisible=!1;mxGraph.prototype.pageBreaksVisible=!1;mxGraph.prototype.pageBreakColor="gray";mxGraph.prototype.pageBreakDashed=!0;mxGraph.prototype.minPageBreakDist=20;mxGraph.prototype.preferPageSize=!1;mxGraph.prototype.pageFormat=mxConstants.PAGE_FORMAT_A4_PORTRAIT;
|
|
mxGraph.prototype.pageScale=1.5;mxGraph.prototype.enabled=!0;mxGraph.prototype.escapeEnabled=!0;mxGraph.prototype.invokesStopCellEditing=!0;mxGraph.prototype.enterStopsCellEditing=!1;mxGraph.prototype.useScrollbarsForPanning=!0;mxGraph.prototype.exportEnabled=!0;mxGraph.prototype.importEnabled=!0;mxGraph.prototype.cellsLocked=!1;mxGraph.prototype.cellsCloneable=!0;mxGraph.prototype.foldingEnabled=!0;mxGraph.prototype.cellsEditable=!0;mxGraph.prototype.cellsDeletable=!0;
|
|
mxGraph.prototype.cellsMovable=!0;mxGraph.prototype.edgeLabelsMovable=!0;mxGraph.prototype.vertexLabelsMovable=!1;mxGraph.prototype.dropEnabled=!1;mxGraph.prototype.splitEnabled=!0;mxGraph.prototype.cellsResizable=!0;mxGraph.prototype.cellsBendable=!0;mxGraph.prototype.cellsSelectable=!0;mxGraph.prototype.cellsDisconnectable=!0;mxGraph.prototype.autoSizeCells=!1;mxGraph.prototype.autoSizeCellsOnAdd=!1;mxGraph.prototype.autoScroll=!0;mxGraph.prototype.ignoreScrollbars=!1;
|
|
mxGraph.prototype.translateToScrollPosition=!1;mxGraph.prototype.timerAutoScroll=!1;mxGraph.prototype.allowAutoPanning=!1;mxGraph.prototype.autoExtend=!0;mxGraph.prototype.maximumGraphBounds=null;mxGraph.prototype.minimumGraphSize=null;mxGraph.prototype.minimumContainerSize=null;mxGraph.prototype.maximumContainerSize=null;mxGraph.prototype.resizeContainer=!1;mxGraph.prototype.border=0;mxGraph.prototype.keepEdgesInForeground=!1;mxGraph.prototype.keepEdgesInBackground=!1;
|
|
mxGraph.prototype.allowNegativeCoordinates=!0;mxGraph.prototype.constrainChildren=!0;mxGraph.prototype.constrainRelativeChildren=!1;mxGraph.prototype.extendParents=!0;mxGraph.prototype.extendParentsOnAdd=!0;mxGraph.prototype.extendParentsOnMove=!1;mxGraph.prototype.recursiveResize=!1;mxGraph.prototype.collapseToPreferredSize=!0;mxGraph.prototype.zoomFactor=1.2;mxGraph.prototype.keepSelectionVisibleOnZoom=!1;mxGraph.prototype.centerZoom=!0;mxGraph.prototype.resetViewOnRootChange=!0;
|
|
mxGraph.prototype.resetEdgesOnResize=!1;mxGraph.prototype.resetEdgesOnMove=!1;mxGraph.prototype.resetEdgesOnConnect=!0;mxGraph.prototype.allowLoops=!1;mxGraph.prototype.defaultLoopStyle=mxEdgeStyle.Loop;mxGraph.prototype.multigraph=!0;mxGraph.prototype.connectableEdges=!1;mxGraph.prototype.allowDanglingEdges=!0;mxGraph.prototype.cloneInvalidEdges=!1;mxGraph.prototype.disconnectOnMove=!0;mxGraph.prototype.labelsVisible=!0;mxGraph.prototype.htmlLabels=!1;mxGraph.prototype.swimlaneSelectionEnabled=!0;
|
|
mxGraph.prototype.swimlaneNesting=!0;mxGraph.prototype.swimlaneIndicatorColorAttribute=mxConstants.STYLE_FILLCOLOR;mxGraph.prototype.imageBundles=null;mxGraph.prototype.minFitScale=0.1;mxGraph.prototype.maxFitScale=8;mxGraph.prototype.panDx=0;mxGraph.prototype.panDy=0;mxGraph.prototype.collapsedImage=new mxImage(mxClient.imageBasePath+"/collapsed.gif",9,9);mxGraph.prototype.expandedImage=new mxImage(mxClient.imageBasePath+"/expanded.gif",9,9);
|
|
mxGraph.prototype.warningImage=new mxImage(mxClient.imageBasePath+"/warning"+(mxClient.IS_MAC?".png":".gif"),16,16);mxGraph.prototype.alreadyConnectedResource="none"!=mxClient.language?"alreadyConnected":"";mxGraph.prototype.containsValidationErrorsResource="none"!=mxClient.language?"containsValidationErrors":"";mxGraph.prototype.collapseExpandResource="none"!=mxClient.language?"collapse-expand":"";
|
|
mxGraph.prototype.init=function(a){this.container=a;this.cellEditor=this.createCellEditor();this.view.init();this.sizeDidChange();mxEvent.addListener(a,"mouseleave",mxUtils.bind(this,function(){null!=this.tooltipHandler&&this.tooltipHandler.hide()}));mxClient.IS_IE&&(mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})),mxEvent.addListener(a,"selectstart",mxUtils.bind(this,function(a){return this.isEditing()||!this.isMouseDown&&!mxEvent.isShiftDown(a)})));8==document.documentMode&&
|
|
a.insertAdjacentHTML("beforeend",'\x3cv:group style\x3d"DISPLAY: none;"\x3e\x3c/v:group\x3e')};
|
|
mxGraph.prototype.createHandlers=function(){this.tooltipHandler=this.createTooltipHandler();this.tooltipHandler.setEnabled(!1);this.selectionCellsHandler=this.createSelectionCellsHandler();this.connectionHandler=this.createConnectionHandler();this.connectionHandler.setEnabled(!1);this.graphHandler=this.createGraphHandler();this.panningHandler=this.createPanningHandler();this.panningHandler.panningEnabled=!1;this.popupMenuHandler=this.createPopupMenuHandler()};
|
|
mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(this)};mxGraph.prototype.createSelectionCellsHandler=function(){return new mxSelectionCellsHandler(this)};mxGraph.prototype.createConnectionHandler=function(){return new mxConnectionHandler(this)};mxGraph.prototype.createGraphHandler=function(){return new mxGraphHandler(this)};mxGraph.prototype.createPanningHandler=function(){return new mxPanningHandler(this)};mxGraph.prototype.createPopupMenuHandler=function(){return new mxPopupMenuHandler(this)};
|
|
mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)};mxGraph.prototype.createStylesheet=function(){return new mxStylesheet};mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)};mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer};mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)};mxGraph.prototype.getModel=function(){return this.model};mxGraph.prototype.getView=function(){return this.view};
|
|
mxGraph.prototype.getStylesheet=function(){return this.stylesheet};mxGraph.prototype.setStylesheet=function(a){this.stylesheet=a};mxGraph.prototype.getSelectionModel=function(){return this.selectionModel};mxGraph.prototype.setSelectionModel=function(a){this.selectionModel=a};
|
|
mxGraph.prototype.getSelectionCellsForChanges=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];if(d.constructor!=mxRootChange){var e=null;d instanceof mxChildChange&&null==d.previous?e=d.child:null!=d.cell&&d.cell instanceof mxCell&&(e=d.cell);null!=e&&0>mxUtils.indexOf(b,e)&&b.push(e)}}return this.getModel().getTopmostCells(b)};
|
|
mxGraph.prototype.graphModelChanged=function(a){for(var b=0;b<a.length;b++)this.processChange(a[b]);this.removeSelectionCells(this.getRemovedCellsForChanges(a));this.view.validate();this.sizeDidChange()};mxGraph.prototype.getRemovedCellsForChanges=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];if(d instanceof mxRootChange)break;else d instanceof mxChildChange?null!=d.previous&&null==d.parent&&(b=b.concat(this.model.getDescendants(d.child))):d instanceof mxVisibleChange&&(b=b.concat(this.model.getDescendants(d.cell)))}return b};
|
|
mxGraph.prototype.processChange=function(a){if(a instanceof mxRootChange)this.clearSelection(),this.removeStateForCell(a.previous),this.resetViewOnRootChange&&(this.view.scale=1,this.view.translate.x=0,this.view.translate.y=0),this.fireEvent(new mxEventObject(mxEvent.ROOT));else if(a instanceof mxChildChange){var b=this.model.getParent(a.child);this.view.invalidate(a.child,!0,!0);if(null==b||this.isCellCollapsed(b))this.view.invalidate(a.child,!0,!0),this.removeStateForCell(a.child),this.view.currentRoot==
|
|
a.child&&this.home();b!=a.previous&&(null!=b&&this.view.invalidate(b,!1,!1),null!=a.previous&&this.view.invalidate(a.previous,!1,!1))}else a instanceof mxTerminalChange||a instanceof mxGeometryChange?(a instanceof mxTerminalChange||null==a.previous&&null!=a.geometry||null!=a.previous&&!a.previous.equals(a.geometry))&&this.view.invalidate(a.cell):a instanceof mxValueChange?this.view.invalidate(a.cell,!1,!1):a instanceof mxStyleChange?(this.view.invalidate(a.cell,!0,!0),a=this.view.getState(a.cell),
|
|
null!=a&&(a.style=null)):null!=a.cell&&a.cell instanceof mxCell&&this.removeStateForCell(a.cell)};mxGraph.prototype.removeStateForCell=function(a){for(var b=this.model.getChildCount(a),c=0;c<b;c++)this.removeStateForCell(this.model.getChildAt(a,c));this.view.invalidate(a,!1,!0);this.view.removeState(a)};
|
|
mxGraph.prototype.addCellOverlay=function(a,b){null==a.overlays&&(a.overlays=[]);a.overlays.push(b);var c=this.view.getState(a);null!=c&&this.cellRenderer.redraw(c);this.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY,"cell",a,"overlay",b));return b};mxGraph.prototype.getCellOverlays=function(a){return a.overlays};
|
|
mxGraph.prototype.removeCellOverlay=function(a,b){if(null==b)this.removeCellOverlays(a);else{var c=mxUtils.indexOf(a.overlays,b);0<=c?(a.overlays.splice(c,1),0==a.overlays.length&&(a.overlays=null),c=this.view.getState(a),null!=c&&this.cellRenderer.redraw(c),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",a,"overlay",b))):b=null}return b};
|
|
mxGraph.prototype.removeCellOverlays=function(a){var b=a.overlays;if(null!=b){a.overlays=null;var c=this.view.getState(a);null!=c&&this.cellRenderer.redraw(c);for(c=0;c<b.length;c++)this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",a,"overlay",b[c]))}return b};mxGraph.prototype.clearCellOverlays=function(a){a=null!=a?a:this.model.getRoot();this.removeCellOverlays(a);for(var b=this.model.getChildCount(a),c=0;c<b;c++){var d=this.model.getChildAt(a,c);this.clearCellOverlays(d)}};
|
|
mxGraph.prototype.setCellWarning=function(a,b,c,d){if(null!=b&&0<b.length)return c=null!=c?c:this.warningImage,b=new mxCellOverlay(c,"\x3cfont color\x3dred\x3e"+b+"\x3c/font\x3e"),d&&b.addListener(mxEvent.CLICK,mxUtils.bind(this,function(b,c){this.isEnabled()&&this.setSelectionCell(a)})),this.addCellOverlay(a,b);this.removeCellOverlays(a);return null};mxGraph.prototype.startEditing=function(a){this.startEditingAtCell(null,a)};
|
|
mxGraph.prototype.startEditingAtCell=function(a,b){if(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),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);this.isEnabled()&&(!mxEvent.isConsumed(b)&&!d.isConsumed())&&(null!=c?this.selectCellForEvent(c,b):(c=null,this.isSwimlaneSelectionEnabled()&&(c=this.getSwimlaneAt(a.getGraphX(),a.getGraphY())),null!=c?this.selectCellForEvent(c,b):this.isToggleEvent(b)||this.clearSelection()))};
|
|
mxGraph.prototype.dblClick=function(a,b){var c=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",a,"cell",b);this.fireEvent(c);this.isEnabled()&&(!mxEvent.isConsumed(a)&&!c.isConsumed()&&null!=b&&this.isCellEditable(b)&&!this.isEditing(b))&&(this.startEditingAtCell(b,a),mxEvent.consume(a))};
|
|
mxGraph.prototype.tapAndHold=function(a){var b=a.getEvent(),c=new mxEventObject(mxEvent.TAP_AND_HOLD,"event",b,"cell",a.getCell());this.fireEvent(c);c.isConsumed()&&(this.panningHandler.panningTrigger=!1);this.isEnabled()&&(!mxEvent.isConsumed(b)&&!c.isConsumed()&&this.connectionHandler.isEnabled())&&(b=this.view.getState(this.connectionHandler.marker.getCell(a)),null!=b&&(this.connectionHandler.marker.currentColor=this.connectionHandler.marker.validColor,this.connectionHandler.marker.markedState=
|
|
b,this.connectionHandler.marker.mark(),this.connectionHandler.first=new mxPoint(a.getGraphX(),a.getGraphY()),this.connectionHandler.edgeState=this.connectionHandler.createEdgeState(a),this.connectionHandler.previous=b,this.connectionHandler.fireEvent(new mxEventObject(mxEvent.START,"state",this.connectionHandler.previous))))};
|
|
mxGraph.prototype.scrollPointToVisible=function(a,b,c,d){if(!this.timerAutoScroll&&(this.ignoreScrollbars||mxUtils.hasScrollbars(this.container))){var e=this.container;d=null!=d?d:20;if(a>=e.scrollLeft&&b>=e.scrollTop&&a<=e.scrollLeft+e.clientWidth&&b<=e.scrollTop+e.clientHeight){var f=e.scrollLeft+e.clientWidth-a;if(f<d){if(a=e.scrollLeft,e.scrollLeft+=d-f,c&&a==e.scrollLeft){if(this.dialect==mxConstants.DIALECT_SVG){a=this.view.getDrawPane().ownerSVGElement;var g=this.container.scrollWidth+d-f}else g=
|
|
Math.max(e.clientWidth,e.scrollWidth)+d-f,a=this.view.getCanvas();a.style.width=g+"px";e.scrollLeft+=d-f}}else f=a-e.scrollLeft,f<d&&(e.scrollLeft-=d-f);f=e.scrollTop+e.clientHeight-b;f<d?(a=e.scrollTop,e.scrollTop+=d-f,a==e.scrollTop&&c&&(this.dialect==mxConstants.DIALECT_SVG?(a=this.view.getDrawPane().ownerSVGElement,b=this.container.scrollHeight+d-f):(b=Math.max(e.clientHeight,e.scrollHeight)+d-f,a=this.view.getCanvas()),a.style.height=b+"px",e.scrollTop+=d-f)):(f=b-e.scrollTop,f<d&&(e.scrollTop-=
|
|
d-f))}}else this.allowAutoPanning&&!this.panningHandler.isActive()&&(null==this.panningManager&&(this.panningManager=this.createPanningManager()),this.panningManager.panTo(a+this.panDx,b+this.panDy))};mxGraph.prototype.createPanningManager=function(){return new mxPanningManager(this)};
|
|
mxGraph.prototype.getBorderSizes=function(){var a=mxUtils.getCurrentStyle(this.container);return new mxRectangle(mxUtils.parseCssNumber(a.paddingLeft)+("none"!=a.borderLeftStyle?mxUtils.parseCssNumber(a.borderLeftWidth):0),mxUtils.parseCssNumber(a.paddingTop)+("none"!=a.borderTopStyle?mxUtils.parseCssNumber(a.borderTopWidth):0),mxUtils.parseCssNumber(a.paddingRight)+("none"!=a.borderRightStyle?mxUtils.parseCssNumber(a.borderRightWidth):0),mxUtils.parseCssNumber(a.paddingBottom)+("none"!=a.borderBottomStyle?
|
|
mxUtils.parseCssNumber(a.borderBottomWidth):0))};mxGraph.prototype.getPreferredPageSize=function(a,b,c){a=this.view.translate;var d=this.pageFormat,e=this.pageScale,d=new mxRectangle(0,0,Math.ceil(d.width*e),Math.ceil(d.height*e));b=this.pageBreaksVisible?Math.ceil(b/d.width):1;c=this.pageBreaksVisible?Math.ceil(c/d.height):1;return new mxRectangle(0,0,b*d.width+2+a.x,c*d.height+2+a.y)};
|
|
mxGraph.prototype.fit=function(a,b,c,d,e,f){if(null!=this.container){a=null!=a?a:this.getBorder();b=null!=b?b:!1;c=null!=c?c:0;d=null!=d?d:!0;e=null!=e?e:!1;f=null!=f?f:!1;var g=this.getBorderSizes(),h=this.container.offsetWidth-g.x-g.width-1,k=this.container.offsetHeight-g.y-g.height-1,g=this.view.getGraphBounds();if(0<g.width&&0<g.height){b&&(null!=g.x&&null!=g.y)&&(g=g.clone(),g.width+=g.x,g.height+=g.y,g.x=0,g.y=0);var m=this.view.scale,l=g.width/m,n=g.height/m;null!=this.backgroundImage&&(l=
|
|
Math.max(l,this.backgroundImage.width-g.x/m),n=Math.max(n,this.backgroundImage.height-g.y/m));var p=(b?a:2*a)+c,h=h-p,k=k-p;e=e?k/n:f?h/l:Math.min(h/l,k/n);null!=this.minFitScale&&(e=Math.max(e,this.minFitScale));null!=this.maxFitScale&&(e=Math.min(e,this.maxFitScale));if(d)b?this.view.scale!=e&&this.view.setScale(e):mxUtils.hasScrollbars(this.container)?(this.view.setScale(e),a=this.getGraphBounds(),null!=a.x&&(this.container.scrollLeft=a.x),null!=a.y&&(this.container.scrollTop=a.y)):this.view.scaleAndTranslate(e,
|
|
null!=g.x?Math.floor(this.view.translate.x-g.x/m+a/e+c/2):a,null!=g.y?Math.floor(this.view.translate.y-g.y/m+a/e+c/2):a);else return e}}return this.view.scale};
|
|
mxGraph.prototype.sizeDidChange=function(){var a=this.getGraphBounds();if(null!=this.container){var b=this.getBorder(),c=Math.max(0,a.x+a.width+b),b=Math.max(0,a.y+a.height+b);null!=this.minimumContainerSize&&(c=Math.max(c,this.minimumContainerSize.width),b=Math.max(b,this.minimumContainerSize.height));this.resizeContainer&&this.doResizeContainer(c,b);if(this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var d=this.getPreferredPageSize(a,Math.max(1,c),Math.max(1,b));null!=d&&(c=d.width*this.view.scale,
|
|
b=d.height*this.view.scale)}null!=this.minimumGraphSize&&(c=Math.max(c,this.minimumGraphSize.width*this.view.scale),b=Math.max(b,this.minimumGraphSize.height*this.view.scale));c=Math.ceil(c);b=Math.ceil(b);this.dialect==mxConstants.DIALECT_SVG?(d=this.view.getDrawPane().ownerSVGElement,d.style.minWidth=Math.max(1,c)+"px",d.style.minHeight=Math.max(1,b)+"px",d.style.width="100%",d.style.height="100%"):mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,c),Math.max(1,b)):(this.view.canvas.style.minWidth=
|
|
Math.max(1,c)+"px",this.view.canvas.style.minHeight=Math.max(1,b)+"px");this.updatePageBreaks(this.pageBreaksVisible,c,b)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",a))};mxGraph.prototype.doResizeContainer=function(a,b){null!=this.maximumContainerSize&&(a=Math.min(this.maximumContainerSize.width,a),b=Math.min(this.maximumContainerSize.height,b));this.container.style.width=Math.ceil(a)+"px";this.container.style.height=Math.ceil(b)+"px"};
|
|
mxGraph.prototype.updatePageBreaks=function(a,b,c){b=this.view.scale;c=this.view.translate;var d=this.pageFormat,e=b*this.pageScale,f=new mxRectangle(0,0,d.width*e,d.height*e),d=mxRectangle.fromRectangle(this.getGraphBounds());d.width=Math.max(1,d.width);d.height=Math.max(1,d.height);f.x=Math.floor((d.x-c.x*b)/f.width)*f.width+c.x*b;f.y=Math.floor((d.y-c.y*b)/f.height)*f.height+c.y*b;d.width=Math.ceil((d.width+(d.x-f.x))/f.width)*f.width;d.height=Math.ceil((d.height+(d.y-f.y))/f.height)*f.height;
|
|
var g=(a=a&&Math.min(f.width,f.height)>this.minPageBreakDist)?Math.ceil(d.height/f.height)+1:0,h=a?Math.ceil(d.width/f.width)+1:0,k=(h-1)*f.width,m=(g-1)*f.height;null==this.horizontalPageBreaks&&0<g&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<h&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var b=a==this.horizontalPageBreaks?g:h,c=0;c<=b;c++){var d=a==this.horizontalPageBreaks?[new mxPoint(Math.round(f.x),Math.round(f.y+c*f.height)),new mxPoint(Math.round(f.x+
|
|
k),Math.round(f.y+c*f.height))]:[new mxPoint(Math.round(f.x+c*f.width),Math.round(f.y)),new mxPoint(Math.round(f.x+c*f.width),Math.round(f.y+m))];if(null!=a[c])a[c].points=d,a[c].redraw();else{var e=new mxPolyline(d,this.pageBreakColor);e.dialect=this.dialect;e.pointerEvents=!1;e.isDashed=this.pageBreakDashed;e.init(this.view.backgroundPane);e.redraw();a[c]=e}console.log("here",c,d)}for(c=b;c<a.length;c++)a[c].destroy();a.splice(b,a.length-b)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)};
|
|
mxGraph.prototype.getCellStyle=function(a){var b=this.model.getStyle(a),c=null,c=this.model.isEdge(a)?this.stylesheet.getDefaultEdgeStyle():this.stylesheet.getDefaultVertexStyle();null!=b&&(c=this.postProcessCellStyle(this.stylesheet.getCellStyle(b,c)));null==c&&(c=mxGraph.prototype.EMPTY_ARRAY);return c};
|
|
mxGraph.prototype.postProcessCellStyle=function(a){if(null!=a){var b=a[mxConstants.STYLE_IMAGE],c=this.getImageFromBundles(b);null!=c?a[mxConstants.STYLE_IMAGE]=c:c=b;null!=c&&"data:image/"==c.substring(0,11)&&("data:image/svg+xml,\x3c"==c.substring(0,20)?c=c.substring(0,19)+encodeURIComponent(c.substring(19)):"data:image/svg+xml,%3C"!=c.substring(0,22)&&(b=c.indexOf(","),0<b&&";base64,"!=c.substring(b-7,b+1)&&(c=c.substring(0,b)+";base64,"+c.substring(b+1))),a[mxConstants.STYLE_IMAGE]=c)}return a};
|
|
mxGraph.prototype.setCellStyle=function(a,b){b=b||this.getSelectionCells();if(null!=b){this.model.beginUpdate();try{for(var c=0;c<b.length;c++)this.model.setStyle(b[c],a)}finally{this.model.endUpdate()}}};mxGraph.prototype.toggleCellStyle=function(a,b,c){c=c||this.getSelectionCell();return this.toggleCellStyles(a,b,[c])};
|
|
mxGraph.prototype.toggleCellStyles=function(a,b,c){b=null!=b?b:!1;c=c||this.getSelectionCells();var d=null;if(null!=c&&0<c.length){var e=this.view.getState(c[0]),e=null!=e?e.style:this.getCellStyle(c[0]);null!=e&&(d=mxUtils.getValue(e,a,b)?0:1,this.setCellStyles(a,d,c))}return d};mxGraph.prototype.setCellStyles=function(a,b,c){c=c||this.getSelectionCells();mxUtils.setCellStyles(this.model,c,a,b)};mxGraph.prototype.toggleCellStyleFlags=function(a,b,c){this.setCellStyleFlags(a,b,null,c)};
|
|
mxGraph.prototype.setCellStyleFlags=function(a,b,c,d){d=d||this.getSelectionCells();if(null!=d&&0<d.length){if(null==c){var e=this.view.getState(d[0]),e=null!=e?e.style:this.getCellStyle(d[0]);null!=e&&(c=(parseInt(e[a]||0)&b)!=b)}mxUtils.setCellStyleFlags(this.model,d,a,b,c)}};
|
|
mxGraph.prototype.alignCells=function(a,b,c){null==b&&(b=this.getSelectionCells());if(null!=b&&1<b.length){if(null==c)for(var d=0;d<b.length;d++){var e=this.view.getState(b[d]);if(null!=e&&!this.model.isEdge(b[d]))if(null==c)if(a==mxConstants.ALIGN_CENTER){c=e.x+e.width/2;break}else if(a==mxConstants.ALIGN_RIGHT)c=e.x+e.width;else if(a==mxConstants.ALIGN_TOP)c=e.y;else if(a==mxConstants.ALIGN_MIDDLE){c=e.y+e.height/2;break}else c=a==mxConstants.ALIGN_BOTTOM?e.y+e.height:e.x;else c=a==mxConstants.ALIGN_RIGHT?
|
|
Math.max(c,e.x+e.width):a==mxConstants.ALIGN_TOP?Math.min(c,e.y):a==mxConstants.ALIGN_BOTTOM?Math.max(c,e.y+e.height):Math.min(c,e.x)}if(null!=c){var f=this.view.scale;this.model.beginUpdate();try{for(d=0;d<b.length;d++)if(e=this.view.getState(b[d]),null!=e){var g=this.getCellGeometry(b[d]);null!=g&&!this.model.isEdge(b[d])&&(g=g.clone(),a==mxConstants.ALIGN_CENTER?g.x+=(c-e.x-e.width/2)/f:a==mxConstants.ALIGN_RIGHT?g.x+=(c-e.x-e.width)/f:a==mxConstants.ALIGN_TOP?g.y+=(c-e.y)/f:a==mxConstants.ALIGN_MIDDLE?
|
|
g.y+=(c-e.y-e.height/2)/f:a==mxConstants.ALIGN_BOTTOM?g.y+=(c-e.y-e.height)/f:g.x+=(c-e.x)/f,this.resizeCell(b[d],g))}this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",a,"cells",b))}finally{this.model.endUpdate()}}}return b};
|
|
mxGraph.prototype.flipEdge=function(a){if(null!=a&&null!=this.alternateEdgeStyle){this.model.beginUpdate();try{var b=this.model.getStyle(a);null==b||0==b.length?this.model.setStyle(a,this.alternateEdgeStyle):this.model.setStyle(a,null);this.resetEdge(a);this.fireEvent(new mxEventObject(mxEvent.FLIP_EDGE,"edge",a))}finally{this.model.endUpdate()}}return a};mxGraph.prototype.addImageBundle=function(a){this.imageBundles.push(a)};
|
|
mxGraph.prototype.removeImageBundle=function(a){for(var b=[],c=0;c<this.imageBundles.length;c++)this.imageBundles[c]!=a&&b.push(this.imageBundles[c]);this.imageBundles=b};mxGraph.prototype.getImageFromBundles=function(a){if(null!=a)for(var b=0;b<this.imageBundles.length;b++){var c=this.imageBundles[b].getImage(a);if(null!=c)return c}return null};
|
|
mxGraph.prototype.orderCells=function(a,b){null==b&&(b=mxUtils.sortCells(this.getSelectionCells(),!0));this.model.beginUpdate();try{this.cellsOrdered(b,a),this.fireEvent(new mxEventObject(mxEvent.ORDER_CELLS,"back",a,"cells",b))}finally{this.model.endUpdate()}return b};
|
|
mxGraph.prototype.cellsOrdered=function(a,b){if(null!=a){this.model.beginUpdate();try{for(var c=0;c<a.length;c++){var d=this.model.getParent(a[c]);b?this.model.add(d,a[c],c):this.model.add(d,a[c],this.model.getChildCount(d)-1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ORDERED,"back",b,"cells",a))}finally{this.model.endUpdate()}}};
|
|
mxGraph.prototype.groupCells=function(a,b,c){null==c&&(c=mxUtils.sortCells(this.getSelectionCells(),!0));c=this.getCellsForGroup(c);null==a&&(a=this.createGroupCell(c));var d=this.getBoundsForGroup(a,c,b);if(0<c.length&&null!=d){var e=this.model.getParent(a);null==e&&(e=this.model.getParent(c[0]));this.model.beginUpdate();try{null==this.getCellGeometry(a)&&this.model.setGeometry(a,new mxGeometry);var f=this.model.getChildCount(e);this.cellsAdded([a],e,f,null,null,!1);f=this.model.getChildCount(a);
|
|
this.cellsAdded(c,a,f,null,null,!1,!1);this.cellsMoved(c,-d.x,-d.y,!1,!0);this.cellsResized([a],[d],!1);this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",a,"border",b,"cells",c))}finally{this.model.endUpdate()}}return a};mxGraph.prototype.getCellsForGroup=function(a){var b=[];if(null!=a&&0<a.length){var c=this.model.getParent(a[0]);b.push(a[0]);for(var d=1;d<a.length;d++)this.model.getParent(a[d])==c&&b.push(a[d])}return b};
|
|
mxGraph.prototype.getBoundsForGroup=function(a,b,c){b=this.getBoundingBoxFromGeometry(b,!0);null!=b&&(this.isSwimlane(a)&&(a=this.getStartSize(a),b.x-=a.width,b.y-=a.height,b.width+=a.width,b.height+=a.height),null!=c&&(b.x-=c,b.y-=c,b.width+=2*c,b.height+=2*c));return b};mxGraph.prototype.createGroupCell=function(a){a=new mxCell("");a.setVertex(!0);a.setConnectable(!1);return a};
|
|
mxGraph.prototype.ungroupCells=function(a){var b=[];if(null==a){a=this.getSelectionCells();for(var c=[],d=0;d<a.length;d++)0<this.model.getChildCount(a[d])&&c.push(a[d]);a=c}if(null!=a&&0<a.length){this.model.beginUpdate();try{for(d=0;d<a.length;d++){var e=this.model.getChildren(a[d]);if(null!=e&&0<e.length){var e=e.slice(),f=this.model.getParent(a[d]),g=this.model.getChildCount(f);this.cellsAdded(e,f,g,null,null,!0);b=b.concat(e)}}this.removeCellsAfterUngroup(a);this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,
|
|
"cells",a))}finally{this.model.endUpdate()}}return b};mxGraph.prototype.removeCellsAfterUngroup=function(a){this.cellsRemoved(this.addAllEdges(a))};mxGraph.prototype.removeCellsFromParent=function(a){null==a&&(a=this.getSelectionCells());this.model.beginUpdate();try{var b=this.getDefaultParent(),c=this.model.getChildCount(b);this.cellsAdded(a,b,c,null,null,!0);this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",a))}finally{this.model.endUpdate()}return a};
|
|
mxGraph.prototype.updateGroupBounds=function(a,b,c,d,e,f,g){null==a&&(a=this.getSelectionCells());b=null!=b?b:0;c=null!=c?c:!1;d=null!=d?d:0;e=null!=e?e:0;f=null!=f?f:0;g=null!=g?g:0;this.model.beginUpdate();try{for(var h=a.length-1;0<=h;h--){var k=this.getCellGeometry(a[h]);if(null!=k){var m=this.getChildCells(a[h]);if(null!=m&&0<m.length){var l=this.getBoundingBoxFromGeometry(m,!0);if(null!=l&&0<l.width&&0<l.height){var n=0,p=0;if(this.isSwimlane(a[h]))var r=this.getStartSize(a[h]),n=r.width,p=
|
|
r.height;k=k.clone();c&&(k.x=Math.round(k.x+l.x-b-n-g),k.y=Math.round(k.y+l.y-b-p-d));k.width=Math.round(l.width+2*b+n+g+e);k.height=Math.round(l.height+2*b+p+d+f);this.model.setGeometry(a[h],k);this.moveCells(m,b+n-l.x+g,b+p-l.y+d)}}}}}finally{this.model.endUpdate()}return a};
|
|
mxGraph.prototype.getBoundingBox=function(a){var b=null;if(null!=a&&0<a.length)for(var c=0;c<a.length;c++)if(this.model.isVertex(a[c])||this.model.isEdge(a[c])){var d=this.view.getBoundingBox(this.view.getState(a[c]),!0);null!=d&&(null==b?b=mxRectangle.fromRectangle(d):b.add(d))}return b};
|
|
mxGraph.prototype.cloneCells=function(a,b,c){b=null!=b?b:!0;var d=null;if(null!=a){for(var e=new mxDictionary,d=[],f=0;f<a.length;f++)e.put(a[f],!0),d.push(a[f]);if(0<d.length)for(var g=this.view.scale,h=this.view.translate,d=this.model.cloneCells(a,!0,c),f=0;f<a.length;f++)if(!b&&this.model.isEdge(d[f])&&null!=this.getEdgeValidationError(d[f],this.model.getTerminal(d[f],!0),this.model.getTerminal(d[f],!1)))d[f]=null;else{var k=this.model.getGeometry(d[f]);if(null!=k){var m=this.view.getState(a[f]),
|
|
l=this.view.getState(this.model.getParent(a[f]));if(null!=m&&null!=l)if(c=l.origin.x,l=l.origin.y,this.model.isEdge(d[f])){for(var m=m.absolutePoints,n=this.model.getTerminal(a[f],!0);null!=n&&!e.get(n);)n=this.model.getParent(n);null==n&&k.setTerminalPoint(new mxPoint(m[0].x/g-h.x,m[0].y/g-h.y),!0);for(n=this.model.getTerminal(a[f],!1);null!=n&&!e.get(n);)n=this.model.getParent(n);null==n&&(n=m.length-1,k.setTerminalPoint(new mxPoint(m[n].x/g-h.x,m[n].y/g-h.y),!1));k=k.points;if(null!=k)for(m=0;m<
|
|
k.length;m++)k[m].x+=c,k[m].y+=l}else k.translate(c,l)}}else d=[]}return d};mxGraph.prototype.insertVertex=function(a,b,c,d,e,f,g,h,k){b=this.createVertex(a,b,c,d,e,f,g,h,k);return this.addCell(b,a)};mxGraph.prototype.createVertex=function(a,b,c,d,e,f,g,h,k){a=new mxGeometry(d,e,f,g);a.relative=null!=k?k:!1;c=new mxCell(c,a,h);c.setId(b);c.setVertex(!0);c.setConnectable(!0);return c};mxGraph.prototype.insertEdge=function(a,b,c,d,e,f){b=this.createEdge(a,b,c,d,e,f);return this.addEdge(b,a,d,e)};
|
|
mxGraph.prototype.createEdge=function(a,b,c,d,e,f){a=new mxCell(c,new mxGeometry,f);a.setId(b);a.setEdge(!0);a.geometry.relative=!0;return a};mxGraph.prototype.addEdge=function(a,b,c,d,e){return this.addCell(a,b,e,c,d)};mxGraph.prototype.addCell=function(a,b,c,d,e){return this.addCells([a],b,c,d,e)[0]};
|
|
mxGraph.prototype.addCells=function(a,b,c,d,e){null==b&&(b=this.getDefaultParent());null==c&&(c=this.model.getChildCount(b));this.model.beginUpdate();try{this.cellsAdded(a,b,c,d,e,!1,!0),this.fireEvent(new mxEventObject(mxEvent.ADD_CELLS,"cells",a,"parent",b,"index",c,"source",d,"target",e))}finally{this.model.endUpdate()}return a};
|
|
mxGraph.prototype.cellsAdded=function(a,b,c,d,e,f,g){if(null!=a&&null!=b&&null!=c){this.model.beginUpdate();try{for(var h=f?this.view.getState(b):null,k=null!=h?h.origin:null,m=new mxPoint(0,0),h=0;h<a.length;h++)if(null==a[h])c--;else{var l=this.model.getParent(a[h]);if(null!=k&&a[h]!=b&&b!=l){var n=this.view.getState(l),p=null!=n?n.origin:m,r=this.model.getGeometry(a[h]);if(null!=r){var q=p.x-k.x,s=p.y-k.y,r=r.clone();r.translate(q,s);!r.relative&&(this.model.isVertex(a[h])&&!this.isAllowNegativeCoordinates())&&
|
|
(r.x=Math.max(0,r.x),r.y=Math.max(0,r.y));this.model.setGeometry(a[h],r)}}b==l&&c+h>this.model.getChildCount(b)&&c--;this.model.add(b,a[h],c+h);this.autoSizeCellsOnAdd&&this.autoSizeCell(a[h],!0);this.isExtendParentsOnAdd(a[h])&&this.isExtendParent(a[h])&&this.extendParent(a[h]);(null==g||g)&&this.constrainChild(a[h]);null!=d&&this.cellConnected(a[h],d,!0);null!=e&&this.cellConnected(a[h],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)for(var c=this.model.getChildCount(a),d=0;d<c;d++)this.autoSizeCell(this.model.getChildAt(a,d));this.getModel().isVertex(a)&&this.isAutoSizeCell(a)&&this.updateCellSize(a)};
|
|
mxGraph.prototype.removeCells=function(a,b){b=null!=b?b:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));b&&(a=this.getDeletableCells(this.addAllEdges(a)));this.model.beginUpdate();try{this.cellsRemoved(a),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS,"cells",a,"includeEdges",b))}finally{this.model.endUpdate()}return a};
|
|
mxGraph.prototype.cellsRemoved=function(a){if(null!=a&&0<a.length){var b=this.view.scale,c=this.view.translate;this.model.beginUpdate();try{for(var d=new mxDictionary,e=0;e<a.length;e++)d.put(a[e],!0);for(e=0;e<a.length;e++){for(var f=this.getAllEdges([a[e]]),g=mxUtils.bind(this,function(d,g){var l=this.model.getGeometry(d);if(null!=l){var n=this.view.getState(d);if(null!=n){for(var p=n.getVisibleTerminal(g),r=!1;null!=p;){if(a[e]==p){r=!0;break}p=this.model.getParent(p)}if(r){var p=c.x,r=c.y,q=this.view.getState(this.model.getParent(d));
|
|
null!=q&&this.model.isVertex(q.cell)&&(p=q.x/b,r=q.y/b);l=l.clone();n=n.absolutePoints;q=g?0:n.length-1;l.setTerminalPoint(new mxPoint(n[q].x/b-p,n[q].y/b-r),g);this.model.setTerminal(f[h],null,g);this.model.setGeometry(f[h],l)}}}}),h=0;h<f.length;h++)d.get(f[h])||(g(f[h],!0),g(f[h],!1));this.model.remove(a[e])}this.fireEvent(new mxEventObject(mxEvent.CELLS_REMOVED,"cells",a))}finally{this.model.endUpdate()}}};
|
|
mxGraph.prototype.splitEdge=function(a,b,c,d,e){d=d||0;e=e||0;var f=this.model.getParent(a),g=this.model.getTerminal(a,!0);this.model.beginUpdate();try{if(null==c){c=this.cloneCells([a])[0];var h=this.view.getState(a),k=this.getCellGeometry(c);if(null!=k&&null!=k.points&&null!=h){var m=this.view.translate,l=this.view.scale,n=mxUtils.findNearestSegment(h,(d+m.x)*l,(e+m.y)*l);k.points=k.points.slice(0,n);k=this.getCellGeometry(a);null!=k&&null!=k.points&&(k=k.clone(),k.points=k.points.slice(n),this.model.setGeometry(a,
|
|
k))}}this.cellsMoved(b,d,e,!1,!1);this.cellsAdded(b,f,this.model.getChildCount(f),null,null,!0);this.cellsAdded([c],f,this.model.getChildCount(f),g,b[0],!1);this.cellConnected(a,b[0],!0);this.fireEvent(new mxEventObject(mxEvent.SPLIT_EDGE,"edge",a,"cells",b,"newEdge",c,"dx",d,"dy",e))}finally{this.model.endUpdate()}return c};
|
|
mxGraph.prototype.toggleCells=function(a,b,c){null==b&&(b=this.getSelectionCells());c&&(b=this.addAllEdges(b));this.model.beginUpdate();try{this.cellsToggled(b,a),this.fireEvent(new mxEventObject(mxEvent.TOGGLE_CELLS,"show",a,"cells",b,"includeEdges",c))}finally{this.model.endUpdate()}return b};mxGraph.prototype.cellsToggled=function(a,b){if(null!=a&&0<a.length){this.model.beginUpdate();try{for(var c=0;c<a.length;c++)this.model.setVisible(a[c],b)}finally{this.model.endUpdate()}}};
|
|
mxGraph.prototype.foldCells=function(a,b,c,d,e){b=null!=b?b:!1;null==c&&(c=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing(!1);this.model.beginUpdate();try{this.cellsFolded(c,a,b,d),this.fireEvent(new mxEventObject(mxEvent.FOLD_CELLS,"collapse",a,"recurse",b,"cells",c))}finally{this.model.endUpdate()}return c};
|
|
mxGraph.prototype.cellsFolded=function(a,b,c,d){if(null!=a&&0<a.length){this.model.beginUpdate();try{for(var e=0;e<a.length;e++)if((!d||this.isCellFoldable(a[e],b))&&b!=this.isCellCollapsed(a[e])){this.model.setCollapsed(a[e],b);this.swapBounds(a[e],b);this.isExtendParent(a[e])&&this.extendParent(a[e]);if(c){var f=this.model.getChildren(a[e]);this.foldCells(f,b,c)}this.constrainChild(a[e])}this.fireEvent(new mxEventObject(mxEvent.CELLS_FOLDED,"cells",a,"collapse",b,"recurse",c))}finally{this.model.endUpdate()}}};
|
|
mxGraph.prototype.swapBounds=function(a,b){if(null!=a){var c=this.model.getGeometry(a);null!=c&&(c=c.clone(),this.updateAlternateBounds(a,c,b),c.swap(),this.model.setGeometry(a,c))}};
|
|
mxGraph.prototype.updateAlternateBounds=function(a,b,c){if(null!=a&&null!=b){c=this.view.getState(a);c=null!=c?c.style:this.getCellStyle(a);if(null==b.alternateBounds){var d=b;this.collapseToPreferredSize&&(a=this.getPreferredSizeForCell(a),null!=a&&(d=a,a=mxUtils.getValue(c,mxConstants.STYLE_STARTSIZE),0<a&&(d.height=Math.max(d.height,a))));b.alternateBounds=new mxRectangle(0,0,d.width,d.height)}if(null!=b.alternateBounds){b.alternateBounds.x=b.x;b.alternateBounds.y=b.y;var e=mxUtils.toRadians(c[mxConstants.STYLE_ROTATION]||
|
|
0);0!=e&&(a=b.alternateBounds.getCenterX()-b.getCenterX(),c=b.alternateBounds.getCenterY()-b.getCenterY(),d=Math.cos(e),e=Math.sin(e),b.alternateBounds.x+=d*a-e*c-a,b.alternateBounds.y+=e*a+d*c-c)}}};mxGraph.prototype.addAllEdges=function(a){var b=a.slice();return mxUtils.removeDuplicates(b.concat(this.getAllEdges(a)))};
|
|
mxGraph.prototype.getAllEdges=function(a){var b=[];if(null!=a)for(var c=0;c<a.length;c++){for(var d=this.model.getEdgeCount(a[c]),e=0;e<d;e++)b.push(this.model.getEdgeAt(a[c],e));d=this.model.getChildren(a[c]);b=b.concat(this.getAllEdges(d))}return b};mxGraph.prototype.updateCellSize=function(a,b){b=null!=b?b:!1;this.model.beginUpdate();try{this.cellSizeUpdated(a,b),this.fireEvent(new mxEventObject(mxEvent.UPDATE_CELL_SIZE,"cell",a,"ignoreChildren",b))}finally{this.model.endUpdate()}return a};
|
|
mxGraph.prototype.cellSizeUpdated=function(a,b){if(null!=a){this.model.beginUpdate();try{var c=this.getPreferredSizeForCell(a),d=this.model.getGeometry(a);if(null!=c&&null!=d){var e=this.isCellCollapsed(a),d=d.clone();if(this.isSwimlane(a)){var f=this.view.getState(a),g=null!=f?f.style:this.getCellStyle(a),h=this.model.getStyle(a);null==h&&(h="");mxUtils.getValue(g,mxConstants.STYLE_HORIZONTAL,!0)?(h=mxUtils.setStyle(h,mxConstants.STYLE_STARTSIZE,c.height+8),e&&(d.height=c.height+8),d.width=c.width):
|
|
(h=mxUtils.setStyle(h,mxConstants.STYLE_STARTSIZE,c.width+8),e&&(d.width=c.width+8),d.height=c.height);this.model.setStyle(a,h)}else d.width=c.width,d.height=c.height;if(!b&&!e){var k=this.view.getBounds(this.model.getChildren(a));if(null!=k){var m=this.view.translate,l=this.view.scale,n=(k.y+k.height)/l-d.y-m.y;d.width=Math.max(d.width,(k.x+k.width)/l-d.x-m.x);d.height=Math.max(d.height,n)}}this.cellsResized([a],[d],!1)}}finally{this.model.endUpdate()}}};
|
|
mxGraph.prototype.getPreferredSizeForCell=function(a){var b=null;if(null!=a){var c=this.view.getState(a)||this.view.createState(a),d=c.style;if(!this.model.isEdge(a)){var e=d[mxConstants.STYLE_FONTSIZE]||mxConstants.DEFAULT_FONTSIZE;a=b=0;if((null!=this.getImage(c)||null!=d[mxConstants.STYLE_IMAGE])&&d[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL)d[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(b+=parseFloat(d[mxConstants.STYLE_IMAGE_WIDTH])||mxLabel.prototype.imageSize),d[mxConstants.STYLE_ALIGN]!=
|
|
mxConstants.ALIGN_CENTER&&(a+=parseFloat(d[mxConstants.STYLE_IMAGE_HEIGHT])||mxLabel.prototype.imageSize);b+=2*(d[mxConstants.STYLE_SPACING]||0);b+=d[mxConstants.STYLE_SPACING_LEFT]||0;b+=d[mxConstants.STYLE_SPACING_RIGHT]||0;a+=2*(d[mxConstants.STYLE_SPACING]||0);a+=d[mxConstants.STYLE_SPACING_TOP]||0;a+=d[mxConstants.STYLE_SPACING_BOTTOM]||0;var f=this.getFoldingImage(c);null!=f&&(b+=f.width+8);f=this.cellRenderer.getLabelValue(c);null!=f&&0<f.length?(this.isHtmlLabel(c.cell)||(f=mxUtils.htmlEntities(f)),
|
|
f=f.replace(/\n/g,"\x3cbr\x3e"),e=mxUtils.getSizeForString(f,e,d[mxConstants.STYLE_FONTFAMILY]),c=e.width+b,a=e.height+a,mxUtils.getValue(d,mxConstants.STYLE_HORIZONTAL,!0)||(d=a,a=c,c=d),this.gridEnabled&&(c=this.snap(c+this.gridSize/2),a=this.snap(a+this.gridSize/2)),b=new mxRectangle(0,0,c,a)):(d=4*this.gridSize,b=new mxRectangle(0,0,d,d))}}return b};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{this.cellsResized(a,b,c),this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",a,"bounds",b))}finally{this.model.endUpdate()}return a};
|
|
mxGraph.prototype.cellsResized=function(a,b,c){c=null!=c?c:!1;if(null!=a&&null!=b&&a.length==b.length){this.model.beginUpdate();try{for(var d=0;d<a.length;d++)this.cellResized(a[d],b[d],!1,c),this.isExtendParent(a[d])&&this.extendParent(a[d]),this.constrainChild(a[d]);this.resetEdgesOnResize&&this.resetEdges(a);this.fireEvent(new mxEventObject(mxEvent.CELLS_RESIZED,"cells",a,"bounds",b))}finally{this.model.endUpdate()}}};
|
|
mxGraph.prototype.cellResized=function(a,b,c,d){var e=this.model.getGeometry(a);if(null!=e&&(e.x!=b.x||e.y!=b.y||e.width!=b.width||e.height!=b.height)){e=e.clone();!c&&e.relative?(c=e.offset,null!=c&&(c.x+=b.x-e.x,c.y+=b.y-e.y)):(e.x=b.x,e.y=b.y);e.width=b.width;e.height=b.height;!e.relative&&(this.model.isVertex(a)&&!this.isAllowNegativeCoordinates())&&(e.x=Math.max(0,e.x),e.y=Math.max(0,e.y));this.model.beginUpdate();try{d&&this.resizeChildCells(a,e),this.model.setGeometry(a,e),this.constrainChildCells(a)}finally{this.model.endUpdate()}}};
|
|
mxGraph.prototype.resizeChildCells=function(a,b){for(var c=this.model.getGeometry(a),d=b.width/c.width,c=b.height/c.height,e=this.model.getChildCount(a),f=0;f<e;f++)this.scaleCell(this.model.getChildAt(a,f),d,c,!0)};mxGraph.prototype.constrainChildCells=function(a){for(var b=this.model.getChildCount(a),c=0;c<b;c++)this.constrainChild(this.model.getChildAt(a,c))};
|
|
mxGraph.prototype.scaleCell=function(a,b,c,d){var e=this.model.getGeometry(a);if(null!=e){var f=this.view.getState(a),f=null!=f?f.style:this.getCellStyle(a),e=e.clone(),g=e.x,h=e.y,k=e.width,m=e.height;e.scale(b,c,"fixed"==f[mxConstants.STYLE_ASPECT]);"1"==f[mxConstants.STYLE_RESIZE_WIDTH]?e.width=k*b:"0"==f[mxConstants.STYLE_RESIZE_WIDTH]&&(e.width=k);"1"==f[mxConstants.STYLE_RESIZE_HEIGHT]?e.height=m*c:"0"==f[mxConstants.STYLE_RESIZE_HEIGHT]&&(e.height=m);this.isCellMovable(a)||(e.x=g,e.y=h);this.isCellResizable(a)||
|
|
(e.width=k,e.height=m);this.model.isVertex(a)?this.cellResized(a,e,!0,d):this.model.setGeometry(a,e)}};mxGraph.prototype.extendParent=function(a){if(null!=a){var b=this.model.getParent(a),c=this.getCellGeometry(b);if(null!=b&&(null!=c&&!this.isCellCollapsed(b))&&(a=this.getCellGeometry(a),null!=a&&!a.relative&&(c.width<a.x+a.width||c.height<a.y+a.height)))c=c.clone(),c.width=Math.max(c.width,a.x+a.width),c.height=Math.max(c.height,a.y+a.height),this.cellsResized([b],[c],!1)}};
|
|
mxGraph.prototype.importCells=function(a,b,c,d,e,f){return this.moveCells(a,b,c,!0,d,e,f)};
|
|
mxGraph.prototype.moveCells=function(a,b,c,d,e,f,g){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:!1;if(null!=a&&(0!=b||0!=c||d||null!=e)){a=this.model.getTopmostCells(a);this.model.beginUpdate();try{for(var h=new mxDictionary,k=0;k<a.length;k++)h.put(a[k],!0);for(var m=mxUtils.bind(this,function(a){for(;null!=a;){if(h.get(a))return!0;a=this.model.getParent(a)}return!1}),l=[],k=0;k<a.length;k++){var n=this.getCellGeometry(a[k]),p=this.model.getParent(a[k]);(null==n||!n.relative||!this.model.isEdge(p)||
|
|
!m(this.model.getTerminal(p,!0))&&!m(this.model.getTerminal(p,!1)))&&l.push(a[k])}a=l;d&&(a=this.cloneCells(a,this.isCloneInvalidEdges(),g),null==e&&(e=this.getDefaultParent()));var r=this.isAllowNegativeCoordinates();null!=e&&this.setAllowNegativeCoordinates(!0);this.cellsMoved(a,b,c,!d&&this.isDisconnectOnMove()&&this.isAllowDanglingEdges(),null==e,this.isExtendParentsOnMove()&&null==e);this.setAllowNegativeCoordinates(r);if(null!=e){var q=this.model.getChildCount(e);this.cellsAdded(a,e,q,null,
|
|
null,!0)}this.fireEvent(new mxEventObject(mxEvent.MOVE_CELLS,"cells",a,"dx",b,"dy",c,"clone",d,"target",e,"event",f))}finally{this.model.endUpdate()}}return a};
|
|
mxGraph.prototype.cellsMoved=function(a,b,c,d,e,f){if(null!=a&&(0!=b||0!=c)){f=null!=f?f:!1;this.model.beginUpdate();try{d&&this.disconnectGraph(a);for(var g=0;g<a.length;g++)this.translateCell(a[g],b,c),f&&this.isExtendParent(a[g])?this.extendParent(a[g]):e&&this.constrainChild(a[g]);this.resetEdgesOnMove&&this.resetEdges(a);this.fireEvent(new mxEventObject(mxEvent.CELLS_MOVED,"cells",a,"dx",b,"dy",c,"disconnect",d))}finally{this.model.endUpdate()}}};
|
|
mxGraph.prototype.translateCell=function(a,b,c){var d=this.model.getGeometry(a);if(null!=d){b=parseFloat(b);c=parseFloat(c);d=d.clone();d.translate(b,c);!d.relative&&(this.model.isVertex(a)&&!this.isAllowNegativeCoordinates())&&(d.x=Math.max(0,parseFloat(d.x)),d.y=Math.max(0,parseFloat(d.y)));if(d.relative&&!this.model.isEdge(a)){var e=this.model.getParent(a),f=0;this.model.isVertex(e)&&(f=this.view.getState(e),e=null!=f?f.style:this.getCellStyle(e),f=mxUtils.getValue(e,mxConstants.STYLE_ROTATION,
|
|
0));0!=f&&(f=mxUtils.toRadians(-f),e=Math.cos(f),f=Math.sin(f),c=mxUtils.getRotatedPoint(new mxPoint(b,c),e,f,new mxPoint(0,0)),b=c.x,c=c.y);null==d.offset?d.offset=new mxPoint(b,c):(d.offset.x=parseFloat(d.offset.x)+b,d.offset.y=parseFloat(d.offset.y)+c)}this.model.setGeometry(a,d)}};
|
|
mxGraph.prototype.getCellContainmentArea=function(a){if(null!=a&&!this.model.isEdge(a)){var b=this.model.getParent(a);if(null!=b&&b!=this.getDefaultParent()){var c=this.model.getGeometry(b);if(null!=c){var d=a=0,e=c.width,c=c.height;if(this.isSwimlane(b)){var f=this.getStartSize(b),g=this.view.getState(b),h=null!=g?g.style:this.getCellStyle(b),b=mxUtils.getValue(h,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),g=1==mxUtils.getValue(h,mxConstants.STYLE_FLIPH,0),h=1==mxUtils.getValue(h,mxConstants.STYLE_FLIPV,
|
|
0);if(b==mxConstants.DIRECTION_SOUTH||b==mxConstants.DIRECTION_NORTH){var k=f.width;f.width=f.height;f.height=k}if(b==mxConstants.DIRECTION_EAST&&!h||b==mxConstants.DIRECTION_NORTH&&!g||b==mxConstants.DIRECTION_WEST&&h||b==mxConstants.DIRECTION_SOUTH&&g)a=f.width,d=f.height;e-=f.width;c-=f.height}return new mxRectangle(a,d,e,c)}}}return null};mxGraph.prototype.getMaximumGraphBounds=function(){return this.maximumGraphBounds};
|
|
mxGraph.prototype.constrainChild=function(a,b){if(null!=a){var c=this.getCellGeometry(a);if(null!=c&&(this.isConstrainRelativeChildren()||!c.relative)){var d=this.model.getParent(a);this.getCellGeometry(d);var e=this.getMaximumGraphBounds();null!=e&&(d=this.getBoundingBoxFromGeometry([d],!1),null!=d&&(e=mxRectangle.fromRectangle(e),e.x-=d.x,e.y-=d.y));if(this.isConstrainChild(a)&&(d=this.getCellContainmentArea(a),null!=d)){var f=this.getOverlap(a);0<f&&(d=mxRectangle.fromRectangle(d),d.x-=d.width*
|
|
f,d.y-=d.height*f,d.width+=2*d.width*f,d.height+=2*d.height*f);null==e?e=d:(e=mxRectangle.fromRectangle(e),e.intersect(d))}if(null!=e){d=[a];if(!this.isCellCollapsed(a))for(var f=this.model.getDescendants(a),g=0;g<f.length;g++)this.isCellVisible(f[g])&&d.push(f[g]);d=this.getBoundingBoxFromGeometry(d,!1);if(null!=d){c=c.clone();f=0;c.width>e.width&&(f=c.width-e.width,c.width-=f);d.x+d.width>e.x+e.width&&(f-=d.x+d.width-e.x-e.width-f);g=0;c.height>e.height&&(g=c.height-e.height,c.height-=g);d.y+d.height>
|
|
e.y+e.height&&(g-=d.y+d.height-e.y-e.height-g);d.x<e.x&&(f-=d.x-e.x);d.y<e.y&&(g-=d.y-e.y);if(0!=f||0!=g)c.relative?(null==c.offset&&(c.offset=new mxPoint),c.offset.x+=f,c.offset.y+=g):(c.x+=f,c.y+=g);this.model.setGeometry(a,c)}}}}};
|
|
mxGraph.prototype.resetEdges=function(a){if(null!=a){for(var b=new mxDictionary,c=0;c<a.length;c++)b.put(a[c],!0);this.model.beginUpdate();try{for(c=0;c<a.length;c++){var d=this.model.getEdges(a[c]);if(null!=d)for(var e=0;e<d.length;e++){var f=this.view.getState(d[e]),g=null!=f?f.getVisibleTerminal(!0):this.view.getVisibleTerminal(d[e],!0),h=null!=f?f.getVisibleTerminal(!1):this.view.getVisibleTerminal(d[e],!1);(!b.get(g)||!b.get(h))&&this.resetEdge(d[e])}this.resetEdges(this.model.getChildren(a[c]))}}finally{this.model.endUpdate()}}};
|
|
mxGraph.prototype.resetEdge=function(a){var b=this.model.getGeometry(a);null!=b&&(null!=b.points&&0<b.points.length)&&(b=b.clone(),b.points=[],this.model.setGeometry(a,b));return a};
|
|
mxGraph.prototype.getOutlineConstraint=function(a,b,c){if(null!=b.shape){c=this.view.getPerimeterBounds(b);var d=b.style[mxConstants.STYLE_DIRECTION];if(d==mxConstants.DIRECTION_NORTH||d==mxConstants.DIRECTION_SOUTH){c.x+=c.width/2-c.height/2;c.y+=c.height/2-c.width/2;var e=c.width;c.width=c.height;c.height=e}var f=mxUtils.toRadians(b.shape.getShapeRotation());if(0!=f){var e=Math.cos(-f),f=Math.sin(-f),g=new mxPoint(c.getCenterX(),c.getCenterY());a=mxUtils.getRotatedPoint(a,e,f,g)}var g=f=1,h=0,k=
|
|
0;if(this.getModel().isVertex(b.cell)){var m=b.style[mxConstants.STYLE_FLIPH],l=b.style[mxConstants.STYLE_FLIPV];null!=b.shape&&null!=b.shape.stencil&&(m=1==mxUtils.getValue(b.style,"stencilFlipH",0)||m,l=1==mxUtils.getValue(b.style,"stencilFlipV",0)||l);if(d==mxConstants.DIRECTION_NORTH||d==mxConstants.DIRECTION_SOUTH)e=m,m=l,l=e;m&&(f=-1,h=-c.width);l&&(g=-1,k=-c.height)}a=new mxPoint((a.x-c.x)*f-h+c.x,(a.y-c.y)*g-k+c.y);b=Math.round(1E3*(a.x-c.x)/c.width)/1E3;a=Math.round(1E3*(a.y-c.y)/c.height)/
|
|
1E3;return new mxConnectionConstraint(new mxPoint(b,a),!1)}return null};mxGraph.prototype.getAllConnectionConstraints=function(a,b){return null!=a&&null!=a.shape&&null!=a.shape.stencil?a.shape.stencil.constraints:null};
|
|
mxGraph.prototype.getConnectionConstraint=function(a,b,c){b=null;var d=a.style[c?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(null!=d){var e=a.style[c?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];null!=e&&(b=new mxPoint(parseFloat(d),parseFloat(e)))}d=!1;null!=b&&(d=mxUtils.getValue(a.style,c?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0));return new mxConnectionConstraint(b,d)};
|
|
mxGraph.prototype.setConnectionConstraint=function(a,b,c,d){if(null!=d){this.model.beginUpdate();try{null==d||null==d.point?(this.setCellStyles(c?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[a]),this.setCellStyles(c?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[a])):null!=d.point&&(this.setCellStyles(c?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,d.point.x,[a]),this.setCellStyles(c?
|
|
mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,d.point.y,[a]),d.perimeter?this.setCellStyles(c?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[a]):this.setCellStyles(c?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[a]))}finally{this.model.endUpdate()}}};
|
|
mxGraph.prototype.getConnectionPoint=function(a,b){var c=null;if(null!=a&&null!=b.point){var d=this.view.getPerimeterBounds(a),e=new mxPoint(d.getCenterX(),d.getCenterY()),f=a.style[mxConstants.STYLE_DIRECTION],g=0;null!=f&&(f==mxConstants.DIRECTION_NORTH?g+=270:f==mxConstants.DIRECTION_WEST?g+=180:f==mxConstants.DIRECTION_SOUTH&&(g+=90),(f==mxConstants.DIRECTION_NORTH||f==mxConstants.DIRECTION_SOUTH)&&d.rotate90());if(null!=b.point){var h=c=1,k=0,m=0;if(this.getModel().isVertex(a.cell)){var l=a.style[mxConstants.STYLE_FLIPH],
|
|
n=a.style[mxConstants.STYLE_FLIPV];null!=a.shape&&null!=a.shape.stencil&&(l=1==mxUtils.getValue(a.style,"stencilFlipH",0)||l,n=1==mxUtils.getValue(a.style,"stencilFlipV",0)||n);if(f==mxConstants.DIRECTION_NORTH||f==mxConstants.DIRECTION_SOUTH)f=l,l=n,n=f;l&&(c=-1,k=-d.width);n&&(h=-1,m=-d.height)}c=new mxPoint(d.x+b.point.x*d.width*c-k,d.y+b.point.y*d.height*h-m)}f=a.style[mxConstants.STYLE_ROTATION]||0;b.perimeter?(0!=g&&null!=c&&(h=d=0,90==g?h=1:180==g?d=-1:270==g&&(h=-1),c=mxUtils.getRotatedPoint(c,
|
|
d,h,e)),null!=c&&b.perimeter&&(c=this.view.getPerimeterPoint(a,c,!1))):f+=g;0!=f&&null!=c&&(g=mxUtils.toRadians(f),d=Math.cos(g),h=Math.sin(g),c=mxUtils.getRotatedPoint(c,d,h,e))}null!=c&&(c.x=Math.round(c.x),c.y=Math.round(c.y));return c};mxGraph.prototype.connectCell=function(a,b,c,d){this.model.beginUpdate();try{var e=this.model.getTerminal(a,c);this.cellConnected(a,b,c,d);this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",a,"terminal",b,"source",c,"previous",e))}finally{this.model.endUpdate()}return a};
|
|
mxGraph.prototype.cellConnected=function(a,b,c,d){if(null!=a){this.model.beginUpdate();try{var e=this.model.getTerminal(a,c);this.setConnectionConstraint(a,b,c,d);this.isPortsEnabled()&&(d=null,this.isPort(b)&&(d=b.getId(),b=this.getTerminalForPort(b,c)),this.setCellStyles(c?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT,d,[a]));this.model.setTerminal(a,b,c);this.resetEdgesOnConnect&&this.resetEdge(a);this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",a,"terminal",b,"source",
|
|
c,"previous",e))}finally{this.model.endUpdate()}}};
|
|
mxGraph.prototype.disconnectGraph=function(a){if(null!=a){this.model.beginUpdate();try{for(var b=this.view.scale,c=this.view.translate,d=new mxDictionary,e=0;e<a.length;e++)d.put(a[e],!0);for(e=0;e<a.length;e++)if(this.model.isEdge(a[e])){var f=this.model.getGeometry(a[e]);if(null!=f){var g=this.view.getState(a[e]),h=this.view.getState(this.model.getParent(a[e]));if(null!=g&&null!=h){var f=f.clone(),k=-h.origin.x,m=-h.origin.y,l=g.absolutePoints,n=this.model.getTerminal(a[e],!0);if(null!=n&&this.isCellDisconnectable(a[e],
|
|
n,!0)){for(;null!=n&&!d.get(n);)n=this.model.getParent(n);null==n&&(f.setTerminalPoint(new mxPoint(l[0].x/b-c.x+k,l[0].y/b-c.y+m),!0),this.model.setTerminal(a[e],null,!0))}var p=this.model.getTerminal(a[e],!1);if(null!=p&&this.isCellDisconnectable(a[e],p,!1)){for(;null!=p&&!d.get(p);)p=this.model.getParent(p);if(null==p){var r=l.length-1;f.setTerminalPoint(new mxPoint(l[r].x/b-c.x+k,l[r].y/b-c.y+m),!1);this.model.setTerminal(a[e],null,!1)}}this.model.setGeometry(a[e],f)}}}}finally{this.model.endUpdate()}}};
|
|
mxGraph.prototype.getCurrentRoot=function(){return this.view.currentRoot};mxGraph.prototype.getTranslateForRoot=function(a){return null};mxGraph.prototype.isPort=function(a){return!1};mxGraph.prototype.getTerminalForPort=function(a,b){return this.model.getParent(a)};mxGraph.prototype.getChildOffsetForCell=function(a){return null};mxGraph.prototype.enterGroup=function(a){a=a||this.getSelectionCell();null!=a&&this.isValidRoot(a)&&(this.view.setCurrentRoot(a),this.clearSelection())};
|
|
mxGraph.prototype.exitGroup=function(){var a=this.model.getRoot(),b=this.getCurrentRoot();if(null!=b){for(var c=this.model.getParent(b);c!=a&&!this.isValidRoot(c)&&this.model.getParent(c)!=a;)c=this.model.getParent(c);c==a||this.model.getParent(c)==a?this.view.setCurrentRoot(null):this.view.setCurrentRoot(c);null!=this.view.getState(b)&&this.setSelectionCell(b)}};mxGraph.prototype.home=function(){var a=this.getCurrentRoot();null!=a&&(this.view.setCurrentRoot(null),null!=this.view.getState(a)&&this.setSelectionCell(a))};
|
|
mxGraph.prototype.isValidRoot=function(a){return null!=a};mxGraph.prototype.getGraphBounds=function(){return this.view.getGraphBounds()};mxGraph.prototype.getCellBounds=function(a,b,c){var d=[a];b&&(d=d.concat(this.model.getEdges(a)));d=this.view.getBounds(d);if(c){c=this.model.getChildCount(a);for(var e=0;e<c;e++){var f=this.getCellBounds(this.model.getChildAt(a,e),b,!0);null!=d?d.add(f):d=f}}return d};
|
|
mxGraph.prototype.getBoundingBoxFromGeometry=function(a,b){b=null!=b?b:!1;var c=null;if(null!=a)for(var d=0;d<a.length;d++)if(b||this.model.isVertex(a[d])){var e=this.getCellGeometry(a[d]);if(null!=e){var f=null;if(this.model.isEdge(a[d])){var g=e.points;if(null!=g&&0<g.length){for(var h=new mxRectangle(g[0].x,g[0].y,0,0),f=function(a){null!=a&&h.add(new mxRectangle(a.x,a.y,0,0))},k=1;k<g.length;k++)f(g[k]);f(e.getTerminalPoint(!0));f(e.getTerminalPoint(!1));f=h}}else g=this.model.getParent(a[d]),
|
|
e.relative?this.model.isVertex(g)&&g!=this.view.currentRoot&&(h=this.getBoundingBoxFromGeometry([g],!1),null!=h&&(f=new mxRectangle(e.x*h.width,e.y*h.height,e.width,e.height),0<=mxUtils.indexOf(a,g)&&(f.x+=h.x,f.y+=h.y))):(f=mxRectangle.fromRectangle(e),this.model.isVertex(g)&&0<=mxUtils.indexOf(a,g)&&(h=this.getBoundingBoxFromGeometry([g],!1),null!=h&&(f.x+=h.x,f.y+=h.y))),null!=f&&null!=e.offset&&(f.x+=e.offset.x,f.y+=e.offset.y);null!=f&&(null==c?c=mxRectangle.fromRectangle(f):c.add(f))}}return c};
|
|
mxGraph.prototype.refresh=function(a){this.view.clear(a,null==a);this.view.validate();this.sizeDidChange();this.fireEvent(new mxEventObject(mxEvent.REFRESH))};mxGraph.prototype.snap=function(a){this.gridEnabled&&(a=Math.round(a/this.gridSize)*this.gridSize);return a};
|
|
mxGraph.prototype.panGraph=function(a,b){if(this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container))this.container.scrollLeft=-a,this.container.scrollTop=-b;else{var c=this.view.getCanvas();if(this.dialect==mxConstants.DIALECT_SVG)if(0==a&&0==b){if(mxClient.IS_IE?c.setAttribute("transform","translate("+a+","+b+")"):c.removeAttribute("transform"),null!=this.shiftPreview1){for(var d=this.shiftPreview1.firstChild;null!=d;){var e=d.nextSibling;this.container.appendChild(d);d=e}null!=this.shiftPreview1.parentNode&&
|
|
this.shiftPreview1.parentNode.removeChild(this.shiftPreview1);this.shiftPreview1=null;this.container.appendChild(c.parentNode);for(d=this.shiftPreview2.firstChild;null!=d;)e=d.nextSibling,this.container.appendChild(d),d=e;null!=this.shiftPreview2.parentNode&&this.shiftPreview2.parentNode.removeChild(this.shiftPreview2);this.shiftPreview2=null}}else{c.setAttribute("transform","translate("+a+","+b+")");if(null==this.shiftPreview1){this.shiftPreview1=document.createElement("div");this.shiftPreview1.style.position=
|
|
"absolute";this.shiftPreview1.style.overflow="visible";this.shiftPreview2=document.createElement("div");this.shiftPreview2.style.position="absolute";this.shiftPreview2.style.overflow="visible";for(var f=this.shiftPreview1,d=this.container.firstChild;null!=d;)e=d.nextSibling,d!=c.parentNode?f.appendChild(d):f=this.shiftPreview2,d=e;null!=this.shiftPreview1.firstChild&&this.container.insertBefore(this.shiftPreview1,c.parentNode);null!=this.shiftPreview2.firstChild&&this.container.appendChild(this.shiftPreview2)}this.shiftPreview1.style.left=
|
|
a+"px";this.shiftPreview1.style.top=b+"px";this.shiftPreview2.style.left=a+"px";this.shiftPreview2.style.top=b+"px"}else c.style.left=a+"px",c.style.top=b+"px";this.panDx=a;this.panDy=b;this.fireEvent(new mxEventObject(mxEvent.PAN))}};mxGraph.prototype.zoomIn=function(){this.zoom(this.zoomFactor)};mxGraph.prototype.zoomOut=function(){this.zoom(1/this.zoomFactor)};
|
|
mxGraph.prototype.zoomActual=function(){1==this.view.scale?this.view.setTranslate(0,0):(this.view.translate.x=0,this.view.translate.y=0,this.view.setScale(1))};mxGraph.prototype.zoomTo=function(a,b){this.zoom(a/this.view.scale,b)};
|
|
mxGraph.prototype.center=function(a,b,c,d){a=null!=a?a:!0;b=null!=b?b:!0;c=null!=c?c:0.5;d=null!=d?d:0.5;var e=mxUtils.hasScrollbars(this.container),f=this.container.clientWidth,g=this.container.clientHeight,h=this.getGraphBounds(),k=this.view.translate,m=this.view.scale,l=a?f-h.width:0,n=b?g-h.height:0;e?(h.x-=k.x,h.y-=k.y,a=this.container.scrollWidth,b=this.container.scrollHeight,a>f&&(l=0),b>g&&(n=0),this.view.setTranslate(Math.floor(l/2-h.x),Math.floor(n/2-h.y)),this.container.scrollLeft=(a-f)/
|
|
2,this.container.scrollTop=(b-g)/2):this.view.setTranslate(a?Math.floor(k.x-h.x*m+l*c/m):k.x,b?Math.floor(k.y-h.y*m+n*d/m):k.y)};
|
|
mxGraph.prototype.zoom=function(a,b){b=null!=b?b:this.centerZoom;var c=Math.round(100*this.view.scale*a)/100,d=this.view.getState(this.getSelectionCell());a=c/this.view.scale;if(this.keepSelectionVisibleOnZoom&&null!=d)d=new mxRectangle(d.x*a,d.y*a,d.width*a,d.height*a),this.view.scale=c,this.scrollRectToVisible(d)||(this.view.revalidate(),this.view.setScale(c));else if(d=mxUtils.hasScrollbars(this.container),b&&!d){var d=this.container.offsetWidth,e=this.container.offsetHeight;if(1<a)var f=(a-1)/
|
|
(2*c),d=d*-f,e=e*-f;else f=(1/a-1)/(2*this.view.scale),d*=f,e*=f;this.view.scaleAndTranslate(c,this.view.translate.x+d,this.view.translate.y+e)}else{var f=this.view.translate.x,g=this.view.translate.y,h=this.container.scrollLeft,k=this.container.scrollTop;this.view.setScale(c);d&&(e=d=0,b&&(d=this.container.offsetWidth*(a-1)/2,e=this.container.offsetHeight*(a-1)/2),this.container.scrollLeft=(this.view.translate.x-f)*this.view.scale+Math.round(h*a+d),this.container.scrollTop=(this.view.translate.y-
|
|
g)*this.view.scale+Math.round(k*a+e))}};
|
|
mxGraph.prototype.zoomToRect=function(a){var b=this.container.clientWidth/a.width/(this.container.clientHeight/a.height);a.x=Math.max(0,a.x);a.y=Math.max(0,a.y);var c=Math.min(this.container.scrollWidth,a.x+a.width),d=Math.min(this.container.scrollHeight,a.y+a.height);a.width=c-a.x;a.height=d-a.y;1>b?(b=a.height/b,c=(b-a.height)/2,a.height=b,b=Math.min(a.y,c),a.y-=b,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,b=Math.min(a.x,c),a.x-=b,
|
|
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,e=this.view.getState(a);null!=e&&(c=new mxRectangle(c+e.x,d+e.y,e.width,e.height),b&&null!=this.container&&(d=this.container.clientWidth,e=this.container.clientHeight,c.x=c.getCenterX()-d/2,c.width=d,c.y=c.getCenterY()-e/2,c.height=e),d=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=
|
|
d.x,this.view.translate.y=d.y,this.view.setTranslate(c.x,c.y)))};
|
|
mxGraph.prototype.scrollRectToVisible=function(a){var b=!1;if(null!=a){var c=this.container.offsetWidth,d=this.container.offsetHeight,e=Math.min(c,a.width),f=Math.min(d,a.height);if(mxUtils.hasScrollbars(this.container)){c=this.container;a.x+=this.view.translate.x;a.y+=this.view.translate.y;var g=c.scrollLeft-a.x,d=Math.max(g-c.scrollLeft,0);0<g?c.scrollLeft-=g+2:(g=a.x+e-c.scrollLeft-c.clientWidth,0<g&&(c.scrollLeft+=g+2));e=c.scrollTop-a.y;g=Math.max(0,e-c.scrollTop);0<e?c.scrollTop-=e+2:(e=a.y+
|
|
f-c.scrollTop-c.clientHeight,0<e&&(c.scrollTop+=e+2));!this.useScrollbarsForPanning&&(0!=d||0!=g)&&this.view.setTranslate(d,g)}else{var g=-this.view.translate.x,h=-this.view.translate.y,k=this.view.scale;a.x+e>g+c&&(this.view.translate.x-=(a.x+e-c-g)/k,b=!0);a.y+f>h+d&&(this.view.translate.y-=(a.y+f-d-h)/k,b=!0);a.x<g&&(this.view.translate.x+=(g-a.x)/k,b=!0);a.y<h&&(this.view.translate.y+=(h-a.y)/k,b=!0);b&&(this.view.refresh(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.refresh())}}return b};
|
|
mxGraph.prototype.getCellGeometry=function(a){return this.model.getGeometry(a)};mxGraph.prototype.isCellVisible=function(a){return this.model.isVisible(a)};mxGraph.prototype.isCellCollapsed=function(a){return this.model.isCollapsed(a)};mxGraph.prototype.isCellConnectable=function(a){return this.model.isConnectable(a)};
|
|
mxGraph.prototype.isOrthogonal=function(a){var b=a.style[mxConstants.STYLE_ORTHOGONAL];if(null!=b)return b;a=this.view.getEdgeStyle(a);return a==mxEdgeStyle.SegmentConnector||a==mxEdgeStyle.ElbowConnector||a==mxEdgeStyle.SideToSide||a==mxEdgeStyle.TopToBottom||a==mxEdgeStyle.EntityRelation||a==mxEdgeStyle.OrthConnector};mxGraph.prototype.isLoop=function(a){var b=a.getVisibleTerminalState(!0);a=a.getVisibleTerminalState(!1);return null!=b&&b==a};mxGraph.prototype.isCloneEvent=function(a){return mxEvent.isControlDown(a)};
|
|
mxGraph.prototype.isToggleEvent=function(a){return mxClient.IS_MAC?mxEvent.isMetaDown(a):mxEvent.isControlDown(a)};mxGraph.prototype.isGridEnabledEvent=function(a){return null!=a&&!mxEvent.isAltDown(a)};mxGraph.prototype.isConstrainedEvent=function(a){return mxEvent.isShiftDown(a)};mxGraph.prototype.isIgnoreTerminalEvent=function(a){return!1};mxGraph.prototype.validationAlert=function(a){mxUtils.alert(a)};mxGraph.prototype.isEdgeValid=function(a,b,c){return null==this.getEdgeValidationError(a,b,c)};
|
|
mxGraph.prototype.getEdgeValidationError=function(a,b,c){if(null!=a&&!this.isAllowDanglingEdges()&&(null==b||null==c))return"";if(null!=a&&null==this.model.getTerminal(a,!0)&&null==this.model.getTerminal(a,!1))return null;if(!this.allowLoops&&b==c&&null!=b||!this.isValidConnection(b,c))return"";if(null!=b&&null!=c){var d="";if(!this.multigraph){var e=this.model.getEdgesBetween(b,c,!0);if(1<e.length||1==e.length&&e[0]!=a)d+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+
|
|
"\n"}var e=this.model.getDirectedEdgeCount(b,!0,a),f=this.model.getDirectedEdgeCount(c,!1,a);if(null!=this.multiplicities)for(var g=0;g<this.multiplicities.length;g++){var h=this.multiplicities[g].check(this,a,b,c,e,f);null!=h&&(d+=h)}h=this.validateEdge(a,b,c);null!=h&&(d+=h);return 0<d.length?d:null}return this.allowDanglingEdges?null:""};mxGraph.prototype.validateEdge=function(a,b,c){return null};
|
|
mxGraph.prototype.validateGraph=function(a,b){a=null!=a?a:this.model.getRoot();b=null!=b?b:{};for(var c=!0,d=this.model.getChildCount(a),e=0;e<d;e++){var f=this.model.getChildAt(a,e),g=b;this.isValidRoot(f)&&(g={});g=this.validateGraph(f,g);null!=g?this.setCellWarning(f,g.replace(/\n/g,"\x3cbr\x3e")):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)||"");e=this.validateCell(a,b);null!=e&&(d+=e);null==this.model.getParent(a)&&this.view.validate();return 0<d.length||!c?d:null};
|
|
mxGraph.prototype.getCellValidationError=function(a){var b=this.model.getDirectedEdgeCount(a,!0),c=this.model.getDirectedEdgeCount(a,!1);a=this.model.getValue(a);var d="";if(null!=this.multiplicities)for(var e=0;e<this.multiplicities.length;e++){var f=this.multiplicities[e];if(f.source&&mxUtils.isNode(a,f.type,f.attr,f.value)&&(0==f.max&&0<b||1==f.min&&0==b||1==f.max&&1<b))d+=f.countError+"\n";else if(!f.source&&mxUtils.isNode(a,f.type,f.attr,f.value)&&(0==f.max&&0<c||1==f.min&&0==c||1==f.max&&1<
|
|
c))d+=f.countError+"\n"}return 0<d.length?d:null};mxGraph.prototype.validateCell=function(a,b){return null};mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage};mxGraph.prototype.setBackgroundImage=function(a){this.backgroundImage=a};mxGraph.prototype.getFoldingImage=function(a){if(null!=a&&this.foldingEnabled&&!this.getModel().isEdge(a.cell)){var b=this.isCellCollapsed(a.cell);if(this.isCellFoldable(a.cell,!b))return b?this.collapsedImage:this.expandedImage}return null};
|
|
mxGraph.prototype.convertValueToString=function(a){a=this.model.getValue(a);if(null!=a){if(mxUtils.isNode(a))return a.nodeName;if("function"==typeof a.toString)return a.toString()}return""};mxGraph.prototype.getLabel=function(a){var b="";if(this.labelsVisible&&null!=a){var c=this.view.getState(a),c=null!=c?c.style:this.getCellStyle(a);mxUtils.getValue(c,mxConstants.STYLE_NOLABEL,!1)||(b=this.convertValueToString(a))}return b};mxGraph.prototype.isHtmlLabel=function(a){return this.isHtmlLabels()};
|
|
mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels};mxGraph.prototype.setHtmlLabels=function(a){this.htmlLabels=a};mxGraph.prototype.isWrapping=function(a){var b=this.view.getState(a);a=null!=b?b.style:this.getCellStyle(a);return null!=a?"wrap"==a[mxConstants.STYLE_WHITE_SPACE]:!1};mxGraph.prototype.isLabelClipped=function(a){var b=this.view.getState(a);a=null!=b?b.style:this.getCellStyle(a);return null!=a?"hidden"==a[mxConstants.STYLE_OVERFLOW]:!1};
|
|
mxGraph.prototype.getTooltip=function(a,b,c,d){var e=null;if(null!=a){if(null!=a.control&&(b==a.control.node||b.parentNode==a.control.node))e=this.collapseExpandResource,e=mxUtils.htmlEntities(mxResources.get(e)||e).replace(/\\n/g,"\x3cbr\x3e");null==e&&null!=a.overlays&&a.overlays.visit(function(a,c){if(null==e&&(b==c.node||b.parentNode==c.node))e=c.overlay.toString()});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){var b=null;return b=null!=a&&null!=a.getTooltip?a.getTooltip():this.convertValueToString(a)};mxGraph.prototype.getCursorForMouseEvent=function(a){return this.getCursorForCell(a.getCell())};mxGraph.prototype.getCursorForCell=function(a){return null};
|
|
mxGraph.prototype.getStartSize=function(a){var b=new mxRectangle,c=this.view.getState(a);a=null!=c?c.style:this.getCellStyle(a);null!=a&&(c=parseInt(mxUtils.getValue(a,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),mxUtils.getValue(a,mxConstants.STYLE_HORIZONTAL,!0)?b.height=c:b.width=c);return b};mxGraph.prototype.getImage=function(a){return null!=a&&null!=a.style?a.style[mxConstants.STYLE_IMAGE]:null};
|
|
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){if(null!=a&&this.model.getParent(a)!=this.model.getRoot()){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);if(null!=b&&!this.model.isEdge(a))return b[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE}return!1};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};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(a){return this.isCellCloneable(a)}))};
|
|
mxGraph.prototype.isCellCloneable=function(a){var b=this.view.getState(a);a=null!=b?b.style:this.getCellStyle(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(a){return this.canExportCell(a)}))};
|
|
mxGraph.prototype.canExportCell=function(a){return this.exportEnabled};mxGraph.prototype.getImportableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(a){return this.canImportCell(a)}))};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(a){return this.isCellDeletable(a)}))};mxGraph.prototype.isCellDeletable=function(a){var b=this.view.getState(a);a=null!=b?b.style:this.getCellStyle(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.isCellRotatable=function(a){var b=this.view.getState(a);return 0!=(null!=b?b.style:this.getCellStyle(a))[mxConstants.STYLE_ROTATABLE]};mxGraph.prototype.getMovableCells=function(a){return this.model.filterCells(a,mxUtils.bind(this,function(a){return this.isCellMovable(a)}))};
|
|
mxGraph.prototype.isCellMovable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(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.isCellResizable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(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.view.getState(a),b=null!=b?b.style:this.getCellStyle(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.isCellEditable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(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(a){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){var b=this.view.getState(a);a=null!=b?b.style:this.getCellStyle(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(a){return this.isCellFoldable(a,b)}))};mxGraph.prototype.isCellFoldable=function(a,b){var c=this.view.getState(a),c=null!=c?c.style:this.getCellStyle(a);return 0<this.model.getChildCount(a)&&0!=c[mxConstants.STYLE_FOLDABLE]};
|
|
mxGraph.prototype.isValidDropTarget=function(a,b,c){return null!=a&&(this.isSplitEnabled()&&this.isSplitTarget(a,b,c)||!this.model.isEdge(a)&&(this.isSwimlane(a)||0<this.model.getChildCount(a)&&!this.isCellCollapsed(a)))};
|
|
mxGraph.prototype.isSplitTarget=function(a,b,c){return this.model.isEdge(a)&&null!=b&&1==b.length&&this.isCellConnectable(b[0])&&null==this.getEdgeValidationError(a,this.model.getTerminal(a,!0),b[0])?(c=this.model.getTerminal(a,!0),a=this.model.getTerminal(a,!1),!this.model.isAncestor(b[0],c)&&!this.model.isAncestor(b[0],a)):!1};
|
|
mxGraph.prototype.getDropTarget=function(a,b,c,d){if(!this.isSwimlaneNesting())for(var e=0;e<a.length;e++)if(this.isSwimlane(a[e]))return null;e=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b));e.x-=this.panDx;e.y-=this.panDy;e=this.getSwimlaneAt(e.x,e.y);if(null==c)c=e;else if(null!=e){for(var f=this.model.getParent(e);null!=f&&this.isSwimlane(f)&&f!=c;)f=this.model.getParent(f);f==c&&(c=e)}for(;null!=c&&!this.isValidDropTarget(c,a,b)&&!this.model.isLayer(c);)c=this.model.getParent(c);
|
|
if(null==d||!d)for(var g=c;null!=g&&0>mxUtils.indexOf(a,g);)g=this.model.getParent(g);return!this.model.isLayer(c)&&null==g?c:null};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){c=c||this.getDefaultParent();if(null!=c)for(var d=this.model.getChildCount(c),e=0;e<d;e++){var f=this.model.getChildAt(c,e),g=this.getSwimlaneAt(a,b,f);if(null!=g)return g;if(this.isSwimlane(f)&&(g=this.view.getState(f),this.intersects(g,a,b)))return f}return null};
|
|
mxGraph.prototype.getCellAt=function(a,b,c,d,e,f){d=null!=d?d:!0;e=null!=e?e:!0;null==c&&(c=this.getCurrentRoot(),null==c&&(c=this.getModel().getRoot()));if(null!=c)for(var g=this.model.getChildCount(c)-1;0<=g;g--){var h=this.model.getChildAt(c,g),k=this.getCellAt(a,b,h,d,e,f);if(null!=k)return k;if(this.isCellVisible(h)&&(e&&this.model.isEdge(h)||d&&this.model.isVertex(h)))if(k=this.view.getState(h),null!=k&&(null==f||!f(k,a,b))&&this.intersects(k,a,b))return h}return null};
|
|
mxGraph.prototype.intersects=function(a,b,c){if(null!=a){var d=a.absolutePoints;if(null!=d){a=this.tolerance*this.tolerance;for(var e=d[0],f=1;f<d.length;f++){var g=d[f];if(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,b,c)<=a)return!0;e=g}}else if(e=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0),0!=e&&(d=Math.cos(-e),e=Math.sin(-e),f=new mxPoint(a.getCenterX(),a.getCenterY()),e=mxUtils.getRotatedPoint(new mxPoint(b,c),d,e,f),b=e.x,c=e.y),mxUtils.contains(a,b,c))return!0}return!1};
|
|
mxGraph.prototype.hitsSwimlaneContent=function(a,b,c){var d=this.getView().getState(a);a=this.getStartSize(a);if(null!=d){var e=this.getView().getScale();b-=d.x;c-=d.y;if(0<a.width&&0<b&&b>a.width*e||0<a.height&&0<c&&c>a.height*e)return!0}return!1};mxGraph.prototype.getChildVertices=function(a){return this.getChildCells(a,!0,!1)};mxGraph.prototype.getChildEdges=function(a){return this.getChildCells(a,!1,!0)};
|
|
mxGraph.prototype.getChildCells=function(a,b,c){a=null!=a?a:this.getDefaultParent();a=this.model.getChildCells(a,null!=b?b:!1,null!=c?c:!1);b=[];for(c=0;c<a.length;c++)this.isCellVisible(a[c])&&b.push(a[c]);return b};mxGraph.prototype.getConnections=function(a,b){return this.getEdges(a,b,!0,!0,!1)};mxGraph.prototype.getIncomingEdges=function(a,b){return this.getEdges(a,b,!0,!1,!1)};mxGraph.prototype.getOutgoingEdges=function(a,b){return this.getEdges(a,b,!1,!0,!1)};
|
|
mxGraph.prototype.getEdges=function(a,b,c,d,e,f){c=null!=c?c:!0;d=null!=d?d:!0;e=null!=e?e:!0;f=null!=f?f:!1;for(var g=[],h=this.isCellCollapsed(a),k=this.model.getChildCount(a),m=0;m<k;m++){var l=this.model.getChildAt(a,m);if(h||!this.isCellVisible(l))g=g.concat(this.model.getEdges(l,c,d))}g=g.concat(this.model.getEdges(a,c,d));h=[];for(m=0;m<g.length;m++)l=this.view.getState(g[m]),k=null!=l?l.getVisibleTerminal(!0):this.view.getVisibleTerminal(g[m],!0),l=null!=l?l.getVisibleTerminal(!1):this.view.getVisibleTerminal(g[m],
|
|
!1),(e&&k==l||k!=l&&(c&&l==a&&(null==b||this.isValidAncestor(k,b,f))||d&&k==a&&(null==b||this.isValidAncestor(l,b,f))))&&h.push(g[m]);return h};mxGraph.prototype.isValidAncestor=function(a,b,c){return c?this.model.isAncestor(b,a):this.model.getParent(a)==b};
|
|
mxGraph.prototype.getOpposites=function(a,b,c,d){c=null!=c?c:!0;d=null!=d?d:!0;var e=[],f=new mxDictionary;if(null!=a)for(var g=0;g<a.length;g++){var h=this.view.getState(a[g]),k=null!=h?h.getVisibleTerminal(!0):this.view.getVisibleTerminal(a[g],!0),h=null!=h?h.getVisibleTerminal(!1):this.view.getVisibleTerminal(a[g],!1);k==b&&null!=h&&h!=b&&d?f.get(h)||(f.put(h,!0),e.push(h)):h==b&&(null!=k&&k!=b&&c)&&!f.get(k)&&(f.put(k,!0),e.push(k))}return e};
|
|
mxGraph.prototype.getEdgesBetween=function(a,b,c){c=null!=c?c:!1;for(var d=this.getEdges(a),e=[],f=0;f<d.length;f++){var g=this.view.getState(d[f]),h=null!=g?g.getVisibleTerminal(!0):this.view.getVisibleTerminal(d[f],!0),g=null!=g?g.getVisibleTerminal(!1):this.view.getVisibleTerminal(d[f],!1);(h==a&&g==b||!c&&h==b&&g==a)&&e.push(d[f])}return e};
|
|
mxGraph.prototype.getPointForEvent=function(a,b){var c=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=this.view.scale,e=this.view.translate,f=!1!=b?this.gridSize/2:0;c.x=this.snap(c.x/d-e.x-f);c.y=this.snap(c.y/d-e.y-f);return c};
|
|
mxGraph.prototype.getCells=function(a,b,c,d,e,f){f=null!=f?f:[];if(0<c||0<d){var g=this.getModel(),h=a+c,k=b+d;null==e&&(e=this.getCurrentRoot(),null==e&&(e=g.getRoot()));if(null!=e)for(var m=g.getChildCount(e),l=0;l<m;l++){var n=g.getChildAt(e,l),p=this.view.getState(n);if(null!=p&&this.isCellVisible(n)){var r=mxUtils.getValue(p.style,mxConstants.STYLE_ROTATION)||0;0!=r&&(p=mxUtils.getBoundingBox(p,r));(g.isEdge(n)||g.isVertex(n))&&p.x>=a&&p.y+p.height<=k&&p.y>=b&&p.x+p.width<=h?f.push(n):this.getCells(a,
|
|
b,c,d,n,f)}}}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),h=0;h<g;h++){var k=this.model.getChildAt(c,h),m=this.view.getState(k);this.isCellVisible(k)&&null!=m&&(!d||m.x>=a)&&(!e||m.y>=b)&&f.push(k)}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,h=0,k=0;k<f;k++){var m=e.getChildAt(a,k);if(this.model.isVertex(m)&&this.isCellVisible(m)){for(var l=this.getConnections(m,b?a:null),n=0,p=0,r=0;r<l.length;r++)this.view.getVisibleTerminal(l[r],!0)==m?n++:p++;(c&&0==n&&0<p||!c&&0==p&&0<n)&&d.push(m);l=c?p-n:n-p;l>h&&(h=l,g=m)}}0==d.length&&null!=g&&d.push(g)}return d};
|
|
mxGraph.prototype.traverse=function(a,b,c,d,e){if(null!=c&&null!=a&&(b=null!=b?b:!0,e=e||new mxDictionary,!e.get(a)&&(e.put(a,!0),d=c(a,d),null==d||d)))if(d=this.model.getEdgeCount(a),0<d)for(var f=0;f<d;f++){var g=this.model.getEdgeAt(a,f),h=this.model.getTerminal(g,!0)==a;if(!b||h)h=this.model.getTerminal(g,!h),this.traverse(h,b,c,g,e)}};mxGraph.prototype.isCellSelected=function(a){return this.getSelectionModel().isSelected(a)};mxGraph.prototype.isSelectionEmpty=function(){return this.getSelectionModel().isEmpty()};
|
|
mxGraph.prototype.clearSelection=function(){return this.getSelectionModel().clear()};mxGraph.prototype.getSelectionCount=function(){return this.getSelectionModel().cells.length};mxGraph.prototype.getSelectionCell=function(){return this.getSelectionModel().cells[0]};mxGraph.prototype.getSelectionCells=function(){return this.getSelectionModel().cells.slice()};mxGraph.prototype.setSelectionCell=function(a){this.getSelectionModel().setCell(a)};mxGraph.prototype.setSelectionCells=function(a){this.getSelectionModel().setCells(a)};
|
|
mxGraph.prototype.addSelectionCell=function(a){this.getSelectionModel().addCell(a)};mxGraph.prototype.addSelectionCells=function(a){this.getSelectionModel().addCells(a)};mxGraph.prototype.removeSelectionCell=function(a){this.getSelectionModel().removeCell(a)};mxGraph.prototype.removeSelectionCells=function(a){this.getSelectionModel().removeCells(a)};mxGraph.prototype.selectRegion=function(a,b){var c=this.getCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(c,b);return c};
|
|
mxGraph.prototype.selectNextCell=function(){this.selectCell(!0)};mxGraph.prototype.selectPreviousCell=function(){this.selectCell()};mxGraph.prototype.selectParentCell=function(){this.selectCell(!1,!0)};mxGraph.prototype.selectChildCell=function(){this.selectCell(!1,!1,!0)};
|
|
mxGraph.prototype.selectCell=function(a,b,c){var d=this.selectionModel,e=0<d.cells.length?d.cells[0]:null;1<d.cells.length&&d.clear();var d=null!=e?this.model.getParent(e):this.getDefaultParent(),f=this.model.getChildCount(d);null==e&&0<f?(a=this.model.getChildAt(d,0),this.setSelectionCell(a)):(null==e||b)&&null!=this.view.getState(d)&&null!=this.model.getGeometry(d)?this.getCurrentRoot()!=d&&this.setSelectionCell(d):null!=e&&c?0<this.model.getChildCount(e)&&(a=this.model.getChildAt(e,0),this.setSelectionCell(a)):
|
|
0<f&&(b=d.getIndex(e),a?(b++,a=this.model.getChildAt(d,b%f)):(b--,a=this.model.getChildAt(d,0>b?f-1:b)),this.setSelectionCell(a))};mxGraph.prototype.selectAll=function(a,b){a=a||this.getDefaultParent();var c=b?this.model.filterDescendants(function(b){return b!=a},a):this.model.getChildren(a);null!=c&&this.setSelectionCells(c)};mxGraph.prototype.selectVertices=function(a){this.selectCells(!0,!1,a)};mxGraph.prototype.selectEdges=function(a){this.selectCells(!1,!0,a)};
|
|
mxGraph.prototype.selectCells=function(a,b,c){c=c||this.getDefaultParent();var d=mxUtils.bind(this,function(c){return null!=this.view.getState(c)&&(0==this.model.getChildCount(c)&&this.model.isVertex(c)&&a&&!this.model.isEdge(this.model.getParent(c))||this.model.isEdge(c)&&b)});c=this.model.filterDescendants(d,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))var b=a.getVisibleTerminalState(!0),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){var c=null;return c=b==mxEdgeStyle.Loop||b==mxEdgeStyle.ElbowConnector||b==mxEdgeStyle.SideToSide||b==mxEdgeStyle.TopToBottom?this.createElbowEdgeHandler(a):b==mxEdgeStyle.SegmentConnector||b==mxEdgeStyle.OrthConnector?this.createEdgeSegmentHandler(a):new mxEdgeHandler(a)};mxGraph.prototype.createEdgeSegmentHandler=function(a){return new mxEdgeSegmentHandler(a)};mxGraph.prototype.createElbowEdgeHandler=function(a){return new mxElbowEdgeHandler(a)};
|
|
mxGraph.prototype.addMouseListener=function(a){null==this.mouseListeners&&(this.mouseListeners=[]);this.mouseListeners.push(a)};mxGraph.prototype.removeMouseListener=function(a){if(null!=this.mouseListeners)for(var b=0;b<this.mouseListeners.length;b++)if(this.mouseListeners[b]==a){this.mouseListeners.splice(b,1);break}};
|
|
mxGraph.prototype.updateMouseEvent=function(a,b){if(null==a.graphX||null==a.graphY){var c=mxUtils.convertPoint(this.container,a.getX(),a.getY());a.graphX=c.x-this.panDx;a.graphY=c.y-this.panDy;null==a.getCell()&&(this.isMouseDown&&b==mxEvent.MOUSE_MOVE)&&(a.state=this.view.getState(this.getCellAt(c.x,c.y,null,null,null,function(a){return null==a.shape||a.shape.paintBackground!=mxRectangleShape.prototype.paintBackground||"1"==mxUtils.getValue(a.style,mxConstants.STYLE_POINTER_EVENTS,"1")||null!=a.shape.fill&&
|
|
a.shape.fill!=mxConstants.NONE})))}return a};mxGraph.prototype.getStateForTouchEvent=function(a){var b=mxEvent.getClientX(a);a=mxEvent.getClientY(a);b=mxUtils.convertPoint(this.container,b,a);return this.view.getState(this.getCellAt(b.x,b.y))};
|
|
mxGraph.prototype.isEventIgnored=function(a,b,c){var d=mxEvent.isMouseEvent(b.getEvent()),e=!1;b.getEvent()==this.lastEvent?e=!0:this.lastEvent=b.getEvent();null!=this.eventSource&&a!=mxEvent.MOUSE_MOVE?(mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveRedirect,this.mouseUpRedirect),this.eventSource=this.mouseUpRedirect=this.mouseMoveRedirect=null):null!=this.eventSource&&b.getSource()!=this.eventSource?e=!0:mxClient.IS_TOUCH&&(a==mxEvent.MOUSE_DOWN&&!d)&&(this.eventSource=b.getSource(),
|
|
this.mouseMoveRedirect=mxUtils.bind(this,function(a){this.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(a,this.getStateForTouchEvent(a)))}),this.mouseUpRedirect=mxUtils.bind(this,function(a){this.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(a,this.getStateForTouchEvent(a)))}),mxEvent.addGestureListeners(this.eventSource,null,this.mouseMoveRedirect,this.mouseUpRedirect));this.isSyntheticEventIgnored(a,b,c)&&(e=!0);if(!mxEvent.isPopupTrigger(this.lastEvent)&&a!=mxEvent.MOUSE_MOVE&&2==this.lastEvent.detail)return!0;
|
|
if(a==mxEvent.MOUSE_UP&&this.isMouseDown)this.isMouseDown=!1;else if(a==mxEvent.MOUSE_DOWN&&!this.isMouseDown)this.isMouseDown=!0,this.isMouseTrigger=d;else if(!e&&((!mxClient.IS_FF||a!=mxEvent.MOUSE_MOVE)&&this.isMouseDown&&this.isMouseTrigger!=d||a==mxEvent.MOUSE_DOWN&&this.isMouseDown||a==mxEvent.MOUSE_UP&&!this.isMouseDown))e=!0;!e&&a==mxEvent.MOUSE_DOWN&&(this.lastMouseX=b.getX(),this.lastMouseY=b.getY());return e};
|
|
mxGraph.prototype.isSyntheticEventIgnored=function(a,b,c){c=!1;b=mxEvent.isMouseEvent(b.getEvent());this.ignoreMouseEvents&&b&&a!=mxEvent.MOUSE_MOVE?(this.ignoreMouseEvents=a!=mxEvent.MOUSE_UP,c=!0):mxClient.IS_FF&&(!b&&a==mxEvent.MOUSE_UP)&&(this.ignoreMouseEvents=!0);return c};
|
|
mxGraph.prototype.isEventSourceIgnored=function(a,b){var c=b.getSource(),d=null!=c.nodeName?c.nodeName.toLowerCase():"",e=!mxEvent.isMouseEvent(b.getEvent())||mxEvent.isLeftMouseButton(b.getEvent());return a==mxEvent.MOUSE_DOWN&&e&&("select"==d||"option"==d||"input"==d&&"checkbox"!=c.type&&"radio"!=c.type&&"button"!=c.type&&"submit"!=c.type&&"file"!=c.type)};mxGraph.prototype.getEventState=function(a){return a};
|
|
mxGraph.prototype.fireMouseEvent=function(a,b,c){if(this.isEventSourceIgnored(a,b))null!=this.tooltipHandler&&this.tooltipHandler.hide();else{null==c&&(c=this);b=this.updateMouseEvent(b,a);if(!this.nativeDblClickEnabled&&!mxEvent.isPopupTrigger(b.getEvent())||this.doubleTapEnabled&&mxClient.IS_TOUCH&&mxEvent.isTouchEvent(b.getEvent())){var d=(new Date).getTime();if(!mxClient.IS_QUIRKS&&a==mxEvent.MOUSE_DOWN||mxClient.IS_QUIRKS&&a==mxEvent.MOUSE_UP&&!this.fireDoubleClick)if(null!=this.lastTouchEvent&&
|
|
this.lastTouchEvent!=b.getEvent()&&d-this.lastTouchTime<this.doubleTapTimeout&&Math.abs(this.lastTouchX-b.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-b.getY())<this.doubleTapTolerance&&2>this.doubleClickCounter){if(this.doubleClickCounter++,d=!1,a==mxEvent.MOUSE_UP?b.getCell()==this.lastTouchCell&&null!=this.lastTouchCell&&(this.lastTouchTime=0,d=this.lastTouchCell,this.lastTouchCell=null,mxClient.IS_QUIRKS&&b.getSource().fireEvent("ondblclick"),this.dblClick(b.getEvent(),d),d=!0):(this.fireDoubleClick=
|
|
!0,this.lastTouchTime=0),!mxClient.IS_QUIRKS||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())&&
|
|
(mxClient.IS_GC||mxClient.IS_SF))&&Math.abs(this.lastTouchX-b.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-b.getY())<this.doubleTapTolerance?this.dblClick(b.getEvent(),d):mxEvent.consume(b.getEvent());return}}if(!this.isEventIgnored(a,b,c)){b.state=this.getEventState(b.getState());this.fireEvent(new mxEventObject(mxEvent.FIRE_MOUSE_EVENT,"eventName",a,"event",b));if(mxClient.IS_OP||mxClient.IS_SF||mxClient.IS_GC||mxClient.IS_IE11||mxClient.IS_IE&&mxClient.IS_SVG||b.getEvent().target!=
|
|
this.container){if(a==mxEvent.MOUSE_MOVE&&this.isMouseDown&&this.autoScroll&&!mxEvent.isMultiTouchEvent(b.getEvent))this.scrollPointToVisible(b.getGraphX(),b.getGraphY(),this.autoExtend);else if(a==mxEvent.MOUSE_UP&&this.ignoreScrollbars&&this.translateToScrollPosition&&(0!=this.container.scrollLeft||0!=this.container.scrollTop)){var d=this.view.scale,e=this.view.translate;this.view.setTranslate(e.x-this.container.scrollLeft/d,e.y-this.container.scrollTop/d);this.container.scrollLeft=0;this.container.scrollTop=
|
|
0}if(null!=this.mouseListeners){d=[c,b];b.getEvent().preventDefault||(b.getEvent().returnValue=!0);for(e=0;e<this.mouseListeners.length;e++){var f=this.mouseListeners[e];a==mxEvent.MOUSE_DOWN?f.mouseDown.apply(f,d):a==mxEvent.MOUSE_MOVE?f.mouseMove.apply(f,d):a==mxEvent.MOUSE_UP&&f.mouseUp.apply(f,d)}}a==mxEvent.MOUSE_UP&&this.click(b)}mxEvent.isTouchEvent(b.getEvent())&&a==mxEvent.MOUSE_DOWN&&this.tapAndHoldEnabled&&!this.tapAndHoldInProgress?(this.tapAndHoldInProgress=!0,this.initialTouchX=b.getGraphX(),
|
|
this.initialTouchY=b.getGraphY(),this.tapAndHoldThread&&window.clearTimeout(this.tapAndHoldThread),this.tapAndHoldThread=window.setTimeout(mxUtils.bind(this,function(){this.tapAndHoldValid&&this.tapAndHold(b);this.tapAndHoldValid=this.tapAndHoldInProgress=!1}),this.tapAndHoldDelay),this.tapAndHoldValid=!0):a==mxEvent.MOUSE_UP?this.tapAndHoldValid=this.tapAndHoldInProgress=!1:this.tapAndHoldValid&&(this.tapAndHoldValid=Math.abs(this.initialTouchX-b.getGraphX())<this.tolerance&&Math.abs(this.initialTouchY-
|
|
b.getGraphY())<this.tolerance);a==mxEvent.MOUSE_DOWN&&(this.isEditing()&&!this.cellEditor.isEventSource(b.getEvent()))&&this.stopEditing(!this.isInvokesStopCellEditing());this.consumeMouseEvent(a,b,c)}}};mxGraph.prototype.consumeMouseEvent=function(a,b,c){a==mxEvent.MOUSE_DOWN&&mxEvent.isTouchEvent(b.getEvent())&&b.consume(!1)};mxGraph.prototype.fireGestureEvent=function(a,b){this.lastTouchTime=0;this.fireEvent(new mxEventObject(mxEvent.GESTURE,"event",a,"cell",b))};
|
|
mxGraph.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tooltipHandler&&this.tooltipHandler.destroy(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.destroy(),null!=this.panningHandler&&this.panningHandler.destroy(),null!=this.popupMenuHandler&&this.popupMenuHandler.destroy(),null!=this.connectionHandler&&this.connectionHandler.destroy(),null!=this.graphHandler&&this.graphHandler.destroy(),null!=this.cellEditor&&this.cellEditor.destroy(),null!=this.view&&this.view.destroy(),
|
|
null!=this.model&&null!=this.graphModelChangeListener&&(this.model.removeListener(this.graphModelChangeListener),this.graphModelChangeListener=null),this.container=null)};function mxLayoutManager(a){this.undoHandler=mxUtils.bind(this,function(a,c){this.isEnabled()&&this.beforeUndo(c.getProperty("edit"))});this.moveHandler=mxUtils.bind(this,function(a,c){this.isEnabled()&&this.cellsMoved(c.getProperty("cells"),c.getProperty("event"))});this.setGraph(a)}mxLayoutManager.prototype=new mxEventSource;
|
|
mxLayoutManager.prototype.constructor=mxLayoutManager;mxLayoutManager.prototype.graph=null;mxLayoutManager.prototype.bubbling=!0;mxLayoutManager.prototype.enabled=!0;mxLayoutManager.prototype.updateHandler=null;mxLayoutManager.prototype.moveHandler=null;mxLayoutManager.prototype.isEnabled=function(){return this.enabled};mxLayoutManager.prototype.setEnabled=function(a){this.enabled=a};mxLayoutManager.prototype.isBubbling=function(){return this.bubbling};
|
|
mxLayoutManager.prototype.setBubbling=function(a){this.bubbling=a};mxLayoutManager.prototype.getGraph=function(){return this.graph};mxLayoutManager.prototype.setGraph=function(a){if(null!=this.graph){var b=this.graph.getModel();b.removeListener(this.undoHandler);this.graph.removeListener(this.moveHandler)}this.graph=a;null!=this.graph&&(b=this.graph.getModel(),b.addListener(mxEvent.BEFORE_UNDO,this.undoHandler),this.graph.addListener(mxEvent.MOVE_CELLS,this.moveHandler))};
|
|
mxLayoutManager.prototype.getLayout=function(a){return null};mxLayoutManager.prototype.beforeUndo=function(a){a=this.getCellsForChanges(a.changes);for(var b=this.getGraph().getModel(),c=[],d=0;d<a.length;d++)c=c.concat(b.getDescendants(a[d]));a=c;if(this.isBubbling())for(c=b.getParents(a);0<c.length;)a=a.concat(c),c=b.getParents(c);this.executeLayoutForCells(a)};mxLayoutManager.prototype.executeLayoutForCells=function(a){a=mxUtils.sortCells(a,!0);a=a.concat(a.slice().reverse());this.layoutCells(a)};
|
|
mxLayoutManager.prototype.cellsMoved=function(a,b){if(null!=a&&null!=b)for(var c=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(b),mxEvent.getClientY(b)),d=this.getGraph().getModel(),e=0;e<a.length;e++){var f=d.getParent(a[e]);0>mxUtils.indexOf(a,f)&&(f=this.getLayout(f),null!=f&&f.moveCell(a[e],c.x,c.y))}};
|
|
mxLayoutManager.prototype.getCellsForChanges=function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++){var e=a[d];if(e instanceof mxRootChange)return[];for(var e=this.getCellsForChange(e),f=0;f<e.length;f++)null!=e[f]&&!b.get(e[f])&&(b.put(e[f],!0),c.push(e[f]))}return c};
|
|
mxLayoutManager.prototype.getCellsForChange=function(a){var b=this.getGraph().getModel();return a instanceof mxChildChange?[a.child,a.previous,b.getParent(a.child)]:a instanceof mxTerminalChange||a instanceof mxGeometryChange?[a.cell,b.getParent(a.cell)]:a instanceof mxVisibleChange||a instanceof mxStyleChange?[a.cell]:[]};
|
|
mxLayoutManager.prototype.layoutCells=function(a){if(0<a.length){var b=this.getGraph().getModel();b.beginUpdate();try{for(var c=null,d=0;d<a.length;d++)a[d]!=b.getRoot()&&a[d]!=c&&this.executeLayout(this.getLayout(a[d]),a[d])&&(c=a[d]);this.fireEvent(new mxEventObject(mxEvent.LAYOUT_CELLS,"cells",a))}finally{b.endUpdate()}}};mxLayoutManager.prototype.executeLayout=function(a,b){var c=!1;null!=a&&null!=b&&(a.execute(b),c=!0);return c};mxLayoutManager.prototype.destroy=function(){this.setGraph(null)};
|
|
function mxConnectionConstraint(a,b){this.point=a;this.perimeter=null!=b?b:!0}mxConnectionConstraint.prototype.point=null;mxConnectionConstraint.prototype.perimeter=null;
|
|
function mxGraphHandler(a){this.graph=a;this.graph.addMouseListener(this);this.panHandler=mxUtils.bind(this,function(){this.updatePreviewShape();this.updateHint()});this.graph.addListener(mxEvent.PAN,this.panHandler);this.escapeHandler=mxUtils.bind(this,function(a,c){this.reset()});this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler)}mxGraphHandler.prototype.graph=null;mxGraphHandler.prototype.maxCells=mxClient.IS_IE?20:50;mxGraphHandler.prototype.enabled=!0;
|
|
mxGraphHandler.prototype.highlightEnabled=!0;mxGraphHandler.prototype.cloneEnabled=!0;mxGraphHandler.prototype.moveEnabled=!0;mxGraphHandler.prototype.guidesEnabled=!1;mxGraphHandler.prototype.guide=null;mxGraphHandler.prototype.currentDx=null;mxGraphHandler.prototype.currentDy=null;mxGraphHandler.prototype.updateCursor=!0;mxGraphHandler.prototype.selectEnabled=!0;mxGraphHandler.prototype.removeCellsFromParent=!0;mxGraphHandler.prototype.connectOnDrop=!1;mxGraphHandler.prototype.scrollOnMove=!0;
|
|
mxGraphHandler.prototype.minimumSize=6;mxGraphHandler.prototype.previewColor="black";mxGraphHandler.prototype.htmlPreview=!1;mxGraphHandler.prototype.shape=null;mxGraphHandler.prototype.scaleGrid=!1;mxGraphHandler.prototype.rotationEnabled=!0;mxGraphHandler.prototype.isEnabled=function(){return this.enabled};mxGraphHandler.prototype.setEnabled=function(a){this.enabled=a};mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled};
|
|
mxGraphHandler.prototype.setCloneEnabled=function(a){this.cloneEnabled=a};mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled};mxGraphHandler.prototype.setMoveEnabled=function(a){this.moveEnabled=a};mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled};mxGraphHandler.prototype.setSelectEnabled=function(a){this.selectEnabled=a};mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent};
|
|
mxGraphHandler.prototype.setRemoveCellsFromParent=function(a){this.removeCellsFromParent=a};mxGraphHandler.prototype.getInitialCellForEvent=function(a){return a.getCell()};mxGraphHandler.prototype.isDelayedSelection=function(a,b){return this.graph.isCellSelected(a)};
|
|
mxGraphHandler.prototype.mouseDown=function(a,b){if(!b.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&null!=b.getState()&&!mxEvent.isMultiTouchEvent(b.getEvent())){var c=this.getInitialCellForEvent(b);this.delayedSelection=this.isDelayedSelection(c,b);this.cell=null;this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(c,b.getEvent());if(this.isMoveEnabled()){var d=this.graph.model,e=d.getGeometry(c);this.graph.isCellMovable(c)&&(!d.isEdge(c)||1<this.graph.getSelectionCount()||
|
|
null!=e.points&&0<e.points.length||null==d.getTerminal(c,!0)||null==d.getTerminal(c,!1)||this.graph.allowDanglingEdges||this.graph.isCloneEvent(b.getEvent())&&this.graph.isCellsCloneable())?this.start(c,b.getX(),b.getY()):this.delayedSelection&&(this.cell=c);this.cellWasClicked=!0;b.consume()}}};
|
|
mxGraphHandler.prototype.getGuideStates=function(){var a=this.graph.getDefaultParent(),b=this.graph.getModel(),c=mxUtils.bind(this,function(a){return null!=this.graph.view.getState(a)&&b.isVertex(a)&&null!=b.getGeometry(a)&&!b.getGeometry(a).relative});return this.graph.view.getCellStates(b.filterDescendants(c,a))};mxGraphHandler.prototype.getCells=function(a){return!this.delayedSelection&&this.graph.isCellMovable(a)?[a]:this.graph.getMovableCells(this.graph.getSelectionCells())};
|
|
mxGraphHandler.prototype.getPreviewBounds=function(a){a=this.getBoundingBox(a);null!=a&&(a.width=Math.max(0,a.width-1),a.height=Math.max(0,a.height-1),a.width<this.minimumSize?(a.x-=(this.minimumSize-a.width)/2,a.width=this.minimumSize):(a.x=Math.round(a.x),a.width=Math.ceil(a.width)),a.height<this.minimumSize?(a.y-=(this.minimumSize-a.height)/2,a.height=this.minimumSize):(a.y=Math.round(a.y),a.height=Math.ceil(a.height)));return a};
|
|
mxGraphHandler.prototype.getBoundingBox=function(a){var b=null;if(null!=a&&0<a.length)for(var c=this.graph.getModel(),d=0;d<a.length;d++)if(c.isVertex(a[d])||c.isEdge(a[d])){var e=this.graph.view.getState(a[d]);if(null!=e){var f=e;c.isVertex(a[d])&&(null!=e.shape&&null!=e.shape.boundingBox)&&(f=e.shape.boundingBox);null==b?b=mxRectangle.fromRectangle(f):b.add(f)}}return b};
|
|
mxGraphHandler.prototype.createPreviewShape=function(a){a=new mxRectangleShape(a,null,this.previewColor);a.isDashed=!0;this.htmlPreview?(a.dialect=mxConstants.DIALECT_STRICTHTML,a.init(this.graph.container)):(a.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,a.init(this.graph.getView().getOverlayPane()),a.pointerEvents=!1,mxClient.IS_IOS&&(a.getSvgScreenOffset=function(){return 0}));return a};
|
|
mxGraphHandler.prototype.start=function(a,b,c){this.cell=a;this.first=mxUtils.convertPoint(this.graph.container,b,c);this.cells=this.getCells(this.cell);this.bounds=this.graph.getView().getBounds(this.cells);this.pBounds=this.getPreviewBounds(this.cells);this.guidesEnabled&&(this.guide=new mxGuide(this.graph,this.getGuideStates()))};mxGraphHandler.prototype.useGuidesForEvent=function(a){return null!=this.guide?this.guide.isEnabledForEvent(a.getEvent()):!0};
|
|
mxGraphHandler.prototype.snap=function(a){var b=this.scaleGrid?this.graph.view.scale:1;a.x=this.graph.snap(a.x/b)*b;a.y=this.graph.snap(a.y/b)*b;return a};mxGraphHandler.prototype.getDelta=function(a){a=mxUtils.convertPoint(this.graph.container,a.getX(),a.getY());var b=this.graph.view.scale;return new mxPoint(this.roundLength((a.x-this.first.x)/b)*b,this.roundLength((a.y-this.first.y)/b)*b)};mxGraphHandler.prototype.updateHint=function(a){};mxGraphHandler.prototype.removeHint=function(){};
|
|
mxGraphHandler.prototype.roundLength=function(a){return Math.round(a)};
|
|
mxGraphHandler.prototype.mouseMove=function(a,b){var c=this.graph;if(!b.isConsumed()&&c.isMouseDown&&null!=this.cell&&null!=this.first&&null!=this.bounds)if(mxEvent.isMultiTouchEvent(b.getEvent()))this.reset();else{var d=this.getDelta(b),e=d.x,d=d.y,f=c.tolerance;if(null!=this.shape||Math.abs(e)>f||Math.abs(d)>f){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3));null==this.shape&&(this.shape=this.createPreviewShape(this.bounds));var g=c.isGridEnabledEvent(b.getEvent()),
|
|
f=!0;if(null!=this.guide&&this.useGuidesForEvent(b))d=this.guide.move(this.bounds,new mxPoint(e,d),g),f=!1,e=d.x,d=d.y;else if(g)var h=c.getView().translate,k=c.getView().scale,g=this.bounds.x-(c.snap(this.bounds.x/k-h.x)+h.x)*k,h=this.bounds.y-(c.snap(this.bounds.y/k-h.y)+h.y)*k,d=this.snap(new mxPoint(e,d)),e=d.x-g,d=d.y-h;null!=this.guide&&f&&this.guide.hide();c.isConstrainedEvent(b.getEvent())&&(Math.abs(e)>Math.abs(d)?d=0:e=0);this.currentDx=e;this.currentDy=d;this.updatePreviewShape();f=null;
|
|
d=b.getCell();g=c.isCloneEvent(b.getEvent())&&c.isCellsCloneable()&&this.isCloneEnabled();c.isDropEnabled()&&this.highlightEnabled&&(f=c.getDropTarget(this.cells,b.getEvent(),d,g));e=c.getView().getState(f);h=!1;null!=e&&(c.model.getParent(this.cell)!=f||g)?(this.target!=f&&(this.target=f,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),h=!0):(this.target=null,this.connectOnDrop&&(null!=d&&1==this.cells.length&&c.getModel().isVertex(d)&&c.isCellConnectable(d))&&(e=c.getView().getState(d),null!=
|
|
e&&(c=null==c.getEdgeValidationError(null,this.cell,d)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,this.setHighlightColor(c),h=!0)));null!=e&&h?this.highlight.highlight(e):this.highlight.hide()}this.updateHint(b);b.consume();mxEvent.consume(b.getEvent())}else if((this.isMoveEnabled()||this.isCloneEnabled())&&this.updateCursor&&!b.isConsumed()&&null!=b.getState()&&!c.isMouseDown)e=c.getCursorForMouseEvent(b),null==e&&(c.isEnabled()&&c.isCellMovable(b.getCell()))&&(e=c.getModel().isEdge(b.getCell())?
|
|
mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),null!=b.sourceState&&b.sourceState.setCursor(e)};mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx-this.graph.panDx),Math.round(this.pBounds.y+this.currentDy-this.graph.panDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())};mxGraphHandler.prototype.setHighlightColor=function(a){null!=this.highlight&&this.highlight.setHighlightColor(a)};
|
|
mxGraphHandler.prototype.mouseUp=function(a,b){if(!b.isConsumed()){var c=this.graph;if(null!=this.cell&&null!=this.first&&null!=this.shape&&null!=this.currentDx&&null!=this.currentDy){var d=b.getCell();if(this.connectOnDrop&&null==this.target&&null!=d&&c.getModel().isVertex(d)&&c.isCellConnectable(d)&&c.isEdgeValid(null,this.cell,d))c.connectionHandler.connect(this.cell,d,b.getEvent());else{var d=c.isCloneEvent(b.getEvent())&&c.isCellsCloneable()&&this.isCloneEnabled(),e=c.getView().scale,f=this.roundLength(this.currentDx/
|
|
e),e=this.roundLength(this.currentDy/e),g=this.target;c.isSplitEnabled()&&c.isSplitTarget(g,this.cells,b.getEvent())?c.splitEdge(g,this.cells,null,f,e):this.moveCells(this.cells,f,e,d,this.target,b.getEvent())}}else this.isSelectEnabled()&&(this.delayedSelection&&null!=this.cell)&&this.selectDelayed(b)}this.cellWasClicked&&b.consume();this.reset()};
|
|
mxGraphHandler.prototype.selectDelayed=function(a){(!this.graph.isCellSelected(this.cell)||!this.graph.popupMenuHandler.isPopupTrigger(a))&&this.graph.selectCellForEvent(this.cell,a.getEvent())};mxGraphHandler.prototype.reset=function(){this.destroyShapes();this.removeHint();this.delayedSelection=this.cellWasClicked=!1;this.target=this.cell=this.first=this.guides=this.currentDy=this.currentDx=null};
|
|
mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,b,c){if(this.graph.getModel().isVertex(a)){a=this.graph.getView().getState(a);c=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(c),mxEvent.getClientY(c));var d=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);if(0!=d){b=Math.cos(-d);var d=Math.sin(-d),e=new mxPoint(a.getCenterX(),a.getCenterY());c=mxUtils.getRotatedPoint(c,b,d,e)}return null!=a&&!mxUtils.contains(a,c.x,c.y)}return!1};
|
|
mxGraphHandler.prototype.moveCells=function(a,b,c,d,e,f){d&&(a=this.graph.getCloneableCells(a));null==e&&(this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(this.graph.getModel().getParent(this.cell),a,f))&&(e=this.graph.getDefaultParent());a=this.graph.moveCells(a,b-this.graph.panDx/this.graph.view.scale,c-this.graph.panDy/this.graph.view.scale,d,e,f);this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(a[0]);d&&this.graph.setSelectionCells(a)};
|
|
mxGraphHandler.prototype.destroyShapes=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.guide&&(this.guide.destroy(),this.guide=null);null!=this.highlight&&(this.highlight.destroy(),this.highlight=null)};mxGraphHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);this.graph.removeListener(this.panHandler);null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null);this.destroyShapes();this.removeHint()};
|
|
function mxPanningHandler(a){null!=a&&(this.graph=a,this.graph.addMouseListener(this),this.forcePanningHandler=mxUtils.bind(this,function(a,c){var d=c.getProperty("eventName"),e=c.getProperty("event");d==mxEvent.MOUSE_DOWN&&this.isForcePanningEvent(e)&&(this.start(e),this.active=!0,this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",e)),e.consume())}),this.graph.addListener(mxEvent.FIRE_MOUSE_EVENT,this.forcePanningHandler),this.gestureHandler=mxUtils.bind(this,function(a,c){if(this.isPinchEnabled()){var d=
|
|
c.getProperty("event");!mxEvent.isConsumed(d)&&"gesturestart"==d.type?(this.initialScale=this.graph.view.scale,!this.active&&null!=this.mouseDownEvent&&(this.start(this.mouseDownEvent),this.mouseDownEvent=null)):"gestureend"==d.type&&null==this.initialScale&&(this.initialScale=null);if(null!=this.initialScale){var e=Math.round(100*this.initialScale*d.scale)/100;null!=this.minScale&&(e=Math.max(this.minScale,e));null!=this.maxScale&&(e=Math.min(this.maxScale,e));this.graph.view.scale!=e&&(this.graph.zoomTo(e),
|
|
mxEvent.consume(d))}}}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler))}mxPanningHandler.prototype=new mxEventSource;mxPanningHandler.prototype.constructor=mxPanningHandler;mxPanningHandler.prototype.graph=null;mxPanningHandler.prototype.useLeftButtonForPanning=!1;mxPanningHandler.prototype.usePopupTrigger=!0;mxPanningHandler.prototype.ignoreCell=!1;mxPanningHandler.prototype.previewEnabled=!0;mxPanningHandler.prototype.useGrid=!1;mxPanningHandler.prototype.panningEnabled=!0;
|
|
mxPanningHandler.prototype.pinchEnabled=!0;mxPanningHandler.prototype.maxScale=8;mxPanningHandler.prototype.minScale=0.01;mxPanningHandler.prototype.dx=null;mxPanningHandler.prototype.dy=null;mxPanningHandler.prototype.startX=0;mxPanningHandler.prototype.startY=0;mxPanningHandler.prototype.isActive=function(){return this.active||null!=this.initialScale};mxPanningHandler.prototype.isPanningEnabled=function(){return this.panningEnabled};
|
|
mxPanningHandler.prototype.setPanningEnabled=function(a){this.panningEnabled=a};mxPanningHandler.prototype.isPinchEnabled=function(){return this.pinchEnabled};mxPanningHandler.prototype.setPinchEnabled=function(a){this.pinchEnabled=a};mxPanningHandler.prototype.isPanningTrigger=function(a){var b=a.getEvent();return this.useLeftButtonForPanning&&null==a.getState()&&mxEvent.isLeftMouseButton(b)||mxEvent.isControlDown(b)&&mxEvent.isShiftDown(b)||this.usePopupTrigger&&mxEvent.isPopupTrigger(b)};
|
|
mxPanningHandler.prototype.isForcePanningEvent=function(a){return this.ignoreCell||mxEvent.isMultiTouchEvent(a.getEvent())};mxPanningHandler.prototype.mouseDown=function(a,b){this.mouseDownEvent=b;!b.isConsumed()&&(this.isPanningEnabled()&&!this.active&&this.isPanningTrigger(b))&&(this.start(b),this.consumePanningTrigger(b))};
|
|
mxPanningHandler.prototype.start=function(a){this.dx0=-this.graph.container.scrollLeft;this.dy0=-this.graph.container.scrollTop;this.startX=a.getX();this.startY=a.getY();this.dy=this.dx=null;this.panningTrigger=!0};mxPanningHandler.prototype.consumePanningTrigger=function(a){a.consume()};
|
|
mxPanningHandler.prototype.mouseMove=function(a,b){this.dx=b.getX()-this.startX;this.dy=b.getY()-this.startY;if(this.active)this.previewEnabled&&(this.useGrid&&(this.dx=this.graph.snap(this.dx),this.dy=this.graph.snap(this.dy)),this.graph.panGraph(this.dx+this.dx0,this.dy+this.dy0)),this.fireEvent(new mxEventObject(mxEvent.PAN,"event",b));else if(this.panningTrigger){var c=this.active;this.active=Math.abs(this.dx)>this.graph.tolerance||Math.abs(this.dy)>this.graph.tolerance;!c&&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)){var c=this.graph.getView().scale,d=this.graph.getView().translate;this.graph.panGraph(0,0);this.panGraph(d.x+this.dx/c,d.y+this.dy/c)}b.consume()}this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",b))}this.panningTrigger=!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)};
|
|
function mxPopupMenuHandler(a,b){null!=a&&(this.graph=a,this.factoryMethod=b,this.graph.addMouseListener(this),this.gestureHandler=mxUtils.bind(this,function(a,b){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.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){if(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){if(this.popupTrigger&&this.inTolerance&&null!=this.triggerX&&null!=this.triggerY){var c=this.getCellForPopupEvent(b);this.graph.isEnabled()&&this.isSelectOnPopup(b)&&null!=c&&!this.graph.isCellSelected(c)?this.graph.setSelectionCell(c):this.clearSelectionOnBackground&&null==c&&this.graph.clearSelection();this.graph.tooltipHandler.hide();var d=mxUtils.getScrollOrigin();this.popup(b.getX()+d.x+1,b.getY()+d.y+1,c,b.getEvent());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!=b?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){var c=this.graph.getView().getState(a);null!=c&&(this.currentColor=null!=b?b:this.validColor,this.markedState=c,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();cell=this.getCell(a);b=this.getStateToMark(b.getState(cell));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.graph.getView().removeListener(this.resetHandler);this.graph.getModel().removeListener(this.resetHandler);this.highlight.destroy()};
|
|
function mxSelectionCellsHandler(a){mxEventSource.call(this);this.graph=a;this.handlers=new mxDictionary;this.graph.addMouseListener(this);this.refreshHandler=mxUtils.bind(this,function(a,c){this.isEnabled()&&this.refresh()});this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.refreshHandler);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.reset=function(){this.handlers.visit(function(a,b){b.reset.apply(b)})};
|
|
mxSelectionCellsHandler.prototype.refresh=function(){var a=this.handlers;this.handlers=new mxDictionary;for(var b=this.graph.getSelectionCells(),c=0;c<b.length;c++){var d=this.graph.view.getState(b[c]);if(null!=d){var e=a.remove(b[c]);null!=e&&(e.state!=d?(e.destroy(),e=null):(null!=e.refresh&&e.refresh(),e.redraw()));null==e&&(e=this.graph.createHandler(d),this.fireEvent(new mxEventObject(mxEvent.ADD,"state",d)));null!=e&&this.handlers.put(b[c],e)}}a.visit(mxUtils.bind(this,function(a,b){this.fireEvent(new mxEventObject(mxEvent.REMOVE,
|
|
"state",b.state));b.destroy()}))};mxSelectionCellsHandler.prototype.updateHandler=function(a){var b=this.handlers.remove(a.cell);null!=b&&(b.destroy(),b=this.graph.createHandler(a),null!=b&&this.handlers.put(a.cell,b))};mxSelectionCellsHandler.prototype.mouseDown=function(a,b){if(this.graph.isEnabled()&&this.isEnabled()){var c=[a,b];this.handlers.visit(function(a,b){b.mouseDown.apply(b,c)})}};
|
|
mxSelectionCellsHandler.prototype.mouseMove=function(a,b){if(this.graph.isEnabled()&&this.isEnabled()){var c=[a,b];this.handlers.visit(function(a,b){b.mouseMove.apply(b,c)})}};mxSelectionCellsHandler.prototype.mouseUp=function(a,b){if(this.graph.isEnabled()&&this.isEnabled()){var c=[a,b];this.handlers.visit(function(a,b){b.mouseUp.apply(b,c)})}};
|
|
mxSelectionCellsHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);null!=this.refreshHandler&&(this.graph.getSelectionModel().removeListener(this.refreshHandler),this.graph.getModel().removeListener(this.refreshHandler),this.graph.getView().removeListener(this.refreshHandler),this.refreshHandler=null)};
|
|
function mxConnectionHandler(a,b){mxEventSource.call(this);null!=a&&(this.graph=a,this.factoryMethod=b,this.init(),this.escapeHandler=mxUtils.bind(this,function(a,b){this.reset()}),this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}mxUtils.extend(mxConnectionHandler,mxEventSource);mxConnectionHandler.prototype.graph=null;mxConnectionHandler.prototype.factoryMethod=!0;mxConnectionHandler.prototype.moveIconFront=!1;mxConnectionHandler.prototype.moveIconBack=!1;
|
|
mxConnectionHandler.prototype.connectImage=null;mxConnectionHandler.prototype.targetConnectImage=!1;mxConnectionHandler.prototype.enabled=!0;mxConnectionHandler.prototype.select=!0;mxConnectionHandler.prototype.createTarget=!1;mxConnectionHandler.prototype.marker=null;mxConnectionHandler.prototype.constraintHandler=null;mxConnectionHandler.prototype.error=null;mxConnectionHandler.prototype.waypointsEnabled=!1;mxConnectionHandler.prototype.ignoreMouseDown=!1;mxConnectionHandler.prototype.first=null;
|
|
mxConnectionHandler.prototype.connectIconOffset=new mxPoint(0,mxConstants.TOOLTIP_VERTICAL_OFFSET);mxConnectionHandler.prototype.edgeState=null;mxConnectionHandler.prototype.changeHandler=null;mxConnectionHandler.prototype.drillHandler=null;mxConnectionHandler.prototype.mouseDownCounter=0;mxConnectionHandler.prototype.movePreviewAway=mxClient.IS_VML;mxConnectionHandler.prototype.outlineConnect=!1;mxConnectionHandler.prototype.livePreview=!1;mxConnectionHandler.prototype.cursor=null;
|
|
mxConnectionHandler.prototype.insertBeforeSource=!1;mxConnectionHandler.prototype.isEnabled=function(){return this.enabled};mxConnectionHandler.prototype.setEnabled=function(a){this.enabled=a};mxConnectionHandler.prototype.isInsertBefore=function(a,b,c,d,e){return this.insertBeforeSource&&b!=c};mxConnectionHandler.prototype.isCreateTarget=function(a){return this.createTarget};mxConnectionHandler.prototype.setCreateTarget=function(a){this.createTarget=a};
|
|
mxConnectionHandler.prototype.createShape=function(){var a=this.livePreview&&null!=this.edgeState?this.graph.cellRenderer.createShape(this.edgeState):new mxPolyline([],mxConstants.INVALID_COLOR);a.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG;a.scale=this.graph.view.scale;a.pointerEvents=!1;a.isDashed=!0;a.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(a.node,this.graph,null);return a};
|
|
mxConnectionHandler.prototype.init=function(){this.graph.addMouseListener(this);this.marker=this.createMarker();this.constraintHandler=new mxConstraintHandler(this.graph);this.changeHandler=mxUtils.bind(this,function(a){null!=this.iconState&&(this.iconState=this.graph.getView().getState(this.iconState.cell));null!=this.iconState?(this.redrawIcons(this.icons,this.iconState),this.constraintHandler.reset()):null!=this.previous&&null==this.graph.view.getState(this.previous.cell)&&this.reset()});this.graph.getModel().addListener(mxEvent.CHANGE,
|
|
this.changeHandler);this.graph.getView().addListener(mxEvent.SCALE,this.changeHandler);this.graph.getView().addListener(mxEvent.TRANSLATE,this.changeHandler);this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.changeHandler);this.drillHandler=mxUtils.bind(this,function(a){this.reset()});this.graph.addListener(mxEvent.START_EDITING,this.drillHandler);this.graph.getView().addListener(mxEvent.DOWN,this.drillHandler);this.graph.getView().addListener(mxEvent.UP,this.drillHandler)};
|
|
mxConnectionHandler.prototype.isConnectableCell=function(a){return!0};
|
|
mxConnectionHandler.prototype.createMarker=function(){var a=new mxCellMarker(this.graph);a.hotspotEnabled=!0;a.getCell=mxUtils.bind(this,function(b){var c=mxCellMarker.prototype.getCell.apply(a,arguments);this.error=null;null==c&&null!=this.currentPoint&&(c=this.graph.getCellAt(this.currentPoint.x,this.currentPoint.y));if(null!=c&&!this.graph.isCellConnectable(c)){var d=this.graph.getModel().getParent(c);this.graph.getModel().isVertex(d)&&this.graph.isCellConnectable(d)&&(c=d)}if(this.graph.isSwimlane(c)&&
|
|
null!=this.currentPoint&&this.graph.hitsSwimlaneContent(c,this.currentPoint.x,this.currentPoint.y)||!this.isConnectableCell(c))c=null;null!=c?this.isConnecting()?null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,c),null!=this.error&&0==this.error.length&&(c=null,this.isCreateTarget(b.getEvent())&&(this.error=null))):this.isValidSource(c,b)||(c=null):this.isConnecting()&&(!this.isCreateTarget(b.getEvent())&&!this.graph.allowDanglingEdges)&&(this.error="");return c});a.isValidState=
|
|
mxUtils.bind(this,function(b){return this.isConnecting()?null==this.error:mxCellMarker.prototype.isValidState.apply(a,arguments)});a.getMarkerColor=mxUtils.bind(this,function(b,c,d){return null==this.connectImage||this.isConnecting()?mxCellMarker.prototype.getMarkerColor.apply(a,arguments):null});a.intersects=mxUtils.bind(this,function(b,c){return null!=this.connectImage||this.isConnecting()?!0:mxCellMarker.prototype.intersects.apply(a,arguments)});return a};
|
|
mxConnectionHandler.prototype.start=function(a,b,c,d){this.previous=a;this.first=new mxPoint(b,c);this.edgeState=null!=d?d:this.createEdgeState(null);this.marker.currentColor=this.marker.validColor;this.marker.markedState=a;this.marker.mark();this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous))};mxConnectionHandler.prototype.isConnecting=function(){return null!=this.first&&null!=this.shape};mxConnectionHandler.prototype.isValidSource=function(a,b){return this.graph.isValidSource(a)};
|
|
mxConnectionHandler.prototype.isValidTarget=function(a){return!0};mxConnectionHandler.prototype.validateConnection=function(a,b){return!this.isValidTarget(b)?"":this.graph.getEdgeValidationError(null,a,b)};mxConnectionHandler.prototype.getConnectImage=function(a){return this.connectImage};mxConnectionHandler.prototype.isMoveIconToFrontForState=function(a){return null!=a.text&&a.text.node.parentNode==this.graph.container?!0:this.moveIconFront};
|
|
mxConnectionHandler.prototype.createIcons=function(a){var b=this.getConnectImage(a);if(null!=b&&null!=a){this.iconState=a;var c=[],d=new mxRectangle(0,0,b.width,b.height),e=new mxImageShape(d,b.src,null,null,0);e.preserveImageAspect=!1;this.isMoveIconToFrontForState(a)?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,e.init(this.graph.getView().getOverlayPane()),this.moveIconBack&&
|
|
null!=e.node.previousSibling&&e.node.parentNode.insertBefore(e.node,e.node.parentNode.firstChild));e.node.style.cursor=mxConstants.CURSOR_CONNECT;var f=mxUtils.bind(this,function(){return null!=this.currentState?this.currentState:a}),b=mxUtils.bind(this,function(a){mxEvent.isConsumed(a)||(this.icon=e,this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(a,f())))});mxEvent.redirectMouseEvents(e.node,this.graph,f,b);c.push(e);this.redrawIcons(c,this.iconState);return c}return null};
|
|
mxConnectionHandler.prototype.redrawIcons=function(a,b){if(null!=a&&null!=a[0]&&null!=b){var c=this.getIconPosition(a[0],b);a[0].bounds.x=c.x;a[0].bounds.y=c.y;a[0].redraw()}};
|
|
mxConnectionHandler.prototype.getIconPosition=function(a,b){var c=this.graph.getView().scale,d=b.getCenterX(),e=b.getCenterY();if(this.graph.isSwimlane(b.cell)){var f=this.graph.getStartSize(b.cell),d=0!=f.width?b.x+f.width*c/2:d,e=0!=f.height?b.y+f.height*c/2:e,f=mxUtils.toRadians(mxUtils.getValue(b.style,mxConstants.STYLE_ROTATION)||0);if(0!=f)var c=Math.cos(f),f=Math.sin(f),g=new mxPoint(b.getCenterX(),b.getCenterY()),e=mxUtils.getRotatedPoint(new mxPoint(d,e),c,f,g),d=e.x,e=e.y}return new mxPoint(d-
|
|
a.bounds.width/2,e-a.bounds.height/2)};mxConnectionHandler.prototype.destroyIcons=function(){if(null!=this.icons){for(var a=0;a<this.icons.length;a++)this.icons[a].destroy();this.iconState=this.selectedIcon=this.icon=this.icons=null}};mxConnectionHandler.prototype.isStartEvent=function(a){return null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint||null!=this.previous&&null==this.error&&(null==this.icons||null!=this.icons&&null!=this.icon)};
|
|
mxConnectionHandler.prototype.mouseDown=function(a,b){this.mouseDownCounter++;if(this.isEnabled()&&this.graph.isEnabled()&&!b.isConsumed()&&!this.isConnecting()&&this.isStartEvent(b)){null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(this.sourceConstraint=this.constraintHandler.currentConstraint,this.previous=this.constraintHandler.currentFocus,this.first=this.constraintHandler.currentPoint.clone()):this.first=new mxPoint(b.getGraphX(),
|
|
b.getGraphY());this.edgeState=this.createEdgeState(b);this.mouseDownCounter=1;this.waypointsEnabled&&null==this.shape&&(this.waypoints=null,this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState));if(null==this.previous&&null!=this.edgeState){var c=this.graph.getPointForEvent(b.getEvent());this.edgeState.cell.geometry.setTerminalPoint(c,!0)}this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous));b.consume()}this.selectedIcon=this.icon;this.icon=null};
|
|
mxConnectionHandler.prototype.isImmediateConnectSource=function(a){return!this.graph.isCellMovable(a.cell)};mxConnectionHandler.prototype.createEdgeState=function(a){return null};
|
|
mxConnectionHandler.prototype.isOutlineConnectEvent=function(a){var b=mxUtils.getOffset(this.graph.container),c=a.getEvent(),d=mxEvent.getClientX(c),c=mxEvent.getClientY(c),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())&&(a.isSource(this.marker.highlight.shape)||
|
|
mxEvent.isAltDown(a.getEvent())&&null!=a.getState()||this.marker.highlight.isHighlightAt(d,c)||(f!=d||b!=c)&&null==a.getState()&&this.marker.highlight.isHighlightAt(f,b))};
|
|
mxConnectionHandler.prototype.updateCurrentState=function(a,b){this.constraintHandler.update(a,null==this.first,!1,null==this.first||a.isSource(this.marker.highlight.shape)?null:b);if(null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentConstraint)null!=this.marker.highlight&&null!=this.marker.highlight.state&&this.marker.highlight.state.cell==this.constraintHandler.currentFocus.cell?"transparent"!=this.marker.highlight.shape.stroke&&(this.marker.highlight.shape.stroke="transparent",
|
|
this.marker.highlight.repaint()):this.marker.markCell(this.constraintHandler.currentFocus.cell,"transparent"),null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,this.constraintHandler.currentFocus.cell),null==this.error?this.currentState=this.constraintHandler.currentFocus:this.constraintHandler.reset());else{this.graph.isIgnoreTerminalEvent(a.getEvent())?(this.marker.reset(),this.currentState=null):(this.marker.process(a),this.currentState=this.marker.getValidState());var c=
|
|
this.isOutlineConnectEvent(a);null!=this.currentState&&c&&(a.isSource(this.marker.highlight.shape)&&(b=new mxPoint(a.getGraphX(),a.getGraphY())),c=this.graph.getOutlineConstraint(b,this.currentState,a),this.constraintHandler.setFocus(a,this.currentState,!1),this.constraintHandler.currentConstraint=c,this.constraintHandler.currentPoint=b);this.outlineConnect&&(null!=this.marker.highlight&&null!=this.marker.highlight.shape)&&(c=this.graph.view.scale,null!=this.constraintHandler.currentConstraint&&null!=
|
|
this.constraintHandler.currentFocus?(this.marker.highlight.shape.stroke=mxConstants.OUTLINE_HIGHLIGHT_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/c/c,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.marker.getValidState()!=a.getState()?(this.marker.highlight.shape.stroke="transparent",this.currentState=null):this.marker.highlight.shape.stroke=mxConstants.DEFAULT_VALID_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/
|
|
c/c,this.marker.highlight.repaint()))}};mxConnectionHandler.prototype.convertWaypoint=function(a){var b=this.graph.getView().getScale(),c=this.graph.getView().getTranslate();a.x=a.x/b-c.x;a.y=a.y/b-c.y};
|
|
mxConnectionHandler.prototype.snapToPreview=function(a,b){if(!mxEvent.isAltDown(a.getEvent())&&null!=this.previous){var c=this.graph.gridSize*this.graph.view.scale/2,d=null!=this.sourceConstraint?this.first:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());Math.abs(d.x-a.getGraphX())<c&&(b.x=d.x);Math.abs(d.y-a.getGraphY())<c&&(b.y=d.y)}};
|
|
mxConnectionHandler.prototype.mouseMove=function(a,b){if(!b.isConsumed()&&(this.ignoreMouseDown||null!=this.first||!this.graph.isMouseDown)){!this.isEnabled()&&null!=this.currentState&&(this.destroyIcons(),this.currentState=null);var c=this.graph.getView(),d=c.scale,e=c.translate,c=new mxPoint(b.getGraphX(),b.getGraphY());this.error=null;this.graph.isGridEnabledEvent(b.getEvent())&&(c=new mxPoint((this.graph.snap(c.x/d-e.x)+e.x)*d,(this.graph.snap(c.y/d-e.y)+e.y)*d));this.snapToPreview(b,c);this.currentPoint=
|
|
c;(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&this.updateCurrentState(b,c);if(null!=this.first){var f=null,d=c;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(f=this.constraintHandler.currentConstraint,d=this.constraintHandler.currentPoint.clone()):null!=this.previous&&(!this.graph.isIgnoreTerminalEvent(b.getEvent())&&mxEvent.isShiftDown(b.getEvent()))&&(Math.abs(this.previous.getCenterX()-c.x)<
|
|
Math.abs(this.previous.getCenterY()-c.y)?c.x=this.previous.getCenterX():c.y=this.previous.getCenterY());e=this.first;if(null!=this.selectedIcon){var g=this.selectedIcon.bounds.width,h=this.selectedIcon.bounds.height;null!=this.currentState&&this.targetConnectImage?(g=this.getIconPosition(this.selectedIcon,this.currentState),this.selectedIcon.bounds.x=g.x,this.selectedIcon.bounds.y=g.y):(g=new mxRectangle(b.getGraphX()+this.connectIconOffset.x,b.getGraphY()+this.connectIconOffset.y,g,h),this.selectedIcon.bounds=
|
|
g);this.selectedIcon.redraw()}null!=this.edgeState?(this.updateEdgeState(d,f),d=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],e=this.edgeState.absolutePoints[0]):(null!=this.currentState&&null==this.constraintHandler.currentConstraint&&(g=this.getTargetPerimeterPoint(this.currentState,b),null!=g&&(d=g)),null==this.sourceConstraint&&null!=this.previous&&(g=this.getSourcePerimeterPoint(this.previous,null!=this.waypoints&&0<this.waypoints.length?this.waypoints[0]:d,b),null!=g&&
|
|
(e=g)));if(null==this.currentState&&this.movePreviewAway){g=e;null!=this.edgeState&&2<=this.edgeState.absolutePoints.length&&(f=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2],null!=f&&(g=f));f=d.x-g.x;g=d.y-g.y;h=Math.sqrt(f*f+g*g);if(0==h)return;this.originalPoint=d.clone();d.x-=4*f/h;d.y-=4*g/h}else this.originalPoint=null;if(null==this.shape&&(f=Math.abs(c.x-this.first.x),g=Math.abs(c.y-this.first.y),f>this.graph.tolerance||g>this.graph.tolerance))this.shape=this.createShape(),
|
|
null!=this.edgeState&&this.shape.apply(this.edgeState),this.updateCurrentState(b,c);null!=this.shape&&(null!=this.edgeState?this.shape.points=this.edgeState.absolutePoints:(c=[e],null!=this.waypoints&&(c=c.concat(this.waypoints)),c.push(d),this.shape.points=c),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.constraintHandler.reset():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();if(!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){c=!1;d=b.getSource();
|
|
for(e=0;e<this.icons.length&&!c;e++)c=d==this.icons[e].node||d.parentNode==this.icons[e].node;c||this.updateIcons(this.currentState,this.icons,b)}}else this.constraintHandler.reset()};
|
|
mxConnectionHandler.prototype.updateEdgeState=function(a,b){null!=this.sourceConstraint&&null!=this.sourceConstraint.point&&(this.edgeState.style[mxConstants.STYLE_EXIT_X]=this.sourceConstraint.point.x,this.edgeState.style[mxConstants.STYLE_EXIT_Y]=this.sourceConstraint.point.y);null!=b&&null!=b.point?(this.edgeState.style[mxConstants.STYLE_ENTRY_X]=b.point.x,this.edgeState.style[mxConstants.STYLE_ENTRY_Y]=b.point.y):(delete this.edgeState.style[mxConstants.STYLE_ENTRY_X],delete this.edgeState.style[mxConstants.STYLE_ENTRY_Y]);
|
|
this.edgeState.absolutePoints=[null,null!=this.currentState?null:a];this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,!0,this.sourceConstraint);null!=this.currentState&&(null==b&&(b=this.graph.getConnectionConstraint(this.edgeState,this.previous,!1)),this.edgeState.setAbsoluteTerminalPoint(null,!1),this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,!1,b));var c=null;if(null!=this.waypoints)for(var c=[],d=0;d<this.waypoints.length;d++){var e=this.waypoints[d].clone();
|
|
this.convertWaypoint(e);c[d]=e}this.graph.view.updatePoints(this.edgeState,c,this.previous,this.currentState);this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState)};
|
|
mxConnectionHandler.prototype.getTargetPerimeterPoint=function(a,b){var c=null,d=a.view,e=d.getPerimeterFunction(a);if(null!=e){var f=null!=this.waypoints&&0<this.waypoints.length?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY()),d=e(d.getPerimeterBounds(a),this.edgeState,f,!1);null!=d&&(c=d)}else c=new mxPoint(a.getCenterX(),a.getCenterY());return c};
|
|
mxConnectionHandler.prototype.getSourcePerimeterPoint=function(a,b,c){c=null;var d=a.view,e=d.getPerimeterFunction(a),f=new mxPoint(a.getCenterX(),a.getCenterY());if(null!=e){var g=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0),h=-g*(Math.PI/180);0!=g&&(b=mxUtils.getRotatedPoint(new mxPoint(b.x,b.y),Math.cos(h),Math.sin(h),f));a=e(d.getPerimeterBounds(a),a,b,!1);null!=a&&(0!=g&&(a=mxUtils.getRotatedPoint(new mxPoint(a.x,a.y),Math.cos(-h),Math.sin(-h),f)),c=a)}else c=f;return c};
|
|
mxConnectionHandler.prototype.updateIcons=function(a,b,c){};mxConnectionHandler.prototype.isStopEvent=function(a){return null!=a.getState()};
|
|
mxConnectionHandler.prototype.addWaypointForEvent=function(a){var b=mxUtils.convertPoint(this.graph.container,a.getX(),a.getY()),c=Math.abs(b.x-this.first.x),b=Math.abs(b.y-this.first.y);if(null!=this.waypoints||1<this.mouseDownCounter&&(c>this.graph.tolerance||b>this.graph.tolerance))null==this.waypoints&&(this.waypoints=[]),c=this.graph.view.scale,b=new mxPoint(this.graph.snap(a.getGraphX()/c)*c,this.graph.snap(a.getGraphY()/c)*c),this.waypoints.push(b)};
|
|
mxConnectionHandler.prototype.mouseUp=function(a,b){if(!b.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(b)){this.addWaypointForEvent(b);b.consume();return}if(null==this.error){var c=null!=this.previous?this.previous.cell:null,d=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(d=this.constraintHandler.currentFocus.cell);null==d&&null!=this.currentState&&(d=this.currentState.cell);this.connect(c,d,b.getEvent(),b.getCell())}else null!=
|
|
this.previous&&(null!=this.marker.validState&&this.previous.cell==this.marker.validState.cell)&&this.graph.selectCellForEvent(this.marker.source,evt),0<this.error.length&&this.graph.validationAlert(this.error);this.destroyIcons();b.consume()}null!=this.first&&this.reset()};
|
|
mxConnectionHandler.prototype.reset=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.cursor&&null!=this.graph.container&&(this.graph.container.style.cursor="");this.destroyIcons();this.marker.reset();this.constraintHandler.reset();this.sourceConstraint=this.error=this.previous=this.edgeState=this.currentPoint=this.originalPoint=null;this.mouseDownCounter=0;this.first=null;this.fireEvent(new mxEventObject(mxEvent.RESET))};
|
|
mxConnectionHandler.prototype.drawPreview=function(){this.updatePreview(null==this.error);this.shape.redraw()};mxConnectionHandler.prototype.updatePreview=function(a){this.shape.strokewidth=this.getEdgeWidth(a);this.shape.stroke=this.getEdgeColor(a)};mxConnectionHandler.prototype.getEdgeColor=function(a){return a?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR};mxConnectionHandler.prototype.getEdgeWidth=function(a){return a?3:1};
|
|
mxConnectionHandler.prototype.connect=function(a,b,c,d){if(null!=b||this.isCreateTarget(c)||this.graph.allowDanglingEdges){var e=this.graph.getModel(),f=!1,g=null;e.beginUpdate();try{if(null!=a&&(null==b&&!this.graph.isIgnoreTerminalEvent(c)&&this.isCreateTarget(c))&&(b=this.createTargetVertex(c,a),null!=b)){d=this.graph.getDropTarget([b],c,d);f=!0;if(null==d||!this.graph.getModel().isEdge(d)){var h=this.graph.getView().getState(d);if(null!=h){var k=e.getGeometry(b);k.x-=h.origin.x;k.y-=h.origin.y}}else d=
|
|
this.graph.getDefaultParent();this.graph.addCell(b,d)}var m=this.graph.getDefaultParent();null!=a&&(null!=b&&e.getParent(a)==e.getParent(b)&&e.getParent(e.getParent(a))!=e.getRoot())&&(m=e.getParent(a),null!=a.geometry&&a.geometry.relative&&(null!=b.geometry&&b.geometry.relative)&&(m=e.getParent(m)));var l=h=null;null!=this.edgeState&&(h=this.edgeState.cell.value,l=this.edgeState.cell.style);g=this.insertEdge(m,null,h,a,b,l);if(null!=g){this.graph.setConnectionConstraint(g,a,!0,this.sourceConstraint);
|
|
this.graph.setConnectionConstraint(g,b,!1,this.constraintHandler.currentConstraint);null!=this.edgeState&&e.setGeometry(g,this.edgeState.cell.geometry);e.getParent(a);if(this.isInsertBefore(g,a,b,c,d)){m=null;for(k=a;null!=k.parent&&null!=k.geometry&&k.geometry.relative&&k.parent!=g.parent;)k=this.graph.model.getParent(k);null!=k&&(null!=k.parent&&k.parent==g.parent)&&(m=k.parent.getIndex(k),k.parent.insert(g,m))}var n=e.getGeometry(g);null==n&&(n=new mxGeometry,n.relative=!0,e.setGeometry(g,n));
|
|
if(null!=this.waypoints&&0<this.waypoints.length){var p=this.graph.view.scale,r=this.graph.view.translate;n.points=[];for(a=0;a<this.waypoints.length;a++){var q=this.waypoints[a];n.points.push(new mxPoint(q.x/p-r.x,q.y/p-r.y))}}if(null==b){var s=this.graph.view.translate,p=this.graph.view.scale,q=null!=this.originalPoint?new mxPoint(this.originalPoint.x/p-s.x,this.originalPoint.y/p-s.y):new mxPoint(this.currentPoint.x/p-s.x,this.currentPoint.y/p-s.y);q.x-=this.graph.panDx/this.graph.view.scale;q.y-=
|
|
this.graph.panDy/this.graph.view.scale;n.setTerminalPoint(q,!1)}this.fireEvent(new mxEventObject(mxEvent.CONNECT,"cell",g,"terminal",b,"event",c,"target",d,"terminalInserted",f))}}catch(u){mxLog.show(),mxLog.debug(u.message)}finally{e.endUpdate()}this.select&&this.selectCells(g,f?b:null)}};mxConnectionHandler.prototype.selectCells=function(a,b){this.graph.setSelectionCell(a)};
|
|
mxConnectionHandler.prototype.insertEdge=function(a,b,c,d,e,f){if(null==this.factoryMethod)return this.graph.insertEdge(a,b,c,d,e,f);b=this.createEdge(c,d,e,f);return b=this.graph.addEdge(b,a,d,e)};
|
|
mxConnectionHandler.prototype.createTargetVertex=function(a,b){for(var c=this.graph.getCellGeometry(b);null!=c&&c.relative;)b=this.graph.getModel().getParent(b),c=this.graph.getCellGeometry(b);var d=this.graph.cloneCells([b])[0],c=this.graph.getModel().getGeometry(d);if(null!=c){var e=this.graph.view.translate,f=this.graph.view.scale,g=new mxPoint(this.currentPoint.x/f-e.x,this.currentPoint.y/f-e.y);c.x=Math.round(g.x-c.width/2-this.graph.panDx/f);c.y=Math.round(g.y-c.height/2-this.graph.panDy/f);
|
|
g=this.getAlignmentTolerance();if(0<g){var h=this.graph.view.getState(b);if(null!=h){var k=h.x/f-e.x,e=h.y/f-e.y;Math.abs(k-c.x)<=g&&(c.x=Math.round(k));Math.abs(e-c.y)<=g&&(c.y=Math.round(e))}}}return d};mxConnectionHandler.prototype.getAlignmentTolerance=function(a){return this.graph.isGridEnabled()?this.graph.gridSize/2:this.graph.tolerance};
|
|
mxConnectionHandler.prototype.createEdge=function(a,b,c,d){var e=null;null!=this.factoryMethod&&(e=this.factoryMethod(b,c,d));null==e&&(e=new mxCell(a||""),e.setEdge(!0),e.setStyle(d),a=new mxGeometry,a.relative=!0,e.setGeometry(a));return e};
|
|
mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this);null!=this.shape&&(this.shape.destroy(),this.shape=null);null!=this.marker&&(this.marker.destroy(),this.marker=null);null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null);null!=this.drillHandler&&(this.graph.removeListener(this.drillHandler),
|
|
this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null);null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null)};
|
|
function mxConstraintHandler(a){this.graph=a;this.resetHandler=mxUtils.bind(this,function(a,c){null!=this.currentFocus&&null==this.graph.view.getState(this.currentFocus.cell)&&this.reset()});this.graph.model.addListener(mxEvent.CHANGE,this.resetHandler);this.graph.view.addListener(mxEvent.SCALE,this.resetHandler);this.graph.addListener(mxEvent.ROOT,this.resetHandler)}mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5);mxConstraintHandler.prototype.graph=null;
|
|
mxConstraintHandler.prototype.enabled=!0;mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR;mxConstraintHandler.prototype.isEnabled=function(){return this.enabled};mxConstraintHandler.prototype.setEnabled=function(a){this.enabled=a};
|
|
mxConstraintHandler.prototype.reset=function(){if(null!=this.focusIcons){for(var a=0;a<this.focusIcons.length;a++)this.focusIcons[a].destroy();this.focusIcons=null}null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null);this.focusPoints=this.currentFocus=this.currentPoint=this.currentFocusArea=this.currentConstraint=null};mxConstraintHandler.prototype.getTolerance=function(a){return this.graph.getTolerance()};
|
|
mxConstraintHandler.prototype.getImageForConstraint=function(a,b,c){return this.pointImage};mxConstraintHandler.prototype.isEventIgnored=function(a,b){return!1};mxConstraintHandler.prototype.isStateIgnored=function(a,b){return!1};mxConstraintHandler.prototype.destroyIcons=function(){if(null!=this.focusIcons){for(var a=0;a<this.focusIcons.length;a++)this.focusIcons[a].destroy();this.focusPoints=this.focusIcons=null}};
|
|
mxConstraintHandler.prototype.destroyFocusHighlight=function(){null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null)};mxConstraintHandler.prototype.isKeepFocusEvent=function(a){return mxEvent.isShiftDown(a.getEvent())};
|
|
mxConstraintHandler.prototype.getCellForEvent=function(a,b){var c=a.getCell();if(null==c&&null!=b&&(a.getGraphX()!=b.x||a.getGraphY()!=b.y))c=this.graph.getCellAt(b.x,b.y);if(null!=c&&!this.graph.isCellConnectable(c)){var d=this.graph.getModel().getParent(c);this.graph.getModel().isVertex(d)&&this.graph.isCellConnectable(d)&&(c=d)}return c};
|
|
mxConstraintHandler.prototype.update=function(a,b,c,d){if(this.isEnabled()&&!this.isEventIgnored(a)){null==this.mouseleaveHandler&&null!=this.graph.container&&(this.mouseleaveHandler=mxUtils.bind(this,function(){this.reset()}),mxEvent.addListener(this.graph.container,"mouseleave",this.resetHandler));var e=this.getTolerance(a),f=null!=d?d.x:a.getGraphX(),g=null!=d?d.y:a.getGraphY(),f=new mxRectangle(f-e,g-e,2*e,2*e),e=new mxRectangle(a.getGraphX()-e,a.getGraphY()-e,2*e,2*e),h=this.graph.view.getState(this.getCellForEvent(a,
|
|
d));if(!this.isKeepFocusEvent(a)&&(null==this.currentFocusArea||null==this.currentFocus||null!=h||!this.graph.getModel().isVertex(this.currentFocus.cell)||!mxUtils.intersects(this.currentFocusArea,e))&&h!=this.currentFocus)this.currentFocus=this.currentFocusArea=null,this.setFocus(a,h,b);a=this.currentPoint=this.currentConstraint=null;if(null!=this.focusIcons&&null!=this.constraints&&(null==h||this.currentFocus==h))for(var g=e.getCenterX(),k=e.getCenterY(),m=0;m<this.focusIcons.length;m++){var l=
|
|
g-this.focusIcons[m].bounds.getCenterX(),n=k-this.focusIcons[m].bounds.getCenterY(),l=l*l+n*n;if((this.intersects(this.focusIcons[m],e,b,c)||null!=d&&this.intersects(this.focusIcons[m],f,b,c))&&(null==a||l<a)){this.currentConstraint=this.constraints[m];this.currentPoint=this.focusPoints[m];a=l;l=this.focusIcons[m].bounds.clone();l.grow(mxConstants.HIGHLIGHT_SIZE);mxClient.IS_IE&&(l.grow(1),l.width-=1,l.height-=1);if(null==this.focusHighlight){n=this.createHighlightShape();n.dialect=this.graph.dialect==
|
|
mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML;n.pointerEvents=!1;n.init(this.graph.getView().getOverlayPane());this.focusHighlight=n;var p=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:h});mxEvent.redirectMouseEvents(n.node,this.graph,p)}this.focusHighlight.bounds=l;this.focusHighlight.redraw()}}null==this.currentConstraint&&this.destroyFocusHighlight()}else this.currentPoint=this.currentFocus=this.currentConstraint=null};
|
|
mxConstraintHandler.prototype.setFocus=function(a,b,c){this.constraints=null!=b&&!this.isStateIgnored(b,c)&&this.graph.isCellConnectable(b.cell)?this.isEnabled()?this.graph.getAllConnectionConstraints(b,c)||[]:[]:null;if(null!=this.constraints){this.currentFocus=b;this.currentFocusArea=new mxRectangle(b.x,b.y,b.width,b.height);if(null!=this.focusIcons){for(c=0;c<this.focusIcons.length;c++)this.focusIcons[c].destroy();this.focusPoints=this.focusIcons=null}this.focusPoints=[];this.focusIcons=[];for(c=
|
|
0;c<this.constraints.length;c++){var d=this.graph.getConnectionPoint(b,this.constraints[c]),e=this.getImageForConstraint(b,this.constraints[c],d),f=e.src,e=new mxRectangle(Math.round(d.x-e.width/2),Math.round(d.y-e.height/2),e.width,e.height),f=new mxImageShape(e,f);f.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG;f.preserveImageAspect=!1;f.init(this.graph.getView().getDecoratorPane());(mxClient.IS_QUIRKS||8==document.documentMode)&&mxEvent.addListener(f.node,
|
|
"dragstart",function(a){mxEvent.consume(a);return!1});null!=f.node.previousSibling&&f.node.parentNode.insertBefore(f.node,f.node.parentNode.firstChild);e=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:b});f.redraw();mxEvent.redirectMouseEvents(f.node,this.graph,e);this.currentFocusArea.add(f.bounds);this.focusIcons.push(f);this.focusPoints.push(d)}this.currentFocusArea.grow(this.getTolerance(a))}else this.destroyIcons(),this.destroyFocusHighlight()};
|
|
mxConstraintHandler.prototype.createHighlightShape=function(){var a=new mxRectangleShape(null,this.highlightColor,this.highlightColor,mxConstants.HIGHLIGHT_STROKEWIDTH);a.opacity=mxConstants.HIGHLIGHT_OPACITY;return a};mxConstraintHandler.prototype.intersects=function(a,b,c,d){return mxUtils.intersects(a.bounds,b)};
|
|
mxConstraintHandler.prototype.destroy=function(){this.reset();null!=this.resetHandler&&(this.graph.model.removeListener(this.resetHandler),this.graph.view.removeListener(this.resetHandler),this.graph.removeListener(this.resetHandler),this.resetHandler=null);null!=this.mouseleaveHandler&&null!=this.graph.container&&(mxEvent.removeListener(this.graph.container,"mouseleave",this.mouseleaveHandler),this.mouseleaveHandler=null)};
|
|
function mxHandle(a,b,c){this.graph=a.view.graph;this.state=a;this.cursor=null!=b?b:this.cursor;this.image=null!=c?c:this.image;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(){};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);var b=-mxUtils.toRadians(this.getRotation()),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.positionChanged();this.redraw()};mxHandle.prototype.positionChanged=function(){null!=this.state.text&&this.state.text.apply(this.state);null!=this.state.shape&&this.state.shape.apply(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):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,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.state.unscaledWidth=null;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()),d=Math.cos(b),e=Math.sin(b);return mxUtils.getRotatedPoint(a,d,e,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 mxTooltipHandler(a,b){null!=a&&(this.graph=a,this.delay=b||500,this.graph.addMouseListener(this))}mxTooltipHandler.prototype.zIndex=10005;mxTooltipHandler.prototype.graph=null;mxTooltipHandler.prototype.delay=null;
|
|
mxTooltipHandler.prototype.ignoreTouchEvents=!0;mxTooltipHandler.prototype.hideOnHover=!1;mxTooltipHandler.prototype.destroyed=!1;mxTooltipHandler.prototype.enabled=!0;mxTooltipHandler.prototype.isEnabled=function(){return this.enabled};mxTooltipHandler.prototype.setEnabled=function(a){this.enabled=a};mxTooltipHandler.prototype.isHideOnHover=function(){return this.hideOnHover};mxTooltipHandler.prototype.setHideOnHover=function(a){this.hideOnHover=a};
|
|
mxTooltipHandler.prototype.init=function(){null!=document.body&&(this.div=document.createElement("div"),this.div.className="mxTooltip",this.div.style.visibility="hidden",document.body.appendChild(this.div),mxEvent.addGestureListeners(this.div,mxUtils.bind(this,function(a){this.hideTooltip()})))};mxTooltipHandler.prototype.mouseDown=function(a,b){this.reset(b,!1);this.hideTooltip()};
|
|
mxTooltipHandler.prototype.mouseMove=function(a,b){if(b.getX()!=this.lastX||b.getY()!=this.lastY)this.reset(b,!0),(this.isHideOnHover()||b.getState()!=this.state||b.getSource()!=this.node&&(!this.stateSource||null!=b.getState()&&this.stateSource==(b.isSource(b.getState().shape)||!b.isSource(b.getState().text))))&&this.hideTooltip();this.lastX=b.getX();this.lastY=b.getY()};mxTooltipHandler.prototype.mouseUp=function(a,b){this.reset(b,!0);this.hideTooltip()};
|
|
mxTooltipHandler.prototype.resetTimer=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null)};
|
|
mxTooltipHandler.prototype.reset=function(a,b){if(!this.ignoreTouchEvents||mxEvent.isMouseEvent(a.getEvent()))if(this.resetTimer(),b&&this.isEnabled()&&null!=a.getState()&&(null==this.div||"hidden"==this.div.style.visibility)){var c=a.getState(),d=a.getSource(),e=a.getX(),f=a.getY(),g=a.isSource(c.shape)||a.isSource(c.text);this.thread=window.setTimeout(mxUtils.bind(this,function(){if(!this.graph.isEditing()&&!this.graph.popupMenuHandler.isMenuShowing()&&!this.graph.isMouseDown){var a=this.graph.getTooltip(c,
|
|
d,e,f);this.show(a,e,f);this.state=c;this.node=d;this.stateSource=g}}),this.delay)}};mxTooltipHandler.prototype.hide=function(){this.resetTimer();this.hideTooltip()};mxTooltipHandler.prototype.hideTooltip=function(){null!=this.div&&(this.div.style.visibility="hidden")};
|
|
mxTooltipHandler.prototype.show=function(a,b,c){if(!this.destroyed&&null!=a&&0<a.length){null==this.div&&this.init();var d=mxUtils.getScrollOrigin();this.div.style.zIndex=this.zIndex;this.div.style.left=b+d.x+"px";this.div.style.top=c+mxConstants.TOOLTIP_VERTICAL_OFFSET+d.y+"px";mxUtils.isNode(a)?(this.div.innerHTML="",this.div.appendChild(a)):this.div.innerHTML=a.replace(/\n/g,"\x3cbr\x3e");this.div.style.visibility="";mxUtils.fit(this.div)}};
|
|
mxTooltipHandler.prototype.destroy=function(){this.destroyed||(this.graph.removeMouseListener(this),mxEvent.release(this.div),null!=this.div&&null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.destroyed=!0,this.div=null)};
|
|
function mxCellHighlight(a,b,c,d){null!=a&&(this.graph=a,this.highlightColor=null!=b?b:mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=null!=c?c:mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=null!=d?d:!1,this.opacity=mxConstants.HIGHLIGHT_OPACITY,this.repaintHandler=mxUtils.bind(this,function(){if(null!=this.state){var a=this.graph.view.getState(this.state.cell);null==a?this.hide():(this.state=a,this.repaint())}}),this.graph.getView().addListener(mxEvent.SCALE,this.repaintHandler),this.graph.getView().addListener(mxEvent.TRANSLATE,
|
|
this.repaintHandler),this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler),this.graph.getModel().addListener(mxEvent.CHANGE,this.repaintHandler),this.resetHandler=mxUtils.bind(this,function(){this.hide()}),this.graph.getView().addListener(mxEvent.DOWN,this.resetHandler),this.graph.getView().addListener(mxEvent.UP,this.resetHandler))}mxCellHighlight.prototype.keepOnTop=!1;mxCellHighlight.prototype.graph=!0;mxCellHighlight.prototype.state=null;
|
|
mxCellHighlight.prototype.spacing=2;mxCellHighlight.prototype.resetHandler=null;mxCellHighlight.prototype.setHighlightColor=function(a){this.highlightColor=a;null!=this.shape&&(this.shape.stroke=a)};mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape();this.repaint();!this.keepOnTop&&this.shape.node.parentNode.firstChild!=this.shape.node&&this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)};
|
|
mxCellHighlight.prototype.createShape=function(){var a=this.graph.cellRenderer.createShape(this.state);a.svgStrokeTolerance=this.graph.tolerance;a.scale=this.state.view.scale;a.outline=!0;a.points=this.state.absolutePoints;a.apply(this.state);a.strokewidth=this.strokeWidth/this.state.view.scale/this.state.view.scale;a.arrowStrokewidth=this.strokeWidth;a.stroke=this.highlightColor;a.opacity=this.opacity;a.isDashed=this.dashed;a.isShadow=!1;a.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:
|
|
mxConstants.DIALECT_SVG;a.init(this.graph.getView().getOverlayPane());mxEvent.redirectMouseEvents(a.node,this.graph,this.state);this.graph.dialect!=mxConstants.DIALECT_SVG?a.pointerEvents=!1:a.svgPointerEvents="stroke";return a};
|
|
mxCellHighlight.prototype.repaint=function(){if(null!=this.state&&null!=this.shape){this.graph.model.isEdge(this.state.cell)?this.shape.points=this.state.absolutePoints:(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),this.shape.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"));null!=this.state.shape&&this.shape.setCursor(this.state.shape.getCursor());if(mxClient.IS_QUIRKS||8==
|
|
document.documentMode)"transparent"==this.shape.stroke?(this.shape.stroke="white",this.shape.opacity=1):this.shape.opacity=this.opacity;this.shape.redraw()}};mxCellHighlight.prototype.hide=function(){this.highlight(null)};mxCellHighlight.prototype.highlight=function(a){this.state!=a&&(null!=this.shape&&(this.shape.destroy(),this.shape=null),this.state=a,null!=this.state&&this.drawHighlight())};
|
|
mxCellHighlight.prototype.isHighlightAt=function(a,b){var c=!1;if(null!=this.shape&&null!=document.elementFromPoint&&!mxClient.IS_QUIRKS)for(var d=document.elementFromPoint(a,b);null!=d;){if(d==this.shape.node){c=!0;break}d=d.parentNode}return c};
|
|
mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler);this.graph.getView().removeListener(this.repaintHandler);this.graph.getModel().removeListener(this.repaintHandler);null!=this.shape&&(this.shape.destroy(),this.shape=null)};
|
|
var mxCodecRegistry={codecs:[],aliases:[],register:function(a){if(null!=a){var b=a.getName();mxCodecRegistry.codecs[b]=a;var c=mxUtils.getFunctionName(a.template.constructor);c!=b&&mxCodecRegistry.addAlias(c,b)}return a},addAlias:function(a,b){mxCodecRegistry.aliases[a]=b},getCodec:function(a){var b=null;if(null!=a){var b=mxUtils.getFunctionName(a),c=mxCodecRegistry.aliases[b];null!=c&&(b=c);b=mxCodecRegistry.codecs[b];if(null==b)try{b=new mxObjectCodec(new a),mxCodecRegistry.register(b)}catch(d){}}return b}};
|
|
function mxCodec(a){this.document=a||mxUtils.createXmlDocument();this.objects=[]}mxCodec.prototype.document=null;mxCodec.prototype.objects=null;mxCodec.prototype.elements=null;mxCodec.prototype.encodeDefaults=!1;mxCodec.prototype.putObject=function(a,b){return this.objects[a]=b};mxCodec.prototype.getObject=function(a){var b=null;null!=a&&(b=this.objects[a],null==b&&(b=this.lookup(a),null==b&&(a=this.getElementById(a),null!=a&&(b=this.decode(a)))));return b};mxCodec.prototype.lookup=function(a){return null};
|
|
mxCodec.prototype.getElementById=function(a){null==this.elements&&(this.elements={},this.addElement(this.document.documentElement));return this.elements[a]};mxCodec.prototype.addElement=function(a){if(a.nodeType==mxConstants.NODETYPE_ELEMENT){var b=a.getAttribute("id");null!=b&&null==this.elements[b]&&(this.elements[b]=a)}for(a=a.firstChild;null!=a;)this.addElement(a),a=a.nextSibling};
|
|
mxCodec.prototype.getId=function(a){var b=null;null!=a&&(b=this.reference(a),null==b&&a instanceof mxCell&&(b=a.getId(),null==b&&(b=mxCellPath.create(a),0==b.length&&(b="root"))));return b};mxCodec.prototype.reference=function(a){return null};mxCodec.prototype.encode=function(a){var b=null;if(null!=a&&null!=a.constructor){var c=mxCodecRegistry.getCodec(a.constructor);null!=c?b=c.encode(this,a):mxUtils.isNode(a)?b=mxUtils.importNode(this.document,a,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(a.constructor))}return b};
|
|
mxCodec.prototype.decode=function(a,b){var c=null;if(null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT){c=null;try{c=window[a.nodeName]}catch(d){}c=mxCodecRegistry.getCodec(c);null!=c?c=c.decode(this,a,b):(c=a.cloneNode(!0),c.removeAttribute("as"))}return c};mxCodec.prototype.encodeCell=function(a,b,c){b.appendChild(this.encode(a));if(null==c||c){c=a.getChildCount();for(var d=0;d<c;d++)this.encodeCell(a.getChildAt(d),b)}};
|
|
mxCodec.prototype.isCellCodec=function(a){return null!=a&&"function"==typeof a.isCellCodec?a.isCellCodec():!1};mxCodec.prototype.decodeCell=function(a,b){b=null!=b?b:!0;var c=null;if(null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT){c=mxCodecRegistry.getCodec(a.nodeName);if(!this.isCellCodec(c))for(var d=a.firstChild;null!=d&&!this.isCellCodec(c);)c=mxCodecRegistry.getCodec(d.nodeName),d=d.nextSibling;this.isCellCodec(c)||(c=mxCodecRegistry.getCodec(mxCell));c=c.decode(this,a);b&&this.insertIntoGraph(c)}return c};
|
|
mxCodec.prototype.insertIntoGraph=function(a){var b=a.parent,c=a.getTerminal(!0),d=a.getTerminal(!1);a.setTerminal(null,!1);a.setTerminal(null,!0);a.parent=null;null!=b&&b.insert(a);null!=c&&c.insertEdge(a,!0);null!=d&&d.insertEdge(a,!1)};mxCodec.prototype.setAttribute=function(a,b,c){null!=b&&null!=c&&a.setAttribute(b,c)};
|
|
function mxObjectCodec(a,b,c,d){this.template=a;this.exclude=null!=b?b:[];this.idrefs=null!=c?c:[];this.mapping=null!=d?d:[];this.reverse={};for(var e in this.mapping)this.reverse[this.mapping[e]]=e}mxObjectCodec.allowEval=!1;mxObjectCodec.prototype.template=null;mxObjectCodec.prototype.exclude=null;mxObjectCodec.prototype.idrefs=null;mxObjectCodec.prototype.mapping=null;mxObjectCodec.prototype.reverse=null;mxObjectCodec.prototype.getName=function(){return mxUtils.getFunctionName(this.template.constructor)};
|
|
mxObjectCodec.prototype.cloneTemplate=function(){return new this.template.constructor};mxObjectCodec.prototype.getFieldName=function(a){if(null!=a){var b=this.reverse[a];null!=b&&(a=b)}return a};mxObjectCodec.prototype.getAttributeName=function(a){if(null!=a){var b=this.mapping[a];null!=b&&(a=b)}return a};mxObjectCodec.prototype.isExcluded=function(a,b,c,d){return b==mxObjectIdentity.FIELD_NAME||0<=mxUtils.indexOf(this.exclude,b)};
|
|
mxObjectCodec.prototype.isReference=function(a,b,c,d){return 0<=mxUtils.indexOf(this.idrefs,b)};mxObjectCodec.prototype.encode=function(a,b){var c=a.document.createElement(this.getName());b=this.beforeEncode(a,b,c);this.encodeObject(a,b,c);return this.afterEncode(a,b,c)};mxObjectCodec.prototype.encodeObject=function(a,b,c){a.setAttribute(c,"id",a.getId(b));for(var d in b){var e=d,f=b[e];null!=f&&!this.isExcluded(b,e,f,!0)&&(mxUtils.isInteger(e)&&(e=null),this.encodeValue(a,b,e,f,c))}};
|
|
mxObjectCodec.prototype.encodeValue=function(a,b,c,d,e){if(null!=d){if(this.isReference(b,c,d,!0)){var f=a.getId(d);if(null==f){mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+c+"\x3d"+d);return}d=f}f=this.template[c];if(null==c||a.encodeDefaults||f!=d)c=this.getAttributeName(c),this.writeAttribute(a,b,c,d,e)}};mxObjectCodec.prototype.writeAttribute=function(a,b,c,d,e){"object"!=typeof d?this.writePrimitiveAttribute(a,b,c,d,e):this.writeComplexAttribute(a,b,c,d,e)};
|
|
mxObjectCodec.prototype.writePrimitiveAttribute=function(a,b,c,d,e){d=this.convertAttributeToXml(a,b,c,d,e);null==c?(b=a.document.createElement("add"),"function"==typeof d?b.appendChild(a.document.createTextNode(d)):a.setAttribute(b,"value",d),e.appendChild(b)):"function"!=typeof d&&a.setAttribute(e,c,d)};
|
|
mxObjectCodec.prototype.writeComplexAttribute=function(a,b,c,d,e){a=a.encode(d);null!=a?(null!=c&&a.setAttribute("as",c),e.appendChild(a)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+c+": "+d)};mxObjectCodec.prototype.convertAttributeToXml=function(a,b,c,d){this.isBooleanAttribute(a,b,c,d)&&(d=!0==d?"1":"0");return d};mxObjectCodec.prototype.isBooleanAttribute=function(a,b,c,d){return"undefined"==typeof d.length&&(!0==d||!1==d)};
|
|
mxObjectCodec.prototype.convertAttributeFromXml=function(a,b,c){var d=b.value;this.isNumericAttribute(a,b,c)&&(d=parseFloat(d));return d};mxObjectCodec.prototype.isNumericAttribute=function(a,b,c){return mxUtils.isNumeric(b.value)};mxObjectCodec.prototype.beforeEncode=function(a,b,c){return b};mxObjectCodec.prototype.afterEncode=function(a,b,c){return c};
|
|
mxObjectCodec.prototype.decode=function(a,b,c){var d=b.getAttribute("id"),e=a.objects[d];null==e&&(e=c||this.cloneTemplate(),null!=d&&a.putObject(d,e));b=this.beforeDecode(a,b,e);this.decodeNode(a,b,e);return this.afterDecode(a,b,e)};mxObjectCodec.prototype.decodeNode=function(a,b,c){null!=b&&(this.decodeAttributes(a,b,c),this.decodeChildren(a,b,c))};mxObjectCodec.prototype.decodeAttributes=function(a,b,c){b=b.attributes;if(null!=b)for(var d=0;d<b.length;d++)this.decodeAttribute(a,b[d],c)};
|
|
mxObjectCodec.prototype.isIgnoredAttribute=function(a,b,c){return"as"==b.nodeName||"id"==b.nodeName};mxObjectCodec.prototype.decodeAttribute=function(a,b,c){if(!this.isIgnoredAttribute(a,b,c)){var d=b.nodeName;b=this.convertAttributeFromXml(a,b,c);var e=this.getFieldName(d);if(this.isReference(c,e,b,!1)){a=a.getObject(b);if(null==a){mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+d+"\x3d"+b);return}b=a}this.isExcluded(c,d,b,!1)||(c[d]=b)}};
|
|
mxObjectCodec.prototype.decodeChildren=function(a,b,c){for(b=b.firstChild;null!=b;){var d=b.nextSibling;b.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(a,b,c)&&this.decodeChild(a,b,c);b=d}};
|
|
mxObjectCodec.prototype.decodeChild=function(a,b,c){var d=this.getFieldName(b.getAttribute("as"));if(null==d||!this.isExcluded(c,d,b,!1)){var e=this.getFieldTemplate(c,d,b),f=null;"add"==b.nodeName?(f=b.getAttribute("value"),null==f&&mxObjectCodec.allowEval&&(f=mxUtils.eval(mxUtils.getTextContent(b)))):f=a.decode(b,e);this.addObjectValue(c,d,f,e)}};mxObjectCodec.prototype.getFieldTemplate=function(a,b,c){a=a[b];a instanceof Array&&0<a.length&&(a=null);return a};
|
|
mxObjectCodec.prototype.addObjectValue=function(a,b,c,d){null!=c&&c!=d&&(null!=b&&0<b.length?a[b]=c:a.push(c))};mxObjectCodec.prototype.processInclude=function(a,b,c){if("include"==b.nodeName){b=b.getAttribute("name");if(null!=b)try{var d=mxUtils.load(b).getDocumentElement();null!=d&&a.decode(d,c)}catch(e){}return!0}return!1};mxObjectCodec.prototype.beforeDecode=function(a,b,c){return b};mxObjectCodec.prototype.afterDecode=function(a,b,c){return c};
|
|
mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);a.isCellCodec=function(){return!0};a.isNumericAttribute=function(a,c,d){return"value"!==c.nodeName&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)};a.isExcluded=function(a,c,d,e){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||e&&"value"==c&&d.nodeType==mxConstants.NODETYPE_ELEMENT};a.afterEncode=function(a,c,d){if(null!=
|
|
c.value&&c.value.nodeType==mxConstants.NODETYPE_ELEMENT){var e=d;d=mxUtils.importNode(a.document,c.value,!0);d.appendChild(e);a=e.getAttribute("id");d.setAttribute("id",a);e.removeAttribute("id")}return d};a.beforeDecode=function(a,c,d){var e=c.cloneNode(!0),f=this.getName();c.nodeName!=f?(e=c.getElementsByTagName(f)[0],null!=e&&e.parentNode==c?(mxUtils.removeWhitespace(e,!0),mxUtils.removeWhitespace(e,!1),e.parentNode.removeChild(e)):e=null,d.value=c.cloneNode(!0),c=d.value.getAttribute("id"),null!=
|
|
c&&(d.setId(c),d.value.removeAttribute("id"))):d.setId(c.getAttribute("id"));if(null!=e)for(c=0;c<this.idrefs.length;c++){var f=this.idrefs[c],g=e.getAttribute(f);if(null!=g){e.removeAttribute(f);var h=a.objects[g]||a.lookup(g);null==h&&(g=a.getElementById(g),null!=g&&(h=(mxCodecRegistry.codecs[g.nodeName]||this).decode(a,g)));d[f]=h}}return e};return a}());
|
|
mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxGraphModel);a.encodeObject=function(a,c,d){var e=a.document.createElement("root");a.encodeCell(c.getRoot(),e);d.appendChild(e)};a.decodeChild=function(a,c,d){"root"==c.nodeName?this.decodeRoot(a,c,d):mxObjectCodec.prototype.decodeChild.apply(this,arguments)};a.decodeRoot=function(a,c,d){var e=null;for(c=c.firstChild;null!=c;){var f=a.decodeCell(c);null!=f&&null==f.getParent()&&(e=f);c=c.nextSibling}null!=e&&d.setRoot(e)};return a}());
|
|
var mxStylesheetCodec=mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxStylesheet);a.encode=function(a,c){var d=a.document.createElement(this.getName()),e;for(e in c.styles){var f=c.styles[e],g=a.document.createElement("add");if(null!=e){g.setAttribute("as",e);for(var h in f){var k=this.getStringValue(h,f[h]);if(null!=k){var m=a.document.createElement("add");m.setAttribute("value",k);m.setAttribute("as",h);g.appendChild(m)}}0<g.childNodes.length&&d.appendChild(g)}}return d};a.getStringValue=
|
|
function(a,c){var d=typeof c;"function"==d?c=mxStyleRegistry.getName(style[j]):"object"==d&&(c=null);return c};a.decode=function(a,c,d){d=d||new this.template.constructor;var e=c.getAttribute("id");null!=e&&(a.objects[e]=d);for(c=c.firstChild;null!=c;){if(!this.processInclude(a,c,d)&&"add"==c.nodeName&&(e=c.getAttribute("as"),null!=e)){var f=c.getAttribute("extend"),g=null!=f?mxUtils.clone(d.styles[f]):null;null==g&&(null!=f&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+f+" not found to extend"),
|
|
g={});for(f=c.firstChild;null!=f;){if(f.nodeType==mxConstants.NODETYPE_ELEMENT){var h=f.getAttribute("as");if("add"==f.nodeName){var k=mxUtils.getTextContent(f),m=null;null!=k&&0<k.length&&mxStylesheetCodec.allowEval?m=mxUtils.eval(k):(m=f.getAttribute("value"),mxUtils.isNumeric(m)&&(m=parseFloat(m)));null!=m&&(g[h]=m)}else"remove"==f.nodeName&&delete g[h]}f=f.nextSibling}d.putCellStyle(e,g)}c=c.nextSibling}return d};return a}());mxStylesheetCodec.allowEval=!0;"undefined"!==typeof html4&&(html4.ATTRIBS["a::target"]=0);mxConstants.SHADOW_OPACITY=0.25;mxConstants.SHADOWCOLOR="#000000";mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxGraph.prototype.pageBreakColor="#c0c0c0";mxGraph.prototype.pageScale=1;(function(){try{if(null!=navigator&&null!=navigator.language){var a=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===a||"en-ca"===a||"es-mx"===a?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(b){}})();
|
|
mxText.prototype.baseSpacingTop=5;mxText.prototype.baseSpacingBottom=1;mxGraphModel.prototype.ignoreRelativeEdgeParent=!1;mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs\x3d":IMAGE_PATH+"/grid.gif";mxGraphView.prototype.gridSteps=4;mxGraphView.prototype.minGridSize=4;mxGraphView.prototype.gridColor="#e0e0e0";mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]";
|
|
Graph=function(a,b,c,d,e){mxGraph.call(this,a,b,c,d);this.themes=e||this.defaultThemes;a=this.baseUrl;b=a.indexOf("//");this.domainPathUrl=this.domainUrl="";0<b&&(b=a.indexOf("/",b+2),0<b&&(this.domainUrl=a.substring(0,b)),b=a.lastIndexOf("/"),0<b&&(this.domainPathUrl=a.substring(0,b+1)));this.isHtmlLabel=function(a){var b=this.view.getState(a);a=null!=b?b.style:this.getCellStyle(a);return"1"==a.html||"wrap"==a[mxConstants.STYLE_WHITE_SPACE]};if(this.edgeMode){var f=null,g=null,h=null,k=null,m=!1;
|
|
this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,b){if("mouseDown"==b.getProperty("eventName")&&this.isEnabled()){var c=b.getProperty("event");if(!mxEvent.isControlDown(c.getEvent())&&!mxEvent.isShiftDown(c.getEvent())){var d=c.getState();null!=d&&this.model.isEdge(d.cell)&&(f=new mxPoint(c.getGraphX(),c.getGraphY()),m=this.isCellSelected(d.cell),h=d,g=c,null!=d.text&&null!=d.text.boundingBox&&mxUtils.contains(d.text.boundingBox,c.getGraphX(),c.getGraphY())?k=mxEvent.LABEL_HANDLE:
|
|
(d=this.selectionCellsHandler.getHandler(d.cell),null!=d&&(null!=d.bends&&0<d.bends.length)&&(k=d.getHandleForEvent(c))))}}}));this.addMouseListener({mouseDown:function(a,b){},mouseMove:mxUtils.bind(this,function(a,b){if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isControlDown(b.getEvent())&&!mxEvent.isShiftDown(b.getEvent())&&!mxEvent.isAltDown(b.getEvent())){var c=this.tolerance;if(null!=f&&null!=h&&null!=g){var d=h;if(Math.abs(f.x-b.getGraphX())>c*this.view.scale||Math.abs(f.y-
|
|
b.getGraphY())>c*this.view.scale){this.isCellSelected(d.cell)||this.setSelectionCell(d.cell);var e=this.selectionCellsHandler.getHandler(d.cell);if(null!=e&&null!=e.bends&&0<e.bends.length){var l=e.getHandleForEvent(g),n=this.view.getEdgeStyle(d),c=n==mxEdgeStyle.EntityRelation;!m&&k==mxEvent.LABEL_HANDLE&&(l=k);if(!c||0==l||l==e.bends.length-1||l==mxEvent.LABEL_HANDLE){if(l==mxEvent.LABEL_HANDLE||0==l||null!=d.visibleSourceState||l==e.bends.length-1||null!=d.visibleTargetState){if(!c&&l!=mxEvent.LABEL_HANDLE){c=
|
|
d.absolutePoints;if(null!=c&&(null==n&&null==l||n==mxEdgeStyle.OrthConnector))l=k,null==l&&(l=new mxRectangle(f.x,f.y),l.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(l,c[0].x,c[0].y)?l=0:mxUtils.contains(l,c[c.length-1].x,c[c.length-1].y)?l=e.bends.length-1:null!=n&&(2==c.length||3==c.length&&(0==Math.round(c[0].x-c[1].x)&&0==Math.round(c[1].x-c[2].x)||0==Math.round(c[0].y-c[1].y)&&0==Math.round(c[1].y-c[2].y)))?l=2:(l=mxUtils.findNearestSegment(d,f.x,f.y),l=null==n?mxEvent.VIRTUAL_HANDLE-
|
|
l:l+1));null==l&&(l=mxEvent.VIRTUAL_HANDLE)}e.start(b.getGraphX(),b.getGraphX(),l);k=f=g=h=null;m=!1;b.consume();this.graphHandler.reset()}}else if(c&&(null!=d.visibleSourceState||null!=d.visibleTargetState))this.graphHandler.reset(),b.consume()}}}else if(d=b.getState(),null!=d&&this.model.isEdge(d.cell)){e=null;c=d.absolutePoints;if(null!=c)if(l=new mxRectangle(b.getGraphX(),b.getGraphY()),l.grow(mxEdgeHandler.prototype.handleImage.width/2),null!=d.text&&null!=d.text.boundingBox&&mxUtils.contains(d.text.boundingBox,
|
|
b.getGraphX(),b.getGraphY()))e="move";else if(mxUtils.contains(l,c[0].x,c[0].y)||mxUtils.contains(l,c[c.length-1].x,c[c.length-1].y))e="pointer";else if(null!=d.visibleSourceState||null!=d.visibleTargetState)n=this.view.getEdgeStyle(d),e="crosshair",n!=mxEdgeStyle.EntityRelation&&this.isOrthogonal(d)&&(n=mxUtils.findNearestSegment(d,b.getGraphX(),b.getGraphY()),n<c.length-1&&0<=n&&(e=0==Math.round(c[n].x-c[n+1].x)?"col-resize":"row-resize"));null!=e&&d.setCursor(e)}}}),mouseUp:mxUtils.bind(this,function(a,
|
|
b){k=f=g=h=null})})}this.cellRenderer.getLabelValue=function(a){var b=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);a.view.graph.isHtmlLabel(a.cell)&&(b=1!=a.style.html?mxUtils.htmlEntities(b,!1):a.view.graph.sanitizeHtml(b));return b};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0);this.setTooltips(!0);this.setAllowLoops(!0);this.allowAutoPanning=!0;this.constrainChildren=this.resetEdgesOnConnect=!1;this.constrainRelativeChildren=
|
|
!0;this.graphHandler.scrollOnMove=!1;this.graphHandler.scaleGrid=!0;this.connectionHandler.setCreateTarget(!1);this.connectionHandler.insertBeforeSource=!0;this.connectionHandler.isValidSource=function(a,b){return!1};this.alternateEdgeStyle="vertical";null==d&&this.loadStylesheet();var l=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var a=l.apply(this,arguments);if(this.graph.pageVisible){for(var b=[],c=this.graph.pageFormat,d=this.graph.pageScale,e=c.width*d,c=c.height*
|
|
d,d=this.graph.view.translate,f=this.graph.view.scale,g=this.graph.getPageLayout(),h=0;h<g.width;h++)b.push(new mxRectangle(((g.x+h)*e+d.x)*f,(g.y*c+d.y)*f,e*f,c*f));for(h=0;h<g.height;h++)b.push(new mxRectangle((g.x*e+d.x)*f,((g.y+h)*c+d.y)*f,e*f,c*f));a=b.concat(a)}return a};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=function(a,b){return null==a.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(a){this.previewColor=
|
|
"#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};this.graphHandler.getCells=function(a){for(var b=mxGraphHandler.prototype.getCells.apply(this,arguments),c=[],d=0;d<b.length;d++){var e=this.graph.view.getState(b[d]),e=null!=e?e.style:this.graph.getCellStyle(b[d]);"1"==mxUtils.getValue(e,"part","0")?(e=this.graph.model.getParent(b[d]),this.graph.model.isVertex(e)&&0>mxUtils.indexOf(b,e)&&c.push(e)):
|
|
c.push(b[d])}return c};this.connectionHandler.createTargetVertex=function(a,b){var c=this.graph.view.getState(b),c=null!=c?c.style:this.graph.getCellStyle(b);mxUtils.getValue(c,"part",!1)&&(c=this.graph.model.getParent(b),this.graph.model.isVertex(c)&&(b=c));return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};var n=new mxRubberband(this);this.getRubberband=function(){return n};var p=(new Date).getTime(),r=0,q=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=
|
|
function(){var a=this.currentState;q.apply(this,arguments);a!=this.currentState?(p=(new Date).getTime(),r=0):r=(new Date).getTime()-p};var s=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(a){return null!=this.currentState&&a.getState()==this.currentState&&2E3<r||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&s.apply(this,arguments)};var u=this.isToggleEvent;this.isToggleEvent=function(a){return u.apply(this,
|
|
arguments)||mxEvent.isShiftDown(a)};var t=n.isForceRubberbandEvent;n.isForceRubberbandEvent=function(a){return t.apply(this,arguments)||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==a.getState()&&mxEvent.isTouchEvent(a.getEvent())};var z=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(z=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,
|
|
function(){this.isEnabled()&&(this.container.style.cursor=z)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(a){return mxEvent.isMouseEvent(a.getEvent())};var y=this.click;this.click=function(a){if(!this.isEnabled()&&!a.isConsumed()){var b=a.getCell();null!=b&&(b=this.getLinkForCell(b),null!=b&&window.open(b))}else return y.apply(this,arguments)};var v=this.getCursorForCell;this.getCursorForCell=function(a){if(this.isEnabled())return v.apply(this,arguments);if(null!=
|
|
this.getLinkForCell(a))return"pointer"};this.selectRegion=function(a,b){var c=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(c,b);return c};this.getAllCells=function(a,b,c,d,e,f){f=null!=f?f:[];if(0<c||0<d){var g=this.getModel(),h=a+c,k=b+d;null==e&&(e=this.getCurrentRoot(),null==e&&(e=g.getRoot()));if(null!=e)for(var m=g.getChildCount(e),l=0;l<m;l++){var n=g.getChildAt(e,l),p=this.view.getState(n);if(null!=p&&this.isCellVisible(n)&&"1"!=mxUtils.getValue(p.style,"locked","0")){var q=
|
|
mxUtils.getValue(p.style,mxConstants.STYLE_ROTATION)||0;0!=q&&(p=mxUtils.getBoundingBox(p,q));(g.isEdge(n)||g.isVertex(n))&&(p.x>=a&&p.y+p.height<=k&&p.y>=b&&p.x+p.width<=h)&&f.push(n);this.getAllCells(a,b,c,d,n,f)}}}return f};var K=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,b,c){return this.graph.isCellSelected(a)?!1:K.apply(this,arguments)};this.isCellLocked=function(a){for(a=this.view.getState(a);null!=a;){if("1"==mxUtils.getValue(a.style,
|
|
"locked","0"))return!0;a=this.view.getState(this.model.getParent(a.cell))}return!1};var F=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,b){if("mouseDown"==b.getProperty("eventName")){var c=b.getProperty("event").getState();F=null!=c&&!this.isSelectionEmpty()&&!this.isCellSelected(c.cell)?this.getSelectionCells():null}}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(a,b){if(!mxEvent.isMultiTouchEvent(b)){var c=b.getProperty("event"),d=b.getProperty("cell");
|
|
null==d?(c=mxUtils.convertPoint(this.container,mxEvent.getClientX(c),mxEvent.getClientY(c)),n.start(c.x,c.y)):null!=F?this.addSelectionCells(F):1<this.getSelectionCount()&&this.isCellSelected(d)&&this.removeSelectionCell(d);F=null;b.consume()}}));this.connectionHandler.selectCells=function(a,b){this.graph.setSelectionCell(b||a)};this.connectionHandler.constraintHandler.isStateIgnored=function(a,b){return b&&a.view.graph.isCellSelected(a.cell)};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,
|
|
function(){var a=this.connectionHandler.constraintHandler;null!=a.currentFocus&&a.isStateIgnored(a.currentFocus,!0)&&(a.currentFocus=null,a.constraints=null,a.destroyIcons());a.destroyFocusHighlight()}));Graph.touchStyle&&this.initTouch();var H=this.updateMouseEvent;this.updateMouseEvent=function(a){a=H.apply(this,arguments);this.isCellLocked(a.getCell())&&(a.state=null);return a}}};
|
|
Graph.touchStyle=mxClient.IS_TOUCH||mxClient.IS_FF&&mxClient.IS_WIN||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints||null==window.urlParams||"1"==urlParams.touch;Graph.fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList&&(null==window.urlParams||"0"!=urlParams.filesupport);mxUtils.extend(Graph,mxGraph);Graph.prototype.minFitScale=null;Graph.prototype.maxFitScale=null;Graph.prototype.linkTarget="_blank";Graph.prototype.defaultScrollbars=!mxClient.IS_IOS;
|
|
Graph.prototype.defaultPageVisible=!0;Graph.prototype.lightbox=!1;Graph.prototype.defaultGraphBackground="#ffffff";Graph.prototype.transparentBackground=!0;Graph.prototype.defaultEdgeLength=80;Graph.prototype.edgeMode=!1;Graph.prototype.connectionArrowsEnabled=!0;Graph.prototype.placeholderPattern=RegExp("%(date{.*}|[^%^{^}]+)%","g");Graph.prototype.defaultThemeName="default";Graph.prototype.defaultThemes={};Graph.prototype.baseUrl=window.location!=window.parent.location?document.referrer:document.location.toString();
|
|
Graph.prototype.init=function(a){mxGraph.prototype.init.apply(this,arguments);this.initLayoutManager()};
|
|
Graph.prototype.initLayoutManager=function(){this.layoutManager=new mxLayoutManager(this);this.layoutManager.getLayout=function(a){var b=this.graph.view.getState(a);a=null!=b?b.style:this.graph.getCellStyle(a);return"stackLayout"==a.childLayout?(b=new mxStackLayout(this.graph,!0),b.resizeParentMax=!0,b.horizontal="1"==mxUtils.getValue(a,"horizontalStack","1"),b.resizeParent="1"==mxUtils.getValue(a,"resizeParent","1"),b.resizeLast="1"==mxUtils.getValue(a,"resizeLast","0"),b.marginLeft=a.marginLeft||
|
|
0,b.marginRight=a.marginRight||0,b.marginTop=a.marginTop||0,b.marginBottom=a.marginBottom||0,b.fill=!0,b):"treeLayout"==a.childLayout?(b=new mxCompactTreeLayout(this.graph),b.horizontal="1"==mxUtils.getValue(a,"horizontalTree","1"),b.resizeParent="1"==mxUtils.getValue(a,"resizeParent","1"),b.groupPadding=mxUtils.getValue(a,"parentPadding",20),b.levelDistance=mxUtils.getValue(a,"treeLevelDistance",30),b.maintainParentLocation=!0,b.edgeRouting=!1,b.resetEdges=!1,b):"flowLayout"==a.childLayout?(b=new mxHierarchicalLayout(this.graph,
|
|
mxUtils.getValue(a,"flowOrientation",mxConstants.DIRECTION_EAST)),b.resizeParent="1"==mxUtils.getValue(a,"resizeParent","1"),b.parentBorder=mxUtils.getValue(a,"parentPadding",20),b.maintainParentLocation=!0,b.intraCellSpacing=mxUtils.getValue(a,"intraCellSpacing",mxHierarchicalLayout.prototype.intraCellSpacing),b.interRankCellSpacing=mxUtils.getValue(a,"interRankCellSpacing",mxHierarchicalLayout.prototype.interRankCellSpacing),b.interHierarchySpacing=mxUtils.getValue(a,"interHierarchySpacing",mxHierarchicalLayout.prototype.interHierarchySpacing),
|
|
b.parallelEdgeSpacing=mxUtils.getValue(a,"parallelEdgeSpacing",mxHierarchicalLayout.prototype.parallelEdgeSpacing),b):null}};Graph.prototype.sanitizeHtml=function(a){return html_sanitize(a,function(a){return null!=a&&"javascript:"!==a.toString().toLowerCase().substring(0,11)?a:null},function(a){return a})};Graph.prototype.updatePlaceholders=function(){var a=!1,b;for(b in this.model.cells){var c=this.model.cells[b];this.isReplacePlaceholders(c)&&(this.view.invalidate(c,!1,!1),a=!0)}a&&this.view.validate()};
|
|
Graph.prototype.isReplacePlaceholders=function(a){return null!=a.value&&"object"==typeof a.value&&"1"==a.value.getAttribute("placeholders")};Graph.prototype.isIgnoreTerminalEvent=function(a){return mxEvent.isShiftDown(a)&&mxEvent.isControlDown(a)};Graph.prototype.isSplitTarget=function(a,b,c){return!mxEvent.isShiftDown(c)&&mxGraph.prototype.isSplitTarget.apply(this,arguments)};
|
|
Graph.prototype.getLabel=function(a){var b=mxGraph.prototype.getLabel.apply(this,arguments);null!=b&&(this.isReplacePlaceholders(a)&&null==a.getAttribute("placeholder"))&&(b=this.replacePlaceholders(a,b));return b};Graph.prototype.isLabelMovable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return!this.isCellLocked(a)&&(this.model.isEdge(a)&&this.edgeLabelsMovable||this.model.isVertex(a)&&(this.vertexLabelsMovable||"1"==mxUtils.getValue(b,"labelMovable","0")))};
|
|
mxGraph.prototype.setGridSize=function(a){this.gridSize=a;this.fireEvent(new mxEventObject("gridSizeChanged"))};Graph.prototype.getGlobalVariable=function(a){var b=null;"date"==a?b=(new Date).toLocaleDateString():"time"==a?b=(new Date).toLocaleTimeString():"timestamp"==a?b=(new Date).toLocaleString():"date{"==a.substring(0,5)&&(a=a.substring(5,a.length-1),b=this.formatDate(new Date,a));return b};
|
|
Graph.prototype.formatDate=function(a,b,c){null==this.dateFormatCache&&(this.dateFormatCache={i18n:{dayNames:"Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" ")},masks:{"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",
|
|
shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var d=this.dateFormatCache,e=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,f=/[^-+\dA-Z]/g,g=function(a,b){a=String(a);for(b=b||2;a.length<b;)a="0"+a;return a};1==arguments.length&&("[object String]"==Object.prototype.toString.call(a)&&
|
|
!/\d/.test(a))&&(b=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");b=String(d.masks[b]||b||d.masks["default"]);"UTC:"==b.slice(0,4)&&(b=b.slice(4),c=!0);var h=c?"getUTC":"get",k=a[h+"Date"](),m=a[h+"Day"](),l=a[h+"Month"](),n=a[h+"FullYear"](),p=a[h+"Hours"](),r=a[h+"Minutes"](),q=a[h+"Seconds"](),h=a[h+"Milliseconds"](),s=c?0:a.getTimezoneOffset(),u={d:k,dd:g(k),ddd:d.i18n.dayNames[m],dddd:d.i18n.dayNames[m+7],m:l+1,mm:g(l+1),mmm:d.i18n.monthNames[l],mmmm:d.i18n.monthNames[l+
|
|
12],yy:String(n).slice(2),yyyy:n,h:p%12||12,hh:g(p%12||12),H:p,HH:g(p),M:r,MM:g(r),s:q,ss:g(q),l:g(h,3),L:g(99<h?Math.round(h/10):h),t:12>p?"a":"p",tt:12>p?"am":"pm",T:12>p?"A":"P",TT:12>p?"AM":"PM",Z:c?"UTC":(String(a).match(e)||[""]).pop().replace(f,""),o:(0<s?"-":"+")+g(100*Math.floor(Math.abs(s)/60)+Math.abs(s)%60,4),S:["th","st","nd","rd"][3<k%10?0:(10!=k%100-k%10)*k%10]};return b.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(a){return a in u?u[a]:a.slice(1,
|
|
a.length-1)})};
|
|
Graph.prototype.createLayersDialog=function(){var a=document.createElement("div");a.style.position="absolute";for(var b=this.getModel(),c=b.getChildCount(b.root),d=0;d<c;d++)(function(c){var d=document.createElement("div");d.style.overflow="hidden";d.style.textOverflow="ellipsis";d.style.padding="2px";d.style.whiteSpace="nowrap";var g=document.createElement("input");g.setAttribute("type","checkbox");b.isVisible(c)&&(g.setAttribute("checked","checked"),g.defaultChecked=!0);d.appendChild(g);var h=c.value||
|
|
mxResources.get("background")||"Background";d.setAttribute("title",h);mxUtils.write(d,h);a.appendChild(d);mxEvent.addListener(g,"click",function(){null!=g.getAttribute("checked")?g.removeAttribute("checked"):g.setAttribute("checked","checked");b.setVisible(c,g.checked)})})(b.getChildAt(b.root,d));return a};
|
|
Graph.prototype.replacePlaceholders=function(a,b){for(var c=[],d=0;match=this.placeholderPattern.exec(b);){var e=match[0];if(2<e.length&&"%label%"!=e&&"%tooltip%"!=e){var f=null;if(match.index>d&&"%"==b.charAt(match.index-1))f=e.substring(1);else{var g=e.substring(1,e.length-1);if(0>g.indexOf("{"))for(var h=a;null==f&&null!=h;)null!=h.value&&"object"==typeof h.value&&(f=h.hasAttribute(g)?null!=h.getAttribute(g)?h.getAttribute(g):"":null),h=this.model.getParent(h);null==f&&(f=this.getGlobalVariable(g))}c.push(b.substring(d,
|
|
match.index)+(null!=f?f:e));d=match.index+e.length}}c.push(b.substring(d));return c.join("")};Graph.prototype.selectCellsForConnectVertex=function(a,b,c){2==a.length&&this.model.isVertex(a[1])?(this.setSelectionCell(a[1]),null!=c&&(mxEvent.isTouchEvent(b)?c.update(c.getState(this.view.getState(a[1]))):c.reset()),this.scrollCellToVisible(a[1])):this.setSelectionCells(a)};
|
|
Graph.prototype.connectVertex=function(a,b,c,d,e){var f=a.geometry.relative?new mxPoint(a.parent.geometry.width*a.geometry.x,a.parent.geometry.height*a.geometry.y):new mxPoint(a.geometry.x,a.geometry.y);b==mxConstants.DIRECTION_NORTH?(f.x+=a.geometry.width/2,f.y-=c):b==mxConstants.DIRECTION_SOUTH?(f.x+=a.geometry.width/2,f.y+=a.geometry.height+c):(f.x=b==mxConstants.DIRECTION_WEST?f.x-c:f.x+(a.geometry.width+c),f.y+=a.geometry.height/2);c=this.view.getState(this.model.getParent(a));var g=this.view.scale,
|
|
h=this.view.translate,k=h.x*g,h=h.y*g;this.model.isVertex(c.cell)&&(k=c.x,h=c.y);this.model.isVertex(a.parent)&&a.geometry.relative&&(f.x+=a.parent.geometry.x,f.y+=a.parent.geometry.y);c=mxEvent.isControlDown(d)&&!e?null:this.getCellAt(k+f.x*g,h+f.y*g);this.model.isAncestor(c,a)&&(c=null);for(g=c;null!=g;){if(this.isCellLocked(g)){c=null;break}g=this.model.getParent(g)}null!=c&&(g=this.view.getState(a),k=this.view.getState(c),null!=g&&(null!=k&&mxUtils.intersects(g,k))&&(c=null));if(e=!mxEvent.isShiftDown(d)||
|
|
e)b==mxConstants.DIRECTION_NORTH?f.y-=a.geometry.height/2:b==mxConstants.DIRECTION_SOUTH?f.y+=a.geometry.height/2:f.x=b==mxConstants.DIRECTION_WEST?f.x-a.geometry.width/2:f.x+a.geometry.width/2;null!=c&&!this.isCellConnectable(c)&&(g=this.getModel().getParent(c),this.getModel().isVertex(g)&&this.isCellConnectable(g)&&(c=g));if(c==a||this.model.isEdge(c)||!this.isCellConnectable(c))c=null;g=[];this.model.beginUpdate();try{k=c;if(null==k&&e){for(var h=a,m=this.getCellGeometry(a);null!=m&&m.relative;)h=
|
|
this.getModel().getParent(h),m=this.getCellGeometry(h);var l=this.view.getState(h),n=null!=l?l.style:this.getCellStyle(h);if(mxUtils.getValue(n,"part",!1)){var p=this.model.getParent(h);this.model.isVertex(p)&&(h=p)}k=this.duplicateCells([h],!1)[0];m=this.getCellGeometry(k);m.x=f.x-m.width/2;m.y=f.y-m.height/2}m=null;null!=this.layoutManager&&(m=this.layoutManager.getLayout(this.model.getParent(a)));var r=mxEvent.isControlDown(d)&&e||null==c&&null!=m&&m.constructor==mxStackLayout?null:this.insertEdge(this.model.getParent(a),
|
|
null,"",a,k,this.createCurrentEdgeStyle());if(null!=r&&this.connectionHandler.insertBeforeSource){var q=null;for(d=a;null!=d.parent&&null!=d.geometry&&d.geometry.relative&&d.parent!=r.parent;)d=this.model.getParent(d);null!=d&&(null!=d.parent&&d.parent==r.parent)&&(q=d.parent.getIndex(d),d.parent.insert(r,q))}null==c&&(null!=k&&null!=m&&null!=a.parent&&m.constructor==mxStackLayout&&b==mxConstants.DIRECTION_WEST)&&(q=a.parent.getIndex(a),a.parent.insert(k,q));null!=r&&g.push(r);null==c&&null!=k&&g.push(k);
|
|
null==k&&null!=r&&r.geometry.setTerminalPoint(f,!1);null!=r&&this.fireEvent(new mxEventObject("cellsInserted","cells",[r]))}finally{this.model.endUpdate()}return g};
|
|
Graph.prototype.convertValueToString=function(a){if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder")){for(var b=a.getAttribute("placeholder"),c=a,d=null;null==d&&null!=c;)null!=c.value&&"object"==typeof c.value&&(d=c.hasAttribute(b)?null!=c.getAttribute(b)?c.getAttribute(b):"":null),c=this.model.getParent(c);return d||""}return a.value.getAttribute("label")}return mxGraph.prototype.convertValueToString.apply(this,arguments)};
|
|
Graph.prototype.getLinkForCell=function(a){return null!=a.value&&"object"==typeof a.value?(a=a.value.getAttribute("link"),null!=a&&"javascript:"===a.toLowerCase().substring(0,11)&&(a=a.substring(11)),a):null};
|
|
Graph.prototype.getCellStyle=function(a){var b=mxGraph.prototype.getCellStyle.apply(this,arguments);if(null!=a&&null!=this.layoutManager){var c=this.model.getParent(a);this.model.isVertex(c)&&this.isCellCollapsed(a)&&(c=this.layoutManager.getLayout(c),null!=c&&c.constructor==mxStackLayout&&(b[mxConstants.STYLE_HORIZONTAL]=!c.horizontal))}return b};
|
|
Graph.prototype.updateAlternateBounds=function(a,b,c){if(null!=a&&null!=b&&null!=this.layoutManager&&null!=b.alternateBounds){var d=this.layoutManager.getLayout(this.model.getParent(a));null!=d&&d.constructor==mxStackLayout&&(d.horizontal?b.alternateBounds.height=0:b.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)};Graph.prototype.isMoveCellsEvent=function(a){return mxEvent.isShiftDown(a)};
|
|
Graph.prototype.foldCells=function(a,b,c,d,e){b=null!=b?b:!1;null==c&&(c=this.getFoldableCells(this.getSelectionCells(),a));if(null!=c){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var f=0;f<c.length;f++){var g=this.view.getState(c[f]),h=this.getCellGeometry(c[f]);if(null!=g&&null!=h){var k=Math.round(h.width-g.width/this.view.scale),m=Math.round(h.height-g.height/this.view.scale);if(0!=m||0!=k){var l=this.model.getParent(c[f]),n=this.layoutManager.getLayout(l);
|
|
null==n?null!=e&&this.isMoveCellsEvent(e)&&this.moveSiblings(g,l,k,m):(null==e||!mxEvent.isAltDown(e))&&(n.constructor==mxStackLayout&&!n.resizeLast)&&this.resizeParentStacks(l,n,k,m)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(c)}};
|
|
Graph.prototype.moveSiblings=function(a,b,c,d){this.model.beginUpdate();try{var e=this.getCellsBeyond(a.x,a.y,b,!0,!0);for(b=0;b<e.length;b++)if(e[b]!=a.cell){var f=this.view.getState(e[b]),g=this.getCellGeometry(e[b]);null!=f&&null!=g&&(g=g.clone(),g.translate(Math.round(c*Math.max(0,Math.min(1,(f.x-a.x)/a.width))),Math.round(d*Math.max(0,Math.min(1,(f.y-a.y)/a.height)))),this.model.setGeometry(e[b],g))}}finally{this.model.endUpdate()}};
|
|
Graph.prototype.resizeParentStacks=function(a,b,c,d){if(null!=this.layoutManager&&null!=b&&b.constructor==mxStackLayout&&!b.resizeLast){this.model.beginUpdate();try{for(var e=b.horizontal;null!=a&&null!=b&&b.constructor==mxStackLayout&&b.horizontal==e&&!b.resizeLast;){var f=this.getCellGeometry(a),g=this.view.getState(a);null!=g&&null!=f&&(f=f.clone(),b.horizontal?f.width+=c+Math.min(0,g.width/this.view.scale-f.width):f.height+=d+Math.min(0,g.height/this.view.scale-f.height),this.model.setGeometry(a,
|
|
f));a=this.model.getParent(a);b=this.layoutManager.getLayout(a)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return this.isSwimlane(a)?"0"!=b.container:"1"==b.container};Graph.prototype.isCellConnectable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return null!=b.connectable?"0"!=b.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments)};
|
|
Graph.prototype.selectAll=function(a){a=a||this.getDefaultParent();this.isCellLocked(a)||mxGraph.prototype.selectAll.apply(this,arguments)};Graph.prototype.selectCells=function(a,b,c){c=c||this.getDefaultParent();this.isCellLocked(c)||mxGraph.prototype.selectCells.apply(this,arguments)};Graph.prototype.getSwimlaneAt=function(a,b,c){c=c||this.getDefaultParent();return!this.isCellLocked(c)?mxGraph.prototype.getSwimlaneAt.apply(this,arguments):null};
|
|
Graph.prototype.isCellFoldable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return this.foldingEnabled&&!this.isCellLocked(a)&&(this.isContainer(a)&&"0"!=b.collapsible||!this.isContainer(a)&&"1"==b.collapsible)};Graph.prototype.reset=function(){this.isEditing()&&this.stopEditing(!0);this.escape();this.isSelectionEmpty()||this.clearSelection()};
|
|
Graph.prototype.zoom=function(a,b){a=Math.max(0.01,Math.min(this.view.scale*a,160))/this.view.scale;mxGraph.prototype.zoom.apply(this,arguments)};Graph.prototype.zoomIn=function(){0.15>this.view.scale?this.zoom((this.view.scale+0.01)/this.view.scale):this.zoom(Math.round(20*this.view.scale*this.zoomFactor)/20/this.view.scale)};Graph.prototype.zoomOut=function(){0.15>=this.view.scale?this.zoom((this.view.scale-0.01)/this.view.scale):this.zoom(Math.round(20*this.view.scale*(1/this.zoomFactor))/20/this.view.scale)};
|
|
Graph.prototype.getTooltipForCell=function(a){var b="";if(mxUtils.isNode(a.value)){var c=a.value.getAttribute("tooltip");if(null!=c)null!=c&&this.isReplacePlaceholders(a)&&(c=this.replacePlaceholders(a,c)),b=this.sanitizeHtml(c);else{c=["label","tooltip","placeholders"];a=a.value.attributes;this.isEnabled()&&c.push("link");for(var d=0;d<a.length;d++)0>mxUtils.indexOf(c,a[d].nodeName)&&0<a[d].nodeValue.length&&(b="link"==a[d].nodeName?b+(mxUtils.htmlEntities(this.getLinkUrl(a[d].nodeValue))+"\n"):
|
|
b+(a[d].nodeName+": "+mxUtils.htmlEntities(a[d].nodeValue)+"\n"));0<b.length&&(b=b.substring(0,b.length-1))}}return b};Graph.prototype.stringToBytes=function(a){for(var b=Array(a.length),c=0;c<a.length;c++)b[c]=a.charCodeAt(c);return b};Graph.prototype.bytesToString=function(a){for(var b=Array(a.length),c=0;c<a.length;c++)b[c]=String.fromCharCode(a[c]);return b.join("")};
|
|
Graph.prototype.compress=function(a){if(null==a||0==a.length||"undefined"===typeof pako)return a;a=this.bytesToString(pako.deflateRaw(encodeURIComponent(a)));return window.btoa?btoa(a):Base64.encode(a,!0)};Graph.prototype.decompress=function(a){if(null==a||0==a.length||"undefined"===typeof pako)return a;a=window.atob?atob(a):Base64.decode(a,!0);return this.zapGremlins(decodeURIComponent(this.bytesToString(pako.inflateRaw(a))))};
|
|
Graph.prototype.zapGremlins=function(a){for(var b=[],c=0;c<a.length;c++){var d=a.charCodeAt(c);(32<=d||9==d||10==d||13==d)&&b.push(a.charAt(c))}return b.join("")};HoverIcons=function(a){this.graph=a;this.init()};HoverIcons.prototype.arrowSpacing=6;HoverIcons.prototype.updateDelay=500;HoverIcons.prototype.activationDelay=140;HoverIcons.prototype.currentState=null;HoverIcons.prototype.activeArrow=null;HoverIcons.prototype.inactiveOpacity=15;HoverIcons.prototype.checkCollisions=!0;
|
|
HoverIcons.prototype.triangleUp=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAOCAYAAAAxDQxDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6N0ZBN0E3M0U5NjZGMTFFNTg5NTRDNzQwMTgwNDlEQzQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6N0ZBN0E3M0Y5NjZGMTFFNTg5NTRDNzQwMTgwNDlEQzQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3RkE3QTczQzk2NkYxMUU1ODk1NEM3NDAxODA0OURDNCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3RkE3QTczRDk2NkYxMUU1ODk1NEM3NDAxODA0OURDNCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pj625P8AAACySURBVHjaYmRY956BROABxF+A+AgpmpjIsGQjEO8CYidaWeQHtYQNiDmBeAspljGRYMlqqCUwALPMg1oWhWCxBNmyjVCHUGQRyJKlOCyBATaoQ/zItSgciFcQsATdshBSLYqC+oSZhMTCBnVYFLEWgRQuItESGGCG6o0iZFECBZagW5aAyyKQxBwKLUG2bD4Qp6FblAyVoIYlyGAmzDIWKGMmA+0AyGw2RjIKVbIAQIABAFJRHSSk2rPoAAAAAElFTkSuQmCC":
|
|
IMAGE_PATH+"/triangle-up.png",26,14);
|
|
HoverIcons.prototype.triangleRight=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAaCAYAAACHD21cAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NThDQzc5RTU5NjZGMTFFNTg5NTRDNzQwMTgwNDlEQzQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NThDQzc5RTY5NjZGMTFFNTg5NTRDNzQwMTgwNDlEQzQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo1OENDNzlFMzk2NkYxMUU1ODk1NEM3NDAxODA0OURDNCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo1OENDNzlFNDk2NkYxMUU1ODk1NEM3NDAxODA0OURDNCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PrHdKTUAAADDSURBVHjanNTBCgFRFIfxMeTZyEKkiBSRxbwREZGiNFZKWSnvY6OUUv6n7ilZaL459XVXv6a5c+cWovQeaSZqFoGJwzpVozzQZq4GeSDCv7AYcJ9Cx0vVpdDxWrUpdLxVLQr/4jjDBpYDblDoeKdqFDpOHRP4jSsU2rzVg8KnqqpbDFFdXck7vlRTXciuOjqT72ioo07k5Nju9dSRnFVHB/J3GBqqPf0fx2pDbwBDK3Ln2MdN1CLraSiFNcn6JJ+PAAMAbnMl1tyDPD8AAAAASUVORK5CYII\x3d":IMAGE_PATH+
|
|
"/triangle-right.png",14,26);
|
|
HoverIcons.prototype.triangleDown=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAOCAYAAAAxDQxDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NThDQzc5RTk5NjZGMTFFNTg5NTRDNzQwMTgwNDlEQzQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NThDQzc5RUE5NjZGMTFFNTg5NTRDNzQwMTgwNDlEQzQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo1OENDNzlFNzk2NkYxMUU1ODk1NEM3NDAxODA0OURDNCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo1OENDNzlFODk2NkYxMUU1ODk1NEM3NDAxODA0OURDNCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv9xyy0AAADESURBVHjaYmRY956BHoAJiHOA+D+NcRrIoilAnEVDz6QD8SwWKGc6EP8F4plUtiQRiBfAgg4GZkEl/lLBgr/IlqBbxACViKPQMgxLQIAFi8JlUHoREDOTYUkckhkMuHyEbFkEEP8i0ZJobJbgswgE1gBxKJGW/YI6bCW+fIQPbCLCsl9Qn6whlGEZiLDMH4i/47AklJAlxFoEAjuA2AfNMpglm4gtgogF+5As+wX15SZiNbOQmHxBlrkBMQ/Ul0QDgAADAC8qRII7g4RyAAAAAElFTkSuQmCC":IMAGE_PATH+
|
|
"/triangle-down.png",26,14);
|
|
HoverIcons.prototype.triangleLeft=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAaCAYAAACHD21cAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6N0ZBN0E3M0E5NjZGMTFFNTg5NTRDNzQwMTgwNDlEQzQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6N0ZBN0E3M0I5NjZGMTFFNTg5NTRDNzQwMTgwNDlEQzQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo1OENDNzlFQjk2NkYxMUU1ODk1NEM3NDAxODA0OURDNCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo1OENDNzlFQzk2NkYxMUU1ODk1NEM3NDAxODA0OURDNCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pi1fu2cAAADXSURBVHjalNTRB8JQFMfxVROxPyl6iuipRJFS2kv/TU89lY0piyw9pP6r3iP6He7Ndd3de87haxMfd+1ua0TVOxLOCuVNIdqiHZ1I4AbtUUsC6fIO6jzhwoWB/hOCU5Tpy+PCCTq5kA+OfKgODlGJ2r7/YMMBqkLIhn0uMmEP3VGH+zQQ7KKnBGmY+O6eD77QGH2kkOYhxeZdJTzjYnsfb2jOwbHjt6s6ltJHTmNa+SuFNBe0rMOh9/GM1i7M+QIUKLVxzNy2XB0zyYomTqUr6jnqLfoJMADoxSMHt6pxsAAAAABJRU5ErkJggg\x3d\x3d":IMAGE_PATH+
|
|
"/triangle-left.png",14,26);
|
|
HoverIcons.prototype.roundDrop=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RTgxRjYzRTU1MDRFMTFFNEExQ0VFNDQwNDhGNzg2RDkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RTgxRjYzRTY1MDRFMTFFNEExQ0VFNDQwNDhGNzg2RDkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpFODFGNjNFMzUwNEUxMUU0QTFDRUU0NDA0OEY3ODZEOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpFODFGNjNFNDUwNEUxMUU0QTFDRUU0NDA0OEY3ODZEOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PuJ657wAAAE0SURBVHjaYvz//z8DPQATA50AC4zBuP4DLjXaQOwMxJZArAfE8lDxh0B8CYiPA/FeIL6KTfP/QAFUi7AABSBOAOJoIFbBIq8FxRFAfAeIlwLxAiB+gNdHaMABiIuB2IfIkAE5pB6IjYG4F4gPEBNHIEtaSLAEGfhA9ToQskgB6hNrCuLdGmqGAj6LEsj0CTafJeCySBsa8dQC0VAzMSxyxpG6yAUqUDMxLLKkQT61xGaRHg0s0sNmkTwNLJKne1mHbNFDGpj/EJtFl2hg0SVsFh2ngUXHsVm0F1oKUwvcgZqJYdFVaFFPLbAUuY5CT3Wg+mQLFSzZAjULZ6H6AFqfHKXAkqNQMx4Qqo9AlVYNmT7bAtV7gNga9gDURWfxVOXoEY+3KmeENbdo3ThhHHbtOoAAAwDmEETshQ0fBAAAAABJRU5ErkJggg\x3d\x3d":IMAGE_PATH+
|
|
"/round-drop.png",26,26);
|
|
HoverIcons.prototype.refreshTarget=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDQxNERDRTU1QjY1MTFFNDkzNTRFQTVEMTdGMTdBQjciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDQxNERDRTY1QjY1MTFFNDkzNTRFQTVEMTdGMTdBQjciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0NDE0RENFMzVCNjUxMUU0OTM1NEVBNUQxN0YxN0FCNyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0NDE0RENFNDVCNjUxMUU0OTM1NEVBNUQxN0YxN0FCNyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsvuX50AAANaSURBVHja7FjRZ1tRGD9ZJ1NCyIQSwrivI4Q8hCpjlFDyFEoYfSp9Ko1QWnmo0If+BSXkIfo0QirTMUpeGo2EPfWllFYjZMLKLDJn53d3biU337m5J223bPbxk5t7v+/c3/2+73znO8fDOWezKM/YjMpz68Lj8ejY+QTeCCwLxOS9qPxtyN+6wAeBTwJ31CCO0cJDjXBGBN4LfIepSwykTUT1bgpuib0SONIgo8KRHOtRiCFcvUcgZeGrHPNBxLIyFPyRgTGz0xLbegJCdmzpElue5KlAIMDX19d5uVzm5+fnfDAYmMA17uEZdOx2Yvb/sHlu2S0xwymn5ufneTab5b1ej08S6EAXNrDd2dnhiUTim21MvMtwQ6yiIrWwsMDPzs64rsBmf3/fvM7n89TYlUnEllSkQqEQv7q64g+Vk5MTVXosORErU0Zer5f0FEIlw2N6MxwO82QyaXql2+2SxDqdjopYWUUsqEp45IldqtWq6UWVh/1+P7+8vCTJ4QMUJSRIEXuneoH96w8PDyeWAnhSJfCqwm6NIlaklFdXV0cGhRcQ2mlJQXK5nMq2YPEZbnteU1U2lUqN/D84OGD9fl+5fgnSrFarsUwmw0qlEru4uBjTicViTk3Cr27HSnxR+Doyz0ZE1CAWiUTusbu7y9rttlZv5fP5WDQavYfIMba4uEipfhF8XtqJoZXx/uH+sC/4vPg7OljZZQbsCmLtYzc3N6zRaJhotVrmfx0xDINtbm6athYUeXpHdbBNaqZUKpWxWXV7e2vex+xaWVnhc3NzjrPUXgexyCt0m67LBV7uJMITjqRE4o8tZeg8FPpFitgapYxiOC0poFgsji1jKNo6BZZckrAGUtJsNk1vqAihCBcKhTE7hNWhqw2qFnGy5UFOUYJVIJ1OjzSE+BCEilon0URavRmBqnbbQ00AXbm+vnZc9O1tj72OnQoc2+cwygRkb2+P1et17ZoEm3g87lRmjgWZ00kbXkNuse6/Bu2wlegIxfb2tuvWGroO4bO2c4bbzUh60mxDXm1sbJhhxkQYnhS4h2fUZoRAWnf7lv8N27f8P7Xhnekjgpk+VKGOoQbsiY+hhhtF3YO7twIJ+ULvUGv+GQ2fQEvWxI/THNx5/p/BaspPAQYAqStgiSQwCDoAAAAASUVORK5CYII\x3d":IMAGE_PATH+
|
|
"/refresh.png",38,38);
|
|
HoverIcons.prototype.init=function(){this.arrowUp=this.createArrow(this.triangleUp,mxResources.get("plusTooltip"));this.arrowRight=this.createArrow(this.triangleRight,mxResources.get("plusTooltip"));this.arrowDown=this.createArrow(this.triangleDown,mxResources.get("plusTooltip"));this.arrowLeft=this.createArrow(this.triangleLeft,mxResources.get("plusTooltip"));this.elts=[this.arrowUp,this.arrowRight,this.arrowDown,this.arrowLeft];this.repaintHandler=mxUtils.bind(this,function(){this.repaint()});this.graph.selectionModel.addListener(mxEvent.CHANGE,
|
|
this.repaintHandler);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,
|
|
mxUtils.bind(this,function(){this.mouseDownPoint=null}));mxEvent.addListener(this.graph.container,"mouseleave",mxUtils.bind(this,function(a){null!=a.relatedTarget&&mxEvent.getSource(a)==this.graph.container&&this.setDisplay("none")}));var a=this.graph.click;this.graph.click=mxUtils.bind(this,function(b){a.apply(this.graph,arguments);null!=this.currentState&&(!this.graph.isCellSelected(this.currentState.cell)&&mxEvent.isTouchEvent(b.getEvent())&&!this.graph.model.isVertex(b.getCell()))&&this.reset()});
|
|
var b=!1;this.graph.addMouseListener({mouseDown:mxUtils.bind(this,function(a,d){b=!1;var e=d.getEvent();if(this.isResetEvent(e))this.reset();else if(!this.isActive()){var f=this.getState(d.getState());(null!=f||!mxEvent.isTouchEvent(e))&&this.update(f)}this.setDisplay("none")}),mouseMove:mxUtils.bind(this,function(a,d){var e=d.getEvent();this.isResetEvent(e)?this.reset():!this.graph.isMouseDown&&!mxEvent.isTouchEvent(e)&&this.update(this.getState(d.getState()),d.getGraphX(),d.getGraphY());null!=this.graph.connectionHandler&&
|
|
null!=this.graph.connectionHandler.shape&&(b=!0)}),mouseUp:mxUtils.bind(this,function(a,d){var e=d.getEvent();this.isResetEvent(e)?this.reset():this.isActive()&&null!=this.mouseDownPoint&&Math.abs(d.getGraphX()-this.mouseDownPoint.x)<this.graph.tolerance&&Math.abs(d.getGraphY()-this.mouseDownPoint.y)<this.graph.tolerance?b||this.click(this.currentState,this.getDirection(),d):this.isActive()?1!=this.graph.getSelectionCount()||!this.graph.model.isEdge(this.graph.getSelectionCell())?this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(d.getGraphX(),
|
|
d.getGraphY())))):this.reset():mxEvent.isTouchEvent(e)||null!=this.bbox&&mxUtils.contains(this.bbox,d.getGraphX(),d.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(e)||this.reset();b=!1;this.resetActiveArrow()})})};HoverIcons.prototype.isResetEvent=function(a,b){return mxEvent.isAltDown(a)||null==this.activeArrow&&mxEvent.isShiftDown(a)||mxEvent.isMetaDown(a)||mxEvent.isPopupTrigger(a)&&!mxEvent.isControlDown(a)};
|
|
HoverIcons.prototype.createArrow=function(a,b){var c=null;mxClient.IS_IE&&!mxClient.IS_SVG?(mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?(c=document.createElement(mxClient.VML_PREFIX+":image"),c.setAttribute("src",a.src),c.style.borderStyle="none"):(c=document.createElement("div"),c.style.backgroundImage="url("+a.src+")",c.style.backgroundPosition="center",c.style.backgroundRepeat="no-repeat"),c.style.width=a.width+4+"px",c.style.height=a.height+4+"px",c.style.display=mxClient.IS_QUIRKS?"inline":
|
|
"inline-block"):(c=mxUtils.createImage(a.src),c.style.width=a.width+"px",c.style.height=a.height+"px");null!=b&&c.setAttribute("title",b);c.style.position="absolute";c.style.cursor="crosshair";mxEvent.addGestureListeners(c,mxUtils.bind(this,function(a){null!=this.currentState&&!this.isResetEvent(a)&&(this.mouseDownPoint=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),this.drag(a,this.mouseDownPoint.x,this.mouseDownPoint.y),this.activeArrow=c,this.setDisplay("none"),
|
|
mxEvent.consume(a))}));mxEvent.redirectMouseEvents(c,this.graph,this.currentState);mxEvent.addListener(c,"mouseenter",mxUtils.bind(this,function(a){mxEvent.isMouseEvent(a)&&(null!=this.activeArrow&&this.activeArrow!=c&&mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.graph.connectionHandler.constraintHandler.reset(),mxUtils.setOpacity(c,100),this.activeArrow=c)}));mxEvent.addListener(c,"mouseleave",mxUtils.bind(this,function(a){this.graph.isMouseDown||this.resetActiveArrow()}));return c};
|
|
HoverIcons.prototype.resetActiveArrow=function(){null!=this.activeArrow&&(mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.activeArrow=null)};HoverIcons.prototype.getDirection=function(){var a=mxConstants.DIRECTION_EAST;this.activeArrow==this.arrowUp?a=mxConstants.DIRECTION_NORTH:this.activeArrow==this.arrowDown?a=mxConstants.DIRECTION_SOUTH:this.activeArrow==this.arrowLeft&&(a=mxConstants.DIRECTION_WEST);return a};
|
|
HoverIcons.prototype.visitNodes=function(a){for(var b=0;b<this.elts.length;b++)null!=this.elts[b]&&a(this.elts[b])};HoverIcons.prototype.removeNodes=function(){this.visitNodes(function(a){null!=a.parentNode&&a.parentNode.removeChild(a)})};HoverIcons.prototype.setDisplay=function(a){this.visitNodes(function(b){b.style.display=a})};HoverIcons.prototype.isActive=function(){return null!=this.activeArrow&&null!=this.currentState};
|
|
HoverIcons.prototype.drag=function(a,b,c){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);null!=this.currentState&&(this.graph.connectionHandler.start(this.currentState,b,c),this.graph.isMouseTrigger=mxEvent.isMouseEvent(a),this.graph.isMouseDown=!0,a=this.graph.selectionCellsHandler.getHandler(this.currentState.cell),null!=a&&a.setHandlesVisible(!1))};
|
|
HoverIcons.prototype.click=function(a,b,c){var d=c.getEvent(),e=c.getGraphX(),f=c.getGraphY(),e=this.graph.view.getState(this.graph.getCellAt(e,f));null!=e&&this.graph.model.isEdge(e.cell)&&!mxEvent.isControlDown(d)&&(e.getVisibleTerminalState(!0)==a||e.getVisibleTerminalState(!1)==a)?(this.graph.setSelectionCell(e.cell),this.reset()):null!=a&&(a=this.graph.connectVertex(a.cell,b,this.graph.defaultEdgeLength,d),this.graph.selectCellsForConnectVertex(a,d,this),2==a.length&&this.graph.model.isVertex(a[1])?
|
|
(this.graph.setSelectionCell(a[1]),mxEvent.isTouchEvent(d)?this.update(this.getState(this.graph.view.getState(a[1]))):this.reset(),this.graph.scrollCellToVisible(a[1])):this.graph.setSelectionCells(a));c.consume()};HoverIcons.prototype.reset=function(a){(null==a||a)&&null!=this.updateThread&&window.clearTimeout(this.updateThread);this.activeArrow=this.currentState=this.mouseDownPoint=null;this.removeNodes();this.bbox=null};
|
|
HoverIcons.prototype.repaint=function(){this.bbox=null;if(null!=this.currentState){this.currentState=this.getState(this.currentState);if(null!=this.currentState&&this.graph.model.isVertex(this.currentState.cell)&&this.graph.isCellConnectable(this.currentState.cell)){var a=mxRectangle.fromRectangle(this.currentState);null!=this.currentState.shape&&null!=this.currentState.shape.boundingBox&&(a=mxRectangle.fromRectangle(this.currentState.shape.boundingBox));a.grow(this.graph.tolerance);a.grow(this.arrowSpacing);
|
|
var b=this.graph.selectionCellsHandler.getHandler(this.currentState.cell);null!=b&&(a.x-=b.horizontalOffset/2,a.y-=b.verticalOffset/2,a.width+=b.horizontalOffset,a.height+=b.verticalOffset,null!=b.rotationShape&&(null!=b.rotationShape.node&&"hidden"!=b.rotationShape.node.style.visibility&&"none"!=b.rotationShape.node.style.display&&null!=b.rotationShape.boundingBox)&&a.add(b.rotationShape.boundingBox));this.arrowUp.style.left=Math.round(this.currentState.getCenterX()-this.triangleUp.width/2)+"px";
|
|
this.arrowUp.style.top=Math.round(a.y-this.triangleUp.height)+"px";mxUtils.setOpacity(this.arrowUp,this.inactiveOpacity);this.arrowRight.style.left=Math.round(a.x+a.width)+"px";this.arrowRight.style.top=Math.round(this.currentState.getCenterY()-this.triangleRight.height/2)+"px";mxUtils.setOpacity(this.arrowRight,this.inactiveOpacity);this.arrowDown.style.left=this.arrowUp.style.left;this.arrowDown.style.top=Math.round(a.y+a.height)+"px";mxUtils.setOpacity(this.arrowDown,this.inactiveOpacity);this.arrowLeft.style.left=
|
|
Math.round(a.x-this.triangleLeft.width)+"px";this.arrowLeft.style.top=this.arrowRight.style.top;mxUtils.setOpacity(this.arrowLeft,this.inactiveOpacity);if(this.checkCollisions){var b=this.graph.getCellAt(a.x+a.width+this.triangleRight.width/2,this.currentState.getCenterY()),c=this.graph.getCellAt(a.x-this.triangleLeft.width/2,this.currentState.getCenterY()),d=this.graph.getCellAt(this.currentState.getCenterX(),a.y-this.triangleUp.height/2),a=this.graph.getCellAt(this.currentState.getCenterX(),a.y+
|
|
a.height+this.triangleDown.height/2);null!=b&&(b==c&&c==d&&d==a)&&(a=d=c=b=null);null!=b&&!this.graph.model.isAncestor(b,this.currentState.cell)?this.arrowRight.style.visibility="hidden":this.arrowRight.style.visibility="visible";null!=c&&!this.graph.model.isAncestor(c,this.currentState.cell)?this.arrowLeft.style.visibility="hidden":this.arrowLeft.style.visibility="visible";null!=d&&!this.graph.model.isAncestor(d,this.currentState.cell)?this.arrowUp.style.visibility="hidden":this.arrowUp.style.visibility=
|
|
"visible";null!=a&&!this.graph.model.isAncestor(a,this.currentState.cell)?this.arrowDown.style.visibility="hidden":this.arrowDown.style.visibility="visible"}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible"}else this.reset();null!=this.currentState&&(this.bbox=this.computeBoundingBox(),null!=this.bbox&&this.bbox.grow(10))}};
|
|
HoverIcons.prototype.computeBoundingBox=function(){var a=!this.graph.model.isEdge(this.currentState.cell)?mxRectangle.fromRectangle(this.currentState):null;this.visitNodes(function(b){null!=b.parentNode&&(b=new mxRectangle(b.offsetLeft,b.offsetTop,b.offsetWidth,b.offsetHeight),null==a?a=b:a.add(b))});return a};
|
|
HoverIcons.prototype.getState=function(a){if(null!=a){a=a.cell;if(this.graph.getModel().isVertex(a)&&!this.graph.isCellConnectable(a)){var b=this.graph.getModel().getParent(a);this.graph.getModel().isVertex(b)&&this.graph.isCellConnectable(b)&&(a=b)}if(this.graph.isCellLocked(a)||this.graph.model.isEdge(a))a=null;a=this.graph.view.getState(a)}return a};
|
|
HoverIcons.prototype.update=function(a,b,c){if(this.graph.connectionArrowsEnabled){var d=null;this.prev!=a||this.isActive()?(this.startTime=(new Date).getTime(),this.prev=a,d=0,null!=this.updateThread&&window.clearTimeout(this.updateThread),null!=a&&(this.updateThread=window.setTimeout(mxUtils.bind(this,function(){!this.isActive()&&(!this.graph.isMouseDown&&!this.graph.panningHandler.isActive())&&(this.prev=a,this.update(a,b,c))}),this.updateDelay+10))):null!=this.startTime&&(d=(new Date).getTime()-
|
|
this.startTime);this.setDisplay("");if(null!=this.currentState&&this.currentState!=a&&d<this.activationDelay&&null!=this.bbox&&!mxUtils.contains(this.bbox,b,c))this.reset(!1);else if(null!=this.currentState||d>this.activationDelay)if(this.currentState!=a&&(d>this.updateDelay&&null!=a||null==this.bbox||null==b||null==c||!mxUtils.contains(this.bbox,b,c)))null!=a&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(a),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!=
|
|
a&&this.graph.connectionHandler.constraintHandler.reset()):this.reset()}else this.reset()};HoverIcons.prototype.setCurrentState=function(a){"eastwest"!=a.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=a};
|
|
(function(){var a=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(b,c,f,g){if(null!=c&&null!=b&&("1"==c.style.snapToPoint||"1"==b.style.snapToPoint)){c=this.getTerminalPort(b,c,g);var h=this.getNextPoint(b,f,g),k=this.graph.isOrthogonal(b),m=mxUtils.toRadians(Number(c.style[mxConstants.STYLE_ROTATION]||"0")),l=new mxPoint(c.getCenterX(),c.getCenterY());if(0!=m)var n=Math.cos(-m),p=Math.sin(-m),h=mxUtils.getRotatedPoint(h,n,p,l);n=parseFloat(b.style[mxConstants.STYLE_PERIMETER_SPACING]||
|
|
0);n+=parseFloat(b.style[g?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);h=this.getPerimeterPoint(c,h,0==m&&k,n);0!=m&&(n=Math.cos(m),p=Math.sin(m),h=mxUtils.getRotatedPoint(h,n,p,l));if(null!=c){m=this.graph.getAllConnectionConstraints(c);k=l=null;for(n=0;n<m.length;n++)if(p=this.graph.getConnectionPoint(c,m[n]),null!=p){var r=(p.x-h.x)*(p.x-h.x)+(p.y-h.y)*(p.y-h.y);if(null==k||r<k)l=p,k=r}null!=l&&(h=l)}b.setAbsoluteTerminalPoint(h,g)}else a.apply(this,
|
|
arguments)};var b=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(a,c,f){var g=b.apply(this,arguments);"1"==a.getAttribute("placeholders")&&null!=f.state&&(g=f.state.view.graph.replacePlaceholders(f.state.cell,g));return g};var c=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(a){if(null!=a.style&&"undefined"!==typeof pako){var b=mxUtils.getValue(a.style,mxConstants.STYLE_SHAPE,null);if(null!=b&&"stencil("==b.substring(0,
|
|
8))try{var f=b.substring(8,b.length-1),g=mxUtils.parseXml(a.view.graph.decompress(f));return new mxShape(new mxStencil(g.documentElement))}catch(h){null!=window.console&&console.log("Error in shape: "+h)}}return c.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.packages=[];
|
|
mxStencilRegistry.getStencil=function(a){var b=mxStencilRegistry.stencils[a];if(null==b&&null==mxCellRenderer.prototype.defaultShapes[a]&&mxStencilRegistry.dynamicLoading){var c=mxStencilRegistry.getBasenameForStencil(a);if(null!=c){b=mxStencilRegistry.libraries[c];if(null!=b){if(null==mxStencilRegistry.packages[c]){mxStencilRegistry.packages[c]=1;for(c=0;c<b.length;c++){var d=b[c];if(".xml"==d.toLowerCase().substring(d.length-4,d.length))mxStencilRegistry.loadStencilSet(d,null);else if(".js"==d.toLowerCase().substring(d.length-
|
|
3,d.length))try{var e=mxUtils.load(d);null!=e&&200==e.getStatus()&&eval.call(window,e.getText())}catch(f){null!=window.console&&console.log("error in getStencil:",d,f)}}}}else c=c.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+c+".xml",null);b=mxStencilRegistry.stencils[a]}}return b};mxStencilRegistry.getBasenameForStencil=function(a){var b=null;if(null!=a&&(a=a.split("."),0<a.length&&"mxgraph"==a[0]))for(var b=a[1],c=2;c<a.length-1;c++)b+="/"+a[c];return b};
|
|
mxStencilRegistry.loadStencilSet=function(a,b,c,d){var e=mxStencilRegistry.packages[a];if(null!=c&&c||null==e){var f=!1;if(null==e)try{if(d){var g=mxUtils.get(a,mxUtils.bind(this,function(c){200==c.getStatus()&&(e=c.getXml(),mxStencilRegistry.packages[a]=e,f=!0,null!=e&&null!=e.documentElement&&mxStencilRegistry.parseStencilSet(e.documentElement,b,f))}));return}g=mxUtils.load(a);e=g.getXml();mxStencilRegistry.packages[a]=e;f=!0}catch(h){null!=window.console&&console.log("error in loadStencilSet:",
|
|
a,h)}null!=e&&null!=e.documentElement&&mxStencilRegistry.parseStencilSet(e.documentElement,b,f)}};mxStencilRegistry.parseStencilSets=function(a){for(var b=0;b<a.length;b++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(a[b]).documentElement)};
|
|
mxStencilRegistry.parseStencilSet=function(a,b,c){if("stencils"==a.nodeName)for(var d=a.firstChild;null!=d;)"shapes"==d.nodeName&&mxStencilRegistry.parseStencilSet(d,b,c),d=d.nextSibling;else{c=null!=c?c:!0;var d=a.firstChild,e="";a=a.getAttribute("name");for(null!=a&&(e=a+".");null!=d;){if(d.nodeType==mxConstants.NODETYPE_ELEMENT&&(a=d.getAttribute("name"),null!=a)){var e=e.toLowerCase(),f=a.replace(/ /g,"_");c&&mxStencilRegistry.addStencil(e+f.toLowerCase(),new mxStencil(d));if(null!=b){var g=d.getAttribute("w"),
|
|
h=d.getAttribute("h"),g=null==g?80:parseInt(g,10),h=null==h?80:parseInt(h,10);b(e,f,a,g,h)}}d=d.nextSibling}}};
|
|
"undefined"!=typeof mxVertexHandler&&function(){function a(){var a=document.createElement("div");a.className="geHint";a.style.whiteSpace="nowrap";a.style.position="absolute";return a}mxConstants.HANDLE_FILLCOLOR="#99ccff";mxConstants.HANDLE_STROKECOLOR="#0088cf";mxConstants.VERTEX_SELECTION_COLOR="#00a8ff";mxConstants.OUTLINE_COLOR="#00a8ff";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.EDGE_SELECTION_COLOR=
|
|
"#00a8ff";mxConstants.DEFAULT_VALID_COLOR="#00a8ff";mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff";mxConstants.GUIDE_COLOR="#0088cf";mxConstants.HIGHLIGHT_OPACITY=30;mxConstants.HIGHLIGHT_SIZE=8;mxEdgeHandler.prototype.snapToTerminals=!0;mxGraphHandler.prototype.guidesEnabled=!0;mxGuide.prototype.isEnabledForEvent=function(a){return!mxEvent.isAltDown(a)};var b=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(a){return mxEvent.isControlDown(a)||b.apply(this,
|
|
arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var a=new mxEllipse(null,this.highlightColor,this.highlightColor,0);a.opacity=mxConstants.HIGHLIGHT_OPACITY;return a};mxConnectionHandler.prototype.livePreview=!0;mxConnectionHandler.prototype.cursor="crosshair";mxConnectionHandler.prototype.createEdgeState=function(a){a=this.graph.createCurrentEdgeStyle();a=this.graph.createEdge(null,null,null,null,null,a);a=new mxCellState(this.graph.view,a,this.graph.getCellStyle(a));for(var b in this.graph.currentEdgeStyle)a.style[b]=
|
|
this.graph.currentEdgeStyle[b];return a};var c=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var a=c.apply(this,arguments);a.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return a};mxConnectionHandler.prototype.updatePreview=function(a){};var d=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var a=d.apply(this,arguments),b=a.getCell;a.getCell=mxUtils.bind(this,function(a){var c=
|
|
b.apply(this,arguments);this.error=null;return c});return a};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",html:"1",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.currentEdgeStyle=Graph.prototype.defaultEdgeStyle;Graph.prototype.currentVertexStyle={};Graph.prototype.createCurrentEdgeStyle=function(){var a="edgeStyle\x3d"+(this.currentEdgeStyle.edgeStyle||"none")+";";null!=this.currentEdgeStyle.shape&&(a+="shape\x3d"+this.currentEdgeStyle.shape+";");null!=this.currentEdgeStyle.curved&&
|
|
(a+="curved\x3d"+this.currentEdgeStyle.curved+";");null!=this.currentEdgeStyle.rounded&&(a+="rounded\x3d"+this.currentEdgeStyle.rounded+";");null!=this.currentEdgeStyle.comic&&(a+="comic\x3d"+this.currentEdgeStyle.comic+";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(a+="elbow\x3d"+this.currentEdgeStyle.elbow+";");return a=null!=this.currentEdgeStyle.html?a+("html\x3d"+this.currentEdgeStyle.html+";"):a+"html\x3d1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,
|
|
0)};Graph.prototype.loadStylesheet=function(){var a=null!=this.themes?this.themes[this.defaultThemeName]:!mxStyleRegistry.dynamicLoading?null:mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement();null!=a&&(new mxCodec(a.ownerDocument)).decode(a,this.getStylesheet())};Graph.prototype.getAllConnectionConstraints=function(a,b){if(null!=a){var c=mxUtils.getValue(a.style,"points",null);if(null!=c){var d=[];try{for(var e=JSON.parse(c),c=0;c<e.length;c++){var f=e[c];d.push(new mxConnectionConstraint(new mxPoint(f[0],
|
|
f[1]),2<f.length?"0"!=f[2]:!0))}}catch(g){}return d}if(null!=a.shape)if(null!=a.shape.stencil){if(null!=a.shape.stencil)return a.shape.stencil.constraints}else if(null!=a.shape.constraints)return a.shape.constraints}return null};Graph.prototype.flipEdge=function(a){if(null!=a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);null!=b&&(b=mxUtils.getValue(b,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL,
|
|
this.setCellStyles(mxConstants.STYLE_ELBOW,b,[a]))}};Graph.prototype.isValidRoot=function(a){for(var b=this.model.getChildCount(a),c=0,d=0;d<b;d++){var e=this.model.getChildAt(a,d);this.model.isVertex(e)&&(e=this.getCellGeometry(e),null!=e&&!e.relative&&c++)}return 0<c||this.isContainer(a)};Graph.prototype.isValidDropTarget=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return"1"!=mxUtils.getValue(b,"part","0")&&(this.isContainer(a)||mxGraph.prototype.isValidDropTarget.apply(this,
|
|
arguments)&&"0"!=mxUtils.getValue(b,"dropTarget","1"))};Graph.prototype.createGroupCell=function(){var a=mxGraph.prototype.createGroupCell.apply(this,arguments);a.setStyle("group");return a};Graph.prototype.isExtendParentsOnAdd=function(a){var b=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(b&&null!=a&&null!=this.layoutManager){var c=this.model.getParent(a);null!=c&&(c=this.layoutManager.getLayout(c),null!=c&&c.constructor==mxStackLayout&&(b=!1))}return b};Graph.prototype.getPreferredSizeForCell=
|
|
function(a){var b=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=b&&(b.width+=10,b.height+=4,this.gridEnabled&&(b.width=this.snap(b.width),b.height=this.snap(b.height)));return b};Graph.prototype.turnShapes=function(a){var b=this.getModel(),c=[];b.beginUpdate();try{for(var d=0;d<a.length;d++){var e=a[d];if(b.isEdge(e)){var f=b.getTerminal(e,!0),g=b.getTerminal(e,!1);b.setTerminal(e,g,!0);b.setTerminal(e,f,!1);var h=b.getGeometry(e);if(null!=h){h=h.clone();null!=h.points&&h.points.reverse();
|
|
var k=h.getTerminalPoint(!0),m=h.getTerminalPoint(!1);h.setTerminalPoint(k,!1);h.setTerminalPoint(m,!0);b.setGeometry(e,h);var l=this.view.getState(e),n=this.view.getState(f),p=this.view.getState(g);if(null!=l){var q=null!=n?this.getConnectionConstraint(l,n,!0):null,r=null!=p?this.getConnectionConstraint(l,p,!1):null;this.setConnectionConstraint(e,f,!0,r);this.setConnectionConstraint(e,g,!1,q)}c.push(e)}}else if(b.isVertex(e)&&(h=this.getCellGeometry(e),null!=h)){h=h.clone();h.x+=h.width/2-h.height/
|
|
2;h.y+=h.height/2-h.width/2;var s=h.width;h.width=h.height;h.height=s;b.setGeometry(e,h);var t=this.view.getState(e);if(null!=t){var u=t.style[mxConstants.STYLE_DIRECTION]||"east";"east"==u?u="south":"south"==u?u="west":"west"==u?u="north":"north"==u&&(u="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,u,[e])}c.push(e)}}}finally{b.endUpdate()}return c};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell.value&&
|
|
"object"==typeof a.cell.value){var b=this.model.getDescendants(a.cell);if(0<b.length)for(var c=0;c<b.length;c++)this.isReplacePlaceholders(b[c])&&this.view.invalidate(b[c],!1,!1)}};Graph.prototype.cellLabelChanged=function(a,b,c){b=this.zapGremlins(b);this.model.beginUpdate();try{if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder"))for(var d=a.getAttribute("placeholder"),e=a;null!=e;){if(e==this.model.getRoot()||null!=e.value&&"object"==
|
|
typeof e.value&&e.hasAttribute(d)){this.setAttributeForCell(e,d,b);break}e=this.model.getParent(e)}var f=a.value.cloneNode(!0);f.setAttribute("label",b);b=f}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.removeCellsAfterUngroup=function(a){for(var b=[],c=0;c<a.length;c++)if(this.isCellDeletable(a[c])){var d=this.view.getState(a[c]);if(null!=d){var e=mxUtils.getValue(d.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(d.style,
|
|
mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e==mxConstants.NONE&&d==mxConstants.NONE&&b.push(a[c])}}a=b;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(a,b){this.setAttributeForCell(a,"link",b)};Graph.prototype.setTooltipForCell=function(a,b){this.setAttributeForCell(a,"tooltip",b)};Graph.prototype.setAttributeForCell=function(a,b,c){var d=null;null!=a.value&&"object"==typeof a.value?d=a.value.cloneNode(!0):(d=mxUtils.createXmlDocument().createElement("UserObject"),
|
|
d.setAttribute("label",a.value||""));null!=c&&0<c.length?d.setAttribute(b,c):d.removeAttribute(b);this.model.setValue(a,d)};Graph.prototype.getDropTarget=function(a,b,c,d){this.getModel();if(mxEvent.isAltDown(b))return null;for(var e=0;e<a.length;e++)if(this.model.isEdge(this.model.getParent(a[e])))return null;return mxGraph.prototype.getDropTarget.apply(this,arguments)};Graph.prototype.click=function(a){mxGraph.prototype.click.call(this,a);this.firstClickState=a.getState();this.firstClickSource=
|
|
a.getSource()};Graph.prototype.dblClick=function(a,b){if(this.isEnabled()){var c=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),mxEvent.getClientY(a));if(null!=a&&!this.model.isVertex(b)){var d=this.model.isEdge(b)?this.view.getState(b):null,e=mxEvent.getSource(a);if(this.firstClickState==d&&this.firstClickSource==e&&(null==d||null==d.text||null==d.text.node||!mxUtils.contains(d.text.boundingBox,c.x,c.y)&&!mxUtils.isAncestorNode(d.text.node,mxEvent.getSource(a))))if(null==d&&!this.isCellLocked(this.getDefaultParent())||
|
|
null!=d&&!this.isCellLocked(d.cell))if(null!=d||mxClient.IS_VML&&e==this.view.getCanvas()||mxClient.IS_SVG&&e==this.view.getCanvas().ownerSVGElement)b=this.addText(c.x,c.y,d)}mxGraph.prototype.dblClick.call(this,a,b)}};Graph.prototype.getInsertPoint=function(){var a=this.getGridSize(),b=this.container.scrollLeft/this.view.scale-this.view.translate.x,c=this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible)var d=this.getPageLayout(),e=this.getPageSize(),b=Math.max(b,d.x*
|
|
e.width),c=Math.max(c,d.y*e.height);return new mxPoint(this.snap(b+a),this.snap(c+a))};Graph.prototype.addText=function(a,b,c){var d=new mxCell;d.value="Text";d.style="text;html\x3d1;resizable\x3d0;points\x3d[];";d.geometry=new mxGeometry(0,0,0,0);d.vertex=!0;if(null!=c){d.style+="align\x3dcenter;verticalAlign\x3dmiddle;labelBackgroundColor\x3d#ffffff;";d.geometry.relative=!0;d.connectable=!1;var e=this.view.getRelativePoint(c,a,b);d.geometry.x=Math.round(1E4*e.x)/1E4;d.geometry.y=Math.round(e.y);
|
|
d.geometry.offset=new mxPoint(0,0);var e=this.view.getPoint(c,d.geometry),f=this.view.scale;d.geometry.offset=new mxPoint(Math.round((a-e.x)/f),Math.round((b-e.y)/f))}else d.style+="autosize\x3d1;align\x3dleft;verticalAlign\x3dtop;spacingTop\x3d-4;",e=this.view.translate,d.geometry.width=40,d.geometry.height=20,d.geometry.x=Math.round(a/this.view.scale)-e.x,d.geometry.y=Math.round(b/this.view.scale)-e.y;this.getModel().beginUpdate();try{this.addCells([d],null!=c?c.cell:null),this.fireEvent(new mxEventObject("textInserted",
|
|
"cells",[d])),this.autoSizeCell(d)}finally{this.getModel().endUpdate()}return d};Graph.prototype.getLinkUrl=function(a){return a};Graph.prototype.getAbsoluteUrl=function(a){null!=a&&this.isRelativeUrl(a)&&(a="/"==a.charAt(0)?this.domainUrl+a:this.domainPathUrl+a);return a};Graph.prototype.isBlankLink=function(a){var b=this.domainUrl;return"self"!=urlParams.target&&null!=a&&"#"!=a.charAt(0)&&a.substring(0,b.length)!=b&&!this.isRelativeUrl(a)};Graph.prototype.isRelativeUrl=function(a){return!/^(?:[a-z]+:)?\/\//i.test(a)&&
|
|
"data:image"!=a.substring(0,10)&&"mailto:"!=a.substring(0,7)};Graph.prototype.addClickHandler=function(a,b,c){var d=mxUtils.bind(this,function(){var a=this.container.getElementsByTagName("a");if(null!=a)for(var c=0;c<a.length;c++){var d=a[c].getAttribute("href");null!=d&&!this.isBlankLink(d)&&(window!=window.top?(a[c].setAttribute("target","_top"),d.charAt("#")?a[c].setAttribute("href",this.baseUrl+d):a[c].setAttribute("href",this.getAbsoluteUrl(d))):"_blank"==a[c].getAttribute("target")&&a[c].removeAttribute("target"),
|
|
null!=b&&mxEvent.addListener(a[c],"click",b))}});this.model.addListener(mxEvent.CHANGE,d);d();var e=this.container.style.cursor,f=this.getTolerance(),g=this,h={currentState:null,currentLink:null,highlight:null!=a&&""!=a&&a!=mxConstants.NONE?new mxCellHighlight(g,a,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(a){a=g.view.getState(a.getCell());a!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=a,null!=this.currentState&&this.activate(this.currentState))},
|
|
mouseDown:function(a,b){this.startX=b.getGraphX();this.startY=b.getGraphY();this.scrollLeft=g.container.scrollLeft;this.scrollTop=g.container.scrollTop;null==this.currentLink&&"auto"==g.container.style.overflow&&(g.container.style.cursor="move");this.updateCurrentState(b)},mouseMove:function(a,b){if(g.isMouseDown){if(null!=this.currentLink){var c=Math.abs(this.startX-b.getGraphX()),d=Math.abs(this.startY-b.getGraphY());(c>f||d>f)&&this.clear()}}else"a"==b.getSource().nodeName.toLowerCase()?this.clear():
|
|
null!=this.currentState&&(b.getState()==this.currentState||null==b.getState())&&g.intersects(this.currentState,b.getGraphX(),b.getGraphY())||this.updateCurrentState(b)},mouseUp:function(a,d){var e=d.getSource(),h=this.currentLink;this.clear();if("a"!=e.nodeName.toLowerCase()&&!d.isConsumed()&&(null==d.getState()||!d.isSource(d.getState().control))&&(mxEvent.isLeftMouseButton(d.getEvent())||mxEvent.isTouchEvent(d.getEvent())))null!=h?(g.isBlankLink(h)?window.open(h):(null!=b&&b(d.getEvent()),"#"==
|
|
h.charAt(0)?window!=window.top?window.open(g.baseUrl+h,"_top"):window.location.hash=h:window!=window.top?window.open(g.getAbsoluteUrl(h),"_top"):window.location=h),d.consume()):null!=c&&(!d.isConsumed()&&Math.abs(this.scrollLeft-g.container.scrollLeft)<f&&Math.abs(this.scrollTop-g.container.scrollTop)<f&&Math.abs(this.startX-d.getGraphX())<f&&Math.abs(this.startY-d.getGraphY())<f)&&c(d.getEvent())},activate:function(a){this.currentLink=g.getLinkUrl(g.getLinkForCell(a.cell));null!=this.currentLink&&
|
|
(g.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(a))},clear:function(){null!=g.container&&(g.container.style.cursor=e);this.currentLink=this.currentState=null;null!=this.highlight&&this.highlight.hide()}};g.click=function(a){};g.addMouseListener(h);mxEvent.addListener(document,"mouseleave",function(a){h.clear()})};Graph.prototype.duplicateCells=function(a,b){a=null!=a?a:this.getSelectionCells();b=null!=b?b:!0;a=this.model.getTopmostCells(a);var c=this.getModel(),
|
|
d=this.gridSize,e=[];c.beginUpdate();try{for(var f=this.cloneCells(a,!1),g=0;g<a.length;g++){var h=c.getParent(a[g]),k=this.moveCells([f[g]],d,d,!1,h)[0];e.push(k);if(b)c.add(h,f[g]);else{var m=h.getIndex(a[g]);c.add(h,f[g],m+1)}}}finally{c.endUpdate()}return e};Graph.prototype.insertImage=function(a,b,c){if(null!=a){for(var d=this.cellEditor.textarea.getElementsByTagName("img"),e=[],f=0;f<d.length;f++)e.push(d[f]);document.execCommand("insertimage",!1,a);a=this.cellEditor.textarea.getElementsByTagName("img");
|
|
if(a.length==e.length+1)for(f=a.length-1;0<=f;f--)if(0==f||a[f]!=e[f-1]){a[f].setAttribute("width",b);a[f].setAttribute("height",c);break}}};Graph.prototype.isCellResizable=function(a){var b=mxGraph.prototype.isCellResizable.apply(this,arguments),c=this.view.getState(a),c=null!=c?c.style:this.getCellStyle(a);return b||"0"!=mxUtils.getValue(c,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==c[mxConstants.STYLE_WHITE_SPACE]};Graph.prototype.distributeCells=function(a,b){null==b&&(b=this.getSelectionCells());
|
|
if(null!=b&&1<b.length){for(var c=[],d=null,e=null,f=0;f<b.length;f++)if(this.getModel().isVertex(b[f])){var g=this.view.getState(b[f]);if(null!=g){var h=a?g.getCenterX():g.getCenterY(),d=null!=d?Math.max(d,h):h,e=null!=e?Math.min(e,h):h;c.push(g)}}if(2<c.length){c.sort(function(b,c){return a?b.x-c.x:b.y-c.y});g=this.view.translate;h=this.view.scale;e=e/h-(a?g.x:g.y);d=d/h-(a?g.x:g.y);this.getModel().beginUpdate();try{for(var k=(d-e)/(c.length-1),d=e,f=1;f<c.length-1;f++){var m=this.getCellGeometry(c[f].cell),
|
|
d=d+k;null!=m&&(m=m.clone(),a?m.x=Math.round(d-m.width/2):m.y=Math.round(d-m.height/2),this.getModel().setGeometry(c[f].cell,m))}}finally{this.getModel().endUpdate()}}}return b};Graph.prototype.isCloneEvent=function(a){return mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxEvent.isControlDown(a)};Graph.prototype.encodeCells=function(a){for(var b=this.cloneCells(a),c=0;c<b.length;c++){var d=this.view.getState(a[c]);if(null!=d){var e=this.getCellGeometry(b[c]);null!=e&&e.relative&&(e.relative=!1,e.x=d.x/
|
|
d.view.scale-d.view.translate.x,e.y=d.y/d.view.scale-d.view.translate.y)}}for(var d=new mxCodec,e=new mxGraphModel,f=e.getChildAt(e.getRoot(),0),c=0;c<a.length;c++)e.add(f,b[c]);return d.encode(e)};Graph.prototype.createSvgImageExport=function(){var a=new mxImageExport;a.getLinkForCellState=mxUtils.bind(this,function(a,b){return this.getLinkForCell(a.cell)});return a};Graph.prototype.getSvg=function(a,b,c,d,e,f,g){b=null!=b?b:1;c=null!=c?c:1;e=null!=e?e:!0;f=null!=f?f:!0;g=null!=g?g:!0;d=d?this.view.getBackgroundPageBounds():
|
|
f?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==d)throw Error(mxResources.get("drawingEmpty"));var h=this.createSvgImageExport(),k=h.drawCellState;h.drawCellState=function(a,b){(f||a.view.graph.isCellSelected(a.cell))&&k.apply(this,arguments)};var m=this.view.scale,l=mxUtils.createXmlDocument(),n=null!=l.createElementNS?l.createElementNS(mxConstants.NS_SVG,"svg"):l.createElement("svg");null!=a&&(null!=n.style?n.style.backgroundColor=a:n.setAttribute("style","background-color:"+
|
|
a));null==l.createElementNS?(n.setAttribute("xmlns",mxConstants.NS_SVG),n.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):n.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);a=b/m;n.setAttribute("width",Math.ceil(d.width*a)+2*c+"px");n.setAttribute("height",Math.ceil(d.height*a)+2*c+"px");n.setAttribute("version","1.1");var p=n;e&&(p=null!=l.createElementNS?l.createElementNS(mxConstants.NS_SVG,"g"):l.createElement("g"),p.setAttribute("transform","translate(0.5,0.5)"),
|
|
n.appendChild(p));l.appendChild(n);l=new mxSvgCanvas2D(p);l.foOffset=e?-0.5:0;l.textOffset=e?-0.5:0;l.translate(Math.floor((c/b-d.x)/m),Math.floor((c/b-d.y)/m));var q=l.createAlternateContent;l.createAlternateContent=function(a,b,c,d,e,f,g,h,k,m,l,n,p){var r=this.state;if(null!=this.foAltText&&(0==d||0!=r.fontSize&&f.length<5*d/r.fontSize)){var G=this.createElement("text");G.setAttribute("x",Math.round(d/2));G.setAttribute("y",Math.round((e+r.fontSize)/2));G.setAttribute("fill",r.fontColor||"black");
|
|
G.setAttribute("text-anchor","middle");G.setAttribute("font-size",Math.round(r.fontSize)+"px");G.setAttribute("font-family",r.fontFamily);(r.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&G.setAttribute("font-weight","bold");(r.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&G.setAttribute("font-style","italic");(r.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&G.setAttribute("text-decoration","underline");mxUtils.write(G,f);return G}return q.apply(this,
|
|
arguments)};c=this.backgroundImage;null!=c&&(e=m/b,b=this.view.translate,e=new mxRectangle(b.x*e,b.y*e,c.width*e,c.height*e),mxUtils.intersects(d,e)&&l.image(b.x,b.y,c.width,c.height,c.src,!0));l.scale(a);l.textEnabled=g;h.drawState(this.getView().getState(this.model.root),l);return n};Graph.prototype.getSelectedElement=function(){var a=null;if(window.getSelection){var b=window.getSelection();b.getRangeAt&&b.rangeCount&&(a=b.getRangeAt(0).commonAncestorContainer)}else document.selection&&(a=document.selection.createRange().parentElement());
|
|
return a};Graph.prototype.getParentByName=function(a,b,c){for(;null!=a&&a.nodeName!=b;){if(a==c)return null;a=a.parentNode}return a};Graph.prototype.selectNode=function(a){var b=null;if(window.getSelection){if(b=window.getSelection(),b.getRangeAt&&b.rangeCount){var c=document.createRange();c.selectNode(a);b.removeAllRanges();b.addRange(c)}}else if((b=document.selection)&&"Control"!=b.type)a=b.createRange(),a.collapse(!0),c=b.createRange(),c.setEndPoint("StartToStart",a),c.select()};Graph.prototype.insertRow=
|
|
function(a,b){for(var c=a.tBodies[0],d=0<c.rows.length?c.rows[0].cells.length:1,c=c.insertRow(b),e=0;e<d;e++)mxUtils.br(c.insertCell(-1));return c.cells[0]};Graph.prototype.deleteRow=function(a,b){a.tBodies[0].deleteRow(b)};Graph.prototype.insertColumn=function(a,b){var c=a.tHead;if(null!=c)for(var d=0;d<c.rows.length;d++){var e=document.createElement("th");c.rows[d].appendChild(e);mxUtils.br(e)}c=a.tBodies[0];for(d=0;d<c.rows.length;d++)e=c.rows[d].insertCell(b),mxUtils.br(e);return c.rows[0].cells[0<=
|
|
b?b:c.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(a,b){if(0<=b)for(var c=a.tBodies[0].rows,d=0;d<c.length;d++)c[d].cells.length>b&&c[d].deleteCell(b)};Graph.prototype.pasteHtmlAtCaret=function(a){var b;if(window.getSelection){if(b=window.getSelection(),b.getRangeAt&&b.rangeCount){b=b.getRangeAt(0);b.deleteContents();var c=document.createElement("div");c.innerHTML=a;a=document.createDocumentFragment();for(var d;d=c.firstChild;)lastNode=a.appendChild(d);b.insertNode(a)}}else(b=document.selection)&&
|
|
"Control"!=b.type&&b.createRange().pasteHTML(a)};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(a,b){this.popupMenuHandler.hideMenu()});var a=this.updateMouseEvent;this.updateMouseEvent=function(b){b=a.apply(this,arguments);if(mxEvent.isTouchEvent(b.getEvent())&&null==b.getState()){var c=this.getCellAt(b.graphX,b.graphY);null!=c&&this.isSwimlane(c)&&this.hitsSwimlaneContent(c,
|
|
b.graphX,b.graphY)||(b.state=this.view.getState(c),null!=b.state&&null!=b.state.shape&&(this.container.style.cursor=b.state.shape.node.style.cursor))}null==b.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return b};var b=!1,c=!1,d=!1,e=this.fireMouseEvent;this.fireMouseEvent=function(a,f,g){a==mxEvent.MOUSE_DOWN&&(f=this.updateMouseEvent(f),b=this.isCellSelected(f.getCell()),c=this.isSelectionEmpty(),d=this.popupMenuHandler.isMenuShowing());e.apply(this,arguments)};this.popupMenuHandler.mouseUp=
|
|
mxUtils.bind(this,function(a,e){this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==e.getState()||!e.isSource(e.getState().control))&&(this.popupMenuHandler.popupTrigger||!d&&!mxEvent.isMouseEvent(e.getEvent())&&(c&&null==e.getCell()&&this.isSelectionEmpty()||b&&this.isCellSelected(e.getCell())));mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,arguments)})};mxCellEditor.prototype.isContentEditing=function(){var a=this.graph.view.getState(this.editingCell);
|
|
return null!=a&&1==a.style.html};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){if(sel=window.getSelection(),sel.getRangeAt&&sel.rangeCount){for(var a=[],b=0,c=sel.rangeCount;b<c;++b)a.push(sel.getRangeAt(b));return a}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=function(a){if(a)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var b=0,c=a.length;b<
|
|
c;++b)sel.addRange(a[b])}else document.selection&&a.select&&a.select()};var e=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(a){null!=a.text&&(a.text.replaceLinefeeds="0"!=mxUtils.getValue(a.style,"nl2Br","1"));e.apply(this,arguments)};var f=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(a,b){this.isKeepFocusEvent(a)||!mxEvent.isAltDown(a.getEvent())?f.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=
|
|
function(a){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var g=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(a,b){g.apply(this,arguments);var c=this.graph.view.getState(a);this.textarea.className=null!=c&&1==c.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(a);null==this.textarea&&
|
|
this.init();var c=this.graph.getModel().getParent(a),d=this.graph.getCellGeometry(a);this.graph.getModel().isEdge(c)&&null!=d&&d.relative||this.graph.getModel().isEdge(a)?mxClient.IS_QUIRKS?this.textarea.style.border="gray dotted 1px":this.textarea.style.outline=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_FF&&mxClient.IS_WIN?"gray dotted 1px":"":mxClient.IS_QUIRKS&&(this.textarea.style.outline="none",this.textarea.style.border="")};var h=mxCellEditor.prototype.installListeners;mxCellEditor.prototype.installListeners=
|
|
function(a){function b(a,c){c.originalNode=a;a=a.firstChild;for(var d=c.firstChild;null!=a&&null!=d;)b(a,d),a=a.nextSibling,d=d.nextSibling;return c}function c(a,b){if(b.originalNode!=a)d(a);else{a=a.firstChild;for(b=b.firstChild;null!=a;){var e=a.nextSibling;null==b?d(a):(c(a,b),b=b.nextSibling);a=e}}}function d(a){for(var b=a.firstChild;null!=b;){var c=b.nextSibling;d(b);b=c}(1!=a.nodeType||"BR"!==a.nodeName&&null==a.firstChild)&&(3!=a.nodeType||0==mxUtils.trim(mxUtils.getTextContent(a)).length)?
|
|
a.parentNode.removeChild(a):(3==a.nodeType&&mxUtils.setTextContent(a,mxUtils.getTextContent(a).replace(/\n|\r/g,"")),1==a.nodeType&&(a.removeAttribute("style"),a.removeAttribute("class"),a.removeAttribute("width"),a.removeAttribute("cellpadding"),a.removeAttribute("cellspacing"),a.removeAttribute("border")))}h.apply(this,arguments);!mxClient.IS_QUIRKS&&(7!==document.documentMode&&8!==document.documentMode)&&mxEvent.addListener(this.textarea,"paste",mxUtils.bind(this,function(a){var d=b(this.textarea,
|
|
this.textarea.cloneNode(!0));window.setTimeout(mxUtils.bind(this,function(){c(this.textarea,d)}),0)}))};mxCellEditor.prototype.toggleViewMode=function(){var a=this.graph.view.getState(this.editingCell),b=null!=a&&"0"!=mxUtils.getValue(a.style,"nl2Br","1"),c=this.saveSelection();if(this.codeViewMode){h=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<h.length&&"\n"==h.charAt(h.length-1)&&(h=h.substring(0,h.length-1));h=this.graph.sanitizeHtml(b?h.replace(/\n/g,"\x3cbr/\x3e"):h);this.textarea.className=
|
|
"mxCellEditor geContentEditable";var d=mxUtils.getValue(a.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),b=mxUtils.getValue(a.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),e=mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),f=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,g=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,a=(mxUtils.getValue(a.style,
|
|
mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(d*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(d)+"px";this.textarea.style.textDecoration=a?"underline":"";this.textarea.style.fontWeight=f?"bold":"normal";this.textarea.style.fontStyle=g?"italic":"";this.textarea.style.fontFamily=b;this.textarea.style.textAlign=e;this.textarea.style.padding=
|
|
"0px";this.textarea.innerHTML!=h&&(this.textarea.innerHTML=h,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));this.codeViewMode=!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerHTML="");var h=mxUtils.htmlEntities(this.textarea.innerHTML);!mxClient.IS_QUIRKS&&8!=document.documentMode&&(h=mxUtils.replaceTrailingNewlines(h,"\x3cdiv\x3e\x3cbr\x3e\x3c/div\x3e"));
|
|
h=this.graph.sanitizeHtml(b?h.replace(/\n/g,"").replace(/<br\s*.?>/g,"\x3cbr\x3e"):h);this.textarea.className="mxCellEditor mxPlainTextEditor";var d=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(d*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(d)+"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.padding="2px";this.textarea.innerHTML!=h&&(this.textarea.innerHTML=h);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState);this.switchSelectionState=c;this.resize()};var k=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(a,b){a=this.graph.getView().getState(this.editingCell);if(this.codeViewMode&&null!=a){var c=a.view.scale;
|
|
this.bounds=mxRectangle.fromRectangle(a);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*c;this.bounds.height=60*c;var d=null!=a.text?a.text.margin:null;null==d&&(d=mxUtils.getAlignmentAsPoint(mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));this.bounds.x+=d.x*this.bounds.width;this.bounds.y+=d.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-
|
|
4)/c)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/c)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/c)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*c);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/c)+(this.textarea.offsetWidth-this.textarea.clientWidth)+
|
|
"px",this.bounds.width=parseInt(this.textarea.style.width)*c);this.textarea.style.left=Math.round(this.bounds.x)+"px";this.textarea.style.top=Math.round(this.bounds.y)+"px";mxClient.IS_VML?this.textarea.style.zoom=c:mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+c+","+c+")")}else this.textarea.style.height="",this.textarea.style.overflow="",k.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=function(a,
|
|
b){if("0"==mxUtils.getValue(a.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var c=this.graph.getEditingValue(a.cell,b);"1"==mxUtils.getValue(a.style,"nl2Br","1")&&(c=c.replace(/\n/g,"\x3cbr/\x3e"));return c=this.graph.sanitizeHtml(c)};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=function(a){if("0"==mxUtils.getValue(a.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);var b=this.graph.sanitizeHtml(this.textarea.innerHTML);
|
|
return b="1"==mxUtils.getValue(a.style,"nl2Br","1")?b.replace(/\r\n/g,"\x3cbr/\x3e").replace(/\n/g,"\x3cbr/\x3e"):b.replace(/\r\n/g,"").replace(/\n/g,"")};var m=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(a){this.codeViewMode&&this.toggleViewMode();m.apply(this,arguments);try{this.graph.container.focus()}catch(b){}};var l=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(a,b){this.graph.getModel().beginUpdate();try{if(l.apply(this,arguments),
|
|
this.graph.isCellDeletable(a.cell)){var c=mxUtils.getValue(a.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(a.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);""==mxUtils.trim(b||"")&&(c==mxConstants.NONE&&d==mxConstants.NONE)&&this.graph.removeCells([a.cell],!1)}}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(a){var b=null;if(this.graph.getModel().isEdge(a.cell)||this.graph.getModel().isEdge(this.graph.getModel().getParent(a.cell)))b=
|
|
mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null),b==mxConstants.NONE&&(b=null);return b};mxCellEditor.prototype.getMinimumSize=function(a){var b=this.graph.getView().scale;return new mxRectangle(0,0,null==a.text?30:a.text.size*b+20,30)};mxGraphHandler.prototype.updateHint=function(b){if(null!=this.shape){null==this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var c=this.graph.view.translate,d=this.graph.view.scale;b=this.roundLength((this.bounds.x+this.currentDx)/
|
|
d-c.x);c=this.roundLength((this.bounds.y+this.currentDy)/d-c.y);this.hint.innerHTML=b+", "+c;this.hint.style.left=this.shape.bounds.x+Math.round((this.shape.bounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.shape.bounds.y+this.shape.bounds.height+12+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(this.hint.parentNode.removeChild(this.hint),this.hint=null)};mxVertexHandler.prototype.isRecursiveResize=function(a,b){return!this.graph.isSwimlane(a.cell)&&0<this.graph.model.getChildCount(a.cell)&&
|
|
!mxEvent.isControlDown(b.getEvent())&&!this.graph.isCellCollapsed(a.cell)&&"1"==mxUtils.getValue(a.style,"recursiveResize","1")&&null==mxUtils.getValue(a.style,"childLayout",null)};mxVertexHandler.prototype.isCenteredEvent=function(a,b){return!(!this.graph.isSwimlane(a.cell)&&0<this.graph.model.getChildCount(a.cell)&&!this.graph.isCellCollapsed(a.cell)&&"1"==mxUtils.getValue(a.style,"recursiveResize","1")&&null==mxUtils.getValue(a.style,"childLayout",null))&&mxEvent.isControlDown(b.getEvent())||mxEvent.isMetaDown(b.getEvent())};
|
|
var n=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var a=new mxPoint(0,0),b=this.tolerance;this.graph.cellEditor.getEditingCell()==this.state.cell&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(b/=2,a.x=this.sizers[0].bounds.width+b,a.y=this.sizers[0].bounds.height+b):a=n.apply(this,arguments);return a};mxVertexHandler.prototype.updateHint=function(b){this.index!=mxEvent.LABEL_HANDLE&&(null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint)),
|
|
this.index==mxEvent.ROTATION_HANDLE?this.hint.innerHTML=this.currentAlpha+"\x26deg;":(b=this.state.view.scale,this.hint.innerHTML=this.roundLength(this.bounds.width/b)+" x "+this.roundLength(this.bounds.height/b)),b=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),null==b&&(b=this.bounds),this.hint.style.left=b.x+Math.round((b.width-this.hint.clientWidth)/2)+"px",this.hint.style.top=b.y+b.height+12+"px")};mxVertexHandler.prototype.removeHint=
|
|
mxGraphHandler.prototype.removeHint;mxEdgeHandler.prototype.updateHint=function(b,c){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));var d=this.graph.view.translate,e=this.graph.view.scale,f=this.roundLength(c.x/e-d.x),d=this.roundLength(c.y/e-d.y);this.hint.innerHTML=f+", "+d;this.hint.style.visibility="visible";if(this.isSource||this.isTarget)null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(f=this.constraintHandler.currentConstraint.point,
|
|
this.hint.innerHTML="["+Math.round(100*f.x)+"%, "+Math.round(100*f.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(b.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(b.getGraphY(),c.y)+this.state.view.graph.gridSize+"px";null!=this.hideEdgeHintThread&&window.clearTimeout(this.hideEdgeHintThread);this.hideEdgeHintThread=window.setTimeout(mxUtils.bind(this,function(){null!=this.hint&&(this.hint.style.visibility="hidden")}),
|
|
500)};mxEdgeHandler.prototype.removeHint=mxGraphHandler.prototype.removeHint;var p=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAAACXBIWXMAAAsTAAALEwEAmpwYAAABLUlEQVQ4y61US4rCQBBNeojiRrLSnbMOWWU3V1FPouARcgc9hyLOCSSbYZw5gRCIkM9KbevJaycS4zCOBY+iq6pf1y+xrNtiE6oEY/tVzMUXgSNoCJrUDu3qHpldutwSuIKOoEvt0m7I7DoCvNj2fb8XRdEojuN5lmVraJxhh59xFSLFF9phGL7lef6hRb63R73aHM8aAjv8JHJ47yqLlud5r0VRbHa51sPZQVuT/QU4ww4/4ljaJRubrC5SxouD6TWBQV/sEIkbs0eOIVGssSO1L5D6LQID+BHHZjdMSYpj7KZpun7/uk8CP5rNqTXLJP/OpNyTMWruP9CTP08nCILKdCp7gkCzJ8vPnz2BvW5PKhuLjJBykiQLaWIEjTP3o3Zjn/LtPO0rfvh/cgKu7z6wtPPltQAAAABJRU5ErkJggg\x3d\x3d":
|
|
IMAGE_PATH+"/handle-main.png",17,17),r=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NkE1NkU4Njk2QjI1MTFFNEFDMjFGQTcyODkzNTc3NkYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NkE1NkU4NkE2QjI1MTFFNEFDMjFGQTcyODkzNTc3NkYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo2QTU2RTg2NzZCMjUxMUU0QUMyMUZBNzI4OTM1Nzc2RiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo2QTU2RTg2ODZCMjUxMUU0QUMyMUZBNzI4OTM1Nzc2RiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pmuk6K8AAAGBSURBVHjarFRBSsNQEM3/atNs6qLowixcKELoqjuXoqfQeoF6BMEj9BCC1YIXcCGlV8hGLNZlBKWlCk1JSs13Xvw/nca6UDrwmMzMy8tk/iTCWmwi52Eq53+QeWwg2bXSSNi1WiRibgRWCTahwEQmhJgw1WJGML2BC6wQnEqlsuH7fr3f7zdHo9EdPGLkUdc8mX8TJNYIpUajsR+G4YMie3pNVKebpB6GPOrgab7kr5F24Hne9ng87r6HStUuP5V1Mc2AGHnUwWMdCck6sVut1onjOHtnt4nV7M0fAuI65VEnXk3PTFq5Eyi4rnvUe1PW9fO3QOdUzvkbyqNOvEM2dMEHK2zbLr98zJ5+cJWkAvDGUC8Wi2X28Gww6bnHcTzYWp+JGAHTCQz1KIoGfFckCyZBELR3N4V1vCOyTrhHHnXw9N5kQn8+nWq1Onc6C/cERLMn7cfZniD/257wbjDxEjqiDT0fDof3tLE+PGK9HyXNy7pYyrez9K/43/+TLwEGAMb7AY6w980DAAAAAElFTkSuQmCC":
|
|
IMAGE_PATH+"/handle-fixed.png",17,17),q=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MEMzRUVERTk2NzU1MTFFNTg5NjNEMjREQ0FFNENFQzgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MEMzRUVERUE2NzU1MTFFNTg5NjNEMjREQ0FFNENFQzgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowQzNFRURFNzY3NTUxMUU1ODk2M0QyNERDQUU0Q0VDOCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowQzNFRURFODY3NTUxMUU1ODk2M0QyNERDQUU0Q0VDOCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Poj8AGUAAAF6SURBVHjarFTBSsNAEM2u2jSXeCh6sAcPilB6ys2j6Fdo/YH6CYKf0I8QrBb8AQ9S+gu5iMV6jKC0VCEJTalZ54VNnMR4ULrwmJ2Zt5PZmdkIo3yJgsRSBfmDzPUUku2VRsz2qixIehBYJZiECgsyJ0SEhQ6WBkwO8AArBKvZbG64rtsej8dd3/fvIKHDDr/myeJNYFgj2J1OZz8IggdF6+k1VoNhnEgs2OEHT/Mlv0aSQaPR2A7DcPgeKNW6/FTGxSIDdNjhB49lJCTLxOz1eieWZe2d3cZGd5RvAvQ22eEnXkvXTBqFDlTq9frR6E0Z18+qtO83ZIefeIes6IIXVpimWXv5yB8cnMqcDn+1Wq2xj2eFSfoeRdFkaz0f5OAqzunwz2azCZ8VyZS553n93U1hHO+I0uvADj94em6yQH/ujuM4ue6UzgmI6Zz0H7/nBPbf5oRng4rbyIgm9Hw6nd7TxLqQ0PV82JqXZbGUt7P0V/zv/8mXAAMASSz1f9Cd7ycAAAAASUVORK5CYII\x3d":
|
|
IMAGE_PATH+"/handle-terminal.png",17,17),s=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MEJBMUVERjNEMkZDMTFFM0I0Qzc5RkE1RTc2NjI0OUIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MEJBMUVERjREMkZDMTFFM0I0Qzc5RkE1RTc2NjI0OUIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowQkExRURGMUQyRkMxMUUzQjRDNzlGQTVFNzY2MjQ5QiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowQkExRURGMkQyRkMxMUUzQjRDNzlGQTVFNzY2MjQ5QiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvXDOj4AAAFqSURBVHjarFTNToNAEN5FLeiBmDRe7MGLF4IXbp71KapP4CPoO/QdvKiv4ME0PkAvJI2J0SueIHgAAk3b7XxkwSlgE38mmSwz8+3HsPMtUnSbbKww1VhbYB5XbrBnpX3JnlUXSbURvk1ukvcYyYy8IJ9rsoqw3MAJtsh3Xdc98H3/KgzDuyRJHrEiRh51jTOaX4LEDrk9Go1O0zR9UWTL9E0to+dyhSGPOnAab/DPKDtwHOcoy7LXz1SpxeRSzW9F7YiRRx041pGsSMC6Ty1f442LycUawRfRsOyIcDfA632ST6A3GAzOVfYu1PS+c+5q+iBQJ9wZO3TJD1aaptkX+YfYaFS3LKvPXl4fTDn3oigiYR1uJqF6nucR14rBglkQBGO5dyzkybBbxpRHHTitm5rox9PxPK81nZZOAKx1Eo5rnSD/nU54NzhxGx1hjHEcP5FifayItT5sjVvTyJ/vzr/f4l//T1YCDAC4VAdLL1OIRAAAAABJRU5ErkJggg\x3d\x3d":
|
|
IMAGE_PATH+"/handle-secondary.png",17,17),u=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAVCAYAAACkCdXRAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAA6ZJREFUeNqM001IY1cUB/D/fYmm2sbR2lC1zYlgoRG6MpEyBlpxM9iFIGKFIm3s0lCKjOByhCLZCFqLBF1YFVJdSRbdFHRhBbULtRuFVBTzYRpJgo2mY5OX5N9Fo2TG+eiFA/dd3vvd8+65ByTxshARTdf1JySp6/oTEdFe9T5eg5lIcnBwkCSZyWS+exX40oyur68/KxaLf5Okw+H4X+A9JBaLfUySZ2dnnJqaosPhIAACeC34DJRKpb7IZrMcHx+nwWCgUopGo/EOKwf9fn/1CzERUevr6+9ls1mOjIwQAH0+H4PBIKPR6D2ofAQCgToRUeVYJUkuLy8TANfW1kiS8/PzCy84Mw4MDBAAZ2dnmc/nub+/X0MSEBF1cHDwMJVKsaGhgV6vl+l0mqOjo1+KyKfl1dze3l4NBoM/PZ+diFSLiIKIGBOJxA9bW1sEwNXVVSaTyQMRaRaRxrOzs+9J8ujoaE5EPhQRq67rcZ/PRwD0+/3Udf03EdEgIqZisZibnJykwWDg4eEhd3Z2xkXELCJvPpdBrYjUiEhL+Xo4HH4sIhUaAKNSqiIcDsNkMqG+vh6RSOQQQM7tdhsAQCkFAHC73UUATxcWFqypVApmsxnDw8OwWq2TADQNgAYAFosF+XweyWQSdru9BUBxcXFRB/4rEgDcPouIIx6P4+bmBi0tLSCpAzBqAIqnp6c/dnZ2IpfLYXNzE62traMADACKNputpr+/v8lms9UAKAAwiMjXe3t7KBQKqKurQy6Xi6K0i2l6evpROp1mbW0t29vbGY/Hb8/IVIqq2zlJXl1dsaOjg2azmefn5wwEAl+JSBVExCgi75PkzMwMlVJsbGxkIpFgPp8PX15ePopEIs3JZPITXdf/iEajbGpqolKKExMT1HWdHo/nIxGpgIgoEXnQ3d39kCTHxsYIgC6Xi3NzcwyHw8xkMozFYlxaWmJbWxuVUuzt7WUul6PX6/1cRN4WEe2uA0SkaWVl5XGpRVhdXU0A1DSNlZWVdz3qdDrZ09PDWCzG4+Pjn0XEWvp9KJKw2WwKwBsA3gHQHAqFfr24uMDGxgZ2d3cRiUQAAHa7HU6nE319fTg5Ofmlq6vrGwB/AngaCoWK6rbsNptNA1AJoA7Aux6Pp3NoaMhjsVg+QNmIRqO/u1yubwFEASRKUAEA7rASqABUAKgC8KAUb5XWCOAfAFcA/gJwDSB7C93DylCtdM8qABhLc5TumV6KQigUeubjfwcAHkQJ94ndWeYAAAAASUVORK5CYII\x3d":
|
|
IMAGE_PATH+"/handle-rotate.png",19,21);mxVertexHandler.prototype.handleImage=p;mxVertexHandler.prototype.secondaryHandleImage=s;mxEdgeHandler.prototype.handleImage=p;mxEdgeHandler.prototype.terminalHandleImage=q;mxEdgeHandler.prototype.fixedHandleImage=r;mxEdgeHandler.prototype.labelHandleImage=s;mxOutline.prototype.sizerImage=p;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);mxClient.IS_SVG||((new Image).src=p.src,(new Image).src=r.src,(new Image).src=q.src,(new Image).src=s.src,(new Image).src=u.src,(new Image).src=HoverIcons.prototype.triangleUp.src,(new Image).src=HoverIcons.prototype.triangleRight.src,(new Image).src=HoverIcons.prototype.triangleDown.src,
|
|
(new Image).src=HoverIcons.prototype.triangleLeft.src,(new Image).src=HoverIcons.prototype.refreshTarget.src,(new Image).src=HoverIcons.prototype.roundDrop.src);mxVertexHandler.prototype.rotationEnabled=!0;mxVertexHandler.prototype.manageSizers=!0;mxVertexHandler.prototype.livePreview=!0;mxRubberband.prototype.defaultOpacity=30;mxConnectionHandler.prototype.outlineConnect=!0;mxCellHighlight.prototype.keepOnTop=!0;mxVertexHandler.prototype.parentHighlightEnabled=!0;mxVertexHandler.prototype.rotationHandleVSpacing=
|
|
-20;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(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.isCustomHandleEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};
|
|
if(Graph.touchStyle){if(mxClient.IS_TOUCH||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)mxShape.prototype.svgStrokeTolerance=18,mxVertexHandler.prototype.tolerance=12,mxEdgeHandler.prototype.tolerance=12,Graph.prototype.tolerance=12,mxVertexHandler.prototype.rotationHandleVSpacing=-24,mxConstraintHandler.prototype.getTolerance=function(a){return mxEvent.isMouseEvent(a.getEvent())?4:this.graph.getTolerance()};mxPanningHandler.prototype.isPanningTrigger=function(a){var b=a.getEvent();return null==
|
|
a.getState()&&!mxEvent.isMouseEvent(b)||mxEvent.isPopupTrigger(b)&&(null==a.getState()||mxEvent.isControlDown(b)||mxEvent.isShiftDown(b))};var t=mxGraphHandler.prototype.mouseDown;mxGraphHandler.prototype.mouseDown=function(a,b){t.apply(this,arguments);mxEvent.isTouchEvent(b.getEvent())&&(this.graph.isCellSelected(b.getCell())&&1<this.graph.getSelectionCount())&&(this.delayedSelection=!1)}}else mxPanningHandler.prototype.isPanningTrigger=function(a){var b=a.getEvent();return mxEvent.isLeftMouseButton(b)&&
|
|
(this.useLeftButtonForPanning&&null==a.getState()||mxEvent.isControlDown(b)&&!mxEvent.isShiftDown(b))||this.usePopupTrigger&&mxEvent.isPopupTrigger(b)};mxRubberband.prototype.isSpaceEvent=function(a){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&mxEvent.isControlDown(a.getEvent())&&mxEvent.isShiftDown(a.getEvent())};mxRubberband.prototype.mouseUp=function(a,b){var c=null!=this.div&&"none"!=this.div.style.display,d=null,e=null,f=null,g=null;null!=this.first&&
|
|
(null!=this.currentX&&null!=this.currentY)&&(d=this.first.x,e=this.first.y,f=(this.currentX-d)/this.graph.view.scale,g=(this.currentY-e)/this.graph.view.scale,mxEvent.isAltDown(b.getEvent())||(f=this.graph.snap(f),g=this.graph.snap(g)));this.reset();if(c){if(this.isSpaceEvent(b)){this.graph.model.beginUpdate();try{for(var h=this.graph.getCellsBeyond(d,e,this.graph.getDefaultParent(),!0,!1),k=this.graph.getCellsBeyond(d,e,this.graph.getDefaultParent(),!1,!0),c=0;c<h.length;c++)if(this.graph.isCellMovable(h[c])){var m=
|
|
this.graph.view.getState(h[c]),l=this.graph.getCellGeometry(h[c]);null!=m&&null!=l&&(l=l.clone(),l.translate(f,0),this.graph.model.setGeometry(h[c],l))}for(c=0;c<k.length;c++)this.graph.isCellMovable(k[c])&&(m=this.graph.view.getState(k[c]),l=this.graph.getCellGeometry(k[c]),null!=m&&null!=l&&(l=l.clone(),l.translate(0,g),this.graph.model.setGeometry(k[c],l)))}catch(n){null!=window.console&&console.log("Error in rubberband: "+n)}finally{this.graph.model.endUpdate()}}else f=new mxRectangle(this.x,
|
|
this.y,this.width,this.height),this.graph.selectRegion(f,b.getEvent());b.consume()}};mxRubberband.prototype.mouseMove=function(a,b){if(!b.isConsumed()&&null!=this.first){var c=mxUtils.getScrollOrigin(this.graph.container),d=mxUtils.getOffset(this.graph.container);c.x-=d.x;c.y-=d.y;var e=b.getX()+c.x,f=b.getY()+c.y,g=this.first.x-e,h=this.first.y-f,k=this.graph.tolerance;if(null!=this.div||Math.abs(g)>k||Math.abs(h)>k)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(e,
|
|
f),this.isSpaceEvent(b)?(e=this.x+this.width,f=this.y+this.height,g=this.graph.view.scale,mxEvent.isAltDown(b.getEvent())||(this.width=this.graph.snap(this.width/g)*g,this.height=this.graph.snap(this.height/g)*g,this.x<this.first.x&&(this.x=e-this.width),this.y<this.first.y&&(this.y=f-this.height)),this.div.style.left=this.x+"px",this.div.style.top=c.y+d.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=Math.max(0,this.graph.container.clientHeight)+"px",this.div.style.backgroundColor=
|
|
"white",this.div.style.borderWidth="0px 1px 0px 1px",this.div.style.borderStyle="dashed",null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=c.x+d.x+"px",this.secondDiv.style.top=this.y+"px",this.secondDiv.style.width=Math.max(0,this.graph.container.clientWidth)+"px",this.secondDiv.style.height=Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth="1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth=
|
|
"",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null)),b.consume()}};var z=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);z.apply(this,arguments)};var y=(new Date).getTime(),v=0,K=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,b,c,d){K.apply(this,arguments);
|
|
c!=this.currentTerminalState?(y=(new Date).getTime(),v=0):v=(new Date).getTime()-y;this.currentTerminalState=c};var F=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&&2E3<v||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&F.apply(this,arguments)};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};
|
|
mxEdgeHandler.prototype.createHandleShape=function(a,b){var c=null!=a&&0==a,d=this.state.getVisibleTerminalState(c),e=null!=a&&(0==a||a>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state,d,c):null,c=null!=(null!=e?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(c),e):null)?this.fixedHandleImage:null!=e&&null!=d?this.terminalHandleImage:this.handleImage;if(null!=c)return c=new mxImageShape(new mxRectangle(0,
|
|
0,c.width,c.height),c.src),c.preserveImageAspect=!1,c;c=mxConstants.HANDLE_SIZE;this.preferHtml&&(c-=1);return new mxRectangleShape(new mxRectangle(0,0,c,c),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var H=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(a,b,c){this.handleImage=b==mxEvent.ROTATION_HANDLE?u:b==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;return H.apply(this,arguments)};var B=mxGraphHandler.prototype.getBoundingBox;
|
|
mxGraphHandler.prototype.getBoundingBox=function(a){if(null!=a&&1==a.length){var b=this.graph.getModel(),c=b.getParent(a[0]),d=this.graph.getCellGeometry(a[0]);if(b.isEdge(c)&&(null!=d&&d.relative)&&(b=this.graph.view.getState(a[0]),null!=b&&2>b.width&&2>b.height&&null!=b.text&&null!=b.text.boundingBox))return mxRectangle.fromRectangle(b.text.boundingBox)}return B.apply(this,arguments)};var A=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var b=
|
|
this.graph.getModel(),c=b.getParent(a.cell),d=this.graph.getCellGeometry(a.cell);return b.isEdge(c)&&null!=d&&d.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(b=a.text.unrotatedBoundingBox||a.text.boundingBox,new mxRectangle(Math.round(b.x),Math.round(b.y),Math.round(b.width),Math.round(b.height))):A.apply(this,arguments)};var D=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(a,b){var c=this.graph.getModel(),d=c.getParent(this.state.cell),
|
|
e=this.graph.getCellGeometry(this.state.cell);(this.getHandleForEvent(b)==mxEvent.ROTATION_HANDLE||!c.isEdge(d)||null==e||!e.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&D.apply(this,arguments)};mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)};mxVertexHandler.prototype.rotateClick=
|
|
function(){this.state.view.graph.turnShapes([this.state.cell])};var J=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(a,b){J.apply(this,arguments);null!=this.graph.graphHandler.first&&(null!=this.rotationShape&&null!=this.rotationShape.node)&&(this.rotationShape.node.style.display="none")};var P=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(a,b){P.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=
|
|
1==this.graph.getSelectionCount()?"":"none")};var O=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){O.apply(this,arguments);var a=!1;null!=this.rotationShape&&this.rotationShape.node.setAttribute("title",mxResources.get("rotateTooltip"));var b=mxUtils.bind(this,function(){null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.specialHandle&&(this.specialHandle.node.style.display=
|
|
this.graph.isEnabled()&&this.graph.getSelectionCount()<this.graph.graphHandler.maxCells?"":"none");this.redrawHandles()});this.selectionHandler=mxUtils.bind(this,function(a,c){b()});this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionHandler);this.changeHandler=mxUtils.bind(this,function(a,c){this.updateLinkHint(this.graph.getLinkForCell(this.state.cell));b()});this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler);this.editingHandler=mxUtils.bind(this,function(a,
|
|
b){this.redrawHandles()});this.graph.addListener(mxEvent.EDITING_STOPPED,this.editingHandler);var c=this.graph.getLinkForCell(this.state.cell);this.updateLinkHint(c);null!=c&&(a=!0);a&&this.redrawHandles()};mxVertexHandler.prototype.updateLinkHint=function(b){if(null==b||1<this.graph.getSelectionCount())null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=b){null==this.linkHint&&(this.linkHint=a(),this.linkHint.style.padding="4px 10px 6px 10px",
|
|
this.linkHint.style.fontSize="90%",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.updateLinkHint(b),this.graph.container.appendChild(this.linkHint));var c=b;60<c.length&&(c=c.substring(0,36)+"..."+c.substring(c.length-20));var d=document.createElement("a");d.setAttribute("href",this.graph.getLinkUrl(b));d.setAttribute("title",b);null!=this.graph.linkTarget&&d.setAttribute("target",this.graph.linkTarget);mxUtils.write(d,c);this.linkHint.innerHTML="";this.linkHint.appendChild(d);
|
|
this.graph.isEnabled()&&"function"===typeof this.graph.editLink&&(b=document.createElement("img"),b.setAttribute("src",IMAGE_PATH+"/edit.gif"),b.setAttribute("title",mxResources.get("editLink")),b.setAttribute("width","11"),b.setAttribute("height","11"),b.style.marginLeft="10px",b.style.marginBottom="-1px",b.style.cursor="pointer",this.linkHint.appendChild(b),mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();mxEvent.consume(a)})))}};
|
|
mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var T=mxEdgeHandler.prototype.init;mxEdgeHandler.prototype.init=function(){T.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});var a=mxUtils.bind(this,function(){null!=this.linkHint&&(this.linkHint.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.labelShape&&(this.labelShape.node.style.display=this.graph.isEnabled()&&
|
|
this.graph.getSelectionCount()<this.graph.graphHandler.maxCells?"":"none")});this.selectionHandler=mxUtils.bind(this,function(b,c){a()});this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionHandler);this.changeHandler=mxUtils.bind(this,function(b,c){this.updateLinkHint(this.graph.getLinkForCell(this.state.cell));a();this.redrawHandles()});this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler);var b=this.graph.getLinkForCell(this.state.cell);null!=b&&(this.updateLinkHint(b),
|
|
this.redrawHandles())};var V=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){V.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var aa=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){aa.apply(this);if(null!=this.state&&null!=this.linkHint){var a=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),b=new mxRectangle(this.state.x,this.state.y-
|
|
22,this.state.width+24,this.state.height+22),a=mxUtils.getBoundingBox(b,this.state.style[mxConstants.STYLE_ROTATION]||"0",a),b=null!=a?mxUtils.getBoundingBox(this.state,this.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state;null==a&&(a=this.state);this.linkHint.style.left=Math.round(b.x+(b.width-this.linkHint.clientWidth)/2)+"px";this.linkHint.style.top=Math.round(a.y+a.height+this.verticalOffset/2+6+this.state.view.graph.tolerance)+"px"}};var w=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=
|
|
function(){w.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none")};var x=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){x.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.selectionHandler&&(this.graph.getSelectionModel().removeListener(this.selectionHandler),this.selectionHandler=
|
|
null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var ba=mxEdgeHandler.prototype.redrawHandles;mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(ba.apply(this),null!=this.state&&null!=this.linkHint)){var a=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(a=new mxRectangle(a.x,a.y,a.width,a.height),
|
|
a.add(this.state.text.bounds));this.linkHint.style.left=Math.round(a.x+(a.width-this.linkHint.clientWidth)/2)+"px";this.linkHint.style.top=Math.round(a.y+a.height+6+this.state.view.graph.tolerance)+"px"}};var N=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=function(){N.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var I=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){I.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),
|
|
this.linkHint=null);null!=this.selectionHandler&&(this.graph.getSelectionModel().removeListener(this.selectionHandler),this.selectionHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function a(){mxCylinder.call(this)}function b(){mxActor.call(this)}function c(){mxCylinder.call(this)}function d(){mxCylinder.call(this)}function e(){mxCylinder.call(this)}function f(){mxActor.call(this)}function g(){mxCylinder.call(this)}function h(){mxActor.call(this)}function k(){mxActor.call(this)}function m(){mxActor.call(this)}function l(){mxActor.call(this)}function n(){mxActor.call(this)}function p(){mxActor.call(this)}function r(){mxActor.call(this)}function q(a,b){this.canvas=
|
|
a;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=b;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,q.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,q.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,q.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,q.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;
|
|
this.canvas.curveTo=mxUtils.bind(this,q.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,q.prototype.arcTo)}function s(){mxRectangleShape.call(this)}function u(){mxActor.call(this)}function t(){mxActor.call(this)}function z(){mxRectangleShape.call(this)}function y(){mxRectangleShape.call(this)}function v(){mxCylinder.call(this)}function K(){mxShape.call(this)}function F(){mxShape.call(this)}function H(){mxEllipse.call(this)}function B(){mxShape.call(this)}
|
|
function A(){mxShape.call(this)}function D(){mxRectangleShape.call(this)}function J(){mxShape.call(this)}function P(){mxShape.call(this)}function O(){mxShape.call(this)}function T(){mxCylinder.call(this)}function V(){mxDoubleEllipse.call(this)}function aa(){mxDoubleEllipse.call(this)}function w(){mxArrowConnector.call(this);this.spacing=0}function x(){mxArrowConnector.call(this);this.spacing=0}function ba(){mxActor.call(this)}function N(){mxRectangleShape.call(this)}function I(){mxActor.call(this)}
|
|
function G(){mxActor.call(this)}function C(){mxActor.call(this)}function E(){mxActor.call(this)}function M(){mxActor.call(this)}function R(){mxActor.call(this)}function $(){mxActor.call(this)}function Y(){mxActor.call(this)}function Q(){mxActor.call(this)}function W(){mxEllipse.call(this)}function X(){mxEllipse.call(this)}function S(){mxEllipse.call(this)}function L(){mxRhombus.call(this)}function fa(){mxEllipse.call(this)}function ca(){mxEllipse.call(this)}function U(){mxEllipse.call(this)}function ea(){mxEllipse.call(this)}
|
|
function ia(){mxActor.call(this)}function Z(){mxActor.call(this)}function la(){mxActor.call(this)}function ta(a,b,c,d,e,f,g,h,k,m){g+=k;var l=d.clone();d.x-=e*(2*g+k);d.y-=f*(2*g+k);e*=g+k;f*=g+k;return function(){a.ellipse(l.x-e-g,l.y-f-g,2*g,2*g);m?a.fillAndStroke():a.stroke()}}mxUtils.extend(a,mxCylinder);a.prototype.size=20;a.prototype.redrawPath=function(a,b,c,d,e,f){b=Math.max(0,Math.min(d,Math.min(e,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));f?(a.moveTo(b,e),a.lineTo(b,b),
|
|
a.lineTo(0,0),a.moveTo(b,b),a.lineTo(d,b)):(a.moveTo(0,0),a.lineTo(d-b,0),a.lineTo(d,b),a.lineTo(d,e),a.lineTo(b,e),a.lineTo(0,e-b),a.lineTo(0,0),a.close());a.end()};mxCellRenderer.prototype.defaultShapes.cube=a;var qa=Math.tan(mxUtils.toRadians(30)),ka=(0.5-qa)/2;mxUtils.extend(b,mxActor);b.prototype.size=20;b.prototype.redrawPath=function(a,b,c,d,e){b=Math.min(d,e/qa);a.translate((d-b)/2,(e-b)/2+b/4);a.moveTo(0,0.25*b);a.lineTo(0.5*b,b*ka);a.lineTo(b,0.25*b);a.lineTo(0.5*b,(0.5-ka)*b);a.lineTo(0,
|
|
0.25*b);a.close();a.end()};mxCellRenderer.prototype.defaultShapes.isoRectangle=b;mxUtils.extend(c,mxCylinder);c.prototype.size=20;c.prototype.redrawPath=function(a,b,c,d,e,f){b=Math.min(d,e/(0.5+qa));f?(a.moveTo(0,0.25*b),a.lineTo(0.5*b,(0.5-ka)*b),a.lineTo(b,0.25*b),a.moveTo(0.5*b,(0.5-ka)*b),a.lineTo(0.5*b,(1-ka)*b)):(a.translate((d-b)/2,(e-b)/2),a.moveTo(0,0.25*b),a.lineTo(0.5*b,b*ka),a.lineTo(b,0.25*b),a.lineTo(b,0.75*b),a.lineTo(0.5*b,(1-ka)*b),a.lineTo(0,0.75*b),a.close());a.end()};mxCellRenderer.prototype.defaultShapes.isoCube=
|
|
c;mxUtils.extend(d,mxCylinder);d.prototype.redrawPath=function(a,b,c,d,e,f){b=Math.min(e/2,Math.round(e/8)+this.strokewidth-1);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()),a.translate(0,b/2),a.moveTo(0,b),a.curveTo(0,2*b,d,2*b,d,b),f||(a.stroke(),a.begin()),a.translate(0,b/2),a.moveTo(0,b),a.curveTo(0,2*b,d,2*b,d,b),f||(a.stroke(),a.begin()),a.translate(0,-b);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())};d.prototype.getLabelBounds=function(a){var b=2.5*Math.min(a.height/2,Math.round(a.height/8)+this.strokewidth-1);if(!this.flipV&&(null==this.direction||this.direction==mxConstants.DIRECTION_EAST)||this.flipV&&this.direction==mxConstants.DIRECTION_WEST)a.y+=b,a.height-=b;else if(!this.flipV&&this.direction==mxConstants.DIRECTION_SOUTH||this.flipV&&this.direction==mxConstants.DIRECTION_NORTH)a.width-=b;else if(!this.flipV&&this.direction==mxConstants.DIRECTION_WEST||
|
|
this.flipV&&(null==this.direction||this.direction==mxConstants.DIRECTION_EAST))a.height-=b;else if(!this.flipV&&this.direction==mxConstants.DIRECTION_NORTH||this.flipV&&this.direction==mxConstants.DIRECTION_SOUTH)a.x+=b,a.width-=b;return a};mxCellRenderer.prototype.defaultShapes.datastore=d;mxUtils.extend(e,mxCylinder);e.prototype.size=30;e.prototype.redrawPath=function(a,b,c,d,e,f){b=Math.max(0,Math.min(d,Math.min(e,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));f?(a.moveTo(d-b,0),
|
|
a.lineTo(d-b,b),a.lineTo(d,b)):(a.moveTo(0,0),a.lineTo(d-b,0),a.lineTo(d,b),a.lineTo(d,e),a.lineTo(0,e),a.lineTo(0,0),a.close());a.end()};mxCellRenderer.prototype.defaultShapes.note=e;mxUtils.extend(f,mxActor);f.prototype.redrawPath=function(a,b,c,d,e){a.moveTo(0,0);a.quadTo(d/2,0.5*e,d,0);a.quadTo(0.5*d,e/2,d,e);a.quadTo(d/2,0.5*e,0,e);a.quadTo(0.5*d,e/2,0,0);a.end()};mxCellRenderer.prototype.defaultShapes["switch"]=f;mxUtils.extend(g,mxCylinder);g.prototype.tabWidth=60;g.prototype.tabHeight=20;
|
|
g.prototype.tabPosition="right";g.prototype.redrawPath=function(a,b,c,d,e,f){b=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));c=Math.max(0,Math.min(e,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var g=mxUtils.getValue(this.style,"tabPosition",this.tabPosition);f?"left"==g?(a.moveTo(0,c),a.lineTo(b,c)):(a.moveTo(d-b,c),a.lineTo(d,c)):("left"==g?(a.moveTo(0,0),a.lineTo(b,0),a.lineTo(b,c),a.lineTo(d,c)):(a.moveTo(0,c),a.lineTo(d-b,c),
|
|
a.lineTo(d-b,0),a.lineTo(d,0)),a.lineTo(d,e),a.lineTo(0,e),a.lineTo(0,c),a.close());a.end()};mxCellRenderer.prototype.defaultShapes.folder=g;mxUtils.extend(h,mxActor);h.prototype.size=30;h.prototype.redrawPath=function(a,b,c,d,e){b=Math.max(0,Math.min(d,Math.min(e,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(b,0),new mxPoint(d,0),new mxPoint(d,e),new mxPoint(0,e),new mxPoint(0,
|
|
b)],this.isRounded,c,!0);a.end()};mxCellRenderer.prototype.defaultShapes.card=h;mxUtils.extend(k,mxActor);k.prototype.size=0.4;k.prototype.redrawPath=function(a,b,c,d,e){b=e*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,b/2);a.quadTo(d/4,1.4*b,d/2,b/2);a.quadTo(3*d/4,b*(1-1.4),d,b/2);a.lineTo(d,e-b/2);a.quadTo(3*d/4,e-1.4*b,d/2,e-b/2);a.quadTo(d/4,e-b*(1-1.4),0,e-b/2);a.lineTo(0,b/2);a.close();a.end()};mxCellRenderer.prototype.defaultShapes.tape=k;mxUtils.extend(m,
|
|
mxActor);m.prototype.size=0.3;m.prototype.redrawPath=function(a,b,c,d,e){b=e*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,0);a.lineTo(d,0);a.lineTo(d,e-b/2);a.quadTo(3*d/4,e-1.4*b,d/2,e-b/2);a.quadTo(d/4,e-b*(1-1.4),0,e-b/2);a.lineTo(0,b/2);a.close();a.end()};mxCellRenderer.prototype.defaultShapes.document=m;mxUtils.extend(l,mxActor);l.prototype.size=0.2;l.prototype.redrawPath=function(a,b,c,d,e){b=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,
|
|
"size",this.size))));c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,e),new mxPoint(b,0),new mxPoint(d,0),new mxPoint(d-b,e)],this.isRounded,c,!0);a.end()};mxCellRenderer.prototype.defaultShapes.parallelogram=l;mxUtils.extend(n,mxActor);n.prototype.size=0.2;n.prototype.redrawPath=function(a,b,c,d,e){b=d*Math.max(0,Math.min(0.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,
|
|
mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,e),new mxPoint(b,0),new mxPoint(d-b,0),new mxPoint(d,e)],this.isRounded,c,!0)};mxCellRenderer.prototype.defaultShapes.trapezoid=n;mxUtils.extend(p,mxActor);p.prototype.size=0.5;p.prototype.redrawPath=function(a,b,c,d,e){a.setFillColor(null);b=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(d,
|
|
0),new mxPoint(b,0),new mxPoint(b,e/2),new mxPoint(0,e/2),new mxPoint(b,e/2),new mxPoint(b,e),new mxPoint(d,e)],this.isRounded,c,!1);a.end()};mxCellRenderer.prototype.defaultShapes.curlyBracket=p;mxUtils.extend(r,mxActor);r.prototype.redrawPath=function(a,b,c,d,e){a.setStrokeWidth(1);a.setFillColor(this.stroke);b=d/5;a.rect(0,0,b,e);a.fillAndStroke();a.rect(2*b,0,b,e);a.fillAndStroke();a.rect(4*b,0,b,e);a.fillAndStroke()};mxCellRenderer.prototype.defaultShapes.parallelMarker=r;q.prototype.moveTo=
|
|
function(a,b){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=b;this.firstX=a;this.firstY=b};q.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)};q.prototype.quadTo=function(a,b,c,d){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=c;this.lastY=d};q.prototype.curveTo=function(a,b,c,d,e,f){this.originalCurveTo.apply(this.canvas,
|
|
arguments);this.lastX=e;this.lastY=f};q.prototype.arcTo=function(a,b,c,d,e,f,g){this.originalArcTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=g};q.prototype.lineTo=function(a,b){if(null!=this.lastX&&null!=this.lastY){var c=Math.abs(a-this.lastX),d=Math.abs(b-this.lastY),e=Math.sqrt(c*c+d*d);if(2>e)this.originalLineTo.apply(this.canvas,arguments);else{var f=Math.round(e/10),g=this.defaultVariation;5>f&&(f=5,g/=3);for(var h=function(a){return"number"===typeof a?a?0>a?-1:1:a===a?0:NaN:NaN},
|
|
k=h(a-this.lastX)*c/f,h=h(b-this.lastY)*d/f,c=c/e,d=d/e,e=0;e<f;e++){var l=k*e+this.lastX,m=h*e+this.lastY,n=(Math.random()-0.5)*g;this.originalLineTo.call(this.canvas,l-n*d,m-n*c)}this.originalLineTo.call(this.canvas,a,b)}}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=b};q.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=
|
|
this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};var xa=mxShape.prototype.paint;mxShape.prototype.defaultJiggle=1.5;mxShape.prototype.paint=function(a){null!=this.style&&("0"!=mxUtils.getValue(this.style,"comic","0")&&null==a.handHiggle)&&(a.handJiggle=new q(a,mxUtils.getValue(this.style,"jiggle",this.defaultJiggle)));xa.apply(this,arguments);null!=a.handJiggle&&(a.handJiggle.destroy(),delete a.handJiggle)};mxRhombus.prototype.defaultJiggle=2;var ya=mxRectangleShape.prototype.isHtmlAllowed;
|
|
mxRectangleShape.prototype.isHtmlAllowed=function(){return(null==this.style||"0"==mxUtils.getValue(this.style,"comic","0"))&&ya.apply(this,arguments)};var za=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(a,b,c,d,e){if(null==a.handJiggle)za.apply(this,arguments);else{var f=!0;null!=this.style&&(f="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(f||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=
|
|
mxConstants.NONE){if(!f&&(null==this.fill||this.fill==mxConstants.NONE))a.pointerEvents=!1;a.begin();this.isRounded?(f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,f=Math.min(d*f,e*f),a.moveTo(b+f,c),a.lineTo(b+d-f,c),a.quadTo(b+d,c,b+d,c+f),a.lineTo(b+d,c+e-f),a.quadTo(b+d,c+e,b+d-f,c+e),a.lineTo(b+f,c+e),a.quadTo(b,c+e,b,c+e-f),a.lineTo(b,c+f),a.quadTo(b,c,b+f,c)):(a.moveTo(b,c),a.lineTo(b+d,c),a.lineTo(b+d,c+e),a.lineTo(b,c+e),a.lineTo(b,
|
|
c));a.close();a.end();a.fillAndStroke()}}};var Aa=mxRectangleShape.prototype.paintForeground;mxRectangleShape.prototype.paintForeground=function(a,b,c,d,e){null==a.handJiggle&&Aa.apply(this,arguments)};mxUtils.extend(s,mxRectangleShape);s.prototype.size=0.1;s.prototype.isHtmlAllowed=function(){return!1};s.prototype.getLabelBounds=function(a){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var b=
|
|
a.width,c=a.height;a=new mxRectangle(a.x,a.y,b,c);var d=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var e=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,d=Math.max(d,Math.min(b*e,c*e));a.x+=d;a.width-=2*d}return a};s.prototype.paintForeground=function(a,b,c,d,e){var f=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var g=mxUtils.getValue(this.style,
|
|
mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,f=Math.max(f,Math.min(d*g,e*g));a.begin();a.moveTo(b+f,c);a.lineTo(b+f,c+e);a.moveTo(b+d-f,c);a.lineTo(b+d-f,c+e);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.prototype.defaultShapes.process=s;mxUtils.extend(u,mxActor);u.prototype.size=0.2;u.prototype.redrawPath=function(a,b,c,d,e){b=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));c=mxUtils.getValue(this.style,
|
|
mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d-b,0),new mxPoint(d,e/2),new mxPoint(d-b,e),new mxPoint(0,e),new mxPoint(b,e/2)],this.isRounded,c,!0);a.end()};mxCellRenderer.prototype.defaultShapes.step=u;mxUtils.extend(t,mxHexagon);t.prototype.size=0.25;t.prototype.redrawPath=function(a,b,c,d,e){b=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/
|
|
2;this.addPoints(a,[new mxPoint(b,0),new mxPoint(d-b,0),new mxPoint(d,0.5*e),new mxPoint(d-b,e),new mxPoint(b,e),new mxPoint(0,0.5*e)],this.isRounded,c,!0)};mxCellRenderer.prototype.defaultShapes.hexagon=t;mxUtils.extend(z,mxRectangleShape);z.prototype.isHtmlAllowed=function(){return!1};z.prototype.paintForeground=function(a,b,c,d,e){var f=Math.min(d/5,e/5)+1;a.begin();a.moveTo(b+d/2,c+f);a.lineTo(b+d/2,c+e-f);a.moveTo(b+f,c+e/2);a.lineTo(b+d-f,c+e/2);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,
|
|
arguments)};mxCellRenderer.prototype.defaultShapes.plus=z;var ua=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var b=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+b,a.y+b,a.width-2*b,a.height-2*b)}return a};mxRhombus.prototype.paintVertexShape=function(a,b,c,d,e){ua.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var f=2*Math.max(2,this.strokewidth+
|
|
1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);b+=f;c+=f;d-=2*f;e-=2*f;0<d&&0<e&&(a.setShadow(!1),ua.apply(this,[a,b,c,d,e]))}};mxUtils.extend(y,mxRectangleShape);y.prototype.isHtmlAllowed=function(){return!1};y.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var b=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+b,a.y+b,a.width-2*b,a.height-2*b)}return a};y.prototype.paintForeground=function(a,b,c,
|
|
d,e){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var f=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);b+=f;c+=f;d-=2*f;e-=2*f;0<d&&0<e&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}a.setDashed(!1);var f=0,g=null;do{g=mxCellRenderer.prototype.defaultShapes[this.style["symbol"+f]];if(null!=g){var h=this.style["symbol"+f+"Align"],k=this.style["symbol"+f+"VerticalAlign"],l=this.style["symbol"+f+"Width"],m=this.style["symbol"+
|
|
f+"Height"],n=this.style["symbol"+f+"Spacing"]||0,p=this.style["symbol"+f+"ArcSpacing"];null!=p&&(n+=this.getArcSize(d+this.strokewidth,e+this.strokewidth)*p);var p=b,q=c,p=h==mxConstants.ALIGN_CENTER?p+(d-l)/2:h==mxConstants.ALIGN_RIGHT?p+(d-l-n):p+n,q=k==mxConstants.ALIGN_MIDDLE?q+(e-m)/2:k==mxConstants.ALIGN_BOTTOM?q+(e-m-n):q+n;a.save();h=new g;h.style=this.style;g.prototype.paintVertexShape.call(h,a,p,q,l,m);a.restore()}f++}while(null!=g)}mxRectangleShape.prototype.paintForeground.apply(this,
|
|
arguments)};mxCellRenderer.prototype.defaultShapes.ext=y;mxUtils.extend(v,mxCylinder);v.prototype.redrawPath=function(a,b,c,d,e,f){f?(a.moveTo(0,0),a.lineTo(d/2,e/2),a.lineTo(d,0),a.end()):(a.moveTo(0,0),a.lineTo(d,0),a.lineTo(d,e),a.lineTo(0,e),a.close())};mxCellRenderer.prototype.defaultShapes.message=v;mxUtils.extend(K,mxShape);K.prototype.paintBackground=function(a,b,c,d,e){a.translate(b,c);a.ellipse(d/4,0,d/2,e/4);a.fillAndStroke();a.begin();a.moveTo(d/2,e/4);a.lineTo(d/2,2*e/3);a.moveTo(d/2,
|
|
e/3);a.lineTo(0,e/3);a.moveTo(d/2,e/3);a.lineTo(d,e/3);a.moveTo(d/2,2*e/3);a.lineTo(0,e);a.moveTo(d/2,2*e/3);a.lineTo(d,e);a.end();a.stroke()};mxCellRenderer.prototype.defaultShapes.umlActor=K;mxUtils.extend(F,mxShape);F.prototype.getLabelBounds=function(a){return new mxRectangle(a.x+a.width/6,a.y,5*a.width/6,a.height)};F.prototype.paintBackground=function(a,b,c,d,e){a.translate(b,c);a.begin();a.moveTo(0,e/4);a.lineTo(0,3*e/4);a.end();a.stroke();a.begin();a.moveTo(0,e/2);a.lineTo(d/6,e/2);a.end();
|
|
a.stroke();a.ellipse(d/6,0,5*d/6,e);a.fillAndStroke()};mxCellRenderer.prototype.defaultShapes.umlBoundary=F;mxUtils.extend(H,mxEllipse);H.prototype.paintVertexShape=function(a,b,c,d,e){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(b+d/8,c+e);a.lineTo(b+7*d/8,c+e);a.end();a.stroke()};mxCellRenderer.prototype.defaultShapes.umlEntity=H;mxUtils.extend(B,mxShape);B.prototype.paintVertexShape=function(a,b,c,d,e){a.translate(b,c);a.begin();a.moveTo(d,0);a.lineTo(0,e);a.moveTo(0,
|
|
0);a.lineTo(d,e);a.end();a.stroke()};mxCellRenderer.prototype.defaultShapes.umlDestroy=B;mxUtils.extend(A,mxShape);A.prototype.getLabelBounds=function(a){return new mxRectangle(a.x,a.y+a.height/8,a.width,7*a.height/8)};A.prototype.paintBackground=function(a,b,c,d,e){a.translate(b,c);a.begin();a.moveTo(3*d/8,1.1*(e/8));a.lineTo(5*d/8,0);a.end();a.stroke();a.ellipse(0,e/8,d,7*e/8);a.fillAndStroke()};A.prototype.paintForeground=function(a,b,c,d,e){a.begin();a.moveTo(3*d/8,1.1*(e/8));a.lineTo(5*d/8,e/
|
|
4);a.end();a.stroke()};mxCellRenderer.prototype.defaultShapes.umlControl=A;mxUtils.extend(D,mxRectangleShape);D.prototype.size=40;D.prototype.isHtmlAllowed=function(){return!1};D.prototype.getLabelBounds=function(a){var b=Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(a.x,a.y,a.width,b)};D.prototype.paintBackground=function(a,b,c,d,e){var f=Math.max(0,Math.min(e,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),
|
|
g=mxUtils.getValue(this.style,"participant");null==g||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,a,b,c,d,f):(g=this.state.view.graph.cellRenderer.getShape(g),null!=g&&g!=D&&(g=new g,g.apply(this.state),a.save(),g.paintVertexShape(a,b,c,d,f),a.restore()));f<e&&(a.setDashed(!0),a.begin(),a.moveTo(b+d/2,c+f),a.lineTo(b+d/2,c+e),a.end(),a.stroke())};D.prototype.paintForeground=function(a,b,c,d,e){var f=Math.max(0,Math.min(e,parseFloat(mxUtils.getValue(this.style,"size",this.size))));
|
|
mxRectangleShape.prototype.paintForeground.call(this,a,b,c,d,Math.min(e,f))};mxCellRenderer.prototype.defaultShapes.umlLifeline=D;mxUtils.extend(J,mxShape);J.prototype.width=60;J.prototype.height=30;J.prototype.corner=10;J.prototype.getLabelBounds=function(a){var b=Math.max(0,Math.min(a.width,parseFloat(mxUtils.getValue(this.style,"width",this.width))*this.scale)),c=Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(this.style,"height",this.height))*this.scale));return new mxRectangle(a.x,a.y,
|
|
b,c)};J.prototype.paintBackground=function(a,b,c,d,e){var f=this.corner,g=Math.min(d,Math.max(f,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),h=Math.min(e,Math.max(1.5*f,parseFloat(mxUtils.getValue(this.style,"height",this.height))));a.begin();a.moveTo(b,c);a.lineTo(b+g,c);a.lineTo(b+g,c+Math.max(0,h-1.5*f));a.lineTo(b+Math.max(0,g-f),c+h);a.lineTo(b,c+h);a.close();a.fillAndStroke();a.begin();a.moveTo(b+g,c);a.lineTo(b+d,c);a.lineTo(b+d,c+e);a.lineTo(b,c+e);a.lineTo(b,c+h);a.stroke()};
|
|
mxCellRenderer.prototype.defaultShapes.umlFrame=J;mxPerimeter.LifelinePerimeter=function(a,b,c,d){d=D.prototype.size;null!=b&&(d=mxUtils.getValue(b.style,"size",d)*b.view.scale);b=parseFloat(b.style[mxConstants.STYLE_STROKEWIDTH]||1)*b.view.scale/2-1;c.x<a.getCenterX()&&(b=-1*(b+1));return new mxPoint(a.getCenterX()+b,Math.min(a.y+a.height,Math.max(a.y+d,c.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(a,b,c,d){d=!0;return mxPerimeter.RectanglePerimeter.apply(this,
|
|
arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);mxPerimeter.BackbonePerimeter=function(a,b,c,d){d=parseFloat(b.style[mxConstants.STYLE_STROKEWIDTH]||1)*b.view.scale/2-1;null!=b.style.backboneSize&&(d+=parseFloat(b.style.backboneSize)*b.view.scale/2-1);if("south"==b.style[mxConstants.STYLE_DIRECTION]||"north"==b.style[mxConstants.STYLE_DIRECTION])return c.x<a.getCenterX()&&(d=-1*(d+1)),new mxPoint(a.getCenterX()+d,Math.min(a.y+a.height,Math.max(a.y,c.y)));
|
|
c.y<a.getCenterY()&&(d+=1,d*=-1);return new mxPoint(Math.min(a.x+a.width,Math.max(a.x,c.x)),a.getCenterY()+d)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxUtils.extend(P,mxShape);P.prototype.size=10;P.prototype.paintBackground=function(a,b,c,d,e){var f=parseFloat(mxUtils.getValue(this.style,"size",this.size));a.translate(b,c);a.ellipse((d-f)/2,0,f,f);a.fillAndStroke();a.begin();a.moveTo(d/2,f);a.lineTo(d/2,e);a.end();a.stroke()};mxCellRenderer.prototype.defaultShapes.lollipop=
|
|
P;mxUtils.extend(O,mxShape);O.prototype.size=10;O.prototype.inset=2;O.prototype.paintBackground=function(a,b,c,d,e){var f=parseFloat(mxUtils.getValue(this.style,"size",this.size)),g=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;a.translate(b,c);a.begin();a.moveTo(d/2,f+g);a.lineTo(d/2,e);a.end();a.stroke();a.begin();a.moveTo((d-f)/2-g,f/2);a.quadTo((d-f)/2-g,f+g,d/2,f+g);a.quadTo((d+f)/2+g,f+g,(d+f)/2+g,f/2);a.end();a.stroke()};mxCellRenderer.prototype.defaultShapes.requires=
|
|
O;mxUtils.extend(T,mxCylinder);T.prototype.jettyWidth=32;T.prototype.jettyHeight=12;T.prototype.redrawPath=function(a,b,c,d,e,f){var g=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));b=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));c=g/2;var g=c+g/2,h=0.3*e-b/2,k=0.7*e-b/2;f?(a.moveTo(c,h),a.lineTo(g,h),a.lineTo(g,h+b),a.lineTo(c,h+b),a.moveTo(c,k),a.lineTo(g,k),a.lineTo(g,k+b),a.lineTo(c,k+b)):(a.moveTo(c,0),a.lineTo(d,0),a.lineTo(d,e),a.lineTo(c,e),
|
|
a.lineTo(c,k+b),a.lineTo(0,k+b),a.lineTo(0,k),a.lineTo(c,k),a.lineTo(c,h+b),a.lineTo(0,h+b),a.lineTo(0,h),a.lineTo(c,h),a.close());a.end()};mxCellRenderer.prototype.defaultShapes.component=T;mxUtils.extend(V,mxDoubleEllipse);V.prototype.outerStroke=!0;V.prototype.paintVertexShape=function(a,b,c,d,e){var f=Math.min(4,Math.min(d/5,e/5));0<d&&0<e&&(a.ellipse(b+f,c+f,d-2*f,e-2*f),a.fillAndStroke());a.setShadow(!1);this.outerStroke&&(a.ellipse(b,c,d,e),a.stroke())};mxCellRenderer.prototype.defaultShapes.endState=
|
|
V;mxUtils.extend(aa,V);aa.prototype.outerStroke=!1;mxCellRenderer.prototype.defaultShapes.startState=aa;mxUtils.extend(w,mxArrowConnector);w.prototype.defaultWidth=4;w.prototype.isOpenEnded=function(){return!0};w.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};w.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.prototype.defaultShapes.link=w;mxUtils.extend(x,mxArrowConnector);x.prototype.defaultWidth=
|
|
10;x.prototype.defaultArrowWidth=20;x.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};x.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};x.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.prototype.defaultShapes.flexArrow=x;mxUtils.extend(ba,
|
|
mxActor);ba.prototype.size=30;ba.prototype.redrawPath=function(a,b,c,d,e){b=Math.min(e,parseFloat(mxUtils.getValue(this.style,"size",this.size)));c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,e),new mxPoint(0,b),new mxPoint(d,0),new mxPoint(d,e)],this.isRounded,c,!0);a.end()};mxCellRenderer.prototype.defaultShapes.manualInput=ba;mxUtils.extend(N,mxRectangleShape);N.prototype.dx=20;N.prototype.dy=20;N.prototype.isHtmlAllowed=function(){return!1};
|
|
N.prototype.paintForeground=function(a,b,c,d,e){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var f=0;if(this.isRounded)var g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,f=Math.max(f,Math.min(d*g,e*g));g=Math.max(f,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));f=Math.max(f,Math.min(e,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));a.begin();a.moveTo(b,c+f);a.lineTo(b+d,c+f);a.end();a.stroke();
|
|
a.begin();a.moveTo(b+g,c);a.lineTo(b+g,c+e);a.end();a.stroke()};mxCellRenderer.prototype.defaultShapes.internalStorage=N;mxUtils.extend(I,mxActor);I.prototype.dx=20;I.prototype.dy=20;I.prototype.redrawPath=function(a,b,c,d,e){b=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));c=Math.max(0,Math.min(e,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));Math.min(d/2,Math.min(e,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var f=mxUtils.getValue(this.style,
|
|
mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d,0),new mxPoint(d,c),new mxPoint(b,c),new mxPoint(b,e),new mxPoint(0,e)],this.isRounded,f,!0);a.end()};mxCellRenderer.prototype.defaultShapes.corner=I;mxUtils.extend(G,mxActor);G.prototype.dx=20;G.prototype.dy=20;G.prototype.redrawPath=function(a,b,c,d,e){b=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));c=Math.max(0,Math.min(e,parseFloat(mxUtils.getValue(this.style,
|
|
"dy",this.dy))));Math.abs(d-b);Math.min(d/2,Math.min(e,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d,0),new mxPoint(d,c),new mxPoint((d+b)/2,c),new mxPoint((d+b)/2,e),new mxPoint((d-b)/2,e),new mxPoint((d-b)/2,c),new mxPoint(0,c)],this.isRounded,f,!0);a.end()};mxCellRenderer.prototype.defaultShapes.tee=G;mxUtils.extend(C,mxActor);C.prototype.arrowWidth=
|
|
0.3;C.prototype.arrowSize=0.2;C.prototype.redrawPath=function(a,b,c,d,e){var f=e*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));b=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));c=(e-f)/2;var f=c+f,g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,c),new mxPoint(d-b,c),new mxPoint(d-b,0),new mxPoint(d,e/2),new mxPoint(d-b,e),new mxPoint(d-b,
|
|
f),new mxPoint(0,f)],this.isRounded,g,!0);a.end()};mxCellRenderer.prototype.defaultShapes.singleArrow=C;mxUtils.extend(E,mxActor);E.prototype.redrawPath=function(a,b,c,d,e){var f=e*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",C.prototype.arrowWidth))));b=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",C.prototype.arrowSize))));c=(e-f)/2;var f=c+f,g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,
|
|
[new mxPoint(0,e/2),new mxPoint(b,0),new mxPoint(b,c),new mxPoint(d-b,c),new mxPoint(d-b,0),new mxPoint(d,e/2),new mxPoint(d-b,e),new mxPoint(d-b,f),new mxPoint(b,f),new mxPoint(b,e)],this.isRounded,g,!0);a.end()};mxCellRenderer.prototype.defaultShapes.doubleArrow=E;mxUtils.extend(M,mxActor);M.prototype.size=0.1;M.prototype.redrawPath=function(a,b,c,d,e){b=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(b,0);a.lineTo(d,0);a.quadTo(d-2*b,e/2,d,e);a.lineTo(b,
|
|
e);a.quadTo(b-2*b,e/2,b,0);a.close();a.end()};mxCellRenderer.prototype.defaultShapes.dataStorage=M;mxUtils.extend(R,mxActor);R.prototype.redrawPath=function(a,b,c,d,e){a.moveTo(0,0);a.quadTo(d,0,d,e/2);a.quadTo(d,e,0,e);a.close();a.end()};mxCellRenderer.prototype.defaultShapes.or=R;mxUtils.extend($,mxActor);$.prototype.redrawPath=function(a,b,c,d,e){a.moveTo(0,0);a.quadTo(d,0,d,e/2);a.quadTo(d,e,0,e);a.quadTo(d/2,e/2,0,0);a.close();a.end()};mxCellRenderer.prototype.defaultShapes.xor=$;mxUtils.extend(Y,
|
|
mxActor);Y.prototype.size=20;Y.prototype.redrawPath=function(a,b,c,d,e){b=Math.min(d/2,Math.min(e,parseFloat(mxUtils.getValue(this.style,"size",this.size))));c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(b,0),new mxPoint(d-b,0),new mxPoint(d,0.8*b),new mxPoint(d,e),new mxPoint(0,e),new mxPoint(0,0.8*b)],this.isRounded,c,!0);a.end()};mxCellRenderer.prototype.defaultShapes.loopLimit=Y;mxUtils.extend(Q,mxActor);Q.prototype.size=0.375;
|
|
Q.prototype.redrawPath=function(a,b,c,d,e){b=e*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(d,0),new mxPoint(d,e-b),new mxPoint(d/2,e),new mxPoint(0,e-b)],this.isRounded,c,!0);a.end()};mxCellRenderer.prototype.defaultShapes.offPageConnector=Q;mxUtils.extend(W,mxEllipse);W.prototype.paintVertexShape=function(a,b,c,d,e){mxEllipse.prototype.paintVertexShape.apply(this,
|
|
arguments);a.begin();a.moveTo(b+d/2,c+e);a.lineTo(b+d,c+e);a.end();a.stroke()};mxCellRenderer.prototype.defaultShapes.tapeData=W;mxUtils.extend(X,mxEllipse);X.prototype.paintVertexShape=function(a,b,c,d,e){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);a.begin();a.moveTo(b,c+e/2);a.lineTo(b+d,c+e/2);a.end();a.stroke();a.begin();a.moveTo(b+d/2,c);a.lineTo(b+d/2,c+e);a.end();a.stroke()};mxCellRenderer.prototype.defaultShapes.orEllipse=X;mxUtils.extend(S,mxEllipse);S.prototype.paintVertexShape=
|
|
function(a,b,c,d,e){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);a.begin();a.moveTo(b+0.145*d,c+0.145*e);a.lineTo(b+0.855*d,c+0.855*e);a.end();a.stroke();a.begin();a.moveTo(b+0.855*d,c+0.145*e);a.lineTo(b+0.145*d,c+0.855*e);a.end();a.stroke()};mxCellRenderer.prototype.defaultShapes.sumEllipse=S;mxUtils.extend(L,mxRhombus);L.prototype.paintVertexShape=function(a,b,c,d,e){mxRhombus.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);a.begin();a.moveTo(b,c+
|
|
e/2);a.lineTo(b+d,c+e/2);a.end();a.stroke()};mxCellRenderer.prototype.defaultShapes.sortShape=L;mxUtils.extend(fa,mxEllipse);fa.prototype.paintVertexShape=function(a,b,c,d,e){a.begin();a.moveTo(b,c);a.lineTo(b+d,c);a.lineTo(b+d/2,c+e/2);a.close();a.fillAndStroke();a.begin();a.moveTo(b,c+e);a.lineTo(b+d,c+e);a.lineTo(b+d/2,c+e/2);a.close();a.fillAndStroke()};mxCellRenderer.prototype.defaultShapes.collate=fa;mxUtils.extend(ca,mxEllipse);ca.prototype.paintVertexShape=function(a,b,c,d,e){var f=c+e-5;
|
|
a.begin();a.moveTo(b,c);a.lineTo(b,c+e);a.moveTo(b,f);a.lineTo(b+10,f-5);a.moveTo(b,f);a.lineTo(b+10,f+5);a.moveTo(b,f);a.lineTo(b+d,f);a.moveTo(b+d,c);a.lineTo(b+d,c+e);a.moveTo(b+d,f);a.lineTo(b+d-10,f-5);a.moveTo(b+d,f);a.lineTo(b+d-10,f+5);a.end();a.stroke()};mxCellRenderer.prototype.defaultShapes.dimension=ca;mxUtils.extend(U,mxEllipse);U.prototype.paintVertexShape=function(a,b,c,d,e){this.outline||a.setStrokeColor(null);mxRectangleShape.prototype.paintBackground.apply(this,arguments);null!=
|
|
this.style&&(a.setStrokeColor(this.stroke),a.rect(b,c,d,e),a.fill(),"1"==mxUtils.getValue(this.style,"top","1")&&(a.begin(),a.moveTo(b,c),a.lineTo(b+d,c),a.end(),a.stroke()),"1"==mxUtils.getValue(this.style,"right","1")&&(a.begin(),a.moveTo(b+d,c),a.lineTo(b+d,c+e),a.end(),a.stroke()),"1"==mxUtils.getValue(this.style,"bottom","1")&&(a.begin(),a.moveTo(b+d,c+e),a.lineTo(b,c+e),a.end(),a.stroke()),"1"==mxUtils.getValue(this.style,"left","1")&&(a.begin(),a.moveTo(b,c+e),a.lineTo(b,c),a.end(),a.stroke()))};
|
|
mxCellRenderer.prototype.defaultShapes.partialRectangle=U;mxUtils.extend(ea,mxEllipse);ea.prototype.paintVertexShape=function(a,b,c,d,e){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);a.begin();"vertical"==mxUtils.getValue(this.style,"line")?(a.moveTo(b+d/2,c),a.lineTo(b+d/2,c+e)):(a.moveTo(b,c+e/2),a.lineTo(b+d,c+e/2));a.end();a.stroke()};mxCellRenderer.prototype.defaultShapes.lineEllipse=ea;mxUtils.extend(ia,mxActor);ia.prototype.redrawPath=function(a,b,c,d,e){b=Math.min(d,
|
|
e/2);a.moveTo(0,0);a.lineTo(d-b,0);a.quadTo(d,0,d,e/2);a.quadTo(d,e,d-b,e);a.lineTo(0,e);a.close();a.end()};mxCellRenderer.prototype.defaultShapes.delay=ia;mxUtils.extend(Z,mxActor);Z.prototype.size=0.2;Z.prototype.redrawPath=function(a,b,c,d,e){b=Math.min(e,d);var f=Math.max(0,Math.min(b,b*parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=(e-f)/2;c=b+f;var g=(d-f)/2,f=g+f;a.moveTo(0,b);a.lineTo(g,b);a.lineTo(g,0);a.lineTo(f,0);a.lineTo(f,b);a.lineTo(d,b);a.lineTo(d,c);a.lineTo(f,c);a.lineTo(f,
|
|
e);a.lineTo(g,e);a.lineTo(g,c);a.lineTo(0,c);a.close();a.end()};mxCellRenderer.prototype.defaultShapes.cross=Z;mxUtils.extend(la,mxActor);la.prototype.size=0.25;la.prototype.redrawPath=function(a,b,c,d,e){b=Math.min(d,e/2);c=Math.min(d-b,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*d);a.moveTo(0,e/2);a.lineTo(c,0);a.lineTo(d-b,0);a.quadTo(d,0,d,e/2);a.quadTo(d,e,d-b,e);a.lineTo(c,e);a.close();a.end()};mxCellRenderer.prototype.defaultShapes.display=la;mxMarker.addMarker("dash",
|
|
function(a,b,c,d,e,f,g,h,k,l){var m=e*(g+k+1),n=f*(g+k+1);return function(){a.begin();a.moveTo(d.x-m/2-n/2,d.y-n/2+m/2);a.lineTo(d.x+n/2-3*m/2,d.y-3*n/2-m/2);a.stroke()}});mxMarker.addMarker("cross",function(a,b,c,d,e,f,g,h,k,m){var l=e*(g+k+1),n=f*(g+k+1);return function(){a.begin();a.moveTo(d.x-l/2-n/2,d.y-n/2+l/2);a.lineTo(d.x+n/2-3*l/2,d.y-3*n/2-l/2);a.moveTo(d.x-l/2+n/2,d.y-n/2-l/2);a.lineTo(d.x-n/2-3*l/2,d.y-3*n/2+l/2);a.stroke()}});mxMarker.addMarker("circle",ta);mxMarker.addMarker("circlePlus",
|
|
function(a,b,c,d,e,f,g,h,k,l){var m=d.clone(),n=ta.apply(this,arguments),p=e*(g+2*k),q=f*(g+2*k);return function(){n.apply(this,arguments);a.begin();a.moveTo(m.x-e*k,m.y-f*k);a.lineTo(m.x-2*p+e*k,m.y-2*q+f*k);a.moveTo(m.x-p-q+f*k,m.y-q+p-e*k);a.lineTo(m.x+q-p-f*k,m.y-q-p+e*k);a.stroke()}});mxMarker.addMarker("async",function(a,b,c,d,e,f,g,h,k,m){b=1.118*e*k;c=1.118*f*k;e*=g+k;f*=g+k;var l=d.clone();l.x-=b;l.y-=c;d.x+=1*-e-b;d.y+=1*-f-c;return function(){a.begin();a.moveTo(l.x,l.y);h?a.lineTo(l.x-
|
|
e-f/2,l.y-f+e/2):a.lineTo(l.x+f/2-e,l.y-f-e/2);a.lineTo(l.x-e,l.y-f);a.close();m?a.fillAndStroke():a.stroke()}});mxMarker.addMarker("openAsync",function(a){a=null!=a?a:2;return function(b,c,d,e,f,g,h,k,l,m){f*=h+l;g*=h+l;var n=e.clone();return function(){b.begin();b.moveTo(n.x,n.y);k?b.lineTo(n.x-f-g/a,n.y-g+f/a):b.lineTo(n.x+g/a-f,n.y-g-f/a);b.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var da=function(a,b,c,d,e){a=new mxHandle(a,null,mxVertexHandler.prototype.secondaryHandleImage);
|
|
a.execute=function(){for(var a=0;a<b.length;a++)this.copyStyle(b[a])};a.getPosition=c;a.setPosition=d;a.ignoreGrid=null!=e?e:!0;return a},ja=function(a,b){return da(a,[mxConstants.STYLE_ARCSIZE],function(c){var d=Math.max(0,parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100,e=null!=b?b:c.height/8;return new mxPoint(c.x+c.width-Math.min(Math.max(c.width/2,c.height/2),Math.min(c.width,c.height)*d),c.y+e)},function(a,b,c){a=Math.min(50,Math.max(0,
|
|
100*(a.width-b.x+a.x)/Math.min(a.width,a.height)));this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(a)})},ha=function(){return function(a){var b=[];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&b.push(ja(a));return b}},ga=function(a){return function(b){var c=[da(b,["size"],function(b){var c=Math.max(0,Math.min(a,parseFloat(mxUtils.getValue(this.state.style,"size",n.prototype.size))));return new mxPoint(b.x+0.75*c*b.width,b.y+b.height/4)},function(b,c){this.state.style.size=Math.max(0,
|
|
Math.min(a,(c.x-b.x)/(0.75*b.width)))})];mxUtils.getValue(b.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(ja(b));return c}},na=function(a,b,c){c=null!=c?c:1;return function(d){var e=[da(d,["size"],function(b){var c=parseFloat(mxUtils.getValue(this.state.style,"size",a));return new mxPoint(b.x+c*b.width,b.getCenterY())},function(a,b){this.state.style.size=Math.max(0,Math.min(c,(b.x-a.x)/a.width))})];b&&mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&e.push(ja(d));return e}},ra=function(a,b,c){return function(d){var e=
|
|
[da(d,["size"],function(c){var d=Math.max(0,Math.min(c.width,Math.min(c.height,parseFloat(mxUtils.getValue(this.state.style,"size",b)))))*a;return new mxPoint(c.x+d,c.y+d)},function(b,c){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(b.width,c.x-b.x),Math.min(b.height,c.y-b.y)))/a)})];c&&mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,!1)&&e.push(ja(d));return e}},va=function(a){return function(b){return[da(b,["arrowWidth","arrowSize"],function(b){var c=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,
|
|
"arrowWidth",C.prototype.arrowWidth))),d=Math.max(0,Math.min(a,mxUtils.getValue(this.state.style,"arrowSize",C.prototype.arrowSize)));return new mxPoint(b.x+(1-d)*b.width,b.y+(1-c)*b.height/2)},function(b,c){this.state.style.arrowWidth=Math.max(0,Math.min(1,2*(Math.abs(b.y+b.height/2-c.y)/b.height)));this.state.style.arrowSize=Math.max(0,Math.min(a,(b.x+b.width-c.x)/b.width))})]}},ma=function(a,b,c,d,e){var f=a.absolutePoints,g=f.length-1,h=a.view.translate,k=a.view.scale,l=c?f[0]:f[g],m=c?f[1]:f[g-
|
|
1],n=m.x-l.x,p=m.y-l.y,q=Math.sqrt(n*n+p*p);return da(a,b,function(a){a=d.call(this,q,n/q,p/q,l,m);return new mxPoint(a.x/k-h.x,a.y/k-h.y)},function(a,b,c){a=Math.sqrt(n*n+p*p);b.x=(b.x+h.x)*k;b.y=(b.y+h.y)*k;e.call(this,a,n/a,p/a,l,m,b,c)})},wa=function(a,b,c){return ma(a,["width"],b,function(b,d,e,f,g){g=a.shape.getEdgeWidth()*a.view.scale+c;return new mxPoint(f.x+d*b/4+e*g/2,f.y+e*b/4-d*g/2)},function(b,d,e,f,g,h){b=Math.sqrt(mxUtils.ptSegDistSq(f.x,f.y,g.x,g.y,h.x,h.y));a.style.width=Math.round(2*
|
|
b)/a.view.scale-c})},sa={link:function(a){return[wa(a,!0,10),wa(a,!1,10)]},flexArrow:function(a){var b=a.view.graph.gridSize/a.view.scale,c=[];mxUtils.getValue(a.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(c.push(ma(a,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(b,c,d,e,f){b=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;f=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(e.x+
|
|
c*(f+a.shape.strokewidth*a.view.scale)+d*b/2,e.y+d*(f+a.shape.strokewidth*a.view.scale)-c*b/2)},function(c,d,e,f,g,h,k){c=Math.sqrt(mxUtils.ptSegDistSq(f.x,f.y,g.x,g.y,h.x,h.y));d=mxUtils.ptLineDist(f.x,f.y,f.x+e,f.y-d,h.x,h.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*c)/a.view.scale;mxEvent.isControlDown(k.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE]);mxEvent.isAltDown(k.getEvent())||
|
|
Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<b/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE])})),c.push(ma(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(b,c,d,e,f){b=(a.shape.getStartArrowWidth()-a.shape.strokewidth)*a.view.scale;f=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(e.x+c*(f+a.shape.strokewidth*
|
|
a.view.scale)+d*b/2,e.y+d*(f+a.shape.strokewidth*a.view.scale)-c*b/2)},function(c,d,e,f,g,h,k){c=Math.sqrt(mxUtils.ptSegDistSq(f.x,f.y,g.x,g.y,h.x,h.y));d=mxUtils.ptLineDist(f.x,f.y,f.x+e,f.y-d,h.x,h.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;a.style.startWidth=Math.max(0,Math.round(2*c)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(k.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE],a.style.endWidth=
|
|
a.style.startWidth);mxEvent.isAltDown(k.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<b/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(a.style.startWidth)-parseFloat(a.style.endWidth))<b&&(a.style.startWidth=a.style.endWidth))})));mxUtils.getValue(a.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(c.push(ma(a,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],
|
|
!1,function(b,c,d,e,f){b=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;f=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(e.x+c*(f+a.shape.strokewidth*a.view.scale)-d*b/2,e.y+d*(f+a.shape.strokewidth*a.view.scale)+c*b/2)},function(c,d,e,f,g,h,k){c=Math.sqrt(mxUtils.ptSegDistSq(f.x,f.y,g.x,g.y,h.x,h.y));d=mxUtils.ptLineDist(f.x,f.y,f.x+e,f.y-d,h.x,h.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(d-a.shape.strokewidth)/
|
|
3)/100/a.view.scale;a.style.width=Math.round(2*c)/a.view.scale;mxEvent.isControlDown(k.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]);mxEvent.isAltDown(k.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<b/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE])})),c.push(ma(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(b,
|
|
c,d,e,f){b=(a.shape.getEndArrowWidth()-a.shape.strokewidth)*a.view.scale;f=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(e.x+c*(f+a.shape.strokewidth*a.view.scale)-d*b/2,e.y+d*(f+a.shape.strokewidth*a.view.scale)+c*b/2)},function(c,d,e,f,g,h,k){c=Math.sqrt(mxUtils.ptSegDistSq(f.x,f.y,g.x,g.y,h.x,h.y));d=mxUtils.ptLineDist(f.x,f.y,f.x+e,f.y-d,h.x,h.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(d-a.shape.strokewidth)/3)/100/a.view.scale;
|
|
a.style.endWidth=Math.max(0,Math.round(2*c)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(k.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE],a.style.startWidth=a.style.endWidth);mxEvent.isAltDown(k.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<b/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(a.style.endWidth)-parseFloat(a.style.startWidth))<
|
|
b&&(a.style.endWidth=a.style.startWidth))})));return c},swimlane:function(a){var b=[da(a,[mxConstants.STYLE_STARTSIZE],function(b){var c=parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(b.getCenterX(),b.y+Math.max(0,Math.min(b.height,c))):new mxPoint(b.x+Math.max(0,Math.min(b.width,c)),b.getCenterY())},function(b,c){a.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,
|
|
mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(b.height,c.y-b.y))):Math.round(Math.max(0,Math.min(b.width,c.x-b.x)))})];if(mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED)){var c=parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));b.push(ja(a,c/2))}return b},label:ha(),ext:ha(),rectangle:ha(),triangle:ha(),rhombus:ha(),hexagon:ha(),umlLifeline:function(a){return[da(a,["size"],function(a){var b=Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(this.state.style,
|
|
"size",D.prototype.size))));return new mxPoint(a.getCenterX(),a.y+b)},function(a,b){this.state.style.size=Math.round(Math.max(0,Math.min(a.height,b.y-a.y)))},!1)]},umlFrame:function(a){var b=[da(a,["width","height"],function(a){var b=Math.max(J.prototype.corner,Math.min(a.width,mxUtils.getValue(this.state.style,"width",J.prototype.width))),c=Math.max(1.5*J.prototype.corner,Math.min(a.height,mxUtils.getValue(this.state.style,"height",J.prototype.height)));return new mxPoint(a.x+b,a.y+c)},function(a,
|
|
b){this.state.style.width=Math.round(Math.max(J.prototype.corner,Math.min(a.width,b.x-a.x)));this.state.style.height=Math.round(Math.max(1.5*J.prototype.corner,Math.min(a.height,b.y-a.y)))},!1)];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&b.push(ja(a));return b},process:function(a){var b=[da(a,["size"],function(a){var b=Math.max(0,Math.min(0.5,parseFloat(mxUtils.getValue(this.state.style,"size",s.prototype.size))));return new mxPoint(a.x+a.width*b,a.y+a.height/4)},function(a,b){this.state.style.size=
|
|
Math.max(0,Math.min(0.5,(b.x-a.x)/a.width))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&b.push(ja(a));return b},cross:function(a){return[da(a,["size"],function(a){var b=Math.min(a.width,a.height),b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",Z.prototype.size)))*b/2;return new mxPoint(a.getCenterX()-b,a.getCenterY()-b)},function(a,b){var c=Math.min(a.width,a.height);this.state.style.size=Math.max(0,Math.min(1,Math.min(2*(Math.max(0,a.getCenterY()-b.y)/c),2*(Math.max(0,
|
|
a.getCenterX()-b.x)/c))))})]},note:function(a){return[da(a,["size"],function(a){var b=Math.max(0,Math.min(a.width,Math.min(a.height,parseFloat(mxUtils.getValue(this.state.style,"size",e.prototype.size)))));return new mxPoint(a.x+a.width-b,a.y+b)},function(a,b){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(a.width,a.x+a.width-b.x),Math.min(a.height,b.y-a.y))))})]},manualInput:function(a){var b=[da(a,["size"],function(a){var b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,
|
|
"size",ba.prototype.size)));return new mxPoint(a.x+a.width/4,a.y+3*b/4)},function(a,b){this.state.style.size=Math.round(Math.max(0,Math.min(a.height,4*(b.y-a.y)/3)))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&b.push(ja(a));return b},dataStorage:function(a){return[da(a,["size"],function(a){var b=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",M.prototype.size))));return new mxPoint(a.x+(1-b)*a.width,a.getCenterY())},function(a,b){this.state.style.size=Math.max(0,
|
|
Math.min(1,(a.x+a.width-b.x)/a.width))})]},internalStorage:function(a){var b=[da(a,["dx","dy"],function(a){var b=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",N.prototype.dx))),c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",N.prototype.dy)));return new mxPoint(a.x+b,a.y+c)},function(a,b){this.state.style.dx=Math.round(Math.max(0,Math.min(a.width,b.x-a.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(a.height,b.y-a.y)))})];mxUtils.getValue(a.style,
|
|
mxConstants.STYLE_ROUNDED,!1)&&b.push(ja(a));return b},corner:function(a){return[da(a,["dx","dy"],function(a){var b=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",I.prototype.dx))),c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",I.prototype.dy)));return new mxPoint(a.x+b,a.y+c)},function(a,b){this.state.style.dx=Math.round(Math.max(0,Math.min(a.width,b.x-a.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(a.height,b.y-a.y)))})]},tee:function(a){return[da(a,
|
|
["dx","dy"],function(a){var b=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",G.prototype.dx))),c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",G.prototype.dy)));return new mxPoint(a.x+(a.width+b)/2,a.y+c)},function(a,b){this.state.style.dx=Math.round(Math.max(0,2*Math.min(a.width/2,b.x-a.x-a.width/2)));this.state.style.dy=Math.round(Math.max(0,Math.min(a.height,b.y-a.y)))})]},singleArrow:va(1),doubleArrow:va(0.5),folder:function(a){return[da(a,["tabWidth",
|
|
"tabHeight"],function(a){var b=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"tabWidth",g.prototype.tabWidth))),c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"tabHeight",g.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",g.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(b=a.width-b);return new mxPoint(a.x+b,a.y+c)},function(a,b){var c=Math.max(0,Math.min(a.width,b.x-a.x));mxUtils.getValue(this.state.style,"tabPosition",g.prototype.tabPosition)==
|
|
mxConstants.ALIGN_RIGHT&&(c=a.width-c);this.state.style.tabWidth=Math.round(c);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(a.height,b.y-a.y)))})]},document:function(a){return[da(a,["size"],function(a){var b=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",m.prototype.size))));return new mxPoint(a.x+3*a.width/4,a.y+(1-b)*a.height)},function(a,b){this.state.style.size=Math.max(0,Math.min(1,(a.y+a.height-b.y)/a.height))})]},tape:function(a){return[da(a,["size"],
|
|
function(a){var b=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",k.prototype.size))));return new mxPoint(a.getCenterX(),a.y+b*a.height/2)},function(a,b){this.state.style.size=Math.max(0,Math.min(1,2*((b.y-a.y)/a.height)))})]},offPageConnector:function(a){return[da(a,["size"],function(a){var b=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",Q.prototype.size))));return new mxPoint(a.getCenterX(),a.y+(1-b)*a.height)},function(a,b){this.state.style.size=
|
|
Math.max(0,Math.min(1,(a.y+a.height-b.y)/a.height))})]},step:na(u.prototype.size,!0),hexagon:na(t.prototype.size,!0,0.5),curlyBracket:na(p.prototype.size,!1),display:na(la.prototype.size,!1),cube:ra(1,a.prototype.size,!1),card:ra(0.5,h.prototype.size,!0),loopLimit:ra(0.5,Y.prototype.size,!0),trapezoid:ga(0.5),parallelogram:ga(1)};Graph.createHandle=da;Graph.handleFactory=sa;mxVertexHandler.prototype.createCustomHandles=function(){if(1==this.state.view.graph.getSelectionCount()&&this.graph.isCellRotatable(this.state.cell)){var a=
|
|
sa[this.state.style.shape];if(null!=a)return a(this.state)}return null};mxEdgeHandler.prototype.createCustomHandles=function(){if(1==this.state.view.graph.getSelectionCount()){var a=sa[this.state.style.shape];if(null!=a)return a(this.state)}return null}}else Graph.createHandle=function(){},Graph.handleFactory={};var oa=new mxPoint(1,0),pa=new mxPoint(1,0),ga=mxUtils.toRadians(-30),ha=Math.cos(ga),ga=Math.sin(ga),oa=mxUtils.getRotatedPoint(oa,ha,ga),ga=mxUtils.toRadians(-150),ha=Math.cos(ga),ga=Math.sin(ga),
|
|
pa=mxUtils.getRotatedPoint(pa,ha,ga);mxEdgeStyle.IsometricConnector=function(a,b,c,d,e){var f=a.view;d=null!=d&&0<d.length?d[0]:null;var g=a.absolutePoints,h=g[0],g=g[g.length-1];null!=d&&(d=f.transformControlPoint(a,d));null==h&&null!=b&&(h=new mxPoint(b.getCenterX(),b.getCenterY()));null==g&&null!=c&&(g=new mxPoint(c.getCenterX(),c.getCenterY()));var k=oa.x,l=oa.y,m=pa.x,n=pa.y,p="horizontal"==mxUtils.getValue(a.style,"elbow","horizontal");if(null!=g&&null!=h){var q=h;a=function(a,b,c){a-=q.x;var d=
|
|
b-q.y;b=(n*a-m*d)/(k*n-l*m);a=(l*a-k*d)/(l*m-k*n);p?(c&&(q=new mxPoint(q.x+k*b,q.y+l*b),e.push(q)),q=new mxPoint(q.x+m*a,q.y+n*a)):(c&&(q=new mxPoint(q.x+m*a,q.y+n*a),e.push(q)),q=new mxPoint(q.x+k*b,q.y+l*b));e.push(q)};null==d&&(d=new mxPoint(h.x+(g.x-h.x)/2,h.y+(g.y-h.y)/2));a(d.x,d.y,!0);a(g.x,g.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Ba=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(a,b){if(b==mxEdgeStyle.IsometricConnector){var c=
|
|
new mxElbowEdgeHandler(a);c.snapToTerminals=!1;return c}return Ba.apply(this,arguments)};b.prototype.constraints=[];c.prototype.constraints=[];mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0.25,0),!0),new mxConnectionConstraint(new mxPoint(0.5,0),!0),new mxConnectionConstraint(new mxPoint(0.75,0),!0),new mxConnectionConstraint(new mxPoint(0,0.25),!0),new mxConnectionConstraint(new mxPoint(0,0.5),!0),new mxConnectionConstraint(new mxPoint(0,0.75),!0),new mxConnectionConstraint(new mxPoint(1,
|
|
0.25),!0),new mxConnectionConstraint(new mxPoint(1,0.5),!0),new mxConnectionConstraint(new mxPoint(1,0.75),!0),new mxConnectionConstraint(new mxPoint(0.25,1),!0),new mxConnectionConstraint(new mxPoint(0.5,1),!0),new mxConnectionConstraint(new mxPoint(0.75,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(0.5,
|
|
0),!0),new mxConnectionConstraint(new mxPoint(0.5,1),!0),new mxConnectionConstraint(new mxPoint(0,0.5),!0),new mxConnectionConstraint(new mxPoint(1,0.5))];mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints;mxImageShape.prototype.constraints=mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;z.prototype.constraints=mxRectangleShape.prototype.constraints;e.prototype.constraints=mxRectangleShape.prototype.constraints;h.prototype.constraints=
|
|
mxRectangleShape.prototype.constraints;a.prototype.constraints=mxRectangleShape.prototype.constraints;g.prototype.constraints=mxRectangleShape.prototype.constraints;N.prototype.constraints=mxRectangleShape.prototype.constraints;M.prototype.constraints=mxRectangleShape.prototype.constraints;W.prototype.constraints=mxEllipse.prototype.constraints;X.prototype.constraints=mxEllipse.prototype.constraints;S.prototype.constraints=mxEllipse.prototype.constraints;ea.prototype.constraints=mxEllipse.prototype.constraints;
|
|
ba.prototype.constraints=mxRectangleShape.prototype.constraints;ia.prototype.constraints=mxRectangleShape.prototype.constraints;la.prototype.constraints=mxRectangleShape.prototype.constraints;Y.prototype.constraints=mxRectangleShape.prototype.constraints;Q.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0.15,0.05),!1),new mxConnectionConstraint(new mxPoint(0.5,0),!0),new mxConnectionConstraint(new mxPoint(0.85,0.05),
|
|
!1),new mxConnectionConstraint(new mxPoint(0,0.3),!0),new mxConnectionConstraint(new mxPoint(0,0.5),!0),new mxConnectionConstraint(new mxPoint(0,0.7),!0),new mxConnectionConstraint(new mxPoint(1,0.3),!0),new mxConnectionConstraint(new mxPoint(1,0.5),!0),new mxConnectionConstraint(new mxPoint(1,0.7),!0),new mxConnectionConstraint(new mxPoint(0.15,0.95),!1),new mxConnectionConstraint(new mxPoint(0.5,1),!0),new mxConnectionConstraint(new mxPoint(0.85,0.95),!1)];K.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0.25,
|
|
0.1),!1),new mxConnectionConstraint(new mxPoint(0.5,0),!1),new mxConnectionConstraint(new mxPoint(0.75,0.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(0.5,0.5),!1)];T.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0.25,0),!0),new mxConnectionConstraint(new mxPoint(0.5,0),!0),new mxConnectionConstraint(new mxPoint(0.75,
|
|
0),!0),new mxConnectionConstraint(new mxPoint(0,0.3),!0),new mxConnectionConstraint(new mxPoint(0,0.7),!0),new mxConnectionConstraint(new mxPoint(1,0.25),!0),new mxConnectionConstraint(new mxPoint(1,0.5),!0),new mxConnectionConstraint(new mxPoint(1,0.75),!0),new mxConnectionConstraint(new mxPoint(0.25,1),!0),new mxConnectionConstraint(new mxPoint(0.5,1),!0),new mxConnectionConstraint(new mxPoint(0.75,1),!0)];mxActor.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0.5,0),!0),new mxConnectionConstraint(new mxPoint(0.25,
|
|
0.2),!1),new mxConnectionConstraint(new mxPoint(0.1,0.5),!1),new mxConnectionConstraint(new mxPoint(0,0.75),!0),new mxConnectionConstraint(new mxPoint(0.75,0.25),!1),new mxConnectionConstraint(new mxPoint(0.9,0.5),!1),new mxConnectionConstraint(new mxPoint(1,0.75),!0),new mxConnectionConstraint(new mxPoint(0.25,1),!0),new mxConnectionConstraint(new mxPoint(0.5,1),!0),new mxConnectionConstraint(new mxPoint(0.75,1),!0)];f.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0.5,
|
|
0.25),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(0.25,0.5),!1),new mxConnectionConstraint(new mxPoint(0.75,0.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(0.5,0.75),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];k.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0.35),!1),new mxConnectionConstraint(new mxPoint(0,0.5),!1),new mxConnectionConstraint(new mxPoint(0,0.65),!1),new mxConnectionConstraint(new mxPoint(1,
|
|
0.35),!1),new mxConnectionConstraint(new mxPoint(1,0.5),!1),new mxConnectionConstraint(new mxPoint(1,0.65),!1),new mxConnectionConstraint(new mxPoint(0.25,1),!1),new mxConnectionConstraint(new mxPoint(0.75,0),!1)];u.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0.25,0),!0),new mxConnectionConstraint(new mxPoint(0.5,0),!0),new mxConnectionConstraint(new mxPoint(0.75,0),!0),new mxConnectionConstraint(new mxPoint(0.25,1),!0),new mxConnectionConstraint(new mxPoint(0.5,1),!0),new mxConnectionConstraint(new mxPoint(0.75,
|
|
1),!0),new mxConnectionConstraint(new mxPoint(0.1,0.25),!1),new mxConnectionConstraint(new mxPoint(0.2,0.5),!1),new mxConnectionConstraint(new mxPoint(0.1,0.75),!1),new mxConnectionConstraint(new mxPoint(0.9,0.25),!1),new mxConnectionConstraint(new mxPoint(1,0.5),!1),new mxConnectionConstraint(new mxPoint(0.9,0.75),!1)];mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0.5),!1),new mxConnectionConstraint(new mxPoint(0.25,0.5),!1),new mxConnectionConstraint(new mxPoint(0.75,0.5),
|
|
!1),new mxConnectionConstraint(new mxPoint(1,0.5),!1)];P.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0.5,0),!1),new mxConnectionConstraint(new mxPoint(0.5,1),!1)];mxDoubleEllipse.prototype.constraints=mxEllipse.prototype.constraints;mxRhombus.prototype.constraints=mxEllipse.prototype.constraints;mxTriangle.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0.25),!0),new mxConnectionConstraint(new mxPoint(0,0.5),!0),new mxConnectionConstraint(new mxPoint(0,0.75),!0),
|
|
new mxConnectionConstraint(new mxPoint(0.5,0),!0),new mxConnectionConstraint(new mxPoint(0.5,1),!0),new mxConnectionConstraint(new mxPoint(1,0.5),!0)];mxHexagon.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0.375,0),!0),new mxConnectionConstraint(new mxPoint(0.5,0),!0),new mxConnectionConstraint(new mxPoint(0.625,0),!0),new mxConnectionConstraint(new mxPoint(0.125,0.25),!1),new mxConnectionConstraint(new mxPoint(0,0.5),!0),new mxConnectionConstraint(new mxPoint(0.125,0.75),!1),new mxConnectionConstraint(new mxPoint(0.875,
|
|
0.25),!1),new mxConnectionConstraint(new mxPoint(0,0.5),!0),new mxConnectionConstraint(new mxPoint(1,0.5),!0),new mxConnectionConstraint(new mxPoint(0.875,0.75),!1),new mxConnectionConstraint(new mxPoint(0.375,1),!0),new mxConnectionConstraint(new mxPoint(0.5,1),!0),new mxConnectionConstraint(new mxPoint(0.625,1),!0)];mxCloud.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0.25,0.25),!1),new mxConnectionConstraint(new mxPoint(0.4,0.1),!1),new mxConnectionConstraint(new mxPoint(0.16,
|
|
0.55),!1),new mxConnectionConstraint(new mxPoint(0.07,0.4),!1),new mxConnectionConstraint(new mxPoint(0.31,0.8),!1),new mxConnectionConstraint(new mxPoint(0.13,0.77),!1),new mxConnectionConstraint(new mxPoint(0.8,0.8),!1),new mxConnectionConstraint(new mxPoint(0.55,0.95),!1),new mxConnectionConstraint(new mxPoint(0.875,0.5),!1),new mxConnectionConstraint(new mxPoint(0.96,0.7),!1),new mxConnectionConstraint(new mxPoint(0.625,0.2),!1),new mxConnectionConstraint(new mxPoint(0.88,0.25),!1)];l.prototype.constraints=
|
|
mxRectangleShape.prototype.constraints;n.prototype.constraints=mxRectangleShape.prototype.constraints;m.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0.25,0),!0),new mxConnectionConstraint(new mxPoint(0.5,0),!0),new mxConnectionConstraint(new mxPoint(0.75,0),!0),new mxConnectionConstraint(new mxPoint(0,0.25),!0),new mxConnectionConstraint(new mxPoint(0,0.5),!0),new mxConnectionConstraint(new mxPoint(0,0.75),!0),new mxConnectionConstraint(new mxPoint(1,0.25),!0),new mxConnectionConstraint(new mxPoint(1,
|
|
0.5),!0),new mxConnectionConstraint(new mxPoint(1,0.75),!0)];mxArrow.prototype.constraints=null;G.prototype.constraints=null;I.prototype.constraints=null;C.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0.5),!1),new mxConnectionConstraint(new mxPoint(1,0.5),!1)];E.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0.5),!1),new mxConnectionConstraint(new mxPoint(1,0.5),!1)];Z.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0.5),!1),new mxConnectionConstraint(new mxPoint(1,
|
|
0.5),!1),new mxConnectionConstraint(new mxPoint(0.5,0),!1),new mxConnectionConstraint(new mxPoint(0.5,1),!1)];D.prototype.constraints=null;R.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0.25),!1),new mxConnectionConstraint(new mxPoint(0,0.5),!1),new mxConnectionConstraint(new mxPoint(0,0.75),!1),new mxConnectionConstraint(new mxPoint(1,0.5),!1),new mxConnectionConstraint(new mxPoint(0.7,0.1),!1),new mxConnectionConstraint(new mxPoint(0.7,0.9),!1)];$.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0.175,
|
|
0.25),!1),new mxConnectionConstraint(new mxPoint(0.25,0.5),!1),new mxConnectionConstraint(new mxPoint(0.175,0.75),!1),new mxConnectionConstraint(new mxPoint(1,0.5),!1),new mxConnectionConstraint(new mxPoint(0.7,0.1),!1),new mxConnectionConstraint(new mxPoint(0.7,0.9),!1)]})();
|
|
(function(x,r){function L(){if(!s){s=!0;window.MathJax={skipStartupTypeset:!0,showMathMenu:!1,messageStyle:"none",AuthorInit:function(){MathJax.Hub.Config({"HTML-CSS":{availableFonts:[],webFont:"STIX-Web",imageFont:null}});MathJax.Hub.Register.StartupHook("Begin",function(){for(var a=0;a<q.length;a++)MathJax.Hub.Queue(["Typeset",MathJax.Hub,q[a]])})}};var a=document.createElement("script");a.type="text/javascript";a.src="https://cdn.mathjax.org/mathjax/2.6-latest/MathJax.js?config\x3dTeX-MML-AM_HTMLorMML";
|
|
document.getElementsByTagName("head")[0].appendChild(a)}}function M(a){"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?MathJax.Hub.Queue(["Typeset",MathJax.Hub,a.container]):q.push(a.container);a.addListener(mxEvent.SIZE,function(d,m){"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub&&MathJax.Hub.Queue(["Typeset",MathJax.Hub,a.container])})}mxStencilRegistry.dynamicLoading=!1;try{var d=document.createElement("style");d.type="text/css";d.innerHTML="div.mxTooltip {\n-webkit-box-shadow: 3px 3px 12px #C0C0C0;\n-moz-box-shadow: 3px 3px 12px #C0C0C0;\nbox-shadow: 3px 3px 12px #C0C0C0;\nbackground: #FFFFCC;\nborder-style: solid;\nborder-width: 1px;\nborder-color: black;\nfont-family: Arial;\nfont-size: 8pt;\nposition: absolute;\ncursor: default;\npadding: 4px;\ncolor: black;}";
|
|
document.getElementsByTagName("head")[0].appendChild(d)}catch(S){}var F=mxClient.NO_FO,s="undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub,q=[];mxGraph.prototype.getImageFromBundles=function(a){return null!=a?("http://"!=a.substring(0,7)&&("https://"!=a.substring(0,8)&&"data:image"!=a.substring(0,10))&&("/"==a.charAt(0)&&(a=a.substring(1,a.length)),a="https://www.draw.io/"+a),a):null};if(null!=r)for(d=0;d<r.length;d++){var y=mxUtils.parseXml(r[d]);mxStencilRegistry.parseStencilSet(y.documentElement)}mxClient.IS_TOUCH&&
|
|
(mxPanningHandler.prototype.isPanningTrigger=function(a){return!0});(function(){function a(a){try{for(var e=a.firstChild;null!=e&&e.nodeType!=mxConstants.NODETYPE_ELEMENT;)e=e.nextSibling;var h=mxUtils.trim(e.innerHTML);a.innerHTML="";var b=new Graph(a),h="\x26lt;"==h.substring(0,4)?h.replace(/</g,"\x3c").replace(/>/g,"\x3e").replace(/&gt;/g,"\x26gt;").replace(/&lt;/g,"\x26lt;").replace(/&quot;/g,"\x26quot;").replace(/
/g,"\n"):"%3C"==h.substring(0,3)?decodeURIComponent(h):b.decompress(h),
|
|
g=mxUtils.parseXml(h),d=e=null;null!=g.documentElement&&"mxfile"==g.documentElement.nodeName&&(d=g.documentElement.getElementsByTagName("diagram"),e=g.documentElement,0<d.length&&(h=mxUtils.getTextContent(d[0]),h=b.decompress(h),g=mxUtils.parseXml(h)));if(null!=g.documentElement&&"mxGraphModel"==g.documentElement.nodeName){var l=new mxCodec(g),m=g.documentElement;null==e&&(e=m);b.resetViewOnRootChange=!1;b.setEnabled(!1);if(null!=d&&0<d.length){var r=b.getGlobalVariable;b.getGlobalVariable=function(b){return"page"==
|
|
b?d[0].getAttribute("name")||"Page-1":"pagenumber"==b?1:r.apply(this,arguments)}}b.foldingEnabled="1"==e.getAttribute("nav");b.cellRenderer.forceControlClickHandler=b.foldingEnabled;var q=e.getAttribute("tooltips");"0"!=q?b.setTooltips(!0):b.setTooltips(!1);if(mxClient.IS_VML){var z=b.view.getCanvas();null!=z&&"DIV"==z.nodeName&&(z.style.position="relative")}if(null!=x){var s=mxUtils.parseXml(x);(new mxCodec(s)).decode(s.documentElement,b.getStylesheet())}var A=e.getAttribute("math");"1"==A&&(mxClient.NO_FO=
|
|
!0,L());"0"!=e.getAttribute("pan")?(b.panningHandler.useLeftButtonForPanning=!0,b.panningHandler.ignoreCell=!0,a.style.cursor="move",b.setPanning(!0)):a.style.cursor="default";var B=e.getAttribute("resize"),u=Number(e.getAttribute("border")||0);b.border=u;var C=e.getAttribute("fit");"100%"!=a.style.width&&"1"!=C&&"0"!=B||""==a.style.width&&""==a.style.height?(b.resizeContainer=!0,b.centerZoom=!1):"0"!=B&&"100%"==a.style.width&&""==a.style.height?(b.resizeContainer=!0,b.centerZoom=!1,b.doResizeContainer=
|
|
function(b,a){if(mxClient.IS_IE)if(mxClient.IS_QUIRKS){var c=this.getBorderSizes();b+=Math.max(2,c.x+c.width+1);a+=Math.max(2,c.y+c.height+1)}else 9<=document.documentMode?(b+=3,a+=5):(b+=1,a+=1);else a+=1;null!=this.maximumContainerSize&&(Math.min(this.maximumContainerSize.width,b),a=Math.min(this.maximumContainerSize.height,a));this.container.style.height=Math.ceil(a+18)+"px"}):b.centerZoom=!0;var y=e.getAttribute("links"),v=e.getAttribute("highlight");if("0"!=y||"0"!=q){var N=a.style.cursor,H=
|
|
b.getTolerance();b.addMouseListener({currentState:null,currentLink:null,highlight:null!=v&&""!=v&&v!=mxConstants.NONE?new mxCellHighlight(b,v,2):null,startX:0,startY:0,mouseDown:function(a,b){this.startX=b.getGraphX();this.startY=b.getGraphY()},mouseMove:function(a,f){if(b.isMouseDown){if(null!=this.currentLink){var c=Math.abs(this.startX-f.getGraphX()),e=Math.abs(this.startY-f.getGraphY());(c>H||e>H)&&this.clear()}}else null!=this.currentState&&(f.getState()==this.currentState||null==f.getState())&&
|
|
b.intersects(this.currentState,f.getGraphX(),f.getGraphY())||(c=b.view.getState(f.getCell()),c!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=c,null!=this.currentState&&this.activate(this.currentState)))},mouseUp:function(b,a){var c=this.currentLink;this.clear();null!=c&&("#"==c.charAt(0)?window.location.hash=c:window.open(c))},activate:function(G){this.currentLink=b.getLinkForCell(G.cell);null!=this.currentLink&&(a.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(G))},
|
|
clear:function(){a.style.cursor=N;this.currentLink=this.currentState=null;null!=this.highlight&&this.highlight.hide()}})}var O=Number(e.getAttribute("x0")||0),P=Number(e.getAttribute("y0")||0);b.view.translate.x=-O+u;b.view.translate.y=-P+u;var I=function(a){a=a.getAttribute("backgroundImage");null!=a&&(a=JSON.parse(a),b.setBackgroundImage(new mxImage(a.src,a.width,a.height)),b.view.validateBackgroundImage());"0"!=C&&b.fit(u);"1"==A&&M(b);a=b.container.getElementsByTagName("a");if(null!=a)for(var f=
|
|
0;f<a.length;f++){var c=a[f].getAttribute("href");null!=c&&("#"==c.charAt(0)&&"_blank"==a[f].getAttribute("target"))&&a[f].removeAttribute("target")}},n=e.getAttribute("url");if(null!=n)try{var p=0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;p.open("GET",n);p.onload=mxUtils.bind(this,function(){try{"1"==A&&(mxClient.NO_FO=!0);var a=null!=p.getText?p.getText():p.responseText;if(null!=a){var f=mxUtils.parseXml(a);if(null!=f&&"html"==f.documentElement.nodeName){var c=
|
|
f.documentElement.getElementsByTagName("div");if(0<c.length&&"mxgraph"==c[0].getAttribute("class")){var e=c[0].getElementsByTagName("div");0<e.length&&(a=mxUtils.getTextContent(e[0]),a=b.decompress(a),0<a.length&&(f=mxUtils.parseXml(a)))}}if(null!=f&&"svg"==f.documentElement.nodeName){var d=f.documentElement.getAttribute("content");null!=d&&("\x3c"!=d.charAt(0)&&"%"!=d.charAt(0))&&(d=unescape(window.atob?atob(d):Base64.decode(cont,d)));null!=d&&"%"==d.charAt(0)&&(d=decodeURIComponent(d));null!=d&&
|
|
0<d.length&&(f=mxUtils.parseXml(d))}if("mxfile"==f.documentElement.nodeName){var g=f.documentElement.getElementsByTagName("diagram");0<g.length&&(a=b.decompress(mxUtils.getTextContent(g[0])),f=mxUtils.parseXml(a))}l=new mxCodec(f);l.decode(f.documentElement,b.getModel());I(f.documentElement)}else b.container.innerHTML="Cannot load "+n;mxClient.NO_FO=F}catch(k){b.container.innerHTML="Cannot load "+n+": "+k.message}});p.onerror=function(){b.container.innerHTML="Cannot load "+n};p.send()}catch(Q){b.container.innerHTML=
|
|
"Cannot load "+n+": "+Q.message}else l.decode(m,b.getModel()),I(m);"100%"!=a.style.width&&("0"!=C&&"1"==B)&&(b.resizeContainer=!0,b.centerZoom=!1);var k=document.createElement("div");k.style.position="absolute";k.style.overflow="visible";k.style.cursor="pointer";var J=b.getBorderSizes(),D=0,K=10,t=16,w=16;mxClient.IS_QUIRKS?(t-=1,w-=1):mxClient.IS_TOUCH&&(w=t=24,K=14);g=function(a,b){var c=document.createElement("div");c.style.position="absolute";c.style.border="1px solid gray";c.style.textAlign=
|
|
"center";c.style.cursor="hand";c.style.width=t+"px";c.style.height=w+"px";c.style.left=D+"px";c.style.top="0px";c.style.backgroundColor="white";mxUtils.setOpacity(c,50);var d=document.createElement("table");d.style.borderWidth="0px";d.style.width="100%";d.style.height="100%";var e=document.createElement("tbody"),g=document.createElement("tr"),h=document.createElement("td");h.style.verticalAlign="middle";h.style.textAlign="center";h.style.fontSize=K+"px";h.style.padding="0px";mxUtils.write(h,a);g.appendChild(h);
|
|
e.appendChild(g);d.appendChild(e);c.appendChild(d);mxEvent.addListener(c,mxClient.IS_POINTER?"pointerdown":"mousedown",function(a){mxEvent.consume(a)});mxEvent.addListener(c,mxClient.IS_POINTER?"pointerup":"mouseup",function(a){b();mxEvent.consume(a)});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(mxEvent.addListener(c,"touchstart",function(a){mxEvent.consume(a)}),mxEvent.addListener(c,"touchend",function(a){b();mxEvent.consume(a)}));D+=t;k.appendChild(c);return c};"0"!=e.getAttribute("zoom")&&(g("+",
|
|
function(){b.zoomIn()}),g("-",function(){b.zoomOut()}));var E=e.getAttribute("edit");null!=E&&(g("",function(){if("_blank"==E)if(null!=n)window.open("https://www.draw.io/?url\x3d"+encodeURIComponent(n));else{var a=null,b=function(c){"ready"==c.data&&c.source==a&&(a.postMessage(h,"*"),window.removeEventListener("message",b))};window.addEventListener("message",b);a=window.open("https://www.draw.io/?client\x3d1")}else window.open(E)}).innerHTML="...");g=function(){k.style.top=a.offsetTop+J.y+"px";k.style.left=
|
|
a.offsetLeft+J.x+"px";k.style.visibility="visible"};!mxClient.IS_POINTER&&!mxClient.IS_TOUCH?(e=function(){k.style.visibility="hidden"},mxEvent.addListener(a,"mouseover",g),mxEvent.addListener(k,"mouseover",g),mxEvent.addListener(a,"mouseout",e),mxEvent.addListener(k,"mouseout",e),e()):g();null!=k.firstChild&&(null!=a.nextSibling?a.parentNode.insertBefore(k,a.nextSibling):a.parentNode.appendChild(k));"function"==typeof window.mxClientOnCreate&&window.mxClientOnCreate(b)}}catch(R){null!=window.console&&
|
|
console.log("Error:",R)}mxClient.NO_FO=F;return b}if("function"==typeof mxClientOnLoad)mxClientOnLoad(x,a);else if(mxClient.isBrowserSupported()){for(var d=document.getElementsByTagName("*"),m=[],l=0;l<d.length;l++)m.push(d[l]);for(l=0;l<m.length;l++)0<=m[l].className.toString().indexOf("mxgraph")&&a(m[l])}})()
|
|
})('<mxStylesheet><add as="defaultVertex"><add as="shape" value="label"/><add as="perimeter" value="rectanglePerimeter"/><add as="fontSize" value="12"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="fillColor" value="#ffffff"/><add as="strokeColor" value="#000000"/><add as="fontColor" value="#000000"/></add><add as="defaultEdge"><add as="shape" value="connector"/><add as="labelBackgroundColor" value="#ffffff"/><add as="endArrow" value="classic"/><add as="fontSize" value="11"/><add as="fontFamily" value="Helvetica"/><add as="align" value="center"/><add as="verticalAlign" value="middle"/><add as="rounded" value="1"/><add as="strokeColor" value="#000000"/><add as="fontColor" value="#000000"/></add><add as="fancy"><add as="shadow" value="1"/><add as="glass" value="1"/></add><add as="gray" extend="fancy"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="blue" extend="fancy"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="green" extend="fancy"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="turquoise" extend="fancy"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="yellow" extend="fancy"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="orange" extend="fancy"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="red" extend="fancy"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="pink" extend="fancy"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="purple" extend="fancy"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="plain-gray"><add as="gradientColor" value="#B3B3B3"/><add as="fillColor" value="#F5F5F5"/><add as="strokeColor" value="#666666"/></add><add as="plain-blue"><add as="gradientColor" value="#7EA6E0"/><add as="fillColor" value="#DAE8FC"/><add as="strokeColor" value="#6C8EBF"/></add><add as="plain-green"><add as="gradientColor" value="#97D077"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#82B366"/></add><add as="plain-turquoise"><add as="gradientColor" value="#67AB9F"/><add as="fillColor" value="#D5E8D4"/><add as="strokeColor" value="#6A9153"/></add><add as="plain-yellow"><add as="gradientColor" value="#FFD966"/><add as="fillColor" value="#FFF2CC"/><add as="strokeColor" value="#D6B656"/></add><add as="plain-orange"><add as="gradientColor" value="#FFA500"/><add as="fillColor" value="#FFCD28"/><add as="strokeColor" value="#D79B00"/></add><add as="plain-red"><add as="gradientColor" value="#EA6B66"/><add as="fillColor" value="#F8CECC"/><add as="strokeColor" value="#B85450"/></add><add as="plain-pink"><add as="gradientColor" value="#B5739D"/><add as="fillColor" value="#E6D0DE"/><add as="strokeColor" value="#996185"/></add><add as="plain-purple"><add as="gradientColor" value="#8C6C9C"/><add as="fillColor" value="#E1D5E7"/><add as="strokeColor" value="#9673A6"/></add><add as="text"><add as="fillColor" value="none"/><add as="gradientColor" value="none"/><add as="strokeColor" value="none"/><add as="align" value="left"/><add as="verticalAlign" value="top"/></add><add as="label"><add as="fontStyle" value="1"/><add as="align" value="left"/><add as="verticalAlign" value="middle"/><add as="spacing" value="2"/><add as="spacingLeft" value="52"/><add as="imageWidth" value="42"/><add as="imageHeight" value="42"/><add as="rounded" value="1"/></add><add as="icon" extend="label"><add as="align" value="center"/><add as="imageAlign" value="center"/><add as="verticalLabelPosition" value="bottom"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="4"/><add as="labelBackgroundColor" value="#ffffff"/><add as="spacing" value="0"/><add as="spacingLeft" value="0"/><add as="spacingTop" value="6"/><add as="fontStyle" value="0"/><add as="imageWidth" value="48"/><add as="imageHeight" value="48"/></add><add as="swimlane"><add as="shape" value="swimlane"/><add as="fontSize" value="12"/><add as="fontStyle" value="1"/><add as="startSize" value="23"/></add><add as="group"><add as="verticalAlign" value="top"/><add as="fillColor" value="none"/><add as="strokeColor" value="none"/><add as="gradientColor" value="none"/><add as="pointerEvents" value="0"/></add><add as="ellipse"><add as="shape" value="ellipse"/><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombus"><add as="shape" value="rhombus"/><add as="perimeter" value="rhombusPerimeter"/></add><add as="triangle"><add as="shape" value="triangle"/><add as="perimeter" value="trianglePerimeter"/></add><add as="line"><add as="shape" value="line"/><add as="strokeWidth" value="4"/><add as="labelBackgroundColor" value="#ffffff"/><add as="verticalAlign" value="top"/><add as="spacingTop" value="8"/></add><add as="image"><add as="shape" value="image"/><add as="labelBackgroundColor" value="white"/><add as="verticalAlign" value="top"/><add as="verticalLabelPosition" value="bottom"/></add><add as="roundImage" extend="image"><add as="perimeter" value="ellipsePerimeter"/></add><add as="rhombusImage" extend="image"><add as="perimeter" value="rhombusPerimeter"/></add><add as="arrow"><add as="shape" value="arrow"/><add as="edgeStyle" value="none"/><add as="fillColor" value="#ffffff"/></add></mxStylesheet>'); |