main.js 1.26 MB
window.urlParams=window.urlParams||{},window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760,window.MAX_AREA=window.MAX_AREA||225e6,window.EXPORT_URL=window.EXPORT_URL||"/export",window.SAVE_URL=window.SAVE_URL||"/save",window.OPEN_URL=window.OPEN_URL||"/open",window.RESOURCES_PATH=window.RESOURCES_PATH||"resources",window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor",window.STENCIL_PATH=window.STENCIL_PATH||"stencils",window.IMAGE_PATH=window.IMAGE_PATH||"images",window.STYLE_PATH=window.STYLE_PATH||"styles",window.CSS_PATH=window.CSS_PATH||"styles",window.OPEN_FORM=window.OPEN_FORM||"open.html",window.WORKFLOW_GETWFINFO_PATH="/api/workflow/layout/getXml",window.WORKFLOW_GETOPERATORS_PATH="/api/workflow/layout/getOperator",window.WORKFLOW_GETDETAILINFO_PATH="/api/workflow/layout/getWfInfo",window.WORKFLOW_SAVEINFO_PATH="/api/workflow/layout/saveLayout",window.WORKFLOW_GET_XML="/api/workflow/baseInfoSetting/getXml",window.WORKFLOW_GET_TOOLTIPS="/api/workflow/layout/getRuleCondition",window.mxBasePath=window.mxBasePath||"./src",window.mxLanguage=window.mxLanguage||urlParams.lang,window.mxLanguages=window.mxLanguages||["de"];var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(t,e){var n,i,o,s,l,r,a,h="",d=0;for((e=null!=e&&e)||(t=Base64._utf8_encode(t));d<t.length;)s=(n=t.charCodeAt(d++))>>2,l=(3&n)<<4|(i=t.charCodeAt(d++))>>4,r=(15&i)<<2|(o=t.charCodeAt(d++))>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),h=h+this._keyStr.charAt(s)+this._keyStr.charAt(l)+this._keyStr.charAt(r)+this._keyStr.charAt(a);return h},decode:function(t,e){e=null!=e&&e;var n,i,o,s,l,r,a="",h=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");h<t.length;)n=this._keyStr.indexOf(t.charAt(h++))<<2|(s=this._keyStr.indexOf(t.charAt(h++)))>>4,i=(15&s)<<4|(l=this._keyStr.indexOf(t.charAt(h++)))>>2,o=(3&l)<<6|(r=this._keyStr.indexOf(t.charAt(h++))),a+=String.fromCharCode(n),64!=l&&(a+=String.fromCharCode(i)),64!=r&&(a+=String.fromCharCode(o));return e||(a=Base64._utf8_decode(a)),a},_utf8_encode:function(t){t=t.replace(/\r\n/g,"\n");for(var e="",n=0;n<t.length;n++){var i=t.charCodeAt(n);i<128?e+=String.fromCharCode(i):(127<i&&i<2048?e+=String.fromCharCode(i>>6|192):(e+=String.fromCharCode(i>>12|224),e+=String.fromCharCode(i>>6&63|128)),e+=String.fromCharCode(63&i|128))}return e},_utf8_decode:function(t){for(var e="",n=0,i=c1=c2=0;n<t.length;)(i=t.charCodeAt(n))<128?(e+=String.fromCharCode(i),n++):191<i&&i<224?(c2=t.charCodeAt(n+1),e+=String.fromCharCode((31&i)<<6|63&c2),n+=2):(c2=t.charCodeAt(n+1),c3=t.charCodeAt(n+2),e+=String.fromCharCode((15&i)<<12|(63&c2)<<6|63&c3),n+=3);return e}},mxClient={VERSION:"3.9.8",IS_READONLY_BACKSTAGE:"true"==window.urlParams.backstageReadOnly||"1"==window.urlParams.backstageReadOnly,IS_READONLY_FORM:"true"==window.urlParams.isFromWfForm,IS_READONLY_PAGE:"true"==window.urlParams.isFromWfForm||"true"==window.urlParams.backstageReadOnly,IS_FROMAUTO_DIRECT:"true"==window.urlParams.isFromAutodirect||"1"==window.urlParams.isFromAutodirect,cellMaxWidth:0,cellMaxHeight:0,OPEN_FREE_WORKFLOW:!0,IS_FREE_WORKFLOW:"true"==window.urlParams.isFree||"1"==window.urlParams.isFree,IS_FREE_FREEFLOW_NODE:"true"==window.urlParams.isAllowNodeFreeFlow||"1"==window.urlParams.isAllowNodeFreeFlow,FREE_WORKFLOW_ISREADONLY_MODEL:"true"==window.urlParams.isReadOnlyModel||"1"==window.urlParams.isReadOnlyModel,WORKFLOW_REQUEST_ID:window.urlParams.requestid||window.urlParams.requestId||"",FREE_WORKFLOW_ID:window.urlParams.workflowid||window.urlParams.workflowId||"",FREE_WORKFLOW_HAS_FREENODE:"1"==window.urlParams.hasFreeNode||"true"==window.urlParams.hasFreeNode,IS_IE:!!window.ActiveXObject||"ActiveXObject"in window,IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:(!!window.ActiveXObject||"ActiveXObject"in window)&&(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/")&&!(window.ActiveXObject||"ActiveXObject"in window)&&navigator.userAgent.indexOf("Edge/")<0,IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&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.")<0,IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&navigator.userAgent.indexOf("Chrome/")<0&&navigator.userAgent.indexOf("Edge/")<0,IS_IOS:!!navigator.userAgent.match(/(iPad|iPhone|iPod)/g),IS_IPAD:!!navigator.userAgent.match(/(iPad)/g),IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&navigator.userAgent.indexOf("Edge/")<0,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/")&&navigator.userAgent.indexOf("Firefox/1.")<0&&navigator.userAgent.indexOf("Firefox/2.")<0||0<=navigator.userAgent.indexOf("Iceweasel/")&&navigator.userAgent.indexOf("Iceweasel/1.")<0&&navigator.userAgent.indexOf("Iceweasel/2.")<0||0<=navigator.userAgent.indexOf("SeaMonkey/")&&navigator.userAgent.indexOf("SeaMonkey/1.")<0||0<=navigator.userAgent.indexOf("Iceape/")&&navigator.userAgent.indexOf("Iceape/1.")<0,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&&!(0<navigator.appVersion.indexOf("Mac")),IS_LOCAL:document.location.href.indexOf("http://")<0&&document.location.href.indexOf("https://")<0,defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(t,e,n){if(n=n||document,mxClient.IS_IE6)n.write('<link rel="'+t+'" href="'+e+'" charset="UTF-8" type="text/css"/>');else{var i=n.createElement("link");i.setAttribute("rel",t),i.setAttribute("href",e),i.setAttribute("charset","UTF-8"),i.setAttribute("type","text/css"),n.getElementsByTagName("head")[0].appendChild(i)}},loadResources:function(t,e){var n=mxClient.defaultBundles.length;function i(){0==--n&&t()}for(var o=0;o<mxClient.defaultBundles.length;o++)mxResources.add(mxClient.defaultBundles[o],e,i)},include:function(t){document.write('<script src="'+t+'"><\/script>')},dispose:function(){for(var t=0;t<mxEvent.objects.length;t++)null!=mxEvent.objects[t].mxListenerList&&mxEvent.removeAllListeners(mxEvent.objects[t])}};"undefined"==typeof mxLoadResources&&(mxLoadResources=!0),"undefined"==typeof mxForceIncludes&&(mxForceIncludes=!1),"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt"),"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0),"undefined"!=typeof mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".","undefined"!=typeof mxImageBasePath&&0<mxImageBasePath.length?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images","undefined"!=typeof mxLanguage&&null!=mxLanguage?mxClient.language=mxLanguage:mxClient.language=mxClient.IS_IE?navigator.userLanguage:navigator.language,"undefined"!=typeof mxDefaultLanguage&&null!=mxDefaultLanguage?mxClient.defaultLanguage=mxDefaultLanguage:mxClient.defaultLanguage="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 t=document.createElement("style");t.type="text/css",t.styleSheet.cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",document.getElementsByTagName("head")[0].appendChild(t)}():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 t=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,e=document.createElement("table");e.setAttribute("width","100%"),e.setAttribute("height","100%");var n=document.createElement("tbody"),i=document.createElement("tr"),o=document.createElement("td");o.style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("wrap","off"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxClient.IS_NS&&"BackCompat"!=document.compatMode?mxLog.textarea.style.width="99%":mxLog.textarea.style.width="100%",o.appendChild(mxLog.textarea),i.appendChild(o),n.appendChild(i),i=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),i.appendChild(mxLog.td),n.appendChild(i),e.appendChild(n),mxLog.addButton("Info",function(t){mxLog.info()}),mxLog.addButton("DOM",function(t){var e=mxUtils.getInnerHtml(document.body);mxLog.debug(e)}),mxLog.addButton("Trace",function(t){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")}),mxLog.addButton("Copy",function(t){try{mxUtils.copy(mxLog.textarea.value)}catch(t){mxUtils.alert(t)}}),mxLog.addButton("Show",function(t){try{mxUtils.popup(mxLog.textarea.value)}catch(t){mxUtils.alert(t)}}),mxLog.addButton("Clear",function(t){mxLog.textarea.value=""});var s=0,l=0;if(l="number"==typeof window.innerWidth?(s=window.innerHeight,window.innerWidth):(s=document.documentElement.clientHeight||document.body.clientHeight,document.body.clientWidth),mxLog.window=new mxWindow(t,e,Math.max(0,l-320),Math.max(0,s-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&"BackCompat"!=document.compatMode||11==document.documentMode){function r(t,e){mxLog.textarea.style.height=Math.max(0,a.offsetHeight-70)+"px"}var a=mxLog.window.getElement();mxLog.window.addListener(mxEvent.RESIZE_END,r),mxLog.window.addListener(mxEvent.MAXIMIZE,r),mxLog.window.addListener(mxEvent.NORMALIZE,r),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(t,e){var n=document.createElement("button");mxUtils.write(n,t),mxEvent.addListener(n,"click",e),mxLog.td.appendChild(n)},isVisible:function(){return null!=mxLog.window&&mxLog.window.isVisible()},show:function(){mxLog.setVisible(!0)},setVisible:function(t){null==mxLog.window&&mxLog.init(),null!=mxLog.window&&mxLog.window.setVisible(t)},enter:function(t){if(mxLog.TRACE)return mxLog.writeln("Entering "+t),(new Date).getTime()},leave:function(t,e){if(mxLog.TRACE){var n=0!=e?" ("+((new Date).getTime()-e)+" ms)":"";mxLog.writeln("Leaving "+t+n)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var t="",e=0;e<arguments.length;e++)t+=arguments[e],e<arguments.length-1&&(t+=" ");null!=mxLog.textarea?(mxLog.textarea.value=mxLog.textarea.value+t,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+=t},writeln:function(){for(var t="",e=0;e<arguments.length;e++)t+=arguments[e],e<arguments.length-1&&(t+=" ");mxLog.write(t+"\n")}},mxObjectIdentity={FIELD_NAME:"mxObjectId",counter:0,get:function(t){if(null==t)return null;if(null==t[mxObjectIdentity.FIELD_NAME])if("object"==typeof t){var e=mxUtils.getFunctionName(t.constructor);t[mxObjectIdentity.FIELD_NAME]=e+"#"+mxObjectIdentity.counter++}else"function"==typeof t&&(t[mxObjectIdentity.FIELD_NAME]="Function#"+mxObjectIdentity.counter++);return t[mxObjectIdentity.FIELD_NAME]},clear:function(t){"object"!=typeof t&&"function"!=typeof t||delete t[mxObjectIdentity.FIELD_NAME]}};function mxDictionary(){this.clear()}mxDictionary.prototype.map=null,mxDictionary.prototype.clear=function(){this.map={}},mxDictionary.prototype.get=function(t){var e=mxObjectIdentity.get(t);return this.map[e]},mxDictionary.prototype.put=function(t,e){var n=mxObjectIdentity.get(t),i=this.map[n];return this.map[n]=e,i},mxDictionary.prototype.remove=function(t){var e=mxObjectIdentity.get(t),n=this.map[e];return delete this.map[e],n},mxDictionary.prototype.getKeys=function(){var t=[];for(var e in this.map)t.push(e);return t},mxDictionary.prototype.getValues=function(){var t=[];for(var e in this.map)t.push(this.map[e]);return t},mxDictionary.prototype.visit=function(t){for(var e in this.map)t(e,this.map[e])};var mxResources={resources:{},extension:mxResourceExtension,resourcesEncoded:!1,loadDefaultBundle:!0,loadSpecialBundle:!0,isLanguageSupported:function(t){return null==mxClient.languages||0<=mxUtils.indexOf(mxClient.languages,t)},getDefaultBundle:function(t,e){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(e)?t+mxResources.extension:null},getSpecialBundle:function(t,e){if(null==mxClient.languages||!this.isLanguageSupported(e)){var n=e.indexOf("-");0<n&&(e=e.substring(0,n))}return mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(e)&&e!=mxClient.defaultLanguage?t+"_"+e+mxResources.extension:null},add:function(t,e,n){if((e=null!=e?e:null!=mxClient.language?mxClient.language.toLowerCase():mxConstants.NONE)!=mxConstants.NONE){function i(){if(null!=s)if(n)mxUtils.get(s,function(t){mxResources.parse(t.getText()),n()},function(){n()});else try{var t=mxUtils.load(s);t.isReady()&&mxResources.parse(t.getText())}catch(t){}else null!=n&&n()}var o=mxResources.getDefaultBundle(t,e),s=mxResources.getSpecialBundle(t,e);if(null!=o)if(n)mxUtils.get(o,function(t){mxResources.parse(t.getText()),i()},function(){i()});else try{var l=mxUtils.load(o);l.isReady()&&mxResources.parse(l.getText()),i()}catch(t){}else i()}},parse:function(t){if(null!=t)for(var e=t.split("\n"),n=0;n<e.length;n++)if("#"!=e[n].charAt(0)){var i=e[n].indexOf("=");if(0<i){var o=e[n].substring(0,i),s=e[n].length;13==e[n].charCodeAt(s-1)&&s--;var l=e[n].substring(i+1,s);this.resourcesEncoded?(l=l.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[o]=unescape(l)):mxResources.resources[o]=l}}},get:function(t,e,n){var i=mxResources.resources[t];return null==i&&(i=n),null!=i&&null!=e&&(i=mxResources.replacePlaceholders(i,e)),i},replacePlaceholders:function(t,e){for(var n=[],i=null,o=0;o<t.length;o++){var s=t.charAt(o);"{"==s?i="":null!=i&&"}"==s?(0<=(i=parseInt(i)-1)&&i<e.length&&n.push(e[i]),i=null):null!=i?i+=s:n.push(s)}return n.join("")},loadResources:function(t){mxResources.add(mxClient.basePath+"/resources/editor",null,function(){mxResources.add(mxClient.basePath+"/resources/graph",null,t)})}};function mxPoint(t,e){this.x=null!=t?t:0,this.y=null!=e?e:0}function mxRectangle(t,e,n,i){mxPoint.call(this,t,e),this.width=null!=n?n:0,this.height=null!=i?i:0}mxPoint.prototype.x=null,mxPoint.prototype.y=null,mxPoint.prototype.equals=function(t){return null!=t&&t.x==this.x&&t.y==this.y},mxPoint.prototype.clone=function(){return mxUtils.clone(this)},mxRectangle.prototype=new mxPoint,mxRectangle.prototype.constructor=mxRectangle,mxRectangle.prototype.width=null,mxRectangle.prototype.height=null,mxRectangle.prototype.setRect=function(t,e,n,i){this.x=t,this.y=e,this.width=n,this.height=i},mxRectangle.prototype.getCenterX=function(){return this.x+this.width/2},mxRectangle.prototype.getCenterY=function(){return this.y+this.height/2},mxRectangle.prototype.add=function(t){if(null!=t){var e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),i=Math.max(this.x+this.width,t.x+t.width),o=Math.max(this.y+this.height,t.y+t.height);this.x=e,this.y=n,this.width=i-e,this.height=o-n}},mxRectangle.prototype.intersect=function(t){if(null!=t){var e=this.x+this.width,n=t.x+t.width,i=this.y+this.height,o=t.y+t.height;this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.width=Math.min(e,n)-this.x,this.height=Math.min(i,o)-this.y}},mxRectangle.prototype.grow=function(t){this.x-=t,this.y-=t,this.width+=2*t,this.height+=2*t},mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)},mxRectangle.prototype.rotate90=function(){var t=(this.width-this.height)/2;this.x+=t,this.y-=t;var e=this.width;this.width=this.height,this.height=e},mxRectangle.prototype.equals=function(t){return null!=t&&t.x==this.x&&t.y==this.y&&t.width==this.width&&t.height==this.height},mxRectangle.fromRectangle=function(t){return new mxRectangle(t.x,t.y,t.width,t.height)};var mxEffects={animateChanges:function(h,d,u){var p=0,m=function(){for(var t=!1,e=0;e<d.length;e++){var n=d[e];if(n instanceof mxGeometryChange||n instanceof mxTerminalChange||n instanceof mxValueChange||n instanceof mxChildChange||n instanceof mxStyleChange){var i=h.getView().getState(n.cell||n.child,!1);if(null!=i)if(t=!0,n.constructor!=mxGeometryChange||h.model.isEdge(n.cell))mxUtils.setOpacity(i.shape.node,100*p/10);else{var o=h.getView().scale,s=(n.geometry.x-n.previous.x)*o,l=(n.geometry.y-n.previous.y)*o,r=(n.geometry.width-n.previous.width)*o,a=(n.geometry.height-n.previous.height)*o;0==p?(i.x-=s,i.y-=l,i.width-=r,i.height-=a):(i.x+=s/10,i.y+=l/10,i.width+=r/10,i.height+=a/10),h.cellRenderer.redraw(i),mxEffects.cascadeOpacity(h,n.cell,100*p/10)}}}p<10&&t?(p++,window.setTimeout(m,c)):null!=u&&u()},c=30;m()},cascadeOpacity:function(t,e,n){for(var i=t.model.getChildCount(e),o=0;o<i;o++){var s=t.model.getChildAt(e,o),l=t.getView().getState(s);null!=l&&(mxUtils.setOpacity(l.shape.node,n),mxEffects.cascadeOpacity(t,s,n))}var r=t.model.getEdges(e);if(null!=r)for(o=0;o<r.length;o++){var a=t.getView().getState(r[o]);null!=a&&mxUtils.setOpacity(a.shape.node,n)}},fadeOut:function(t,e,n,i,o,s){i=i||40,o=o||30;var l=e||100;if(mxUtils.setOpacity(t,l),s||null==s){var r=function(){l=Math.max(l-i,0),mxUtils.setOpacity(t,l),0<l?window.setTimeout(r,o):(t.style.visibility="hidden",n&&t.parentNode&&t.parentNode.removeChild(t))};window.setTimeout(r,o)}else t.style.visibility="hidden",n&&t.parentNode&&t.parentNode.removeChild(t)}},mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",wdCheckNameCharLength:function(t,e,n){for(var i=0,o=t,s=!0,l=0,r=t.length;l<r;l++)if(t.charCodeAt(l)<=255){if(e<(i+=1)){s=!1,o=t.substring(0,l);break}}else if(e<(i+=3)){s=!1,o=t.substring(0,l);break}return n?{endStr:o,isPassed:s}:s},hideWfOperatorInfo:function(){var t=document.getElementById("wfFrontOperator-container");t&&(t.style.display="none")},removeCursors:function(t){null!=t.style&&(t.style.cursor="");var e=t.childNodes;if(null!=e)for(var n=e.length,i=0;i<n;i+=1)mxUtils.removeCursors(e[i])},getCurrentStyle:mxClient.IS_IE&&(null==document.documentMode||document.documentMode<9)?function(t){return null!=t?t.currentStyle:null}:function(t){return null!=t?window.getComputedStyle(t,""):null},parseCssNumber:function(t){return"thin"==t?t="2":"medium"==t?t="4":"thick"==t&&(t="6"),t=parseFloat(t),isNaN(t)&&(t=0),t},setPrefixedStyle:function(){var i=null;return mxClient.IS_OT?i="O":mxClient.IS_SF||mxClient.IS_GC?i="Webkit":mxClient.IS_MT?i="Moz":mxClient.IS_IE&&9<=document.documentMode&&document.documentMode<10&&(i="ms"),function(t,e,n){t[e]=n,null!=i&&0<e.length&&(t[e=i+e.substring(0,1).toUpperCase()+e.substring(1)]=n)}}(),hasScrollbars:function(t){var e=mxUtils.getCurrentStyle(t);return null!=e&&("scroll"==e.overflow||"auto"==e.overflow)},bind:function(t,e){return function(){return e.apply(t,arguments)}},eval:function(expr){var result=null;if(0<=expr.indexOf("function"))try{eval("var _mxJavaScriptExpression="+expr),result=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(t){mxLog.warn(t.message+" while evaluating "+expr)}else try{result=eval(expr)}catch(t){mxLog.warn(t.message+" while evaluating "+expr)}return result},findNode:function(t,e,n){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var i=t.getAttribute(e);if(null!=i&&i==n)return t}for(t=t.firstChild;null!=t;){var o=mxUtils.findNode(t,e,n);if(null!=o)return o;t=t.nextSibling}return null},getFunctionName:function(t){var e=null;if(null!=t)if(null!=t.name)e=t.name;else if(e=mxUtils.trim(t.toString()),/^function\s/.test(e)){var n=(e=mxUtils.ltrim(e.substring(9))).indexOf("(");0<n&&(e=e.substring(0,n))}return e},indexOf:function(t,e){if(null!=t&&null!=e)for(var n=0;n<t.length;n++)if(t[n]==e)return n;return-1},forEach:function(t,e){if(null!=t&&null!=e)for(var n=0;n<t.length;n++)e(t[n]);return t},remove:function(t,e){var n=null;if("object"==typeof e)for(var i=mxUtils.indexOf(e,t);0<=i;)e.splice(i,1),n=t,i=mxUtils.indexOf(e,t);for(var o in e)e[o]==t&&(delete e[o],n=t);return n},isNode:function(t,e,n,i){return!(null==t||isNaN(t.nodeType)||null!=e&&t.nodeName.toLowerCase()!=e.toLowerCase())&&(null==n||t.getAttribute(n)==i)},isAncestorNode:function(t,e){for(var n=e;null!=n;){if(n==t)return!0;n=n.parentNode}return!1},getChildNodes:function(t,e){e=e||mxConstants.NODETYPE_ELEMENT;for(var n=[],i=t.firstChild;null!=i;)i.nodeType==e&&n.push(i),i=i.nextSibling;return n},importNode:function(t,e,n){if(!mxClient.IS_IE||!(null==document.documentMode||document.documentMode<10))return t.importNode(e,n);switch(e.nodeType){case 1:var i=t.createElement(e.nodeName);if(e.attributes&&0<e.attributes.length){for(var o=0;o<e.attributes.length;o++)i.setAttribute(e.attributes[o].nodeName,e.getAttribute(e.attributes[o].nodeName));if(n&&e.childNodes&&0<e.childNodes.length)for(o=0;o<e.childNodes.length;o++)i.appendChild(mxUtils.importNode(t,e.childNodes[o],n))}return i;case 3:case 4:case 8:return t.createTextNode(e.value)}},createXmlDocument:function(){var t=null;return document.implementation&&document.implementation.createDocument?t=document.implementation.createDocument("","",null):window.ActiveXObject&&(t=new ActiveXObject("Microsoft.XMLDOM")),t},parseXml:window.DOMParser?function(t){var e=null;return window.ActiveXObject||"ActiveXObject"in window?((e=new ActiveXObject("Microsoft.XMLDOM")).async=!1,e.loadXML(t)):e=(new DOMParser).parseFromString(t,"text/xml"),e}:function(t){var e=mxUtils.createXmlDocument();return e.async=!1,e.validateOnParse=!1,e.resolveExternals=!1,e.loadXML(t),e},clearSelection:document.selection?function(){document.selection.empty()}:window.getSelection?function(){window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges()}:function(){},getPrettyXml:function(t,e,n){var i=[];if(null!=t)if(e=e||"  ",n=n||"",t.nodeType==mxConstants.NODETYPE_TEXT){var o=mxUtils.trim(mxUtils.getTextContent(t));0<o.length&&i.push(n+mxUtils.htmlEntities(o)+"\n")}else{i.push(n+"<"+t.nodeName);var s=t.attributes;if(null!=s)for(var l=0;l<s.length;l++){var r=mxUtils.htmlEntities(s[l].value);i.push(" "+s[l].nodeName+'="'+r+'"')}var a=t.firstChild;if(null!=a){for(i.push(">\n");null!=a;)i.push(mxUtils.getPrettyXml(a,e,n+e)),a=a.nextSibling;i.push(n+"</"+t.nodeName+">\n")}else i.push("/>\n")}return i.join("")},removeWhitespace:function(t,e){for(var n=e?t.previousSibling:t.nextSibling;null!=n&&n.nodeType==mxConstants.NODETYPE_TEXT;){var i=e?n.previousSibling:n.nextSibling,o=mxUtils.getTextContent(n);0==mxUtils.trim(o).length&&n.parentNode.removeChild(n),n=i}},htmlEntities:function(t,e){return t=(t=(t=(t=(t=(t=String(t||"")).replace(/&/g,"&amp;")).replace(/"/g,"&quot;")).replace(/\'/g,"&#39;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;"),null!=e&&!e||(t=t.replace(/\n/g,"&#xa;")),t},isVml:function(t){return null!=t&&"urn:schemas-microsoft-com:vml"==t.tagUrn},getXml:function(t,e){var n="";null!=window.XMLSerializer?n=(new XMLSerializer).serializeToString(t):null!=t.xml&&(n=t.xml.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n"));return e=e||"&#xa;",n=n.replace(/\n/g,e)},extractTextWithWhitespace:function(t){var o=["BLOCKQUOTE","DIV","H1","H2","H3","H4","H5","H6","OL","P","PRE","TABLE","UL"],s=[];return function t(e){if(1!=e.length||"BR"!=e[0].nodeName&&"\n"!=e[0].innerHTML)for(var n=0;n<e.length;n++){var i=e[n];"BR"==i.nodeName||"\n"==i.innerHTML||(1==e.length||0==n)&&"DIV"==i.nodeName&&"<br>"==i.innerHTML.toLowerCase()?s.push("\n"):(3===i.nodeType||4===i.nodeType?0<i.nodeValue.length&&s.push(i.nodeValue):8!==i.nodeType&&0<i.childNodes.length&&t(i.childNodes),n<e.length-1&&0<=mxUtils.indexOf(o,e[n+1].nodeName)&&s.push("\n"))}}(t),s.join("")},replaceTrailingNewlines:function(t,e){for(var n="";0<t.length&&"\n"==t.charAt(t.length-1);)t=t.substring(0,t.length-1),n+=e;return t+n},getTextContent:function(t){return mxClient.IS_IE&&void 0!==t.innerText?t.innerText:null!=t?t[void 0===t.textContent?"text":"textContent"]:""},setTextContent:function(t,e){void 0!==t.innerText?t.innerText=e:t[void 0===t.textContent?"text":"textContent"]=e},getInnerHtml:mxClient.IS_IE?function(t){return null!=t?t.innerHTML:""}:function(t){return null==t?"":(new XMLSerializer).serializeToString(t)},getOuterHtml:mxClient.IS_IE?function(t){if(null==t)return"";if(null!=t.outerHTML)return t.outerHTML;var e=[];e.push("<"+t.nodeName);var n=t.attributes;if(null!=n)for(var i=0;i<n.length;i++){var o=n[i].value;null!=o&&0<o.length&&(e.push(" "),e.push(n[i].nodeName),e.push('="'),e.push(o),e.push('"'))}return 0==t.innerHTML.length?e.push("/>"):(e.push(">"),e.push(t.innerHTML),e.push("</"+t.nodeName+">")),e.join("")}:function(t){return null==t?"":(new XMLSerializer).serializeToString(t)},write:function(t,e){var n=t.ownerDocument.createTextNode(e);return null!=t&&t.appendChild(n),n},writeln:function(t,e){var n=t.ownerDocument.createTextNode(e);return null!=t&&(t.appendChild(n),t.appendChild(document.createElement("br"))),n},br:function(t,e){e=e||1;for(var n=null,i=0;i<e;i++)null!=t&&(n=t.ownerDocument.createElement("br"),t.appendChild(n));return n},button:function(t,e,n){var i=(n=null!=n?n:document).createElement("button");return mxUtils.write(i,t),mxEvent.addListener(i,"click",function(t){e(t)}),i},para:function(t,e){var n=document.createElement("p");return mxUtils.write(n,e),null!=t&&t.appendChild(n),n},addTransparentBackgroundFilter:function(t){t.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mxClient.imageBasePath+"/transparent.gif', sizingMethod='scale')"},linkAction:function(t,e,n,i,o){return mxUtils.link(t,e,function(){n.execute(i)},o)},linkInvoke:function(t,e,n,i,o,s){return mxUtils.link(t,e,function(){n[i](o)},s)},link:function(t,e,n,i){var o=document.createElement("span");return o.style.color="blue",o.style.textDecoration="underline",o.style.cursor="pointer",null!=i&&(o.style.paddingLeft=i+"px"),mxEvent.addListener(o,"click",n),mxUtils.write(o,e),null!=t&&t.appendChild(o),o},fit:function(t){var e=parseInt(t.offsetLeft),n=parseInt(t.offsetWidth),i=mxUtils.getDocumentScrollOrigin(t.ownerDocument),o=i.x,s=i.y,l=document.body,r=document.documentElement,a=o+(l.clientWidth||r.clientWidth);a<e+n&&(t.style.left=Math.max(o,a-n)+"px");var h=parseInt(t.offsetTop),d=parseInt(t.offsetHeight),u=s+Math.max(l.clientHeight||0,r.clientHeight);u<h+d&&(t.style.top=Math.max(s,u-d)+"px")},load:function(t){var e=new mxXmlRequest(t,null,"GET",!1);return e.send(),e},get:function(t,e,n,i,o,s){var l=new mxXmlRequest(t,null,"GET");return null!=i&&l.setBinary(i),l.send(e,n,o,s),l},getAll:function(t,i,e){function o(){0==n&&null!=e&&e(),n++}for(var s=t.length,l=[],n=0,r=0;r<t.length;r++)!function(t,n){mxUtils.get(t,function(t){var e=t.getStatus();e<200||299<e?o():(l[n]=t,0==--s&&i(l))},o)}(t[r],r);0==s&&i(l)},post:function(t,e,n,i){return new mxXmlRequest(t,e).send(n,i)},submit:function(t,e,n,i){return new mxXmlRequest(t,e).simulate(n,i)},loadInto:function(t,e,n){mxClient.IS_IE?e.onreadystatechange=function(){4==e.readyState&&n()}:e.addEventListener("load",n,!1),e.load(t)},getValue:function(t,e,n){var i=null!=t?t[e]:null;return null==i&&(i=n),i},getNumber:function(t,e,n){var i=null!=t?t[e]:null;return null==i&&(i=n||0),Number(i)},getColor:function(t,e,n){var i=null!=t?t[e]:null;return null==i?i=n:i==mxConstants.NONE&&(i=null),i},clone:function(t,e,n){n=null!=n&&n;var i=null;if(null!=t&&"function"==typeof t.constructor)for(var o in i=new t.constructor,t)o!=mxObjectIdentity.FIELD_NAME&&(null==e||mxUtils.indexOf(e,o)<0)&&(n||"object"!=typeof t[o]?i[o]=t[o]:i[o]=mxUtils.clone(t[o]));return i},equalPoints:function(t,e){if(null==t&&null!=e||null!=t&&null==e||null!=t&&null!=e&&t.length!=e.length)return!1;if(null!=t&&null!=e)for(var n=0;n<t.length;n++)if(t[n]==e[n]||null!=t[n]&&!t[n].equals(e[n]))return!1;return!0},equalEntries:function(t,e){if(null==t&&null!=e||null!=t&&null==e||null!=t&&null!=e&&t.length!=e.length)return!1;if(null!=t&&null!=e){var n=0;for(var i in e)n++;for(var i in t)if(n--,!(mxUtils.isNaN(t[i])&&mxUtils.isNaN(e[i])||t[i]==e[i]))return!1}return 0==n},removeDuplicates:function(t){for(var e=new mxDictionary,n=[],i=0;i<t.length;i++)e.get(t[i])||(n.push(t[i]),e.put(t[i],!0));return n},isNaN:function(t){return"number"==typeof t&&isNaN(t)},extend:function(t,e){function n(){}n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t},toString:function(t){var e="";for(var n in t)try{if(null==t[n])e+=n+" = [null]\n";else if("function"==typeof t[n])e+=n+" => [Function]\n";else if("object"==typeof t[n]){e+=n+" => ["+mxUtils.getFunctionName(t[n].constructor)+"]\n"}else e+=n+" = "+t[n]+"\n"}catch(t){e+=n+"="+t.message}return e},toRadians:function(t){return Math.PI*t/180},toDegree:function(t){return 180*t/Math.PI},arcToCurves:function(t,e,n,i,o,s,l,r,a){if(r-=t,a-=e,0===n||0===i)return W;var h=l,d=o;n=Math.abs(n),i=Math.abs(i);var u,p=-r/2,m=-a/2,c=Math.cos(d*Math.PI/180),g=Math.sin(d*Math.PI/180),x=c*p+g*m,y=-1*g*p+c*m,f=x*x,v=y*y,C=n*n,E=i*i,w=f/C+v/E;if(1<w)n=Math.sqrt(w)*n,i=Math.sqrt(w)*i,u=0;else{var S=1;s===h&&(S=-1),u=S*Math.sqrt((C*E-C*v-E*f)/(C*v+E*f))}var b=u*n*y/i,T=-1*u*i*x/n,A=c*b-g*T+r/2,L=g*b+c*T+a/2,I=Math.atan2((y-T)/i,(x-b)/n)-Math.atan2(0,1),M=0<=I?I:2*Math.PI+I,R=0<=(I=Math.atan2((-y-T)/i,(-x-b)/n)-Math.atan2((y-T)/i,(x-b)/n))?I:2*Math.PI+I;0==h&&0<R?R-=2*Math.PI:0!=h&&R<0&&(R+=2*Math.PI);for(var P=2*R/Math.PI,O=Math.ceil(P<0?-1*P:P),N=R/O,G=8/3*Math.sin(N/4)*Math.sin(N/4)/Math.sin(N/2),H=c*n,D=c*i,_=g*n,U=g*i,k=Math.cos(M),V=Math.sin(M),F=-G*(H*V+U*k),B=-G*(_*V-D*k),Y=0,z=0,W=[],X=0;X<O;++X){M+=N,Y=H*(k=Math.cos(M))-U*(V=Math.sin(M))+A,z=_*k+D*V+L;var j=-G*(H*V+U*k),Z=-G*(_*V-D*k),K=6*X;W[K]=Number(F+t),W[1+K]=Number(B+e),W[2+K]=Number(Y-j+t),W[3+K]=Number(z-Z+e),W[4+K]=Number(Y+t),W[5+K]=Number(z+e),F=Y+j,B=z+Z}return W},getBoundingBox:function(t,e,n){var i=null;if(null!=t&&null!=e&&0!=e){var o=mxUtils.toRadians(e),s=Math.cos(o),l=Math.sin(o);n=null!=n?n:new mxPoint(t.x+t.width/2,t.y+t.height/2);var r=new mxPoint(t.x,t.y),a=new mxPoint(t.x+t.width,t.y),h=new mxPoint(a.x,t.y+t.height),d=new mxPoint(t.x,h.y);r=mxUtils.getRotatedPoint(r,s,l,n),a=mxUtils.getRotatedPoint(a,s,l,n),h=mxUtils.getRotatedPoint(h,s,l,n),d=mxUtils.getRotatedPoint(d,s,l,n),(i=new mxRectangle(r.x,r.y,0,0)).add(new mxRectangle(a.x,a.y,0,0)),i.add(new mxRectangle(h.x,h.y,0,0)),i.add(new mxRectangle(d.x,d.y,0,0))}return i},getRotatedPoint:function(t,e,n,i){i=null!=i?i:new mxPoint;var o=t.x-i.x,s=t.y-i.y,l=s*e+o*n;return new mxPoint(o*e-s*n+i.x,l+i.y)},getPortConstraints:function(t,e,n,i){var o=mxUtils.getValue(t.style,mxConstants.STYLE_PORT_CONSTRAINT,mxUtils.getValue(e.style,n?mxConstants.STYLE_SOURCE_PORT_CONSTRAINT:mxConstants.STYLE_TARGET_PORT_CONSTRAINT,null));if(null==o)return i;var s=o.toString(),l=mxConstants.DIRECTION_MASK_NONE,r=0;1==mxUtils.getValue(t.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0)&&(r=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0));var a=0;if(45<r?(a=1,135<=r&&(a=2)):r<-45&&(a=3,r<=-135&&(a=2)),0<=s.indexOf(mxConstants.DIRECTION_NORTH))switch(a){case 0:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:l|=mxConstants.DIRECTION_MASK_EAST;break;case 2:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:l|=mxConstants.DIRECTION_MASK_WEST}if(0<=s.indexOf(mxConstants.DIRECTION_WEST))switch(a){case 0:l|=mxConstants.DIRECTION_MASK_WEST;break;case 1:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:l|=mxConstants.DIRECTION_MASK_EAST;break;case 3:l|=mxConstants.DIRECTION_MASK_SOUTH}if(0<=s.indexOf(mxConstants.DIRECTION_SOUTH))switch(a){case 0:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:l|=mxConstants.DIRECTION_MASK_WEST;break;case 2:l|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:l|=mxConstants.DIRECTION_MASK_EAST}if(0<=s.indexOf(mxConstants.DIRECTION_EAST))switch(a){case 0:l|=mxConstants.DIRECTION_MASK_EAST;break;case 1:l|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:l|=mxConstants.DIRECTION_MASK_WEST;break;case 3:l|=mxConstants.DIRECTION_MASK_NORTH}return l},reversePortConstraints:function(t){var e=0;return e=(t&mxConstants.DIRECTION_MASK_WEST)<<3,e|=(t&mxConstants.DIRECTION_MASK_NORTH)<<1,e|=(t&mxConstants.DIRECTION_MASK_SOUTH)>>1,e|=(t&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(t,e,n){var i=-1;if(0<t.absolutePoints.length)for(var o=t.absolutePoints[0],s=null,l=1;l<t.absolutePoints.length;l++){var r=t.absolutePoints[l],a=mxUtils.ptSegDistSq(o.x,o.y,r.x,r.y,e,n);(null==s||a<s)&&(s=a,i=l-1),o=r}return i},getDirectedBounds:function(t,e,n,i,o){var s=mxUtils.getValue(n,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);if(i=null!=i?i:mxUtils.getValue(n,mxConstants.STYLE_FLIPH,!1),o=null!=o?o:mxUtils.getValue(n,mxConstants.STYLE_FLIPV,!1),e.x=Math.round(Math.max(0,Math.min(t.width,e.x))),e.y=Math.round(Math.max(0,Math.min(t.height,e.y))),e.width=Math.round(Math.max(0,Math.min(t.width,e.width))),e.height=Math.round(Math.max(0,Math.min(t.height,e.height))),o&&(s==mxConstants.DIRECTION_SOUTH||s==mxConstants.DIRECTION_NORTH)||i&&(s==mxConstants.DIRECTION_EAST||s==mxConstants.DIRECTION_WEST)){var l=e.x;e.x=e.width,e.width=l}if(i&&(s==mxConstants.DIRECTION_SOUTH||s==mxConstants.DIRECTION_NORTH)||o&&(s==mxConstants.DIRECTION_EAST||s==mxConstants.DIRECTION_WEST)){l=e.y;e.y=e.height,e.height=l}var r=mxRectangle.fromRectangle(e);return s==mxConstants.DIRECTION_SOUTH?(r.y=e.x,r.x=e.height,r.width=e.y,r.height=e.width):s==mxConstants.DIRECTION_WEST?(r.y=e.height,r.x=e.width,r.width=e.x,r.height=e.y):s==mxConstants.DIRECTION_NORTH&&(r.y=e.width,r.x=e.y,r.width=e.height,r.height=e.x),new mxRectangle(t.x+r.x,t.y+r.y,t.width-r.width-r.x,t.height-r.height-r.y)},getPerimeterPoint:function(t,e,n){for(var i=null,o=0;o<t.length-1;o++){var s=mxUtils.intersection(t[o].x,t[o].y,t[o+1].x,t[o+1].y,e.x,e.y,n.x,n.y);if(null!=s){var l=n.x-s.x,r=n.y-s.y,a={p:s,distSq:r*r+l*l};null!=a&&(null==i||i.distSq>a.distSq)&&(i=a)}}return null!=i?i.p:null},rectangleIntersectsSegment:function(t,e,n){var i=t.y,o=t.x,s=i+t.height,l=o+t.width,r=e.x,a=n.x;if(e.x>n.x&&(r=n.x,a=e.x),l<a&&(a=l),r<o&&(r=o),a<r)return!1;var h=e.y,d=n.y,u=n.x-e.x;if(1e-7<Math.abs(u)){var p=(n.y-e.y)/u,m=e.y-p*e.x;h=p*r+m,d=p*a+m}if(d<h){var c=d;d=h,h=c}return s<d&&(d=s),h<i&&(h=i),!(d<h)},contains:function(t,e,n){return t.x<=e&&t.x+t.width>=e&&t.y<=n&&t.y+t.height>=n},intersects:function(t,e){var n=t.width,i=t.height,o=e.width,s=e.height;if(o<=0||s<=0||n<=0||i<=0)return!1;var l=t.x,r=t.y,a=e.x,h=e.y;return s+=h,n+=l,i+=r,((o+=a)<a||l<o)&&(s<h||r<s)&&(n<l||a<n)&&(i<r||h<i)},intersectsHotspot:function(t,e,n,i,o,s){if(o=null!=o?o:0,s=null!=s?s:0,0<(i=null!=i?i:1)){var l=t.getCenterX(),r=t.getCenterY(),a=t.width,h=t.height,d=mxUtils.getValue(t.style,mxConstants.STYLE_STARTSIZE)*t.view.scale;0<d&&(mxUtils.getValue(t.style,mxConstants.STYLE_HORIZONTAL,!0)?(r=t.y+d/2,h=d):(l=t.x+d/2,a=d)),a=Math.max(o,a*i),h=Math.max(o,h*i),0<s&&(a=Math.min(a,s),h=Math.min(h,s));var u=new mxRectangle(l-a/2,r-h/2,a,h),p=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0);if(0!=p){var m=Math.cos(-p),c=Math.sin(-p),g=(l=new mxPoint(t.getCenterX(),t.getCenterY()),mxUtils.getRotatedPoint(new mxPoint(e,n),m,c,l));e=g.x,n=g.y}return mxUtils.contains(u,e,n)}return!0},getOffset:function(t,e){for(var n=0,i=0,o=!1,s=t,l=document.body,r=document.documentElement;null!=s&&s!=l&&s!=r&&!o;){var a=mxUtils.getCurrentStyle(s);null!=a&&(o=o||"fixed"==a.position),s=s.parentNode}if(!e&&!o){var h=mxUtils.getDocumentScrollOrigin(t.ownerDocument);n+=h.x,i+=h.y}var d=t.getBoundingClientRect();return null!=d&&(n+=d.left,i+=d.top),new mxPoint(n,i)},getDocumentScrollOrigin:function(t){if(mxClient.IS_QUIRKS)return new mxPoint(t.body.scrollLeft,t.body.scrollTop);var e=t.defaultView||t.parentWindow;return new mxPoint(null!=e&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=e&&void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},getScrollOrigin:function(t,e,n){e=null!=e&&e,n=null==n||n;for(var i=null!=t?t.ownerDocument:document,o=i.body,s=i.documentElement,l=new mxPoint,r=!1;null!=t&&t!=o&&t!=s;){isNaN(t.scrollLeft)||isNaN(t.scrollTop)||(l.x+=t.scrollLeft,l.y+=t.scrollTop);var a=mxUtils.getCurrentStyle(t);null!=a&&(r=r||"fixed"==a.position),t=e?t.parentNode:null}if(!r&&n){var h=mxUtils.getDocumentScrollOrigin(i);l.x+=h.x,l.y+=h.y}return l},convertPoint:function(t,e,n){var i=mxUtils.getScrollOrigin(t,!1),o=mxUtils.getOffset(t);return o.x-=i.x,o.y-=i.y,new mxPoint(e-o.x,n-o.y)},ltrim:function(t,e){return e=e||"\\s",null!=t?t.replace(new RegExp("^["+e+"]+","g"),""):null},rtrim:function(t,e){return e=e||"\\s",null!=t?t.replace(new RegExp("["+e+"]+$","g"),""):null},trim:function(t,e){return mxUtils.ltrim(mxUtils.rtrim(t,e),e)},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)&&("string"!=typeof t||t.toLowerCase().indexOf("0x")<0)},isInteger:function(t){return String(parseInt(t))===String(t)},mod:function(t,e){return(t%e+e)%e},intersection:function(t,e,n,i,o,s,l,r){var a=(r-s)*(n-t)-(l-o)*(i-e),h=((l-o)*(e-s)-(r-s)*(t-o))/a,d=((n-t)*(e-s)-(i-e)*(t-o))/a;return 0<=h&&h<=1&&0<=d&&d<=1?new mxPoint(t+h*(n-t),e+h*(i-e)):null},ptSegDistSq:function(t,e,n,i,o,s){var l,r=(o-=t)*(n-=t)+(s-=e)*(i-=e);l=r<=0?0:(r=(o=n-o)*n+(s=i-s)*i)<=0?0:r*r/(n*n+i*i);var a=o*o+s*s-l;return a<0&&(a=0),a},ptLineDist:function(t,e,n,i,o,s){return Math.abs((i-e)*o-(n-t)*s+n*e-i*t)/Math.sqrt((i-e)*(i-e)+(n-t)*(n-t))},relativeCcw:function(t,e,n,i,o,s){var l=(o-=t)*(i-=e)-(s-=e)*(n-=t);return 0==l&&0<(l=o*n+s*i)&&(l=(o-=n)*n+(s-=i)*i)<0&&(l=0),l<0?-1:0<l?1:0},animateChanges:function(t,e){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(t,e,n){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(t,e,n,i,o,s){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(t,e){mxUtils.isVml(t)?t.style.filter=100<=e?"":"alpha(opacity="+e/5+")":mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?t.style.filter=100<=e?"":"alpha(opacity="+e+")":t.style.opacity=e/100},createImage:function(t){var e=null;return mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?((e=document.createElement(mxClient.VML_PREFIX+":image")).setAttribute("src",t),e.style.borderStyle="none"):((e=document.createElement("img")).setAttribute("src",t),e.setAttribute("border","0")),e},sortCells:function(t,s){s=null==s||s;var l=new mxDictionary;return t.sort(function(t,e){var n=l.get(t);null==n&&(n=mxCellPath.create(t).split(mxCellPath.PATH_SEPARATOR),l.put(t,n));var i=l.get(e);null==i&&(i=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),l.put(e,i));var o=mxCellPath.compare(n,i);return 0==o?0:0<o==s?1:-1}),t},getStylename:function(t){if(null!=t){var e=t.split(";")[0];if(e.indexOf("=")<0)return e}return""},getStylenames:function(t){var e=[];if(null!=t)for(var n=t.split(";"),i=0;i<n.length;i++)n[i].indexOf("=")<0&&e.push(n[i]);return e},indexOfStylename:function(t,e){if(null!=t&&null!=e)for(var n=t.split(";"),i=0,o=0;o<n.length;o++){if(n[o]==e)return i;i+=n[o].length+1}return-1},addStylename:function(t,e){return mxUtils.indexOfStylename(t,e)<0&&(null==t?t="":0<t.length&&";"!=t.charAt(t.length-1)&&(t+=";"),t+=e),t},removeStylename:function(t,e){var n=[];if(null!=t)for(var i=t.split(";"),o=0;o<i.length;o++)i[o]!=e&&n.push(i[o]);return n.join(";")},removeAllStylenames:function(t){var e=[];if(null!=t)for(var n=t.split(";"),i=0;i<n.length;i++)0<=n[i].indexOf("=")&&e.push(n[i]);return e.join(";")},setCellStyles:function(t,e,n,i){if(null!=e&&0<e.length){t.beginUpdate();try{for(var o=0;o<e.length;o++)if(null!=e[o]){var s=mxUtils.setStyle(t.getStyle(e[o]),n,i);t.setStyle(e[o],s)}}finally{t.endUpdate()}}},setStyle:function(t,e,n){var i=null!=n&&(void 0===n.length||0<n.length);if(null==t||0==t.length)i&&(t=e+"="+n+";");else if(t.substring(0,e.length+1)==e+"="){var o=t.indexOf(";");t=i?e+"="+n+(o<0?";":t.substring(o)):o<0||o==t.length-1?"":t.substring(o+1)}else{var s=t.indexOf(";"+e+"=");if(s<0){if(i){var l=";"==t.charAt(t.length-1)?"":";";t=t+l+e+"="+n+";"}}else{o=t.indexOf(";",s+1);t=i?t.substring(0,s+1)+e+"="+n+(o<0?";":t.substring(o)):t.substring(0,s)+(o<0?";":t.substring(o))}}return t},setCellStyleFlags:function(t,e,n,i,o){if(null!=e&&0<e.length){t.beginUpdate();try{for(var s=0;s<e.length;s++)if(null!=e[s]){var l=mxUtils.setStyleFlag(t.getStyle(e[s]),n,i,o);t.setStyle(e[s],l)}}finally{t.endUpdate()}}},setStyleFlag:function(t,e,n,i){if(null==t||0==t.length)t=i||null==i?e+"="+n:e+"=0";else{var o=t.indexOf(e+"=");if(o<0){var s=";"==t.charAt(t.length-1)?"":";";t=i||null==i?t+s+e+"="+n:t+s+e+"=0"}else{var l=t.indexOf(";",o),r="";r=l<0?t.substring(o+e.length+1):t.substring(o+e.length+1,l),r=null==i?parseInt(r)^n:i?parseInt(r)|n:parseInt(r)&~n,t=t.substring(0,o)+e+"="+r+(0<=l?t.substring(l):"")}}return t},getAlignmentAsPoint:function(t,e){var n=0,i=0;return t==mxConstants.ALIGN_CENTER?n=-.5:t==mxConstants.ALIGN_RIGHT&&(n=-1),e==mxConstants.ALIGN_MIDDLE?i=-.5:e==mxConstants.ALIGN_BOTTOM&&(i=-1),new mxPoint(n,i)},getSizeForString:function(t,e,n,i){e=null!=e?e:mxConstants.DEFAULT_FONTSIZE,n=null!=n?n:mxConstants.DEFAULT_FONTFAMILY;var o=document.createElement("div");o.style.fontFamily=n,o.style.fontSize=Math.round(e)+"px",o.style.lineHeight=Math.round(e*mxConstants.LINE_HEIGHT)+"px",o.style.position="absolute",o.style.visibility="hidden",o.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",o.style.zoom="1",null!=i?(o.style.width=i+"px",o.style.whiteSpace="normal"):o.style.whiteSpace="nowrap",o.innerHTML=t,document.body.appendChild(o);var s=new mxRectangle(0,0,o.offsetWidth,o.offsetHeight);return document.body.removeChild(o),s},getViewXml:function(t,e,n,i,o){i=null!=i?i:0,o=null!=o?o:0,e=null!=e?e:1,null==n&&(n=[t.getModel().getRoot()]);var s=t.getView(),l=null,r=s.isEventsEnabled();s.setEventsEnabled(!1);var a=s.drawPane,h=s.overlayPane;t.dialect==mxConstants.DIALECT_SVG?(s.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),s.canvas.appendChild(s.drawPane),s.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(s.drawPane=s.drawPane.cloneNode(!1),s.canvas.appendChild(s.drawPane),s.overlayPane=s.overlayPane.cloneNode(!1)),s.canvas.appendChild(s.overlayPane);var d=s.getTranslate();s.translate=new mxPoint(i,o);var u=new mxTemporaryCellStates(t.getView(),e,n);try{l=(new mxCodec).encode(t.getView())}finally{u.destroy(),s.translate=d,s.canvas.removeChild(s.drawPane),s.canvas.removeChild(s.overlayPane),s.drawPane=a,s.overlayPane=h,s.setEventsEnabled(r)}return l},getScaleForPageCount:function(t,e,n,i){if(t<1)return 1;i=null!=i?i:0;var o=(n=null!=n?n:mxConstants.PAGE_FORMAT_A4_PORTRAIT).width-2*i,s=n.height-2*i,l=e.getGraphBounds().clone(),r=e.getView().getScale();l.width/=r,l.height/=r;var a=l.width,h=a/l.height/(o/s),d=Math.sqrt(t),u=Math.sqrt(h),p=d*u,m=d/u;if(p<1&&t<m){var c=m/t;m=t,p/=c}if(m<1&&t<p){c=p/t;p=t,m/=c}for(var g=Math.ceil(p)*Math.ceil(m),x=0;t<g;){var y=Math.floor(p)/p,f=Math.floor(m)/m;1==y&&(y=Math.floor(p-1)/p),1==f&&(f=Math.floor(m-1)/m);c=1;if(p*=c=f<y?y:f,m*=c,g=Math.ceil(p)*Math.ceil(m),10<++x)break}return.99999*(o*p/a)},show:function(t,e,n,i,o,s){(n=null!=n?n:0,i=null!=i?i:0,null==e)?e=window.open().document:e.open();9==document.documentMode&&e.writeln('\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=9"><![endif]--\x3e');var l=t.getGraphBounds(),r=Math.ceil(n-l.x),a=Math.ceil(i-l.y);if(null==o&&(o=Math.ceil(l.width+n)+Math.ceil(Math.ceil(l.x)-l.x)),null==s&&(s=Math.ceil(l.height+i)+Math.ceil(Math.ceil(l.y)-l.y)),mxClient.IS_IE||11==document.documentMode){for(var h="<html><head>",d=document.getElementsByTagName("base"),u=0;u<d.length;u++)h+=d[u].outerHTML;h+="<style>";for(u=0;u<document.styleSheets.length;u++)try{h+=document.styleSheets[u].cssText}catch(t){}h+='</style></head><body style="margin:0px;">',h+='<div style="position:absolute;overflow:hidden;width:'+o+"px;height:"+s+'px;"><div style="position:relative;left:'+r+"px;top:"+a+'px;">',h+=t.container.innerHTML,h+="</div></div></body><html>",e.writeln(h),e.close()}else{e.writeln("<html><head>");for(d=document.getElementsByTagName("base"),u=0;u<d.length;u++)e.writeln(mxUtils.getOuterHtml(d[u]));var p=document.getElementsByTagName("link");for(u=0;u<p.length;u++)e.writeln(mxUtils.getOuterHtml(p[u]));var m=document.getElementsByTagName("style");for(u=0;u<m.length;u++)e.writeln(mxUtils.getOuterHtml(m[u]));e.writeln('</head><body style="margin:0px;"></body></html>'),e.close();var c=e.createElement("div");c.position="absolute",c.overflow="hidden",c.style.width=o+"px",c.style.height=s+"px";var g=e.createElement("div");g.style.position="absolute",g.style.left=r+"px",g.style.top=a+"px";for(var x=t.container.firstChild,y=null;null!=x;){var f=x.cloneNode(!0);x==t.view.drawPane.ownerSVGElement?(c.appendChild(f),y=f):g.appendChild(f),x=x.nextSibling}e.body.appendChild(c),null!=g.firstChild&&e.body.appendChild(g),null!=y&&(y.style.minWidth="",y.style.minHeight="",y.firstChild.setAttribute("transform","translate("+r+","+a+")"))}return mxUtils.removeCursors(e.body),e},printScreen:function(t){var e=window.open();t.getGraphBounds();mxUtils.show(t,e.document);function n(){e.focus(),e.print(),e.close()}mxClient.IS_GC?e.setTimeout(n,500):n()},popup:function(t,e){if(e){var n=document.createElement("div");n.style.overflow="scroll",n.style.width="636px",n.style.height="460px",(o=document.createElement("pre")).innerHTML=mxUtils.htmlEntities(t,!1).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;"),n.appendChild(o),(i=new mxWindow("Popup Window",n,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight)/2-240,640,480,!1,!0)).setClosable(!0),i.setVisible(!0)}else{var i,o;if(mxClient.IS_NS)(i=window.open()).document.writeln("<pre>"+mxUtils.htmlEntities(t)+"</pre"),i.document.close();else(o=(i=window.open()).document.createElement("pre")).innerHTML=mxUtils.htmlEntities(t,!1).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;"),i.document.body.appendChild(o)}},alert:function(t){alert(t)},prompt:function(t,e){return prompt(t,null!=e?e:"")},confirm:function(t){return confirm(t)},error:function(t,e,n,i){var o=document.createElement("div");o.style.padding="20px";var s=document.createElement("img");s.setAttribute("src",i||mxUtils.errorImage),s.setAttribute("valign","bottom"),s.style.verticalAlign="middle",o.appendChild(s),o.appendChild(document.createTextNode(" ")),o.appendChild(document.createTextNode(" ")),o.appendChild(document.createTextNode(" ")),mxUtils.write(o,t);var l=document.body.clientWidth,r=document.body.clientHeight||document.documentElement.clientHeight,a=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,o,(l-e)/2,r/4,e,null,!1,!0);if(n){mxUtils.br(o);var h=document.createElement("p"),d=document.createElement("button");mxClient.IS_IE?d.style.cssText="float:right":d.setAttribute("style","float:right"),mxEvent.addListener(d,"click",function(t){a.destroy()}),mxUtils.write(d,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),h.appendChild(d),o.appendChild(h),mxUtils.br(o),a.setClosable(!0)}return a.setVisible(!0),a},makeDraggable:function(t,e,n,o,i,s,l,r,a,h){var d=new mxDragSource(t,n);return d.dragOffset=new mxPoint(null!=i?i:0,null!=s?s:mxConstants.TOOLTIP_VERTICAL_OFFSET),d.autoscroll=l,d.setGuidesEnabled(!1),null!=a&&(d.highlightDropTargets=a),null!=h&&(d.getDropTarget=h),d.getGraphForEvent=function(t){return"function"==typeof e?e(t):e},null!=o&&(d.createDragElement=function(){return o.cloneNode(!0)},r&&(d.createPreviewElement=function(t){var e=o.cloneNode(!0),n=parseInt(e.style.width),i=parseInt(e.style.height);return e.style.width=Math.round(n*t.view.scale)+"px",e.style.height=Math.round(i*t.view.scale)+"px",e})),d}},mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_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:.5,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,"true"==window.urlParams.isFromWfForm?window.innerWidth-20:window.innerWidth-266,"true"==window.urlParams.isFromWfForm?window.innerHeight-22:window.innerHeight-170),PAGE_FORMAT_WORKFLOW_PORTRAIT:new mxRectangle(0,0,"true"==window.urlParams.isFromWfForm?window.innerWidth-20:window.innerWidth-266,"true"==window.urlParams.isFromWfForm?window.innerHeight-22:window.innerHeight-170),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_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_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",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_SAME_TOP_AND_BOTTOM:"same_top_bottom",ALIGN_SAME_LEFT_AND_RIGHT:"same_left_right",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(t){this.name=t,this.properties=[];for(var e=1;e<arguments.length;e+=2)null!=arguments[e+1]&&(this.properties[arguments[e]]=arguments[e+1])}function mxMouseEvent(t,e){this.evt=t,this.state=e,this.sourceState=e}function mxEventSource(t){this.setEventSource(t)}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(t){return this.properties[t]},mxEventObject.prototype.isConsumed=function(){return this.consumed},mxEventObject.prototype.consume=function(){this.consumed=!0},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(t){return null!=t&&mxUtils.isAncestorNode(t.node,this.getSource())},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 t=this.getState();return null!=t?t.cell:null},mxMouseEvent.prototype.isPopupTrigger=function(){return mxEvent.isPopupTrigger(this.getEvent())},mxMouseEvent.prototype.isConsumed=function(){return this.consumed},mxMouseEvent.prototype.consume=function(t){(t=null==t||t)&&this.evt.preventDefault&&this.evt.preventDefault(),mxClient.IS_IE&&(this.evt.returnValue=!0),this.consumed=!0},mxEventSource.prototype.eventListeners=null,mxEventSource.prototype.eventsEnabled=!0,mxEventSource.prototype.eventSource=null,mxEventSource.prototype.isEventsEnabled=function(){return this.eventsEnabled},mxEventSource.prototype.setEventsEnabled=function(t){this.eventsEnabled=t},mxEventSource.prototype.getEventSource=function(){return this.eventSource},mxEventSource.prototype.setEventSource=function(t){this.eventSource=t},mxEventSource.prototype.addListener=function(t,e){null==this.eventListeners&&(this.eventListeners=[]),this.eventListeners.push(t),this.eventListeners.push(e)},mxEventSource.prototype.removeListener=function(t){if(null!=this.eventListeners)for(var e=0;e<this.eventListeners.length;)this.eventListeners[e+1]==t?this.eventListeners.splice(e,2):e+=2},mxEventSource.prototype.fireEvent=function(t,e){if(null!=this.eventListeners&&this.isEventsEnabled()){null==t&&(t=new mxEventObject),null==e&&(e=this.getEventSource()),null==e&&(e=this);for(var n=[e,t],i=0;i<this.eventListeners.length;i+=2){var o=this.eventListeners[i];null!=o&&o!=t.getName()||this.eventListeners[i+1].apply(this,n)}}};var mxEvent={objects:[],addListener:function(){function i(t,e,n){null==t.mxListenerList&&(t.mxListenerList=[],mxEvent.objects.push(t));var i={name:e,f:n};t.mxListenerList.push(i)}return window.addEventListener?function(t,e,n){t.addEventListener(e,n,!1),i(t,e,n)}:function(t,e,n){t.attachEvent("on"+e,n),i(t,e,n)}}(),removeListener:function(){function i(t,e,n){if(null!=t.mxListenerList){for(var i=t.mxListenerList.length,o=0;o<i;o++){if(t.mxListenerList[o].f==n){t.mxListenerList.splice(o,1);break}}if(0==t.mxListenerList.length){t.mxListenerList=null;var s=mxUtils.indexOf(mxEvent.objects,t);0<=s&&mxEvent.objects.splice(s,1)}}}return window.removeEventListener?function(t,e,n){t.removeEventListener(e,n,!1),i(t,0,n)}:function(t,e,n){t.detachEvent("on"+e,n),i(t,0,n)}}(),removeAllListeners:function(t){var e=t.mxListenerList;if(null!=e)for(;0<e.length;){var n=e[0];mxEvent.removeListener(t,n.name,n.f)}},addGestureListeners:function(t,e,n,i){!mxClient.IS_POINTER&&mxClient.IS_TOUCH?(null!=e&&mxEvent.addListener(t,"touchstart",e),null!=n&&mxEvent.addListener(t,"touchmove",n),null!=i&&mxEvent.addListener(t,"touchend",i)):(null!=e&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),null!=n&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",n),null!=i&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",i))},removeGestureListeners:function(t,e,n,i){null!=e&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),null!=n&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",n),null!=i&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",i),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=e&&mxEvent.removeListener(t,"touchstart",e),null!=n&&mxEvent.removeListener(t,"touchmove",n),null!=i&&mxEvent.removeListener(t,"touchend",i))},redirectMouseEvents:function(t,n,e,i,o,s,l){function r(t){return"function"==typeof e?e(t):e}mxEvent.addGestureListeners(t,function(t){null!=i?i(t):mxEvent.isConsumed(t)||n.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,r(t)))},function(t){null!=o?o(t):mxEvent.isConsumed(t)||n.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,r(t)))},function(t){null!=s?s(t):mxEvent.isConsumed(t)||n.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t,r(t)))}),mxEvent.addListener(t,"dblclick",function(t){if(null!=l)l(t);else if(!mxEvent.isConsumed(t)){var e=r(t);n.dblClick(t,null!=e?e.cell:null)}})},release:function(t){if(null!=t){mxEvent.removeAllListeners(t);var e=t.childNodes;if(null!=e)for(var n=e.length,i=0;i<n;i+=1)mxEvent.release(e[i])}},addMouseWheelListener:function(n){if(null!=n){function t(t){null==t&&(t=window.event);var e=0;0!=(e=mxClient.IS_FF?-t.detail/2:t.wheelDelta/120)&&n(t,0<e)}if(mxClient.IS_NS&&null==document.documentMode){var e=mxClient.IS_SF||mxClient.IS_GC?"mousewheel":"DOMMouseScroll";mxEvent.addListener(window,e,t)}else mxEvent.addListener(document,"mousewheel",t)}},disableContextMenu:function(t){mxEvent.addListener(t,"contextmenu",function(t){return t.preventDefault&&t.preventDefault(),!1})},getSource:function(t){return null!=t.srcElement?t.srcElement:t.target},isConsumed:function(t){return null!=t.isConsumed&&t.isConsumed},isTouchEvent:function(t){return null!=t.pointerType?"touch"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_TOUCH:null!=t.mozInputSource?5==t.mozInputSource:0==t.type.indexOf("touch")},isPenEvent:function(t){return null!=t.pointerType?"pen"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_PEN:null!=t.mozInputSource?2==t.mozInputSource:0==t.type.indexOf("pen")},isMultiTouchEvent:function(t){return null!=t.type&&0==t.type.indexOf("touch")&&null!=t.touches&&1<t.touches.length},isMouseEvent:function(t){return null!=t.pointerType?"mouse"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE:null!=t.mozInputSource?1==t.mozInputSource:0==t.type.indexOf("mouse")},isLeftMouseButton:function(t){return"buttons"in t&&("mousedown"==t.type||"mousemove"==t.type)?1==t.buttons:"which"in t?1===t.which:1===t.button},isMiddleMouseButton:function(t){return"which"in t?2===t.which:4===t.button},isRightMouseButton:function(t){return"which"in t?3===t.which:2===t.button},isPopupTrigger:function(t){return mxEvent.isRightMouseButton(t)||mxClient.IS_MAC&&mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)&&!mxEvent.isMetaDown(t)&&!mxEvent.isAltDown(t)},isShiftDown:function(t){return null!=t&&t.shiftKey},isAltDown:function(t){return null!=t&&t.altKey},isControlDown:function(t){return null!=t&&t.ctrlKey},isMetaDown:function(t){return null!=t&&t.metaKey},getMainEvent:function(t){return"touchstart"!=t.type&&"touchmove"!=t.type||null==t.touches||null==t.touches[0]?"touchend"==t.type&&null!=t.changedTouches&&null!=t.changedTouches[0]&&(t=t.changedTouches[0]):t=t.touches[0],t},getClientX:function(t){return mxEvent.getMainEvent(t).clientX},getClientY:function(t){return mxEvent.getMainEvent(t).clientY},consume:function(t,e,n){n=null==n||n,(e=null==e||e)&&(t.preventDefault?(n&&t.stopPropagation(),t.preventDefault()):n&&(t.cancelBubble=!0)),t.isConsumed=!0,t.preventDefault||(t.returnValue=!1)},trace:function(t){var e=arguments.callee.caller,n=0;for(t=t||10;e&&n<t;)alert(e.toString()),e=e.caller,n++},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",DOUBLE_CLICK:"doubleClick",START:"start",RESET:"reset"};function mxXmlRequest(t,e,n,i,o,s){this.url=t,this.params=e,this.method=n||"POST",this.async=null==i||i,this.username=o,this.password=s}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(t){this.binary=t},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.isReady=function(){return 4==this.request.readyState},mxXmlRequest.prototype.getDocumentElement=function(){var t=this.getXml();return null!=t?t.documentElement:null},mxXmlRequest.prototype.getXml=function(){var t=this.request.responseXML;return(9<=document.documentMode||null==t||null==t.documentElement)&&(t=mxUtils.parseXml(this.request.responseText)),t},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.getStatus=function(){return this.request.status},mxXmlRequest.prototype.create=window.XMLHttpRequest?function(){var t=new XMLHttpRequest;return this.isBinary()&&t.overrideMimeType&&t.overrideMimeType("text/plain; charset=x-user-defined"),t}:"undefined"!=typeof ActiveXObject?function(){return new ActiveXObject("Microsoft.XMLHTTP")}:void 0,mxXmlRequest.prototype.send=function(t,e,n,i){this.request=this.create(),null!=this.request&&(null!=t&&(this.request.onreadystatechange=mxUtils.bind(this,function(){this.isReady()&&(t(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"),!mxClient.IS_QUIRKS&&(null==document.documentMode||9<document.documentMode)&&window.XMLHttpRequest&&null!=n&&null!=i&&(this.request.timeout=n,this.request.ontimeout=i),this.request.send(this.params))},mxXmlRequest.prototype.setRequestHeaders=function(t,e){null!=e&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8")},mxXmlRequest.prototype.simulate=function(t,e){var n=null;(t=t||document)==document&&(n=window.onbeforeunload,window.onbeforeunload=null);var i=t.createElement("form");i.setAttribute("method",this.method),i.setAttribute("action",this.url),null!=e&&i.setAttribute("target",e),i.style.display="none",i.style.visibility="hidden";for(var o=0<this.params.indexOf("&")?this.params.split("&"):this.params.split(),s=0;s<o.length;s++){var l=o[s].indexOf("=");if(0<l){var r=o[s].substring(0,l),a=o[s].substring(l+1);this.decodeSimulateValues&&(a=decodeURIComponent(a));var h=t.createElement("textarea");h.setAttribute("wrap","off"),h.setAttribute("name",r),mxUtils.write(h,a),i.appendChild(h)}}t.body.appendChild(i),i.submit(),null!=i.parentNode&&i.parentNode.removeChild(i),null!=n&&(window.onbeforeunload=n)};var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,setCells:function(t){mxClipboard.cells=t},getCells:function(){return mxClipboard.cells},isEmpty:function(){return null==mxClipboard.getCells()},cut:function(t,e){return e=mxClipboard.copy(t,e),mxClipboard.insertCount=0,mxClipboard.removeCells(t,e),e},removeCells:function(t,e){t.removeCells(e)},copy:function(t,e){e=e||t.getSelectionCells();var n=t.getExportableCells(t.model.getTopmostCells(e));return mxClipboard.insertCount=1,mxClipboard.setCells(t.cloneCells(n)),n},paste:function(t){var e=null;if(!mxClipboard.isEmpty()){e=t.getImportableCells(mxClipboard.getCells());for(var n,i=!1,o=0;o<e.length;++o)0==e[o].nodeType&&(i=!0,n=o),e[o].nodeId&&(e[o].nodeId=""),e[o].linkId&&(e[o].linkId="");i&&(wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390412,"只能有一个创建节点!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}}),e.splice(n,1));var s=mxClipboard.insertCount*mxClipboard.STEPSIZE,l=t.getDefaultParent();e=t.importCells(e,s,s,l),mxClipboard.insertCount++,t.setSelectionCells(e)}return e}};function mxWindow(t,e,n,i,o,s,l,r,a,h){null!=e&&(l=null==l||l,this.content=e,this.init(n,i,o,s,h),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(l),this.setTitle(t),null!=r&&!r||this.installMoveHandler(),null!=a&&null!=a.parentNode?a.parentNode.replaceChild(this.div,a):document.body.appendChild(this.div))}function mxForm(t){this.table=document.createElement("table"),this.table.className=t,this.body=document.createElement("tbody"),this.table.appendChild(this.body)}function mxImage(t,e,n){this.src=t,this.width=e,this.height=n}function mxDivResizer(t,e){if("div"==t.nodeName.toLowerCase()){null==e&&(e=window),this.div=t;var n=mxUtils.getCurrentStyle(t);null!=n&&(this.resizeWidth="auto"==n.width,this.resizeHeight="auto"==n.height),mxEvent.addListener(e,"resize",mxUtils.bind(this,function(t){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)})),this.resize()}}function mxDragSource(t,e){this.element=t,this.dropHandler=e,mxEvent.addGestureListeners(t,mxUtils.bind(this,function(t){this.mouseDown(t)})),mxEvent.addListener(t,"dragstart",function(t){mxEvent.consume(t)}),this.eventConsumer=function(t,e){var n=e.getProperty("eventName"),i=e.getProperty("event");n!=mxEvent.MOUSE_DOWN&&i.consume()}}function mxToolbar(t){this.container=t}function mxUndoableEdit(t,e){this.source=t,this.changes=[],this.significant=null==e||e}function mxUndoManager(t){this.size=null!=t?t:100,this.clear()}mxWindow.prototype=new mxEventSource,mxWindow.prototype.constructor=mxWindow,mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif",mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif",mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif",mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif",mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif",mxWindow.prototype.visible=!1,mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40),mxWindow.prototype.destroyOnClose=!0,mxWindow.prototype.contentHeightCorrection=8==document.documentMode||7==document.documentMode?6:2,mxWindow.prototype.title=null,mxWindow.prototype.content=null,mxWindow.prototype.init=function(t,e,n,i,o){o=null!=o?o:"mxWindow",this.div=document.createElement("div"),this.div.className=o,this.div.style.left=t+"px",this.div.style.top=e+"px",this.table=document.createElement("table"),this.table.className=o,mxClient.IS_POINTER&&(this.div.style.touchAction="none"),null!=n&&(mxClient.IS_QUIRKS||(this.div.style.width=n+"px"),this.table.style.width=n+"px"),null!=i&&(mxClient.IS_QUIRKS||(this.div.style.height=i+"px"),this.table.style.height=i+"px");var s=document.createElement("tbody"),l=document.createElement("tr");this.title=document.createElement("td"),this.title.className=o+"Title",this.buttons=document.createElement("div"),this.buttons.style.position="absolute",this.buttons.style.display="inline-block",this.buttons.style.right="4px",this.buttons.style.top="5px",this.title.appendChild(this.buttons),l.appendChild(this.title),s.appendChild(l),l=document.createElement("tr"),this.td=document.createElement("td"),this.td.className=o+"Pane",7==document.documentMode&&(this.td.style.height="100%"),this.contentWrapper=document.createElement("div"),this.contentWrapper.className=o+"Pane",this.contentWrapper.style.width="100%",this.contentWrapper.appendChild(this.content),!mxClient.IS_QUIRKS&&"DIV"==this.content.nodeName.toUpperCase()||(this.contentWrapper.style.height="100%"),this.td.appendChild(this.contentWrapper),l.appendChild(this.td),s.appendChild(l),this.table.appendChild(s),this.div.appendChild(this.table);var r=mxUtils.bind(this,function(t){this.activate()});mxEvent.addGestureListeners(this.title,r),mxEvent.addGestureListeners(this.table,r),this.hide()},mxWindow.prototype.setTitle=function(t){for(var e=this.title.firstChild;null!=e;){var n=e.nextSibling;e.nodeType==mxConstants.NODETYPE_TEXT&&e.parentNode.removeChild(e),e=n}mxUtils.write(this.title,t||""),this.title.appendChild(this.buttons)},mxWindow.prototype.setScrollable=function(t){navigator.userAgent.indexOf("Presto/2.5")<0&&(this.contentWrapper.style.overflow=t?"auto":"hidden")},mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var t=mxUtils.getCurrentStyle(this.getElement()),e=null!=t?t.zIndex:3;if(mxWindow.activeWindow){var n=mxWindow.activeWindow.getElement();null!=n&&null!=n.style&&(n.style.zIndex=e)}var i=mxWindow.activeWindow;this.getElement().style.zIndex=parseInt(e)+1,(mxWindow.activeWindow=this).fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",i))}},mxWindow.prototype.getElement=function(){return this.div},mxWindow.prototype.fit=function(){mxUtils.fit(this.div)},mxWindow.prototype.isResizable=function(){return null!=this.resize&&"none"!=this.resize.style.display},mxWindow.prototype.setResizable=function(t){if(t)if(null==this.resize){this.resize=document.createElement("img"),this.resize.style.position="absolute",this.resize.style.bottom="2px",this.resize.style.right="2px",this.resize.setAttribute("src",this.resizeImage),this.resize.style.cursor="nw-resize";var i=null,o=null,s=null,l=null,e=mxUtils.bind(this,function(t){this.activate(),i=mxEvent.getClientX(t),o=mxEvent.getClientY(t),s=this.div.offsetWidth,l=this.div.offsetHeight,mxEvent.addGestureListeners(document,null,n,r),this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",t)),mxEvent.consume(t)}),n=mxUtils.bind(this,function(t){if(null!=i&&null!=o){var e=mxEvent.getClientX(t)-i,n=mxEvent.getClientY(t)-o;this.setSize(s+e,l+n),this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",t)),mxEvent.consume(t)}}),r=mxUtils.bind(this,function(t){null!=i&&null!=o&&(o=i=null,mxEvent.removeGestureListeners(document,null,n,r),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",t)),mxEvent.consume(t))});mxEvent.addGestureListeners(this.resize,e,n,r),this.div.appendChild(this.resize)}else this.resize.style.display="inline";else null!=this.resize&&(this.resize.style.display="none")},mxWindow.prototype.setSize=function(t,e){t=Math.max(this.minimumSize.width,t),e=Math.max(this.minimumSize.height,e),mxClient.IS_QUIRKS||(this.div.style.width=t+"px",this.div.style.height=e+"px"),this.table.style.width=t+"px",this.table.style.height=e+"px",mxClient.IS_QUIRKS||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px")},mxWindow.prototype.setMinimizable=function(t){this.minimize.style.display=t?"":"none"},mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)},mxWindow.prototype.installMinimizeHandler=function(){this.minimize=document.createElement("img"),this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.minimize.style.cursor="pointer",this.minimize.style.marginLeft="2px",this.minimize.style.display="none",this.buttons.appendChild(this.minimize);var n=!1,i=null,o=null,t=mxUtils.bind(this,function(t){if(this.activate(),n)n=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=i,mxClient.IS_QUIRKS||(this.div.style.height=o),this.table.style.height=o,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",t));else{n=!0,this.minimize.setAttribute("src",this.normalizeImage),this.minimize.setAttribute("title","Normalize"),this.contentWrapper.style.display="none",i=this.maximize.style.display,this.maximize.style.display="none",o=this.table.style.height;var e=this.getMinimumSize();0<e.height&&(mxClient.IS_QUIRKS||(this.div.style.height=e.height+"px"),this.table.style.height=e.height+"px"),0<e.width&&(mxClient.IS_QUIRKS||(this.div.style.width=e.width+"px"),this.table.style.width=e.width+"px"),null!=this.resize&&(this.resize.style.visibility="hidden"),this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",t))}mxEvent.consume(t)});mxEvent.addGestureListeners(this.minimize,t)},mxWindow.prototype.setMaximizable=function(t){this.maximize.style.display=t?"":"none"},mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img"),this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.maximize.style.cursor="default",this.maximize.style.marginLeft="2px",this.maximize.style.cursor="pointer",this.maximize.style.display="none",this.buttons.appendChild(this.maximize);var n=!1,i=null,o=null,s=null,l=null,r=null,t=mxUtils.bind(this,function(t){if(this.activate(),"none"!=this.maximize.style.display){if(n){if(n=!1,this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.contentWrapper.style.display="",this.minimize.style.display=r,this.div.style.left=i+"px",this.div.style.top=o+"px",!mxClient.IS_QUIRKS)this.div.style.height=s,this.div.style.width=l,"auto"!=mxUtils.getCurrentStyle(this.contentWrapper).overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px");this.table.style.height=s,this.table.style.width=l,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",t))}else{n=!0,this.maximize.setAttribute("src",this.normalizeImage),this.maximize.setAttribute("title","Normalize"),this.contentWrapper.style.display="",r=this.minimize.style.display,this.minimize.style.display="none",i=parseInt(this.div.style.left),o=parseInt(this.div.style.top),s=this.table.style.height,l=this.table.style.width,this.div.style.left="0px",this.div.style.top="0px";var e=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0);if(mxClient.IS_QUIRKS||(this.div.style.width=document.body.clientWidth-2+"px",this.div.style.height=e-2+"px"),this.table.style.width=document.body.clientWidth-2+"px",this.table.style.height=e-2+"px",null!=this.resize&&(this.resize.style.visibility="hidden"),!mxClient.IS_QUIRKS)"auto"!=mxUtils.getCurrentStyle(this.contentWrapper).overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px");this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",t))}mxEvent.consume(t)}});mxEvent.addGestureListeners(this.maximize,t),mxEvent.addListener(this.title,"dblclick",t)},mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move",mxEvent.addGestureListeners(this.title,mxUtils.bind(this,function(t){var i=mxEvent.getClientX(t),o=mxEvent.getClientY(t),s=this.getX(),l=this.getY(),e=mxUtils.bind(this,function(t){var e=mxEvent.getClientX(t)-i,n=mxEvent.getClientY(t)-o;this.setLocation(s+e,l+n),this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",t)),mxEvent.consume(t)}),n=mxUtils.bind(this,function(t){mxEvent.removeGestureListeners(document,null,e,n),this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",t)),mxEvent.consume(t)});mxEvent.addGestureListeners(document,null,e,n),this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",t)),mxEvent.consume(t)})),mxClient.IS_POINTER&&(this.title.style.touchAction="none")},mxWindow.prototype.setLocation=function(t,e){this.div.style.left=t+"px",this.div.style.top=e+"px"},mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)},mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)},mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img"),this.closeImg.setAttribute("src",this.closeImage),this.closeImg.setAttribute("title","Close"),this.closeImg.style.marginLeft="2px",this.closeImg.style.cursor="pointer",this.closeImg.style.display="none",this.buttons.appendChild(this.closeImg),mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,function(t){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",t)),this.destroyOnClose?this.destroy():this.setVisible(!1),mxEvent.consume(t)}))},mxWindow.prototype.setImage=function(t){this.image=document.createElement("img"),this.image.setAttribute("src",t),this.image.setAttribute("align","left"),this.image.style.marginRight="4px",this.image.style.marginLeft="0px",this.image.style.marginTop="-2px",this.title.insertBefore(this.image,this.title.firstChild)},mxWindow.prototype.setClosable=function(t){this.closeImg.style.display=t?"":"none"},mxWindow.prototype.isVisible=function(){return null!=this.div&&"none"!=this.div.style.display},mxWindow.prototype.setVisible=function(t){null!=this.div&&this.isVisible()!=t&&(t?this.show():this.hide())},mxWindow.prototype.show=function(){this.div.style.display="",this.activate();var t=mxUtils.getCurrentStyle(this.contentWrapper);mxClient.IS_QUIRKS||"auto"!=t.overflow&&null==this.resize||"none"==this.contentWrapper.style.display||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"),this.fireEvent(new mxEventObject(mxEvent.SHOW))},mxWindow.prototype.hide=function(){this.div.style.display="none",this.fireEvent(new mxEventObject(mxEvent.HIDE))},mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY)),null!=this.div&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null),this.title=null,this.content=null,this.contentWrapper=null},mxForm.prototype.table=null,mxForm.prototype.body=!1,mxForm.prototype.getTable=function(){return this.table},mxForm.prototype.addButtons=function(t,e){var n=document.createElement("tr"),i=document.createElement("td");n.appendChild(i),i=document.createElement("td");var o=document.createElement("button");mxUtils.write(o,mxResources.get("ok")||"OK"),i.appendChild(o),mxEvent.addListener(o,"click",function(){t()}),o=document.createElement("button"),mxUtils.write(o,mxResources.get("cancel")||"Cancel"),i.appendChild(o),mxEvent.addListener(o,"click",function(){e()}),n.appendChild(i),this.body.appendChild(n)},mxForm.prototype.addText=function(t,e,n){var i=document.createElement("input");return i.setAttribute("type",n||"text"),i.value=e,this.addField(t,i)},mxForm.prototype.addCheckbox=function(t,e){var n=document.createElement("input");return n.setAttribute("type","checkbox"),this.addField(t,n),e&&(n.checked=!0),n},mxForm.prototype.addTextarea=function(t,e,n){var i=document.createElement("textarea");return mxClient.IS_NS&&n--,i.setAttribute("rows",n||2),i.value=e,this.addField(t,i)},mxForm.prototype.addCombo=function(t,e,n){var i=document.createElement("select");return null!=n&&i.setAttribute("size",n),e&&i.setAttribute("multiple","true"),this.addField(t,i)},mxForm.prototype.addOption=function(t,e,n,i){var o=document.createElement("option");mxUtils.writeln(o,e),o.setAttribute("value",n),i&&o.setAttribute("selected",i),t.appendChild(o)},mxForm.prototype.addField=function(t,e){var n=document.createElement("tr"),i=document.createElement("td");return mxUtils.write(i,t),n.appendChild(i),(i=document.createElement("td")).appendChild(e),n.appendChild(i),this.body.appendChild(n),e},mxImage.prototype.src=null,mxImage.prototype.width=null,mxImage.prototype.height=null,mxDivResizer.prototype.resizeWidth=!0,mxDivResizer.prototype.resizeHeight=!0,mxDivResizer.prototype.handlingResize=!1,mxDivResizer.prototype.resize=function(){var t=this.getDocumentWidth(),e=this.getDocumentHeight(),n=parseInt(this.div.style.left),i=parseInt(this.div.style.right),o=parseInt(this.div.style.top),s=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(n)&&!isNaN(i)&&0<=n&&0<=i&&0<t-i-n&&(this.div.style.width=t-i-n+"px"),this.resizeHeight&&!isNaN(o)&&!isNaN(s)&&0<=o&&0<=s&&0<e-o-s&&(this.div.style.height=e-o-s+"px")},mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth},mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight},mxDragSource.prototype.element=null,mxDragSource.prototype.dropHandler=null,mxDragSource.prototype.dragOffset=null,mxDragSource.prototype.dragElement=null,mxDragSource.prototype.previewElement=null,mxDragSource.prototype.enabled=!0,mxDragSource.prototype.currentGraph=null,mxDragSource.prototype.currentDropTarget=null,mxDragSource.prototype.currentPoint=null,mxDragSource.prototype.currentGuide=null,mxDragSource.prototype.currentHighlight=null,mxDragSource.prototype.autoscroll=!0,mxDragSource.prototype.guidesEnabled=!0,mxDragSource.prototype.gridEnabled=!0,mxDragSource.prototype.highlightDropTargets=!0,mxDragSource.prototype.dragElementZIndex=100,mxDragSource.prototype.dragElementOpacity=70,mxDragSource.prototype.checkEventSource=!0,mxDragSource.prototype.isEnabled=function(){return this.enabled},mxDragSource.prototype.setEnabled=function(t){this.enabled=t},mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled},mxDragSource.prototype.setGuidesEnabled=function(t){this.guidesEnabled=t},mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled},mxDragSource.prototype.setGridEnabled=function(t){this.gridEnabled=t},mxDragSource.prototype.getGraphForEvent=function(t){return null},mxDragSource.prototype.getDropTarget=function(t,e,n,i){return t.getCellAt(e,n)},mxDragSource.prototype.createDragElement=function(t){return this.element.cloneNode(!0)},mxDragSource.prototype.createPreviewElement=function(t){return null},mxDragSource.prototype.isActive=function(){return null!=this.mouseMoveHandler},mxDragSource.prototype.reset=function(){null!=this.currentGraph&&(this.dragExit(this.currentGraph),this.currentGraph=null),this.removeDragElement(),this.removeListeners(),this.stopDrag()},mxDragSource.prototype.mouseDown=function(t){for(var e=workflowUi.editor.graph,n=e.view.scale,i=e.minimumGraphSize.x||0,o=e.minimumGraphSize.y||0,s=e.minimumGraphSize.width*n||1e5,l=e.minimumGraphSize.height*n||1e5,r=e.getAllCells(i,o,s,l),a=!0,h=0,d=r.length;h<d;++h)null!=t.currentTarget&&-1!=t.currentTarget.className.indexOf("chuangjian")&&0==r[h].nodeType&&(a=!1);a?this.enabled&&!mxEvent.isConsumed(t)&&null==this.mouseMoveHandler&&(this.startDrag(t),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),mxClient.IS_TOUCH&&!mxEvent.isMouseEvent(t)&&(this.eventSource=mxEvent.getSource(t),mxEvent.addGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler))):wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390412,"只能有一个创建节点!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}})},mxDragSource.prototype.startDrag=function(t){this.dragElement=this.createDragElement(t),this.dragElement.style.position="absolute",this.dragElement.style.zIndex=this.dragElementZIndex,mxUtils.setOpacity(this.dragElement,this.dragElementOpacity),this.checkEventSource&&mxClient.IS_SVG&&(this.dragElement.style.pointerEvents="none")},mxDragSource.prototype.stopDrag=function(){this.removeDragElement()},mxDragSource.prototype.removeDragElement=function(){null!=this.dragElement&&(null!=this.dragElement.parentNode&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)},mxDragSource.prototype.getElementForEvent=function(t){return mxEvent.isTouchEvent(t)||mxEvent.isPenEvent(t)?document.elementFromPoint(mxEvent.getClientX(t),mxEvent.getClientY(t)):mxEvent.getSource(t)},mxDragSource.prototype.graphContainsEvent=function(t,e){var n=mxEvent.getClientX(e),i=mxEvent.getClientY(e),o=mxUtils.getOffset(t.container),s=mxUtils.getScrollOrigin(),l=this.getElementForEvent(e);if(this.checkEventSource)for(;null!=l&&l!=t.container;)l=l.parentNode;return null!=l&&n>=o.x-s.x&&i>=o.y-s.y&&n<=o.x-s.x+t.container.offsetWidth&&i<=o.y-s.y+t.container.offsetHeight},mxDragSource.prototype.mouseMove=function(t){var e=this.getGraphForEvent(t);if(null==e||this.graphContainsEvent(e,t)||(e=null),e!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph,t),this.currentGraph=e,null!=this.currentGraph&&this.dragEnter(this.currentGraph,t)),null!=this.currentGraph&&this.dragOver(this.currentGraph,t),null==this.dragElement||null!=this.previewElement&&"visible"==this.previewElement.style.visibility)null!=this.dragElement&&(this.dragElement.style.visibility="hidden");else{var n=mxEvent.getClientX(t),i=mxEvent.getClientY(t);null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement),this.dragElement.style.visibility="visible",null!=this.dragOffset&&(n+=this.dragOffset.x,i+=this.dragOffset.y);var o=mxUtils.getDocumentScrollOrigin(document);this.dragElement.style.left=n+o.x+"px",this.dragElement.style.top=i+o.y+"px"}mxEvent.consume(t)},mxDragSource.prototype.mouseUp=function(t){if(null!=this.currentGraph){if(null!=this.currentPoint&&(null==this.previewElement||"hidden"!=this.previewElement.style.visibility)){var e=this.currentGraph.view.scale,n=this.currentGraph.view.translate,i=this.currentPoint.x/e-n.x,o=this.currentPoint.y/e-n.y;this.drop(this.currentGraph,t,this.currentDropTarget,i,o)}this.dragExit(this.currentGraph),this.currentGraph=null}this.stopDrag(),this.removeListeners(),mxEvent.consume(t)},mxDragSource.prototype.removeListeners=function(){null!=this.eventSource&&(mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler),this.eventSource=null),mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),this.mouseMoveHandler=null,this.mouseUpHandler=null},mxDragSource.prototype.dragEnter=function(t,e){t.isMouseDown=!0,t.isMouseTrigger=mxEvent.isMouseEvent(e),this.previewElement=this.createPreviewElement(t),null!=this.previewElement&&this.checkEventSource&&mxClient.IS_SVG&&(this.previewElement.style.pointerEvents="none"),this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(t,t.graphHandler.getGuideStates())),this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(t,mxConstants.DROP_TARGET_COLOR)),t.addListener(mxEvent.FIRE_MOUSE_EVENT,this.eventConsumer)},mxDragSource.prototype.dragExit=function(t,e){this.currentDropTarget=null,this.currentPoint=null,t.isMouseDown=!1,t.removeListener(this.eventConsumer),null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null),null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null),null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)},mxDragSource.prototype.dragOver=function(t,e){var n=mxUtils.getOffset(t.container),i=mxUtils.getScrollOrigin(t.container),o=mxEvent.getClientX(e)-n.x+i.x-t.panDx,s=mxEvent.getClientY(e)-n.y+i.y-t.panDy;if(t.autoScroll&&(null==this.autoscroll||this.autoscroll)&&t.scrollPointToVisible(o,s,t.autoExtend),null!=this.currentHighlight&&t.isDropEnabled(),null!=this.previewElement){null==this.previewElement.parentNode&&(t.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");var l=this.isGridEnabled()&&t.isGridEnabledEvent(e),r=!0;if(null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(e)){var a=new mxRectangle(0,0,parseInt(this.previewElement.style.width),parseInt(this.previewElement.style.height)),h=new mxPoint(o,s);r=!1,o=(h=this.currentGuide.move(a,h,l)).x,s=h.y}else if(l){var d=t.view.scale,u=t.view.translate,p=t.gridSize/2;o=(t.snap(o/d-u.x-p)+u.x)*d,s=(t.snap(s/d-u.y-p)+u.y)*d}null!=this.currentGuide&&r&&this.currentGuide.hide(),null!=this.previewOffset&&(o+=this.previewOffset.x,s+=this.previewOffset.y),this.previewElement.style.left=Math.round(o)+"px",this.previewElement.style.top=Math.round(s)+"px",this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(o,s)},mxDragSource.prototype.drop=function(t,e,n,i,o){this.dropHandler.apply(this,arguments),"hidden"!=t.container.style.visibility&&t.container.focus()},mxToolbar.prototype=new mxEventSource,mxToolbar.prototype.constructor=mxToolbar,mxToolbar.prototype.container=null,mxToolbar.prototype.enabled=!0,mxToolbar.prototype.noReset=!1,mxToolbar.prototype.updateDefaultMode=!0,mxToolbar.prototype.addItem=function(t,e,n,i,o,s){var l=document.createElement(null!=e?"img":"button"),r=o||(null!=s?"mxToolbarMode":"mxToolbarItem");l.className=r,l.setAttribute("src",e),null!=t&&(null!=e?l.setAttribute("title",t):mxUtils.write(l,t)),this.container.appendChild(l),null!=n&&(mxEvent.addListener(l,"click",n),mxClient.IS_TOUCH&&mxEvent.addListener(l,"touchend",n));var a=mxUtils.bind(this,function(t){null!=i?l.setAttribute("src",e):l.style.backgroundColor=""});return mxEvent.addGestureListeners(l,mxUtils.bind(this,function(t){if(null!=i?l.setAttribute("src",i):l.style.backgroundColor="gray",null!=s){null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init());var e=this.currentImg;if(this.menu.isMenuShowing()&&this.menu.hideMenu(),e!=l){this.currentImg=l,this.menu.factoryMethod=s;var n=new mxPoint(l.offsetLeft,l.offsetTop+l.offsetHeight);this.menu.popup(n.x,n.y,null,t),this.menu.isMenuShowing()&&(l.className=r+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this),l.className=r,this.currentImg=null})}}}),null,a),mxEvent.addListener(l,"mouseout",a),l},mxToolbar.prototype.addCombo=function(t){var e=document.createElement("div");e.style.display="inline",e.className="mxToolbarComboContainer";var n=document.createElement("select");return n.className=t||"mxToolbarCombo",e.appendChild(n),this.container.appendChild(e),n},mxToolbar.prototype.addActionCombo=function(t,e){var n=document.createElement("select");return n.className=e||"mxToolbarCombo",this.addOption(n,t,null),mxEvent.addListener(n,"change",function(t){var e=n.options[n.selectedIndex];n.selectedIndex=0,null!=e.funct&&e.funct(t)}),this.container.appendChild(n),n},mxToolbar.prototype.addOption=function(t,e,n){var i=document.createElement("option");return mxUtils.writeln(i,e),"function"==typeof n?i.funct=n:i.setAttribute("value",n),t.appendChild(i),i},mxToolbar.prototype.addSwitchMode=function(t,e,n,i,o){var s=document.createElement("img");return s.initialClassName=o||"mxToolbarMode",s.className=s.initialClassName,s.setAttribute("src",e),s.altIcon=i,null!=t&&s.setAttribute("title",t),mxEvent.addListener(s,"click",mxUtils.bind(this,function(t){var e;null!=(e=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",e)):this.selectedMode.className=this.selectedMode.initialClassName,this.updateDefaultMode&&(this.defaultMode=s),null!=(e=(this.selectedMode=s).altIcon)?(s.altIcon=s.getAttribute("src"),s.setAttribute("src",e)):s.className=s.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT)),n()})),this.container.appendChild(s),null==this.defaultMode&&(this.defaultMode=s,this.selectMode(s),n()),s},mxToolbar.prototype.addMode=function(t,e,n,i,o,s){s=null==s||s;var l=document.createElement(null!=e?"img":"button");return l.initialClassName=o||"mxToolbarMode",l.className=l.initialClassName,l.setAttribute("src",e),l.altIcon=i,null!=t&&l.setAttribute("title",t),this.enabled&&s&&(mxEvent.addListener(l,"click",mxUtils.bind(this,function(t){this.selectMode(l,n),this.noReset=!1})),mxEvent.addListener(l,"dblclick",mxUtils.bind(this,function(t){this.selectMode(l,n),this.noReset=!0})),null==this.defaultMode&&(this.defaultMode=l,this.defaultFunction=n,this.selectMode(l,n))),this.container.appendChild(l),l},mxToolbar.prototype.selectMode=function(t,e){if(this.selectedMode!=t){var n;if(null!=this.selectedMode)null!=(n=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",n)):this.selectedMode.className=this.selectedMode.initialClassName;this.selectedMode=t,null!=(n=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",n)):this.selectedMode.className=this.selectedMode.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",e))}},mxToolbar.prototype.resetMode=function(t){!t&&this.noReset||this.selectedMode==this.defaultMode||this.selectMode(this.defaultMode,this.defaultFunction)},mxToolbar.prototype.addSeparator=function(t){return this.addItem(null,t,null)},mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)},mxToolbar.prototype.addLine=function(){var t=document.createElement("hr");t.style.marginRight="6px",t.setAttribute("size","1"),this.container.appendChild(t)},mxToolbar.prototype.destroy=function(){mxEvent.release(this.container),this.container=null,this.defaultMode=null,this.defaultFunction=null,(this.selectedMode=null)!=this.menu&&this.menu.destroy()},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(t){this.changes.push(t)},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 t=this.changes.length-1;0<=t;t--){var e=this.changes[t];null!=e.execute?e.execute():null!=e.undo&&e.undo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",e))}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 t=this.changes.length,e=0;e<t;e++){var n=this.changes[e];null!=n.execute?n.execute():null!=n.redo&&n.redo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",n))}this.undone=!1,this.redone=!0,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoManager.prototype=new mxEventSource,mxUndoManager.prototype.constructor=mxUndoManager,mxUndoManager.prototype.size=null,mxUndoManager.prototype.history=null,mxUndoManager.prototype.indexOfNextAdd=0,mxUndoManager.prototype.isEmpty=function(){return 0==this.history.length},mxUndoManager.prototype.clear=function(){this.history=[],this.indexOfNextAdd=0,this.fireEvent(new mxEventObject(mxEvent.CLEAR))},mxUndoManager.prototype.canUndo=function(){return 0<this.indexOfNextAdd},mxUndoManager.prototype.undo=function(){for(;0<this.indexOfNextAdd;){var t=this.history[--this.indexOfNextAdd];if(t.undo(),t.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t));break}}},mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd<this.history.length},mxUndoManager.prototype.redo=function(){for(var t=this.history.length;this.indexOfNextAdd<t;){var e=this.history[this.indexOfNextAdd++];if(e.redo(),e.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.REDO,"edit",e));break}}},mxUndoManager.prototype.undoableEditHappened=function(t){this.trim(),0<this.size&&this.size==this.history.length&&this.history.shift(),this.history.push(t),this.indexOfNextAdd=this.history.length,this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",t))},mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var t=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),e=0;e<t.length;e++)t[e].die()};var mxUrlConverter=function(){};function mxPanningManager(s){this.thread=null,this.active=!1,this.tdx=0,this.tdy=0,this.t0x=0,this.t0y=0,this.dx=0,this.dy=0,this.scrollbars=!1,this.scrollLeft=0,this.scrollTop=0,this.mouseListener={mouseDown:function(t,e){},mouseMove:function(t,e){},mouseUp:mxUtils.bind(this,function(t,e){this.active&&this.stop()})},s.addMouseListener(this.mouseListener),this.mouseUpListener=mxUtils.bind(this,function(){this.active&&this.stop()}),mxEvent.addListener(document,"mouseup",this.mouseUpListener);var l=mxUtils.bind(this,function(){return this.scrollbars=mxUtils.hasScrollbars(s.container),this.scrollLeft=s.container.scrollLeft,this.scrollTop=s.container.scrollTop,window.setInterval(mxUtils.bind(this,function(){if(this.tdx-=this.dx,this.tdy-=this.dy,this.scrollbars){var t=-s.container.scrollLeft-Math.ceil(this.dx),e=-s.container.scrollTop-Math.ceil(this.dy);s.panGraph(t,e),s.panDx=this.scrollLeft-s.container.scrollLeft,s.panDy=this.scrollTop-s.container.scrollTop,s.fireEvent(new mxEventObject(mxEvent.PAN))}else s.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=s.view.translate.x,this.t0y=s.view.translate.y,this.active=!0},this.panTo=function(t,e,n,i){this.active||this.start(),this.scrollLeft=s.container.scrollLeft,this.scrollTop=s.container.scrollTop,n=null!=n?n:0,i=null!=i?i:0;var o=s.container;this.dx=t+n-o.scrollLeft-o.clientWidth,this.dx<0&&Math.abs(this.dx)<this.border?this.dx=this.border+this.dx:this.handleMouseOut?this.dx=Math.max(this.dx,0):this.dx=0,0==this.dx&&(this.dx=t-o.scrollLeft,0<this.dx&&this.dx<this.border?this.dx=this.dx-this.border:this.handleMouseOut?this.dx=Math.min(0,this.dx):this.dx=0),this.dy=e+i-o.scrollTop-o.clientHeight,this.dy<0&&Math.abs(this.dy)<this.border?this.dy=this.border+this.dy:this.handleMouseOut?this.dy=Math.max(this.dy,0):this.dy=0,0==this.dy&&(this.dy=e-o.scrollTop,0<this.dy&&this.dy<this.border?this.dy=this.dy-this.border:this.handleMouseOut?this.dy=Math.min(0,this.dy):this.dy=0),0!=this.dx||0!=this.dy?(this.dx*=this.damper,this.dy*=this.damper,null==this.thread&&(this.thread=l())):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.tdx=0,this.tdy=0,this.scrollbars)s.panDx=0,s.panDy=0,s.fireEvent(new mxEventObject(mxEvent.PAN));else{var t=s.panDx,e=s.panDy;0==t&&0==e||(s.panGraph(0,0),s.view.setTranslate(this.t0x+t/s.view.scale,this.t0y+e/s.view.scale))}},this.destroy=function(){s.removeMouseListener(this.mouseListener),mxEvent.removeListener(document,"mouseup",this.mouseUpListener)}}function mxPopupMenu(t){null!=(this.factoryMethod=t)&&this.init()}function mxAutoSaveManager(t){this.changeHandler=mxUtils.bind(this,function(t,e){this.isEnabled()&&this.graphModelChanged(e.getProperty("edit").changes)}),this.setGraph(t)}function mxAnimation(t){this.delay=null!=t?t:20}function mxMorphing(t,e,n,i){mxAnimation.call(this,i),this.graph=t,this.steps=null!=e?e:6,this.ease=null!=n?n:1.5}function mxImageBundle(t){this.images=[],this.alt=null!=t&&t}function mxImageExport(){}function mxAbstractCanvas2D(){this.converter=this.createUrlConverter(),this.reset()}function mxXmlCanvas2D(t){mxAbstractCanvas2D.call(this),this.root=t,this.writeDefaults()}function mxSvgCanvas2D(t,e){mxAbstractCanvas2D.call(this),this.root=t,this.gradients=[],this.defs=null,this.styleEnabled=null!=e&&e;var n=null;if(t.ownerDocument!=document){for(var i=t;null!=i&&"svg"!=i.nodeName;)i=i.parentNode;n=i}null!=n&&(0<n.getElementsByTagName("defs").length&&(this.defs=n.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=n.firstChild?n.insertBefore(this.defs,n.firstChild):n.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}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 t=this.baseUrl.lastIndexOf("/");0<t&&(this.baseUrl=this.baseUrl.substring(0,t+1))},mxUrlConverter.prototype.isEnabled=function(){return this.enabled},mxUrlConverter.prototype.setEnabled=function(t){this.enabled=t},mxUrlConverter.prototype.getBaseUrl=function(){return this.baseUrl},mxUrlConverter.prototype.setBaseUrl=function(t){this.baseUrl=t},mxUrlConverter.prototype.getBaseDomain=function(){return this.baseDomain},mxUrlConverter.prototype.setBaseDomain=function(t){this.baseDomain=t},mxUrlConverter.prototype.isRelativeUrl=function(t){return"//"!=t.substring(0,2)&&"http://"!=t.substring(0,7)&&"https://"!=t.substring(0,8)&&"data:image"!=t.substring(0,10)&&"file://"!=t.substring(0,7)},mxUrlConverter.prototype.convert=function(t){return this.isEnabled()&&this.isRelativeUrl(t)&&(null==this.getBaseUrl()&&this.updateBaseUrl(),t="/"==t.charAt(0)?this.getBaseDomain()+t:this.getBaseUrl()+t),t},mxPanningManager.prototype.damper=1/6,mxPanningManager.prototype.delay=10,mxPanningManager.prototype.handleMouseOut=!0,mxPanningManager.prototype.border=0,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(t){this.enabled=t},mxPopupMenu.prototype.isPopupTrigger=function(t){return t.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(t.getEvent())},mxPopupMenu.prototype.addItem=function(t,e,n,i,o,s,l){i=i||this,this.itemCount++,i.willAddSeparator&&(i.containsItems&&this.addSeparator(i,!0),i.willAddSeparator=!1),i.containsItems=!0;var r=document.createElement("tr");r.className="mxPopupMenuItem";var a=document.createElement("td");if(a.className="mxPopupMenuIcon",null!=e){var h=document.createElement("img");h.src=e,a.appendChild(h)}else if(null!=o){var d=document.createElement("div");d.className=o,a.appendChild(d)}if(r.appendChild(a),this.labels){var u=document.createElement("td");u.className="mxPopupMenuItem"+(null==s||s?"":" mxDisabled"),mxUtils.write(u,t),u.align="left",r.appendChild(u);var p=document.createElement("td");p.className="mxPopupMenuItem"+(null==s||s?"":" mxDisabled"),p.style.paddingRight="6px",p.style.textAlign="right",r.appendChild(p),null==i.div&&this.createSubmenu(i)}if(i.tbody.appendChild(r),0!=l&&0!=s){var m=null;mxEvent.addGestureListeners(r,mxUtils.bind(this,function(t){this.eventReceiver=r,i.activeRow!=r&&i.activeRow!=i&&(null!=i.activeRow&&null!=i.activeRow.div.parentNode&&this.hideSubmenu(i),null!=r.div&&(this.showSubmenu(i,r),i.activeRow=r)),!mxClient.IS_QUIRKS&&8!=document.documentMode||(m=document.selection.createRange()),mxEvent.consume(t)}),mxUtils.bind(this,function(t){i.activeRow!=r&&i.activeRow!=i&&(null!=i.activeRow&&null!=i.activeRow.div.parentNode&&this.hideSubmenu(i),this.autoExpand&&null!=r.div&&(this.showSubmenu(i,r),i.activeRow=r)),r.className="mxPopupMenuItemHover"}),mxUtils.bind(this,function(t){if(this.eventReceiver==r){if(i.activeRow!=r&&this.hideMenu(),null!=m){try{m.select()}catch(t){}m=null}null!=n&&n(t)}this.eventReceiver=null,mxEvent.consume(t)})),mxEvent.addListener(r,"mouseout",mxUtils.bind(this,function(t){r.className="mxPopupMenuItem"}))}return r},mxPopupMenu.prototype.addCheckmark=function(t,e){var n=t.firstChild.nextSibling;n.style.backgroundImage="url('"+e+"')",n.style.backgroundRepeat="no-repeat",n.style.backgroundPosition="2px 50%"},mxPopupMenu.prototype.createSubmenu=function(t){t.table=document.createElement("table"),t.table.className="mxPopupMenu",t.tbody=document.createElement("tbody"),t.table.appendChild(t.tbody),t.div=document.createElement("div"),t.div.className="mxPopupMenu",t.div.style.position="absolute",t.div.style.display="inline",t.div.style.zIndex=this.zIndex,t.div.appendChild(t.table);var e=document.createElement("img");e.setAttribute("src",this.submenuImage),td=t.firstChild.nextSibling.nextSibling,td.appendChild(e)},mxPopupMenu.prototype.showSubmenu=function(t,e){if(null!=e.div){e.div.style.left=t.div.offsetLeft+e.offsetLeft+e.offsetWidth-1+"px",e.div.style.top=t.div.offsetTop+e.offsetTop+"px",document.body.appendChild(e.div);var n=parseInt(e.div.offsetLeft),i=parseInt(e.div.offsetWidth),o=mxUtils.getDocumentScrollOrigin(document),s=document.body,l=document.documentElement;o.x+(s.clientWidth||l.clientWidth)<n+i&&(e.div.style.left=Math.max(0,t.div.offsetLeft-i+(mxClient.IS_IE?6:-6))+"px"),mxUtils.fit(e.div)}},mxPopupMenu.prototype.addSeparator=function(t,e){if(t=t||this,this.smartSeparators&&!e)t.willAddSeparator=!0;else if(null!=t.tbody){t.willAddSeparator=!1;var n=document.createElement("tr"),i=document.createElement("td");i.className="mxPopupMenuIcon",i.style.padding="0 0 0 0px",n.appendChild(i);var o=document.createElement("td");o.style.padding="0 0 0 0px",o.setAttribute("colSpan","2");var s=document.createElement("hr");s.setAttribute("size","1"),o.appendChild(s),n.appendChild(o),t.tbody.appendChild(n)}},mxPopupMenu.prototype.popup=function(t,e,n,i){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){for(this.div.style.left=t+"px",this.div.style.top=e+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0,this.factoryMethod(this,n,i),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(t){null!=t.activeRow&&(this.hideSubmenu(t.activeRow),null!=t.activeRow.div.parentNode&&t.activeRow.div.parentNode.removeChild(t.activeRow.div),t.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)},mxAutoSaveManager.prototype=new mxEventSource,mxAutoSaveManager.prototype.constructor=mxAutoSaveManager,mxAutoSaveManager.prototype.graph=null,mxAutoSaveManager.prototype.autoSaveDelay=10,mxAutoSaveManager.prototype.autoSaveThrottle=2,mxAutoSaveManager.prototype.autoSaveThreshold=5,mxAutoSaveManager.prototype.ignoredChanges=0,mxAutoSaveManager.prototype.lastSnapshot=0,mxAutoSaveManager.prototype.enabled=!0,mxAutoSaveManager.prototype.changeHandler=null,mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled},mxAutoSaveManager.prototype.setEnabled=function(t){this.enabled=t},mxAutoSaveManager.prototype.setGraph=function(t){null!=this.graph&&this.graph.getModel().removeListener(this.changeHandler),this.graph=t,null!=this.graph&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)},mxAutoSaveManager.prototype.save=function(){},mxAutoSaveManager.prototype.graphModelChanged=function(t){var e=((new Date).getTime()-this.lastSnapshot)/1e3;e>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&e>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++},mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime(),this.ignoredChanges=0},mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)},mxAnimation.prototype=new mxEventSource,mxAnimation.prototype.constructor=mxAnimation,mxAnimation.prototype.delay=null,mxAnimation.prototype.thread=null,mxAnimation.prototype.isRunning=function(){return null!=this.thread},mxAnimation.prototype.startAnimation=function(){null==this.thread&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))},mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))},mxAnimation.prototype.stopAnimation=function(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))},mxMorphing.prototype=new mxAnimation,mxMorphing.prototype.constructor=mxMorphing,mxMorphing.prototype.graph=null,mxMorphing.prototype.steps=null,mxMorphing.prototype.step=0,mxMorphing.prototype.ease=null,mxMorphing.prototype.cells=null,mxMorphing.prototype.updateAnimation=function(){mxAnimation.prototype.updateAnimation.apply(this,arguments);var t=new mxCellStatePreview(this.graph);if(null!=this.cells)for(var e=0;e<this.cells.length;e++)this.animateCell(this.cells[e],t,!1);else this.animateCell(this.graph.getModel().getRoot(),t,!0);this.show(t),(t.isEmpty()||this.step++>=this.steps)&&this.stopAnimation()},mxMorphing.prototype.show=function(t){t.show()},mxMorphing.prototype.animateCell=function(t,e,n){var i=this.graph.getView().getState(t),o=null;if(null!=i&&(o=this.getDelta(i),this.graph.getModel().isVertex(t)&&(0!=o.x||0!=o.y))){var s=this.graph.view.getTranslate(),l=this.graph.view.getScale();o.x+=s.x*l,o.y+=s.y*l,e.moveState(i,-o.x/this.ease,-o.y/this.ease)}if(n&&!this.stopRecursion(i,o))for(var r=this.graph.getModel().getChildCount(t),a=0;a<r;a++)this.animateCell(this.graph.getModel().getChildAt(t,a),e,n)},mxMorphing.prototype.stopRecursion=function(t,e){return null!=e&&(0!=e.x||0!=e.y)},mxMorphing.prototype.getDelta=function(t){var e=this.getOriginForCell(t.cell),n=this.graph.getView().getTranslate(),i=this.graph.getView().getScale(),o=t.x/i-n.x,s=t.y/i-n.y;return new mxPoint((e.x-o)*i,(e.y-s)*i)},mxMorphing.prototype.getOriginForCell=function(t){var e=null;if(null!=t){var n=this.graph.getModel().getParent(t),i=this.graph.getCellGeometry(t);if(e=this.getOriginForCell(n),null!=i)if(i.relative){var o=this.graph.getCellGeometry(n);null!=o&&(e.x+=i.x*o.width,e.y+=i.y*o.height)}else e.x+=i.x,e.y+=i.y}if(null==e){var s=this.graph.view.getTranslate();e=new mxPoint(-s.x,-s.y)}return e},mxImageBundle.prototype.images=null,mxImageBundle.prototype.images=null,mxImageBundle.prototype.putImage=function(t,e,n){this.images[t]={value:e,fallback:n}},mxImageBundle.prototype.getImage=function(t){var e=null;if(null!=t){var n=this.images[t];null!=n&&(e=this.alt?n.fallback:n.value)}return e},mxImageExport.prototype.includeOverlays=!1,mxImageExport.prototype.drawState=function(t,e){null!=t&&(this.visitStatesRecursive(t,e,mxUtils.bind(this,function(){this.drawCellState.apply(this,arguments)})),this.includeOverlays&&this.visitStatesRecursive(t,e,mxUtils.bind(this,function(){this.drawOverlays.apply(this,arguments)})))},mxImageExport.prototype.visitStatesRecursive=function(t,e,n){if(null!=t){n(t,e);for(var i=t.view.graph,o=i.model.getChildCount(t.cell),s=0;s<o;s++){var l=i.view.getState(i.model.getChildAt(t.cell,s));this.visitStatesRecursive(l,e,n)}}},mxImageExport.prototype.getLinkForCellState=function(t,e){return null},mxImageExport.prototype.drawCellState=function(t,e){var n=this.getLinkForCellState(t,e);null!=n&&e.setLink(n),this.drawShape(t,e),this.drawText(t,e),null!=n&&e.setLink(null)},mxImageExport.prototype.drawShape=function(t,e){t.shape instanceof mxShape&&t.shape.checkBounds()&&(e.save(),t.shape.paint(e),e.restore())},mxImageExport.prototype.drawText=function(t,e){null!=t.text&&t.text.checkBounds()&&(e.save(),t.text.paint(e),e.restore())},mxImageExport.prototype.drawOverlays=function(t,n){null!=t.overlays&&t.overlays.visit(function(t,e){e instanceof mxShape&&e.paint(n)})},mxAbstractCanvas2D.prototype.state=null,mxAbstractCanvas2D.prototype.states=null,mxAbstractCanvas2D.prototype.path=null,mxAbstractCanvas2D.prototype.rotateHtml=!0,mxAbstractCanvas2D.prototype.lastX=0,mxAbstractCanvas2D.prototype.lastY=0,mxAbstractCanvas2D.prototype.moveOp="M",mxAbstractCanvas2D.prototype.lineOp="L",mxAbstractCanvas2D.prototype.quadOp="Q",mxAbstractCanvas2D.prototype.curveOp="C",mxAbstractCanvas2D.prototype.closeOp="Z",mxAbstractCanvas2D.prototype.pointerEvents=!1,mxAbstractCanvas2D.prototype.createUrlConverter=function(){return new mxUrlConverter},mxAbstractCanvas2D.prototype.reset=function(){this.state=this.createState(),this.states=[]},mxAbstractCanvas2D.prototype.createState=function(){return{dx:0,dy:0,scale:1,alpha:1,fillAlpha:1,strokeAlpha:1,fillColor:null,gradientFillAlpha:1,gradientColor:null,gradientAlpha:1,gradientDirection:null,strokeColor:null,strokeWidth:1,dashed:!1,dashPattern:"3 3",fixDash:!1,lineCap:"flat",lineJoin:"miter",miterLimit:10,fontColor:"#000000",fontBackgroundColor:null,fontBorderColor:null,fontSize:mxConstants.DEFAULT_FONTSIZE,fontFamily:mxConstants.DEFAULT_FONTFAMILY,fontStyle:0,shadow:!1,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(t){return Math.round(parseFloat(t))},mxAbstractCanvas2D.prototype.addOp=function(){if(null!=this.path&&(this.path.push(arguments[0]),2<arguments.length))for(var t=this.state,e=2;e<arguments.length;e+=2)this.lastX=arguments[e-1],this.lastY=arguments[e],this.path.push(this.format((this.lastX+t.dx)*t.scale)),this.path.push(this.format((this.lastY+t.dy)*t.scale))},mxAbstractCanvas2D.prototype.rotatePoint=function(t,e,n,i,o){var s=n*(Math.PI/180);return mxUtils.getRotatedPoint(new mxPoint(t,e),Math.cos(s),Math.sin(s),new mxPoint(i,o))},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(t){},mxAbstractCanvas2D.prototype.scale=function(t){this.state.scale*=t,this.state.strokeWidth*=t},mxAbstractCanvas2D.prototype.translate=function(t,e){this.state.dx+=t,this.state.dy+=e},mxAbstractCanvas2D.prototype.rotate=function(t,e,n,i,o){},mxAbstractCanvas2D.prototype.setAlpha=function(t){this.state.alpha=t},mxAbstractCanvas2D.prototype.setFillAlpha=function(t){this.state.fillAlpha=t},mxAbstractCanvas2D.prototype.setStrokeAlpha=function(t){this.state.strokeAlpha=t},mxAbstractCanvas2D.prototype.setFillColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fillColor=t,this.state.gradientColor=null},mxAbstractCanvas2D.prototype.setGradient=function(t,e,n,i,o,s,l,r,a){var h=this.state;h.fillColor=t,h.gradientFillAlpha=null!=r?r:1,h.gradientColor=e,h.gradientAlpha=null!=a?a:1,h.gradientDirection=l},mxAbstractCanvas2D.prototype.setStrokeColor=function(t){t==mxConstants.NONE&&(t=null),this.state.strokeColor=t},mxAbstractCanvas2D.prototype.setStrokeWidth=function(t){this.state.strokeWidth=t},mxAbstractCanvas2D.prototype.setDashed=function(t,e){this.state.dashed=t,this.state.fixDash=e},mxAbstractCanvas2D.prototype.setDashPattern=function(t){this.state.dashPattern=t},mxAbstractCanvas2D.prototype.setLineCap=function(t){this.state.lineCap=t},mxAbstractCanvas2D.prototype.setLineJoin=function(t){this.state.lineJoin=t},mxAbstractCanvas2D.prototype.setMiterLimit=function(t){this.state.miterLimit=t},mxAbstractCanvas2D.prototype.setFontColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontColor=t},mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontBackgroundColor=t},mxAbstractCanvas2D.prototype.setFontBorderColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontBorderColor=t},mxAbstractCanvas2D.prototype.setFontSize=function(t){this.state.fontSize=parseFloat(t)},mxAbstractCanvas2D.prototype.setFontFamily=function(t){this.state.fontFamily=t},mxAbstractCanvas2D.prototype.setFontStyle=function(t){null==t&&(t=0),this.state.fontStyle=t},mxAbstractCanvas2D.prototype.setShadow=function(t){this.state.shadow=t},mxAbstractCanvas2D.prototype.setShadowColor=function(t){t==mxConstants.NONE&&(t=null),this.state.shadowColor=t},mxAbstractCanvas2D.prototype.setShadowAlpha=function(t){this.state.shadowAlpha=t},mxAbstractCanvas2D.prototype.setShadowOffset=function(t,e){this.state.shadowDx=t,this.state.shadowDy=e},mxAbstractCanvas2D.prototype.begin=function(){this.lastX=0,this.lastY=0,this.path=[]},mxAbstractCanvas2D.prototype.moveTo=function(t,e){this.addOp(this.moveOp,t,e)},mxAbstractCanvas2D.prototype.lineTo=function(t,e){this.addOp(this.lineOp,t,e)},mxAbstractCanvas2D.prototype.quadTo=function(t,e,n,i){this.addOp(this.quadOp,t,e,n,i)},mxAbstractCanvas2D.prototype.curveTo=function(t,e,n,i,o,s){this.addOp(this.curveOp,t,e,n,i,o,s)},mxAbstractCanvas2D.prototype.arcTo=function(t,e,n,i,o,s,l){var r=mxUtils.arcToCurves(this.lastX,this.lastY,t,e,n,i,o,s,l);if(null!=r)for(var a=0;a<r.length;a+=6)this.curveTo(r[a],r[a+1],r[a+2],r[a+3],r[a+4],r[a+5])},mxAbstractCanvas2D.prototype.close=function(t,e,n,i,o,s){this.addOp(this.closeOp)},mxAbstractCanvas2D.prototype.end=function(){},mxUtils.extend(mxXmlCanvas2D,mxAbstractCanvas2D),mxXmlCanvas2D.prototype.textEnabled=!0,mxXmlCanvas2D.prototype.compressed=!0,mxXmlCanvas2D.prototype.writeDefaults=function(){var t;(t=this.createElement("fontfamily")).setAttribute("family",mxConstants.DEFAULT_FONTFAMILY),this.root.appendChild(t),(t=this.createElement("fontsize")).setAttribute("size",mxConstants.DEFAULT_FONTSIZE),this.root.appendChild(t),(t=this.createElement("shadowcolor")).setAttribute("color",mxConstants.SHADOWCOLOR),this.root.appendChild(t),(t=this.createElement("shadowalpha")).setAttribute("alpha",mxConstants.SHADOW_OPACITY),this.root.appendChild(t),(t=this.createElement("shadowoffset")).setAttribute("dx",mxConstants.SHADOW_OFFSET_X),t.setAttribute("dy",mxConstants.SHADOW_OFFSET_Y),this.root.appendChild(t)},mxXmlCanvas2D.prototype.format=function(t){return parseFloat(parseFloat(t).toFixed(2))},mxXmlCanvas2D.prototype.createElement=function(t){return this.root.ownerDocument.createElement(t)},mxXmlCanvas2D.prototype.save=function(){this.compressed&&mxAbstractCanvas2D.prototype.save.apply(this,arguments),this.root.appendChild(this.createElement("save"))},mxXmlCanvas2D.prototype.restore=function(){this.compressed&&mxAbstractCanvas2D.prototype.restore.apply(this,arguments),this.root.appendChild(this.createElement("restore"))},mxXmlCanvas2D.prototype.scale=function(t){var e=this.createElement("scale");e.setAttribute("scale",t),this.root.appendChild(e)},mxXmlCanvas2D.prototype.translate=function(t,e){var n=this.createElement("translate");n.setAttribute("dx",this.format(t)),n.setAttribute("dy",this.format(e)),this.root.appendChild(n)},mxXmlCanvas2D.prototype.rotate=function(t,e,n,i,o){var s=this.createElement("rotate");(0!=t||e||n)&&(s.setAttribute("theta",this.format(t)),s.setAttribute("flipH",e?"1":"0"),s.setAttribute("flipV",n?"1":"0"),s.setAttribute("cx",this.format(i)),s.setAttribute("cy",this.format(o)),this.root.appendChild(s))},mxXmlCanvas2D.prototype.setAlpha=function(t){if(this.compressed){if(this.state.alpha==t)return;mxAbstractCanvas2D.prototype.setAlpha.apply(this,arguments)}var e=this.createElement("alpha");e.setAttribute("alpha",this.format(t)),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setFillAlpha=function(t){if(this.compressed){if(this.state.fillAlpha==t)return;mxAbstractCanvas2D.prototype.setFillAlpha.apply(this,arguments)}var e=this.createElement("fillalpha");e.setAttribute("alpha",this.format(t)),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setStrokeAlpha=function(t){if(this.compressed){if(this.state.strokeAlpha==t)return;mxAbstractCanvas2D.prototype.setStrokeAlpha.apply(this,arguments)}var e=this.createElement("strokealpha");e.setAttribute("alpha",this.format(t)),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setFillColor=function(t){if(t==mxConstants.NONE&&(t=null),this.compressed){if(this.state.fillColor==t)return;mxAbstractCanvas2D.prototype.setFillColor.apply(this,arguments)}var e=this.createElement("fillcolor");e.setAttribute("color",null!=t?t:mxConstants.NONE),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setGradient=function(t,e,n,i,o,s,l,r,a){if(null!=t&&null!=e){mxAbstractCanvas2D.prototype.setGradient.apply(this,arguments);var h=this.createElement("gradient");h.setAttribute("c1",t),h.setAttribute("c2",e),h.setAttribute("x",this.format(n)),h.setAttribute("y",this.format(i)),h.setAttribute("w",this.format(o)),h.setAttribute("h",this.format(s)),null!=l&&h.setAttribute("direction",l),null!=r&&h.setAttribute("alpha1",r),null!=a&&h.setAttribute("alpha2",a),this.root.appendChild(h)}},mxXmlCanvas2D.prototype.setStrokeColor=function(t){if(t==mxConstants.NONE&&(t=null),this.compressed){if(this.state.strokeColor==t)return;mxAbstractCanvas2D.prototype.setStrokeColor.apply(this,arguments)}var e=this.createElement("strokecolor");e.setAttribute("color",null!=t?t:mxConstants.NONE),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setStrokeWidth=function(t){if(this.compressed){if(this.state.strokeWidth==t)return;mxAbstractCanvas2D.prototype.setStrokeWidth.apply(this,arguments)}var e=this.createElement("strokewidth");e.setAttribute("width",this.format(t)),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setDashed=function(t,e){if(this.compressed){if(this.state.dashed==t)return;mxAbstractCanvas2D.prototype.setDashed.apply(this,arguments)}var n=this.createElement("dashed");n.setAttribute("dashed",t?"1":"0"),null!=e&&n.setAttribute("fixDash",e?"1":"0"),this.root.appendChild(n)},mxXmlCanvas2D.prototype.setDashPattern=function(t){if(this.compressed){if(this.state.dashPattern==t)return;mxAbstractCanvas2D.prototype.setDashPattern.apply(this,arguments)}var e=this.createElement("dashpattern");e.setAttribute("pattern",t),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setLineCap=function(t){if(this.compressed){if(this.state.lineCap==t)return;mxAbstractCanvas2D.prototype.setLineCap.apply(this,arguments)}var e=this.createElement("linecap");e.setAttribute("cap",t),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setLineJoin=function(t){if(this.compressed){if(this.state.lineJoin==t)return;mxAbstractCanvas2D.prototype.setLineJoin.apply(this,arguments)}var e=this.createElement("linejoin");e.setAttribute("join",t),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setMiterLimit=function(t){if(this.compressed){if(this.state.miterLimit==t)return;mxAbstractCanvas2D.prototype.setMiterLimit.apply(this,arguments)}var e=this.createElement("miterlimit");e.setAttribute("limit",t),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setFontColor=function(t){if(this.textEnabled){if(t==mxConstants.NONE&&(t=null),this.compressed){if(this.state.fontColor==t)return;mxAbstractCanvas2D.prototype.setFontColor.apply(this,arguments)}var e=this.createElement("fontcolor");e.setAttribute("color",null!=t?t:mxConstants.NONE),this.root.appendChild(e)}},mxXmlCanvas2D.prototype.setFontBackgroundColor=function(t){if(this.textEnabled){if(t==mxConstants.NONE&&(t=null),this.compressed){if(this.state.fontBackgroundColor==t)return;mxAbstractCanvas2D.prototype.setFontBackgroundColor.apply(this,arguments)}var e=this.createElement("fontbackgroundcolor");e.setAttribute("color",null!=t?t:mxConstants.NONE),this.root.appendChild(e)}},mxXmlCanvas2D.prototype.setFontBorderColor=function(t){if(this.textEnabled){if(t==mxConstants.NONE&&(t=null),this.compressed){if(this.state.fontBorderColor==t)return;mxAbstractCanvas2D.prototype.setFontBorderColor.apply(this,arguments)}var e=this.createElement("fontbordercolor");e.setAttribute("color",null!=t?t:mxConstants.NONE),this.root.appendChild(e)}},mxXmlCanvas2D.prototype.setFontSize=function(t){if(this.textEnabled){if(this.compressed){if(this.state.fontSize==t)return;mxAbstractCanvas2D.prototype.setFontSize.apply(this,arguments)}var e=this.createElement("fontsize");e.setAttribute("size",t),this.root.appendChild(e)}},mxXmlCanvas2D.prototype.setFontFamily=function(t){if(this.textEnabled){if(this.compressed){if(this.state.fontFamily==t)return;mxAbstractCanvas2D.prototype.setFontFamily.apply(this,arguments)}var e=this.createElement("fontfamily");e.setAttribute("family",t),this.root.appendChild(e)}},mxXmlCanvas2D.prototype.setFontStyle=function(t){if(this.textEnabled){if(null==t&&(t=0),this.compressed){if(this.state.fontStyle==t)return;mxAbstractCanvas2D.prototype.setFontStyle.apply(this,arguments)}var e=this.createElement("fontstyle");e.setAttribute("style",t),this.root.appendChild(e)}},mxXmlCanvas2D.prototype.setShadow=function(t){if(this.compressed){if(this.state.shadow==t)return;mxAbstractCanvas2D.prototype.setShadow.apply(this,arguments)}var e=this.createElement("shadow");e.setAttribute("enabled",t?"1":"0"),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setShadowColor=function(t){if(this.compressed){if(t==mxConstants.NONE&&(t=null),this.state.shadowColor==t)return;mxAbstractCanvas2D.prototype.setShadowColor.apply(this,arguments)}var e=this.createElement("shadowcolor");e.setAttribute("color",null!=t?t:mxConstants.NONE),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setShadowAlpha=function(t){if(this.compressed){if(this.state.shadowAlpha==t)return;mxAbstractCanvas2D.prototype.setShadowAlpha.apply(this,arguments)}var e=this.createElement("shadowalpha");e.setAttribute("alpha",t),this.root.appendChild(e)},mxXmlCanvas2D.prototype.setShadowOffset=function(t,e){if(this.compressed){if(this.state.shadowDx==t&&this.state.shadowDy==e)return;mxAbstractCanvas2D.prototype.setShadowOffset.apply(this,arguments)}var n=this.createElement("shadowoffset");n.setAttribute("dx",t),n.setAttribute("dy",e),this.root.appendChild(n)},mxXmlCanvas2D.prototype.rect=function(t,e,n,i){var o=this.createElement("rect");o.setAttribute("x",this.format(t)),o.setAttribute("y",this.format(e)),o.setAttribute("w",this.format(n)),o.setAttribute("h",this.format(i)),this.root.appendChild(o)},mxXmlCanvas2D.prototype.roundrect=function(t,e,n,i,o,s){var l=this.createElement("roundrect");l.setAttribute("x",this.format(t)),l.setAttribute("y",this.format(e)),l.setAttribute("w",this.format(n)),l.setAttribute("h",this.format(i)),l.setAttribute("dx",this.format(o)),l.setAttribute("dy",this.format(s)),this.root.appendChild(l)},mxXmlCanvas2D.prototype.ellipse=function(t,e,n,i){var o=this.createElement("ellipse");o.setAttribute("x",this.format(t)),o.setAttribute("y",this.format(e)),o.setAttribute("w",this.format(n)),o.setAttribute("h",this.format(i)),this.root.appendChild(o)},mxXmlCanvas2D.prototype.image=function(t,e,n,i,o,s,l,r){o=this.converter.convert(o);var a=this.createElement("image");a.setAttribute("x",this.format(t)),a.setAttribute("y",this.format(e)),a.setAttribute("w",this.format(n)),a.setAttribute("h",this.format(i)),a.setAttribute("src",o),a.setAttribute("aspect",s?"1":"0"),a.setAttribute("flipH",l?"1":"0"),a.setAttribute("flipV",r?"1":"0"),this.root.appendChild(a)},mxXmlCanvas2D.prototype.begin=function(){this.root.appendChild(this.createElement("begin")),this.lastX=0,this.lastY=0},mxXmlCanvas2D.prototype.moveTo=function(t,e){var n=this.createElement("move");n.setAttribute("x",this.format(t)),n.setAttribute("y",this.format(e)),this.root.appendChild(n),this.lastX=t,this.lastY=e},mxXmlCanvas2D.prototype.lineTo=function(t,e){var n=this.createElement("line");n.setAttribute("x",this.format(t)),n.setAttribute("y",this.format(e)),this.root.appendChild(n),this.lastX=t,this.lastY=e},mxXmlCanvas2D.prototype.quadTo=function(t,e,n,i){var o=this.createElement("quad");o.setAttribute("x1",this.format(t)),o.setAttribute("y1",this.format(e)),o.setAttribute("x2",this.format(n)),o.setAttribute("y2",this.format(i)),this.root.appendChild(o),this.lastX=n,this.lastY=i},mxXmlCanvas2D.prototype.curveTo=function(t,e,n,i,o,s){var l=this.createElement("curve");l.setAttribute("x1",this.format(t)),l.setAttribute("y1",this.format(e)),l.setAttribute("x2",this.format(n)),l.setAttribute("y2",this.format(i)),l.setAttribute("x3",this.format(o)),l.setAttribute("y3",this.format(s)),this.root.appendChild(l),this.lastX=o,this.lastY=s},mxXmlCanvas2D.prototype.close=function(){this.root.appendChild(this.createElement("close"))},mxXmlCanvas2D.prototype.text=function(t,e,n,i,o,s,l,r,a,h,d,u,p){if(this.textEnabled&&null!=o){mxUtils.isNode(o)&&(o=mxUtils.getOuterHtml(o));var m=this.createElement("text");m.setAttribute("x",this.format(t)),m.setAttribute("y",this.format(e)),m.setAttribute("w",this.format(n)),m.setAttribute("h",this.format(i)),m.setAttribute("str",o),null!=s&&m.setAttribute("align",s),null!=l&&m.setAttribute("valign",l),m.setAttribute("wrap",r?"1":"0"),null==a&&(a=""),m.setAttribute("format",a),null!=h&&m.setAttribute("overflow",h),null!=d&&m.setAttribute("clip",d?"1":"0"),null!=u&&m.setAttribute("rotation",u),null!=p&&m.setAttribute("dir",p),this.root.appendChild(m)}},mxXmlCanvas2D.prototype.stroke=function(){this.root.appendChild(this.createElement("stroke"))},mxXmlCanvas2D.prototype.fill=function(){this.root.appendChild(this.createElement("fill"))},mxXmlCanvas2D.prototype.fillAndStroke=function(){this.root.appendChild(this.createElement("fillstroke"))},mxUtils.extend(mxSvgCanvas2D,mxAbstractCanvas2D),function(){if(mxSvgCanvas2D.prototype.useDomParser=!mxClient.IS_IE&&"function"==typeof DOMParser&&"function"==typeof XMLSerializer,mxSvgCanvas2D.prototype.useDomParser)try{var t=(new DOMParser).parseFromString("test text","text/html");mxSvgCanvas2D.prototype.useDomParser=null!=t}catch(t){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.imageOffset=0,mxSvgCanvas2D.prototype.strokeTolerance=0,mxSvgCanvas2D.prototype.minStrokeWidth=1,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(t){return parseFloat(parseFloat(t).toFixed(2))},mxSvgCanvas2D.prototype.getBaseUrl=function(){var t=window.location.href,e=t.lastIndexOf("#");return 0<e&&(t=t.substring(0,e)),t},mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments),this.gradients=[]},mxSvgCanvas2D.prototype.createStyle=function(t){var e=this.createElement("style");return e.setAttribute("type","text/css"),mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}"),e},mxSvgCanvas2D.prototype.createElement=function(t,e){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(e||mxConstants.NS_SVG,t);var n=this.root.ownerDocument.createElement(t);return null!=e&&n.setAttribute("xmlns",e),n},mxSvgCanvas2D.prototype.createAlternateContent=function(t,e,n,i,o,s,l,r,a,h,d,u,p){if(null==this.foAltText)return null;var m=this.state,c=this.createElement("text");return c.setAttribute("x",Math.round(i/2)),c.setAttribute("y",Math.round((o+m.fontSize)/2)),c.setAttribute("fill",m.fontColor||"black"),c.setAttribute("text-anchor","middle"),c.setAttribute("font-size",m.fontSize+"px"),c.setAttribute("font-family",m.fontFamily),(m.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&c.setAttribute("font-weight","bold"),(m.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&c.setAttribute("font-style","italic"),(m.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&c.setAttribute("text-decoration","underline"),mxUtils.write(c,this.foAltText),c},mxSvgCanvas2D.prototype.createGradientId=function(t,e,n,i,o){"#"==t.charAt(0)&&(t=t.substring(1)),"#"==e.charAt(0)&&(e=e.substring(1)),t=t.toLowerCase()+"-"+n,e=e.toLowerCase()+"-"+i;var s=null;if(null==o||o==mxConstants.DIRECTION_SOUTH)s="s";else if(o==mxConstants.DIRECTION_EAST)s="e";else{var l=t;t=e,e=l,o==mxConstants.DIRECTION_NORTH?s="s":o==mxConstants.DIRECTION_WEST&&(s="e")}return"mx-gradient-"+t+"-"+e+"-"+s},mxSvgCanvas2D.prototype.getSvgGradient=function(t,e,n,i,o){var s=this.createGradientId(t,e,n,i,o),l=this.gradients[s];if(null==l){var r=this.root.ownerSVGElement,a=0,h=s+"-"+a;if(null!=r)for(l=r.ownerDocument.getElementById(h);null!=l&&l.ownerSVGElement!=r;)h=s+"-"+a++,l=r.ownerDocument.getElementById(h);else h="id"+ ++this.refCount;null==l&&((l=this.createSvgGradient(t,e,n,i,o)).setAttribute("id",h),null!=this.defs?this.defs.appendChild(l):r.appendChild(l)),this.gradients[s]=l}return l.getAttribute("id")},mxSvgCanvas2D.prototype.createSvgGradient=function(t,e,n,i,o){var s=this.createElement("linearGradient");s.setAttribute("x1","0%"),s.setAttribute("y1","0%"),s.setAttribute("x2","0%"),s.setAttribute("y2","0%"),null==o||o==mxConstants.DIRECTION_SOUTH?s.setAttribute("y2","100%"):o==mxConstants.DIRECTION_EAST?s.setAttribute("x2","100%"):o==mxConstants.DIRECTION_NORTH?s.setAttribute("y1","100%"):o==mxConstants.DIRECTION_WEST&&s.setAttribute("x1","100%");var l=n<1?";stop-opacity:"+n:"",r=this.createElement("stop");return r.setAttribute("offset","0%"),r.setAttribute("style","stop-color:"+t+l),s.appendChild(r),l=i<1?";stop-opacity:"+i:"",(r=this.createElement("stop")).setAttribute("offset","100%"),r.setAttribute("style","stop-color:"+e+l),s.appendChild(r),s},mxSvgCanvas2D.prototype.addNode=function(t,e){var n=this.node,i=this.state;if(null!=n){if("path"==n.nodeName){if(!(null!=this.path&&0<this.path.length))return;n.setAttribute("d",this.path.join(" "))}t&&null!=i.fillColor?this.updateFill():this.styleEnabled||("ellipse"==n.nodeName&&mxClient.IS_FF?n.setAttribute("fill","transparent"):n.setAttribute("fill","none"),t=!1),e&&null!=i.strokeColor?this.updateStroke():this.styleEnabled||n.setAttribute("stroke","none"),null!=i.transform&&0<i.transform.length&&n.setAttribute("transform",i.transform),i.shadow&&this.root.appendChild(this.createShadow(n)),0<this.strokeTolerance&&!t&&this.root.appendChild(this.createTolerance(n)),!this.pointerEvents||"path"==n.nodeName&&this.path[this.path.length-1]!=this.closeOp?this.pointerEvents||null!=this.originalRoot||n.setAttribute("pointer-events","none"):n.setAttribute("pointer-events",this.pointerEventsValue),("rect"!=n.nodeName&&"path"!=n.nodeName&&"ellipse"!=n.nodeName||"none"!=n.getAttribute("fill")&&"transparent"!=n.getAttribute("fill")||"none"!=n.getAttribute("stroke")||"none"!=n.getAttribute("pointer-events"))&&this.root.appendChild(n),this.node=null}},mxSvgCanvas2D.prototype.updateFill=function(){var t=this.state;if((t.alpha<1||t.fillAlpha<1)&&this.node.setAttribute("fill-opacity",t.alpha*t.fillAlpha),null!=t.fillColor)if(null!=t.gradientColor){var e=this.getSvgGradient(t.fillColor,t.gradientColor,t.gradientFillAlpha,t.gradientAlpha,t.gradientDirection);if(mxClient.IS_CHROME_APP||mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE||this.root.ownerDocument!=document)this.node.setAttribute("fill","url(#"+e+")");else{var n=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");this.node.setAttribute("fill","url("+n+"#"+e+")")}}else this.node.setAttribute("fill",t.fillColor.toLowerCase())},mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))},mxSvgCanvas2D.prototype.updateStroke=function(){var t=this.state;this.node.setAttribute("stroke",t.strokeColor.toLowerCase()),(t.alpha<1||t.strokeAlpha<1)&&this.node.setAttribute("stroke-opacity",t.alpha*t.strokeAlpha);var e=this.getCurrentStrokeWidth();1!=e&&this.node.setAttribute("stroke-width",e),"path"==this.node.nodeName&&this.updateStrokeAttributes(),t.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((t.fixDash?1:t.strokeWidth)*t.scale))},mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var t=this.state;if(null!=t.lineJoin&&"miter"!=t.lineJoin&&this.node.setAttribute("stroke-linejoin",t.lineJoin),null!=t.lineCap){var e=t.lineCap;"flat"==e&&(e="butt"),"butt"!=e&&this.node.setAttribute("stroke-linecap",e)}null==t.miterLimit||this.styleEnabled&&10==t.miterLimit||this.node.setAttribute("stroke-miterlimit",t.miterLimit)},mxSvgCanvas2D.prototype.createDashPattern=function(t){var e=[];if("string"==typeof this.state.dashPattern){var n=this.state.dashPattern.split(" ");if(0<n.length)for(var i=0;i<n.length;i++)e[i]=Number(n[i])*t}return e.join(" ")},mxSvgCanvas2D.prototype.createTolerance=function(t){var e=t.cloneNode(!0),n=parseFloat(e.getAttribute("stroke-width")||1)+this.strokeTolerance;return e.setAttribute("pointer-events","stroke"),e.setAttribute("visibility","hidden"),e.removeAttribute("stroke-dasharray"),e.setAttribute("stroke-width",n),e.setAttribute("fill","none"),e.setAttribute("stroke",mxClient.IS_OT?"none":"white"),e},mxSvgCanvas2D.prototype.createShadow=function(t){var e=t.cloneNode(!0),n=this.state;return"none"==e.getAttribute("fill")||mxClient.IS_FF&&"transparent"==e.getAttribute("fill")||e.setAttribute("fill",n.shadowColor),"none"!=e.getAttribute("stroke")&&e.setAttribute("stroke",n.shadowColor),e.setAttribute("transform","translate("+this.format(n.shadowDx*n.scale)+","+this.format(n.shadowDy*n.scale)+")"+(n.transform||"")),e.setAttribute("opacity",n.shadowAlpha),e},mxSvgCanvas2D.prototype.setLink=function(t){if(null==t)this.root=this.originalRoot;else{this.originalRoot=this.root;var e=this.createElement("a");null==e.setAttributeNS||this.root.ownerDocument!=document&&null==document.documentMode?e.setAttribute("xlink:href",t):e.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",t),this.root.appendChild(e),this.root=e}},mxSvgCanvas2D.prototype.rotate=function(t,e,n,i,o){if(0!=t||e||n){var s=this.state;if(i+=s.dx,o+=s.dy,i*=s.scale,o*=s.scale,s.transform=s.transform||"",e&&n)t+=180;else if(e!=n){var l=e?i:0,r=e?-1:1,a=n?o:0,h=n?-1:1;s.transform+="translate("+this.format(l)+","+this.format(a)+")scale("+this.format(r)+","+this.format(h)+")translate("+this.format(-l)+","+this.format(-a)+")"}(e?!n:n)&&(t*=-1),0!=t&&(s.transform+="rotate("+this.format(t)+","+this.format(i)+","+this.format(o)+")"),s.rotation=s.rotation+t,s.rotationCx=i,s.rotationCy=o}},mxSvgCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createElement("path")},mxSvgCanvas2D.prototype.rect=function(t,e,n,i){var o=this.state,s=this.createElement("rect");s.setAttribute("x",this.format((t+o.dx)*o.scale)),s.setAttribute("y",this.format((e+o.dy)*o.scale)),s.setAttribute("width",this.format(n*o.scale)),s.setAttribute("height",this.format(i*o.scale)),this.node=s},mxSvgCanvas2D.prototype.roundrect=function(t,e,n,i,o,s){this.rect(t,e,n,i),0<o&&this.node.setAttribute("rx",this.format(o*this.state.scale)),0<s&&this.node.setAttribute("ry",this.format(s*this.state.scale))},mxSvgCanvas2D.prototype.ellipse=function(t,e,n,i){var o=this.state,s=this.createElement("ellipse");s.setAttribute("cx",Math.round((t+n/2+o.dx)*o.scale)),s.setAttribute("cy",Math.round((e+i/2+o.dy)*o.scale)),s.setAttribute("rx",n/2*o.scale),s.setAttribute("ry",i/2*o.scale),this.node=s},mxSvgCanvas2D.prototype.image=function(t,e,n,i,o,s,l,r){o=this.converter.convert(o),s=null==s||s,l=null!=l&&l,r=null!=r&&r;var a=this.state;t+=a.dx,e+=a.dy;var h=this.createElement("image");h.setAttribute("x",this.format(t*a.scale)+this.imageOffset),h.setAttribute("y",this.format(e*a.scale)+this.imageOffset),h.setAttribute("width",this.format(n*a.scale)),h.setAttribute("height",this.format(i*a.scale)),null==h.setAttributeNS?h.setAttribute("xlink:href",o):h.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",o),s||h.setAttribute("preserveAspectRatio","none"),(a.alpha<1||a.fillAlpha<1)&&h.setAttribute("opacity",a.alpha*a.fillAlpha);var d=this.state.transform||"";if(l||r){var u=1,p=1,m=0,c=0;l&&(u=-1,m=-n-2*t),r&&(p=-1,c=-i-2*e),d+="scale("+u+","+p+")translate("+m*a.scale+","+c*a.scale+")"}0<d.length&&h.setAttribute("transform",d),this.pointerEvents||h.setAttribute("pointer-events","none"),this.root.appendChild(h),this.blockImagePointerEvents&&(h.setAttribute("style","pointer-events:none"),(h=this.createElement("rect")).setAttribute("visibility","hidden"),h.setAttribute("pointer-events","fill"),h.setAttribute("x",this.format(t*a.scale)),h.setAttribute("y",this.format(e*a.scale)),h.setAttribute("width",this.format(n*a.scale)),h.setAttribute("height",this.format(i*a.scale)),this.root.appendChild(h))},mxSvgCanvas2D.prototype.convertHtml=function(t){if(this.useDomParser){var e=(new DOMParser).parseFromString(t,"text/html");null!=e&&("<body"==(t=(new XMLSerializer).serializeToString(e.body)).substring(0,5)&&(t=t.substring(t.indexOf(">",5)+1)),"</body>"==t.substring(t.length-7,t.length)&&(t=t.substring(0,t.length-7)))}else{if(null!=document.implementation&&null!=document.implementation.createDocument){var n=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null),i=n.createElement("body");n.documentElement.appendChild(i);var o=document.createElement("div");o.innerHTML=t;for(var s=o.firstChild;null!=s;){var l=s.nextSibling;i.appendChild(n.adoptNode(s)),s=l}return i.innerHTML}var r=document.createElement("textarea");r.innerHTML=t.replace(/&amp;/g,"&amp;amp;").replace(/&#60;/g,"&amp;lt;").replace(/&#62;/g,"&amp;gt;").replace(/&lt;/g,"&amp;lt;").replace(/&gt;/g,"&amp;gt;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),t=r.value.replace(/&/g,"&amp;").replace(/&amp;lt;/g,"&lt;").replace(/&amp;gt;/g,"&gt;").replace(/&amp;amp;/g,"&amp;").replace(/<br>/g,"<br />").replace(/<hr>/g,"<hr />").replace(/(<img[^>]+)>/gm,"$1 />")}return t},mxSvgCanvas2D.prototype.createDiv=function(t,e,n,i,o,s){if(-1<t.indexOf("base64")&&(t=Base64.decode(t.split("_")[1])),!(s.cell.isGroupArea||s.cell.isHelpfulText||s.cell.linkId||s.cell.nodeId||s.cell.shouldNotAddNumStr)){workflowUi.wfEditor.wfPanelNowCellsNum++,s.cell.shouldNotAddNumStr=!0,mxClient.workflowDatas.maxNodeOrder++,t+=mxClient.workflowDatas.maxNodeOrder;for(var l=workflowUi.editor.graph,r=l.view.scale,a=l.minimumGraphSize.x||0,h=l.minimumGraphSize.y||0,d=l.minimumGraphSize.width*r||1e5,u=l.minimumGraphSize.height*r||1e5,p=l.getAllCells(a,h,d,u),m=!1,c=!1,g=0;g<p.length;++g)s.cell.edge&&p[g].edge?p[g].value.trim()==t.trim()&&(c=!0):s.cell.edge||p[g].edge||p[g].value.trim()==t.trim()&&(m=!0);(c||m)&&wfGetLabel&&(wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:m?wfGetLabel(390395,"节点名称不能重复!"):wfGetLabel(390400,"出口名称不能重复!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}}),t+="_2"),s.cell.value=t,s.cell.order=mxClient.workflowDatas.maxNodeOrder}mxClient.IS_READONLY_PAGE||(t=wfFormatMultiLang(t));var x=t;x=(x=(x=(x=(x=x.replace(/<br\/>/g,"\n")).replace(/<br>/g,"\n")).replace(/&#10;/g,"\n")).replace(/<div>/g,"")).replace(/<\/div>/g,"");var y=this.canvasStyle.shape,f=this.state,v=mxConstants.ABSOLUTE_LINE_HEIGHT?f.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*this.lineHeightCorrection;"true"!=window.urlParams.isFromWfForm&&(f.fontColor="#345e3a"),i="display:inline-block;font-size:"+f.fontSize+"px;font-family:"+f.fontFamily+";color:"+f.fontColor+";line-height:"+v+";"+i,i+="margin-top:-15px;",mxClient.IS_FF&&"rhombus"==y&&s.style.icons&&(-1<s.style.icons.indexOf("left")||-1<s.style.icons.indexOf("right"))&&(i+="margin-top:10px;"),mxClient.IS_READONLY_PAGE&&"ellipse"!=y&&"rhombus"!=y&&(i+="margin-top:-10px;"),i+="width:"+("ellipse"==y?93:"rhombus"==y?110:108)+"px;",s.cell&&s.cell.isHelpfulText&&(i+="text-align:left;white-space:pre-wrap;width:"+s.cell.geometry.width+"px;max-height:"+(s.cell.geometry.height+10)+"px;margin-top:0;overflow:hidden;"),(f.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(i+="font-weight:bold;"),(f.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(i+="font-style:italic;"),(f.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(i+="text-decoration:underline;"),e==mxConstants.ALIGN_CENTER?i+="text-align:center;":e==mxConstants.ALIGN_RIGHT&&(i+="text-align:right;");var C="";null!=f.fontBackgroundColor&&(C+="background-color:"+f.fontBackgroundColor+";"),null!=f.fontBorderColor&&(C+="border:1px solid "+f.fontBorderColor+";");t.split("_split_")[0];var E=t.split("_split_")[0],w={};if(null!=this.canvasStyle&&null!=this.canvasStyle.icons&&(w=JSON.parse(this.canvasStyle.icons)),!mxUtils.isNode(E)){E=this.convertHtml(E),this.convertHtml(E);var S=s?s.cell.id:"none";"fill"!=o&&"width"!=o?(s.cell&&s.cell.isHelpfulText&&(C+="white-space:pre-wrap;text-align:left;"),E='<div class="wf-word-line" id="wf-word-line-'+S+'" xmlns="http://www.w3.org/1999/xhtml" style="display:inline-block;text-align:inherit;text-decoration:inherit;'+C+'">'+E+"</div>"):i+=C}if(mxClient.IS_IE||!document.createElementNS)return mxUtils.isNode(E)&&this.root.ownerDocument!=document&&(E=E.outerHTML),mxUtils.parseXml('<div xmlns="http://www.w3.org/1999/xhtml" style="'+i+'">'+E+"</div>").documentElement;var b=document.createElementNS("http://www.w3.org/1999/xhtml","div");if(b.setAttribute("style",i),"true"==window.urlParams.isFromWfForm||"true"==window.urlParams.backstageReadOnly?b.setAttribute("title",x):b.setAttribute("title",wfFormatMultiLang(x)),mxUtils.isNode(E))this.root.ownerDocument!=document?b.appendChild(E.cloneNode(!0)):b.appendChild(E);else{var T=document.createElement("div");T.className="wf-nodeName","rhombus"==y?(T.style.marginTop="10px",T.style.padding="0 14px"):mxClient.IS_FF&&(T.style.marginTop="1px"),s.cell&&s.cell.isHelpfulText&&(T.style.wordBreak="break-word",T.style.maxHeight=s.cell.geometry.height+"px"),"true"!=window.urlParams.isFromWfForm&&"true"!=window.urlParams.backstageReadOnly&&(T.style.width="100%"),"true"==window.urlParams.isFromWfForm||"true"==window.urlParams.backstageReadOnly?T.setAttribute("title",x):T.setAttribute("title",wfFormatMultiLang(x)),T.innerHTML=E,b.appendChild(T)}var A=document.createElement("div");A.className="wf-nodeIcons","rhombus"==y||mxClient.IS_READONLY_FORM||(A.style.height="16px");var L=workflowUi.editor.graph.workflowDetailDatas;if(L&&L.nodeDatas&&L.nodeDatas[s.cell.nodeId]){var I=L.nodeDatas[s.cell.nodeId];"true"!=I.hasNodeAftAddOpr||w&&w.nodeAfter||(w.nodeAfter="icon-workflow-caozuohou"),"true"!=I.hasNodeBefAddOpr||w&&w.beforeNode||(w.beforeNode="icon-workflow-caozuoqian")}if(w&&w.hasOwnProperty("left")){var M=!0;if(window.urlParams.isFromWfForm&&"true"==window.urlParams.isFromWfForm&&(-1<w.left.indexOf("fencha")||-1<w.left.indexOf("fenchazhongjiandian")||-1<w.left.indexOf("hebing"))&&(M=!1),M)(R=document.createElement("span")).className=w.left,R.style.color=s.style.strokeColor,R.style.float="left","rhombus"==y&&(R.style.margin="-44px 0 0 43px"),A.appendChild(R)}if(w&&w.hasOwnProperty("right")){var R=document.createElement("span");w.right=w.right.replace(/guidang/g,"tingzhi"),R.className=w.right,R.style.color=s.style.strokeColor,R.style.float="right",A.appendChild(R)}var P=document.createElement("div");return P.className="wf-nodeOperations",P.style.height="16px","rhombus"==y&&(P.style.width="80%",P.style.marginLeft="10%"),!mxClient.IS_READONLY_FORM&&w&&w.hasOwnProperty("nodeAfter")&&((R=document.createElement("span")).className=w.nodeAfter,R.style.float="right",P.appendChild(R)),!mxClient.IS_READONLY_FORM&&w&&w.hasOwnProperty("beforeNode")&&((R=document.createElement("span")).className=w.beforeNode,R.style.float="left",P.appendChild(R)),s.cell.isGroupArea||s.cell.isHelpfulText||b.appendChild(A),s.cell.isGroupArea||s.cell.isHelpfulText||mxClient.IS_READONLY_FORM||b.appendChild(P),"true"!=window.urlParams.isFromWfForm||s.cell.isGroupArea||s.cell.isHelpfulText||this.creacreateWorkflowOperatorsteDiv(b,s,y),b},mxSvgCanvas2D.prototype.invalidateCachedOffsetSize=function(t){delete t.firstChild.mxCachedOffsetWidth,delete t.firstChild.mxCachedFinalOffsetWidth,delete t.firstChild.mxCachedFinalOffsetHeight},mxSvgCanvas2D.prototype.updateText=function(t,e,n,i,o,s,l,r,a,h,d){if(null!=d&&null!=d.firstChild&&null!=d.firstChild.firstChild&&null!=d.firstChild.firstChild.firstChild){var u=d.firstChild,p=u.firstChild,m=p.firstChild;h=null!=h?h:0;var c=this.state;t+=c.dx,e+=c.dy,a?(m.style.maxHeight=Math.round(i)+"px",m.style.maxWidth=Math.round(n)+"px"):"fill"==r?(m.style.width=Math.round(n+1)+"px",m.style.height=Math.round(i+1)+"px"):"width"==r&&(m.style.width=Math.round(n+1)+"px",0<i&&(m.style.maxHeight=Math.round(i)+"px")),l&&0<n&&(m.style.width=Math.round(n+1)+"px");var g=0,x=0,y=m;null!=y.firstChild&&"DIV"==y.firstChild.nodeName&&(y=y.firstChild);var f=null!=u.mxCachedOffsetWidth?u.mxCachedOffsetWidth:y.offsetWidth;g=f+0,l&&"fill"!=r&&(a&&(g=Math.min(g,n)),m.style.width=Math.round(g+1)+"px"),g=null!=u.mxCachedFinalOffsetWidth?u.mxCachedFinalOffsetWidth:y.offsetWidth,x=null!=u.mxCachedFinalOffsetHeight?u.mxCachedFinalOffsetHeight:y.offsetHeight,this.cacheOffsetSize&&(u.mxCachedOffsetWidth=f,u.mxCachedFinalOffsetWidth=g,u.mxCachedFinalOffsetHeight=x),g+=0,x-=2,a&&(x=Math.min(x,i),g=Math.min(g,n)),"width"==r?i=x:"fill"!=r&&(n=g,i=x);var v=0,C=0;o==mxConstants.ALIGN_CENTER?v-=n/2:o==mxConstants.ALIGN_RIGHT&&(v-=n),t+=v,s==mxConstants.ALIGN_MIDDLE?C-=i/2:s==mxConstants.ALIGN_BOTTOM&&(C-=i),"fill"!=r&&mxClient.IS_FF&&mxClient.IS_WIN&&(C-=2),e+=C;var E=1!=c.scale?"scale("+c.scale+")":"";if(0!=c.rotation&&this.rotateHtml){E+="rotate("+c.rotation+","+n/2+","+i/2+")";var w=this.rotatePoint((t+n/2)*c.scale,(e+i/2)*c.scale,c.rotation,c.rotationCx,c.rotationCy);t=w.x-n*c.scale/2,e=w.y-i*c.scale/2}else t*=c.scale,e*=c.scale;0!=h&&(E+="rotate("+h+","+-v+","+-C+")"),u.setAttribute("transform","translate("+Math.round(t)+","+Math.round(e)+")"+E),p.setAttribute("width",Math.round(Math.max(1,n))),mxClient.IS_FF?(p.setAttribute("height",Math.round(Math.max(1,50))),this.canvasStyle&&"rhombus"==this.canvasStyle.shape&&this.canvasStyle.icons&&(-1<this.canvasStyle.icons.indexOf("left")||-1<this.canvasStyle.icons.indexOf("right"))&&(p.setAttribute("height",Math.round(Math.max(1,70))),p.setAttribute("transform","translate(0,-20)"))):p.setAttribute("height",Math.round(Math.max(1,i)))}},mxSvgCanvas2D.prototype.text=function(t,e,n,i,o,s,l,r,a,h,d,u,p,m){if(-1<o.indexOf("base64")&&(o=Base64.decode(o.split("_")[1])),mxClient.IS_READONLY_PAGE||(o=wfFormatMultiLang(o)),this.textEnabled&&null!=o){u=null!=u?u:0;var c=this.state;if(t+=c.dx,e+=c.dy,this.foEnabled&&"html"==a){var g="vertical-align:top;";d?g+="overflow:hidden;max-height:"+Math.round(i)+"px;max-width:"+Math.round(n)+"px;":"fill"==h?g+="width:"+Math.round(n+1)+"px;height:"+Math.round(i+1)+"px;overflow:hidden;":"width"==h&&(g+="width:"+Math.round(n+1)+"px;",0<i&&(g+="max-height:"+Math.round(i)+"px;overflow:hidden;")),g+=r&&0<n?"width:"+Math.round(n+1)+"px;white-space:normal;word-wrap:"+mxConstants.WORD_WRAP+";":"white-space:nowrap;";var x=this.createElement("g");c.alpha<1&&x.setAttribute("opacity",c.alpha);var y=this.createElement("foreignObject");y.setAttribute("style","overflow:visible;"),y.setAttribute("pointer-events","all");var f=this.createDiv(o,s,l,g,h,m);if(null==f)return;null!=p&&f.setAttribute("dir",p),x.appendChild(y),this.root.appendChild(x);var v=0,C=0,E=2,w=2;if(!mxClient.IS_IE||9!=document.documentMode&&mxClient.IS_SVG&&!m.cell.isGroupArea){this.root.ownerDocument!=document?(f.style.visibility="hidden",document.body.appendChild(f)):y.appendChild(f);var S=f;null!=S.firstChild&&"DIV"==S.firstChild.nodeName&&(S=S.firstChild,r&&"break-word"==f.style.wordWrap&&(S.style.width="100%"));var b;if(b="ellipse"==m.style.shape?93:"rhombus"==m.style.shape?110:108,0==(L=0==S.offsetWidth?b:S.offsetWidth)&&f.parentNode==y&&(f.style.visibility="hidden",document.body.appendChild(f),L=S.offsetWidth),this.cacheOffsetSize&&(x.mxCachedOffsetWidth=L),!d&&r&&0<n&&this.root.ownerDocument!=document&&"fill"!=h&&"width"!=h){I=f.style.whiteSpace;f.style.whiteSpace="nowrap",L<S.offsetWidth&&(f.style.whiteSpace=I)}v=L+E-1,r&&"fill"!=h&&"width"!=h&&(d&&(v=Math.min(v,n)),f.style.width=v+"px"),v=0==S.offsetWidth?b:S.offsetWidth,C=0==S.offsetHeight?12:S.offsetHeight,this.cacheOffsetSize&&(x.mxCachedFinalOffsetWidth=v,x.mxCachedFinalOffsetHeight=C),C-=w,f.parentNode!=y&&(y.appendChild(f),f.style.visibility="")}else{var T=document.createElement("div");T.style.cssText=f.getAttribute("style"),T.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",T.style.position="absolute",T.style.visibility="hidden";var A=document.createElement("div");if(A.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",A.style.wordWrap=mxConstants.WORD_WRAP,A.innerHTML=mxUtils.isNode(o)?o.outerHTML:o,T.appendChild(A),document.body.appendChild(T),8!=document.documentMode&&9!=document.documentMode&&null!=c.fontBorderColor&&(E+=2,w+=2),r&&0<n){var L=A.offsetWidth;if(padDx=0,!d&&r&&0<n&&this.root.ownerDocument!=document&&"fill"!=h){var I=T.style.whiteSpace;A.style.whiteSpace="nowrap",L<A.offsetWidth&&(T.style.whiteSpace=I)}d&&(L=Math.min(L,n)),T.style.width=L+"px",v=A.offsetWidth+E+padDx,C=A.offsetHeight+w,T.style.display="inline-block",T.style.position="",T.style.visibility="",T.style.width=v+"px",f.setAttribute("style",T.style.cssText)}else v=A.offsetWidth+E,C=A.offsetHeight+w;T.parentNode.removeChild(T),y.appendChild(f)}d&&(C=Math.min(C,i),v=Math.min(v,n)),"width"==h?i=C:"fill"!=h&&(n=v,i=C),c.alpha<1&&x.setAttribute("opacity",c.alpha);var M=0,R=0;s==mxConstants.ALIGN_CENTER?M-=n/2:s==mxConstants.ALIGN_RIGHT&&(M-=n),t+=M,l==mxConstants.ALIGN_MIDDLE?R-=i/2:l==mxConstants.ALIGN_BOTTOM&&(R-=i),"fill"!=h&&mxClient.IS_FF&&mxClient.IS_WIN&&(R-=2),e+=R;var P=1!=c.scale?"scale("+c.scale+")":"";if(0!=c.rotation&&this.rotateHtml){P+="rotate("+c.rotation+","+n/2+","+i/2+")";var O=this.rotatePoint((t+n/2)*c.scale,(e+i/2)*c.scale,c.rotation,c.rotationCx,c.rotationCy);t=O.x-n*c.scale/2,e=O.y-i*c.scale/2}else t*=c.scale,e*=c.scale;if(0!=u&&(P+="rotate("+u+","+-M+","+-R+")"),x.setAttribute("transform","translate("+(Math.round(t)+this.foOffset)+","+(Math.round(e)+this.foOffset)+")"+P),y.setAttribute("width",Math.round(Math.max(1,n))),mxClient.IS_FF?(y.setAttribute("height",Math.round(Math.max(1,50))),this.canvasStyle&&"rhombus"==this.canvasStyle.shape&&this.canvasStyle.icons&&(-1<this.canvasStyle.icons.indexOf("left")||-1<this.canvasStyle.icons.indexOf("right"))&&(y.setAttribute("height",Math.round(Math.max(1,70))),y.setAttribute("transform","translate(0,-20)"))):y.setAttribute("height",Math.round(Math.max(1,i))),this.root.ownerDocument!=document){var N=this.createAlternateContent(y,t,e,n,i,o,s,l,r,a,h,d,u);if(null!=N){y.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var G=this.createElement("switch");G.appendChild(y),G.appendChild(N),x.appendChild(G)}}}else this.plainText(t,e,n,i,o,s,l,r,h,d,u,p,m)}},mxSvgCanvas2D.prototype.creacreateWorkflowOperatorsteDiv=function(t,e,n){var i=e.style.operatorFontColor||"#000000",o=e.cell.operatorNameStr||"",s=document.createElement("div");s.className="wf-NodeOperators",s.innerHTML=o,s.title=o,s.style.color=i,"rhombus"==n?s.style.padding="0 15%":"ellipse"==n&&(s.style.padding="0 10%"),t.appendChild(s)},mxSvgCanvas2D.prototype.createClip=function(t,e,n,i){for(var o="mx-clip-"+(t=Math.round(t))+"-"+(e=Math.round(e))+"-"+(n=Math.round(n))+"-"+(i=Math.round(i)),s=0,l=o+"-"+s;null!=document.getElementById(l);)l=o+"-"+ ++s;clip=this.createElement("clipPath"),clip.setAttribute("id",l);var r=this.createElement("rect");return r.setAttribute("x",t),r.setAttribute("y",e),r.setAttribute("width",n),r.setAttribute("height",i),clip.appendChild(r),clip},mxSvgCanvas2D.prototype.plainText=function(t,e,n,i,o,s,l,r,a,h,d,u,p){for(var m=p.cell.isGroupArea?p.cellBounds.width-50:p.cellBounds.width-20,c=0,g=0;g<o.length;++g)o.charCodeAt(g)<=255?c+=6:c+=12;var x=Math.floor(c/o.length),y=Math.ceil(m/x);o.length>y&&(o=o.substring(0,y)+"..."),d=null!=d?d:0;var f=this.state,v=f.fontSize,C=this.createElement("g"),E=f.transform||"";if(this.updateFont(C),0!=d&&(E+="rotate("+d+","+this.format(t*f.scale)+","+this.format(e*f.scale)+")"),null!=u&&C.setAttribute("direction",u),h&&0<n&&0<i){var w=t,S=e;s==mxConstants.ALIGN_CENTER?w-=n/2:s==mxConstants.ALIGN_RIGHT&&(w-=n),"fill"!=a&&(l==mxConstants.ALIGN_MIDDLE?S-=i/2:l==mxConstants.ALIGN_BOTTOM&&(S-=i));var b=this.createClip(w*f.scale-2,S*f.scale-2,n*f.scale+4,i*f.scale+4);if(null!=this.defs?this.defs.appendChild(b):this.root.appendChild(b),mxClient.IS_CHROME_APP||mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE||this.root.ownerDocument!=document)C.setAttribute("clip-path","url(#"+b.getAttribute("id")+")");else{var T=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");C.setAttribute("clip-path","url("+T+"#"+b.getAttribute("id")+")")}}var A=s==mxConstants.ALIGN_RIGHT?"end":s==mxConstants.ALIGN_CENTER?"middle":"start";"start"!=A&&C.setAttribute("text-anchor",A),this.styleEnabled&&v==mxConstants.DEFAULT_FONTSIZE||C.setAttribute("font-size",v*f.scale+"px"),0<E.length&&C.setAttribute("transform",E),f.alpha<1&&C.setAttribute("opacity",f.alpha);var L=o.split("\n"),I=Math.round(v*mxConstants.LINE_HEIGHT),M=v+(L.length-1)*I;S=e+v-1;if(l==mxConstants.ALIGN_MIDDLE)S-="fill"==a?i/2:(this.matchHtmlAlignment&&h&&0<i?Math.min(M,i):M)/2+1;else if(l==mxConstants.ALIGN_BOTTOM){if("fill"==a)S-=i;else S-=(this.matchHtmlAlignment&&h&&0<i?Math.min(M,i):M)+2}for(g=0;g<L.length;g++){if(0<L[g].length&&0<mxUtils.trim(L[g]).length){var R=this.createElement("text");R.setAttribute("x",this.format(t*f.scale)+this.textOffset),R.setAttribute("y",this.format(S*f.scale)+this.textOffset),R.setAttribute("title",L[g]);var P=document.createElementNS("http://www.w3.org/2000/svg","title"),O=document.createTextNode(p.cell.value);P.appendChild(O),R.appendChild(P),mxUtils.write(R,L[g]),C.appendChild(R)}S+=I}this.root.appendChild(C),this.addTextBackground(C,o,t,e,n,"fill"==a?i:M,s,l,a)},mxSvgCanvas2D.prototype.updateFont=function(t){var e=this.state;t.setAttribute("fill",e.fontColor),this.styleEnabled&&(e.fontFamily,mxConstants.DEFAULT_FONTFAMILY),(e.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&t.setAttribute("font-weight","normal"),(e.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&t.setAttribute("font-style","italic"),(e.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&t.setAttribute("text-decoration","underline")},mxSvgCanvas2D.prototype.addTextBackground=function(t,e,n,i,o,s,l,r,a){var h=this.state;if(null!=h.fontBackgroundColor||null!=h.fontBorderColor){var d=null;if("fill"==a||"width"==a)l==mxConstants.ALIGN_CENTER?n-=o/2:l==mxConstants.ALIGN_RIGHT&&(n-=o),r==mxConstants.ALIGN_MIDDLE?i-=s/2:r==mxConstants.ALIGN_BOTTOM&&(i-=s),d=new mxRectangle((n+1)*h.scale,i*h.scale,(o-2)*h.scale,(s+2)*h.scale);else if(null!=t.getBBox&&this.root.ownerDocument==document)try{d=t.getBBox();var u=mxClient.IS_IE&&mxClient.IS_SVG;d=new mxRectangle(d.x,d.y+(u?0:1),d.width,d.height+(u?1:0))}catch(t){}else{var p=document.createElement("div");p.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?h.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,p.style.fontSize=h.fontSize+"px",p.style.fontFamily=h.fontFamily,p.style.whiteSpace="nowrap",p.style.position="absolute",p.style.visibility="hidden",p.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",p.style.zoom="1",(h.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(p.style.fontWeight="bold"),(h.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(p.style.fontStyle="italic"),e=mxUtils.htmlEntities(e,!1),p.innerHTML=e.replace(/\n/g,"<br/>"),document.body.appendChild(p);o=p.offsetWidth,s=p.offsetHeight;p.parentNode.removeChild(p),l==mxConstants.ALIGN_CENTER?n-=o/2:l==mxConstants.ALIGN_RIGHT&&(n-=o),r==mxConstants.ALIGN_MIDDLE?i-=s/2:r==mxConstants.ALIGN_BOTTOM&&(i-=s),d=new mxRectangle((n+1)*h.scale,(i+2)*h.scale,o*h.scale,(s+1)*h.scale)}if(null!=d){var m=this.createElement("rect");m.setAttribute("fill",h.fontBackgroundColor||"none"),m.setAttribute("stroke",h.fontBorderColor||"none"),m.setAttribute("x",Math.floor(d.x-1)),m.setAttribute("y",Math.floor(d.y-1)),m.setAttribute("width",Math.ceil(d.width+2)),m.setAttribute("height",Math.ceil(d.height));var c=null!=h.fontBorderColor?Math.max(1,this.format(h.scale)):0;m.setAttribute("stroke-width",c),this.root.ownerDocument==document&&1==mxUtils.mod(c,2)&&m.setAttribute("transform","translate(0.5, 0.5)"),t.insertBefore(m,t.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(t){mxAbstractCanvas2D.call(this),this.root=t};function mxGuide(t,e){this.graph=t,this.setStates(e)}function mxStencil(t){this.desc=t,this.parseDescription(),this.parseConstraints()}function mxShape(t){this.stencil=t,this.initStyles()}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(t){return document.createElement(t)},mxVmlCanvas2D.prototype.createVmlElement=function(t){return this.createElement(mxClient.VML_PREFIX+":"+t)},mxVmlCanvas2D.prototype.addNode=function(t,e){var n=this.node,i=this.state;if(null!=n){if("shape"==n.nodeName){if(!(null!=this.path&&0<this.path.length))return;n.path=this.path.join(" ")+" e",n.style.width=this.root.style.width,n.style.height=this.root.style.height,n.coordsize=parseInt(n.style.width)+" "+parseInt(n.style.height)}n.strokeweight=this.format(Math.max(1,i.strokeWidth*i.scale/this.vmlScale))+"px",i.shadow&&this.root.appendChild(this.createShadow(n,t&&null!=i.fillColor,e&&null!=i.strokeColor)),e&&null!=i.strokeColor?(n.stroked="true",n.strokecolor=i.strokeColor):n.stroked="false",n.appendChild(this.createStroke()),t&&null!=i.fillColor?n.appendChild(this.createFill()):!this.pointerEvents||"shape"==n.nodeName&&this.path[this.path.length-1]!=this.closeOp?n.filled="false":n.appendChild(this.createTransparentFill()),this.root.appendChild(n)}},mxVmlCanvas2D.prototype.createTransparentFill=function(){var t=this.createVmlElement("fill");return t.src=mxClient.imageBasePath+"/transparent.gif",t.type="tile",t},mxVmlCanvas2D.prototype.createFill=function(){var t=this.state,e=this.createVmlElement("fill");if(e.color=t.fillColor,null!=t.gradientColor){e.type="gradient",e.method="none",e.color2=t.gradientColor;var n=180-t.rotation;t.gradientDirection==mxConstants.DIRECTION_WEST?n-=90+("x"==this.root.style.flip?180:0):t.gradientDirection==mxConstants.DIRECTION_EAST?n+=90+("x"==this.root.style.flip?180:0):t.gradientDirection==mxConstants.DIRECTION_NORTH?n-=180+("y"==this.root.style.flip?-180:0):n+="y"==this.root.style.flip?-180:0,"x"!=this.root.style.flip&&"y"!=this.root.style.flip||(n*=-1),e.angle=mxUtils.mod(n,360),e.opacity=t.alpha*t.gradientFillAlpha*100+"%",e.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",t.alpha*t.gradientAlpha*100+"%")}else(t.alpha<1||t.fillAlpha<1)&&(e.opacity=t.alpha*t.fillAlpha*100+"%");return e},mxVmlCanvas2D.prototype.createStroke=function(){var t=this.state,e=this.createVmlElement("stroke");return e.endcap=t.lineCap||"flat",e.joinstyle=t.lineJoin||"miter",e.miterlimit=t.miterLimit||"10",(t.alpha<1||t.strokeAlpha<1)&&(e.opacity=t.alpha*t.strokeAlpha*100+"%"),t.dashed&&(e.dashstyle=this.getVmlDashStyle()),e},mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var t="dash";if("string"==typeof this.state.dashPattern){var e=this.state.dashPattern.split(" ");0<e.length&&1==e[0]&&(t="0 2")}return t},mxVmlCanvas2D.prototype.createShadow=function(t,e,n){var i=this.state,o=-i.rotation*(Math.PI/180),s=Math.cos(o),l=Math.sin(o),r=i.shadowDx*i.scale,a=i.shadowDy*i.scale;"x"==this.root.style.flip?r*=-1:"y"==this.root.style.flip&&(a*=-1);var h=t.cloneNode(!0);return h.style.marginLeft=Math.round(r*s-a*l)+"px",h.style.marginTop=Math.round(r*l+a*s)+"px",8==document.documentMode&&(h.strokeweight=t.strokeweight,"shape"==t.nodeName&&(h.path=this.path.join(" ")+" e",h.style.width=this.root.style.width,h.style.height=this.root.style.height,h.coordsize=parseInt(t.style.width)+" "+parseInt(t.style.height))),n?(h.strokecolor=i.shadowColor,h.appendChild(this.createShadowStroke())):h.stroked="false",e?h.appendChild(this.createShadowFill()):h.filled="false",h},mxVmlCanvas2D.prototype.createShadowFill=function(){var t=this.createVmlElement("fill");return t.color=this.state.shadowColor,t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.createShadowStroke=function(){var t=this.createStroke();return t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.rotate=function(t,e,n,i,o){e&&n?t+=180:e?this.root.style.flip="x":n&&(this.root.style.flip="y"),(e?!n:n)&&(t*=-1),this.root.style.rotation=t,this.state.rotation=this.state.rotation+t,this.state.rotationCx=i,this.state.rotationCy=o},mxVmlCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createVmlElement("shape"),this.node.style.position="absolute"},mxVmlCanvas2D.prototype.quadTo=function(t,e,n,i){var o=this.state,s=(this.lastX+o.dx)*o.scale,l=(this.lastY+o.dy)*o.scale,r=(t+o.dx)*o.scale,a=(e+o.dy)*o.scale,h=(n+o.dx)*o.scale,d=(i+o.dy)*o.scale,u=s+2/3*(r-s),p=l+2/3*(a-l),m=h+2/3*(r-h),c=d+2/3*(a-d);this.path.push("c "+this.format(u)+" "+this.format(p)+" "+this.format(m)+" "+this.format(c)+" "+this.format(h)+" "+this.format(d)),this.lastX=h/o.scale-o.dx,this.lastY=d/o.scale-o.dy},mxVmlCanvas2D.prototype.createRect=function(t,e,n,i,o){var s=this.state,l=this.createVmlElement(t);return l.style.position="absolute",l.style.left=this.format((e+s.dx)*s.scale)+"px",l.style.top=this.format((n+s.dy)*s.scale)+"px",l.style.width=this.format(i*s.scale)+"px",l.style.height=this.format(o*s.scale)+"px",l},mxVmlCanvas2D.prototype.rect=function(t,e,n,i){this.node=this.createRect("rect",t,e,n,i)},mxVmlCanvas2D.prototype.roundrect=function(t,e,n,i,o,s){this.node=this.createRect("roundrect",t,e,n,i),this.node.setAttribute("arcsize",Math.max(100*o/n,100*s/i)+"%")},mxVmlCanvas2D.prototype.ellipse=function(t,e,n,i){this.node=this.createRect("oval",t,e,n,i)},mxVmlCanvas2D.prototype.image=function(t,e,n,i,o,s,l,r){var a=null;if(s){(a=this.createRect("rect",t,e,n,i)).stroked="false";var h=this.createVmlElement("fill");h.aspect=s?"atmost":"ignore",h.rotate="true",h.type="frame",h.src=o,a.appendChild(h)}else(a=this.createRect("image",t,e,n,i)).src=o;l&&r?a.style.rotation="180":l?a.style.flip="x":r&&(a.style.flip="y"),(this.state.alpha<1||this.state.fillAlpha<1)&&(a.style.filter+="alpha(opacity="+this.state.alpha*this.state.fillAlpha*100+")"),this.root.appendChild(a)},mxVmlCanvas2D.prototype.createDiv=function(t,e,n,i){var o=this.createElement("div"),s=this.state,l="";if(null!=s.fontBackgroundColor&&(l+="background-color:"+s.fontBackgroundColor+";"),null!=s.fontBorderColor&&(l+="border:1px solid "+s.fontBorderColor+";"),mxUtils.isNode(t))o.appendChild(t);else if("fill"!=i&&"width"!=i){var r=this.createElement("div");r.style.cssText=l,r.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",r.style.zoom="1",r.style.textDecoration="inherit",r.innerHTML=t,o.appendChild(r)}else o.style.cssText=l,o.innerHTML=t;var a=o.style;return a.fontSize=s.fontSize/this.vmlScale+"px",a.fontFamily=s.fontFamily,a.color=s.fontColor,a.verticalAlign="top",a.textAlign=e||"left",a.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?s.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale+"px":mxConstants.LINE_HEIGHT,(s.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a.fontWeight="bold"),(s.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a.fontStyle="italic"),(s.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(a.textDecoration="underline"),o},mxVmlCanvas2D.prototype.text=function(t,e,n,i,o,s,l,r,a,h,d,u,p){if(this.textEnabled&&null!=o){var m=this.state;if("html"==a){if(null!=m.rotation){var c=this.rotatePoint(t,e,m.rotation,m.rotationCx,m.rotationCy);t=c.x,e=c.y}8!=document.documentMode||mxClient.IS_EM?(t*=m.scale,e*=m.scale):(t+=m.dx,e+=m.dy,"fill"!=h&&l==mxConstants.ALIGN_TOP&&(e-=1));var g=8!=document.documentMode||mxClient.IS_EM?this.createElement("div"):this.createVmlElement("group");g.style.position="absolute",g.style.display="inline",g.style.left=this.format(t)+"px",g.style.top=this.format(e)+"px",g.style.zoom=m.scale;var x=this.createElement("div");x.style.position="relative",x.style.display="inline";var y=mxUtils.getAlignmentAsPoint(s,l),f=y.x,v=y.y,C=this.createDiv(o,s,l,h),E=this.createElement("div");if(null!=p&&C.setAttribute("dir",p),r&&0<n){if(d||(C.style.width=Math.round(n)+"px"),C.style.wordWrap=mxConstants.WORD_WRAP,C.style.whiteSpace="normal","break-word"==C.style.wordWrap)null!=(R=C).firstChild&&"DIV"==R.firstChild.nodeName&&(R.firstChild.style.width="100%")}else C.style.whiteSpace="nowrap";var w=m.rotation+(u||0);if(this.rotateHtml&&0!=w?(E.style.display="inline",E.style.zoom="1",E.appendChild(C),8!=document.documentMode||mxClient.IS_EM||"DIV"==this.root.nodeName?g.appendChild(E):(x.appendChild(E),g.appendChild(x))):8!=document.documentMode||mxClient.IS_EM?(C.style.display="inline",g.appendChild(C)):(x.appendChild(C),g.appendChild(x)),"DIV"!=this.root.nodeName){var S=this.createVmlElement("rect");S.stroked="false",S.filled="false",S.appendChild(g),this.root.appendChild(S)}else this.root.appendChild(g);if(d?(C.style.overflow="hidden",C.style.width=Math.round(n)+"px",mxClient.IS_QUIRKS||(C.style.maxHeight=Math.round(i)+"px")):"fill"==h?(C.style.overflow="hidden",C.style.width=Math.max(0,n)+1+"px",C.style.height=Math.max(0,i)+1+"px"):"width"==h&&(C.style.overflow="hidden",C.style.width=Math.max(0,n)+1+"px",C.style.maxHeight=Math.max(0,i)+1+"px"),this.rotateHtml&&0!=w){var b=w*(Math.PI/180),T=parseFloat(parseFloat(Math.cos(b)).toFixed(8)),A=parseFloat(parseFloat(Math.sin(-b)).toFixed(8));(b%=2*Math.PI)<0&&(b+=2*Math.PI),(b%=Math.PI)>Math.PI/2&&(b=Math.PI-b);var L=Math.cos(b),I=Math.sin(b);8!=document.documentMode||mxClient.IS_EM||(C.style.display="inline-block",E.style.display="inline-block",x.style.display="inline-block"),C.style.visibility="hidden",C.style.position="absolute",document.body.appendChild(C);var M=C;null!=M.firstChild&&"DIV"==M.firstChild.nodeName&&(M=M.firstChild);var R=M.offsetWidth+3,P=M.offsetHeight;d?(n=Math.min(n,R),P=Math.min(P,i)):n=R,r&&(C.style.width=n+"px"),mxClient.IS_QUIRKS&&(d||"width"==h)&&i<P&&(P=i,C.style.height=P+"px");var O=((i=P)-i*L+n*-I)/2-A*n*(f+.5)+T*i*(v+.5),N=(n-n*L+i*-I)/2+T*n*(f+.5)+A*i*(v+.5);if("group"==g.nodeName&&"DIV"==this.root.nodeName){var G=this.createElement("div");G.style.display="inline-block",G.style.position="absolute",G.style.left=this.format(t+(N-n/2)*m.scale)+"px",G.style.top=this.format(e+(O-i/2)*m.scale)+"px",g.parentNode.appendChild(G),G.appendChild(g)}else{var H=8!=document.documentMode||mxClient.IS_EM?m.scale:1;g.style.left=this.format(t+(N-n/2)*H)+"px",g.style.top=this.format(e+(O-i/2)*H)+"px"}E.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+T+", M12="+A+", M21="+-A+", M22="+T+", sizingMethod='auto expand')",E.style.backgroundColor=this.rotatedHtmlBackground,this.state.alpha<1&&(E.style.filter+="alpha(opacity="+100*this.state.alpha+")"),E.appendChild(C),C.style.position="",C.style.visibility=""}else if(8!=document.documentMode||mxClient.IS_EM){C.style.verticalAlign="top",this.state.alpha<1&&(g.style.filter="alpha(opacity="+100*this.state.alpha+")");var D=C.parentNode;C.style.visibility="hidden",document.body.appendChild(C),n=C.offsetWidth;P=C.offsetHeight;mxClient.IS_QUIRKS&&d&&i<P&&(P=i,C.style.height=P+"px"),i=P,C.style.visibility="",D.appendChild(C),g.style.left=this.format(t+n*f*this.state.scale)+"px",g.style.top=this.format(e+i*v*this.state.scale)+"px"}else this.state.alpha<1&&(C.style.filter="alpha(opacity="+100*this.state.alpha+")"),x.style.left=100*f+"%",x.style.top=100*v+"%"}else this.plainText(t,e,n,i,mxUtils.htmlEntities(o,!1),s,l,r,a,h,d,u,p)}},mxVmlCanvas2D.prototype.plainText=function(t,e,n,i,o,s,l,r,a,h,d,u,p){var m=this.state;t=(t+m.dx)*m.scale,e=(e+m.dy)*m.scale;var c=this.createVmlElement("shape");c.style.width="1px",c.style.height="1px",c.stroked="false";var g=this.createVmlElement("fill");g.color=m.fontColor,g.opacity=100*m.alpha+"%",c.appendChild(g);var x=this.createVmlElement("path");x.textpathok="true",x.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0),c.appendChild(x);var y=this.createVmlElement("textpath");y.style.cssText="v-text-align:"+s,y.style.align=s,y.style.fontFamily=m.fontFamily,y.string=o,y.on="true";var f=m.fontSize*m.scale/this.vmlScale;y.style.fontSize=f+"px",(m.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(y.style.fontWeight="bold"),(m.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(y.style.fontStyle="italic"),(m.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(y.style.textDecoration="underline");var v=f+(o.split("\n").length-1)*f*mxConstants.LINE_HEIGHT,C=0,E=0;if(l==mxConstants.ALIGN_BOTTOM?E=-v/2:l!=mxConstants.ALIGN_MIDDLE&&(E=v/2),null!=u){var w=(c.style.rotation=u)*(Math.PI/180);C=Math.sin(w)*E,E=Math.cos(w)*E}c.appendChild(y),c.style.left=this.format(t-C)+"px",c.style.top=this.format(e+E)+"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)},mxGuide.prototype.graph=null,mxGuide.prototype.states=null,mxGuide.prototype.horizontal=!0,mxGuide.prototype.vertical=!0,mxGuide.prototype.guideX=null,mxGuide.prototype.guideY=null,mxGuide.prototype.setStates=function(t){this.states=t},mxGuide.prototype.isEnabledForEvent=function(t){return!0},mxGuide.prototype.getGuideTolerance=function(){return this.graph.gridSize/2},mxGuide.prototype.createGuideShape=function(t){var e=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH);return e.isDashed=!0,e},mxGuide.prototype.move=function(i,t,e){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=i&&null!=t){var n=this.graph.getView().translate,o=this.graph.getView().scale,s=t.x,l=t.y,r=!1,a=null,h=null,d=!1,u=null,p=null,m=this.getGuideTolerance(),c=m,g=m,x=i.clone();x.x+=t.x,x.y+=t.y;var y=x.x,f=x.x+x.width,v=x.getCenterX(),C=x.y,E=x.y+x.height,w=x.getCenterY();function S(t,e){t+=this.graph.panDx;var n=!1;Math.abs(t-v)<c?(s=t-i.getCenterX(),c=Math.abs(t-v),n=!0):Math.abs(t-y)<c?(s=t-i.x,c=Math.abs(t-y),n=!0):Math.abs(t-f)<c&&(s=t-i.x-i.width,c=Math.abs(t-f),n=!0),n&&(a=e,h=Math.round(t-this.graph.panDx),null==this.guideX&&(this.guideX=this.createGuideShape(!0),this.guideX.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideX.pointerEvents=!1,this.guideX.init(this.graph.getView().getOverlayPane()))),r=r||n}function b(t){t+=this.graph.panDy;var e=!1;Math.abs(t-w)<g?(l=t-i.getCenterY(),g=Math.abs(t-w),e=!0):Math.abs(t-C)<g?(l=t-i.y,g=Math.abs(t-C),e=!0):Math.abs(t-E)<g&&(l=t-i.y-i.height,g=Math.abs(t-E),e=!0),e&&(u=A,p=Math.round(t-this.graph.panDy),null==this.guideY&&(this.guideY=this.createGuideShape(!1),this.guideY.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.guideY.pointerEvents=!1,this.guideY.init(this.graph.getView().getOverlayPane()))),d=d||e}for(var T=0;T<this.states.length;T++){var A=this.states[T];null!=A&&(this.horizontal&&(S.call(this,A.getCenterX(),A),S.call(this,A.x,A),S.call(this,A.x+A.width,A)),this.vertical&&(b.call(this,A.getCenterY(),A),b.call(this,A.y,A),b.call(this,A.y+A.height,A)))}if(e){if(!r){var L=i.x-(this.graph.snap(i.x/o-n.x)+n.x)*o;s=this.graph.snap(s/o)*o-L}if(!d){var I=i.y-(this.graph.snap(i.y/o-n.y)+n.y)*o;l=this.graph.snap(l/o)*o-I}}var M=this.graph.container;r||null==this.guideX?null!=this.guideX&&(null!=a&&null!=i&&(minY=Math.min(i.y+l-this.graph.panDy,a.y),maxY=Math.max(i.y+i.height+l-this.graph.panDy,a.y+a.height)),null!=minY&&null!=maxY?this.guideX.points=[new mxPoint(h,minY),new mxPoint(h,maxY)]:this.guideX.points=[new mxPoint(h,-this.graph.panDy),new mxPoint(h,M.scrollHeight-3-this.graph.panDy)],this.guideX.stroke=this.getGuideColor(a,!0),this.guideX.node.style.visibility="visible",this.guideX.redraw()):this.guideX.node.style.visibility="hidden",d||null==this.guideY?null!=this.guideY&&(null!=u&&null!=i&&(minX=Math.min(i.x+s-this.graph.panDx,u.x),maxX=Math.max(i.x+i.width+s-this.graph.panDx,u.x+u.width)),null!=minX&&null!=maxX?this.guideY.points=[new mxPoint(minX,p),new mxPoint(maxX,p)]:this.guideY.points=[new mxPoint(-this.graph.panDx,p),new mxPoint(M.scrollWidth-3-this.graph.panDx,p)],this.guideY.stroke=this.getGuideColor(u,!1),this.guideY.node.style.visibility="visible",this.guideY.redraw()):this.guideY.node.style.visibility="hidden",t=new mxPoint(s,l)}return t},mxGuide.prototype.getGuideColor=function(t,e){return mxConstants.GUIDE_COLOR},mxGuide.prototype.hide=function(){this.setVisible(!1)},mxGuide.prototype.setVisible=function(t){null!=this.guideX&&(this.guideX.node.style.visibility=t?"visible":"hidden"),null!=this.guideY&&(this.guideY.node.style.visibility=t?"visible":"hidden")},mxGuide.prototype.destroy=function(){null!=this.guideX&&(this.guideX.destroy(),this.guideX=null),null!=this.guideY&&(this.guideY.destroy(),this.guideY=null)},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 t=this.desc.getAttribute("aspect");this.aspect=null!=t?t:"variable";var e=this.desc.getAttribute("strokewidth");this.strokewidth=null!=e?e:"1"},mxStencil.prototype.parseConstraints=function(){var t=this.desc.getElementsByTagName("connections")[0];if(null!=t){var e=mxUtils.getChildNodes(t);if(null!=e&&0<e.length){this.constraints=[];for(var n=0;n<e.length;n++)this.constraints.push(this.parseConstraint(e[n]))}}},mxStencil.prototype.parseConstraint=function(t){var e=Number(t.getAttribute("x")),n=Number(t.getAttribute("y")),i="1"==t.getAttribute("perimeter"),o=t.getAttribute("name");return new mxConnectionConstraint(new mxPoint(e,n),i,o)},mxStencil.prototype.evaluateTextAttribute=function(t,e,n){var i=this.evaluateAttribute(t,e,n),o=t.getAttribute("localized");return(mxStencil.defaultLocalized&&null==o||"1"==o)&&(i=mxResources.get(i)),i},mxStencil.prototype.evaluateAttribute=function(t,e,n){var i=t.getAttribute(e);if(null==i){var o=mxUtils.getTextContent(t);if(null!=o&&mxStencil.allowEval){var s=mxUtils.eval(o);"function"==typeof s&&(i=s(n))}}return i},mxStencil.prototype.drawShape=function(t,e,n,i,o,s){var l=mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,null),r=this.computeAspect(e.style,n,i,o,s,l),a=Math.min(r.width,r.height),h="inherit"==this.strokewidth?Number(mxUtils.getNumber(e.style,mxConstants.STYLE_STROKEWIDTH,1)):Number(this.strokewidth)*a;t.setStrokeWidth(h),this.drawChildren(t,e,n,i,o,s,this.bgNode,r,!1,!0),this.drawChildren(t,e,n,i,o,s,this.fgNode,r,!0,!e.outline||null==e.style||0==mxUtils.getValue(e.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0))},mxStencil.prototype.drawChildren=function(t,e,n,i,o,s,l,r,a,h){if(null!=l&&0<o&&0<s)for(var d=l.firstChild;null!=d;)d.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(t,e,d,r,a,h),d=d.nextSibling},mxStencil.prototype.computeAspect=function(t,e,n,i,o,s){var l=e,r=n,a=i/this.w0,h=o/this.h0,d=s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH;if(d){h=i/this.h0,a=o/this.w0;var u=(i-o)/2;l+=u,r-=u}return"fixed"==this.aspect&&(a=h=Math.min(a,h),d?(l+=(o-this.w0*a)/2,r+=(i-this.h0*h)/2):(l+=(i-this.w0*a)/2,r+=(o-this.h0*h)/2)),new mxRectangle(l,r,a,h)},mxStencil.prototype.drawNode=function(t,e,n,i,o,s){var l=n.nodeName,r=i.x,a=i.y,h=i.width,d=i.height,u=Math.min(h,d);if("save"==l)t.save();else if("restore"==l)t.restore();else if(s){if("path"==l){t.begin();for(var p=n.firstChild;null!=p;)p.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(t,e,p,i,o,s),p=p.nextSibling}else if("close"==l)t.close();else if("move"==l)t.moveTo(r+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*d);else if("line"==l)t.lineTo(r+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*d);else if("quad"==l)t.quadTo(r+Number(n.getAttribute("x1"))*h,a+Number(n.getAttribute("y1"))*d,r+Number(n.getAttribute("x2"))*h,a+Number(n.getAttribute("y2"))*d);else if("curve"==l)t.curveTo(r+Number(n.getAttribute("x1"))*h,a+Number(n.getAttribute("y1"))*d,r+Number(n.getAttribute("x2"))*h,a+Number(n.getAttribute("y2"))*d,r+Number(n.getAttribute("x3"))*h,a+Number(n.getAttribute("y3"))*d);else if("arc"==l)t.arcTo(Number(n.getAttribute("rx"))*h,Number(n.getAttribute("ry"))*d,Number(n.getAttribute("x-axis-rotation")),Number(n.getAttribute("large-arc-flag")),Number(n.getAttribute("sweep-flag")),r+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*d);else if("rect"==l)t.rect(r+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*d,Number(n.getAttribute("w"))*h,Number(n.getAttribute("h"))*d);else if("roundrect"==l){var m=Number(n.getAttribute("arcsize"));0==m&&(m=100*mxConstants.RECTANGLE_ROUNDING_FACTOR);var c=Number(n.getAttribute("w"))*h,g=Number(n.getAttribute("h"))*d,x=Number(m)/100,y=Math.min(c*x,g*x);t.roundrect(r+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*d,c,g,y,y)}else if("ellipse"==l)t.ellipse(r+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*d,Number(n.getAttribute("w"))*h,Number(n.getAttribute("h"))*d);else if("image"==l){if(!e.outline){var f=this.evaluateAttribute(n,"src",e);t.image(r+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*d,Number(n.getAttribute("w"))*h,Number(n.getAttribute("h"))*d,f,!1,"1"==n.getAttribute("flipH"),"1"==n.getAttribute("flipV"))}}else if("text"==l){if(!e.outline){var v=this.evaluateTextAttribute(n,"str",e),C="1"==n.getAttribute("vertical")?-90:0;if("0"==n.getAttribute("align-shape")){var E=e.rotation,w=1==mxUtils.getValue(e.style,mxConstants.STYLE_FLIPH,0),S=1==mxUtils.getValue(e.style,mxConstants.STYLE_FLIPV,0);w&&S?C-=E:w||S?C+=E:C-=E}C-=n.getAttribute("rotation"),t.text(r+Number(n.getAttribute("x"))*h,a+Number(n.getAttribute("y"))*d,0,0,v,n.getAttribute("align")||"left",n.getAttribute("valign")||"top",!1,"",null,!1,C)}}else if("include-shape"==l){var b=mxStencilRegistry.getStencil(n.getAttribute("name"));if(null!=b){var T=r+Number(n.getAttribute("x"))*h,A=a+Number(n.getAttribute("y"))*d;c=Number(n.getAttribute("w"))*h,g=Number(n.getAttribute("h"))*d;b.drawShape(t,e,T,A,c,g)}}else if("fillstroke"==l)t.fillAndStroke();else if("fill"==l)t.fill();else if("stroke"==l)t.stroke();else if("strokewidth"==l){var L="1"==n.getAttribute("fixed")?1:u;t.setStrokeWidth(Number(n.getAttribute("width"))*L)}else if("dashed"==l)t.setDashed("1"==n.getAttribute("dashed"));else if("dashpattern"==l){var I=n.getAttribute("pattern");if(null!=I){for(var M=I.split(" "),R=[],P=0;P<M.length;P++)0<M[P].length&&R.push(Number(M[P])*u);I=R.join(" "),t.setDashPattern(I)}}else"strokecolor"==l?t.setStrokeColor(n.getAttribute("color")):"linecap"==l?t.setLineCap(n.getAttribute("cap")):"linejoin"==l?t.setLineJoin(n.getAttribute("join")):"miterlimit"==l?t.setMiterLimit(Number(n.getAttribute("limit"))):"fillcolor"==l?t.setFillColor(n.getAttribute("color")):"alpha"==l?t.setAlpha(n.getAttribute("alpha")):"fontcolor"==l?t.setFontColor(n.getAttribute("color")):"fontstyle"==l?t.setFontStyle(n.getAttribute("style")):"fontfamily"==l?t.setFontFamily(n.getAttribute("family")):"fontsize"==l&&t.setFontSize(Number(n.getAttribute("size"))*u);!o||"fillstroke"!=l&&"fill"!=l&&"stroke"!=l||(o=!1,t.setShadow(!1))}},mxShape.prototype.dialect=null,mxShape.prototype.scale=1,mxShape.prototype.antiAlias=!0,mxShape.prototype.minSvgStrokeWidth=1,mxShape.prototype.bounds=null,mxShape.prototype.points=null,mxShape.prototype.node=null,mxShape.prototype.state=null,mxShape.prototype.style=null,mxShape.prototype.boundingBox=null,mxShape.prototype.stencil=null,mxShape.prototype.svgStrokeTolerance=8,mxShape.prototype.pointerEvents=!0,mxShape.prototype.svgPointerEvents="all",mxShape.prototype.shapePointerEvents=!1,mxShape.prototype.stencilPointerEvents=!1,mxShape.prototype.vmlScale=1,mxShape.prototype.outline=!1,mxShape.prototype.visible=!0,mxShape.prototype.useSvgBoundingBox=!1,mxShape.prototype.init=function(t){null==this.node&&(this.node=this.create(t),null!=t&&t.appendChild(this.node))},mxShape.prototype.initStyles=function(t){this.strokewidth=1,this.rotation=0,this.opacity=100,this.fillOpacity=100,this.strokeOpacity=100,this.flipH=!1,this.flipV=!1},mxShape.prototype.isParseVml=function(){return!0},mxShape.prototype.isHtmlAllowed=function(){return!1},mxShape.prototype.getSvgScreenOffset=function(){var t=this.stencil&&"inherit"!=this.stencil.strokewidth?Number(this.stencil.strokewidth):this.strokewidth;return 1==mxUtils.mod(Math.max(1,Math.round(t*this.scale)),2)?.5:0},mxShape.prototype.create=function(t){return null!=t&&null!=t.ownerSVGElement?this.createSvg(t):8==document.documentMode||!mxClient.IS_VML||this.dialect!=mxConstants.DIALECT_VML&&this.isHtmlAllowed()?this.createHtml(t):this.createVml(t)},mxShape.prototype.createSvg=function(){return document.createElementNS(mxConstants.NS_SVG,"g")},mxShape.prototype.createVml=function(){var t=document.createElement(mxClient.VML_PREFIX+":group");return t.style.position="absolute",t},mxShape.prototype.createHtml=function(){var t=document.createElement("div");return t.style.position="absolute",t},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.redrawShape():this.redrawHtmlShape(),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 t=this.points;if(null!=t&&0<t.length&&null!=t[0]){this.bounds=new mxRectangle(Number(t[0].x),Number(t[0].y),1,1);for(var e=1;e<this.points.length;e++)null!=t[e]&&this.bounds.add(new mxRectangle(Number(t[e].x),Number(t[e].y),1,1))}},mxShape.prototype.getLabelBounds=function(t){var e=mxUtils.getValue(this.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),n=t;if(e!=mxConstants.DIRECTION_SOUTH&&e!=mxConstants.DIRECTION_NORTH&&null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()){var i=(n=n.clone()).width;n.width=n.height,n.height=i}var o=this.getLabelMargins(n);if(null==o)return t;var s="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,!1),l="1"==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,!1);if(null!=this.state&&null!=this.state.text&&this.state.text.isPaintBoundsInverted()){i=o.x;o.x=o.height,o.height=o.width,o.width=o.y,o.y=i,i=s,s=l,l=i}return mxUtils.getDirectedBounds(t,o,this.style,s,l)},mxShape.prototype.getLabelMargins=function(t){return null},mxShape.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&0<this.scale&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&0<this.bounds.width&&0<this.bounds.height},mxShape.prototype.createVmlGroup=function(){var t=document.createElement(mxClient.VML_PREFIX+":group");return t.style.position="absolute",t.style.width=this.node.style.width,t.style.height=this.node.style.height,t},mxShape.prototype.redrawShape=function(){var t=this.createCanvas();null!=t&&(t.pointerEvents=this.pointerEvents,this.paint(t),this.node!=t.root&&this.node.insertAdjacentHTML("beforeend",t.root.outerHTML),"DIV"==this.node.nodeName&&8==document.documentMode&&(this.node.style.filter="",mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(t))},mxShape.prototype.createCanvas=function(){var t=null;return null!=this.node.ownerSVGElement?t=this.createSvgCanvas():mxClient.IS_VML&&(this.updateVmlContainer(),t=this.createVmlCanvas()),null!=t&&this.outline&&(t.setStrokeWidth(this.strokewidth),t.setStrokeColor(this.stroke),null!=this.isDashed&&t.setDashed(this.isDashed),t.setStrokeWidth=function(){},t.setStrokeColor=function(){},t.setFillColor=function(){},t.setGradient=function(){},t.setDashed=function(){},t.text=function(){}),t},mxShape.prototype.createSvgCanvas=function(){var t=new mxSvgCanvas2D(this.node,!1);t.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,t.pointerEventsValue=this.svgPointerEvents,t.blockImagePointerEvents=mxClient.IS_FF;var e=this.getSvgScreenOffset();return 0!=e?this.node.setAttribute("transform","translate("+e+","+e+")"):this.node.removeAttribute("transform"),t.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(t.format=function(t){return Math.round(parseFloat(t))}),t},mxShape.prototype.createVmlCanvas=function(){var t=8==document.documentMode&&this.isParseVml()?this.createVmlGroup():this.node,e=new mxVmlCanvas2D(t,!1);if(""!=t.tagUrn){var n=Math.max(1,Math.round(this.bounds.width)),i=Math.max(1,Math.round(this.bounds.height));t.coordsize=n*this.vmlScale+","+i*this.vmlScale,e.scale(this.vmlScale),e.vmlScale=this.vmlScale}var o=this.scale;return e.translate(-Math.round(this.bounds.x/o),-Math.round(this.bounds.y/o)),e},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 t=Math.max(1,Math.round(this.bounds.width)),e=Math.max(1,Math.round(this.bounds.height));this.node.style.width=t+"px",this.node.style.height=e+"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(t){var e="";if(this.opacity<100&&(e+="alpha(opacity="+this.opacity+")"),this.isShadow&&(e+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.VML_SHADOWCOLOR+"')"),null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var n=this.fill,i=this.gradient,o="0",s={east:0,south:1,west:2,north:3},l=null!=this.direction?s[this.direction]:0;if(null!=this.gradientDirection&&(l=mxUtils.mod(l+s[this.gradientDirection]-1,4)),1==l){o="1";var r=n;n=i,i=r}else if(2==l){r=n;n=i,i=r}else 3==l&&(o="1");e+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+n+"', endColorStr='"+i+"', gradientType='"+o+"')"}t.style.filter=e},mxShape.prototype.updateHtmlColors=function(t){var e=this.stroke;null!=e&&e!=mxConstants.NONE?(t.style.borderColor=e,this.isDashed?t.style.borderStyle="dashed":0<this.strokewidth&&(t.style.borderStyle="solid"),t.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):t.style.borderWidth="0px",null!=(e=this.outline?null:this.fill)&&e!=mxConstants.NONE?(t.style.backgroundColor=e,t.style.backgroundImage="none"):this.pointerEvents?t.style.backgroundColor="transparent":8==document.documentMode?mxUtils.addTransparentBackgroundFilter(t):this.setTransparentBackgroundImage(t)},mxShape.prototype.updateHtmlBounds=function(t){var e=9<=document.documentMode?0:Math.ceil(this.strokewidth*this.scale);t.style.borderWidth=Math.max(1,e)+"px",t.style.overflow="hidden",t.style.left=Math.round(this.bounds.x-e/2)+"px",t.style.top=Math.round(this.bounds.y-e/2)+"px","CSS1Compat"==document.compatMode&&(e=-e),t.style.width=Math.round(Math.max(0,this.bounds.width+e))+"px",t.style.height=Math.round(Math.max(0,this.bounds.height+e))+"px"},mxShape.prototype.destroyCanvas=function(t){if(t instanceof mxSvgCanvas2D){for(var e in t.gradients){var n=t.gradients[e];null!=n&&(n.mxRefCount=(n.mxRefCount||0)+1)}this.releaseSvgGradients(this.oldGradients),this.oldGradients=t.gradients}},mxShape.prototype.paint=function(t){var e=!1;if(null!=t&&this.outline){var n=t.stroke;t.stroke=function(){e=!0,n.apply(this,arguments)};var i=t.fillAndStroke;t.fillAndStroke=function(){e=!0,i.apply(this,arguments)}}var o=this.scale,s=this.bounds.x/o,l=this.bounds.y/o,r=this.bounds.width/o,a=this.bounds.height/o;if(this.isPaintBoundsInverted()){var h=(r-a)/2;s+=h,l-=h;var d=r;r=a,a=d}this.updateTransform(t,s,l,r,a),this.configureCanvas(t,s,l,r,a);var u=null;if(null==this.stencil&&null==this.points&&this.shapePointerEvents||null!=this.stencil&&this.stencilPointerEvents){var p=this.createBoundingBox();if(this.dialect==mxConstants.DIALECT_SVG)u=this.createTransparentSvgRectangle(p.x,p.y,p.width,p.height),this.node.appendChild(u);else{var m=t.createRect("rect",p.x/o,p.y/o,p.width/o,p.height/o);m.appendChild(t.createTransparentFill()),m.stroked="false",t.root.appendChild(m)}}if(null!=this.stencil)this.stencil.drawShape(t,this,s,l,r,a);else if(t.setStrokeWidth(this.strokewidth),null!=this.points){for(var c=[],g=0;g<this.points.length;g++)null!=this.points[g]&&c.push(new mxPoint(this.points[g].x/o,this.points[g].y/o));this.paintEdgeShape(t,c)}else this.paintVertexShape(t,s,l,r,a);null!=u&&null!=t.state&&null!=t.state.transform&&u.setAttribute("transform",t.state.transform),null!=t&&this.outline&&!e&&(t.rect(s,l,r,a),t.stroke())},mxShape.prototype.configureCanvas=function(t,e,n,i,o){var s=null;if(null!=this.style&&(s=this.style.dashPattern),t.canvasStyle=this.style,t.setAlpha(this.opacity/100),t.setFillAlpha(this.fillOpacity/100),t.setStrokeAlpha(this.strokeOpacity/100),null!=this.isShadow&&t.setShadow(this.isShadow),null!=this.isDashed&&t.setDashed(this.isDashed,null!=this.style&&1==mxUtils.getValue(this.style,mxConstants.STYLE_FIX_DASH,!1)),null!=s&&t.setDashPattern(s),null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var l=this.getGradientBounds(t,e,n,i,o);t.setGradient(this.fill,this.gradient,l.x,l.y,l.width,l.height,this.gradientDirection)}else t.setFillColor(this.fill);t.canvasStyle&&"connector"==t.canvasStyle.shape&&"#000000"==this.stroke&&(this.stroke="#8c8c8c"),t.setStrokeColor(this.stroke)},mxShape.prototype.getGradientBounds=function(t,e,n,i,o){return new mxRectangle(e,n,i,o)},mxShape.prototype.updateTransform=function(t,e,n,i,o){t.scale(this.scale),t.rotate(this.getShapeRotation(),this.flipH,this.flipV,e+i/2,n+o/2)},mxShape.prototype.paintVertexShape=function(t,e,n,i,o){this.paintBackground(t,e,n,i,o),this.outline&&null!=this.style&&0!=mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)||(t.setShadow(!1),this.paintForeground(t,e,n,i,o))},mxShape.prototype.paintBackground=function(t,e,n,i,o){},mxShape.prototype.paintForeground=function(t,e,n,i,o){},mxShape.prototype.paintEdgeShape=function(t,e){},mxShape.prototype.getArcSize=function(t,e){var n=0;if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))n=Math.min(t/2,Math.min(e/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else{var i=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;n=Math.min(t*i,e*i)}return n},mxShape.prototype.paintGlassEffect=function(t,e,n,i,o,s){var l=Math.ceil(this.strokewidth/2);t.setGradient("#ffffff","#ffffff",e,n,i,.6*o,"south",.9,.1),t.begin(),s+=2*l,this.isRounded?(t.moveTo(e-l+s,n-l),t.quadTo(e-l,n-l,e-l,n-l+s),t.lineTo(e-l,n+.4*o),t.quadTo(e+.5*i,n+.7*o,e+i+l,n+.4*o),t.lineTo(e+i+l,n-l+s),t.quadTo(e+i+l,n-l,e+i+l-s,n-l)):(t.moveTo(e-l,n-l),t.lineTo(e-l,n+.4*o),t.quadTo(e+.5*i,n+.7*o,e+i+l,n+.4*o),t.lineTo(e+i+l,n-l)),t.close(),t.fill()},mxShape.prototype.addPoints=function(t,e,n,i,o,s,l){if(null!=e&&0<e.length){l=null==l||l;var r=e[e.length-1];if(o&&n){var a=(e=e.slice())[0],h=new mxPoint(r.x+(a.x-r.x)/2,r.y+(a.y-r.y)/2);e.splice(0,0,h)}var d=e[0],u=1;for(l?t.moveTo(d.x,d.y):t.lineTo(d.x,d.y);u<(o?e.length:e.length-1);){var p=e[mxUtils.mod(u,e.length)],m=d.x-p.x,c=d.y-p.y;if(n&&(0!=m||0!=c)&&(null==s||mxUtils.indexOf(s,u-1)<0)){var g=Math.sqrt(m*m+c*c),x=m*Math.min(i,g/2)/g,y=c*Math.min(i,g/2)/g,f=p.x+x,v=p.y+y;t.lineTo(f,v);for(var C=e[mxUtils.mod(u+1,e.length)];u<e.length-2&&0==Math.round(C.x-p.x)&&0==Math.round(C.y-p.y);)C=e[mxUtils.mod(u+2,e.length)],u++;m=C.x-p.x,c=C.y-p.y,g=Math.max(1,Math.sqrt(m*m+c*c));var E=m*Math.min(i,g/2)/g,w=c*Math.min(i,g/2)/g,S=p.x+E,b=p.y+w;t.quadTo(p.x,p.y,S,b),p=new mxPoint(S,b)}else t.lineTo(p.x,p.y);d=p,u++}o?t.close():t.lineTo(r.x,r.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(t){if(this.state=t,this.style=t.style,null!=this.style){if(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.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),this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH){var e=this.flipH;this.flipH=this.flipV,this.flipV=e}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(t){null==t&&(t=""),this.cursor=t,null!=this.node&&(this.node.style.cursor=t)},mxShape.prototype.getCursor=function(){return this.cursor},mxShape.prototype.isRoundable=function(){return!1},mxShape.prototype.updateBoundingBox=function(){if(this.useSvgBoundingBox&&null!=this.node&&null!=this.node.ownerSVGElement)try{var t=this.node.getBBox();if(0<t.width&&0<t.height)return this.boundingBox=new mxRectangle(t.x,t.y,t.width,t.height),void this.boundingBox.grow(this.strokewidth*this.scale/2)}catch(t){}if(null!=this.bounds){var e=this.createBoundingBox();if(null!=e){this.augmentBoundingBox(e);var n=this.getShapeRotation();0!=n&&(e=mxUtils.getBoundingBox(e,n))}this.boundingBox=e}},mxShape.prototype.createBoundingBox=function(){var t=this.bounds.clone();return(null==this.stencil||this.direction!=mxConstants.DIRECTION_NORTH&&this.direction!=mxConstants.DIRECTION_SOUTH)&&!this.isPaintBoundsInverted()||t.rotate90(),t},mxShape.prototype.augmentBoundingBox=function(t){this.isShadow&&(t.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale),t.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale)),t.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 t=this.getRotation();return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(t+=mxText.prototype.verticalTextRotation),t},mxShape.prototype.getShapeRotation=function(){var t=this.getRotation();return null!=this.direction&&(this.direction==mxConstants.DIRECTION_NORTH?t+=270:this.direction==mxConstants.DIRECTION_WEST?t+=180:this.direction==mxConstants.DIRECTION_SOUTH&&(t+=90)),t},mxShape.prototype.createTransparentSvgRectangle=function(t,e,n,i){var o=document.createElementNS(mxConstants.NS_SVG,"rect");return o.setAttribute("x",t),o.setAttribute("y",e),o.setAttribute("width",n),o.setAttribute("height",i),o.setAttribute("fill","none"),o.setAttribute("stroke","none"),o.setAttribute("pointer-events","all"),o},mxShape.prototype.setTransparentBackgroundImage=function(t){t.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(t){if(null!=t)for(var e in t){var n=t[e];null!=n&&(n.mxRefCount=(n.mxRefCount||0)-1,0==n.mxRefCount&&null!=n.parentNode&&n.parentNode.removeChild(n))}},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(t,e){mxStencilRegistry.stencils[t]=e},getStencil:function(t){return mxStencilRegistry.stencils[t]}},mxMarker={markers:[],addMarker:function(t,e){mxMarker.markers[t]=e},createMarker:function(t,e,n,i,o,s,l,r,a,h){var d=mxMarker.markers[n];return null!=d?d(t,e,n,i,o,s,l,r,a,h):null}};function mxActor(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxCloud(t,e,n,i){mxActor.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxRectangleShape(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxEllipse(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxDoubleEllipse(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxRhombus(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxPolyline(t,e,n){mxShape.call(this),this.points=t,this.stroke=e,this.strokewidth=null!=n?n:1}function mxArrow(t,e,n,i,o,s,l){mxShape.call(this),this.points=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1,this.arrowWidth=null!=o?o:mxConstants.ARROW_WIDTH,this.spacing=null!=s?s:mxConstants.ARROW_SPACING,this.endSize=null!=l?l:mxConstants.ARROW_SIZE}function mxArrowConnector(t,e,n,i,o,s,l){mxShape.call(this),this.points=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1,this.arrowWidth=null!=o?o:mxConstants.ARROW_WIDTH,this.arrowSpacing=null!=s?s:mxConstants.ARROW_SPACING,this.startSize=mxConstants.ARROW_SIZE/5,this.endSize=mxConstants.ARROW_SIZE/5}function mxText(t,e,n,i,o,s,l,r,a,h,d,u,p,m,c,g,x,y,f,v,C){mxShape.call(this),this.value=t,this.bounds=e,this.color=null!=o?o:"black",this.align=null!=n?n:mxConstants.ALIGN_CENTER,this.valign=null!=i?i:mxConstants.ALIGN_MIDDLE,this.family=null!=s?s:mxConstants.DEFAULT_FONTFAMILY,this.size=null!=l?l:mxConstants.DEFAULT_FONTSIZE,this.fontStyle=null!=r?r:mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(a||2),this.spacingTop=this.spacing+parseInt(h||0),this.spacingRight=this.spacing+parseInt(d||0),this.spacingBottom=this.spacing+parseInt(u||0),this.spacingLeft=this.spacing+parseInt(p||0),this.horizontal=null==m||m,this.background=c,this.border=g,this.wrap=null!=x&&x,this.clipped=null!=y&&y,this.overflow=null!=f?f:"visible",this.labelPadding=null!=v?v:0,this.textDirection=C,this.rotation=0,this.updateMargin()}function mxTriangle(){mxActor.call(this)}function mxHexagon(){mxActor.call(this)}function mxLine(t,e,n){mxShape.call(this),this.bounds=t,this.stroke=e,this.strokewidth=null!=n?n:1}function mxImageShape(t,e,n,i,o){mxShape.call(this),this.bounds=t,this.image=e,this.fill=n,this.stroke=i,this.strokewidth=null!=o?o:1,this.shadow=!1}function mxLabel(t,e,n,i){mxRectangleShape.call(this,t,e,n,i)}function mxCylinder(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxConnector(t,e,n){mxPolyline.call(this,t,e,n)}function mxSwimlane(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxGraphLayout(t){this.graph=t}function WeightedCellSorter(t,e){this.cell=t,this.weightedValue=e}function mxStackLayout(t,e,n,i,o,s){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.spacing=null!=n?n:0,this.x0=null!=i?i:0,this.y0=null!=o?o:0,this.border=null!=s?s:0}function mxPartitionLayout(t,e,n,i){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.spacing=n||0,this.border=i||0}function mxCompactTreeLayout(t,e,n){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.invert=null!=n&&n}function mxRadialTreeLayout(t){mxCompactTreeLayout.call(this,t,!1)}function mxFastOrganicLayout(t){mxGraphLayout.call(this,t)}function mxCircleLayout(t,e){mxGraphLayout.call(this,t),this.radius=null!=e?e:100}function mxParallelEdgeLayout(t){mxGraphLayout.call(this,t)}function mxCompositeLayout(t,e,n){mxGraphLayout.call(this,t),this.layouts=e,this.master=n}function mxEdgeLabelLayout(t,e){mxGraphLayout.call(this,t)}function mxGraphAbstractHierarchyCell(){this.x=[],this.y=[],this.temp=[]}function mxGraphHierarchyNode(t){mxGraphAbstractHierarchyCell.apply(this,arguments),this.cell=t,this.id=mxObjectIdentity.get(t),this.connectsAsTarget=[],this.connectsAsSource=[]}function mxGraphHierarchyEdge(t){mxGraphAbstractHierarchyCell.apply(this,arguments),this.edges=t,this.ids=[];for(var e=0;e<t.length;e++)this.ids.push(mxObjectIdentity.get(t[e]))}function mxGraphHierarchyModel(t,e,n,i,o){t.getGraph();this.tightenToSource=o,this.roots=n,this.parent=i,this.vertexMapper=new mxDictionary,this.edgeMapper=new mxDictionary,this.maxRank=0;var s=[];null==e&&(e=this.graph.getChildVertices(i)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(t,e,s);for(var l=0;l<e.length;l++){for(var r=s[l].connectsAsSource,a=0;a<r.length;a++){var h=r[a],d=h.edges;if(null!=d&&0<d.length){var u=d[0],p=t.getVisibleTerminal(u,!1),m=this.vertexMapper.get(p);s[l]==m&&(p=t.getVisibleTerminal(u,!0),m=this.vertexMapper.get(p)),null!=m&&s[l]!=m&&(0==(h.target=m).connectsAsTarget.length&&(m.connectsAsTarget=[]),mxUtils.indexOf(m.connectsAsTarget,h)<0&&m.connectsAsTarget.push(h))}}s[l].temp[0]=1}}function mxSwimlaneModel(t,e,n,i,o){t.getGraph();this.tightenToSource=o,this.roots=n,this.parent=i,this.vertexMapper=new mxDictionary,this.edgeMapper=new mxDictionary,this.maxRank=0;var s=[];null==e&&(e=this.graph.getChildVertices(i)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(t,e,s);for(var l=0;l<e.length;l++){for(var r=s[l].connectsAsSource,a=0;a<r.length;a++){var h=r[a],d=h.edges;if(null!=d&&0<d.length){var u=d[0],p=t.getVisibleTerminal(u,!1),m=this.vertexMapper.get(p);s[l]==m&&(p=t.getVisibleTerminal(u,!0),m=this.vertexMapper.get(p)),null!=m&&s[l]!=m&&(0==(h.target=m).connectsAsTarget.length&&(m.connectsAsTarget=[]),mxUtils.indexOf(m.connectsAsTarget,h)<0&&m.connectsAsTarget.push(h))}}s[l].temp[0]=1}}function mxHierarchicalLayoutStage(){}function mxMedianHybridCrossingReduction(t){this.layout=t}function MedianCellSorter(){}function mxMinimumCycleRemover(t){this.layout=t}function mxCoordinateAssignment(t,e,n,i,o,s){this.layout=t,this.intraCellSpacing=e,this.interRankCellSpacing=n,this.orientation=i,this.initialX=o,this.parallelEdgeSpacing=s}function mxSwimlaneOrdering(t){this.layout=t}function mxHierarchicalLayout(t,e,n){mxGraphLayout.call(this,t),this.orientation=null!=e?e:mxConstants.DIRECTION_NORTH,this.deterministic=null==n||n}!function(){function t(c){return c=null!=c?c:2,function(t,e,n,i,o,s,l,r,a,h){var d=o*a*1.118,u=s*a*1.118;o*=l+a,s*=l+a;var p=i.clone();p.x-=d,p.y-=u;var m=n!=mxConstants.ARROW_CLASSIC&&n!=mxConstants.ARROW_CLASSIC_THIN?1:.75;return i.x+=-o*m-d,i.y+=-s*m-u,function(){t.begin(),t.moveTo(p.x,p.y),t.lineTo(p.x-o-s/c,p.y-s+o/c),n!=mxConstants.ARROW_CLASSIC&&n!=mxConstants.ARROW_CLASSIC_THIN||t.lineTo(p.x-3*o/4,p.y-3*s/4),t.lineTo(p.x+s/c-o,p.y-s-o/c),t.close(),h?t.fillAndStroke():t.stroke()}}}function e(m){return m=null!=m?m:2,function(t,e,n,i,o,s,l,r,a,h){var d=o*a*1.118,u=s*a*1.118;o*=l+a,s*=l+a;var p=i.clone();return p.x-=d,p.y-=u,i.x+=2*-d,i.y+=2*-u,function(){t.begin(),t.moveTo(p.x-o-s/m,p.y-s+o/m),t.lineTo(p.x,p.y),t.lineTo(p.x+s/m-o,p.y-s-o/m),t.stroke()}}}function n(t,e,n,i,o,s,l,r,a,h){var d=n==mxConstants.ARROW_DIAMOND?.7071:.9862,u=o*a*d,p=s*a*d;o*=l+a,s*=l+a;var m=i.clone();m.x-=u,m.y-=p,i.x+=-o-u,i.y+=-s-p;var c=n==mxConstants.ARROW_DIAMOND?2:3.4;return function(){t.begin(),t.moveTo(m.x,m.y),t.lineTo(m.x-o/2-s/c,m.y+o/c-s/2),t.lineTo(m.x-o,m.y-s),t.lineTo(m.x-o/2+s/c,m.y-s/2-o/c),t.close(),h?t.fillAndStroke():t.stroke()}}mxMarker.addMarker("classic",t(2)),mxMarker.addMarker("classicThin",t(3)),mxMarker.addMarker("block",t(2)),mxMarker.addMarker("blockThin",t(3)),mxMarker.addMarker("open",e(2)),mxMarker.addMarker("openThin",e(3)),mxMarker.addMarker("oval",function(t,e,n,i,o,s,l,r,a,h){var d=l/2,u=i.clone();return i.x-=o*d,i.y-=s*d,function(){t.ellipse(u.x-d,u.y-d,l,l),h?t.fillAndStroke():t.stroke()}}),mxMarker.addMarker("diamond",n),mxMarker.addMarker("diamondThin",n)}(),mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(t,e,n,i,o){t.translate(e,n),t.begin(),this.redrawPath(t,e,n,i,o),t.fillAndStroke()},mxActor.prototype.redrawPath=function(t,e,n,i,o){var s=i/3;t.moveTo(0,o),t.curveTo(0,3*o/5,0,2*o/5,i/2,2*o/5),t.curveTo(i/2-s,2*o/5,i/2-s,0,i/2,0),t.curveTo(i/2+s,0,i/2+s,2*o/5,i/2,2*o/5),t.curveTo(i,2*o/5,i,3*o/5,i,o),t.close()},mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(t,e,n,i,o){t.moveTo(.25*i,.25*o),t.curveTo(.05*i,.25*o,0,.5*o,.16*i,.55*o),t.curveTo(0,.66*o,.18*i,.9*o,.31*i,.8*o),t.curveTo(.4*i,o,.7*i,o,.8*i,.8*o),t.curveTo(i,.8*o,i,.6*o,.875*i,.5*o),t.curveTo(i,.3*o,.8*i,.1*o,.625*i,.2*o),t.curveTo(.5*i,.05*o,.3*i,.05*o,.25*i,.25*o),t.close()},mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){var t=!0;return null!=this.style&&(t="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),!this.isRounded&&!this.glass&&0==this.rotation&&(t||null!=this.fill&&this.fill!=mxConstants.NONE)},mxRectangleShape.prototype.paintBackground=function(t,e,n,i,o){var s=!0;if(null!=this.style&&(s="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),s||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE){if(s||null!=this.fill&&this.fill!=mxConstants.NONE||(t.pointerEvents=!1),this.isRounded){var l=0;if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))l=Math.min(i/2,Math.min(o/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else{var r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;l=Math.min(i*r,o*r)}t.roundrect(e,n,i,o,l,l)}else t.rect(e,n,i,o);t.fillAndStroke()}},mxRectangleShape.prototype.isRoundable=function(t,e,n,i,o){return!0},mxRectangleShape.prototype.paintForeground=function(t,e,n,i,o){this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(t,e,n,i,o,this.getArcSize(i+this.strokewidth,o+this.strokewidth))},mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(t,e,n,i,o){t.ellipse(e,n,i,o),t.fillAndStroke()},mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(t,e,n,i,o){t.ellipse(e,n,i,o),t.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(t,e,n,i,o){if(!this.outline){var s=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(i/5,o/5)));e+=s,n+=s,o-=2*s,0<(i-=2*s)&&0<o&&t.ellipse(e,n,i,o),t.stroke()}},mxDoubleEllipse.prototype.getLabelBounds=function(t){var e=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(t.width/5/this.scale,t.height/5/this.scale)))*this.scale;return new mxRectangle(t.x+e,t.y+e,t.width-2*e,t.height-2*e)},mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.paintVertexShape=function(t,e,n,i,o){var s=i/2,l=o/2,r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,[new mxPoint(e+s,n),new mxPoint(e+i,n+l),new mxPoint(e+s,n+o),new mxPoint(e,n+l)],this.isRounded,r,!0),t.fillAndStroke()},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(t,e){null==this.style||1!=this.style[mxConstants.STYLE_CURVED]?this.paintLine(t,e,this.isRounded):this.paintCurvedLine(t,e)},mxPolyline.prototype.paintLine=function(t,e,n){var i=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,e,n,i,!1),t.stroke()},mxPolyline.prototype.paintCurvedLine=function(t,e){t.begin();var n=e[0],i=e.length;t.moveTo(n.x,n.y);for(var o=1;o<i-2;o++){var s=e[o],l=e[o+1],r=(s.x+l.x)/2,a=(s.y+l.y)/2;t.quadTo(s.x,s.y,r,a)}s=e[i-2],l=e[i-1];t.quadTo(s.x,s.y,l.x,l.y),t.stroke()},mxUtils.extend(mxArrow,mxShape),mxArrow.prototype.augmentBoundingBox=function(t){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var e=Math.max(this.arrowWidth,this.endSize);t.grow((e/2+this.strokewidth)*this.scale)},mxArrow.prototype.paintEdgeShape=function(t,e){var n=mxConstants.ARROW_SPACING,i=mxConstants.ARROW_WIDTH,o=mxConstants.ARROW_SIZE,s=e[0],l=e[e.length-1],r=l.x-s.x,a=l.y-s.y,h=Math.sqrt(r*r+a*a),d=h-2*n-o,u=r/h,p=a/h,m=d*u,c=d*p,g=i*p/3,x=-i*u/3,y=s.x-g/2+n*u,f=s.y-x/2+n*p,v=y+g,C=f+x,E=v+m,w=C+c,S=E+g,b=w+x,T=S-3*g,A=b-3*x;t.begin(),t.moveTo(y,f),t.lineTo(v,C),t.lineTo(E,w),t.lineTo(S,b),t.lineTo(l.x-n*u,l.y-n*p),t.lineTo(T,A),t.lineTo(T+g,A+x),t.close(),t.fillAndStroke()},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(t){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(t){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var e=this.getEdgeWidth();this.isMarkerStart()&&(e=Math.max(e,this.getStartArrowWidth())),this.isMarkerEnd()&&(e=Math.max(e,this.getEndArrowWidth())),t.grow((e/2+this.strokewidth)*this.scale)},mxArrowConnector.prototype.paintEdgeShape=function(l,t){var e=this.strokewidth;this.outline&&(e=Math.max(1,mxUtils.getNumber(this.style,mxConstants.STYLE_STROKEWIDTH,this.strokewidth)));for(var n=this.getStartArrowWidth()+e,i=this.getEndArrowWidth()+e,r=this.outline?this.getEdgeWidth()+e:this.getEdgeWidth(),o=this.isOpenEnded(),s=this.isMarkerStart(),a=this.isMarkerEnd(),h=o?0:this.arrowSpacing+e/2,d=this.startSize+e,u=this.endSize+e,p=this.isArrowRounded(),m=t[t.length-1],c=1;c<t.length-1&&t[c].x==t[0].x&&t[c].y==t[0].y;)c++;var g=t[c].x-t[0].x,x=t[c].y-t[0].y,y=Math.sqrt(g*g+x*x);if(0!=y){var f,v,C=g/y,E=C,w=x/y,S=w,b=r*w,T=-r*C,A=[];p?l.setLineJoin("round"):2<t.length&&l.setMiterLimit(1.42),l.begin();var L=C,I=w;if(s&&!o)this.paintMarker(l,t[0].x,t[0].y,C,w,d,n,r,h,!0);else{var M=t[0].x+b/2+h*C,R=t[0].y+T/2+h*w,P=t[0].x-b/2+h*C,O=t[0].y-T/2+h*w;o?(l.moveTo(M,R),A.push(function(){l.lineTo(P,O)})):(l.moveTo(P,O),l.lineTo(M,R))}for(var N=0,G=0,H=0,D=0;D<t.length-2;D++){var _=mxUtils.relativeCcw(t[D].x,t[D].y,t[D+1].x,t[D+1].y,t[D+2].x,t[D+2].y);if(N=t[D+2].x-t[D+1].x,G=t[D+2].y-t[D+1].y,0!=(H=Math.sqrt(N*N+G*G))){var U=C*(E=N/H)+w*(S=G/H);tmp=Math.max(Math.sqrt((1+U)/2),.04),f=C+E,v=w+S;var k=Math.sqrt(f*f+v*v);if(0!=k){f/=k,v/=k;var V=Math.max(tmp,Math.min(this.strokewidth/200+.04,.35)),F=0!=_&&p?Math.max(.1,V):Math.max(tmp,.06),B=t[D+1].x+v*r/2/F,Y=t[D+1].y-f*r/2/F,z=t[D+1].x-v*r/2/F,W=t[D+1].y+f*r/2/F;if(0!=_&&p)if(-1==_){var X=z+w*r,j=W-C*r,Z=z+S*r,K=W-E*r;l.lineTo(X,j),l.quadTo(B,Y,Z,K),function(t,e){A.push(function(){l.lineTo(t,e)})}(z,W)}else l.lineTo(B,Y),function(t,e){var n=B-w*r,i=Y+C*r,o=B-S*r,s=Y+E*r;A.push(function(){l.quadTo(t,e,n,i)}),A.push(function(){l.lineTo(o,s)})}(z,W);else l.lineTo(B,Y),function(t,e){A.push(function(){l.lineTo(t,e)})}(z,W);C=E,w=S}}}if(b=r*S,T=-r*E,a&&!o)this.paintMarker(l,m.x,m.y,-C,-w,u,i,r,h,!1);else{l.lineTo(m.x-h*E+b/2,m.y-h*S+T/2);var Q=m.x-h*E-b/2,J=m.y-h*S-T/2;o?(l.moveTo(Q,J),A.splice(0,0,function(){l.moveTo(Q,J)})):l.lineTo(Q,J)}for(D=A.length-1;0<=D;D--)A[D]();o?(l.end(),l.stroke()):(l.close(),l.fillAndStroke()),l.setShadow(!1),l.setMiterLimit(4),p&&l.setLineJoin("flat"),2<t.length&&(l.setMiterLimit(4),s&&!o&&(l.begin(),this.paintMarker(l,t[0].x,t[0].y,L,I,d,n,r,h,!0),l.stroke(),l.end()),a&&!o&&(l.begin(),this.paintMarker(l,m.x,m.y,-C,-w,u,i,r,h,!0),l.stroke(),l.end()))}},mxArrowConnector.prototype.paintMarker=function(t,e,n,i,o,s,l,r,a,h){var d=r/l,u=r*o/2,p=-r*i/2,m=(a+s)*i,c=(a+s)*o;h?t.moveTo(e-u+m,n-p+c):t.lineTo(e-u+m,n-p+c),t.lineTo(e-u/d+m,n-p/d+c),t.lineTo(e+a*i,n+a*o),t.lineTo(e+u/d+m,n+p/d+c),t.lineTo(e+u+m,n+p+c)},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},mxUtils.extend(mxText,mxShape),mxText.prototype.baseSpacingTop=0,mxText.prototype.baseSpacingBottom=0,mxText.prototype.baseSpacingLeft=0,mxText.prototype.baseSpacingRight=0,mxText.prototype.replaceLinefeeds=!0,mxText.prototype.verticalTextRotation=-90,mxText.prototype.ignoreClippedStringSize=!0,mxText.prototype.ignoreStringSize=!1,mxText.prototype.textWidthPadding=8!=document.documentMode||mxClient.IS_EM?3:4,mxText.prototype.lastValue=null,mxText.prototype.cacheEnabled=!0,mxText.prototype.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(t,e){var n=this.scale,i=this.bounds.x/n,o=this.bounds.y/n,s=this.bounds.width/n,l=this.bounds.height/n;this.updateTransform(t,i,o,s,l),this.configureCanvas(t,i,o,s,l);var r=null!=this.state?this.state.unscaledWidth:null;if(e)null==this.node.firstChild||null!=r&&this.lastUnscaledWidth==r||t.invalidateCachedOffsetSize(this.node),t.updateText(i,o,s,l,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),this.node);else{var a=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML,h=a||t instanceof mxVmlCanvas2D?"html":"",d=this.value;a||"html"!=h||(d=mxUtils.htmlEntities(d,!1)),"html"!=h||mxUtils.isNode(this.value)||(d=mxUtils.replaceTrailingNewlines(d,"<div><br></div>")),d=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==h?d.replace(/\n/g,"<br/>"):d;var u=this.textDirection;u!=mxConstants.TEXT_DIRECTION_AUTO||a||(u=this.getAutoDirection()),u!=mxConstants.TEXT_DIRECTION_LTR&&u!=mxConstants.TEXT_DIRECTION_RTL&&(u=null),t.text(i,o,s,l,d,this.align,this.valign,this.wrap,h,this.overflow,this.clipped,this.getTextRotation(),u,this.state)}this.lastUnscaledWidth=r},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){var t=this.createCanvas();null!=t&&null!=t.updateText&&null!=t.invalidateCachedOffsetSize?(this.paint(t,!0),this.destroyCanvas(t),this.updateBoundingBox()):mxShape.prototype.redraw.apply(this,arguments)}else this.updateSize(this.node,null==this.state||null==this.state.view.textDiv),mxClient.IS_IE&&(null==document.documentMode||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform(),this.updateBoundingBox();else mxShape.prototype.redraw.apply(this,arguments),mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML?this.lastValue=this.value:this.lastValue=null},mxText.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments),this.color="black",this.align=mxConstants.ALIGN_CENTER,this.valign=mxConstants.ALIGN_MIDDLE,this.family=mxConstants.DEFAULT_FONTFAMILY,this.size=mxConstants.DEFAULT_FONTSIZE,this.fontStyle=mxConstants.DEFAULT_FONTSTYLE,this.spacing=2,this.spacingTop=2,this.spacingRight=2,this.spacingBottom=2,this.spacingLeft=2,this.horizontal=!0,delete this.background,delete this.border,this.textDirection=mxConstants.DEFAULT_TEXT_DIRECTION,delete this.margin},mxText.prototype.apply=function(t){var e=this.spacing;mxShape.prototype.apply.apply(this,arguments),null!=this.style&&(this.fontStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,this.fontStyle),this.family=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,this.family),this.size=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,this.size),this.color=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,this.color),this.align=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,this.align),this.valign=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,this.valign),this.spacing=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing)),this.spacingTop=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,this.spacingTop-e))+this.spacing,this.spacingRight=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,this.spacingRight-e))+this.spacing,this.spacingBottom=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,this.spacingBottom-e))+this.spacing,this.spacingLeft=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_LEFT,this.spacingLeft-e))+this.spacing,this.horizontal=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,this.horizontal),this.background=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,this.background),this.border=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,this.border),this.textDirection=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_OPACITY,100),this.updateMargin()),this.flipV=null,this.flipH=null},mxText.prototype.getAutoDirection=function(){var t=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(this.value);return null!=t&&0<t.length&&"z"<t[0]?mxConstants.TEXT_DIRECTION_RTL:mxConstants.TEXT_DIRECTION_LTR},mxText.prototype.updateBoundingBox=function(){var t=this.node;this.boundingBox=this.bounds.clone();var e=this.getTextRotation(),n=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER):null,i=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE):null;if(!(this.ignoreStringSize||null==t||"fill"==this.overflow||this.clipped&&this.ignoreClippedStringSize&&n==mxConstants.ALIGN_CENTER&&i==mxConstants.ALIGN_MIDDLE)){var o=null,s=null;if(null!=t.ownerSVGElement)if(null!=t.firstChild&&null!=t.firstChild.firstChild&&"foreignObject"==t.firstChild.firstChild.nodeName)t=t.firstChild.firstChild,o=parseInt(t.getAttribute("width"))*this.scale,s=parseInt(t.getAttribute("height"))*this.scale;else try{var l=t.getBBox();return void("string"==typeof this.value&&0==mxUtils.trim(this.value)?this.boundingBox=null:0==l.width&&0==l.height?this.boundingBox=null:this.boundingBox=new mxRectangle(l.x,l.y,l.width,l.height))}catch(t){}else{var r=null!=this.state?this.state.view.textDiv:null;if(null!=this.offsetWidth&&null!=this.offsetHeight)o=this.offsetWidth*this.scale,s=this.offsetHeight*this.scale;else{null!=r&&(this.updateFont(r),this.updateSize(r,!1),this.updateInnerHtml(r),t=r);var a=t;if(8!=document.documentMode||mxClient.IS_EM)null!=a.firstChild&&"DIV"==a.firstChild.nodeName&&(a=a.firstChild);else{var h=Math.round(this.bounds.width/this.scale);if(this.wrap&&0<h){if(t.style.wordWrap=mxConstants.WORD_WRAP,t.style.whiteSpace="normal","break-word"!=t.style.wordWrap){var d=a.getElementsByTagName("div");0<d.length&&(a=d[d.length-1]),o=a.offsetWidth+2,d=this.node.getElementsByTagName("div"),this.clipped&&(o=Math.min(h,o)),1<d.length&&(d[d.length-2].style.width=o+"px")}}else t.style.whiteSpace="nowrap"}this.offsetWidth=a.offsetWidth+this.textWidthPadding,this.offsetHeight=a.offsetHeight,o=this.offsetWidth*this.scale,s=this.offsetHeight*this.scale}}null!=o&&null!=s&&(this.boundingBox=new mxRectangle(this.bounds.x,this.bounds.y,o,s))}if(null!=this.boundingBox)if(0!=e){var u=mxUtils.getBoundingBox(new mxRectangle(this.margin.x*this.boundingBox.width,this.margin.y*this.boundingBox.height,this.boundingBox.width,this.boundingBox.height),e,new mxPoint(0,0));this.unrotatedBoundingBox=mxRectangle.fromRectangle(this.boundingBox),this.unrotatedBoundingBox.x+=this.margin.x*this.unrotatedBoundingBox.width,this.unrotatedBoundingBox.y+=this.margin.y*this.unrotatedBoundingBox.height,this.boundingBox.x+=u.x,this.boundingBox.y+=u.y,this.boundingBox.width=u.width,this.boundingBox.height=u.height}else this.boundingBox.x+=this.margin.x*this.boundingBox.width,this.boundingBox.y+=this.margin.y*this.boundingBox.height,this.unrotatedBoundingBox=null},mxText.prototype.getShapeRotation=function(){return 0},mxText.prototype.getTextRotation=function(){return null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(t,e,n,i,o){mxShape.prototype.configureCanvas.apply(this,arguments),t.setFontColor(this.color),t.setFontBackgroundColor(this.background),t.setFontBorderColor(this.border),t.setFontFamily(this.family),t.setFontSize(this.size),t.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 t=this.node.style;t.whiteSpace="normal",t.overflow="",t.width="",t.height="",this.updateValue(this.state),this.updateFont(this.node),this.updateSize(this.node,null==this.state||null==this.state.view.textDiv),this.offsetWidth=null,this.offsetHeight=null,mxClient.IS_IE&&(null==document.documentMode||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()},mxText.prototype.updateHtmlTransform=function(){var t=this.getTextRotation(),e=this.node.style,n=this.margin.x,i=this.margin.y;0!=t?(mxUtils.setPrefixedStyle(e,"transformOrigin",100*-n+"% "+100*-i+"%"),mxUtils.setPrefixedStyle(e,"transform","translate("+100*n+"%,"+100*i+"%)scale("+this.scale+") rotate("+t+"deg)")):(mxUtils.setPrefixedStyle(e,"transformOrigin","0% 0%"),mxUtils.setPrefixedStyle(e,"transform","scale("+this.scale+")translate("+100*n+"%,"+100*i+"%)")),e.left=Math.round(this.bounds.x-Math.ceil(n*("fill"!=this.overflow&&"width"!=this.overflow?3:1)))+"px",e.top=Math.round(this.bounds.y-i*("fill"!=this.overflow?3:1))+"px",this.opacity<100?e.opacity=this.opacity/100:e.opacity=""},mxText.prototype.updateInnerHtml=function(t){if(mxUtils.isNode(this.value))t.innerHTML=this.value.outerHTML;else{var e=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1)),e=mxUtils.replaceTrailingNewlines(e,"<div>&nbsp;</div>"),e='<div style="display:inline-block;_display:inline;">'+(e=this.replaceLinefeeds?e.replace(/\n/g,"<br/>"):e)+"</div>",t.innerHTML=e}},mxText.prototype.updateHtmlFilter=function(){var t=this.node.style,e=this.margin.x,n=this.margin.y,i=this.scale;mxUtils.setOpacity(this.node,this.opacity);var o=0,s=0,l=null!=this.state?this.state.view.textDiv:null,r=this.node;if(null!=l){l.style.overflow="",l.style.height="",l.style.width="",this.updateFont(l),this.updateSize(l,!1),this.updateInnerHtml(l);var a=Math.round(this.bounds.width/this.scale);this.wrap&&0<a?(l.style.whiteSpace="normal",l.style.wordWrap=mxConstants.WORD_WRAP,o=a,this.clipped&&(o=Math.min(o,this.bounds.width)),l.style.width=o+"px"):l.style.whiteSpace="nowrap",null!=(r=l).firstChild&&"DIV"==r.firstChild.nodeName&&(r=r.firstChild,this.wrap&&"break-word"==l.style.wordWrap&&(r.style.width="100%")),!this.clipped&&this.wrap&&0<a&&(o=r.offsetWidth+this.textWidthPadding,l.style.width=o+"px"),s=r.offsetHeight+2,mxClient.IS_QUIRKS&&null!=this.border&&this.border!=mxConstants.NONE&&(s+=3)}else null!=r.firstChild&&"DIV"==r.firstChild.nodeName&&(s=(r=r.firstChild).offsetHeight);o=r.offsetWidth+this.textWidthPadding,this.clipped&&(s=Math.min(s,this.bounds.height));a=this.bounds.width/i;var h=this.bounds.height/i;"fill"==this.overflow?(s=h,o=a):"width"==this.overflow&&(s=r.scrollHeight,o=a),this.offsetWidth=o,this.offsetHeight=s,mxClient.IS_QUIRKS&&(this.clipped||"width"==this.overflow&&0<h)?(h=Math.min(h,s),t.height=Math.round(h)+"px"):h=s,"fill"!=this.overflow&&"width"!=this.overflow&&(this.clipped&&(o=Math.min(a,o)),a=o,(mxClient.IS_QUIRKS&&this.clipped||this.wrap)&&(t.width=Math.round(a)+"px")),h*=i,a*=i;var d=this.getTextRotation()*(Math.PI/180),u=parseFloat(parseFloat(Math.cos(d)).toFixed(8)),p=parseFloat(parseFloat(Math.sin(-d)).toFixed(8));(d%=2*Math.PI)<0&&(d+=2*Math.PI),(d%=Math.PI)>Math.PI/2&&(d=Math.PI-d);var m=Math.cos(d),c=Math.sin(-d),g=a*-(e+.5),x=h*-(n+.5),y=(h-h*m+a*c)/2+p*g-u*x,f=(a-a*m+h*c)/2-u*g-p*x;if(0!=d){var v="progid:DXImageTransform.Microsoft.Matrix(M11="+u+", M12="+p+", M21="+-p+", M22="+u+", sizingMethod='auto expand')";null!=t.filter&&0<t.filter.length?t.filter+=" "+v:t.filter=v}n=0;"fill"!=this.overflow&&mxClient.IS_QUIRKS&&(this.valign==mxConstants.ALIGN_TOP?n-=1:this.valign==mxConstants.ALIGN_BOTTOM?n+=2:n+=1),t.zoom=i,t.left=Math.round(this.bounds.x+f-a/2)+"px",t.top=Math.round(this.bounds.y+y-h/2+n)+"px"},mxText.prototype.createQuirkNodeIcons=function(t){var e=t.style,n="<div></div>",i=!1,o={};e.icons&&(o=JSON.parse(e.icons));var s=workflowUi.editor.graph.workflowDetailDatas;if(s&&s.nodeDatas&&s.nodeDatas[t.cell.nodeId]){var l=s.nodeDatas[t.cell.nodeId];"true"!=l.hasNodeAftAddOpr||o&&o.nodeAfter||(i=!0,o.nodeAfter="icon-workflow-caozuohou"),"true"!=l.hasNodeBefAddOpr||o&&o.beforeNode||(i=!0,o.beforeNode="icon-workflow-caozuoqian")}if(o||i){var r="",a=t.style.operatorFontColor?"color:"+t.style.operatorFontColor+";":"";"rhombus"==e.shape&&(a+="width:110px;position:absolute;left:-16px;",o.left||o.right?r+="top:8px;":r+="top:6px;");var h='<div class="quirk-nodeTagDiv" style="'+a+'">',d='<div class="quirk-nodeActionDiv" style="'+r+'">',u="";o.left&&("rhombus"==e.shape&&(u="position:absolute;top:-36px;left:calc(50% - 4px);"),(-1<o.left.indexOf("fencha")||-1<o.left.indexOf("fenchazhongjiandian")||-1<o.left.indexOf("hebing"))&&window.urlParams.isFromWfForm&&"true"==window.urlParams.isFromWfForm||(h+='<span class="left '+o.left+'" style="'+u+'"></span>')),o.right&&(o.right=o.right.replace(/guidang/g,"tingzhi"),h+='<span class="right '+o.right+'"></span>'),o.beforeNode&&("rhombus"==e.shape&&(u="margin-left:8px;"),"true"!=window.urlParams.isFromWfForm&&(d+='<span class="beforeNode '+o.beforeNode+'" style="'+u+'"></span>')),o.nodeAfter&&("rhombus"==e.shape&&(u="margin-right:8px;"),"true"!=window.urlParams.isFromWfForm&&(d+='<span class="nodeAfter '+o.nodeAfter+'" style="'+u+'"></span>')),h!='<div class="quirk-nodeTagDiv" style="'+a+'">'?h+="</div>":h="",d!='<div class="quirk-nodeActionDiv" style="'+r+'">'?d+="</div>":d="";var p="";"rhombus"==e.shape&&(p+="position:relative;height:0;"),n='<div class="word-line-quirk-icons" style="'+p+'">'+(h||"")+(d||"")+"</div>"}if("true"==window.urlParams.isFromWfForm&&!t.cell.isGroupArea&&!t.cell.isHelpfulText){var m=t.style.operatorFontColor||"red",c=t.cell.operatorNameStr||"",g="color:"+m+";";"rhombus"==e.shape&&(g+="left:2px;top:5px;width:81px;"),n+='<div class="word-line-quirk-operators" style="'+g+'" title="'+c+'">'+c+"</div>"}return n},mxText.prototype.updateValue=function(t){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var e=this.value;-1<e.indexOf("base64")&&(e=Base64.decode(e.split("_")[1])),this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1)),e=mxUtils.replaceTrailingNewlines(e,"<div><br></div>"),e=this.replaceLinefeeds?e.replace(/\n/g,"<br/>"):e;var n=null!=this.background&&this.background!=mxConstants.NONE?this.background:null,i=null!=this.border&&this.border!=mxConstants.NONE?this.border:null;if("fill"==this.overflow||"width"==this.overflow)null!=n&&(this.node.style.backgroundColor=n),null!=i&&(this.node.style.border="1px solid "+i);else{var o="";null!=n&&(o+="background-color:"+n+";"),null!=i&&(o+="border:1px solid "+i+";"),t&&"rhombus"==t.style.shape&&(o+="top:-15px;width:85px;"),t.cell.isHelpfulText&&(o+="text-align:left;left:0;top:-40px;overflow:hidden;height:"+t.height+"px;white-space:pre-wrap;");var s=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT;t.cell.isGroupArea||t.cell.isHelpfulText||t.cell.linkId||t.cell.nodeId||t.cell.shouldNotAddNumStr||(workflowUi.wfEditor.wfPanelNowCellsNum++,t.cell.shouldNotAddNumStr=!0,e+=workflowUi.wfEditor.wfPanelNowCellsNum,t.cell.value=e),"true"!=window.urlParams.isFromWfForm&&"true"!=window.urlParams.backstageReadOnly&&(e=wfFormatMultiLang(e));var l=e;e='<div class="word-line-isQuirk" style="zoom:1;'+o+"display:inline-block;_display:inline;text-decoration:inherit;padding-bottom:1px;padding-right:1px;line-height:"+s+'" title="'+(l=(l=(l=(l=l.replace(/<br\/>/g,"\n")).replace(/<br>/g,"\n")).replace(/<div>/g,"")).replace(/<\/div>/g,""))+'">'+(e=e.replace(/&#10;/g,"<br>"))+"</div>",e+=this.createQuirkNodeIcons(t)}this.node.style.zIndex=2,this.node.innerHTML=e;var r=this.node.getElementsByTagName("div");if(0<r.length){var a=this.textDirection;a==mxConstants.TEXT_DIRECTION_AUTO&&this.dialect!=mxConstants.DIALECT_STRICTHTML&&(a=this.getAutoDirection()),a==mxConstants.TEXT_DIRECTION_LTR||a==mxConstants.TEXT_DIRECTION_RTL?r[r.length-1].setAttribute("dir",a):r[r.length-1].removeAttribute("dir")}}},mxText.prototype.updateFont=function(t){var e=t.style;e.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,e.fontSize=this.size+"px",e.fontFamily=this.family,e.verticalAlign="top",e.color=this.color,(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?e.fontWeight="bold":e.fontWeight="",(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?e.fontStyle="italic":e.fontStyle="",(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE?e.textDecoration="underline":e.textDecoration="",this.align==mxConstants.ALIGN_CENTER?e.textAlign="center":this.align==mxConstants.ALIGN_RIGHT?e.textAlign="right":e.textAlign="left"},mxText.prototype.updateSize=function(t,e){var n=Math.max(0,Math.round(this.bounds.width/this.scale)),i=Math.max(0,Math.round(this.bounds.height/this.scale)),o=t.style;if(this.clipped?(o.overflow="hidden",mxClient.IS_QUIRKS?o.width=n+"px":(o.maxHeight=i+"px",o.maxWidth=n+"px")):"fill"==this.overflow?(o.width=n+1+"px",o.height=i+1+"px",o.overflow="hidden"):"width"==this.overflow&&(o.width=n+1+"px",o.maxHeight=i+1+"px",o.overflow="hidden"),this.wrap&&0<n){if(o.wordWrap=mxConstants.WORD_WRAP,o.whiteSpace="normal",o.width=n+"px",e&&"fill"!=this.overflow&&"width"!=this.overflow){var s=t;null!=s.firstChild&&"DIV"==s.firstChild.nodeName&&(s=s.firstChild,"break-word"==t.style.wordWrap&&(s.style.width="100%"));var l=s.offsetWidth;if(0==l){var r=t.parentNode;t.style.visibility="hidden",document.body.appendChild(t),l=s.offsetWidth,t.style.visibility="",r.appendChild(t)}l+=3,this.clipped&&(l=Math.min(l,n)),o.width=l+"px"}}else o.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){return new mxPoint(this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-this.baseSpacingRight:this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-this.baseSpacingBottom:this.spacingTop+this.baseSpacingTop)},mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.redrawPath=function(t,e,n,i,o){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,0),new mxPoint(i,.5*o),new mxPoint(0,o)],this.isRounded,s,!0)},mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(t,e,n,i,o){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(.25*i,0),new mxPoint(.75*i,0),new mxPoint(i,.5*o),new mxPoint(.75*i,o),new mxPoint(.25*i,o),new mxPoint(0,.5*o)],this.isRounded,s,!0)},mxUtils.extend(mxLine,mxShape),mxLine.prototype.paintVertexShape=function(t,e,n,i,o){var s=n+o/2;t.begin(),t.moveTo(e,s),t.lineTo(e+i,s),t.stroke()},mxUtils.extend(mxImageShape,mxRectangleShape),mxImageShape.prototype.preserveImageAspect=!0,mxImageShape.prototype.getSvgScreenOffset=function(){return 0},mxImageShape.prototype.apply=function(t){mxShape.prototype.apply.apply(this,arguments),this.fill=null,this.stroke=null,(this.gradient=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 t=document.createElement("div");return t.style.position="absolute",t},mxImageShape.prototype.isRoundable=function(t,e,n,i,o){return!1},mxImageShape.prototype.paintVertexShape=function(t,e,n,i,o){if(null!=this.image){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),l=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);null!=s&&(t.setFillColor(s),t.setStrokeColor(l),t.rect(e,n,i,o),t.fillAndStroke()),t.image(e,n,i,o,this.image,this.preserveImageAspect,!1,!1),null!=(l=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null))&&(t.setShadow(!1),t.setStrokeColor(l),t.rect(e,n,i,o),t.stroke())}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){if(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="",null!=this.image){var t=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,""),e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,"");this.node.style.backgroundColor=t,this.node.style.borderColor=e;var n=mxClient.IS_IE6||(null==document.documentMode||document.documentMode<=8)&&0!=this.rotation,i=document.createElement(n?mxClient.VML_PREFIX+":image":"img");i.setAttribute("border","0"),i.style.position="absolute",i.src=this.image;var o=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=o,this.flipH&&this.flipV?o+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?o+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(o+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),i.style.filter!=o&&(i.style.filter=o),"image"==i.nodeName?i.style.rotation=this.rotation:0!=this.rotation?mxUtils.setPrefixedStyle(i.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(i.style,"transform",""),i.style.width=this.node.style.width,i.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(i)}else this.setTransparentBackgroundImage(this.node)},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(t){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(t,e,n,i,o){this.paintImage(t,e,n,i,o),this.paintIndicator(t,e,n,i,o),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(t,e,n,i,o){if(null!=this.image){var s=this.getImageBounds(e,n,i,o);t.image(s.x,s.y,s.width,s.height,this.image,!1,!1,!1)}},mxLabel.prototype.getImageBounds=function(t,e,n,i){var o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),r=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),a=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return o==mxConstants.ALIGN_CENTER?t+=(n-l)/2:o==mxConstants.ALIGN_RIGHT?t+=n-l-a:t+=a,s==mxConstants.ALIGN_TOP?e+=a:s==mxConstants.ALIGN_BOTTOM?e+=i-r-a:e+=(i-r)/2,new mxRectangle(t,e,l,r)},mxLabel.prototype.paintIndicator=function(t,e,n,i,o){if(null!=this.indicator)this.indicator.bounds=this.getIndicatorBounds(e,n,i,o),this.indicator.paint(t);else if(null!=this.indicatorImage){var s=this.getIndicatorBounds(e,n,i,o);t.image(s.x,s.y,s.width,s.height,this.indicatorImage,!1,!1,!1)}},mxLabel.prototype.getIndicatorBounds=function(t,e,n,i){var o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),r=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),a=this.spacing+5;return o==mxConstants.ALIGN_RIGHT?t+=n-l-a:o==mxConstants.ALIGN_CENTER?t+=(n-l)/2:t+=a,s==mxConstants.ALIGN_BOTTOM?e+=i-r-a:s==mxConstants.ALIGN_TOP?e+=a:e+=(i-r)/2,new mxRectangle(t,e,l,r)},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 t=document.createElement("img");t.style.position="relative",t.setAttribute("border","0");var e=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);e.x-=this.bounds.x,e.y-=this.bounds.y,t.style.left=Math.round(e.x)+"px",t.style.top=Math.round(e.y)+"px",t.style.width=Math.round(e.width)+"px",t.style.height=Math.round(e.height)+"px",t.src=this.image,this.node.appendChild(t)}},mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(t,e,n,i,o){t.translate(e,n),t.begin(),this.redrawPath(t,e,n,i,o,!1),t.fillAndStroke(),this.outline&&null!=this.style&&0!=mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)||(t.setShadow(!1),t.begin(),this.redrawPath(t,e,n,i,o,!0),t.stroke())},mxCylinder.prototype.getCylinderSize=function(t,e,n,i){return Math.min(this.maxHeight,Math.round(i/5))},mxCylinder.prototype.redrawPath=function(t,e,n,i,o,s){var l=this.getCylinderSize(e,n,i,o);(s&&null!=this.fill||!s&&null==this.fill)&&(t.moveTo(0,l),t.curveTo(0,2*l,i,2*l,i,l),s||(t.stroke(),t.begin())),s||(t.moveTo(0,l),t.curveTo(0,-l/3,i,-l/3,i,l),t.lineTo(i,o-l),t.curveTo(i,o+l/3,0,o+l/3,0,o-l),t.close())},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(t,e){var n=this.createMarker(t,e,!0),i=this.createMarker(t,e,!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments),t.setFillColor(this.stroke),t.setShadow(!1),t.setDashed(!1),null!=n&&n(),null!=i&&i()},mxConnector.prototype.createMarker=function(t,e,n){var i=null,o=e.length,s=mxUtils.getValue(this.style,n?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW),l=n?e[1]:e[o-2],r=n?e[0]:e[o-1];if(null!=s&&null!=l&&null!=r){for(var a=1;a<o-1&&0==Math.round(l.x-r.x)&&0==Math.round(l.y-r.y);)l=n?e[1+a]:e[o-2-a],a++;var h=r.x-l.x,d=r.y-l.y,u=Math.max(1,Math.sqrt(h*h+d*d)),p=h/u,m=d/u,c=mxUtils.getNumber(this.style,n?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE),g=0!=this.style[n?mxConstants.STYLE_STARTFILL:mxConstants.STYLE_ENDFILL];i=mxMarker.createMarker(t,this,s,r,p,m,c,n,this.strokewidth,g)}return i},mxConnector.prototype.augmentBoundingBox=function(t){mxShape.prototype.augmentBoundingBox.apply(this,arguments);var e=0;mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(e=mxUtils.getNumber(this.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)+1),mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(e=Math.max(e,mxUtils.getNumber(this.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE))+1),t.grow(e*this.scale)},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(t){var e=this.getTitleSize(),n=new mxRectangle(t.x,t.y,t.width,t.height),i=this.isHorizontal(),o=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPH,0),s=1==mxUtils.getValue(this.style,mxConstants.STYLE_FLIPV,0),l=this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH,r=i==!l,a=!r&&o!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST),h=r&&s!=(this.direction==mxConstants.DIRECTION_SOUTH||this.direction==mxConstants.DIRECTION_WEST);if(l){d=Math.min(n.width,e*this.scale);(a||h)&&(n.x+=n.width-d),n.width=d}else{var d=Math.min(n.height,e*this.scale);(a||h)&&(n.y+=n.height-d),n.height=d}return n},mxSwimlane.prototype.getGradientBounds=function(t,e,n,i,o){var s=this.getTitleSize();return this.isHorizontal()?new mxRectangle(e,n,i,s=Math.min(s,o)):new mxRectangle(e,n,s=Math.min(s,i),o)},mxSwimlane.prototype.getArcSize=function(t,e,n){return n*(mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100)*3},mxSwimlane.prototype.isHorizontal=function(){return 1==mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)},mxSwimlane.prototype.paintVertexShape=function(t,e,n,i,o){var s=this.getTitleSize(),l=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE),r=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),a=0;s=this.isHorizontal()?Math.min(s,o):Math.min(s,i),t.translate(e,n),this.isRounded?(a=this.getArcSize(i,o,s),this.paintRoundedSwimlane(t,e,n,i,o,s,a,l,r)):this.paintSwimlane(t,e,n,i,o,s,l,r);var h=mxUtils.getValue(this.style,mxConstants.STYLE_SEPARATORCOLOR,mxConstants.NONE);if(this.paintSeparator(t,e,n,i,o,s,h),null!=this.image){var d=this.getImageBounds(e,n,i,o);t.image(d.x-e,d.y-n,d.width,d.height,this.image,!1,!1,!1)}this.glass&&(t.setShadow(!1),this.paintGlassEffect(t,0,0,i,s,a))},mxSwimlane.prototype.paintSwimlane=function(t,e,n,i,o,s,l,r){l!=mxConstants.NONE&&(t.save(),t.setFillColor(l),t.rect(0,0,i,o),t.fillAndStroke(),t.restore(),t.setShadow(!1)),t.begin(),0==s&&(s=o),this.isHorizontal()?(t.moveTo(0,s),t.lineTo(0,0),t.lineTo(i,0),t.lineTo(i,s),(r||o<=s)&&t.close(),t.fillAndStroke(),s<o&&l==mxConstants.NONE&&(t.pointerEvents=!1,t.begin(),t.moveTo(0,s),t.lineTo(0,o),t.lineTo(i,o),t.lineTo(i,s),t.stroke())):(t.moveTo(s,0),t.lineTo(0,0),t.lineTo(0,o),t.lineTo(s,o),(r||i<=s)&&t.close(),t.fillAndStroke(),s<i&&l==mxConstants.NONE&&(t.pointerEvents=!1,t.begin(),t.moveTo(s,0),t.lineTo(i,0),t.lineTo(i,o),t.lineTo(s,o),t.stroke()))},mxSwimlane.prototype.paintRoundedSwimlane=function(t,e,n,i,o,s,l,r,a){l=Math.min(o-s,Math.min(s,l)),r!=mxConstants.NONE&&(t.save(),t.setFillColor(r),t.roundrect(0,0,i,o,l,l),t.fillAndStroke(),t.restore(),t.setShadow(!1)),t.begin(),this.isHorizontal()?(t.moveTo(i,s),t.lineTo(i,l),t.quadTo(i,0,i-Math.min(i/2,l),0),t.lineTo(Math.min(i/2,l),0),t.quadTo(0,0,0,l),t.lineTo(0,s),(a||o<=s)&&t.close(),t.fillAndStroke(),s<o&&r==mxConstants.NONE&&(t.pointerEvents=!1,t.begin(),t.moveTo(0,s),t.lineTo(0,o-l),t.quadTo(0,o,Math.min(i/2,l),o),t.lineTo(i-Math.min(i/2,l),o),t.quadTo(i,o,i,o-l),t.lineTo(i,s),t.stroke())):(t.moveTo(s,0),t.lineTo(l,0),t.quadTo(0,0,0,Math.min(o/2,l)),t.lineTo(0,o-Math.min(o/2,l)),t.quadTo(0,o,l,o),t.lineTo(s,o),(a||i<=s)&&t.close(),t.fillAndStroke(),s<i&&r==mxConstants.NONE&&(t.pointerEvents=!1,t.begin(),t.moveTo(s,o),t.lineTo(i-l,o),t.quadTo(i,o,i,o-Math.min(o/2,l)),t.lineTo(i,Math.min(o/2,l)),t.quadTo(i,0,i-l,0),t.lineTo(s,0),t.stroke()))},mxSwimlane.prototype.paintSeparator=function(t,e,n,i,o,s,l){l!=mxConstants.NONE&&(t.setStrokeColor(l),t.setDashed(!0),t.begin(),this.isHorizontal()?(t.moveTo(i,s),t.lineTo(i,o)):(t.moveTo(s,0),t.lineTo(i,0)),t.stroke(),t.setDashed(!1))},mxSwimlane.prototype.getImageBounds=function(t,e,n,i){return this.isHorizontal()?new mxRectangle(t+n-this.imageSize,e,this.imageSize,this.imageSize):new mxRectangle(t,e,this.imageSize,this.imageSize)},mxGraphLayout.prototype.graph=null,mxGraphLayout.prototype.useBoundingBox=!0,mxGraphLayout.prototype.parent=null,mxGraphLayout.prototype.moveCell=function(t,e,n){},mxGraphLayout.prototype.execute=function(t){},mxGraphLayout.prototype.getGraph=function(){return this.graph},mxGraphLayout.prototype.getConstraint=function(t,e,n,i){var o=this.graph.view.getState(e),s=null!=o?o.style:this.graph.getCellStyle(e);return null!=s?s[t]:null},mxGraphLayout.traverse=function(t,e,n,i,o){if(null!=n&&null!=t&&(e=null==e||e,!(o=o||new mxDictionary).get(t))){o.put(t,!0);var s=n(t,i);if(null==s||s){var l=this.graph.model.getEdgeCount(t);if(0<l)for(var r=0;r<l;r++){var a=this.graph.model.getEdgeAt(t,r),h=this.graph.model.getTerminal(a,!0)==t;if(!e||h){var d=this.graph.view.getVisibleTerminal(a,!h);this.traverse(d,e,n,a,o)}}}}},mxGraphLayout.prototype.isAncestor=function(t,e,n){if(!n)return this.graph.model.getParent(cell)==t;if(e==t)return!1;for(;null!=e&&e!=t;)e=this.graph.model.getParent(e);return e==t},mxGraphLayout.prototype.isVertexMovable=function(t){return this.graph.isCellMovable(t)},mxGraphLayout.prototype.isVertexIgnored=function(t){return!this.graph.getModel().isVertex(t)||!this.graph.isCellVisible(t)},mxGraphLayout.prototype.isEdgeIgnored=function(t){var e=this.graph.getModel();return!e.isEdge(t)||!this.graph.isCellVisible(t)||null==e.getTerminal(t,!0)||null==e.getTerminal(t,!1)},mxGraphLayout.prototype.setEdgeStyleEnabled=function(t,e){this.graph.setCellStyles(mxConstants.STYLE_NOEDGESTYLE,e?"0":"1",[t])},mxGraphLayout.prototype.setOrthogonalEdge=function(t,e){this.graph.setCellStyles(mxConstants.STYLE_ORTHOGONAL,e?"1":"0",[t])},mxGraphLayout.prototype.getParentOffset=function(t){var e=new mxPoint;if(null!=t&&t!=this.parent){var n=this.graph.getModel();if(n.isAncestor(this.parent,t))for(var i=n.getGeometry(t);t!=this.parent;)e.x=e.x+i.x,e.y=e.y+i.y,t=n.getParent(t),i=n.getGeometry(t)}return e},mxGraphLayout.prototype.setEdgePoints=function(t,e){if(null!=t){var n=this.graph.model,i=n.getGeometry(t);if(null==i?(i=new mxGeometry).setRelative(!0):i=i.clone(),null!=this.parent&&null!=e)for(var o=n.getParent(t),s=this.getParentOffset(o),l=0;l<e.length;l++)e[l].x=e[l].x-s.x,e[l].y=e[l].y-s.y;i.points=e,n.setGeometry(t,i)}},mxGraphLayout.prototype.setVertexLocation=function(t,e,n){var i=this.graph.getModel(),o=i.getGeometry(t),s=null;if(null!=o){if(s=new mxRectangle(e,n,o.width,o.height),this.useBoundingBox){var l=this.graph.getView().getState(t);if(null!=l&&null!=l.text&&null!=l.text.boundingBox){var r=this.graph.getView().scale,a=l.text.boundingBox;l.text.boundingBox.x<l.x&&(e+=(l.x-a.x)/r,s.width=a.width),l.text.boundingBox.y<l.y&&(n+=(l.y-a.y)/r,s.height=a.height)}}if(null!=this.parent){var h=i.getParent(t);if(null!=h&&h!=this.parent){var d=this.getParentOffset(h);e-=d.x,n-=d.y}}o.x==e&&o.y==n||((o=o.clone()).x=e,o.y=n,i.setGeometry(t,o))}return s},mxGraphLayout.prototype.getVertexBounds=function(t){var e=this.graph.getModel().getGeometry(t);if(this.useBoundingBox){var n=this.graph.getView().getState(t);if(null!=n&&null!=n.text&&null!=n.text.boundingBox){var i=this.graph.getView().scale,o=n.text.boundingBox,s=Math.max(n.x-o.x,0)/i,l=Math.max(n.y-o.y,0)/i,r=Math.max(o.x+o.width-(n.x+n.width),0)/i,a=Math.max(o.y+o.height-(n.y+n.height),0)/i;e=new mxRectangle(e.x-s,e.y-l,e.width+s+r,e.height+l+a)}}if(null!=this.parent){var h=this.graph.getModel().getParent(t);if(e=e.clone(),null!=h&&h!=this.parent){var d=this.getParentOffset(h);e.x=e.x+d.x,e.y=e.y+d.y}}return new mxRectangle(e.x,e.y,e.width,e.height)},mxGraphLayout.prototype.arrangeGroups=function(t,e,n,i,o,s){return this.graph.updateGroupBounds(t,e,!0,n,i,o,s)},WeightedCellSorter.prototype.weightedValue=0,WeightedCellSorter.prototype.nudge=!1,WeightedCellSorter.prototype.visited=!1,WeightedCellSorter.prototype.rankIndex=null,WeightedCellSorter.prototype.cell=null,WeightedCellSorter.prototype.compare=function(t,e){return null!=t&&null!=e?e.weightedValue>t.weightedValue?-1:e.weightedValue<t.weightedValue?1:e.nudge?-1:1: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(t,e,n){var i=this.graph.getModel(),o=i.getParent(t),s=this.isHorizontal();if(null!=t&&null!=o){var l=0,r=0,a=i.getChildCount(o),h=s?e:n,d=this.graph.getView().getState(o);for(null!=d&&(h-=s?d.x:d.y),h/=this.graph.view.scale,l=0;l<a;l++){var u=i.getChildAt(o,l);if(u!=t){var p=i.getGeometry(u);if(null!=p){var m=s?p.x+p.width/2:p.y+p.height/2;if(r<=h&&h<m)break;r=m}}}var c=o.getIndex(t);c=Math.max(0,l-(c<l?1:0)),i.add(o,t,c)}},mxStackLayout.prototype.getParentSize=function(t){var e=this.graph.getModel(),n=e.getGeometry(t);null!=this.graph.container&&(null==n&&e.isLayer(t)||t==this.graph.getView().currentRoot)&&(n=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));return n},mxStackLayout.prototype.execute=function(t){if(null!=t){var e=this.getParentSize(t),n=this.isHorizontal(),i=this.graph.getModel(),o=null;null!=e&&(o=n?e.height-this.marginTop-this.marginBottom:e.width-this.marginLeft-this.marginRight),o-=2*this.border;var s=this.x0+this.border+this.marginLeft,l=this.y0+this.border+this.marginTop;if(this.graph.isSwimlane(t)){var r=this.graph.getCellStyle(t),a=mxUtils.getNumber(r,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE),h=1==mxUtils.getValue(r,mxConstants.STYLE_HORIZONTAL,!0);null!=e&&(a=h?Math.min(a,e.height):Math.min(a,e.width)),n==h&&(o-=a),h?l+=a:s+=a}i.beginUpdate();try{for(var d=0,u=null,p=0,m=null,c=i.getChildCount(t),g=0;g<c;g++){var x=i.getChildAt(t,g);if(!this.isVertexIgnored(x)&&this.isVertexMovable(x)){var y=i.getGeometry(x);if(null!=y){y=y.clone(),null!=this.wrap&&null!=u&&(n&&u.x+u.width+y.width+2*this.spacing>this.wrap||!n&&u.y+u.height+y.height+2*this.spacing>this.wrap)&&(u=null,n?l+=d+this.spacing:s+=d+this.spacing,d=0),d=Math.max(d,n?y.height:y.width);var f=0;if(!this.borderCollapse){var v=this.graph.getCellStyle(x);f=mxUtils.getNumber(v,mxConstants.STYLE_STROKEWIDTH,1)}null!=u?n?y.x=p+this.spacing+Math.floor(f/2):y.y=p+this.spacing+Math.floor(f/2):this.keepFirstLocation||(n?y.x=s:y.y=l),n?y.y=l:y.x=s,this.fill&&null!=o&&(n?y.height=o:y.width=o),this.setChildGeometry(x,y),m=x,u=y,p=n?u.x+u.width+Math.floor(f/2):u.y+u.height+Math.floor(f/2)}}}this.resizeParent&&null!=e&&null!=u&&!this.graph.isCellCollapsed(t)?this.updateParentGeometry(t,e,u):this.resizeLast&&null!=e&&null!=u&&null!=m&&(n?u.width=e.width-u.x-this.spacing-this.marginRight-this.marginLeft:u.height=e.height-u.y-this.spacing-this.marginBottom,this.setChildGeometry(m,u))}finally{i.endUpdate()}}},mxStackLayout.prototype.setChildGeometry=function(t,e){var n=this.graph.getCellGeometry(t);null!=n&&e.x==n.x&&e.y==n.y&&e.width==n.width&&e.height==n.height||this.graph.getModel().setGeometry(t,e)},mxStackLayout.prototype.updateParentGeometry=function(t,e,n){var i=this.isHorizontal(),o=this.graph.getModel(),s=e.clone();if(i){var l=n.x+n.width+this.marginRight+this.border;this.resizeParentMax?s.width=Math.max(s.width,l):s.width=l}else{l=n.y+n.height+this.marginBottom+this.border;this.resizeParentMax?s.height=Math.max(s.height,l):s.height=l}e.x==s.x&&e.y==s.y&&e.width==s.width&&e.height==s.height||o.setGeometry(t,s)},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(t,e,n){var i=this.graph.getModel(),o=i.getParent(t);if(null!=t&&null!=o){var s=0,l=0,r=i.getChildCount(o);for(s=0;s<r;s++){var a=i.getChildAt(o,s),h=this.getVertexBounds(a);if(null!=h){var d=h.x+h.width/2;if(l<e&&e<d)break;l=d}}var u=o.getIndex(t);u=Math.max(0,s-(u<s?1:0)),i.add(o,t,u)}},mxPartitionLayout.prototype.execute=function(t){var e=this.isHorizontal(),n=this.graph.getModel(),i=n.getGeometry(t);null!=this.graph.container&&(null==i&&n.isLayer(t)||t==this.graph.getView().currentRoot)&&(i=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));if(null!=i){for(var o=[],s=n.getChildCount(t),l=0;l<s;l++){var r=n.getChildAt(t,l);!this.isVertexIgnored(r)&&this.isVertexMovable(r)&&o.push(r)}var a=o.length;if(0<a){var h=this.border,d=this.border,u=e?i.height:i.width;u-=2*this.border;var p=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;u-=e?p.height:p.width,h+=p.width,d+=p.height;var m=this.border+(a-1)*this.spacing,c=e?(i.width-h-m)/a:(i.height-d-m)/a;if(0<c){n.beginUpdate();try{for(l=0;l<a;l++){r=o[l];var g=n.getGeometry(r);null!=g&&((g=g.clone()).x=h,g.y=d,e?(this.resizeVertices&&(g.width=c,g.height=u),h+=c+this.spacing):(this.resizeVertices&&(g.height=c,g.width=u),d+=c+this.spacing),n.setGeometry(r,g))}}finally{n.endUpdate()}}}}},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(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(t).length},mxCompactTreeLayout.prototype.isHorizontal=function(){return this.horizontal},mxCompactTreeLayout.prototype.execute=function(t,e){this.parent=t;var n=this.graph.getModel();if(null==e)if(0<this.graph.getEdges(t,n.getParent(t),this.invert,!this.invert,!1).length)this.root=t;else{var i=this.graph.findTreeRoots(t,!0,this.invert);if(0<i.length)for(var o=0;o<i.length;o++)if(!this.isVertexIgnored(i[o])&&0<this.graph.getEdges(i[o],null,this.invert,!this.invert,!1).length){this.root=i[o];break}}else this.root=e;if(null!=this.root){if(this.resizeParent?this.parentsChanged=new Object:this.parentsChanged=null,this.parentX=null,this.parentY=null,t!=this.root&&null!=n.isVertex(t)&&this.maintainParentLocation)null!=(a=this.graph.getCellGeometry(t))&&(this.parentX=a.x,this.parentY=a.y);n.beginUpdate();try{if(this.visited=new Object,this.node=this.dfs(this.root,t),this.alignRanks&&(this.maxRankHeight=[],this.findRankHeights(this.node,0),this.setCellHeights(this.node,0)),null!=this.node){this.layout(this.node);var s=this.graph.gridSize,l=s;if(!this.moveTree){var r=this.getVertexBounds(this.root);null!=r&&(s=r.x,l=r.y)}var a,h=null;if(null!=(h=this.isHorizontal()?this.horizontalLayout(this.node,s,l):this.verticalLayout(this.node,null,s,l))){var d=0,u=0;h.x<0&&(d=Math.abs(s-h.x)),h.y<0&&(u=Math.abs(l-h.y)),0==d&&0==u||this.moveNode(this.node,d,u),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(this.node)}if(null!=this.parentX&&null!=this.parentY)null!=(a=this.graph.getCellGeometry(t))&&((a=a.clone()).x=this.parentX,a.y=this.parentY,n.setGeometry(t,a))}}finally{n.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(t,e,n){t.x+=e,t.y+=n,this.apply(t);for(var i=t.child;null!=i;)this.moveNode(i,e,n),i=i.next},mxCompactTreeLayout.prototype.sortOutgoingEdges=function(l,t){var r=new mxDictionary;t.sort(function(t,e){var n=t.getTerminal(t.getTerminal(!1)==l),i=r.get(n);null==i&&(i=mxCellPath.create(n).split(mxCellPath.PATH_SEPARATOR),r.put(n,i));var o=e.getTerminal(e.getTerminal(!1)==l),s=r.get(o);return null==s&&(s=mxCellPath.create(o).split(mxCellPath.PATH_SEPARATOR),r.put(o,s)),mxCellPath.compare(i,s)})},mxCompactTreeLayout.prototype.findRankHeights=function(t,e){(null==this.maxRankHeight[e]||this.maxRankHeight[e]<t.height)&&(this.maxRankHeight[e]=t.height);for(var n=t.child;null!=n;)this.findRankHeights(n,e+1),n=n.next},mxCompactTreeLayout.prototype.setCellHeights=function(t,e){null!=this.maxRankHeight[e]&&this.maxRankHeight[e]>t.height&&(t.height=this.maxRankHeight[e]);for(var n=t.child;null!=n;)this.setCellHeights(n,e+1),n=n.next},mxCompactTreeLayout.prototype.dfs=function(t,e){var n=mxCellPath.create(t),i=null;if(null!=t&&null==this.visited[n]&&!this.isVertexIgnored(t)){this.visited[n]=t,i=this.createNode(t);var o=this.graph.getModel(),s=null,l=this.graph.getEdges(t,e,this.invert,!this.invert,!1,!0),r=this.graph.getView();this.sortEdges&&this.sortOutgoingEdges(t,l);for(var a=0;a<l.length;a++){var h=l[a];if(!this.isEdgeIgnored(h)){this.resetEdges&&this.setEdgePoints(h,null),this.edgeRouting&&(this.setEdgeStyleEnabled(h,!1),this.setEdgePoints(h,null));var d=r.getState(h),u=null!=d?d.getVisibleTerminal(this.invert):r.getVisibleTerminal(h,this.invert),p=this.dfs(u,e);null!=p&&null!=o.getGeometry(u)&&(null==s?i.child=p:s.next=p,s=p)}}}return i},mxCompactTreeLayout.prototype.layout=function(t){if(null!=t){for(var e=t.child;null!=e;)this.layout(e),e=e.next;null!=t.child?this.attachParent(t,this.join(t)):this.layoutLeaf(t)}},mxCompactTreeLayout.prototype.horizontalLayout=function(t,e,n,i){t.x+=e+t.offsetX,t.y+=n+t.offsetY,i=this.apply(t,i);var o=t.child;if(null!=o){i=this.horizontalLayout(o,t.x,t.y,i);for(var s=t.y+o.offsetY,l=o.next;null!=l;)i=this.horizontalLayout(l,t.x+o.offsetX,s,i),s+=l.offsetY,l=l.next}return i},mxCompactTreeLayout.prototype.verticalLayout=function(t,e,n,i,o){t.x+=n+t.offsetY,t.y+=i+t.offsetX,o=this.apply(t,o);var s=t.child;if(null!=s){o=this.verticalLayout(s,t,t.x,t.y,o);for(var l=t.x+s.offsetY,r=s.next;null!=r;)o=this.verticalLayout(r,t,l,t.y+s.offsetX,o),l+=r.offsetY,r=r.next}return o},mxCompactTreeLayout.prototype.attachParent=function(t,e){var n=this.nodeDistance+this.levelDistance,i=(e-t.width)/2-this.nodeDistance,o=i+t.width+2*this.nodeDistance-e;t.child.offsetX=n+t.height,t.child.offsetY=o,t.contour.upperHead=this.createLine(t.height,0,this.createLine(n,o,t.contour.upperHead)),t.contour.lowerHead=this.createLine(t.height,0,this.createLine(n,i,t.contour.lowerHead))},mxCompactTreeLayout.prototype.layoutLeaf=function(t){var e=2*this.nodeDistance;t.contour.upperTail=this.createLine(t.height+e,0),t.contour.upperHead=t.contour.upperTail,t.contour.lowerTail=this.createLine(0,-t.width-e),t.contour.lowerHead=this.createLine(t.height+e,0,t.contour.lowerTail)},mxCompactTreeLayout.prototype.join=function(t){var e=2*this.nodeDistance,n=t.child;t.contour=n.contour;var i=n.width+e,o=i;for(n=n.next;null!=n;){var s=this.merge(t.contour,n.contour);n.offsetY=s+i,n.offsetX=0,o+=s+(i=n.width+e),n=n.next}return o},mxCompactTreeLayout.prototype.merge=function(t,e){for(var n=0,i=0,o=0,s=t.lowerHead,l=e.upperHead;null!=l&&null!=s;){var r=this.offset(n,i,l.dx,l.dy,s.dx,s.dy);i+=r,o+=r,n+l.dx<=s.dx?(n+=l.dx,i+=l.dy,l=l.next):(n-=s.dx,i-=s.dy,s=s.next)}if(null!=l){var a=this.bridge(t.upperTail,0,0,l,n,i);t.upperTail=null!=a.next?e.upperTail:a,t.lowerTail=e.lowerTail}else{null==(a=this.bridge(e.lowerTail,n,i,s,0,0)).next&&(t.lowerTail=a)}return t.lowerHead=e.lowerHead,o},mxCompactTreeLayout.prototype.offset=function(t,e,n,i,o,s){var l=0;if(o<=t||t+n<=0)return 0;if(0<o*i-n*s)if(t<0)l=t*i/n-e;else if(0<t){l=t*s/o-e}else l=-e;else if(o<t+n){l=s-(e+(o-t)*i/n)}else if(t+n<o){l=(n+t)*s/o-(e+i)}else l=s-(e+i);return 0<l?l:0},mxCompactTreeLayout.prototype.bridge=function(t,e,n,i,o,s){var l=o+i.dx-e,r=0;r=0==i.dx?i.dy:l*i.dy/i.dx;var a=this.createLine(l,r,i.next);return t.next=this.createLine(0,s+i.dy-r-n,a),a},mxCompactTreeLayout.prototype.createNode=function(t){var e=new Object;e.cell=t,e.x=0,e.y=0,e.width=0,e.height=0;var n=this.getVertexBounds(t);return null!=n&&(this.isHorizontal()?(e.width=n.height,e.height=n.width):(e.width=n.width,e.height=n.height)),e.offsetX=0,e.offsetY=0,e.contour=new Object,e},mxCompactTreeLayout.prototype.apply=function(t,e){var n=this.graph.getModel(),i=t.cell,o=n.getGeometry(i);if(null!=i&&null!=o){if(this.isVertexMovable(i)&&(o=this.setVertexLocation(i,t.x,t.y),this.resizeParent)){var s=n.getParent(i),l=mxCellPath.create(s);null==this.parentsChanged[l]&&(this.parentsChanged[l]=s)}e=null==e?new mxRectangle(o.x,o.y,o.width,o.height):new mxRectangle(Math.min(e.x,o.x),Math.min(e.y,o.y),Math.max(e.x+e.width,o.x+o.width),Math.max(e.y+e.height,o.y+o.height))}return e},mxCompactTreeLayout.prototype.createLine=function(t,e,n){var i=new Object;return i.dx=t,i.dy=e,i.next=n,i},mxCompactTreeLayout.prototype.adjustParents=function(){var t=[];for(var e in this.parentsChanged)t.push(this.parentsChanged[e]);this.arrangeGroups(mxUtils.sortCells(t,!0),this.groupPadding,this.groupPaddingTop,this.groupPaddingRight,this.groupPaddingBottom,this.groupPaddingLeft)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(t){this.processNodeOutgoing(t);for(var e=t.child;null!=e;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(t){for(var e=t.child,n=t.cell,i=0,o=[];null!=e;){i++;var s=e.x;this.horizontal&&(s=e.y),o.push(new WeightedCellSorter(e,s)),e=e.next}o.sort(WeightedCellSorter.prototype.compare);var l=t.width,r=(i+1)*this.prefHozEdgeSep;l>r+2*this.prefHozEdgeSep&&(l-=2*this.prefHozEdgeSep);var a=l/i,h=a/2;l>r+2*this.prefHozEdgeSep&&(h+=this.prefHozEdgeSep);var d=this.minEdgeJetty-this.prefVertEdgeOff,u=0,p=this.getVertexBounds(n);e=t.child;for(var m=0;m<o.length;m++){for(var c=o[m].cell.cell,g=this.getVertexBounds(c),x=this.graph.getEdgesBetween(n,c,!1),y=[],f=0,v=0,C=0;C<x.length;C++)this.horizontal?(f=p.x+p.width,v=p.y+h,y.push(new mxPoint(f,v)),f=p.x+p.width+d,y.push(new mxPoint(f,v)),v=g.y+g.height/2):(f=p.x+h,v=p.y+p.height,y.push(new mxPoint(f,v)),v=p.y+p.height+d,y.push(new mxPoint(f,v)),f=g.x+g.width/2),y.push(new mxPoint(f,v)),this.setEdgePoints(x[C],y);m<i/2?d+=this.prefVertEdgeOff:i/2<m&&(d-=this.prefVertEdgeOff),h+=a,u=Math.max(u,d)}},mxUtils.extend(mxRadialTreeLayout,mxCompactTreeLayout),mxRadialTreeLayout.prototype.angleOffset=.5,mxRadialTreeLayout.prototype.rootx=0,mxRadialTreeLayout.prototype.rooty=0,mxRadialTreeLayout.prototype.levelDistance=120,mxRadialTreeLayout.prototype.nodeDistance=10,mxRadialTreeLayout.prototype.autoRadius=!1,mxRadialTreeLayout.prototype.sortEdges=!1,mxRadialTreeLayout.prototype.rowMinX=[],mxRadialTreeLayout.prototype.rowMaxX=[],mxRadialTreeLayout.prototype.rowMinCenX=[],mxRadialTreeLayout.prototype.rowMaxCenX=[],mxRadialTreeLayout.prototype.rowRadi=[],mxRadialTreeLayout.prototype.row=[],mxRadialTreeLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(t).length},mxRadialTreeLayout.prototype.execute=function(t,e){this.parent=t,this.useBoundingBox=!1,this.edgeRouting=!1,mxCompactTreeLayout.prototype.execute.apply(this,arguments);var n=null,i=this.getVertexBounds(this.root);for(var o in this.centerX=i.x+i.width/2,this.centerY=i.y+i.height/2,this.visited){var s=this.getVertexBounds(this.visited[o]);(n=null!=n?n:s.clone()).add(s)}this.calcRowDims([this.node],0);for(var l=0,r=0,a=0;a<this.row.length;a++){var h=(this.centerX-this.rowMinX[a]-this.nodeDistance)/this.rowRadi[a],d=(this.rowMaxX[a]-this.centerX-this.nodeDistance)/this.rowRadi[a];l=Math.max(l,h),r=Math.max(r,d)}for(a=0;a<this.row.length;a++)for(var u=this.centerX-this.nodeDistance-l*this.rowRadi[a],p=this.centerX+this.nodeDistance+r*this.rowRadi[a]-u,m=0;m<this.row[a].length;m++){var c=(y=this.row[a])[m],g=((s=this.getVertexBounds(c.cell)).x+s.width/2-u)/p,x=2*Math.PI*g;c.theta=x}for(a=this.row.length-2;0<=a;a--){var y=this.row[a];for(m=0;m<y.length;m++){for(var f=(c=y[m]).child,v=0,C=0;null!=f;)C+=f.theta,v++,f=f.next;if(0<v){var E=C/v;if(E>c.theta&&m<y.length-1){var w=y[m+1].theta;c.theta=Math.min(E,w-Math.PI/10)}else if(E<c.theta&&0<m){var S=y[m-1].theta;c.theta=Math.max(E,S+Math.PI/10)}}}}for(a=0;a<this.row.length;a++)for(m=0;m<this.row[a].length;m++){c=(y=this.row[a])[m],s=this.getVertexBounds(c.cell);this.setVertexLocation(c.cell,this.centerX-s.width/2+this.rowRadi[a]*Math.cos(c.theta),this.centerY-s.height/2+this.rowRadi[a]*Math.sin(c.theta))}},mxRadialTreeLayout.prototype.calcRowDims=function(t,e){if(null!=t&&0!=t.length){this.rowMinX[e]=this.centerX,this.rowMaxX[e]=this.centerX,this.rowMinCenX[e]=this.centerX,this.rowMaxCenX[e]=this.centerX;for(var n=!(this.row[e]=[]),i=0;i<t.length;i++)for(var o=null!=t[i]?t[i].child:null;null!=o;){var s=o.cell,l=this.getVertexBounds(s);this.rowMinX[e]=Math.min(l.x,this.rowMinX[e]),this.rowMaxX[e]=Math.max(l.x+l.width,this.rowMaxX[e]),this.rowMinCenX[e]=Math.min(l.x+l.width/2,this.rowMinCenX[e]),this.rowMaxCenX[e]=Math.max(l.x+l.width/2,this.rowMaxCenX[e]),this.rowRadi[e]=l.y-this.getVertexBounds(this.root).y,null!=o.child&&(n=!0),this.row[e].push(o),o=o.next}n&&this.calcRowDims(this.row[e],e+1)}},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.vertexArray,mxFastOrganicLayout.prototype.dispX,mxFastOrganicLayout.prototype.dispY,mxFastOrganicLayout.prototype.cellLocation,mxFastOrganicLayout.prototype.radius,mxFastOrganicLayout.prototype.radiusSquared,mxFastOrganicLayout.prototype.isMoveable,mxFastOrganicLayout.prototype.neighbours,mxFastOrganicLayout.prototype.indices,mxFastOrganicLayout.prototype.allowedToRun=!0,mxFastOrganicLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(t).length},mxFastOrganicLayout.prototype.execute=function(t){var e=this.graph.getModel();this.vertexArray=[];for(var n=this.graph.getChildVertices(t),i=0;i<n.length;i++)this.isVertexIgnored(n[i])||this.vertexArray.push(n[i]);var o=this.useInputOrigin?this.graph.getBoundingBoxFromGeometry(this.vertexArray):null,s=this.vertexArray.length;this.indices=[],this.dispX=[],this.dispY=[],this.cellLocation=[],this.isMoveable=[],this.neighbours=[],this.radius=[],this.radiusSquared=[],this.forceConstant<.001&&(this.forceConstant=.001),this.forceConstantSquared=this.forceConstant*this.forceConstant;for(i=0;i<this.vertexArray.length;i++){var l=this.vertexArray[i];this.cellLocation[i]=[];var r=mxObjectIdentity.get(l);this.indices[r]=i;var a=(y=this.getVertexBounds(l)).width,h=y.height,d=y.x,u=y.y;this.cellLocation[i][0]=d+a/2,this.cellLocation[i][1]=u+h/2,this.radius[i]=Math.min(a,h),this.radiusSquared[i]=this.radius[i]*this.radius[i]}e.beginUpdate();try{for(i=0;i<s;i++){this.dispX[i]=0,this.dispY[i]=0,this.isMoveable[i]=this.isVertexMovable(this.vertexArray[i]);var p=this.graph.getConnections(this.vertexArray[i],t);n=this.graph.getOpposites(p,this.vertexArray[i]);this.neighbours[i]=[];for(var m=0;m<n.length;m++){this.resetEdges&&this.graph.resetEdge(p[m]),this.disableEdgeStyle&&this.setEdgeStyleEnabled(p[m],!1);r=mxObjectIdentity.get(n[m]);var c=this.indices[r];this.neighbours[i][m]=null!=c?c:i}}for(this.temperature=this.initialTemp,0==this.maxIterations&&(this.maxIterations=20*Math.sqrt(s)),this.iteration=0;this.iteration<this.maxIterations;this.iteration++){if(!this.allowedToRun)return;this.calcRepulsion(),this.calcAttraction(),this.calcPositions(),this.reduceTemperature()}var g=null,x=null;for(i=0;i<this.vertexArray.length;i++){var y;l=this.vertexArray[i];if(this.isVertexMovable(l))if(null!=(y=this.getVertexBounds(l))){this.cellLocation[i][0]-=y.width/2,this.cellLocation[i][1]-=y.height/2;d=this.graph.snap(Math.round(this.cellLocation[i][0])),u=this.graph.snap(Math.round(this.cellLocation[i][1]));this.setVertexLocation(l,d,u),g=null==g?d:Math.min(g,d),x=null==x?u:Math.min(x,u)}}var f=1-(g||0),v=1-(x||0);null!=o&&(f+=o.x,v+=o.y),this.graph.moveCells(this.vertexArray,f,v)}finally{e.endUpdate()}},mxFastOrganicLayout.prototype.calcPositions=function(){for(var t=0;t<this.vertexArray.length;t++)if(this.isMoveable[t]){var e=Math.sqrt(this.dispX[t]*this.dispX[t]+this.dispY[t]*this.dispY[t]);e<.001&&(e=.001);var n=this.dispX[t]/e*Math.min(e,this.temperature),i=this.dispY[t]/e*Math.min(e,this.temperature);this.dispX[t]=0,this.dispY[t]=0,this.cellLocation[t][0]+=n,this.cellLocation[t][1]+=i}},mxFastOrganicLayout.prototype.calcAttraction=function(){for(var t=0;t<this.vertexArray.length;t++)for(var e=0;e<this.neighbours[t].length;e++){var n=this.neighbours[t][e];if(t!=n&&this.isMoveable[t]&&this.isMoveable[n]){var i=this.cellLocation[t][0]-this.cellLocation[n][0],o=this.cellLocation[t][1]-this.cellLocation[n][1],s=i*i+o*o-this.radiusSquared[t]-this.radiusSquared[n];s<this.minDistanceLimitSquared&&(s=this.minDistanceLimitSquared);var l=Math.sqrt(s),r=s/this.forceConstant,a=i/l*r,h=o/l*r;this.dispX[t]-=a,this.dispY[t]-=h,this.dispX[n]+=a,this.dispY[n]+=h}}},mxFastOrganicLayout.prototype.calcRepulsion=function(){for(var t=this.vertexArray.length,e=0;e<t;e++)for(var n=e;n<t;n++){if(!this.allowedToRun)return;if(n!=e&&this.isMoveable[e]&&this.isMoveable[n]){var i=this.cellLocation[e][0]-this.cellLocation[n][0],o=this.cellLocation[e][1]-this.cellLocation[n][1];0==i&&(i=.01+Math.random()),0==o&&(o=.01+Math.random());var s=Math.sqrt(i*i+o*o),l=s-this.radius[e]-this.radius[n];if(l>this.maxDistanceLimit)continue;l<this.minDistanceLimit&&(l=this.minDistanceLimit);var r=this.forceConstantSquared/l,a=i/s*r,h=o/s*r;this.dispX[e]+=a,this.dispY[e]+=h,this.dispX[n]-=a,this.dispY[n]-=h}}},mxFastOrganicLayout.prototype.reduceTemperature=function(){this.temperature=this.initialTemp*(1-this.iteration/this.maxIterations)},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(t){var e=this.graph.getModel();e.beginUpdate();try{for(var n=0,i=null,o=null,s=[],l=e.getChildCount(t),r=0;r<l;r++){var a=e.getChildAt(t,r);if(this.isVertexIgnored(a))this.isEdgeIgnored(a)||(this.resetEdges&&this.graph.resetEdge(a),this.disableEdgeStyle&&this.setEdgeStyleEnabled(a,!1));else{s.push(a);var h=this.getVertexBounds(a);i=null==i?h.y:Math.min(i,h.y),o=null==o?h.x:Math.min(o,h.x),n=Math.max(n,Math.max(h.width,h.height))}}var d=this.getRadius(s.length,n);this.moveCircle&&(o=this.x0,i=this.y0),this.circle(s,d,o,i)}finally{e.endUpdate()}},mxCircleLayout.prototype.getRadius=function(t,e){return Math.max(t*e/Math.PI,this.radius)},mxCircleLayout.prototype.circle=function(t,e,n,i){for(var o=t.length,s=2*Math.PI/o,l=0;l<o;l++)this.isVertexMovable(t[l])&&this.setVertexLocation(t[l],Math.round(n+e+e*Math.sin(l*s)),Math.round(i+e+e*Math.cos(l*s)))},mxParallelEdgeLayout.prototype=new mxGraphLayout,mxParallelEdgeLayout.prototype.constructor=mxParallelEdgeLayout,mxParallelEdgeLayout.prototype.spacing=20,mxParallelEdgeLayout.prototype.execute=function(t){var e=this.findParallels(t);this.graph.model.beginUpdate();try{for(var n in e){var i=e[n];1<i.length&&this.layout(i)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(t){for(var e=this.graph.getModel(),n=[],i=e.getChildCount(t),o=0;o<i;o++){var s=e.getChildAt(t,o);if(!this.isEdgeIgnored(s)){var l=this.getEdgeId(s);null!=l&&(null==n[l]&&(n[l]=[]),n[l].push(s))}}return n},mxParallelEdgeLayout.prototype.getEdgeId=function(t){var e=this.graph.getView(),n=e.getVisibleTerminal(t,!0),i=e.getVisibleTerminal(t,!1);return null!=n&&null!=i?(n=mxObjectIdentity.get(n),(i=mxObjectIdentity.get(i))<n?i+"-"+n:n+"-"+i):null},mxParallelEdgeLayout.prototype.layout=function(t){var e=t[0],n=this.graph.getView(),i=this.graph.getModel(),o=i.getGeometry(n.getVisibleTerminal(e,!0)),s=i.getGeometry(n.getVisibleTerminal(e,!1));if(o==s)for(var l=o.x+o.width+this.spacing,r=o.y+o.height/2,a=0;a<t.length;a++)this.route(t[a],l,r),l+=this.spacing;else if(null!=o&&null!=s){var h=o.x+o.width/2,d=o.y+o.height/2,u=s.x+s.width/2-h,p=s.y+s.height/2-d,m=Math.sqrt(u*u+p*p);if(0<m){l=h+u/2,r=d+p/2;var c=p*this.spacing/m,g=u*this.spacing/m;l+=c*(t.length-1)/2,r-=g*(t.length-1)/2;for(a=0;a<t.length;a++)this.route(t[a],l,r),l-=c,r+=g}}},mxParallelEdgeLayout.prototype.route=function(t,e,n){this.graph.isCellMovable(t)&&this.setEdgePoints(t,[new mxPoint(e,n)])},mxCompositeLayout.prototype=new mxGraphLayout,mxCompositeLayout.prototype.constructor=mxCompositeLayout,mxCompositeLayout.prototype.layouts=null,mxCompositeLayout.prototype.master=null,mxCompositeLayout.prototype.moveCell=function(t,e,n){null!=this.master?this.master.move.apply(this.master,arguments):this.layouts[0].move.apply(this.layouts[0],arguments)},mxCompositeLayout.prototype.execute=function(t){var e=this.graph.getModel();e.beginUpdate();try{for(var n=0;n<this.layouts.length;n++)this.layouts[n].execute.apply(this.layouts[n],arguments)}finally{e.endUpdate()}},mxEdgeLabelLayout.prototype=new mxGraphLayout,mxEdgeLabelLayout.prototype.constructor=mxEdgeLabelLayout,mxEdgeLabelLayout.prototype.execute=function(t){for(var e=this.graph.view,n=this.graph.getModel(),i=[],o=[],s=n.getChildCount(t),l=0;l<s;l++){var r=n.getChildAt(t,l),a=e.getState(r);null!=a&&(this.isVertexIgnored(r)?this.isEdgeIgnored(r)||i.push(a):o.push(a))}this.placeLabels(o,i)},mxEdgeLabelLayout.prototype.placeLabels=function(t,e){var n=this.graph.getModel();n.beginUpdate();try{for(var i=0;i<e.length;i++){var o=e[i];if(null!=o&&null!=o.text&&null!=o.text.boundingBox)for(var s=0;s<t.length;s++){var l=t[s];null!=l&&this.avoid(o,l)}}}finally{n.endUpdate()}},mxEdgeLabelLayout.prototype.avoid=function(t,e){var n=this.graph.getModel(),i=t.text.boundingBox;if(mxUtils.intersects(i,e)){var o=-i.y-i.height+e.y,s=-i.y+e.y+e.height,l=Math.abs(o)<Math.abs(s)?o:s,r=-i.x-i.width+e.x,a=-i.x+e.x+e.width,h=Math.abs(r)<Math.abs(a)?r:a;Math.abs(h)<Math.abs(l)?l=0:h=0;var d=n.getGeometry(t.cell);null!=d&&(null!=(d=d.clone()).offset?(d.offset.x+=h,d.offset.y+=l):d.offset=new mxPoint(h,l),n.setGeometry(t.cell,d))}},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(t){return null},mxGraphAbstractHierarchyCell.prototype.getPreviousLayerConnectedCells=function(t){return null},mxGraphAbstractHierarchyCell.prototype.isEdge=function(){return!1},mxGraphAbstractHierarchyCell.prototype.isVertex=function(){return!1},mxGraphAbstractHierarchyCell.prototype.getGeneralPurposeVariable=function(t){return null},mxGraphAbstractHierarchyCell.prototype.setGeneralPurposeVariable=function(t,e){return null},mxGraphAbstractHierarchyCell.prototype.setX=function(t,e){this.isVertex()?this.x[0]=e:this.isEdge()&&(this.x[t-this.minRank-1]=e)},mxGraphAbstractHierarchyCell.prototype.getX=function(t){return this.isVertex()?this.x[0]:this.isEdge()?this.x[t-this.minRank-1]:0},mxGraphAbstractHierarchyCell.prototype.setY=function(t,e){this.isVertex()?this.y[0]=e:this.isEdge()&&(this.y[t-this.minRank-1]=e)},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(t){return this.maxRank},mxGraphHierarchyNode.prototype.getNextLayerConnectedCells=function(t){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[],this.nextLayerConnectedCells[0]=[];for(var e=0;e<this.connectsAsTarget.length;e++){var n=this.connectsAsTarget[e];-1==n.maxRank||n.maxRank==t+1?this.nextLayerConnectedCells[0].push(n.source):this.nextLayerConnectedCells[0].push(n)}}return this.nextLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.getPreviousLayerConnectedCells=function(t){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[],this.previousLayerConnectedCells[0]=[];for(var e=0;e<this.connectsAsSource.length;e++){var n=this.connectsAsSource[e];-1==n.minRank||n.minRank==t-1?this.previousLayerConnectedCells[0].push(n.target):this.previousLayerConnectedCells[0].push(n)}}return this.previousLayerConnectedCells[0]},mxGraphHierarchyNode.prototype.isVertex=function(){return!0},mxGraphHierarchyNode.prototype.getGeneralPurposeVariable=function(t){return this.temp[0]},mxGraphHierarchyNode.prototype.setGeneralPurposeVariable=function(t,e){this.temp[0]=e},mxGraphHierarchyNode.prototype.isAncestor=function(t){if(null!=t&&null!=this.hashCode&&null!=t.hashCode&&this.hashCode.length<t.hashCode.length){if(this.hashCode==t.hashCode)return!0;if(null==this.hashCode||null==this.hashCode)return!1;for(var e=0;e<this.hashCode.length;e++)if(this.hashCode[e]!=t.hashCode[e])return!1;return!0}return!1},mxGraphHierarchyNode.prototype.getCoreCell=function(){return this.cell},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(t){var e=this.source;this.source=this.target,this.target=e,this.isReversed=!this.isReversed},mxGraphHierarchyEdge.prototype.getNextLayerConnectedCells=function(t){if(null==this.nextLayerConnectedCells){this.nextLayerConnectedCells=[];for(var e=0;e<this.temp.length;e++)this.nextLayerConnectedCells[e]=[],e==this.temp.length-1?this.nextLayerConnectedCells[e].push(this.source):this.nextLayerConnectedCells[e].push(this)}return this.nextLayerConnectedCells[t-this.minRank-1]},mxGraphHierarchyEdge.prototype.getPreviousLayerConnectedCells=function(t){if(null==this.previousLayerConnectedCells){this.previousLayerConnectedCells=[];for(var e=0;e<this.temp.length;e++)this.previousLayerConnectedCells[e]=[],0==e?this.previousLayerConnectedCells[e].push(this.target):this.previousLayerConnectedCells[e].push(this)}return this.previousLayerConnectedCells[t-this.minRank-1]},mxGraphHierarchyEdge.prototype.isEdge=function(){return!0},mxGraphHierarchyEdge.prototype.getGeneralPurposeVariable=function(t){return this.temp[t-this.minRank-1]},mxGraphHierarchyEdge.prototype.setGeneralPurposeVariable=function(t,e){this.temp[t-this.minRank-1]=e},mxGraphHierarchyEdge.prototype.getCoreCell=function(){return null!=this.edges&&0<this.edges.length?this.edges[0]:null},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(t,e,n){for(var i=t.getGraph(),o=0;o<e.length;o++){n[o]=new mxGraphHierarchyNode(e[o]),this.vertexMapper.put(e[o],n[o]);var s=t.getEdges(e[o]);n[o].connectsAsSource=[];for(var l=0;l<s.length;l++){var r=t.getVisibleTerminal(s[l],!1);if(r!=e[o]&&t.graph.model.isVertex(r)&&!t.isVertexIgnored(r)){var a=t.getEdgesBetween(e[o],r,!1),h=t.getEdgesBetween(e[o],r,!0);if(null!=a&&0<a.length&&null==this.edgeMapper.get(a[0])&&2*h.length>=a.length){for(var d=new mxGraphHierarchyEdge(a),u=0;u<a.length;u++){var p=a[u];this.edgeMapper.put(p,d),i.resetEdge(p),t.disableEdgeStyle&&(t.setEdgeStyleEnabled(p,!1),t.setOrthogonalEdge(p,!0))}d.source=n[o],mxUtils.indexOf(n[o].connectsAsSource,d)<0&&n[o].connectsAsSource.push(d)}}}n[o].temp[0]=0}},mxGraphHierarchyModel.prototype.initialRank=function(){var t=[];if(null!=this.roots)for(var e=0;e<this.roots.length;e++){null!=(h=this.vertexMapper.get(this.roots[e]))&&t.push(h)}var n=this.vertexMapper.getValues();for(e=0;e<n.length;e++)n[e].temp[0]=-1;for(var i=t.slice();0<t.length;){var o;u=(h=t[0]).connectsAsTarget,o=h.connectsAsSource;var s=!0,l=this.SOURCESCANSTARTRANK;for(e=0;e<u.length;e++){if(5270620!=(m=u[e]).temp[0]){s=!1;break}var r=m.source;l=Math.min(l,r.temp[0]-1)}if(s){if(h.temp[0]=l,this.maxRank=Math.min(this.maxRank,l),null!=o)for(e=0;e<o.length;e++){(m=o[e]).temp[0]=5270620,-1==(r=m.target).temp[0]&&(t.push(r),r.temp[0]=-2)}t.shift()}else{var a=t.shift();if(t.push(h),a==h&&1==t.length)break}}for(e=0;e<n.length;e++)n[e].temp[0]-=this.maxRank;for(e=0;e<i.length;e++)for(var h,d=0,u=(h=i[e]).connectsAsSource,p=0;p<u.length;p++){var m;r=(m=u[p]).target;h.temp[0]=Math.max(d,r.temp[0]+1),d=h.temp[0]}this.maxRank=this.SOURCESCANSTARTRANK-this.maxRank},mxGraphHierarchyModel.prototype.fixRanks=function(){var l=[];this.ranks=[];for(var t=0;t<this.maxRank+1;t++)l[t]=[],this.ranks[t]=l[t];var e=null;if(null!=this.roots){var n=this.roots;e=[];for(t=0;t<n.length;t++){var i=n[t],o=this.vertexMapper.get(i);e[t]=o}}this.visit(function(t,e,n,i,o){if((0==o&&e.maxRank<0&&e.minRank<0&&(l[e.temp[0]].push(e),e.maxRank=e.temp[0],e.minRank=e.temp[0],e.temp[0]=l[e.maxRank].length-1),null!=t&&null!=n)&&1<t.maxRank-e.maxRank){n.maxRank=t.maxRank,n.minRank=e.maxRank,n.temp=[],n.x=[],n.y=[];for(var s=n.minRank+1;s<n.maxRank;s++)l[s].push(n),n.setGeneralPurposeVariable(s,l[s].length-1)}},e,!1,null)},mxGraphHierarchyModel.prototype.visit=function(t,e,n,i){if(null!=e){for(var o=0;o<e.length;o++){var s=e[o];null!=s&&(null==i&&(i=new Object),n?(s.hashCode=[],s.hashCode[0]=this.dfsCount,s.hashCode[1]=o,this.extendedDfs(null,s,null,t,i,s.hashCode,o,0)):this.dfs(null,s,null,t,i,0))}this.dfsCount++}},mxGraphHierarchyModel.prototype.dfs=function(t,e,n,i,o,s){if(null!=e){var l=e.id;if(null==o[l]){i(t,o[l]=e,n,s,0);for(var r=e.connectsAsSource.slice(),a=0;a<r.length;a++){var h=r[a],d=h.target;this.dfs(e,d,h,i,o,s+1)}}else i(t,e,n,s,1)}},mxGraphHierarchyModel.prototype.extendedDfs=function(t,e,n,i,o,s,l,r){if(null!=e){if(null!=t&&(null==e.hashCode||e.hashCode[0]!=t.hashCode[0])){var a=t.hashCode.length+1;e.hashCode=t.hashCode.slice(),e.hashCode[a-1]=l}var h=e.id;if(null==o[h]){i(t,o[h]=e,n,r,0);for(var d=e.connectsAsSource.slice(),u=0;u<d.length;u++){var p=d[u],m=p.target;this.extendedDfs(e,m,p,i,o,e.hashCode,u,r+1)}}else i(t,e,n,r,1)}},mxSwimlaneModel.prototype.maxRank=null,mxSwimlaneModel.prototype.vertexMapper=null,mxSwimlaneModel.prototype.edgeMapper=null,mxSwimlaneModel.prototype.ranks=null,mxSwimlaneModel.prototype.roots=null,mxSwimlaneModel.prototype.parent=null,mxSwimlaneModel.prototype.dfsCount=0,mxSwimlaneModel.prototype.SOURCESCANSTARTRANK=1e8,mxSwimlaneModel.prototype.tightenToSource=!1,mxSwimlaneModel.prototype.ranksPerGroup=null,mxSwimlaneModel.prototype.createInternalCells=function(t,e,n){for(var i=t.getGraph(),o=t.swimlanes,s=0;s<e.length;s++){n[s]=new mxGraphHierarchyNode(e[s]),this.vertexMapper.put(e[s],n[s]),n[s].swimlaneIndex=-1;for(var l=0;l<o.length;l++)if(i.model.getParent(e[s])==o[l]){n[s].swimlaneIndex=l;break}var r=t.getEdges(e[s]);n[s].connectsAsSource=[];for(var a=0;a<r.length;a++){var h=t.getVisibleTerminal(r[a],!1);if(h!=e[s]&&t.graph.model.isVertex(h)&&!t.isVertexIgnored(h)){var d=t.getEdgesBetween(e[s],h,!1),u=t.getEdgesBetween(e[s],h,!0);if(null!=d&&0<d.length&&null==this.edgeMapper.get(d[0])&&2*u.length>=d.length){for(var p=new mxGraphHierarchyEdge(d),m=0;m<d.length;m++){var c=d[m];this.edgeMapper.put(c,p),i.resetEdge(c),t.disableEdgeStyle&&(t.setEdgeStyleEnabled(c,!1),t.setOrthogonalEdge(c,!0))}p.source=n[s],mxUtils.indexOf(n[s].connectsAsSource,p)<0&&n[s].connectsAsSource.push(p)}}}n[s].temp[0]=0}},mxSwimlaneModel.prototype.initialRank=function(){this.ranksPerGroup=[];var t=[],e=new Object;if(null!=this.roots)for(var n=0;n<this.roots.length;n++){var i=this.vertexMapper.get(this.roots[n]);this.maxChainDfs(null,i,null,e,0),null!=i&&t.push(i)}var o=[],s=[];for(n=this.ranksPerGroup.length-1;0<=n;n--)n==this.ranksPerGroup.length-1?o[n]=0:o[n]=s[n+1]+1,s[n]=o[n]+this.ranksPerGroup[n];this.maxRank=s[0];var l=this.vertexMapper.getValues();for(n=0;n<l.length;n++)l[n].temp[0]=-1;for(t.slice();0<t.length;){var r,a;r=(i=t[0]).connectsAsTarget,a=i.connectsAsSource;var h=!0,d=s[0];for(n=0;n<r.length;n++){if(5270620!=(p=r[n]).temp[0]){h=!1;break}var u=p.source;d=Math.min(d,u.temp[0]-1)}if(h){if(d>s[i.swimlaneIndex]&&(d=s[i.swimlaneIndex]),i.temp[0]=d,null!=a)for(n=0;n<a.length;n++){var p;(p=a[n]).temp[0]=5270620,-1==(u=p.target).temp[0]&&(t.push(u),u.temp[0]=-2)}t.shift()}else{var m=t.shift();if(t.push(i),m==i&&1==t.length)break}}},mxSwimlaneModel.prototype.maxChainDfs=function(t,e,n,i,o){if(null!=e){var s=mxCellPath.create(e.cell);if(null==i[s]){var l=(i[s]=e).swimlaneIndex;(null==this.ranksPerGroup[l]||this.ranksPerGroup[l]<o)&&(this.ranksPerGroup[l]=o);for(var r=e.connectsAsSource.slice(),a=0;a<r.length;a++){var h=r[a],d=h.target;e.swimlaneIndex<d.swimlaneIndex?this.maxChainDfs(e,d,h,mxUtils.clone(i,null,!0),0):e.swimlaneIndex==d.swimlaneIndex&&this.maxChainDfs(e,d,h,mxUtils.clone(i,null,!0),o+1)}}}},mxSwimlaneModel.prototype.fixRanks=function(){var l=[];this.ranks=[];for(var t=0;t<this.maxRank+1;t++)l[t]=[],this.ranks[t]=l[t];var e=null;if(null!=this.roots){var n=this.roots;e=[];for(t=0;t<n.length;t++){var i=n[t],o=this.vertexMapper.get(i);e[t]=o}}this.visit(function(t,e,n,i,o){if((0==o&&e.maxRank<0&&e.minRank<0&&(l[e.temp[0]].push(e),e.maxRank=e.temp[0],e.minRank=e.temp[0],e.temp[0]=l[e.maxRank].length-1),null!=t&&null!=n)&&1<t.maxRank-e.maxRank){n.maxRank=t.maxRank,n.minRank=e.maxRank,n.temp=[],n.x=[],n.y=[];for(var s=n.minRank+1;s<n.maxRank;s++)l[s].push(n),n.setGeneralPurposeVariable(s,l[s].length-1)}},e,!1,null)},mxSwimlaneModel.prototype.visit=function(t,e,n,i){if(null!=e){for(var o=0;o<e.length;o++){var s=e[o];null!=s&&(null==i&&(i=new Object),n?(s.hashCode=[],s.hashCode[0]=this.dfsCount,s.hashCode[1]=o,this.extendedDfs(null,s,null,t,i,s.hashCode,o,0)):this.dfs(null,s,null,t,i,0))}this.dfsCount++}},mxSwimlaneModel.prototype.dfs=function(t,e,n,i,o,s){if(null!=e){var l=e.id;if(null==o[l]){i(t,o[l]=e,n,s,0);for(var r=e.connectsAsSource.slice(),a=0;a<r.length;a++){var h=r[a],d=h.target;this.dfs(e,d,h,i,o,s+1)}}else i(t,e,n,s,1)}},mxSwimlaneModel.prototype.extendedDfs=function(t,e,n,i,o,s,l,r){if(null!=e){if(null!=t&&(null==e.hashCode||e.hashCode[0]!=t.hashCode[0])){var a=t.hashCode.length+1;e.hashCode=t.hashCode.slice(),e.hashCode[a-1]=l}var h=e.id;if(null==o[h]){i(t,o[h]=e,n,r,0);for(var d=e.connectsAsSource.slice(),u=e.connectsAsTarget.slice(),p=0;p<d.length;p++){var m=(c=d[p]).target;e.swimlaneIndex<=m.swimlaneIndex&&this.extendedDfs(e,m,c,i,o,e.hashCode,p,r+1)}for(p=0;p<u.length;p++){var c;m=(c=u[p]).source;e.swimlaneIndex<m.swimlaneIndex&&this.extendedDfs(e,m,c,i,o,e.hashCode,p,r+1)}}else i(t,e,n,r,1)}},mxHierarchicalLayoutStage.prototype.execute=function(t){},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(t){var e=this.layout.getModel();this.nestedBestRanks=[];for(var n=0;n<e.ranks.length;n++)this.nestedBestRanks[n]=e.ranks[n].slice();var i=0,o=this.calculateCrossings(e);for(n=0;n<this.maxIterations&&i<this.maxNoImprovementIterations;n++){this.weightedMedian(n,e),this.transpose(n,e);var s=this.calculateCrossings(e);if(s<o){o=s;for(var l=i=0;l<this.nestedBestRanks.length;l++)for(var r=e.ranks[l],a=0;a<r.length;a++){var h=r[a];this.nestedBestRanks[l][h.getGeneralPurposeVariable(l)]=h}}else{i++;for(l=0;l<this.nestedBestRanks.length;l++)for(r=e.ranks[l],a=0;a<r.length;a++){(h=r[a]).setGeneralPurposeVariable(l,a)}}if(0==o)break}var d=[],u=[];for(n=0;n<e.maxRank+1;n++)u[n]=[],d[n]=u[n];for(n=0;n<this.nestedBestRanks.length;n++)for(l=0;l<this.nestedBestRanks[n].length;l++)u[n].push(this.nestedBestRanks[n][l]);e.ranks=d},mxMedianHybridCrossingReduction.prototype.calculateCrossings=function(t){for(var e=t.ranks.length,n=0,i=1;i<e;i++)n+=this.calculateRankCrossing(i,t);return n},mxMedianHybridCrossingReduction.prototype.calculateRankCrossing=function(t,e){for(var n=0,i=e.ranks[t],o=e.ranks[t-1],s=[],l=0;l<i.length;l++){for(var r=i[l],a=r.getGeneralPurposeVariable(t),h=r.getPreviousLayerConnectedCells(t),d=[],u=0;u<h.length;u++){var p=h[u].getGeneralPurposeVariable(t-1);d.push(p)}d.sort(function(t,e){return t-e}),s[a]=d}var m=[];for(l=0;l<s.length;l++)m=m.concat(s[l]);for(var c=1;c<o.length;)c<<=1;var g=2*c-1;c-=1;var x=[];for(l=0;l<g;++l)x[l]=0;for(l=0;l<m.length;l++){var y=m[l]+c;for(++x[y];0<y;)y%2&&(n+=x[y+1]),++x[y=y-1>>1]}return n},mxMedianHybridCrossingReduction.prototype.transpose=function(t,e){for(var n=!0,i=0;n&&i++<10;){var o=t%2==1&&i%2==1;n=!1;for(var s=0;s<e.ranks.length;s++){for(var l=e.ranks[s],r=[],a=0;a<l.length;a++){var h=l[a],d=h.getGeneralPurposeVariable(s);d<0&&(d=a),r[d]=h}var u=null,p=null,m=null,c=null,g=null,x=null,y=null,f=null,v=null,C=null;for(a=0;a<l.length-1;a++){if(0==a){u=(v=r[a]).getNextLayerConnectedCells(s),p=v.getPreviousLayerConnectedCells(s),g=[],x=[];for(var E=0;E<u.length;E++)g[E]=u[E].getGeneralPurposeVariable(s+1);for(E=0;E<p.length;E++)x[E]=p[E].getGeneralPurposeVariable(s-1)}else u=m,p=c,g=y,x=f,v=C;m=(C=r[a+1]).getNextLayerConnectedCells(s),c=C.getPreviousLayerConnectedCells(s),y=[],f=[];for(E=0;E<m.length;E++)y[E]=m[E].getGeneralPurposeVariable(s+1);for(E=0;E<c.length;E++)f[E]=c[E].getGeneralPurposeVariable(s-1);var w=0,S=0;for(E=0;E<g.length;E++)for(var b=0;b<y.length;b++)g[E]>y[b]&&w++,g[E]<y[b]&&S++;for(E=0;E<x.length;E++)for(b=0;b<f.length;b++)x[E]>f[b]&&w++,x[E]<f[b]&&S++;if(S<w||S==w&&o){var T=v.getGeneralPurposeVariable(s);v.setGeneralPurposeVariable(s,C.getGeneralPurposeVariable(s)),C.setGeneralPurposeVariable(s,T),m=u,c=p,y=g,f=x,C=v,o||(n=!0)}}}}},mxMedianHybridCrossingReduction.prototype.weightedMedian=function(t,e){var n=t%2==0;if(n)for(var i=e.maxRank-1;0<=i;i--)this.medianRank(i,n);else for(i=1;i<e.maxRank;i++)this.medianRank(i,n)},mxMedianHybridCrossingReduction.prototype.medianRank=function(t,e){for(var n=this.nestedBestRanks[t].length,i=[],o=[],s=0;s<n;s++){var l,r,a=this.nestedBestRanks[t][s],h=new MedianCellSorter;h.cell=a,r=e?t+1:t-1,null!=(l=e?a.getNextLayerConnectedCells(t):a.getPreviousLayerConnectedCells(t))&&0!=l.length?(h.medianValue=this.medianValue(l,r),i.push(h)):o[a.getGeneralPurposeVariable(t)]=!0}i.sort(MedianCellSorter.prototype.compare);for(s=0;s<n;s++){if(null==o[s])(a=i.shift().cell).setGeneralPurposeVariable(t,s)}},mxMedianHybridCrossingReduction.prototype.medianValue=function(t,e){for(var n=[],i=0,o=0;o<t.length;o++){var s=t[o];n[i++]=s.getGeneralPurposeVariable(e)}if(n.sort(function(t,e){return t-e}),i%2==1)return n[Math.floor(i/2)];if(2==i)return(n[0]+n[1])/2;var l=i/2,r=n[l-1]-n[0],a=n[i-1]-n[l];return(n[l-1]*a+n[l]*r)/(r+a)},MedianCellSorter.prototype.medianValue=0,MedianCellSorter.prototype.cell=!1,MedianCellSorter.prototype.compare=function(t,e){return null!=t&&null!=e?e.medianValue>t.medianValue?-1:e.medianValue<t.medianValue?1:0:0},mxMinimumCycleRemover.prototype=new mxHierarchicalLayoutStage,mxMinimumCycleRemover.prototype.constructor=mxMinimumCycleRemover,mxMinimumCycleRemover.prototype.layout=null,mxMinimumCycleRemover.prototype.execute=function(t){for(var e=this.layout.getModel(),s=new Object,n=e.vertexMapper.getValues(),l=new Object,i=0;i<n.length;i++)l[n[i].id]=n[i];var o=null;if(null!=e.roots){var r=e.roots;o=[];for(i=0;i<r.length;i++)o[i]=e.vertexMapper.get(r[i])}e.visit(function(t,e,n,i,o){e.isAncestor(t)&&(n.invert(),mxUtils.remove(n,t.connectsAsSource),t.connectsAsTarget.push(n),mxUtils.remove(n,e.connectsAsTarget),e.connectsAsSource.push(n)),s[e.id]=e,delete l[e.id]},o,!0,null);var a=mxUtils.clone(s,null,!0);e.visit(function(t,e,n,i,o){e.isAncestor(t)&&(n.invert(),mxUtils.remove(n,t.connectsAsSource),e.connectsAsSource.push(n),t.connectsAsTarget.push(n),mxUtils.remove(n,e.connectsAsTarget)),s[e.id]=e,delete l[e.id]},l,!0,a)},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 t=this.layout.getModel();mxLog.show(),mxLog.writeln("======Coord assignment debug=======");for(var e=0;e<t.ranks.length;e++){mxLog.write("Rank ",e," : ");for(var n=t.ranks[e],i=0;i<n.length;i++){var o=n[i];mxLog.write(o.getGeneralPurposeVariable(e),"  ")}mxLog.writeln()}mxLog.writeln("====================================")},mxCoordinateAssignment.prototype.execute=function(t){this.jettyPositions=Object();var e=this.layout.getModel();this.currentXDelta=0,this.initialCoords(this.layout.getGraph(),e),this.fineTuning&&this.minNode(e);var n=1e8;if(this.fineTuning)for(var i=0;i<this.maxIterations;i++){if(0!=i&&(this.medianPos(i,e),this.minNode(e)),this.currentXDelta<n){for(var o=0;o<e.ranks.length;o++)for(var s=e.ranks[o],l=0;l<s.length;l++){(r=s[l]).setX(o,r.getGeneralPurposeVariable(o))}n=this.currentXDelta}else for(o=0;o<e.ranks.length;o++)for(s=e.ranks[o],l=0;l<s.length;l++){var r;(r=s[l]).setGeneralPurposeVariable(o,r.getX(o))}this.minPath(this.layout.getGraph(),e),this.currentXDelta=0}this.setCellLocations(this.layout.getGraph(),e)},mxCoordinateAssignment.prototype.minNode=function(t){for(var e=[],n=new mxDictionary,i=[],o=0;o<=t.maxRank;o++){i[o]=t.ranks[o];for(var s=0;s<i[o].length;s++){var l=i[o][s],r=new WeightedCellSorter(l,o);r.rankIndex=s,r.visited=!0,e.push(r),n.put(l,r)}}for(var a=10*e.length,h=0;0<e.length&&h<=a;){var d=e.shift(),u=d.cell,p=d.weightedValue,m=parseInt(d.rankIndex),c=u.getNextLayerConnectedCells(p),g=u.getPreviousLayerConnectedCells(p),x=c.length,y=g.length,f=this.medianXValue(c,p+1),v=this.medianXValue(g,p-1),C=x+y,E=u.getGeneralPurposeVariable(p),w=E;0<C&&(w=(f*x+v*y)/C);var S=!1;if(w<E-1)if(0==m)u.setGeneralPurposeVariable(p,w),S=!0;else{var b=i[p][m-1],T=b.getGeneralPurposeVariable(p);(T=T+b.width/2+this.intraCellSpacing+u.width/2)<w?(u.setGeneralPurposeVariable(p,w),S=!0):T<u.getGeneralPurposeVariable(p)-1&&(u.setGeneralPurposeVariable(p,T),S=!0)}else if(E+1<w){if(m==i[p].length-1)u.setGeneralPurposeVariable(p,w),S=!0;else{var A=i[p][m+1],L=A.getGeneralPurposeVariable(p);w<(L=L-A.width/2-this.intraCellSpacing-u.width/2)?(u.setGeneralPurposeVariable(p,w),S=!0):L>u.getGeneralPurposeVariable(p)+1&&(u.setGeneralPurposeVariable(p,L),S=!0)}}if(S){for(o=0;o<c.length;o++){var I=c[o];null!=(M=n.get(I))&&0==M.visited&&(M.visited=!0,e.push(M))}for(o=0;o<g.length;o++){var M;I=g[o];null!=(M=n.get(I))&&0==M.visited&&(M.visited=!0,e.push(M))}}d.visited=!1,h++}},mxCoordinateAssignment.prototype.medianPos=function(t,e){if(t%2==0)for(var n=e.maxRank;0<n;n--)this.rankMedianPosition(n-1,e,n);else for(n=0;n<e.maxRank-1;n++)this.rankMedianPosition(n+1,e,n)},mxCoordinateAssignment.prototype.rankMedianPosition=function(t,e,n){for(var i=e.ranks[t],o=[],s=new Object,l=0;l<i.length;l++){var r=i[l];o[l]=new WeightedCellSorter,o[l].cell=r,o[l].rankIndex=l,s[r.id]=o[l];var a=null;a=n<t?r.getPreviousLayerConnectedCells(t):r.getNextLayerConnectedCells(t),o[l].weightedValue=this.calculatedWeightedValue(r,a)}o.sort(WeightedCellSorter.prototype.compare);for(l=0;l<o.length;l++){var h=o[l].cell,d=(a=null,0);null!=(a=n<t?h.getPreviousLayerConnectedCells(t).slice():h.getNextLayerConnectedCells(t).slice())&&(d=0<a.length?this.medianXValue(a,n):h.getGeneralPurposeVariable(t));for(var u=0,p=-1e8,m=o[l].rankIndex-1;0<=m;){if(null!=(y=s[i[m].id])){var c=y.cell;y.visited?(p=c.getGeneralPurposeVariable(t)+c.width/2+this.intraCellSpacing+u+h.width/2,m=-1):(u+=c.width+this.intraCellSpacing,m--)}}var g=0,x=1e8;for(m=o[l].rankIndex+1;m<o.length;){var y;if(null!=(y=s[i[m].id])){var f=y.cell;y.visited?(x=f.getGeneralPurposeVariable(t)-f.width/2-this.intraCellSpacing-g-h.width/2,m=o.length):(g+=f.width+this.intraCellSpacing,m++)}}p<=d&&d<=x?h.setGeneralPurposeVariable(t,d):d<p?(h.setGeneralPurposeVariable(t,p),this.currentXDelta+=p-d):x<d&&(h.setGeneralPurposeVariable(t,x),this.currentXDelta+=d-x),o[l].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(t,e){for(var n=0,i=0;i<e.length;i++){var o=e[i];t.isVertex()&&o.isVertex()?n++:t.isEdge()&&o.isEdge()?n+=8:n+=2}return n},mxCoordinateAssignment.prototype.medianXValue=function(t,e){if(0==t.length)return 0;for(var n=[],i=0;i<t.length;i++)n[i]=t[i].getGeneralPurposeVariable(e);if(n.sort(function(t,e){return t-e}),t.length%2==1)return n[Math.floor(t.length/2)];var o=t.length/2;return(n[o-1]+n[o])/2},mxCoordinateAssignment.prototype.initialCoords=function(t,e){this.calculateWidestRank(t,e);for(var n=this.widestRank;0<=n;n--)n<e.maxRank&&this.rankCoordinates(n,t,e);for(n=this.widestRank+1;n<=e.maxRank;n++)0<n&&this.rankCoordinates(n,t,e)},mxCoordinateAssignment.prototype.rankCoordinates=function(t,e,n){for(var i=n.ranks[t],o=0,s=this.initialX+(this.widestRankValue-this.rankWidths[t])/2,l=!1,r=0;r<i.length;r++){var a=i[r];if(a.isVertex()){var h=this.layout.getVertexBounds(a.cell);null!=h?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(a.width=h.width,a.height=h.height):(a.width=h.height,a.height=h.width):l=!0,o=Math.max(o,a.height)}else if(a.isEdge()){var d=1;null!=a.edges?d=a.edges.length:mxLog.warn("edge.edges is null"),a.width=(d-1)*this.parallelEdgeSpacing}s+=a.width/2,a.setX(t,s),a.setGeneralPurposeVariable(t,s),s+=a.width/2,s+=this.intraCellSpacing}1==l&&mxLog.warn("At least one cell has no bounds")},mxCoordinateAssignment.prototype.calculateWidestRank=function(t,e){var n=-this.interRankCellSpacing,i=0;this.rankWidths=[],this.rankY=[];for(var o=e.maxRank;0<=o;o--){for(var s=0,l=e.ranks[o],r=this.initialX,a=!1,h=0;h<l.length;h++){var d=l[h];if(d.isVertex()){var u=this.layout.getVertexBounds(d.cell);null!=u?this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(d.width=u.width,d.height=u.height):(d.width=u.height,d.height=u.width):a=!0,s=Math.max(s,d.height)}else if(d.isEdge()){var p=1;null!=d.edges?p=d.edges.length:mxLog.warn("edge.edges is null"),d.width=(p-1)*this.parallelEdgeSpacing}r+=d.width/2,d.setX(o,r),d.setGeneralPurposeVariable(o,r),r+=d.width/2,(r+=this.intraCellSpacing)>this.widestRankValue&&(this.widestRankValue=r,this.widestRank=o),this.rankWidths[o]=r}1==a&&mxLog.warn("At least one cell has no bounds"),this.rankY[o]=n;var m=s/2+i/2+this.interRankCellSpacing;i=s,this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?n+=m:n-=m;for(h=0;h<l.length;h++){l[h].setY(o,n)}}},mxCoordinateAssignment.prototype.minPath=function(t,e){for(var n=e.edgeMapper.getValues(),i=0;i<n.length;i++){var o=n[i];if(!(o.maxRank-o.minRank-1<1)){for(var s=o.getGeneralPurposeVariable(o.minRank+1),l=!0,r=0,a=o.minRank+2;a<o.maxRank;a++){var h=o.getGeneralPurposeVariable(a);s!=h?(l=!1,s=h):r++}if(!l){var d=0,u=0,p=[],m=[],c=o.getGeneralPurposeVariable(o.minRank+1);for(a=o.minRank+1;a<o.maxRank-1;a++){c==(g=o.getX(a+1))?(p[a-o.minRank-1]=c,d++):this.repositionValid(e,o,a+1,c)?(p[a-o.minRank-1]=c,d++):c=p[a-o.minRank-1]=g}c=o.getX(a);for(a=o.maxRank-1;a>o.minRank+1;a--){var g;c==(g=o.getX(a-1))?(m[a-o.minRank-2]=c,u++):this.repositionValid(e,o,a-1,c)?(m[a-o.minRank-2]=c,u++):(m[a-o.minRank-2]=o.getX(a-1),c=g)}if(r<u||r<d)if(d<=u)for(a=o.maxRank-2;a>o.minRank;a--)o.setX(a,m[a-o.minRank-1]);else if(u<d)for(a=o.minRank+2;a<o.maxRank;a++)o.setX(a,p[a-o.minRank-2])}}}},mxCoordinateAssignment.prototype.repositionValid=function(t,e,n,i){for(var o=t.ranks[n],s=-1,l=0;l<o.length;l++)if(e==o[l]){s=l;break}if(s<0)return!1;var r=e.getGeneralPurposeVariable(n);if(i<r){if(0==s)return!0;var a=o[s-1],h=a.getGeneralPurposeVariable(n);return(h=h+a.width/2+this.intraCellSpacing+e.width/2)<=i}if(r<i){if(s==o.length-1)return!0;var d=o[s+1],u=d.getGeneralPurposeVariable(n);return i<=(u=u-d.width/2-this.intraCellSpacing-e.width/2)}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(t,e){this.rankTopY=[],this.rankBottomY=[];for(var n=0;n<e.ranks.length;n++)this.rankTopY[n]=Number.MAX_VALUE,this.rankBottomY[n]=-Number.MAX_VALUE;var i=e.vertexMapper.getValues();for(n=0;n<i.length;n++)this.setVertexLocation(i[n]);this.layout.edgeStyle!=mxHierarchicalEdgeStyle.ORTHOGONAL&&this.layout.edgeStyle!=mxHierarchicalEdgeStyle.POLYLINE&&this.layout.edgeStyle!=mxHierarchicalEdgeStyle.CURVE||this.localEdgeProcessing(e);var o=e.edgeMapper.getValues();for(n=0;n<o.length;n++)this.setEdgePosition(o[n])},mxCoordinateAssignment.prototype.localEdgeProcessing=function(t){for(var e=0;e<t.ranks.length;e++)for(var n=t.ranks[e],i=0;i<n.length;i++){var o=n[i];if(o.isVertex())for(var s=o.getPreviousLayerConnectedCells(e),l=e-1,r=0;r<2;r++){if(-1<l&&l<t.ranks.length&&null!=s&&0<s.length){for(var a=[],h=0;h<s.length;h++){var d=new WeightedCellSorter(s[h],s[h].getX(l));a.push(d)}a.sort(WeightedCellSorter.prototype.compare);var u=o.x[0]-o.width/2,p=u+o.width,m=0,c=[];for(h=0;h<a.length;h++){var g,x=a[h].cell;if(x.isVertex()){g=0==r?o.connectsAsSource:o.connectsAsTarget;for(var y=0;y<g.length;y++)g[y].source!=x&&g[y].target!=x||(m+=g[y].edges.length,0,c.push(g[y]))}else m+=x.edges.length,0,c.push(x)}var f=(m+1)*this.prefHozEdgeSep;o.width>f+2*this.prefHozEdgeSep&&(u+=this.prefHozEdgeSep,p-=this.prefHozEdgeSep);var v=(p-u)/m,C=u+v/2,E=this.minEdgeJetty-this.prefVertEdgeOff,w=0;for(h=0;h<c.length;h++){var S=c[h].edges.length,b=this.jettyPositions[c[h].ids[0]];null==b&&(b=[],this.jettyPositions[c[h].ids[0]]=b),h<m/2?E+=this.prefVertEdgeOff:m/2<h&&(E-=this.prefVertEdgeOff);for(var T=0;T<S;T++)b[4*T+2*r]=C,C+=v,b[4*T+2*r+1]=E;w=Math.max(w,E)}}s=o.getNextLayerConnectedCells(e),l=e+1}}},mxCoordinateAssignment.prototype.setEdgePosition=function(t){var e=0;if(101207!=t.temp[0]){var n=t.maxRank,i=t.minRank;n==i&&(n=t.source.maxRank,i=t.target.minRank);for(var o=0,s=this.jettyPositions[t.ids[0]],l=t.isReversed?t.target.cell:t.source.cell,r=this.layout.graph,a=this.orientation==mxConstants.DIRECTION_EAST||this.orientation==mxConstants.DIRECTION_SOUTH,h=0;h<t.edges.length;h++){var d=t.edges[h],u=this.layout.getVisibleTerminal(d,!0),p=[],m=t.isReversed;if(u!=l&&(m=!m),null!=s){var c=m?2:0,g=m?a?this.rankBottomY[i]:this.rankTopY[i]:a?this.rankTopY[n]:this.rankBottomY[n],x=s[4*o+1+c];m!=a&&(x=-x),g+=x;var y=s[4*o+c],f=r.model.getTerminal(d,!0);if(this.layout.isPort(f)&&r.model.getParent(f)==u)y=null!=(M=r.view.getState(f))?M.x:u.geometry.x+t.source.width*f.geometry.x;this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(p.push(new mxPoint(y,g)),this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&p.push(new mxPoint(y,g+x))):(p.push(new mxPoint(g,y)),this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&p.push(new mxPoint(g+x,y)))}var v=t.x.length-1,C=-1,E=-1,w=t.maxRank-1;m&&(v=0,C=t.x.length,E=1,w=t.minRank+1);for(var S=v;t.maxRank!=t.minRank&&S!=C;S+=E){var b=t.x[S]+e,T=(this.rankTopY[w]+this.rankBottomY[w+1])/2,A=(this.rankTopY[w-1]+this.rankBottomY[w])/2;if(m){var L=T;T=A,A=L}this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(p.push(new mxPoint(b,T)),p.push(new mxPoint(b,A))):(p.push(new mxPoint(T,b)),p.push(new mxPoint(A,b))),this.limitX=Math.max(this.limitX,b),w+=E}if(null!=s){c=m?2:0;var I=m?a?this.rankTopY[n]:this.rankBottomY[n]:a?this.rankBottomY[i]:this.rankTopY[i];x=s[4*o+3-c];m!=a&&(x=-x);g=I-x,y=s[4*o+2-c];var M,R=r.model.getTerminal(d,!1),P=this.layout.getVisibleTerminal(d,!1);if(this.layout.isPort(R)&&r.model.getParent(R)==P)y=null!=(M=r.view.getState(R))?M.x:P.geometry.x+t.target.width*R.geometry.x;this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&p.push(new mxPoint(y,g-x)),p.push(new mxPoint(y,g))):(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&p.push(new mxPoint(g-x,y)),p.push(new mxPoint(g,y)))}t.isReversed&&this.processReversedEdge(t,d),this.layout.setEdgePoints(d,p),e=0==e?this.parallelEdgeSpacing:0<e?-e:-e+this.parallelEdgeSpacing,o++}t.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(t){var e=t.cell,n=t.x[0]-t.width/2,i=t.y[0]-t.height/2;this.rankTopY[t.minRank]=Math.min(this.rankTopY[t.minRank],i),this.rankBottomY[t.minRank]=Math.max(this.rankBottomY[t.minRank],i+t.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(e,n,i):this.layout.setVertexLocation(e,i,n),this.limitX=Math.max(this.limitX,n+t.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(t,e){},mxSwimlaneOrdering.prototype=new mxHierarchicalLayoutStage,mxSwimlaneOrdering.prototype.constructor=mxSwimlaneOrdering,mxSwimlaneOrdering.prototype.layout=null,mxSwimlaneOrdering.prototype.execute=function(t){var e=this.layout.getModel(),a=new Object,h=mxUtils.clone(e.vertexMapper,null,!0),n=null;if(null!=e.roots){var i=e.roots;n=[];for(var o=0;o<i.length;o++){mxCellPath.create(i[o]);n[o]=e.vertexMapper.get(i[o])}}e.visit(function(t,e,n,i,o){var s=null!=t&&t.swimlaneIndex==e.swimlaneIndex&&e.isAncestor(t),l=null!=t&&null!=n&&t.swimlaneIndex<e.swimlaneIndex&&n.source==e;s?(n.invert(),mxUtils.remove(n,t.connectsAsSource),e.connectsAsSource.push(n),t.connectsAsTarget.push(n),mxUtils.remove(n,e.connectsAsTarget)):l&&(n.invert(),mxUtils.remove(n,t.connectsAsTarget),e.connectsAsTarget.push(n),t.connectsAsSource.push(n),mxUtils.remove(n,e.connectsAsSource));var r=mxCellPath.create(e.cell);a[r]=e,delete h[r]},n,!0,null)};var mxHierarchicalEdgeStyle={ORTHOGONAL:1,POLYLINE:2,STRAIGHT:3,CURVE:4};function mxSwimlaneLayout(t,e,n){mxGraphLayout.call(this,t),this.orientation=null!=e?e:mxConstants.DIRECTION_NORTH,this.deterministic=null==n||n}function mxGraphModel(t){this.currentEdit=this.createUndoableEdit(),null!=t?this.setRoot(t):this.clear()}function mxRootChange(t,e){this.model=t,this.root=e,this.previous=e}function mxChildChange(t,e,n,i){this.model=t,this.parent=e,this.previous=e,this.child=n,this.index=i,this.previousIndex=i}function mxTerminalChange(t,e,n,i){this.model=t,this.cell=e,this.terminal=n,this.previous=n,this.source=i}function mxValueChange(t,e,n){this.model=t,this.cell=e,this.value=n,this.previous=n}function mxStyleChange(t,e,n){this.model=t,this.cell=e,this.style=n,this.previous=n}function mxNodeTypeChange(t,e,n){this.model=t,this.cell=e,this.nodeType=n,this.previous=n}function mxGeometryChange(t,e,n){this.model=t,this.cell=e,this.geometry=n,this.previous=n}function mxCollapseChange(t,e,n){this.model=t,this.cell=e,this.collapsed=n,this.previous=n}function mxVisibleChange(t,e,n){this.model=t,this.cell=e,this.visible=n,this.previous=n}function mxCellAttributeChange(t,e,n){this.cell=t,this.attribute=e,this.value=n,this.previous=n}function mxCell(t,e,n,i){this.value=t,this.setGeometry(e),this.setStyle(n),this.branchType=i,null!=this.onInit&&this.onInit()}function mxGeometry(t,e,n,i,o){mxRectangle.call(this,t,e,n,i,o)}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(t,e){this.parent=t;var n=this.graph.model;if(this.edgesCache=new mxDictionary,this.edgeSourceTermCache=new mxDictionary,this.edgesTargetTermCache=new mxDictionary,null==e||e instanceof Array||(e=[e]),null!=e||null!=t){if(this.parentX=null,this.parentY=null,t!=this.root&&null!=n.isVertex(t)&&this.maintainParentLocation)null!=(s=this.graph.getCellGeometry(t))&&(this.parentX=s.x,this.parentY=s.y);if(null!=e){for(var i=[],o=0;o<e.length;o++){(null==t||n.isAncestor(t,e[o]))&&n.isVertex(e[o])&&i.push(e[o])}this.roots=i}n.beginUpdate();try{var s;if(this.run(t),this.resizeParent&&!this.graph.isCellCollapsed(t)&&this.graph.updateGroupBounds([t],this.parentBorder,this.moveParent),null!=this.parentX&&null!=this.parentY)null!=(s=this.graph.getCellGeometry(t))&&((s=s.clone()).x=this.parentX,s.y=this.parentY,n.setGeometry(t,s))}finally{n.endUpdate()}}},mxHierarchicalLayout.prototype.findRoots=function(t,e){var n=[];if(null!=t&&null!=e){var i=this.graph.model,o=null,s=-1e5;for(var l in e){var r=e[l];if(i.isVertex(r)&&this.graph.isCellVisible(r)){for(var a=this.getEdges(r),h=0,d=0,u=0;u<a.length;u++){this.getVisibleTerminal(a[u],!0)==r?h++:d++}0==d&&0<h&&n.push(r);var p=h-d;s<p&&(s=p,o=r)}}0==n.length&&null!=o&&n.push(o)}return n},mxHierarchicalLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(null!=e)return e;for(var n=this.graph.model,i=[],o=this.graph.isCellCollapsed(t),s=n.getChildCount(t),l=0;l<s;l++){var r=n.getChildAt(t,l);this.isPort(r)?i=i.concat(n.getEdges(r,!0,!0)):!o&&this.graph.isCellVisible(r)||(i=i.concat(n.getEdges(r,!0,!0)))}i=i.concat(n.getEdges(t,!0,!0));var a=[];for(l=0;l<i.length;l++){var h=this.getVisibleTerminal(i[l],!0),d=this.getVisibleTerminal(i[l],!1);(h==d||h!=d&&(d==t&&(null==this.parent||this.isAncestor(this.parent,h,this.traverseAncestors))||h==t&&(null==this.parent||this.isAncestor(this.parent,d,this.traverseAncestors))))&&a.push(i[l])}return this.edgesCache.put(t,a),a},mxHierarchicalLayout.prototype.getVisibleTerminal=function(t,e){var n=this.edgesTargetTermCache;e&&(n=this.edgeSourceTermCache);var i=n.get(t);if(null!=i)return i;var o=this.graph.view.getState(t),s=null!=o?o.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e);return null==s&&(s=null!=o?o.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e)),null!=s&&(this.isPort(s)&&(s=this.graph.model.getParent(s)),n.put(t,s)),s},mxHierarchicalLayout.prototype.run=function(t){var e=[],n=[];if(null==this.roots&&null!=t){var i=Object();this.filterDescendants(t,i),this.roots=[];var o=!0;for(var s in i)if(null!=i[s]){o=!1;break}for(;!o;){for(var l=this.findRoots(t,i),r=0;r<l.length;r++){var a=Object();e.push(a),this.traverse(l[r],!0,null,n,a,e,i)}for(r=0;r<l.length;r++)this.roots.push(l[r]);for(var s in o=!0,i)if(null!=i[s]){o=!1;break}}}else for(r=0;r<this.roots.length;r++){a=Object();e.push(a),this.traverse(this.roots[r],!0,null,n,a,e,null)}var h=0;for(r=0;r<e.length;r++){a=e[r];var d=[];for(var s in a)d.push(a[s]);this.model=new mxGraphHierarchyModel(this,d,this.roots,t,this.tightenToSource),this.cycleStage(t),this.layeringStage(),this.crossingStage(t),h=this.placementStage(h,t)}},mxHierarchicalLayout.prototype.filterDescendants=function(t,e){var n=this.graph.model;if(n.isVertex(t)&&t!=this.parent&&this.graph.isCellVisible(t)&&(e[mxObjectIdentity.get(t)]=t),this.traverseAncestors||t==this.parent&&this.graph.isCellVisible(t))for(var i=n.getChildCount(t),o=0;o<i;o++){var s=n.getChildAt(t,o);this.isPort(s)||this.filterDescendants(s,e)}},mxHierarchicalLayout.prototype.isPort=function(t){return!!t.geometry.relative},mxHierarchicalLayout.prototype.getEdgesBetween=function(t,e,n){n=null!=n&&n;for(var i=this.getEdges(t),o=[],s=0;s<i.length;s++){var l=this.getVisibleTerminal(i[s],!0),r=this.getVisibleTerminal(i[s],!1);(l==t&&r==e||!n&&l==e&&r==t)&&o.push(i[s])}return o},mxHierarchicalLayout.prototype.traverse=function(t,e,n,i,o,s,l){if(null!=t&&null!=i){var r=mxObjectIdentity.get(t);if(null!=i[r]||null!=l&&null==l[r]){if(null==o[r])for(p=0;p<s.length;p++){var a=s[p];if(null!=a[r]){for(var h in a)o[h]=a[h];return s.splice(p,1),o}}}else{null==o[r]&&(o[r]=t),null==i[r]&&(i[r]=t),null!==l&&delete l[r];for(var d=this.getEdges(t),u=[],p=0;p<d.length;p++)u[p]=this.getVisibleTerminal(d[p],!0)==t;for(var p=0;p<d.length;p++)if(!e||u[p]){for(var m=this.getVisibleTerminal(d[p],!u[p]),c=1,g=0;g<d.length;g++)if(g!=p){var x=u[g];this.getVisibleTerminal(d[g],!x)==m&&(x?c++:c--)}0<=c&&(o=this.traverse(m,e,d[p],i,o,s,l))}}}return o},mxHierarchicalLayout.prototype.cycleStage=function(t){new mxMinimumCycleRemover(this).execute(t)},mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxHierarchicalLayout.prototype.crossingStage=function(t){new mxMedianHybridCrossingReduction(this).execute(t)},mxHierarchicalLayout.prototype.placementStage=function(t,e){var n=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,t,this.parallelEdgeSpacing);return n.fineTuning=this.fineTuning,n.execute(e),n.limitX+this.interHierarchySpacing},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(t,e){this.parent=t;var n=this.graph.model;if(this.edgesCache=new mxDictionary,this.edgeSourceTermCache=new mxDictionary,this.edgesTargetTermCache=new mxDictionary,!(null==e||e.length<1)){if(null==t&&(t=n.getParent(e[0])),this.parentX=null,this.parentY=null,t!=this.root&&null!=n.isVertex(t)&&this.maintainParentLocation)null!=(l=this.graph.getCellGeometry(t))&&(this.parentX=l.x,this.parentY=l.y);this.swimlanes=e,this.dummyVertices=[];for(var i=0;i<e.length;i++){var o=this.graph.getChildCells(e[i]);if(null==o||0==o.length){var s=this.graph.insertVertex(e[i],null,null,0,0,this.dummyVertexWidth,0);this.dummyVertices.push(s)}}n.beginUpdate();try{var l;if(this.run(t),this.resizeParent&&!this.graph.isCellCollapsed(t)&&this.graph.updateGroupBounds([t],this.parentBorder,this.moveParent),null!=this.parentX&&null!=this.parentY)null!=(l=this.graph.getCellGeometry(t))&&((l=l.clone()).x=this.parentX,l.y=this.parentY,n.setGeometry(t,l));this.graph.removeCells(this.dummyVertices)}finally{n.endUpdate()}}},mxSwimlaneLayout.prototype.updateGroupBounds=function(){var t=[],e=this.model;for(var n in e.edgeMapper)for(var i=e.edgeMapper[n],o=0;o<i.edges.length;o++)t.push(i.edges[o]);var s=this.graph.getBoundingBoxFromGeometry(t,!0),l=[];for(o=0;o<this.swimlanes.length;o++){var r=this.swimlanes[o];if(null!=(c=this.graph.getCellGeometry(r))){var a=this.graph.getChildCells(r),h=this.graph.isSwimlane(r)?this.graph.getStartSize(r):new mxRectangle,d=this.graph.getBoundingBoxFromGeometry(a),u=(l[o]=d).y+c.y-h.height-this.parentBorder,p=d.y+c.y+d.height;if(null==s)s=new mxRectangle(0,u,0,p-u);else{s.y=Math.min(s.y,u);var m=Math.max(s.y+s.height,p);s.height=m-s.y}}}for(o=0;o<this.swimlanes.length;o++){var c;r=this.swimlanes[o];if(null!=(c=this.graph.getCellGeometry(r))){a=this.graph.getChildCells(r),h=this.graph.isSwimlane(r)?this.graph.getStartSize(r):new mxRectangle;var g=c.clone(),x=0==o?this.parentBorder:this.interRankCellSpacing/2;g.x+=l[o].x-h.width-x,g.y=g.y+s.y-c.y-this.parentBorder,g.width=l[o].width+h.width+this.interRankCellSpacing/2+x,g.height=s.height+h.height+2*this.parentBorder,this.graph.model.setGeometry(r,g),this.graph.moveCells(a,-l[o].x+h.width+x,c.y-s.y+this.parentBorder)}}},mxSwimlaneLayout.prototype.findRoots=function(t,e){var n=[];if(null!=t&&null!=e){var i=this.graph.model,o=null,s=-1e5;for(var l in e){var r=e[l];if(null!=r&&i.isVertex(r)&&this.graph.isCellVisible(r)&&i.isAncestor(t,r)){for(var a=this.getEdges(r),h=0,d=0,u=0;u<a.length;u++){var p=this.getVisibleTerminal(a[u],!0);if(p==r){var m=this.getVisibleTerminal(a[u],!1);i.isAncestor(t,m)&&h++}else i.isAncestor(t,p)&&d++}0==d&&0<h&&n.push(r);var c=h-d;s<c&&(s=c,o=r)}}0==n.length&&null!=o&&n.push(o)}return n},mxSwimlaneLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(null!=e)return e;for(var n=this.graph.model,i=[],o=this.graph.isCellCollapsed(t),s=n.getChildCount(t),l=0;l<s;l++){var r=n.getChildAt(t,l);this.isPort(r)?i=i.concat(n.getEdges(r,!0,!0)):!o&&this.graph.isCellVisible(r)||(i=i.concat(n.getEdges(r,!0,!0)))}i=i.concat(n.getEdges(t,!0,!0));var a=[];for(l=0;l<i.length;l++){var h=this.getVisibleTerminal(i[l],!0),d=this.getVisibleTerminal(i[l],!1);(h==d||h!=d&&(d==t&&(null==this.parent||this.graph.isValidAncestor(h,this.parent,this.traverseAncestors))||h==t&&(null==this.parent||this.graph.isValidAncestor(d,this.parent,this.traverseAncestors))))&&a.push(i[l])}return this.edgesCache.put(t,a),a},mxSwimlaneLayout.prototype.getVisibleTerminal=function(t,e){var n=this.edgesTargetTermCache;e&&(n=this.edgeSourceTermCache);var i=n.get(t);if(null!=i)return i;var o=this.graph.view.getState(t),s=null!=o?o.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e);return null==s&&(s=null!=o?o.getVisibleTerminal(e):this.graph.view.getVisibleTerminal(t,e)),null!=s&&(this.isPort(s)&&(s=this.graph.model.getParent(s)),n.put(t,s)),s},mxSwimlaneLayout.prototype.run=function(t){var e=[],n=[];if(null!=this.swimlanes&&0<this.swimlanes.length&&null!=t){for(var i=Object(),o=0;o<this.swimlanes.length;o++)this.filterDescendants(this.swimlanes[o],i);this.roots=[];var s=!0;for(var l in i)if(null!=i[l]){s=!1;break}for(var r=0;!s&&r<this.swimlanes.length;){var a=this.findRoots(this.swimlanes[r],i);if(0!=a.length){for(o=0;o<a.length;o++){var h=Object();e.push(h),this.traverse(a[o],!0,null,n,h,e,i,r)}for(o=0;o<a.length;o++)this.roots.push(a[o]);for(var l in s=!0,i)if(null!=i[l]){s=!1;break}}else r++}}else for(o=0;o<this.roots.length;o++){h=Object();e.push(h),this.traverse(this.roots[o],!0,null,n,h,e,null)}var d=[];for(var l in n)d.push(n[l]);this.model=new mxSwimlaneModel(this,d,this.roots,t,this.tightenToSource),this.cycleStage(t),this.layeringStage(),this.crossingStage(t),initialX=this.placementStage(0,t)},mxSwimlaneLayout.prototype.filterDescendants=function(t,e){var n=this.graph.model;if(n.isVertex(t)&&t!=this.parent&&n.getParent(t)!=this.parent&&this.graph.isCellVisible(t)&&(e[mxObjectIdentity.get(t)]=t),this.traverseAncestors||t==this.parent&&this.graph.isCellVisible(t))for(var i=n.getChildCount(t),o=0;o<i;o++){var s=n.getChildAt(t,o);this.isPort(s)||this.filterDescendants(s,e)}},mxSwimlaneLayout.prototype.isPort=function(t){return!!t.geometry.relative},mxSwimlaneLayout.prototype.getEdgesBetween=function(t,e,n){n=null!=n&&n;for(var i=this.getEdges(t),o=[],s=0;s<i.length;s++){var l=this.getVisibleTerminal(i[s],!0),r=this.getVisibleTerminal(i[s],!1);(l==t&&r==e||!n&&l==e&&r==t)&&o.push(i[s])}return o},mxSwimlaneLayout.prototype.traverse=function(t,e,n,i,o,s,l,r){if(null!=t&&null!=i){var a=mxObjectIdentity.get(t);if(null!=i[a]||null!=l&&null==l[a]){if(null==o[a])for(m=0;m<s.length;m++){var h=s[m];if(null!=h[a]){for(var d in h)o[d]=h[d];return s.splice(m,1),o}}}else{null==o[a]&&(o[a]=t),null==i[a]&&(i[a]=t),null!==l&&delete l[a];for(var u=this.getEdges(t),p=this.graph.model,m=0;m<u.length;m++){var c=this.getVisibleTerminal(u[m],!0),g=c==t;g&&(c=this.getVisibleTerminal(u[m],!1));var x=0;for(x=0;x<this.swimlanes.length&&!p.isAncestor(this.swimlanes[x],c);x++);x>=this.swimlanes.length||(r<x||(!e||g)&&x==r)&&(o=this.traverse(c,e,u[m],i,o,s,l,x))}}}return o},mxSwimlaneLayout.prototype.cycleStage=function(t){new mxSwimlaneOrdering(this).execute(t)},mxSwimlaneLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxSwimlaneLayout.prototype.crossingStage=function(t){new mxMedianHybridCrossingReduction(this).execute(t)},mxSwimlaneLayout.prototype.placementStage=function(t,e){var n=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,t,this.parallelEdgeSpacing);return n.fineTuning=this.fineTuning,n.execute(e),n.limitX+this.interHierarchySpacing},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(t){this.createIds=t},mxGraphModel.prototype.createRoot=function(){var t=new mxCell;return t.insert(new mxCell),t},mxGraphModel.prototype.getCell=function(t){return null!=this.cells?this.cells[t]:null},mxGraphModel.prototype.filterCells=function(t,e){var n=null;if(null!=t){n=[];for(var i=0;i<t.length;i++)e(t[i])&&n.push(t[i])}return n},mxGraphModel.prototype.getDescendants=function(t){return this.filterDescendants(null,t)},mxGraphModel.prototype.filterDescendants=function(t,e){var n=[];e=e||this.getRoot(),null!=t&&!t(e)||n.push(e);for(var i=this.getChildCount(e),o=0;o<i;o++){var s=this.getChildAt(e,o);n=n.concat(this.filterDescendants(t,s))}return n},mxGraphModel.prototype.getRoot=function(t){var e=t||this.root;if(null!=t)for(;null!=t;)e=t,t=this.getParent(t);return e},mxGraphModel.prototype.setRoot=function(t){return this.execute(new mxRootChange(this,t)),t},mxGraphModel.prototype.rootChanged=function(t){var e=this.root;return this.root=t,this.nextId=0,this.cells=null,this.cellAdded(t),e},mxGraphModel.prototype.isRoot=function(t){return null!=t&&this.root==t},mxGraphModel.prototype.isLayer=function(t){return this.isRoot(this.getParent(t))},mxGraphModel.prototype.isAncestor=function(t,e){for(;null!=e&&e!=t;)e=this.getParent(e);return e==t},mxGraphModel.prototype.contains=function(t){return this.isAncestor(this.root,t)},mxGraphModel.prototype.getParent=function(t){return null!=t?t.getParent():null},mxGraphModel.prototype.add=function(t,e,n){if(e!=t&&null!=t&&null!=e){null==n&&(n=this.getChildCount(t));var i=t!=this.getParent(e);this.execute(new mxChildChange(this,t,e,n)),this.maintainEdgeParent&&i&&this.updateEdgeParents(e)}return e},mxGraphModel.prototype.cellAdded=function(t){if(null!=t){if(null==t.getId()&&this.createIds&&t.setId(this.createId(t)),null!=t.getId()){var e=this.getCell(t.getId());if(e!=t){for(;null!=e;)t.setId(this.createId(t)),e=this.getCell(t.getId());null==this.cells&&(this.cells=new Object),this.cells[t.getId()]=t}}mxUtils.isNumeric(t.getId())&&(this.nextId=Math.max(this.nextId,t.getId()));for(var n=this.getChildCount(t),i=0;i<n;i++)this.cellAdded(this.getChildAt(t,i))}},mxGraphModel.prototype.createId=function(t){var e=this.nextId;return this.nextId++,this.prefix+e+this.postfix},mxGraphModel.prototype.updateEdgeParents=function(t,e){e=e||this.getRoot(t);for(var n=this.getChildCount(t),i=0;i<n;i++){var o=this.getChildAt(t,i);this.updateEdgeParents(o,e)}var s=this.getEdgeCount(t),l=[];for(i=0;i<s;i++)l.push(this.getEdgeAt(t,i));for(i=0;i<l.length;i++){var r=l[i];this.isAncestor(e,r)&&this.updateEdgeParent(r,e)}},mxGraphModel.prototype.updateEdgeParent=function(t,e){for(var n=this.getTerminal(t,!0),i=this.getTerminal(t,!1),o=null;null!=n&&!this.isEdge(n)&&null!=n.geometry&&n.geometry.relative;)n=this.getParent(n);for(;null!=i&&this.ignoreRelativeEdgeParent&&!this.isEdge(i)&&null!=i.geometry&&i.geometry.relative;)i=this.getParent(i);if(this.isAncestor(e,n)&&this.isAncestor(e,i)&&null!=(o=n==i?this.getParent(n):this.getNearestCommonAncestor(n,i))&&(this.getParent(o)!=this.root||this.isAncestor(o,t))&&this.getParent(t)!=o){var s=this.getGeometry(t);if(null!=s){var l=this.getOrigin(this.getParent(t)),r=this.getOrigin(o),a=r.x-l.x,h=r.y-l.y;(s=s.clone()).translate(-a,-h),this.setGeometry(t,s)}this.add(o,t,this.getChildCount(o))}},mxGraphModel.prototype.getOrigin=function(t){var e=null;if(null!=t){if(e=this.getOrigin(this.getParent(t)),!this.isEdge(t)){var n=this.getGeometry(t);null!=n&&(e.x+=n.x,e.y+=n.y)}}else e=new mxPoint;return e},mxGraphModel.prototype.getNearestCommonAncestor=function(t,e){if(null!=t&&null!=e){var n=mxCellPath.create(e);if(null!=n&&0<n.length){var i=t,o=mxCellPath.create(i);if(n.length<o.length){i=e;var s=o;o=n,n=s}for(;null!=i;){var l=this.getParent(i);if(0==n.indexOf(o+mxCellPath.PATH_SEPARATOR)&&null!=l)return i;o=mxCellPath.getParentPath(o),i=l}}}return null},mxGraphModel.prototype.remove=function(t){return t==this.root?this.setRoot(null):null!=this.getParent(t)&&this.execute(new mxChildChange(this,null,t)),t},mxGraphModel.prototype.cellRemoved=function(t){if(null!=t&&null!=this.cells){for(var e=this.getChildCount(t)-1;0<=e;e--)this.cellRemoved(this.getChildAt(t,e));null!=this.cells&&null!=t.getId()&&delete this.cells[t.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(t,e,n){var i=this.getParent(t);if(null!=e)e==i&&i.getIndex(t)==n||e.insert(t,n);else if(null!=i){var o=i.getIndex(t);i.remove(o)}return this.contains(i)||null==e?null==e&&this.cellRemoved(t):this.cellAdded(t),i},mxGraphModel.prototype.getChildCount=function(t){return null!=t?t.getChildCount():0},mxGraphModel.prototype.getChildAt=function(t,e){return null!=t?t.getChildAt(e):null},mxGraphModel.prototype.getChildren=function(t){return null!=t?t.children:null},mxGraphModel.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraphModel.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraphModel.prototype.getChildCells=function(t,e,n){e=null!=e&&e,n=null!=n&&n;for(var i=this.getChildCount(t),o=[],s=0;s<i;s++){var l=this.getChildAt(t,s);(!n&&!e||n&&this.isEdge(l)||e&&this.isVertex(l))&&o.push(l)}return o},mxGraphModel.prototype.getTerminal=function(t,e){return null!=t?t.getTerminal(e):null},mxGraphModel.prototype.setTerminal=function(t,e,n){var i=e!=this.getTerminal(t,n);return this.execute(new mxTerminalChange(this,t,e,n)),this.maintainEdgeParent&&i&&this.updateEdgeParent(t,this.getRoot()),e},mxGraphModel.prototype.setTerminals=function(t,e,n){this.beginUpdate();try{this.setTerminal(t,e,!0),this.setTerminal(t,n,!1)}finally{this.endUpdate()}},mxGraphModel.prototype.terminalForCellChanged=function(t,e,n){var i=this.getTerminal(t,n);return null!=e?e.insertEdge(t,n):null!=i&&i.removeEdge(t,n),i},mxGraphModel.prototype.getEdgeCount=function(t){return null!=t?t.getEdgeCount():0},mxGraphModel.prototype.getEdgeAt=function(t,e){return null!=t?t.getEdgeAt(e):null},mxGraphModel.prototype.getDirectedEdgeCount=function(t,e,n){for(var i=0,o=this.getEdgeCount(t),s=0;s<o;s++){var l=this.getEdgeAt(t,s);l!=n&&this.getTerminal(l,e)==t&&i++}return i},mxGraphModel.prototype.getConnections=function(t){return this.getEdges(t,!0,!0,!1)},mxGraphModel.prototype.getIncomingEdges=function(t){return this.getEdges(t,!0,!1,!1)},mxGraphModel.prototype.getOutgoingEdges=function(t){return this.getEdges(t,!1,!0,!1)},mxGraphModel.prototype.getEdges=function(t,e,n,i){e=null==e||e,n=null==n||n,i=null==i||i;for(var o=this.getEdgeCount(t),s=[],l=0;l<o;l++){var r=this.getEdgeAt(t,l),a=this.getTerminal(r,!0),h=this.getTerminal(r,!1);(i&&a==h||a!=h&&(e&&h==t||n&&a==t))&&s.push(r)}return s},mxGraphModel.prototype.getEdgesBetween=function(t,e,n){n=null!=n&&n;var i=this.getEdgeCount(t),o=this.getEdgeCount(e),s=t,l=i;o<i&&(l=o,s=e);for(var r=[],a=0;a<l;a++){var h=this.getEdgeAt(s,a),d=this.getTerminal(h,!0),u=this.getTerminal(h,!1);(d==t&&u==e||!n&&(u==t&&d==e))&&r.push(h)}return r},mxGraphModel.prototype.getOpposites=function(t,e,n,i){n=null==n||n,i=null==i||i;var o=[];if(null!=t)for(var s=0;s<t.length;s++){var l=this.getTerminal(t[s],!0),r=this.getTerminal(t[s],!1);l==e&&null!=r&&r!=e&&i?o.push(r):r==e&&null!=l&&l!=e&&n&&o.push(l)}return o},mxGraphModel.prototype.getTopmostCells=function(t){for(var e=new mxDictionary,n=[],i=0;i<t.length;i++)e.put(t[i],!0);for(i=0;i<t.length;i++){for(var o=t[i],s=!0,l=this.getParent(o);null!=l;){if(e.get(l)){s=!1;break}l=this.getParent(l)}s&&n.push(o)}return n},mxGraphModel.prototype.isVertex=function(t){return null!=t&&t.isVertex()},mxGraphModel.prototype.isEdge=function(t){return null!=t&&t.isEdge()},mxGraphModel.prototype.isConnectable=function(t){return null!=t&&t.isConnectable()},mxGraphModel.prototype.getValue=function(t){return null!=t?t.getValue():null},mxGraphModel.prototype.setValue=function(t,e){return this.execute(new mxValueChange(this,t,e)),e},mxGraphModel.prototype.valueForCellChanged=function(t,e){return t.valueChanged(e)},mxGraphModel.prototype.getGeometry=function(t){return null!=t?t.getGeometry():null},mxGraphModel.prototype.setGeometry=function(t,e){return e!=this.getGeometry(t)&&this.execute(new mxGeometryChange(this,t,e)),e},mxGraphModel.prototype.geometryForCellChanged=function(t,e){var n=this.getGeometry(t);return t.setGeometry(e),n},mxGraphModel.prototype.getStyle=function(t){return null!=t?t.getStyle():null},mxGraphModel.prototype.setStyle=function(t,e){return e!=this.getStyle(t)&&this.execute(new mxStyleChange(this,t,e)),e},mxGraphModel.prototype.setNodeType=function(t,e){return e!=t.nodeType&&this.execute(new mxNodeTypeChange(this,t,e)),e},mxGraphModel.prototype.styleForCellChanged=function(t,e){var n=this.getStyle(t);return t.setStyle(e),n},mxGraphModel.prototype.nodeTypeForCellChanged=function(t,e){var n=t.nodeType;return t.nodeType=e,n},mxGraphModel.prototype.isCollapsed=function(t){return null!=t&&t.isCollapsed()},mxGraphModel.prototype.setCollapsed=function(t,e){return e!=this.isCollapsed(t)&&this.execute(new mxCollapseChange(this,t,e)),e},mxGraphModel.prototype.collapsedStateForCellChanged=function(t,e){var n=this.isCollapsed(t);return t.setCollapsed(e),n},mxGraphModel.prototype.isVisible=function(t){return null!=t&&t.isVisible()},mxGraphModel.prototype.setVisible=function(t,e){return e!=this.isVisible(t)&&this.execute(new mxVisibleChange(this,t,e)),e},mxGraphModel.prototype.visibleStateForCellChanged=function(t,e){var n=this.isVisible(t);return t.setVisible(e),n},mxGraphModel.prototype.execute=function(t){t.execute(),this.beginUpdate(),this.currentEdit.add(t),this.fireEvent(new mxEventObject(mxEvent.EXECUTE,"change",t)),this.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",t)),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(){if(this.updateLevel--,0==this.updateLevel&&this.fireEvent(new mxEventObject(mxEvent.END_EDIT)),!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 t=this.currentEdit;this.currentEdit=this.createUndoableEdit(),t.notify(),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t))}}finally{this.endingUpdate=!1}}},mxGraphModel.prototype.createUndoableEdit=function(t){var e=new mxUndoableEdit(this,null==t||t);return e.notify=function(){e.source.fireEvent(new mxEventObject(mxEvent.CHANGE,"edit",e,"changes",e.changes)),e.source.fireEvent(new mxEventObject(mxEvent.NOTIFY,"edit",e,"changes",e.changes))},e},mxGraphModel.prototype.mergeChildren=function(t,e,n){n=null==n||n,this.beginUpdate();try{var i=new Object;for(var o in this.mergeChildrenImpl(t,e,n,i),i){var s=i[o],l=this.getTerminal(s,!0);null!=l&&(l=i[mxCellPath.create(l)],this.setTerminal(s,l,!0)),null!=(l=this.getTerminal(s,!1))&&(l=i[mxCellPath.create(l)],this.setTerminal(s,l,!1))}}finally{this.endUpdate()}},mxGraphModel.prototype.mergeChildrenImpl=function(t,e,n,i){this.beginUpdate();try{for(var o=t.getChildCount(),s=0;s<o;s++){var l=t.getChildAt(s);if("function"==typeof l.getId){var r=l.getId(),a=null==r||this.isEdge(l)&&n?null:this.getCell(r);if(null==a){var h=l.clone();h.setId(r),h.setTerminal(l.getTerminal(!0),!0),h.setTerminal(l.getTerminal(!1),!1),a=e.insert(h),this.cellAdded(a)}i[mxCellPath.create(l)]=a,this.mergeChildrenImpl(l,a,n,i)}}}finally{this.endUpdate()}},mxGraphModel.prototype.getParents=function(t){var e=[];if(null!=t)for(var n=new mxDictionary,i=0;i<t.length;i++){var o=this.getParent(t[i]);null==o||n.get(o)||(n.put(o,!0),e.push(o))}return e},mxGraphModel.prototype.cloneCell=function(t){return null!=t?this.cloneCells([t],!0)[0]:null},mxGraphModel.prototype.cloneCells=function(t,e,n){n=null!=n?n:new Object;for(var i=[],o=0;o<t.length;o++)null!=t[o]?i.push(this.cloneCellImpl(t[o],n,e)):i.push(null);for(o=0;o<i.length;o++)null!=i[o]&&this.restoreClone(i[o],t[o],n);return i},mxGraphModel.prototype.cloneCellImpl=function(t,e,n){var i=this.cellCloned(t);if(e[mxObjectIdentity.get(t)]=i,n)for(var o=this.getChildCount(t),s=0;s<o;s++){var l=this.cloneCellImpl(this.getChildAt(t,s),e,!0);i.insert(l)}return i},mxGraphModel.prototype.cellCloned=function(t){return t.clone()},mxGraphModel.prototype.restoreClone=function(t,e,n){var i=this.getTerminal(e,!0);null!=i&&null!=(o=n[mxObjectIdentity.get(i)])&&o.insertEdge(t,!0);var o,s=this.getTerminal(e,!1);null!=s&&null!=(o=n[mxObjectIdentity.get(s)])&&o.insertEdge(t,!1);for(var l=this.getChildCount(t),r=0;r<l;r++)this.restoreClone(this.getChildAt(t,r),this.getChildAt(e,r),n)},mxRootChange.prototype.execute=function(){this.root=this.previous,this.previous=this.model.rootChanged(this.previous)},mxChildChange.prototype.execute=function(){if(null!=this.child){var t=this.model.getParent(this.child),e=null!=t?t.getIndex(this.child):0;null==this.previous&&this.connect(this.child,!1),t=this.model.parentForCellChanged(this.child,this.previous,this.previousIndex),null!=this.previous&&this.connect(this.child,!0),this.parent=this.previous,this.previous=t,this.index=this.previousIndex,this.previousIndex=e}},mxChildChange.prototype.connect=function(t,e){e=null==e||e;var n=t.getTerminal(!0),i=t.getTerminal(!1);null!=n&&(e?this.model.terminalForCellChanged(t,n,!0):this.model.terminalForCellChanged(t,null,!0)),null!=i&&(e?this.model.terminalForCellChanged(t,i,!1):this.model.terminalForCellChanged(t,null,!1)),t.setTerminal(n,!0),t.setTerminal(i,!1);for(var o=this.model.getChildCount(t),s=0;s<o;s++)this.connect(this.model.getChildAt(t,s),e)},mxTerminalChange.prototype.execute=function(){null!=this.cell&&(this.terminal=this.previous,this.previous=this.model.terminalForCellChanged(this.cell,this.previous,this.source))},mxValueChange.prototype.execute=function(){null!=this.cell&&(this.value=this.previous,this.previous=this.model.valueForCellChanged(this.cell,this.previous))},mxStyleChange.prototype.execute=function(){null!=this.cell&&(this.style=this.previous,this.previous=this.model.styleForCellChanged(this.cell,this.previous))},mxNodeTypeChange.prototype.execute=function(){null!=this.cell&&(this.nodeType=this.previous,this.previous=this.model.nodeTypeForCellChanged(this.cell,this.previous))},mxGeometryChange.prototype.execute=function(){null!=this.cell&&(this.geometry=this.previous,this.previous=this.model.geometryForCellChanged(this.cell,this.previous))},mxCollapseChange.prototype.execute=function(){null!=this.cell&&(this.collapsed=this.previous,this.previous=this.model.collapsedStateForCellChanged(this.cell,this.previous))},mxVisibleChange.prototype.execute=function(){null!=this.cell&&(this.visible=this.previous,this.previous=this.model.visibleStateForCellChanged(this.cell,this.previous))},mxCellAttributeChange.prototype.execute=function(){if(null!=this.cell){var t=this.cell.getAttribute(this.attribute);null==this.previous?this.cell.value.removeAttribute(this.attribute):this.cell.setAttribute(this.attribute,this.previous),this.previous=t}},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"],mxCell.prototype.getId=function(){return this.id},mxCell.prototype.setId=function(t){this.id=t},mxCell.prototype.getValue=function(){return this.value},mxCell.prototype.setValue=function(t){t&&-1<t.indexOf("base64")&&(t=Base64.decode(t.split("_")[1])),this.value=t},mxCell.prototype.valueChanged=function(t){t=(t=t.replace(/&nbsp;/g,"")).replace(/<br>/g,"");var e=this.getValue(),n=!1,i=!1;if(!this.isGroupArea&&!this.isHelpfulText)for(var o=workflowUi.editor.graph,s=o.view.scale,l=o.minimumGraphSize.x||0,r=o.minimumGraphSize.y||0,a=o.minimumGraphSize.width*s||1e5,h=o.minimumGraphSize.height*s||1e5,d=o.getAllCells(l,r,a,h),u=0;u<d.length;++u)if(this.edge&&d[u].edge&&d[u].id!=this.id){if(t==d[u].value){i=!0;break}}else if(!this.edge&&!d[u].edge&&d[u].id!=this.id&&t==d[u].value&&d[u].id!=this.id){n=!0;break}return i=!1,""!=t.trim()?n||i?(wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:n?wfGetLabel(390395,"节点名称不能重复!"):wfGetLabel(390400,"出口名称不能重复!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}}),this.setValue(e)):t!=e&&this.setValue(t):(wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:this.isGroupArea?wfGetLabel(390396,"分组名称不能为空!"):this.isHelpfulText?wfGetLabel(390397,"文本说明文字不能为空!"):this.edge?wfGetLabel(390398,"出口名称不能为空!"):wfGetLabel(390399,"节点名称不能为空!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}}),this.setValue(e)),e},mxCell.prototype.getGeometry=function(){return this.geometry},mxCell.prototype.setGeometry=function(t){this.geometry=t},mxCell.prototype.getStyle=function(){return this.style},mxCell.prototype.setStyle=function(t){this.style=t},mxCell.prototype.isVertex=function(){return 0!=this.vertex},mxCell.prototype.setVertex=function(t){this.vertex=t},mxCell.prototype.isEdge=function(){return 0!=this.edge},mxCell.prototype.setEdge=function(t){this.edge=t},mxCell.prototype.isConnectable=function(){return 0!=this.connectable},mxCell.prototype.setConnectable=function(t){this.connectable=t},mxCell.prototype.isVisible=function(){return 0!=this.visible},mxCell.prototype.setVisible=function(t){this.visible=t},mxCell.prototype.isCollapsed=function(){return 0!=this.collapsed},mxCell.prototype.setCollapsed=function(t){this.collapsed=t},mxCell.prototype.getParent=function(){return this.parent},mxCell.prototype.setParent=function(t){this.parent=t},mxCell.prototype.getTerminal=function(t){return t?this.source:this.target},mxCell.prototype.setTerminal=function(t,e){return e?this.source=t:this.target=t,t},mxCell.prototype.getChildCount=function(){return null==this.children?0:this.children.length},mxCell.prototype.getIndex=function(t){return mxUtils.indexOf(this.children,t)},mxCell.prototype.getChildAt=function(t){return null==this.children?null:this.children[t]},mxCell.prototype.insert=function(t,e){return null!=t&&(null==e&&(e=this.getChildCount(),t.getParent()==this&&e--),t.removeFromParent(),t.setParent(this),null==this.children?(this.children=[],this.children.push(t)):this.children.splice(e,0,t)),t},mxCell.prototype.remove=function(t){var e=null;return null!=this.children&&0<=t&&null!=(e=this.getChildAt(t))&&(this.children.splice(t,1),e.setParent(null)),e},mxCell.prototype.removeFromParent=function(){if(null!=this.parent){var t=this.parent.getIndex(this);this.parent.remove(t)}},mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(t){return mxUtils.indexOf(this.edges,t)},mxCell.prototype.getEdgeAt=function(t){return null==this.edges?null:this.edges[t]},mxCell.prototype.insertEdge=function(t,e){return null!=t&&(t.removeFromTerminal(e),t.setTerminal(this,e),(null==this.edges||t.getTerminal(!e)!=this||mxUtils.indexOf(this.edges,t)<0)&&(null==this.edges&&(this.edges=[]),this.edges.push(t))),t},mxCell.prototype.removeEdge=function(t,e){if(null!=t){if(t.getTerminal(!e)!=this&&null!=this.edges){var n=this.getEdgeIndex(t);0<=n&&this.edges.splice(n,1)}t.setTerminal(null,e)}return t},mxCell.prototype.removeFromTerminal=function(t){var e=this.getTerminal(t);null!=e&&e.removeEdge(this,t)},mxCell.prototype.hasAttribute=function(t){var e=this.getValue();return null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.hasAttribute?e.hasAttribute(t):null!=e.getAttribute(t)},mxCell.prototype.getAttribute=function(t,e){var n=this.getValue();return(null!=n&&n.nodeType==mxConstants.NODETYPE_ELEMENT?n.getAttribute(t):null)||e},mxCell.prototype.setAttribute=function(t,e){var n=this.getValue();null!=n&&n.nodeType==mxConstants.NODETYPE_ELEMENT&&n.setAttribute(t,e)},mxCell.prototype.clone=function(){var t=mxUtils.clone(this,this.mxTransient);return t.setValue(this.cloneValue()),t},mxCell.prototype.cloneValue=function(){var t=this.getValue();return null!=t&&("function"==typeof t.clone?t=t.clone():isNaN(t.nodeType)||(t=t.cloneNode(!0))),t},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 t=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=t}},mxGeometry.prototype.getTerminalPoint=function(t){return t?this.sourcePoint:this.targetPoint},mxGeometry.prototype.setTerminalPoint=function(t,e){return e?this.sourcePoint=t:this.targetPoint=t,t},mxGeometry.prototype.rotate=function(t,e){var n=mxUtils.toRadians(t),i=Math.cos(n),o=Math.sin(n);if(!this.relative){var s=new mxPoint(this.getCenterX(),this.getCenterY()),l=mxUtils.getRotatedPoint(s,i,o,e);this.x=Math.round(l.x-this.width/2),this.y=Math.round(l.y-this.height/2)}if(null!=this.sourcePoint){l=mxUtils.getRotatedPoint(this.sourcePoint,i,o,e);this.sourcePoint.x=Math.round(l.x),this.sourcePoint.y=Math.round(l.y)}if(null!=this.targetPoint){l=mxUtils.getRotatedPoint(this.targetPoint,i,o,e);this.targetPoint.x=Math.round(l.x),this.targetPoint.y=Math.round(l.y)}if(null!=this.points)for(var r=0;r<this.points.length;r++)if(null!=this.points[r]){l=mxUtils.getRotatedPoint(this.points[r],i,o,e);this.points[r].x=Math.round(l.x),this.points[r].y=Math.round(l.y)}},mxGeometry.prototype.translate=function(t,e){if(t=parseFloat(t),e=parseFloat(e),this.relative||(this.x=parseFloat(this.x)+t,this.y=parseFloat(this.y)+e),null!=this.sourcePoint&&(this.sourcePoint.x=parseFloat(this.sourcePoint.x)+t,this.sourcePoint.y=parseFloat(this.sourcePoint.y)+e),null!=this.targetPoint&&(this.targetPoint.x=parseFloat(this.targetPoint.x)+t,this.targetPoint.y=parseFloat(this.targetPoint.y)+e),this.TRANSLATE_CONTROL_POINTS&&null!=this.points)for(var n=0;n<this.points.length;n++)null!=this.points[n]&&(this.points[n].x=parseFloat(this.points[n].x)+t,this.points[n].y=parseFloat(this.points[n].y)+e)},mxGeometry.prototype.scale=function(t,e,n){if(t=parseFloat(t),e=parseFloat(e),null!=this.sourcePoint&&(this.sourcePoint.x=parseFloat(this.sourcePoint.x)*t,this.sourcePoint.y=parseFloat(this.sourcePoint.y)*e),null!=this.targetPoint&&(this.targetPoint.x=parseFloat(this.targetPoint.x)*t,this.targetPoint.y=parseFloat(this.targetPoint.y)*e),null!=this.points)for(var i=0;i<this.points.length;i++)null!=this.points[i]&&(this.points[i].x=parseFloat(this.points[i].x)*t,this.points[i].y=parseFloat(this.points[i].y)*e);this.relative||(this.x=parseFloat(this.x)*t,this.y=parseFloat(this.y)*e,n&&(e=t=Math.min(t,e)),this.width=parseFloat(this.width)*t,this.height=parseFloat(this.height)*e)},mxGeometry.prototype.equals=function(t){return mxRectangle.prototype.equals.apply(this,arguments)&&this.relative==t.relative&&(null==this.sourcePoint&&null==t.sourcePoint||null!=this.sourcePoint&&this.sourcePoint.equals(t.sourcePoint))&&(null==this.targetPoint&&null==t.targetPoint||null!=this.targetPoint&&this.targetPoint.equals(t.targetPoint))&&(null==this.points&&null==t.points||null!=this.points&&mxUtils.equalPoints(this.points,t.points))&&(null==this.alternateBounds&&null==t.alternateBounds||null!=this.alternateBounds&&this.alternateBounds.equals(t.alternateBounds))&&(null==this.offset&&null==t.offset||null!=this.offset&&this.offset.equals(t.offset))};var mxCellPath={PATH_SEPARATOR:".",create:function(t){var e="";if(null!=t)for(var n=t.getParent();null!=n;){e=n.getIndex(t)+mxCellPath.PATH_SEPARATOR+e,n=(t=n).getParent()}var i=e.length;return 1<i&&(e=e.substring(0,i-1)),e},getParentPath:function(t){if(null!=t){var e=t.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(0<=e)return t.substring(0,e);if(0<t.length)return""}return null},resolve:function(t,e){var n=t;if(null!=e)for(var i=e.split(mxCellPath.PATH_SEPARATOR),o=0;o<i.length;o++)n=n.getChildAt(parseInt(i[o]));return n},compare:function(t,e){for(var n=Math.min(t.length,e.length),i=0,o=0;o<n;o++)if(t[o]!=e[o]){var s,l;if(0==t[o].length||0==e[o].length)i=t[o]==e[o]?0:t[o]>e[o]?1:-1;else i=(s=parseInt(t[o]))==(l=parseInt(e[o]))?0:l<s?1:-1;break}0==i&&(s=t.length)!=(l=e.length)&&(i=l<s?1:-1);return i}},mxPerimeter={RectanglePerimeter:function(t,e,n,i){var o=t.getCenterX(),s=t.getCenterY(),l=n.x-o,r=n.y-s,a=Math.atan2(r,l),h=new mxPoint(0,0),d=Math.PI,u=Math.PI/2-a,p=Math.atan2(t.height,t.width);return a<-d+p||d-p<a?(h.x=t.x,h.y=s-t.width*Math.tan(a)/2):a<-p?(h.y=t.y,h.x=o-t.height*Math.tan(u)/2):a<p?(h.x=t.x+t.width,h.y=s+t.width*Math.tan(a)/2):(h.y=t.y+t.height,h.x=o+t.height*Math.tan(u)/2),i&&(n.x>=t.x&&n.x<=t.x+t.width?h.x=n.x:n.y>=t.y&&n.y<=t.y+t.height&&(h.y=n.y),n.x<t.x?h.x=t.x:n.x>t.x+t.width&&(h.x=t.x+t.width),n.y<t.y?h.y=t.y:n.y>t.y+t.height&&(h.y=t.y+t.height)),h},EllipsePerimeter:function(t,e,n,i){var o=t.x,s=t.y,l=t.width/2,r=t.height/2,a=o+l,h=s+r,d=n.x,u=n.y,p=parseInt(d-a),m=parseInt(u-h);if(0==p&&0!=m)return new mxPoint(a,h+r*m/Math.abs(m));if(0==p&&0==m)return new mxPoint(d,u);if(i){if(s<=u&&u<=s+t.height){var c=u-h,g=Math.sqrt(l*l*(1-c*c/(r*r)))||0;return d<=o&&(g=-g),new mxPoint(a+g,u)}if(o<=d&&d<=o+t.width){g=d-a,c=Math.sqrt(r*r*(1-g*g/(l*l)))||0;return u<=s&&(c=-c),new mxPoint(d,h+c)}}var x=m/p,y=h-x*a,f=l*l*x*x+r*r,v=-2*a*f,C=l*l*x*x*a*a+r*r*a*a-l*l*r*r,E=Math.sqrt(v*v-4*f*C),w=(-v+E)/(2*f),S=(-v-E)/(2*f),b=x*w+y,T=x*S+y,A=0,L=0;return L=Math.sqrt(Math.pow(w-d,2)+Math.pow(b-u,2))<Math.sqrt(Math.pow(S-d,2)+Math.pow(T-u,2))?(A=w,b):(A=S,T),new mxPoint(A,L)},RhombusPerimeter:function(t,e,n,i){var o=t.x,s=t.y,l=t.width,r=t.height,a=o+l/2,h=s+r/2,d=n.x,u=n.y;if(a==d)return new mxPoint(a,u<h?s:s+r);if(h==u)return new mxPoint(d<a?o:o+l,h);var p=a,m=h;return i&&(o<=d&&d<=o+l?p=d:s<=u&&u<=s+r&&(m=u)),d<a?u<h?mxUtils.intersection(d,u,p,m,a,s,o,h):mxUtils.intersection(d,u,p,m,a,s+r,o,h):u<h?mxUtils.intersection(d,u,p,m,a,s,o+l,h):mxUtils.intersection(d,u,p,m,a,s+r,o+l,h)},TrianglePerimeter:function(t,e,n,i){var o=null!=e?e.style[mxConstants.STYLE_DIRECTION]:null,s=o==mxConstants.DIRECTION_NORTH||o==mxConstants.DIRECTION_SOUTH,l=t.x,r=t.y,a=t.width,h=t.height,d=l+a/2,u=r+h/2,p=new mxPoint(l,r),m=new mxPoint(l+a,u),c=new mxPoint(l,r+h);o==mxConstants.DIRECTION_NORTH?(p=c,m=new mxPoint(d,r),c=new mxPoint(l+a,r+h)):o==mxConstants.DIRECTION_SOUTH?(m=new mxPoint(d,r+h),c=new mxPoint(l+a,r)):o==mxConstants.DIRECTION_WEST&&(p=new mxPoint(l+a,r),m=new mxPoint(l,u),c=new mxPoint(l+a,r+h));var g=n.x-d,x=n.y-u,y=s?Math.atan2(g,x):Math.atan2(x,g),f=s?Math.atan2(a,h):Math.atan2(h,a),v=null;if(o==mxConstants.DIRECTION_NORTH||o==mxConstants.DIRECTION_WEST?-f<y&&y<f:y<-Math.PI+f||y>Math.PI-f)v=i&&(s&&n.x>=p.x&&n.x<=c.x||!s&&n.y>=p.y&&n.y<=c.y)?s?new mxPoint(n.x,p.y):new mxPoint(p.x,n.y):o==mxConstants.DIRECTION_NORTH?new mxPoint(l+a/2+h*Math.tan(y)/2,r+h):o==mxConstants.DIRECTION_SOUTH?new mxPoint(l+a/2-h*Math.tan(y)/2,r):o==mxConstants.DIRECTION_WEST?new mxPoint(l+a,r+h/2+a*Math.tan(y)/2):new mxPoint(l,r+h/2-a*Math.tan(y)/2);else{if(i){var C=new mxPoint(d,u);n.y>=r&&n.y<=r+h?(C.x=s?d:o==mxConstants.DIRECTION_WEST?l+a:l,C.y=n.y):n.x>=l&&n.x<=l+a&&(C.x=n.x,C.y=s?o==mxConstants.DIRECTION_NORTH?r+h:r:u),g=n.x-C.x,x=n.y-C.y,d=C.x,u=C.y}v=s&&n.x<=l+a/2||!s&&n.y<=r+h/2?mxUtils.intersection(n.x,n.y,d,u,p.x,p.y,m.x,m.y):mxUtils.intersection(n.x,n.y,d,u,m.x,m.y,c.x,c.y)}return null==v&&(v=new mxPoint(d,u)),v},HexagonPerimeter:function(t,e,n,i){var o=t.x,s=t.y,l=t.width,r=t.height,a=t.getCenterX(),h=t.getCenterY(),d=n.x,u=n.y,p=d-a,m=u-h,c=-Math.atan2(m,p),g=Math.PI,x=Math.PI/2,y=new mxPoint(a,h),f=null!=e?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST,v=f==mxConstants.DIRECTION_NORTH||f==mxConstants.DIRECTION_SOUTH,C=new mxPoint,E=new mxPoint;if((d<o&&u<s||d<o&&s+r<u||o+l<d&&u<s||o+l<d&&s+r<u)&&(i=!1),i){if(v){if(d==a){if(u<=s)return new mxPoint(a,s);if(s+r<=u)return new mxPoint(a,s+r)}else if(d<o){if(u==s+r/4)return new mxPoint(o,s+r/4);if(u==s+3*r/4)return new mxPoint(o,s+3*r/4)}else if(o+l<d){if(u==s+r/4)return new mxPoint(o+l,s+r/4);if(u==s+3*r/4)return new mxPoint(o+l,s+3*r/4)}else if(d==o){if(u<h)return new mxPoint(o,s+r/4);if(h<u)return new mxPoint(o,s+3*r/4)}else if(d==o+l){if(u<h)return new mxPoint(o+l,s+r/4);if(h<u)return new mxPoint(o+l,s+3*r/4)}if(u==s)return new mxPoint(a,s);if(u==s+r)return new mxPoint(a,s+r);d<a?s+r/4<u&&u<s+3*r/4?(C=new mxPoint(o,s),E=new mxPoint(o,s+r)):u<s+r/4?(C=new mxPoint(o-Math.floor(.5*l),s+Math.floor(.5*r)),E=new mxPoint(o+l,s-Math.floor(.25*r))):s+3*r/4<u&&(C=new mxPoint(o-Math.floor(.5*l),s+Math.floor(.5*r)),E=new mxPoint(o+l,s+Math.floor(1.25*r))):a<d&&(s+r/4<u&&u<s+3*r/4?(C=new mxPoint(o+l,s),E=new mxPoint(o+l,s+r)):u<s+r/4?(C=new mxPoint(o,s-Math.floor(.25*r)),E=new mxPoint(o+Math.floor(1.5*l),s+Math.floor(.5*r))):s+3*r/4<u&&(C=new mxPoint(o+Math.floor(1.5*l),s+Math.floor(.5*r)),E=new mxPoint(o,s+Math.floor(1.25*r))))}else{if(u==h){if(d<=o)return new mxPoint(o,s+r/2);if(o+l<=d)return new mxPoint(o+l,s+r/2)}else if(u<s){if(d==o+l/4)return new mxPoint(o+l/4,s);if(d==o+3*l/4)return new mxPoint(o+3*l/4,s)}else if(s+r<u){if(d==o+l/4)return new mxPoint(o+l/4,s+r);if(d==o+3*l/4)return new mxPoint(o+3*l/4,s+r)}else if(u==s){if(d<a)return new mxPoint(o+l/4,s);if(a<d)return new mxPoint(o+3*l/4,s)}else if(u==s+r){if(d<a)return new mxPoint(o+l/4,s+r);if(h<u)return new mxPoint(o+3*l/4,s+r)}if(d==o)return new mxPoint(o,h);if(d==o+l)return new mxPoint(o+l,h);u<h?o+l/4<d&&d<o+3*l/4?(C=new mxPoint(o,s),E=new mxPoint(o+l,s)):d<o+l/4?(C=new mxPoint(o-Math.floor(.25*l),s+r),E=new mxPoint(o+Math.floor(.5*l),s-Math.floor(.5*r))):o+3*l/4<d&&(C=new mxPoint(o+Math.floor(.5*l),s-Math.floor(.5*r)),E=new mxPoint(o+Math.floor(1.25*l),s+r)):h<u&&(o+l/4<d&&d<o+3*l/4?(C=new mxPoint(o,s+r),E=new mxPoint(o+l,s+r)):d<o+l/4?(C=new mxPoint(o-Math.floor(.25*l),s),E=new mxPoint(o+Math.floor(.5*l),s+Math.floor(1.5*r))):o+3*l/4<d&&(C=new mxPoint(o+Math.floor(.5*l),s+Math.floor(1.5*r)),E=new mxPoint(o+Math.floor(1.25*l),s)))}var w=a,S=h;o<=d&&d<=o+l?(w=d,S=u<h?s+r:s):s<=u&&u<=s+r&&(S=u,w=d<a?o+l:o),y=mxUtils.intersection(w,S,n.x,n.y,C.x,C.y,E.x,E.y)}else{if(v){if(c==(b=Math.atan2(r/4,l/2)))return new mxPoint(o+l,s+Math.floor(.25*r));if(c==x)return new mxPoint(o+Math.floor(.5*l),s);if(c==g-b)return new mxPoint(o,s+Math.floor(.25*r));if(c==-b)return new mxPoint(o+l,s+Math.floor(.75*r));if(c==-x)return new mxPoint(o+Math.floor(.5*l),s+r);if(c==-g+b)return new mxPoint(o,s+Math.floor(.75*r));c<b&&-b<c?(C=new mxPoint(o+l,s),E=new mxPoint(o+l,s+r)):b<c&&c<x?(C=new mxPoint(o,s-Math.floor(.25*r)),E=new mxPoint(o+Math.floor(1.5*l),s+Math.floor(.5*r))):x<c&&c<g-b?(C=new mxPoint(o-Math.floor(.5*l),s+Math.floor(.5*r)),E=new mxPoint(o+l,s-Math.floor(.25*r))):g-b<c&&c<=g||c<-g+b&&-g<=c?(C=new mxPoint(o,s),E=new mxPoint(o,s+r)):c<-b&&-x<c?(C=new mxPoint(o+Math.floor(1.5*l),s+Math.floor(.5*r)),E=new mxPoint(o,s+Math.floor(1.25*r))):c<-x&&-g+b<c&&(C=new mxPoint(o-Math.floor(.5*l),s+Math.floor(.5*r)),E=new mxPoint(o+l,s+Math.floor(1.25*r)))}else{var b;if(c==(b=Math.atan2(r/2,l/4)))return new mxPoint(o+Math.floor(.75*l),s);if(c==g-b)return new mxPoint(o+Math.floor(.25*l),s);if(c==g||c==-g)return new mxPoint(o,s+Math.floor(.5*r));if(0==c)return new mxPoint(o+l,s+Math.floor(.5*r));if(c==-b)return new mxPoint(o+Math.floor(.75*l),s+r);if(c==-g+b)return new mxPoint(o+Math.floor(.25*l),s+r);0<c&&c<b?(C=new mxPoint(o+Math.floor(.5*l),s-Math.floor(.5*r)),E=new mxPoint(o+Math.floor(1.25*l),s+r)):b<c&&c<g-b?(C=new mxPoint(o,s),E=new mxPoint(o+l,s)):g-b<c&&c<g?(C=new mxPoint(o-Math.floor(.25*l),s+r),E=new mxPoint(o+Math.floor(.5*l),s-Math.floor(.5*r))):c<0&&-b<c?(C=new mxPoint(o+Math.floor(.5*l),s+Math.floor(1.5*r)),E=new mxPoint(o+Math.floor(1.25*l),s)):c<-b&&-g+b<c?(C=new mxPoint(o,s+r),E=new mxPoint(o+l,s+r)):c<-g+b&&-g<c&&(C=new mxPoint(o-Math.floor(.25*l),s),E=new mxPoint(o+Math.floor(.5*l),s+Math.floor(1.5*r)))}y=mxUtils.intersection(a,h,n.x,n.y,C.x,C.y,E.x,E.y)}return null==y?new mxPoint(a,h):y}};function mxPrintPreview(t,e,n,i,o,s,l,r,a){this.graph=t,this.scale=null!=e?e:1/t.pageScale,this.border=null!=i?i:0,this.pageFormat=mxRectangle.fromRectangle(null!=n?n:t.pageFormat),this.title=null!=r?r:"Printer-friendly version",this.x0=null!=o?o:0,this.y0=null!=s?s:0,this.borderColor=l,this.pageSelector=null==a||a}function mxStylesheet(){this.styles=new Object,this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}function mxCellState(t,e,n){this.view=t,this.cell=e,this.style=n,this.origin=new mxPoint,this.absoluteOffset=new mxPoint}function mxGraphSelectionModel(t){this.graph=t,this.cells=[]}function mxSelectionChange(t,e,n){this.selectionModel=t,this.added=null!=e?e.slice():null,this.removed=null!=n?n.slice():null}function mxCellEditor(t){this.graph=t,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(t){null!=this.editingCell&&null==this.graph.getView().getState(this.editingCell)&&this.stopEditing(!0)}),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)}function mxCellRenderer(){}mxPrintPreview.prototype.graph=null,mxPrintPreview.prototype.pageFormat=null,mxPrintPreview.prototype.scale=null,mxPrintPreview.prototype.border=0,mxPrintPreview.prototype.marginTop=0,mxPrintPreview.prototype.marginBottom=0,mxPrintPreview.prototype.x0=0,mxPrintPreview.prototype.y0=0,mxPrintPreview.prototype.autoOrigin=!0,mxPrintPreview.prototype.printOverlays=!1,mxPrintPreview.prototype.printControls=!1,mxPrintPreview.prototype.printBackgroundImage=!1,mxPrintPreview.prototype.backgroundColor="#ffffff",mxPrintPreview.prototype.borderColor=null,mxPrintPreview.prototype.title=null,mxPrintPreview.prototype.pageSelector=null,mxPrintPreview.prototype.wnd=null,mxPrintPreview.prototype.targetWindow=null,mxPrintPreview.prototype.pageCount=0,mxPrintPreview.prototype.clipping=!0,mxPrintPreview.prototype.getWindow=function(){return this.wnd},mxPrintPreview.prototype.getDoctype=function(){var t="";return 5==document.documentMode?t='<meta http-equiv="X-UA-Compatible" content="IE=5">':8==document.documentMode?t='<meta http-equiv="X-UA-Compatible" content="IE=8">':8<document.documentMode&&(t='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]--\x3e'),t},mxPrintPreview.prototype.appendGraph=function(t,e,n,i,o,s){this.graph=t,this.scale=null!=e?e:1/t.pageScale,this.x0=n,this.y0=i,this.open(null,null,o,s)},mxPrintPreview.prototype.open=function(t,e,n,i){var o=this.graph.cellRenderer.initializeOverlay,s=null;try{this.printOverlays&&(this.graph.cellRenderer.initializeOverlay=function(t,e){e.init(t.view.getDrawPane())}),this.printControls&&(this.graph.cellRenderer.initControl=function(t,e,n,i){e.dialect=t.view.graph.dialect,e.init(t.view.getDrawPane())}),this.wnd=null!=e?e:this.wnd;var l=!1;null==this.wnd&&(l=!0,this.wnd=window.open());var r=this.wnd.document;if(l){var a=this.getDoctype();null!=a&&0<a.length&&r.writeln(a),mxClient.IS_VML?r.writeln('<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">'):("CSS1Compat"===document.compatMode&&r.writeln("<!DOCTYPE html>"),r.writeln("<html>")),r.writeln("<head>"),this.writeHead(r,t),r.writeln("</head>"),r.writeln('<body class="mxPage">')}var h=this.graph.getGraphBounds().clone(),d=this.graph.getView().getScale(),u=d/this.scale,p=this.graph.getView().getTranslate();this.autoOrigin||(this.x0-=p.x*this.scale,this.y0-=p.y*this.scale,h.width+=h.x,h.height+=h.y,h.x=0,h.y=0,this.border=0);var m=this.pageFormat.width-2*this.border,c=this.pageFormat.height-2*this.border;this.pageFormat.height+=this.marginTop+this.marginBottom,h.width/=u,h.height/=u;var g=Math.max(1,Math.ceil((h.width+this.x0)/m)),x=Math.max(1,Math.ceil((h.height+this.y0)/c));this.pageCount=g*x;var y=mxUtils.bind(this,function(){if(this.pageSelector&&(1<x||1<g)){var t=this.createPageSelector(x,g);if(r.body.appendChild(t),mxClient.IS_IE&&null==r.documentMode||5==r.documentMode||8==r.documentMode||7==r.documentMode){t.style.position="absolute";function e(){t.style.top=(r.body.scrollTop||r.documentElement.scrollTop)+10+"px"}mxEvent.addListener(this.wnd,"scroll",function(t){e()}),mxEvent.addListener(this.wnd,"resize",function(t){e()})}}}),f=mxUtils.bind(this,function(t,e){null!=this.borderColor&&(t.style.borderColor=this.borderColor,t.style.borderStyle="solid",t.style.borderWidth="1px"),t.style.background=this.backgroundColor,(n||e)&&(t.style.pageBreakAfter="always"),l&&(mxClient.IS_IE||11<=document.documentMode||mxClient.IS_EDGE)?(r.writeln(t.outerHTML),t.parentNode.removeChild(t)):(t.parentNode.removeChild(t),r.body.appendChild(t)),(n||e)&&this.addPageBreak(r)}),v=this.getCoverPages(this.pageFormat.width,this.pageFormat.height);if(null!=v)for(var C=0;C<v.length;C++)f(v[C],!0);var E=this.getAppendices(this.pageFormat.width,this.pageFormat.height);for(C=0;C<x;C++)for(var w=C*c/this.scale-this.y0/this.scale+(h.y-p.y*d)/d,S=0;S<g;S++){if(null==this.wnd)return null;var b=S*m/this.scale-this.x0/this.scale+(h.x-p.x*d)/d,T=C*g+S+1,A=new mxRectangle(b,w,m,c);(s=this.renderPage(this.pageFormat.width,this.pageFormat.height,0,0,mxUtils.bind(this,function(t){this.addGraphFragment(-b,-w,this.scale,T,t,A),this.printBackgroundImage&&this.insertBackgroundImage(t,-b,-w)}),T)).setAttribute("id","mxPage-"+T),f(s,null!=E||C<x-1||S<g-1)}if(null!=E)for(C=0;C<E.length;C++)f(E[C],C<E.length-1);l&&!i&&(this.closeDocument(),y()),this.wnd.focus()}catch(t){null!=s&&null!=s.parentNode&&s.parentNode.removeChild(s)}finally{this.graph.cellRenderer.initializeOverlay=o}return this.wnd},mxPrintPreview.prototype.addPageBreak=function(t){var e=t.createElement("hr");e.className="mxPageBreak",t.body.appendChild(e)},mxPrintPreview.prototype.closeDocument=function(){if(null!=this.wnd&&null!=this.wnd.document){var t=this.wnd.document;this.writePostfix(t),t.writeln("</body>"),t.writeln("</html>"),t.close(),mxEvent.release(t.body)}},mxPrintPreview.prototype.writeHead=function(t,e){null!=this.title&&t.writeln("<title>"+this.title+"</title>"),mxClient.IS_VML&&t.writeln('<style type="text/css">v\\:*{behavior:url(#default#VML)}o\\:*{behavior:url(#default#VML)}</style>'),mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",t),t.writeln('<style type="text/css">'),t.writeln("@media print {"),t.writeln("  * { -webkit-print-color-adjust: exact; }"),t.writeln("  table.mxPageSelector { display: none; }"),t.writeln("  hr.mxPageBreak { display: none; }"),t.writeln("}"),t.writeln("@media screen {"),t.writeln("  table.mxPageSelector { position: fixed; right: 10px; top: 10px;font-family: Arial; font-size:10pt; border: solid 1px darkgray;background: white; border-collapse:collapse; }"),t.writeln("  table.mxPageSelector td { border: solid 1px gray; padding:4px; }"),t.writeln("  body.mxPage { background: gray; }"),t.writeln("}"),null!=e&&t.writeln(e),t.writeln("</style>")},mxPrintPreview.prototype.writePostfix=function(t){},mxPrintPreview.prototype.createPageSelector=function(t,e){var n=this.wnd.document,i=n.createElement("table");i.className="mxPageSelector",i.setAttribute("border","0");for(var o=n.createElement("tbody"),s=0;s<t;s++){for(var l=n.createElement("tr"),r=0;r<e;r++){var a=s*e+r+1,h=n.createElement("td"),d=n.createElement("a");if(d.setAttribute("href","#mxPage-"+a),mxClient.IS_NS&&!mxClient.IS_SF&&!mxClient.IS_GC){var u="var page = document.getElementById('mxPage-"+a+"');page.scrollIntoView(true);event.preventDefault();";d.setAttribute("onclick",u)}mxUtils.write(d,a,n),h.appendChild(d),l.appendChild(h)}o.appendChild(l)}return i.appendChild(o),i},mxPrintPreview.prototype.renderPage=function(t,e,n,i,o,s){var l=this.wnd.document,r=document.createElement("div"),a=null;try{if(0!=n||0!=i){r.style.position="relative",r.style.width=t+"px",r.style.height=e+"px",r.style.pageBreakInside="avoid",(d=document.createElement("div")).style.position="relative",d.style.top=this.border+"px",d.style.left=this.border+"px",d.style.width=t-2*this.border+"px",d.style.height=e-2*this.border+"px",d.style.overflow="hidden";var h=document.createElement("div");h.style.position="relative",h.style.marginLeft=n+"px",h.style.marginTop=i+"px",8==l.documentMode&&(d.style.position="absolute",h.style.position="absolute"),10==l.documentMode&&(h.style.width="100%",h.style.height="100%"),d.appendChild(h),r.appendChild(d),document.body.appendChild(r),a=h}else{var d;r.style.width=t+"px",r.style.height=e+"px",r.style.overflow="hidden",r.style.pageBreakInside="avoid",8==l.documentMode&&(r.style.position="relative"),(d=document.createElement("div")).style.width=t-2*this.border+"px",d.style.height=e-2*this.border+"px",d.style.overflow="hidden",!mxClient.IS_IE||null!=l.documentMode&&5!=l.documentMode&&8!=l.documentMode&&7!=l.documentMode?(d.style.top=this.border+"px",d.style.left=this.border+"px"):(d.style.marginTop=this.border+"px",d.style.marginLeft=this.border+"px"),this.graph.dialect==mxConstants.DIALECT_VML&&(d.style.position="absolute"),r.appendChild(d),document.body.appendChild(r),a=d}}catch(t){throw r.parentNode.removeChild(r),r=null,t}return o(a),r},mxPrintPreview.prototype.getRoot=function(){var t=this.graph.view.currentRoot;return null==t&&(t=this.graph.getModel().getRoot()),t},mxPrintPreview.prototype.addGraphFragment=function(t,e,n,i,o,s){var l=this.graph.getView(),r=this.graph.container;this.graph.container=o;var a=l.getCanvas(),h=l.getBackgroundPane(),d=l.getDrawPane(),u=l.getOverlayPane();this.graph.dialect==mxConstants.DIALECT_SVG?l.createSvg():this.graph.dialect==mxConstants.DIALECT_VML?l.createVml():l.createHtml();var p=l.isEventsEnabled();l.setEventsEnabled(!1);var m=this.graph.isEnabled();this.graph.setEnabled(!1);var c=l.getTranslate();l.translate=new mxPoint(t,e);var g=this.graph.cellRenderer.redraw,x=l.states,y=l.scale;if(this.clipping){var f=new mxRectangle((s.x+c.x)*y,(s.y+c.y)*y,s.width*y/n,s.height*y/n);this.graph.cellRenderer.redraw=function(t,e,n){if(null!=t){var i=x.get(t.cell);if(null!=i){var o=l.getBoundingBox(i,!1);if(null!=o&&!mxUtils.intersects(f,o))return}}g.apply(this,arguments)}}var v=null;try{var C=[this.getRoot()];v=new mxTemporaryCellStates(l,n,C,null,mxUtils.bind(this,function(t){return this.getLinkForCellState(t)}))}finally{if(mxClient.IS_IE)l.overlayPane.innerHTML="",l.canvas.style.overflow="hidden",l.canvas.style.position="relative",l.canvas.style.top=this.marginTop+"px",l.canvas.style.width=s.width+"px",l.canvas.style.height=s.height+"px";else for(var E=o.firstChild;null!=E;){var w=E.nextSibling,S=E.nodeName.toLowerCase();"svg"==S?(E.style.overflow="hidden",E.style.position="relative",E.style.top=this.marginTop+"px",E.setAttribute("width",s.width),E.setAttribute("height",s.height),E.style.width="",E.style.height=""):"default"!=E.style.cursor&&"div"!=S&&E.parentNode.removeChild(E),E=w}if(this.printBackgroundImage){var b=o.getElementsByTagName("svg");0<b.length&&(b[0].style.position="absolute")}l.overlayPane.parentNode.removeChild(l.overlayPane),this.graph.setEnabled(m),this.graph.container=r,this.graph.cellRenderer.redraw=g,l.canvas=a,l.backgroundPane=h,l.drawPane=d,l.overlayPane=u,l.translate=c,v.destroy(),l.setEventsEnabled(p)}},mxPrintPreview.prototype.getLinkForCellState=function(t){return this.graph.getLinkForCell(t.cell)},mxPrintPreview.prototype.insertBackgroundImage=function(t,e,n){var i=this.graph.backgroundImage;if(null!=i){var o=document.createElement("img");o.style.position="absolute",o.style.marginLeft=Math.round(e*this.scale)+"px",o.style.marginTop=Math.round(n*this.scale)+"px",o.setAttribute("width",Math.round(this.scale*i.width)),o.setAttribute("height",Math.round(this.scale*i.height)),o.src=i.src,t.insertBefore(o,t.firstChild)}},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(t){var e=this.open(t);null!=e&&e.print()},mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)},mxStylesheet.prototype.styles,mxStylesheet.prototype.createDefaultVertexStyle=function(){var t=new Object;return t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE,t[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_FILLCOLOR]="#C3D9FF",t[mxConstants.STYLE_STROKECOLOR]="#6482B9",t[mxConstants.STYLE_FONTCOLOR]="#774400",t},mxStylesheet.prototype.createDefaultEdgeStyle=function(){var t=new Object;return t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR,t[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_STROKECOLOR]="#6482B9",t[mxConstants.STYLE_FONTCOLOR]="#446299",t},mxStylesheet.prototype.putDefaultVertexStyle=function(t){this.putCellStyle("defaultVertex",t)},mxStylesheet.prototype.putDefaultEdgeStyle=function(t){this.putCellStyle("defaultEdge",t)},mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex},mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge},mxStylesheet.prototype.putCellStyle=function(t,e){this.styles[t]=e},mxStylesheet.prototype.getCellStyle=function(t,e){var n=e;if(null!=t&&0<t.length){var i=t.split(";");n=null!=n&&";"!=t.charAt(0)?mxUtils.clone(n):new Object;for(var o=0;o<i.length;o++){var s=i[o],l=s.indexOf("=");if(0<=l){var r=s.substring(0,l),a=s.substring(l+1);a==mxConstants.NONE?delete n[r]:mxUtils.isNumeric(a)?n[r]=parseFloat(a):n[r]=a}else{var h=this.styles[s];if(null!=h)for(var r in h)n[r]=h[r]}}}return n},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(t,e){if(t=t||0,e=null!=e?e:new mxRectangle(this.x,this.y,this.width,this.height),null!=this.shape&&null!=this.shape.stencil&&"fixed"==this.shape.stencil.aspect){var n=this.shape.stencil.computeAspect(this.style,e.x,e.y,e.width,e.height);e.x=n.x,e.y=n.y,e.width=this.shape.stencil.w0*n.width,e.height=this.shape.stencil.h0*n.height}return 0!=t&&e.grow(t),e},mxCellState.prototype.setAbsoluteTerminalPoint=function(t,e){e?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(t):this.absolutePoints[0]=t):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(t)):1==this.absolutePoints.length?this.absolutePoints.push(t):this.absolutePoints[this.absolutePoints.length-1]=t},mxCellState.prototype.setCursor=function(t){null!=this.shape&&this.shape.setCursor(t),null!=this.text&&this.text.setCursor(t)},mxCellState.prototype.getVisibleTerminal=function(t){var e=this.getVisibleTerminalState(t);return null!=e?e.cell:null},mxCellState.prototype.getVisibleTerminalState=function(t){return t?this.visibleSourceState:this.visibleTargetState},mxCellState.prototype.setVisibleTerminalState=function(t,e){e?this.visibleSourceState=t:this.visibleTargetState=t},mxCellState.prototype.getCellBounds=function(){return this.cellBounds},mxCellState.prototype.getPaintBounds=function(){return this.paintBounds},mxCellState.prototype.updateCachedBounds=function(){var t=this.view.translate,e=this.view.scale;this.cellBounds=new mxRectangle(this.x/e-t.x,this.y/e-t.y,this.width/e,this.height/e),this.paintBounds=mxRectangle.fromRectangle(this.cellBounds),null!=this.shape&&this.shape.isPaintBoundsInverted()&&this.paintBounds.rotate90()},mxCellState.prototype.setState=function(t){this.view=t.view,this.cell=t.cell,this.style=t.style,this.absolutePoints=t.absolutePoints,this.origin=t.origin,this.absoluteOffset=t.absoluteOffset,this.boundingBox=t.boundingBox,this.terminalDistance=t.terminalDistance,this.segments=t.segments,this.length=t.length,this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.unscaledWidth=t.unscaledWidth},mxCellState.prototype.clone=function(){var t=new mxCellState(this.view,this.cell,this.style);if(null!=this.absolutePoints){t.absolutePoints=[];for(var e=0;e<this.absolutePoints.length;e++)t.absolutePoints[e]=this.absolutePoints[e].clone()}return null!=this.origin&&(t.origin=this.origin.clone()),null!=this.absoluteOffset&&(t.absoluteOffset=this.absoluteOffset.clone()),null!=this.boundingBox&&(t.boundingBox=this.boundingBox.clone()),t.terminalDistance=this.terminalDistance,t.segments=this.segments,t.length=this.length,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.unscaledWidth=this.unscaledWidth,t},mxCellState.prototype.destroy=function(){this.view.graph.cellRenderer.destroy(this)},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(t){this.singleSelection=t},mxGraphSelectionModel.prototype.isSelected=function(t){return null!=t&&0<=mxUtils.indexOf(this.cells,t)},mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(t){null!=t&&this.setCells([t])},mxGraphSelectionModel.prototype.setCells=function(t){if(null!=t){this.singleSelection&&(t=[this.getFirstSelectableCell(t)]);for(var e=[],n=0;n<t.length;n++)this.graph.isCellSelectable(t[n])&&e.push(t[n]);this.changeSelection(e,this.cells)}},mxGraphSelectionModel.prototype.getFirstSelectableCell=function(t){if(null!=t)for(var e=0;e<t.length;e++)if(this.graph.isCellSelectable(t[e]))return t[e];return null},mxGraphSelectionModel.prototype.addCell=function(t){null!=t&&this.addCells([t])},mxGraphSelectionModel.prototype.addCells=function(t){if(null!=t){var e=null;this.singleSelection&&(e=this.cells,t=[this.getFirstSelectableCell(t)]);for(var n=[],i=0;i<t.length;i++)!this.isSelected(t[i])&&this.graph.isCellSelectable(t[i])&&n.push(t[i]);this.changeSelection(n,e)}},mxGraphSelectionModel.prototype.removeCell=function(t){null!=t&&this.removeCells([t])},mxGraphSelectionModel.prototype.removeCells=function(t){this.graph.model.cells;if(null!=t){for(var e=[],n=0;n<t.length;n++)this.isSelected(t[n])&&e.push(t[n]);this.changeSelection(null,e)}},mxGraphSelectionModel.prototype.changeSelection=function(t,e){if(null!=t&&0<t.length&&null!=t[0]||null!=e&&0<e.length&&null!=e[0]){var n=new mxSelectionChange(this,t,e);n.execute();var i=new mxUndoableEdit(this,!1);i.add(n),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",i))}},mxGraphSelectionModel.prototype.cellAdded=function(t){null==t||this.isSelected(t)||this.cells.push(t)},mxGraphSelectionModel.prototype.cellRemoved=function(t){if(null!=t){var e=mxUtils.indexOf(this.cells,t);0<=e&&this.cells.splice(e,1)}},mxSelectionChange.prototype.execute=function(){var t=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,null!=this.removed)for(var e=0;e<this.removed.length;e++)this.selectionModel.cellRemoved(this.removed[e]);if(null!=this.added)for(e=0;e<this.added.length;e++)this.selectionModel.cellAdded(this.added[e]);var n=this.added;this.added=this.removed,this.removed=n,window.status=mxResources.get(this.selectionModel.doneResource)||this.selectionModel.doneResource,mxLog.leave("mxSelectionChange.execute",t),this.selectionModel.fireEvent(new mxEventObject(mxEvent.CHANGE,"added",this.added,"removed",this.removed))},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?"<br>":"",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?0:1,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,mxClient.IS_GC&&(this.textarea.style.minHeight="1em"),this.textarea.style.position=this.isLegacyEditor()?"absolute":"relative",this.installListeners(this.textarea)},mxCellEditor.prototype.applyValue=function(t,e){this.graph.labelChanged(t.cell,e,this.trigger)},mxCellEditor.prototype.getInitialValue=function(t,e){var n=mxUtils.htmlEntities(this.graph.getEditingValue(t.cell,e),!1);return mxClient.IS_QUIRKS||8==document.documentMode||9==document.documentMode||10==document.documentMode||(n=mxUtils.replaceTrailingNewlines(n,"<div><br></div>")),n.replace(/\n/g,"<br>")},mxCellEditor.prototype.getCurrentValue=function(t){return mxUtils.extractTextWithWhitespace(this.textarea.childNodes)},mxCellEditor.prototype.isCancelEditingKeyEvent=function(t){return this.escapeCancelsEditing||mxEvent.isShiftDown(t)||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)},mxCellEditor.prototype.installListeners=function(e){mxEvent.addListener(e,"blur",mxUtils.bind(this,function(t){this.blurEnabled&&this.focusLost(t)})),mxEvent.addListener(e,"keydown",mxUtils.bind(this,function(t){mxEvent.isConsumed(t)||(this.isStopEditingEvent(t)?(this.graph.stopEditing(!1),mxEvent.consume(t)):27==t.keyCode&&(this.graph.stopEditing(this.isCancelEditingKeyEvent(t)),mxEvent.consume(t)))}));var t=mxUtils.bind(this,function(t){null!=this.editingCell&&this.clearOnChange&&e.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||8!=t.keyCode&&46!=t.keyCode)&&(this.clearOnChange=!1,e.innerHTML="")});mxEvent.addListener(e,"keypress",t),mxEvent.addListener(e,"paste",t);var n=mxUtils.bind(this,function(t){null!=this.editingCell&&(0==this.textarea.innerHTML.length||"<br>"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length):this.clearOnChange=!1)});mxEvent.addListener(e,mxClient.IS_IE11||mxClient.IS_IE?"keyup":"input",n),mxEvent.addListener(e,"cut",n),mxEvent.addListener(e,"paste",n);var i=mxClient.IS_IE11||mxClient.IS_IE?"keydown":"input",o=mxUtils.bind(this,function(t){null!=this.editingCell&&this.autoSize&&!mxEvent.isConsumed(t)&&(null!=this.resizeThread&&window.clearTimeout(this.resizeThread),this.resizeThread=window.setTimeout(mxUtils.bind(this,function(){this.resizeThread=null,this.resize()}),0))});mxEvent.addListener(e,i,o),9<=document.documentMode?(mxEvent.addListener(e,"DOMNodeRemoved",o),mxEvent.addListener(e,"DOMNodeInserted",o)):(mxEvent.addListener(e,"cut",o),mxEvent.addListener(e,"paste",o))},mxCellEditor.prototype.isStopEditingEvent=function(t){return 113==t.keyCode||this.graph.isEnterStopsCellEditing()&&13==t.keyCode&&!mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)},mxCellEditor.prototype.isEventSource=function(t){return mxEvent.getSource(t)==this.textarea},mxCellEditor.prototype.resize=function(){var t=this.graph.getView().getState(this.editingCell);if(null==t)this.stopEditing(!0);else if(null!=this.textarea){var e=this.graph.getModel().isEdge(t.cell),n=this.graph.getView().scale,i=null;if(this.autoSize&&"fill"!=t.style[mxConstants.STYLE_OVERFLOW]){var o=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);if(null==(i=null!=t.text?t.text.margin:null)&&(i=mxUtils.getAlignmentAsPoint(mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE))),e){if(this.bounds=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y,0,0),null!=o){var s=(parseFloat(o)+2)*n;this.bounds.width=s,this.bounds.x+=i.x*s}}else{var l=mxRectangle.fromRectangle(t),r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),a=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(l=null!=t.shape&&r==mxConstants.ALIGN_CENTER&&a==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(l):l,null!=o&&(l.width=parseFloat(o)*n),!t.view.graph.cellRenderer.legacySpacing||"width"!=t.style[mxConstants.STYLE_OVERFLOW]){var h=parseInt(t.style[mxConstants.STYLE_SPACING]||2)*n,d=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*n+h,u=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*n+h,p=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*n+h,m=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*n+h;r=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),a=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);l=new mxRectangle(l.x+m,l.y+d,l.width-(r==mxConstants.ALIGN_CENTER&&null==o?m+u:0),l.height-(a==mxConstants.ALIGN_MIDDLE?d+p:0))}this.bounds=new mxRectangle(l.x+t.absoluteOffset.x,l.y+t.absoluteOffset.y,l.width,l.height)}if(this.graph.isWrapping(t.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";s=Math.round(this.bounds.width/(document.documentMode,n))+this.wordWrapPadding;"relative"!=this.textarea.style.position?(this.textarea.style.width=s+"px",this.textarea.scrollWidth>s&&(this.textarea.style.width=this.textarea.scrollWidth+"px")):this.textarea.style.maxWidth=s+"px"}else this.textarea.style.whiteSpace="nowrap",this.textarea.style.width="";8==document.documentMode&&(this.textarea.style.zoom="1",this.textarea.style.height="auto");var c=this.textarea.scrollWidth,g=this.textarea.scrollHeight;8==document.documentMode?(this.textarea.style.left=Math.max(0,Math.ceil((this.bounds.x-i.x*(this.bounds.width-(c+1)*n)+c*(n-1)*0+2*(i.x+.5))/n))+"px",this.textarea.style.top=Math.max(0,Math.ceil((this.bounds.y-i.y*(this.bounds.height-(g+.5)*n)+g*(n-1)*0+1*Math.abs(i.y+.5))/n))-3+"px",this.textarea.style.width=Math.round(c*n)+"px",this.textarea.style.height=Math.round(g*n)+"px"):mxClient.IS_QUIRKS?(this.textarea.style.left=Math.max(0,Math.ceil(this.bounds.x-i.x*(this.bounds.width-(c+1)*n)+c*(n-1)*0+2*(i.x+.5)))+"px",this.textarea.style.top=Math.max(0,Math.ceil(this.bounds.y-i.y*(this.bounds.height-(g+.5)*n)+g*(n-1)*0+1*Math.abs(i.y+.5)))-3+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-i.x*(this.bounds.width-2))+1)+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-i.y*(this.bounds.height-4)+(-1==i.y?3:0))+1)-3+"px")}else this.bounds=this.getEditorBounds(t),this.textarea.style.width=Math.round(this.bounds.width/n)+"px",this.textarea.style.height=Math.round(this.bounds.height/n)+"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)-3+"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))-3+"px"),this.graph.isWrapping(t.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"!=t.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=Math.round(this.bounds.width/n)+this.wordWrapPadding+"px")):(this.textarea.style.whiteSpace="nowrap","fill"!=t.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=""));mxClient.IS_VML?this.textarea.style.zoom=n:(mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px"),mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+n+","+n+")"+(null==i?"":" translate("+100*i.x+"%,"+100*i.y+"%)")))}},mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())},mxCellEditor.prototype.getBackgroundColor=function(t){return null},mxCellEditor.prototype.isLegacyEditor=function(){if(mxClient.IS_VML)return!0;var t=!1;if(mxClient.IS_SVG){var e=this.graph.view.getDrawPane().ownerSVGElement;null!=e&&(t="absolute"==mxUtils.getCurrentStyle(e).position)}return!t},mxCellEditor.prototype.startEditing=function(n,t){var e,i;this.stopEditing(!0),document.getElementById("workflow-cellEditor")?(e=document.getElementById("workflow-cellEditor")).style.display="block":((e=document.createElement("div")).id="workflow-cellEditor",mxClient.IS_IE&&(e.style.zIndex=3)),null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.hideTooltip();var o=this.graph.getView().getState(n),s=this.graph.model,l=n.geometry.width;n.geometry.height;if(null!=o){n.isEditing=!0,(i=document.getElementById("wf-word-line-"+n.id))&&(i.style.visibility="hidden"),e.style.position=this.isLegacyEditor()?"absolute":"relative";var r=this.graph.getView().scale;this.bounds=this.getEditorBounds(o);var a=-1<n.style.indexOf("rhombus"),h=-1<n.style.indexOf("ellipse"),d=-1<n.style.indexOf("rounded");e.style.width=(0<Math.round(l-32)?Math.round(l-32):100)+"px",d&&(e.style.width=Math.round(l-23)+"px"),o.cell.isGroupArea&&(e.style.width=Math.round(128)+"px"),e.style.height=Math.round(30)+"px",e.style.transform="scale("+r+")",e.style.transformOrigin="left top",e.style.msTransform="scale("+r+")",e.style.msTransformOrigin="left top",8==document.documentMode||mxClient.IS_QUIRKS?(e.style.left=Math.round(this.bounds.x+(11+(a?5:0))*r)+"px",e.style.top=Math.round(this.bounds.y+(+(a?19:0)+4)*r)+"px"):(e.style.left=o.cell.isGroupArea?Math.max(0,Math.round(this.bounds.x+(12+(a?18:0))*r))+"px":Math.max(0,Math.round(this.bounds.x+(12+(a?6:0))*r))+"px",o.cell.isHelpfulText&&(e.style.left=Math.max(0,Math.round(this.bounds.x))+"px"),e.style.top=o.cell.isGroupArea?Math.max(0,Math.round(this.bounds.y+(5+(a?9:0))*r))+"px":Math.max(0,Math.round(this.bounds.y+(5+(a?24:0))*r))+"px",h&&(e.style.top=Math.max(0,Math.round(this.bounds.y+15*r))+"px",e.style.left=Math.max(0,Math.round(this.bounds.x+18*r))+"px")),o.cell.isHelpfulText&&(e.style.left=o.x+"px",e.style.top=o.y+"px",e.style.width=o.width+"px"),this.graph.container.appendChild(e);var u=window.ecCom.WeaInput,p=window.ecCom.WeaTextarea,m=n.isHelpfulText?p:u,c=Math.floor(o.height/20),g=n.isHelpfulText?{value:n.value.replace(/&#10;/g,"\n")||"",maxRows:c,minRows:c,layout:document.getElementById("workflow-cellEditor"),onChange:function(t){},onBlur:function(t){s.beginUpdate();try{s.setValue(n,t)}finally{s.endUpdate()}}}:{viewAttr:3,value:n.value||"",inputType:"multilang",isBase64:!0,layout:document.getElementById("workflow-cellEditor"),customBlur:function(t){if(n.value!==t){s.beginUpdate();try{s.setValue(n,t)}finally{s.endUpdate()}}}};window.setTimeout(function(){ReactDOM.render(React.createElement(m,g),document.getElementById("workflow-cellEditor"),function(){if(jQuery("#workflow-cellEditor input")&&jQuery("#workflow-cellEditor input").focus(),jQuery("#workflow-cellEditor textarea")){var t=jQuery("#workflow-cellEditor textarea").val();jQuery("#workflow-cellEditor textarea").val("").focus().val(t)}jQuery("#workflow-cellEditor input")[0]&&jQuery("#workflow-cellEditor input")[0].addEventListener("blur",function(t){var e=t.target.value;if(n.value!==e){s.beginUpdate();try{s.setValue(n,e)}finally{s.endUpdate()}}})})},0)}},mxCellEditor.prototype.isSelectText=function(){return this.selectText},mxCellEditor.prototype.clearSelection=function(){var t=null;window.getSelection?t=window.getSelection():document.selection&&(t=document.selection),null!=t&&(t.empty?t.empty():t.removeAllRanges&&t.removeAllRanges())},mxCellEditor.prototype.stopEditing=function(t){if(t=t||!1,null!=this.editingCell&&"null"!==this.editingCell){null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null);var e=t?null:this.graph.view.getState(this.editingCell),n=this.initialValue;if(this.initialValue=null,this.editingCell=null,this.trigger=null,this.bounds=null,this.textarea.blur(),this.clearSelection(),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.textarea.innerHTML="",this.clearOnChange=!1),null!=e&&this.textarea.innerHTML!=n){this.prepareTextarea();var i=this.getCurrentValue(e);null!=i&&this.applyValue(e,i)}mxEvent.release(this.textarea),this.textarea=null}},mxCellEditor.prototype.prepareTextarea=function(){mxClient.IS_FF&&null!=this.textarea.lastChild&&"BR"==this.textarea.lastChild.nodeName&&this.textarea.removeChild(this.textarea.lastChild)},mxCellEditor.prototype.isHideLabel=function(t){return!0},mxCellEditor.prototype.getMinimumSize=function(t){var e=this.graph.getView().scale;return new mxRectangle(0,0,null==t.text?30:t.text.size*e+20,"left"==this.textarea.style.textAlign?120:40)},mxCellEditor.prototype.getEditorBounds=function(t){var e=this.graph.getModel().isEdge(t.cell),n=this.graph.getView().scale,i=this.getMinimumSize(t),o=i.width,s=i.height,l=null;if(!e&&t.view.graph.cellRenderer.legacySpacing&&"fill"==t.style[mxConstants.STYLE_OVERFLOW])l=t.shape.getLabelBounds(mxRectangle.fromRectangle(t));else{var r=parseInt(t.style[mxConstants.STYLE_SPACING]||0)*n,a=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*n+r,h=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*n+r,d=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*n+r,u=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*n+r;l=new mxRectangle(t.x,t.y,Math.max(o,t.width-u-h),Math.max(s,t.height-a-d));var p=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),m=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(l=null!=t.shape&&p==mxConstants.ALIGN_CENTER&&m==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(l):l,e?(l.x=t.absoluteOffset.x,l.y=t.absoluteOffset.y,null!=t.text&&null!=t.text.boundingBox&&(0<t.text.boundingBox.x&&(l.x=t.text.boundingBox.x),0<t.text.boundingBox.y&&(l.y=t.text.boundingBox.y))):null!=t.text&&null!=t.text.boundingBox&&(l.x=Math.min(l.x,t.text.boundingBox.x),l.y=Math.min(l.y,t.text.boundingBox.y)),l.x+=u,l.y+=a,null!=t.text&&null!=t.text.boundingBox&&(e?(l.width=Math.max(o,t.text.boundingBox.width),l.height=Math.max(s,t.text.boundingBox.height)):(l.width=Math.max(l.width,t.text.boundingBox.width),l.height=Math.max(l.height,t.text.boundingBox.height))),this.graph.getModel().isVertex(t.cell)){var c=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);c==mxConstants.ALIGN_LEFT?l.x-=t.width:c==mxConstants.ALIGN_RIGHT&&(l.x+=t.width);var g=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);g==mxConstants.ALIGN_TOP?l.y-=t.height:g==mxConstants.ALIGN_BOTTOM&&(l.y+=t.height)}}return new mxRectangle(Math.round(l.x),Math.round(l.y),Math.round(l.width),Math.round(l.height))},mxCellEditor.prototype.getEmptyLabelText=function(t){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)},mxCellRenderer.defaultShapes=new Object,mxCellRenderer.prototype.defaultEdgeShape=mxConnector,mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape,mxCellRenderer.prototype.defaultTextShape=mxText,mxCellRenderer.prototype.legacyControlPosition=!0,mxCellRenderer.prototype.legacySpacing=!0,mxCellRenderer.prototype.antiAlias=!0,mxCellRenderer.prototype.minSvgStrokeWidth=1,mxCellRenderer.prototype.forceControlClickHandler=!1,mxCellRenderer.registerShape=function(t,e){mxCellRenderer.defaultShapes[t]=e},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(t){t.shape.dialect=t.view.graph.dialect,this.configureShape(t),t.shape.init(t.view.getDrawPane())},mxCellRenderer.prototype.createShape=function(t){var e=null;if(null!=t.style){var n=mxStencilRegistry.getStencil(t.style[mxConstants.STYLE_SHAPE]);if(null!=n)e=new mxShape(n);else e=new(this.getShapeConstructor(t))}return e},mxCellRenderer.prototype.createIndicatorShape=function(t){t.shape.indicatorShape=this.getShape(t.view.graph.getIndicatorShape(t))},mxCellRenderer.prototype.getShape=function(t){return null!=t?mxCellRenderer.defaultShapes[t]:null},mxCellRenderer.prototype.getShapeConstructor=function(t){var e=this.getShape(t.style[mxConstants.STYLE_SHAPE]);return null==e&&(e=t.view.graph.getModel().isEdge(t.cell)?this.defaultEdgeShape:this.defaultVertexShape),e},mxCellRenderer.prototype.configureShape=function(t){t.shape.apply(t),t.shape.image=t.view.graph.getImage(t),t.shape.indicatorColor=t.view.graph.getIndicatorColor(t),t.shape.indicatorStrokeColor=t.style[mxConstants.STYLE_INDICATOR_STROKECOLOR],t.shape.indicatorGradientColor=t.view.graph.getIndicatorGradientColor(t),t.shape.indicatorDirection=t.style[mxConstants.STYLE_INDICATOR_DIRECTION],t.shape.indicatorImage=t.view.graph.getIndicatorImage(t),this.postConfigureShape(t)},mxCellRenderer.prototype.postConfigureShape=function(t){null!=t.shape&&(this.resolveColor(t,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(t,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(t,"fill",mxConstants.STYLE_FILLCOLOR),this.resolveColor(t,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(t,"gradient",mxConstants.STYLE_GRADIENTCOLOR))},mxCellRenderer.prototype.checkPlaceholderStyles=function(t){if(null!=t.style)for(var e=["inherit","swimlane","indicated"],n=[mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_GRADIENTCOLOR],i=0;i<n.length;i++)if(0<=mxUtils.indexOf(e,t.style[n[i]]))return!0;return!1},mxCellRenderer.prototype.resolveColor=function(t,e,n){var i=t.shape[e],o=t.view.graph,s=null;if("inherit"==i?s=o.model.getParent(t.cell):"swimlane"==i?(t.shape[e]=n==mxConstants.STYLE_STROKECOLOR?"#000000":"#ffffff",s=null!=o.model.getTerminal(t.cell,!1)?o.model.getTerminal(t.cell,!1):t.cell,s=o.getSwimlane(s),n=o.swimlaneIndicatorColorAttribute):"indicated"==i&&(t.shape[e]=t.shape.indicatorColor),null!=s){var l=o.getView().getState(s);(t.shape[e]=null)!=l&&(null!=l.shape&&"indicatorColor"!=e?t.shape[e]=l.shape[e]:t.shape[e]=l.style[n])}},mxCellRenderer.prototype.getLabelValue=function(t){return t.view.graph.getLabel(t.cell)},mxCellRenderer.prototype.createLabel=function(s,t){var l=s.view.graph;l.getModel().isEdge(s.cell);if(0<s.style[mxConstants.STYLE_FONTSIZE]||null==s.style[mxConstants.STYLE_FONTSIZE]){var e=l.isHtmlLabel(s.cell)||null!=t&&mxUtils.isNode(t);s.text=new this.defaultTextShape(t,new mxRectangle,s.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,l.getVerticalAlign(s),s.style[mxConstants.STYLE_FONTCOLOR],s.style[mxConstants.STYLE_FONTFAMILY],s.style[mxConstants.STYLE_FONTSIZE],s.style[mxConstants.STYLE_FONTSTYLE],s.style[mxConstants.STYLE_SPACING],s.style[mxConstants.STYLE_SPACING_TOP],s.style[mxConstants.STYLE_SPACING_RIGHT],s.style[mxConstants.STYLE_SPACING_BOTTOM],s.style[mxConstants.STYLE_SPACING_LEFT],s.style[mxConstants.STYLE_HORIZONTAL],s.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],s.style[mxConstants.STYLE_LABEL_BORDERCOLOR],l.isWrapping(s.cell)&&l.isHtmlLabel(s.cell),l.isLabelClipped(s.cell),s.style[mxConstants.STYLE_OVERFLOW],s.style[mxConstants.STYLE_LABEL_PADDING],mxUtils.getValue(s.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)),s.text.opacity=mxUtils.getValue(s.style,mxConstants.STYLE_TEXT_OPACITY,100),s.text.dialect=e?mxConstants.DIALECT_STRICTHTML:s.view.graph.dialect,s.text.style=s.style,s.text.state=s,this.initializeLabel(s,s.text);function n(t){var e=s;if(mxClient.IS_TOUCH||r){var n=mxEvent.getClientX(t),i=mxEvent.getClientY(t),o=mxUtils.convertPoint(l.container,n,i);e=l.view.getState(l.getCellAt(o.x,o.y))}return e}var r=!1,i=s.text.node;mxEvent.addGestureListeners(i,mxUtils.bind(this,function(t){if(this.isLabelEvent(s,t)){if(mxClient.IS_READONLY_PAGE||workflowUi.wfEditor.wfTestIsIng)return void(mxClient.IS_TOUCH?this.addWfOperatorInfo(s,t):"true"==window.urlParams.isFromWfForm&&this.addWfOperatorInfo(s,t));l.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,s)),r=l.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(t).nodeName}}),mxUtils.bind(this,function(t){mxClient.IS_READONLY_PAGE||workflowUi.wfEditor.wfTestIsIng||this.isLabelEvent(s,t)&&l.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,n(t)))}),mxUtils.bind(this,function(t){if(!mxClient.IS_TOUCH&&this.isLabelEvent(s,t)){if(mxClient.IS_READONLY_PAGE||workflowUi.wfEditor.wfTestIsIng)return;l.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t,n(t))),r=!1}})),l.nativeDblClickEnabled&&mxEvent.addListener(s.text.node,"dblclick",mxUtils.bind(this,function(t){if(this.isLabelEvent(s,t)){if("true"==window.urlParams.isFromWfForm||"true"==window.urlParams.backstageReadOnly||workflowUi.wfEditor.wfTestIsIng)return;l.dblClick(t,s.cell),mxEvent.consume(t)}}))}},mxCellRenderer.prototype.initializeLabel=function(t,e){mxClient.IS_SVG&&mxClient.NO_FO&&e.dialect!=mxConstants.DIALECT_SVG?e.init(t.view.graph.container):e.init(t.view.getDrawPane())},mxCellRenderer.prototype.createCellOverlays=function(t){var e=t.view.graph.getCellOverlays(t.cell),n=null;if(null!=e){n=new mxDictionary;for(var i=0;i<e.length;i++){var o=null!=t.overlays?t.overlays.remove(e[i]):null;if(null==o){var s=new mxImageShape(new mxRectangle,e[i].image.src);s.dialect=t.view.graph.dialect,s.preserveImageAspect=!1,s.overlay=e[i],this.initializeOverlay(t,s),this.installCellOverlayListeners(t,e[i],s),null!=e[i].cursor&&(s.node.style.cursor=e[i].cursor),n.put(e[i],s)}else n.put(e[i],o)}}null!=t.overlays&&t.overlays.visit(function(t,e){e.destroy()}),t.overlays=n},mxCellRenderer.prototype.initializeOverlay=function(t,e){e.init(t.view.getOverlayPane())},mxCellRenderer.prototype.installCellOverlayListeners=function(e,n,t){var i=e.view.graph;mxEvent.addListener(t.node,"click",function(t){i.isEditing()&&i.stopEditing(!i.isInvokesStopCellEditing()),n.fireEvent(new mxEventObject(mxEvent.CLICK,"event",t,"cell",e.cell))}),mxEvent.addGestureListeners(t.node,function(t){mxEvent.consume(t)},function(t){i.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,e))}),mxClient.IS_TOUCH&&mxEvent.addListener(t.node,"touchend",function(t){n.fireEvent(new mxEventObject(mxEvent.CLICK,"event",t,"cell",e.cell))})},mxCellRenderer.prototype.createControl=function(t){var e=t.view.graph,n=e.getFoldingImage(t);if(e.foldingEnabled&&null!=n){if(null==t.control){var i=new mxRectangle(0,0,n.width,n.height);t.control=new mxImageShape(i,n.src),t.control.preserveImageAspect=!1,t.control.dialect=e.dialect,this.initControl(t,t.control,!0,this.createControlClickHandler(t))}}else null!=t.control&&(t.control.destroy(),t.control=null)},mxCellRenderer.prototype.createControlClickHandler=function(n){var i=n.view.graph;return mxUtils.bind(this,function(t){if(this.forceControlClickHandler||i.isEnabled()){var e=!i.isCellCollapsed(n.cell);i.foldCells(e,!1,[n.cell],null,t),mxEvent.consume(t)}})},mxCellRenderer.prototype.initControl=function(e,t,n,i){var o=e.view.graph;o.isHtmlLabel(e.cell)&&mxClient.NO_FO&&o.dialect==mxConstants.DIALECT_SVG?(t.dialect=mxConstants.DIALECT_PREFERHTML,t.init(o.container),t.node.style.zIndex=1):t.init(e.view.getOverlayPane());var s=t.innerNode||t.node;if(null==i||mxClient.IS_IOS||(o.isEnabled()&&(s.style.cursor="pointer"),mxEvent.addListener(s,"click",i)),n){var l=null;mxEvent.addGestureListeners(s,function(t){l=new mxPoint(mxEvent.getClientX(t),mxEvent.getClientY(t)),o.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,e)),mxEvent.consume(t)},function(t){o.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,e))},function(t){o.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t,e)),mxEvent.consume(t)}),null!=i&&mxClient.IS_IOS&&s.addEventListener("touchend",function(t){if(null!=l){var e=o.tolerance;Math.abs(l.x-mxEvent.getClientX(t))<e&&Math.abs(l.y-mxEvent.getClientY(t))<e&&(i.call(i,t),mxEvent.consume(t))}},!0)}return s},mxCellRenderer.prototype.isShapeEvent=function(t,e){return!0},mxCellRenderer.prototype.isLabelEvent=function(t,e){return!0},mxCellRenderer.prototype.addWfOperatorInfo=function(i,t){var e=mxClient.labelMap||{};if(i.cell.edge||i.cell.isGroupArea||i.cell.isHelpfulText||!mxClient.FREE_WORKFLOW_ISREADONLY_MODEL&&mxClient.IS_TOUCH)mxUtils.hideWfOperatorInfo();else{var n,o;if(document.getElementById("wfFrontOperator-container"))n=document.getElementById("wfFrontOperator-container");else{(n=document.createElement("div")).id="wfFrontOperator-container";var s=document.createElement("div");s.className="wfFrontOperator-header",s.innerHTML=e[99]||"操作者",n.appendChild(s),document.body.appendChild(n)}workflowUi.currentIsHorizon?n.style.transform="rotate(90deg)":n.style.transform="",n.style.display="block",document.getElementById("wfFrontOperator-main")?o=document.getElementById("wfFrontOperator-main"):(o=document.createElement("div")).id="wfFrontOperator-main",o.innerHTML="",o.style.padding="6px 8px";var l,r,a,h,d=this,u=workflowUi.editor.graph.workflowDetailDatas.form_nodesInfo||{},p=u[i.cell.nodeId]||{},m=window.urlParams.requestid||window.urlParams.requestId||"",c=i.cell.nodeId||"";i.cell.isPostedNodeOperators||2==p.nodeType||0==p.nodeOperatorName.indexOf("1_#WFSPSTR_OPTTP#_")?0==p.nodeType?(p.notOperators&&0<p.notOperators.length&&d.createWfOperatorItem(o,"notOperate",p.notOperators,p,i,p.nodeType),p.viewers&&0<p.viewers.length&&d.createWfOperatorItem(o,"checked",p.viewers,p,i,p.nodeType),p.operators&&0<p.operators.length&&d.createWfOperatorItem(o,"operated",p.operators,p,i,p.nodeType)):1==p.nodeType?(d.createWfOperatorItem(o,"notOperate",p.notOperators,p,i,p.nodeType),d.createWfOperatorItem(o,"checked",p.viewers,p,i,p.nodeType),d.createWfOperatorItem(o,"operated",p.operators,p,i,p.nodeType)):3==p.nodeType&&0!=p.nodeOperatorName.indexOf("1_#WFSPSTR_OPTTP#_")?d.createWfOperatorItem(o,"operated",p.operators,p,i,p.nodeType):d.createWfOperatorItem(o,"notOperate",p.operators,p,i,p.nodeType):(o.innerHTML=e[81558]||(wfGetLabel?wfGetLabel(81558,"正在加载数据,请稍候!"):"正在加载数据,请稍候!"),mxUtils.post(WORKFLOW_GETOPERATORS_PATH,"requestid="+m+"&cnodeid="+c,function(t){var e=t.request.responseText,n=JSON.parse(e);i.cell.isPostedNodeOperators=!0,o.innerHTML="",u[i.cell.nodeId].notOperators=n.nodes[0].notOperators||[],u[i.cell.nodeId].operators=n.nodes[0].operators||[],u[i.cell.nodeId].viewers=n.nodes[0].viewers||[],0==p.nodeType||3==p.nodeType?(n.nodes[0].notOperators&&0<n.nodes[0].notOperators.length&&d.createWfOperatorItem(o,"notOperate",n.nodes[0].notOperators,p,i,p.nodeType),n.nodes[0].viewers&&0<n.nodes[0].viewers.length&&d.createWfOperatorItem(o,"checked",n.nodes[0].viewers,p,i,p.nodeType),n.nodes[0].operators&&0<n.nodes[0].operators.length&&d.createWfOperatorItem(o,"operated",n.nodes[0].operators,p,i,p.nodeType)):1==p.nodeType&&(d.createWfOperatorItem(o,"notOperate",n.nodes[0].notOperators,p,i,p.nodeType),d.createWfOperatorItem(o,"checked",n.nodes[0].viewers,p,i,p.nodeType),d.createWfOperatorItem(o,"operated",n.nodes[0].operators,p,i,p.nodeType))})),p.nodeOperatorName&&""!=p.nodeOperatorName?n.appendChild(o):n.style.display="none",h=mxClient.IS_TOUCH&&t.changedTouches?t.changedTouches[0]:t,r=mxClient.IS_IE||mxClient.IS_TOUCH?(l=h.pageX,h.pageY):(l=h.x,h.y),void 0===l&&(l=h.clientX,r=h.clientY),(a=window.innerHeight-r-30)<65&&(r-=65-a,a=65),(a-=5)<65&&(a=65),300<a&&(a=300),o.style.maxHeight=a+"px",l+240>window.innerWidth?n.style.left=window.innerWidth-240+"px":n.style.left=l+"px",r+n.clientHeight>window.innerHeight?n.style.top=window.innerHeight-n.clientHeight+"px":n.style.top=r+"px"}},mxCellRenderer.prototype.createWfOperatorFunc=function(t,e){if(mxClient.IS_TOUCH)return!1;var n=window.openhrm||window.parent.openhrm||null,i=window.pointerXY||window.parent.pointerXY||null;return 0!=t.target.hrmType?window.open("/spa/crm/static/index.html#/main/crm/customerView?customerId="+t.target.hrmId):(n&&n(t.target.hrmId),i&&i(t)),!1},mxCellRenderer.prototype.createWfOperatorItem=function(t,e,n,i,o,s){var l=mxClient.labelMap||{},r=document.createElement("div"),a=document.createElement("div");r.className="operatorItem",a.className=e,a.innerHTML=3!==s?"operated"==e?l[28499]||"已操作":"checked"==e?l[18006]||"已查看":l[28500]||"未操作":"";i.nodeOperatorName&&i.nodeOperatorName.split("_")[0];r.appendChild(a);for(var h="/spa/workflow/static4engine/engine.html#/main/workflowengine/path/pathSet/group?workflowId="+window.urlParams.workflowId+"&nodeid="+o.cell.nodeId+"&nodetype="+i.nodeType+"&groupid=",d=0;d<n.length;++d){var u;if("notOperate"!=e||2!=s&&3!=s?(u=document.createElement("div")).className="operatorItemDiv":u=document.createElement("a"),u.href="notOperate"!=e||2!=s&&3!=s?"javascript:openhrm("+n[d].id+");":h+n[d].id,0!=n[d].type&&("notOperate"!=e||2!=s&&3!=s)&&(u.href="/spa/crm/static/index.html#/main/crm/customerView?customerId="+n[d].id),mxClient.IS_TOUCH&&(u.href="javascript:void(0)"),u.hrmType=n[d].type,u.hrmId=n[d].id,"notOperate"!=e||2!=s&&3!=s||(u.target="_blank"),mxClient.IS_TOUCH?("notOperate"!=e||2!=s&&3!=s)&&(u.ontouchend=this.createWfOperatorFunc):("notOperate"!=e||2!=s&&3!=s)&&(u.onclick=this.createWfOperatorFunc),n[d].hasAgent){var p=n[d].agent;u.innerHTML=n[d].name+" ";var m=document.createElement("span"),c=document.createElement("a");c.href="notOperate"==e&&2==s?h+p.id:"javascript:openhrm("+p.id+");",mxClient.IS_TOUCH&&(c.href="javascript:void(0)"),c.hrmId=p.id,c.hrmType=0,"notOperate"==e&&2==s&&(c.target="_blank"),mxClient.IS_TOUCH?"notOperate"==e&&2==s||(c.ontouchend=this.createWfOperatorFunc):"notOperate"==e&&2==s||(c.onclick=this.createWfOperatorFunc),m.innerHTML=" -> ",c.innerHTML=p.name+" ",r.appendChild(u),r.appendChild(m),r.appendChild(c)}else u.innerHTML=n[d].name+" ",r.appendChild(u)}if(!mxClient.IS_TOUCH){var g=window.ecCom||window.ecComWf||window.parent.ecCom||window.parent.ecComWf||{},x=g.WeaPopoverHrm||g.WeaPopoverHrm,y=window.ReactDOM||window.parent.ReactDOM||null,f=window.React||window.parent.React||null;window.antd||window.parent.antd;window.setTimeout(function(){x&&document.getElementById("workflowDesign-HrmContainer")&&y.render(f.createElement(x,{}),document.getElementById("workflowDesign-HrmContainer"))},0)}t.appendChild(r)},mxCellRenderer.prototype.installListeners=function(s){function e(t){var e=s;if(l.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(t).nodeName||mxClient.IS_TOUCH){var n=mxEvent.getClientX(t),i=mxEvent.getClientY(t),o=mxUtils.convertPoint(l.container,n,i);e=l.view.getState(l.getCellAt(o.x,o.y))}return e}var l=s.view.graph;mxClient.IS_TOUCH||mxEvent.addGestureListeners(s.shape.node,mxUtils.bind(this,function(t){if(this.isShapeEvent(s,t)){if(mxClient.IS_READONLY_PAGE||workflowUi.wfEditor.wfTestIsIng)return void(mxClient.IS_TOUCH||"true"==window.urlParams.isFromWfForm&&this.addWfOperatorInfo(s,t));l.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,s))}}),mxUtils.bind(this,function(t){if(!mxClient.IS_TOUCH&&this.isShapeEvent(s,t)){if(!s.cell.edge&&(mxClient.IS_READONLY_PAGE||workflowUi.wfEditor.wfTestIsIng))return;l.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,e(t)))}}),mxUtils.bind(this,function(t){if(!mxClient.IS_TOUCH&&this.isShapeEvent(s,t)){if(mxClient.IS_READONLY_PAGE||workflowUi.wfEditor.wfTestIsIng)return;l.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t,e(t)))}})),l.nativeDblClickEnabled&&mxEvent.addListener(s.shape.node,"dblclick",mxUtils.bind(this,function(t){if(this.isShapeEvent(s,t)){if("true"==window.urlParams.isFromWfForm||"true"==window.urlParams.backstageReadOnly||workflowUi.wfEditor.wfTestIsIng)return;l.dblClick(t,s.cell),mxEvent.consume(t)}}))},mxCellRenderer.prototype.redrawLabel=function(t,e){var n=t.view.graph,i=this.getLabelValue(t),o=n.isWrapping(t.cell),s=n.isLabelClipped(t.cell),l=t.view.graph.isHtmlLabel(t.cell)||null!=i&&mxUtils.isNode(i)?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect,r=t.style[mxConstants.STYLE_OVERFLOW]||"visible";if(null==t.text||t.text.wrap==o&&t.text.clipped==s&&t.text.overflow==r&&t.text.dialect==l||(t.text.destroy(),t.text=null),!t.cell.edge&&null==t.text&&null!=i&&(mxUtils.isNode(i)||0<i.length)?this.createLabel(t,i):null==t.text||null!=i&&0!=i.length||(t.text.destroy(),t.text=null),null!=t.text){e&&(null!=t.text.lastValue&&this.isTextShapeInvalid(t,t.text)&&(t.text.lastValue=null),t.text.resetStyles(),t.text.apply(t),t.text.valign=n.getVerticalAlign(t));var a=this.getLabelBounds(t),h=this.getTextScale(t);if(e||t.text.value!=i||t.text.isWrapping!=o||t.text.overflow!=r||t.text.isClipping!=s||t.text.scale!=h||t.text.dialect!=l||!t.text.bounds.equals(a)){0!=t.text.bounds.width&&null!=t.unscaledWidth&&0!=Math.round(t.text.bounds.width/t.text.scale*h-a.width)&&(t.unscaledWidth=null),t.text.dialect=l,t.text.value=i,t.text.bounds=a,t.text.scale=h,t.text.wrap=o,t.text.clipped=s,t.text.overflow=r;var d=t.text.node.style.visibility;this.redrawLabelShape(t.text),t.text.node.style.visibility=d}}},mxCellRenderer.prototype.isTextShapeInvalid=function(i,o){function t(t,e,n){return result="spacingTop"==e||"spacingRight"==e||"spacingBottom"==e||"spacingLeft"==e?parseFloat(o[t])-parseFloat(o.spacing)!=(i.style[e]||n):o[t]!=(i.style[e]||n),result}return t("fontStyle",mxConstants.STYLE_FONTSTYLE,mxConstants.DEFAULT_FONTSTYLE)||t("family",mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)||t("size",mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)||t("color",mxConstants.STYLE_FONTCOLOR,"black")||t("align",mxConstants.STYLE_ALIGN,"")||t("valign",mxConstants.STYLE_VERTICAL_ALIGN,"")||t("spacing",mxConstants.STYLE_SPACING,2)||t("spacingTop",mxConstants.STYLE_SPACING_TOP,0)||t("spacingRight",mxConstants.STYLE_SPACING_RIGHT,0)||t("spacingBottom",mxConstants.STYLE_SPACING_BOTTOM,0)||t("spacingLeft",mxConstants.STYLE_SPACING_LEFT,0)||t("horizontal",mxConstants.STYLE_HORIZONTAL,!0)||t("background",mxConstants.STYLE_LABEL_BACKGROUNDCOLOR)||t("border",mxConstants.STYLE_LABEL_BORDERCOLOR)||t("opacity",mxConstants.STYLE_TEXT_OPACITY,100)||t("textDirection",mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)},mxCellRenderer.prototype.redrawLabelShape=function(t){t.redraw()},mxCellRenderer.prototype.getTextScale=function(t){return t.view.scale},mxCellRenderer.prototype.getLabelBounds=function(t){var e=t.view.graph,n=t.view.scale,i=e.getModel().isEdge(t.cell),o=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y);if(i){var s=t.text.getSpacing();o.x+=s.x*n,o.y+=s.y*n;var l=e.getCellGeometry(t.cell);null!=l&&(o.width=Math.max(0,l.width*n),o.height=Math.max(0,l.height*n))}else{if(t.text.isPaintBoundsInverted()){var r=o.x;o.x=o.y,o.y=r}o.x+=t.x,o.y+=t.y,o.width=Math.max(1,t.width),o.height=Math.max(1,t.height);var a=mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE);if(a!=mxConstants.NONE&&""!=a){var h=parseFloat(mxUtils.getValue(t.style,mxConstants.STYLE_STROKEWIDTH,1))*n,d=1+Math.floor((h-1)/2),u=Math.floor(1+h);o.x+=d,o.y+=d,o.width-=u,o.height-=u}}if(t.text.isPaintBoundsInverted()){var p=(t.width-t.height)/2;o.x+=p,o.y-=p;r=o.width;o.width=o.height,o.height=r}if(null!=t.shape){var m=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),c=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);m==mxConstants.ALIGN_CENTER&&c==mxConstants.ALIGN_MIDDLE&&(o=t.shape.getLabelBounds(o))}var g=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);return null!=g&&(o.width=parseFloat(g)*n),i||this.rotateLabelBounds(t,o),o},mxCellRenderer.prototype.rotateLabelBounds=function(t,e){if(e.y-=t.text.margin.y*e.height,e.x-=t.text.margin.x*e.width,!this.legacySpacing||"fill"!=t.style[mxConstants.STYLE_OVERFLOW]&&"width"!=t.style[mxConstants.STYLE_OVERFLOW]){var n=t.view.scale,i=t.text.getSpacing();e.x+=i.x*n,e.y+=i.y*n;var o=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),s=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),l=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);e.width=Math.max(0,e.width-(o==mxConstants.ALIGN_CENTER&&null==l?t.text.spacingLeft*n+t.text.spacingRight*n:0)),e.height=Math.max(0,e.height-(s==mxConstants.ALIGN_MIDDLE?t.text.spacingTop*n+t.text.spacingBottom*n:0))}var r=t.text.getTextRotation();if(0!=r&&null!=t&&t.view.graph.model.isVertex(t.cell)){var a=t.getCenterX(),h=t.getCenterY();if(e.x!=a||e.y!=h){var d=r*(Math.PI/180);pt=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(d),Math.sin(d),new mxPoint(a,h)),e.x=pt.x,e.y=pt.y}}},mxCellRenderer.prototype.redrawCellOverlays=function(l,r){if(this.createCellOverlays(l),null!=l.overlays){var a=mxUtils.mod(mxUtils.getValue(l.style,mxConstants.STYLE_ROTATION,0),90),t=mxUtils.toRadians(a),h=Math.cos(t),d=Math.sin(t);l.overlays.visit(function(t,e){var n=e.overlay.getBounds(l);if(!l.view.graph.getModel().isEdge(l.cell)&&null!=l.shape&&0!=a){var i=n.getCenterX(),o=n.getCenterY(),s=mxUtils.getRotatedPoint(new mxPoint(i,o),h,d,new mxPoint(l.getCenterX(),l.getCenterY()));i=s.x,o=s.y,n.x=Math.round(i-n.width/2),n.y=Math.round(o-n.height/2)}!r&&null!=e.bounds&&e.scale==l.view.scale&&e.bounds.equals(n)||(e.bounds=n,e.scale=l.view.scale,e.redraw())})}},mxCellRenderer.prototype.redrawControl=function(t,e){var n=t.view.graph.getFoldingImage(t);if(null!=t.control&&null!=n){var i=this.getControlBounds(t,n.width,n.height),o=this.legacyControlPosition?mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0):t.shape.getTextRotation(),s=t.view.scale;!e&&t.control.scale==s&&t.control.bounds.equals(i)&&t.control.rotation==o||(t.control.rotation=o,t.control.bounds=i,t.control.scale=s,t.control.redraw())}},mxCellRenderer.prototype.getControlBounds=function(t,e,n){if(null==t.control)return null;var i=t.view.scale,o=t.getCenterX(),s=t.getCenterY();if(!t.view.graph.getModel().isEdge(t.cell)&&(o=t.x+e*i,s=t.y+n*i,null!=t.shape)){var l=t.shape.getShapeRotation();if(this.legacyControlPosition)l=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0);else if(t.shape.isPaintBoundsInverted()){var r=(t.width-t.height)/2;o+=r,s-=r}if(0!=l){var a=mxUtils.toRadians(l),h=Math.cos(a),d=Math.sin(a),u=mxUtils.getRotatedPoint(new mxPoint(o,s),h,d,new mxPoint(t.getCenterX(),t.getCenterY()));o=u.x,s=u.y}}return t.view.graph.getModel().isEdge(t.cell),new mxRectangle(Math.round(o-e/2*i),Math.round(s-n/2*i),Math.round(e*i),Math.round(n*i))},mxCellRenderer.prototype.insertStateAfter=function(t,e,n){for(var i=this.getShapesForState(t),o=0;o<i.length;o++)if(null!=i[o]&&null!=i[o].node){var s=i[o].node.parentNode!=t.view.getDrawPane()&&i[o].node.parentNode!=t.view.getOverlayPane(),l=s?n:e;if(null!=l&&l.nextSibling!=i[o].node)null==l.nextSibling?l.parentNode.appendChild(i[o].node):l.parentNode.insertBefore(i[o].node,l.nextSibling);else if(null==l)if(i[o].node.parentNode==t.view.graph.container){for(var r=t.view.canvas;null!=r&&r.parentNode!=t.view.graph.container;)r=r.parentNode;null!=r&&null!=r.nextSibling?r.nextSibling!=i[o].node&&i[o].node.parentNode.insertBefore(i[o].node,r.nextSibling):i[o].node.parentNode.appendChild(i[o].node)}else null!=i[o].node.parentNode.firstChild&&i[o].node.parentNode.firstChild!=i[o].node&&i[o].node.parentNode.insertBefore(i[o].node,i[o].node.parentNode.firstChild);s?n=i[o].node:e=i[o].node}return[e,n]},mxCellRenderer.prototype.getShapesForState=function(t){return[t.shape,t.text,t.control]},mxCellRenderer.prototype.redraw=function(t,e,n){var i=this.redrawShape(t,e,n);null==t.shape||null!=n&&!n||(this.redrawLabel(t,i),this.redrawCellOverlays(t,i),this.redrawControl(t,i))},mxCellRenderer.prototype.redrawShape=function(t,e,n){var i=t.view.graph.model,o=!1;return null!=t.shape&&null!=t.shape.style&&null!=t.style&&t.shape.style[mxConstants.STYLE_SHAPE]!=t.style[mxConstants.STYLE_SHAPE]&&(t.shape.destroy(),t.shape=null),null==t.shape&&null!=t.view.graph.container&&t.cell!=t.view.currentRoot&&(i.isVertex(t.cell)||i.isEdge(t.cell))?(t.shape=this.createShape(t),null!=t.shape&&(t.shape.minSvgStrokeWidth=this.minSvgStrokeWidth,t.shape.antiAlias=this.antiAlias,this.createIndicatorShape(t),this.initializeShape(t),this.createCellOverlays(t),this.installListeners(t),t.view.graph.selectionCellsHandler.updateHandler(t))):e||null==t.shape||mxUtils.equalEntries(t.shape.style,t.style)&&!this.checkPlaceholderStyles(t)||(t.shape.resetStyles(),this.configureShape(t),t.view.graph.selectionCellsHandler.updateHandler(t),e=!0),null!=t.shape&&(this.createControl(t),(e||this.isShapeInvalid(t,t.shape))&&(null!=t.absolutePoints?(t.shape.points=t.absolutePoints.slice(),t.shape.bounds=null):(t.shape.points=null,t.shape.bounds=new mxRectangle(t.x,t.y,t.width,t.height)),t.shape.scale=t.view.scale,null==n||n?this.doRedrawShape(t):t.shape.updateBoundingBox(),o=!0)),o},mxCellRenderer.prototype.doRedrawShape=function(t){t.shape.redraw()},mxCellRenderer.prototype.isShapeInvalid=function(t,e){return null==e.bounds||e.scale!=t.view.scale||null==t.absolutePoints&&!e.bounds.equals(t)||null!=t.absolutePoints&&!mxUtils.equalPoints(e.points,t.absolutePoints)},mxCellRenderer.prototype.destroy=function(t){null!=t.shape&&(null!=t.text&&(t.text.destroy(),t.text=null),null!=t.overlays&&(t.overlays.visit(function(t,e){e.destroy()}),t.overlays=null),null!=t.control&&(t.control.destroy(),t.control=null),t.shape.destroy(),t.shape=null)};var mxEdgeStyle={EntityRelation:function(t,e,n,i,o){var s=t.view,l=s.graph,r=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,mxConstants.ENTITY_SEGMENT)*s.scale,a=t.absolutePoints,h=a[0],d=a[a.length-1],u=!1;if(null!=h)(e=new mxCellState).x=h.x,e.y=h.y;else{if(null==e)return;if((c=mxUtils.getPortConstraints(e,t,!0,mxConstants.DIRECTION_MASK_NONE))!=mxConstants.DIRECTION_MASK_NONE&&c!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST)u=c==mxConstants.DIRECTION_MASK_WEST;else{var p=l.getCellGeometry(e.cell);p.relative?u=p.x<=.5:null!=n&&(u=n.x+n.width<e.x)}}var m=!0;if(null!=d)(n=new mxCellState).x=d.x,n.y=d.y;else if(null!=n){var c;if((c=mxUtils.getPortConstraints(n,t,!1,mxConstants.DIRECTION_MASK_NONE))!=mxConstants.DIRECTION_MASK_NONE&&c!=mxConstants.DIRECTION_MASK_WEST+mxConstants.DIRECTION_MASK_EAST)m=c==mxConstants.DIRECTION_MASK_WEST;else{var g=l.getCellGeometry(n.cell);g.relative?m=g.x<=.5:null!=e&&(m=e.x+e.width<n.x)}}if(null!=e&&null!=n){var x=u?e.x:e.x+e.width,y=s.getRoutingCenterY(e),f=m?n.x:n.x+n.width,v=s.getRoutingCenterY(n),C=r,E=u?-C:C,w=new mxPoint(x+E,y),S=new mxPoint(f+(E=m?-C:C),v);if(u==m){var b=u?Math.min(x,f)-r:Math.max(x,f)+r;o.push(new mxPoint(b,y)),o.push(new mxPoint(b,v))}else if(w.x<S.x==u){var T=y+(v-y)/2;o.push(w),o.push(new mxPoint(w.x,T)),o.push(new mxPoint(S.x,T)),o.push(S)}else o.push(w),o.push(S)}},Loop:function(t,e,n,i,o){var s=t.absolutePoints,l=s[0],r=s[s.length-1];if(null==l||null==r){if(null!=e){var a=t.view,h=a.graph;null!=(y=null!=i&&0<i.length?i[0]:null)&&(y=a.transformControlPoint(t,y),mxUtils.contains(e,y.x,y.y)&&(y=null));var d=0,u=0,p=0,m=0,c=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,h.gridSize)*a.scale,g=mxUtils.getValue(t.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);g==mxConstants.DIRECTION_NORTH||g==mxConstants.DIRECTION_SOUTH?(d=a.getRoutingCenterX(e),u=c):(p=a.getRoutingCenterY(e),m=c),null==y||y.x<e.x||y.x>e.x+e.width?null!=y?(d=y.x,m=Math.max(Math.abs(p-y.y),m)):g==mxConstants.DIRECTION_NORTH?p=e.y-2*u:g==mxConstants.DIRECTION_SOUTH?p=e.y+e.height+2*u:d=g==mxConstants.DIRECTION_EAST?e.x-2*m:e.x+e.width+2*m:null!=y&&(d=a.getRoutingCenterX(e),u=Math.max(Math.abs(d-y.x),m),p=y.y,m=0),o.push(new mxPoint(d-u,p-m)),o.push(new mxPoint(d+u,p+m))}}else if(null!=i&&0<i.length)for(var x=0;x<i.length;x++){var y=i[x];y=t.view.transformControlPoint(t,y),o.push(new mxPoint(y.x,y.y))}},ElbowConnector:function(t,e,n,i,o){var s=null!=i&&0<i.length?i[0]:null,l=!1,r=!1;if(null!=e&&null!=n)if(null!=s){var a=Math.min(e.x,n.x),h=Math.max(e.x+e.width,n.x+n.width),d=Math.min(e.y,n.y),u=Math.max(e.y+e.height,n.y+n.height);l=(s=t.view.transformControlPoint(t,s)).y<d||s.y>u,r=s.x<a||s.x>h}else{if(!(l=(a=Math.max(e.x,n.x))==(h=Math.min(e.x+e.width,n.x+n.width))))r=(d=Math.max(e.y,n.y))==(u=Math.min(e.y+e.height,n.y+n.height))}r||!l&&t.style[mxConstants.STYLE_ELBOW]!=mxConstants.ELBOW_VERTICAL?mxEdgeStyle.SideToSide(t,e,n,i,o):mxEdgeStyle.TopToBottom(t,e,n,i,o)},SideToSide:function(t,e,n,i,o){var s=t.view,l=null!=i&&0<i.length?i[0]:null,r=t.absolutePoints,a=r[0],h=r[r.length-1];if(null!=l&&(l=s.transformControlPoint(t,l)),null!=a&&((e=new mxCellState).x=a.x,e.y=a.y),null!=h&&((n=new mxCellState).x=h.x,n.y=h.y),null!=e&&null!=n){var d=Math.max(e.x,n.x),u=Math.min(e.x+e.width,n.x+n.width),p=null!=l?l.x:Math.round(u+(d-u)/2),m=s.getRoutingCenterY(e),c=s.getRoutingCenterY(n);if(null!=l&&(l.y>=e.y&&l.y<=e.y+e.height&&(m=l.y),l.y>=n.y&&l.y<=n.y+n.height&&(c=l.y)),mxUtils.contains(n,p,m)||mxUtils.contains(e,p,m)||o.push(new mxPoint(p,m)),mxUtils.contains(n,p,c)||mxUtils.contains(e,p,c)||o.push(new mxPoint(p,c)),1==o.length)if(null!=l)mxUtils.contains(n,p,l.y)||mxUtils.contains(e,p,l.y)||o.push(new mxPoint(p,l.y));else{var g=Math.max(e.y,n.y),x=Math.min(e.y+e.height,n.y+n.height);o.push(new mxPoint(p,g+(x-g)/2))}}},TopToBottom:function(t,e,n,i,o){var s=t.view,l=null!=i&&0<i.length?i[0]:null,r=t.absolutePoints,a=r[0],h=r[r.length-1];if(null!=l&&(l=s.transformControlPoint(t,l)),null!=a&&((e=new mxCellState).x=a.x,e.y=a.y),null!=h&&((n=new mxCellState).x=h.x,n.y=h.y),null!=e&&null!=n){var d=Math.max(e.y,n.y),u=Math.min(e.y+e.height,n.y+n.height),p=s.getRoutingCenterX(e);null!=l&&l.x>=e.x&&l.x<=e.x+e.width&&(p=l.x);var m=null!=l?l.y:Math.round(u+(d-u)/2);if(mxUtils.contains(n,p,m)||mxUtils.contains(e,p,m)||o.push(new mxPoint(p,m)),p=null!=l&&l.x>=n.x&&l.x<=n.x+n.width?l.x:s.getRoutingCenterX(n),mxUtils.contains(n,p,m)||mxUtils.contains(e,p,m)||o.push(new mxPoint(p,m)),1==o.length)if(null!=l&&1==o.length)mxUtils.contains(n,l.x,m)||mxUtils.contains(e,l.x,m)||o.push(new mxPoint(l.x,m));else{var c=Math.max(e.x,n.x),g=Math.min(e.x+e.width,n.x+n.width);o.push(new mxPoint(c+(g-c)/2,m))}}},SegmentConnector:function(t,e,n,i,o){var s=t.absolutePoints,l=Math.max(1,t.view.scale),r=0<o.length?o[0]:null,a=!0,h=null;function d(t){return(null==r||Math.abs(r.x-t.x)>=l||Math.abs(r.y-t.y)>=l)&&(o.push(t),r=t),r}var u=s[0];null==u&&null!=e?u=new mxPoint(t.view.getRoutingCenterX(e),t.view.getRoutingCenterY(e)):null!=u&&(u=u.clone()),u.x=Math.round(u.x),u.y=Math.round(u.y);var p=s.length-1;if(null!=i&&0<i.length){for(var m=[],c=0;c<i.length;c++){var g=t.view.transformControlPoint(t,i[c]);null!=g&&(g.x=Math.round(g.x),g.y=Math.round(g.y),m.push(g))}if(0==m.length)return;i=m,null!=u&&null!=i[0]&&(Math.abs(i[0].x-u.x)<l&&(i[0].x=u.x),Math.abs(i[0].y-u.y)<l&&(i[0].y=u.y));var x=s[p];null!=x&&null!=i[i.length-1]&&(Math.abs(i[i.length-1].x-x.x)<l&&(i[i.length-1].x=x.x),Math.abs(i[i.length-1].y-x.y)<l&&(i[i.length-1].y=x.y)),h=i[0];var y=e,f=s[0],v=!1,C=!1,E=h;null!=f&&(f.x=Math.round(f.x),f.y=Math.round(f.y),y=null);for(c=0;c<2;c++){var w=null!=f&&f.x==E.x,S=null!=f&&f.y==E.y,b=null!=y&&E.y>=y.y&&E.y<=y.y+y.height,T=null!=y&&E.x>=y.x&&E.x<=y.x+y.width;if(v=S||null==f&&b,C=w||null==f&&T,0!=c||!(v&&C||w&&S)){if(null!=f&&!S&&!w&&(b||T)){a=!b;break}if(C||v){a=v,1==c&&(a=i.length%2==0?v:C);break}}y=n,null!=(f=s[p])&&(f.x=Math.round(f.x),f.y=Math.round(f.y),y=null),E=i[i.length-1],w&&S&&(i=i.slice(1))}a&&(null!=s[0]&&s[0].y!=h.y||null==s[0]&&null!=e&&(h.y<e.y||h.y>e.y+e.height))?d(new mxPoint(u.x,h.y)):!a&&(null!=s[0]&&s[0].x!=h.x||null==s[0]&&null!=e&&(h.x<e.x||h.x>e.x+e.width))&&d(new mxPoint(h.x,u.y)),a?u.y=h.y:u.x=h.x;for(c=0;c<i.length;c++)a=!a,h=i[c],a?u.y=h.y:u.x=h.x,d(u.clone())}else h=u,a=!0;if(null==(u=s[p])&&null!=n&&(u=new mxPoint(t.view.getRoutingCenterX(n),t.view.getRoutingCenterY(n))),null!=u&&(u.x=Math.round(u.x),u.y=Math.round(u.y),null!=h&&(a&&(null!=s[p]&&s[p].y!=h.y||null==s[p]&&null!=n&&(h.y<n.y||h.y>n.y+n.height))?d(new mxPoint(u.x,h.y)):!a&&(null!=s[p]&&s[p].x!=h.x||null==s[p]&&null!=n&&(h.x<n.x||h.x>n.x+n.width))&&d(new mxPoint(h.x,u.y)))),null==s[0]&&null!=e)for(;1<o.length&&null!=o[1]&&mxUtils.contains(e,o[1].x,o[1].y);)o.splice(1,1);if(null==s[p]&&null!=n)for(;1<o.length&&null!=o[o.length-1]&&mxUtils.contains(n,o[o.length-1].x,o[o.length-1].y);)o.splice(o.length-1,1);null!=x&&null!=o[o.length-1]&&Math.abs(x.x-o[o.length-1].x)<l&&Math.abs(x.y-o[o.length-1].y)<l&&(o.splice(o.length-1,1),null!=o[o.length-1]&&(Math.abs(o[o.length-1].x-x.x)<l&&(o[o.length-1].x=x.x),Math.abs(o[o.length-1].y-x.y)<l&&(o[o.length-1].y=x.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(t,e,n,i,o){var s=mxUtils.getValue(t.style,o?mxConstants.STYLE_SOURCE_JETTY_SIZE:mxConstants.STYLE_TARGET_JETTY_SIZE,mxUtils.getValue(t.style,mxConstants.STYLE_JETTY_SIZE,mxEdgeStyle.orthBuffer));if("auto"==s)if(mxUtils.getValue(t.style,o?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE){var l=mxUtils.getNumber(t.style,o?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE);s=Math.max(2,Math.ceil((l+mxEdgeStyle.orthBuffer)/mxEdgeStyle.orthBuffer))*mxEdgeStyle.orthBuffer}else s=2*mxEdgeStyle.orthBuffer;return s},OrthConnector:function(t,e,n,i,o){var s=t.view.graph,l=null!=e&&s.getModel().isEdge(e.cell),r=null!=n&&s.getModel().isEdge(n.cell),a=t.absolutePoints,h=a[0],d=a[a.length-1],u=null!=e?e.x:h.x,p=null!=e?e.y:h.y,m=null!=e?e.width:0,c=null!=e?e.height:0,g=null!=n?n.x:d.x,x=null!=n?n.y:d.y,y=null!=n?n.width:0,f=null!=n?n.height:0,v=t.view.scale*mxEdgeStyle.getJettySize(t,e,n,i,!0),C=t.view.scale*mxEdgeStyle.getJettySize(t,e,n,i,!1);null!=e&&n==e&&(v=C=Math.max(v,C));var E=C+v,w=!1;null!=h&&null!=d&&(w=(R=d.x-h.x)*R+(G=d.y-h.y)*G<E*E);if(w||mxEdgeStyle.orthPointsFallback&&null!=i&&0<i.length||l||r)mxEdgeStyle.SegmentConnector(t,e,n,i,o);else{var S,b=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL],T=0;if(null!=e)if(b[0]=mxUtils.getPortConstraints(e,t,!0,mxConstants.DIRECTION_MASK_ALL),0!=(T=mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION,0)))u=(S=mxUtils.getBoundingBox(new mxRectangle(u,p,m,c),T)).x,p=S.y,m=S.width,c=S.height;if(null!=n)if(b[1]=mxUtils.getPortConstraints(n,t,!1,mxConstants.DIRECTION_MASK_ALL),0!=(T=mxUtils.getValue(n.style,mxConstants.STYLE_ROTATION,0)))g=(S=mxUtils.getBoundingBox(new mxRectangle(g,x,y,f),T)).x,x=S.y,y=S.width,f=S.height;for(var A=[0,0],L=[[u=Math.round(10*u)/10,p=Math.round(10*p)/10,m=Math.round(10*m)/10,c=Math.round(10*c)/10],[g=Math.round(10*g)/10,x=Math.round(10*x)/10,y=Math.round(10*y)/10,f=Math.round(10*f)/10]],I=[v,C],M=0;M<2;M++)mxEdgeStyle.limits[M][1]=L[M][0]-I[M],mxEdgeStyle.limits[M][2]=L[M][1]-I[M],mxEdgeStyle.limits[M][4]=L[M][0]+L[M][2]+I[M],mxEdgeStyle.limits[M][8]=L[M][1]+L[M][3]+I[M];var R,P=L[0][0]+L[0][2]/2,O=L[0][1]+L[0][3]/2,N=L[1][0]+L[1][2]/2,G=O-(L[1][1]+L[1][3]/2),H=0;(R=P-N)<0?H=G<0?2:1:G<=0&&(H=3,0==R&&(H=2));var D=null;null!=e&&(D=h);var _=[[.5,.5],[.5,.5]];for(M=0;M<2;M++)null!=D&&(_[M][0]=(D.x-L[M][0])/L[M][2],Math.abs(D.x-L[M][0])<=1?A[M]=mxConstants.DIRECTION_MASK_WEST:Math.abs(D.x-L[M][0]-L[M][2])<=1&&(A[M]=mxConstants.DIRECTION_MASK_EAST),_[M][1]=(D.y-L[M][1])/L[M][3],Math.abs(D.y-L[M][1])<=1?A[M]=mxConstants.DIRECTION_MASK_NORTH:Math.abs(D.y-L[M][1]-L[M][3])<=1&&(A[M]=mxConstants.DIRECTION_MASK_SOUTH)),(D=null)!=n&&(D=d);var U=L[0][1]-(L[1][1]+L[1][3]),k=L[0][0]-(L[1][0]+L[1][2]),V=L[1][1]-(L[0][1]+L[0][3]),F=L[1][0]-(L[0][0]+L[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(k-E,0),mxEdgeStyle.vertexSeperations[2]=Math.max(U-E,0),mxEdgeStyle.vertexSeperations[4]=Math.max(V-E,0),mxEdgeStyle.vertexSeperations[3]=Math.max(F-E,0);var B=[],Y=[],z=[];Y[0]=F<=k?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,z[0]=V<=U?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,Y[1]=mxUtils.reversePortConstraints(Y[0]),z[1]=mxUtils.reversePortConstraints(z[0]);var W=F<=k?k:F,X=V<=U?U:V,j=[[0,0],[0,0]],Z=!1;for(M=0;M<2;M++)0==A[M]&&(0==(Y[M]&b[M])&&(Y[M]=mxUtils.reversePortConstraints(Y[M])),0==(z[M]&b[M])&&(z[M]=mxUtils.reversePortConstraints(z[M])),j[M][0]=z[M],j[M][1]=Y[M]);0<X&&0<W&&(0<(Y[0]&b[0])&&0<(z[1]&b[1])?(j[0][0]=Y[0],j[0][1]=z[0],j[1][0]=z[1],j[1][1]=Y[1],Z=!0):0<(z[0]&b[0])&&0<(Y[1]&b[1])&&(j[0][0]=z[0],j[0][1]=Y[0],j[1][0]=Y[1],j[1][1]=z[1],Z=!0)),0<X&&!Z&&(j[0][0]=z[0],j[0][1]=Y[0],j[1][0]=z[1],j[1][1]=Y[1],Z=!0),0<W&&!Z&&(j[0][0]=Y[0],j[0][1]=z[0],j[1][0]=Y[1],j[1][1]=z[1],Z=!0);for(M=0;M<2;M++)0==A[M]&&(0==(j[M][0]&b[M])&&(j[M][0]=j[M][1]),B[M]=j[M][0]&b[M],B[M]|=(j[M][1]&b[M])<<8,B[M]|=(j[1-M][M]&b[M])<<16,B[M]|=(j[1-M][1-M]&b[M])<<24,0==(15&B[M])&&(B[M]=B[M]<<8),0==(3840&B[M])&&(B[M]=15&B[M]|B[M]>>8),0==(983040&B[M])&&(B[M]=65535&B[M]|(251658240&B[M])>>8),A[M]=15&B[M],b[M]!=mxConstants.DIRECTION_MASK_WEST&&b[M]!=mxConstants.DIRECTION_MASK_NORTH&&b[M]!=mxConstants.DIRECTION_MASK_EAST&&b[M]!=mxConstants.DIRECTION_MASK_SOUTH||(A[M]=b[M]));var K=A[0]==mxConstants.DIRECTION_MASK_EAST?3:A[0],Q=A[1]==mxConstants.DIRECTION_MASK_EAST?3:A[1];(K-=H)<1&&(K+=4),(Q-=H)<1&&(Q+=4);var J=mxEdgeStyle.routePatterns[K-1][Q-1];switch(mxEdgeStyle.wayPoints1[0][0]=L[0][0],mxEdgeStyle.wayPoints1[0][1]=L[0][1],A[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=v,mxEdgeStyle.wayPoints1[0][1]+=_[0][1]*L[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=_[0][0]*L[0][2],mxEdgeStyle.wayPoints1[0][1]+=L[0][3]+v;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=L[0][2]+v,mxEdgeStyle.wayPoints1[0][1]+=_[0][1]*L[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=_[0][0]*L[0][2],mxEdgeStyle.wayPoints1[0][1]-=v}var q=0,$=0<(A[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1,tt=$,et=0;for(M=0;M<J.length;M++){var nt=15&J[M],it=nt==mxConstants.DIRECTION_MASK_EAST?3:nt;4<(it+=H)&&(it-=4);var ot=mxEdgeStyle.dirVectors[it-1];(et=0<it%2?0:1)!=$&&(q++,mxEdgeStyle.wayPoints1[q][0]=mxEdgeStyle.wayPoints1[q-1][0],mxEdgeStyle.wayPoints1[q][1]=mxEdgeStyle.wayPoints1[q-1][1]);var st=0<(J[M]&mxEdgeStyle.TARGET_MASK),lt=0<(J[M]&mxEdgeStyle.SOURCE_MASK),rt=(J[M]&mxEdgeStyle.SIDE_MASK)>>5;15<(rt<<=H)&&(rt>>=4);var at=0<(J[M]&mxEdgeStyle.CENTER_MASK);if((lt||st)&&rt<9){var ht=0,dt=lt?0:1;if(ht=at&&0==et?L[dt][0]+_[dt][0]*L[dt][2]:at?L[dt][1]+_[dt][1]*L[dt][3]:mxEdgeStyle.limits[dt][rt],0==et){var ut=(ht-mxEdgeStyle.wayPoints1[q][0])*ot[0];0<ut&&(mxEdgeStyle.wayPoints1[q][0]+=ot[0]*ut)}else{var pt=(ht-mxEdgeStyle.wayPoints1[q][1])*ot[1];0<pt&&(mxEdgeStyle.wayPoints1[q][1]+=ot[1]*pt)}}else at&&(mxEdgeStyle.wayPoints1[q][0]+=ot[0]*Math.abs(mxEdgeStyle.vertexSeperations[it]/2),mxEdgeStyle.wayPoints1[q][1]+=ot[1]*Math.abs(mxEdgeStyle.vertexSeperations[it]/2));0<q&&mxEdgeStyle.wayPoints1[q][et]==mxEdgeStyle.wayPoints1[q-1][et]?q--:$=et}for(M=0;M<=q;M++){if(M==q)if(((0<(A[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))?0:1)==tt?0:1)!=(q+1)%2)break;o.push(new mxPoint(Math.round(mxEdgeStyle.wayPoints1[M][0]),Math.round(mxEdgeStyle.wayPoints1[M][1])))}for(var mt=1;mt<o.length;)null==o[mt-1]||null==o[mt]||o[mt-1].x!=o[mt].x||o[mt-1].y!=o[mt].y?mt++:o.splice(mt,1)}},getRoutePattern:function(t,e,n,i){var o=t[0]==mxConstants.DIRECTION_MASK_EAST?3:t[0],s=t[1]==mxConstants.DIRECTION_MASK_EAST?3:t[1];(o-=e)<1&&(o+=4),(s-=e)<1&&(s+=4);var l=routePatterns[o-1][s-1];return 0!=n&&0!=i||null!=inlineRoutePatterns[o-1][s-1]&&(l=inlineRoutePatterns[o-1][s-1]),l}},mxStyleRegistry={values:[],putValue:function(t,e){mxStyleRegistry.values[t]=e},getValue:function(t){return mxStyleRegistry.values[t]},getName:function(t){for(var e in mxStyleRegistry.values)if(mxStyleRegistry.values[e]==t)return e;return null}};function mxGraphView(t){this.graph=t,this.translate=new mxPoint,this.graphBounds=new mxRectangle,this.states=new mxDictionary}function mxCurrentRootChange(t,e){if(this.view=t,this.root=e,this.previous=e,this.isUp=null==e,!this.isUp)for(var n=this.view.currentRoot,i=this.view.graph.getModel();null!=n;){if(n==e){this.isUp=!0;break}n=i.getParent(n)}}function mxGraph(t,e,n,i){this.mouseListeners=null,this.renderHint=n,mxClient.IS_SVG?this.dialect=mxConstants.DIALECT_SVG:n==mxConstants.RENDERING_HINT_EXACT&&mxClient.IS_VML?this.dialect=mxConstants.DIALECT_VML:n==mxConstants.RENDERING_HINT_FASTEST?this.dialect=mxConstants.DIALECT_STRICTHTML:n==mxConstants.RENDERING_HINT_FASTER?this.dialect=mxConstants.DIALECT_PREFERHTML:this.dialect=mxConstants.DIALECT_MIXEDHTML,this.model=null!=e?e:new mxGraphModel,this.multiplicities=[],this.imageBundles=[],this.cellRenderer=this.createCellRenderer(),this.setSelectionModel(this.createSelectionModel()),this.setStylesheet(null!=i?i:this.createStylesheet()),this.view=this.createGraphView(),this.graphModelChangeListener=mxUtils.bind(this,function(t,e){this.graphModelChanged(e.getProperty("edit").changes)}),this.model.addListener(mxEvent.CHANGE,this.graphModelChangeListener),this.createHandlers(),null!=t&&this.init(t),this.view.revalidate()}function mxCellOverlay(t,e,n,i,o,s){this.image=t,this.tooltip=e,this.align=null!=n?n:this.align,this.verticalAlign=null!=i?i:this.verticalAlign,this.offset=null!=o?o:new mxPoint,this.cursor=null!=s?s:"help"}function mxOutline(t,e){this.source=t,null!=e&&this.init(e)}function mxMultiplicity(t,e,n,i,o,s,l,r,a,h){this.source=t,this.type=e,this.attr=n,this.value=i,this.min=null!=o?o:0,this.max=null!=s?s:"n",this.validNeighbors=l,this.countError=mxResources.get(r)||r,this.typeError=mxResources.get(a)||a,this.validNeighborsAllowed=null==h||h}function mxLayoutManager(t){this.undoHandler=mxUtils.bind(this,function(t,e){this.isEnabled()&&this.beforeUndo(e.getProperty("edit"))}),this.moveHandler=mxUtils.bind(this,function(t,e){this.isEnabled()&&this.cellsMoved(e.getProperty("cells"),e.getProperty("event"))}),this.setGraph(t)}function mxSwimlaneManager(t,e,n,i){this.horizontal=null==e||e,this.addEnabled=null==n||n,this.resizeEnabled=null==i||i,this.addHandler=mxUtils.bind(this,function(t,e){this.isEnabled()&&this.isAddEnabled()&&this.cellsAdded(e.getProperty("cells"))}),this.resizeHandler=mxUtils.bind(this,function(t,e){this.isEnabled()&&this.isResizeEnabled()&&this.cellsResized(e.getProperty("cells"))}),this.setGraph(t)}function mxTemporaryCellStates(o,t,e,n,s){t=null!=t?t:1,this.view=o,this.oldValidateCellState=o.validateCellState,this.oldBounds=o.getGraphBounds(),this.oldStates=o.getStates(),this.oldScale=o.getScale(),this.oldDoRedrawShape=o.graph.cellRenderer.doRedrawShape;var l=this;if(null!=s&&(o.graph.cellRenderer.doRedrawShape=function(n){var i=n.shape.paint;n.shape.paint=function(t){var e=s(n);null!=e&&t.setLink(e),i.apply(this,arguments),null!=e&&t.setLink(null)},l.oldDoRedrawShape.apply(o.graph.cellRenderer,arguments),n.shape.paint=i}),o.validateCellState=function(t,e){return null==t||null==n||n(t)?l.oldValidateCellState.apply(o,arguments):null},o.setStates(new mxDictionary),o.setScale(t),null!=e){o.resetValidationState();for(var i=null,r=0;r<e.length;r++){var a=o.getBoundingBox(o.validateCellState(o.validateCell(e[r])));null==i?i=a:i.add(a)}o.setGraphBounds(i||new mxRectangle)}}function mxCellStatePreview(t){this.deltas=new mxDictionary,this.graph=t}function mxConnectionConstraint(t,e,n){this.point=t,this.perimeter=null==e||e,this.name=n}function mxGraphHandler(t){this.graph=t,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(t,e){this.reset()}),this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler)}function mxPanningHandler(t){null!=t&&(this.graph=t,this.graph.addMouseListener(this),this.forcePanningHandler=mxUtils.bind(this,function(t,e){var n=e.getProperty("eventName"),i=e.getProperty("event");n==mxEvent.MOUSE_DOWN&&this.isForcePanningEvent(i)&&(this.start(i),this.active=!0,this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",i)),i.consume())}),this.graph.addListener(mxEvent.FIRE_MOUSE_EVENT,this.forcePanningHandler),this.gestureHandler=mxUtils.bind(this,function(t,e){if(this.isPinchEnabled()){var n=e.getProperty("event");if(mxEvent.isConsumed(n)||"gesturestart"!=n.type?"gestureend"==n.type&&null!=this.initialScale&&(this.initialScale=null):(this.initialScale=this.graph.view.scale,this.active||null==this.mouseDownEvent||(this.start(this.mouseDownEvent),this.mouseDownEvent=null)),null!=this.initialScale){var i=Math.round(this.initialScale*n.scale*100)/100;null!=this.minScale&&(i=Math.max(this.minScale,i)),null!=this.maxScale&&(i=Math.min(this.maxScale,i)),this.graph.view.scale!=i&&this.graph.zoomTo(i)}}}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.mouseUpListener=mxUtils.bind(this,function(){this.active&&this.reset()}),mxEvent.addListener(document,"mouseup",this.mouseUpListener))}function mxPopupMenuHandler(t,e){null!=t&&(this.graph=t,this.factoryMethod=e,this.graph.addMouseListener(this),this.gestureHandler=mxUtils.bind(this,function(t,e){this.inTolerance=!1}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),this.init())}function mxCellMarker(t,e,n,i){mxEventSource.call(this),null!=t&&(this.graph=t,this.validColor=null!=e?e:mxConstants.DEFAULT_VALID_COLOR,this.invalidColor=null!=e?n:mxConstants.DEFAULT_INVALID_COLOR,this.hotspot=null!=i?i:mxConstants.DEFAULT_HOTSPOT,this.highlight=new mxCellHighlight(t))}function mxSelectionCellsHandler(t){mxEventSource.call(this),this.graph=t,this.handlers=new mxDictionary,this.graph.addMouseListener(this),this.refreshHandler=mxUtils.bind(this,function(t,e){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)}function mxConnectionHandler(t,e){mxEventSource.call(this),null!=t&&(this.graph=t,this.factoryMethod=e,this.init(),this.escapeHandler=mxUtils.bind(this,function(t,e){this.reset()}),this.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}function mxConstraintHandler(t){this.graph=t,this.resetHandler=mxUtils.bind(this,function(t,e){null!=this.currentFocus&&null==this.graph.view.getState(this.currentFocus.cell)?this.reset():this.redraw()}),this.graph.model.addListener(mxEvent.CHANGE,this.resetHandler),this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.resetHandler),this.graph.view.addListener(mxEvent.TRANSLATE,this.resetHandler),this.graph.view.addListener(mxEvent.SCALE,this.resetHandler),this.graph.addListener(mxEvent.ROOT,this.resetHandler)}function mxRubberband(t){null!=t&&(this.graph=t,this.graph.addMouseListener(this),this.forceRubberbandHandler=mxUtils.bind(this,function(t,e){var n=e.getProperty("eventName"),i=e.getProperty("event");if(n==mxEvent.MOUSE_DOWN&&this.isForceRubberbandEvent(i)){var o=mxUtils.getOffset(this.graph.container),s=mxUtils.getScrollOrigin(this.graph.container);s.x-=o.x,s.y-=o.y,this.start(i.getX()+s.x,i.getY()+s.y),i.consume(!1)}}),this.graph.addListener(mxEvent.FIRE_MOUSE_EVENT,this.forceRubberbandHandler),this.panHandler=mxUtils.bind(this,function(){this.repaint()}),this.graph.addListener(mxEvent.PAN,this.panHandler),this.gestureHandler=mxUtils.bind(this,function(t,e){null!=this.first&&this.reset()}),this.graph.addListener(mxEvent.GESTURE,this.gestureHandler),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}function mxHandle(t,e,n){this.graph=t.view.graph,this.state=t,this.cursor=null!=e?e:this.cursor,this.image=null!=n?n:this.image,this.init()}function mxVertexHandler(t){null!=t&&(this.state=t,this.init(),this.escapeHandler=mxUtils.bind(this,function(t,e){this.livePreview&&null!=this.index&&(this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate()),this.reset()}),this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}function mxEdgeHandler(i){null!=i&&(this.state=i,this.init(),this.escapeHandler=mxUtils.bind(this,function(t,e){var n=null!=this.index;this.reset(),n&&this.graph.cellRenderer.redraw(this.state,!1,i.view.isRendering())}),this.state.view.graph.addListener(mxEvent.ESCAPE,this.escapeHandler))}function mxElbowEdgeHandler(t){mxEdgeHandler.call(this,t)}function mxEdgeSegmentHandler(t){mxEdgeHandler.call(this,t)}function mxKeyHandler(t,e){null!=t&&(this.graph=t,this.target=e||document.documentElement,this.normalKeys=[],this.shiftKeys=[],this.controlKeys=[],this.controlShiftKeys=[],this.keydownHandler=mxUtils.bind(this,function(t){-1<t.target.className.indexOf("ant-input")?t.stopPropagation():this.keyDown(t)}),mxEvent.addListener(this.target,"keydown",this.keydownHandler),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}function mxTooltipHandler(t,e){null!=t&&(this.graph=t,this.delay=e||100,this.graph.addMouseListener(this))}function mxCellTracker(t,e,n){mxCellMarker.call(this,t,e),this.graph.addMouseListener(this),null!=n&&(this.getCell=n),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()}))}function mxCellHighlight(t,e,n,i){null!=t&&(this.graph=t,this.highlightColor=null!=e?e:mxConstants.DEFAULT_VALID_COLOR,this.strokeWidth=null!=n?n:mxConstants.HIGHLIGHT_STROKEWIDTH,this.dashed=null!=i&&i,this.opacity=mxConstants.HIGHLIGHT_OPACITY,this.repaintHandler=mxUtils.bind(this,function(){if(null!=this.state){var t=this.graph.view.getState(this.state.cell);null==t?this.hide():(this.state=t,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))}function mxDefaultKeyHandler(e){if(null!=e){this.editor=e,this.handler=new mxKeyHandler(e.graph);var n=this.handler.escape;this.handler.escape=function(t){n.apply(this,arguments),e.hideProperties(),e.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",t))}}}function mxDefaultPopupMenu(t){this.config=t}function mxDefaultToolbar(t,e){this.editor=e,null!=t&&null!=e&&this.init(t)}function mxEditor(t){this.actions=[],this.addActions(),null!=document.body&&(this.cycleAttributeValues=[],this.popupHandler=new mxDefaultPopupMenu,this.undoManager=new mxUndoManager,this.graph=this.createGraph(),this.toolbar=this.createToolbar(),this.keyHandler=new mxDefaultKeyHandler(this),this.configure(t),this.graph.swimlaneIndicatorColorAttribute=this.cycleAttributeName,null!=this.onInit&&this.onInit(),mxClient.IS_IE&&mxEvent.addListener(window,"unload",mxUtils.bind(this,function(){this.destroy()})))}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),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(t){this.graphBounds=t},mxGraphView.prototype.getBounds=function(t){var e=null;if(null!=t&&0<t.length)for(var n=this.graph.getModel(),i=0;i<t.length;i++)if(n.isVertex(t[i])||n.isEdge(t[i])){var o=this.getState(t[i]);null!=o&&(null==e?e=mxRectangle.fromRectangle(o):e.add(o))}return e},mxGraphView.prototype.setCurrentRoot=function(t){if(this.currentRoot!=t){var e=new mxCurrentRootChange(this,t);e.execute();var n=new mxUndoableEdit(this,!1);n.add(e),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",n)),this.graph.sizeDidChange()}return t},mxGraphView.prototype.scaleAndTranslate=function(t,e,n){var i=this.scale,o=new mxPoint(this.translate.x,this.translate.y);this.scale==t&&this.translate.x==e&&this.translate.y==n||(this.scale=t,this.translate.x=e,this.translate.y=n,this.isEventsEnabled()&&this.viewStateChanged()),this.fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE,"scale",t,"previousScale",i,"translate",this.translate,"previousTranslate",o))},mxGraphView.prototype.getScale=function(){return this.scale},mxGraphView.prototype.setScale=function(t){var e=this.scale;this.scale!=t&&(this.scale=t,this.isEventsEnabled()&&this.viewStateChanged()),this.fireEvent(new mxEventObject(mxEvent.SCALE,"scale",t,"previousScale",e))},mxGraphView.prototype.getTranslate=function(){return this.translate},mxGraphView.prototype.setTranslate=function(t,e){var n=new mxPoint(this.translate.x,this.translate.y);this.translate.x==t&&this.translate.y==e||(this.translate.x=t,this.translate.y=e,this.isEventsEnabled()&&this.viewStateChanged()),this.fireEvent(new mxEventObject(mxEvent.TRANSLATE,"translate",this.translate,"previousTranslate",n))},mxGraphView.prototype.viewStateChanged=function(){this.revalidate(),this.graph.sizeDidChange()},mxGraphView.prototype.refresh=function(){null!=this.currentRoot&&this.clear(),this.revalidate()},mxGraphView.prototype.revalidate=function(){this.invalidate(),this.validate()},mxGraphView.prototype.clear=function(t,e,n){var i=this.graph.getModel();if(t=t||i.getRoot(),e=null!=e&&e,n=null==n||n,this.removeState(t),n&&(e||t!=this.currentRoot))for(var o=i.getChildCount(t),s=0;s<o;s++)this.clear(i.getChildAt(t,s),e);else this.invalidate(t)},mxGraphView.prototype.invalidate=function(t,e,n){var i=this.graph.getModel();t=t||i.getRoot(),e=null==e||e,n=null==n||n;var o=this.getState(t);if(null!=o&&(o.invalid=!0),!t.invalidating){if(t.invalidating=!0,e)for(var s=i.getChildCount(t),l=0;l<s;l++){var r=i.getChildAt(t,l);this.invalidate(r,e,n)}if(n){var a=i.getEdgeCount(t);for(l=0;l<a;l++)this.invalidate(i.getEdgeAt(t,l),e,n)}delete t.invalidating}},mxGraphView.prototype.validate=function(t){var e=mxLog.enter("mxGraphView.validate");window.status=mxResources.get(this.updatingDocumentResource)||this.updatingDocumentResource,this.resetValidationState();var n=null;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),n=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));var i=this.getBoundingBox(this.validateCellState(this.validateCell(t||(null!=this.currentRoot?this.currentRoot:this.graph.getModel().getRoot()))));this.setGraphBounds(null!=i?i:this.getEmptyBounds()),this.validateBackground(),null!=n&&(this.canvas.style.display=n,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",e)},mxGraphView.prototype.getEmptyBounds=function(){return new mxRectangle(this.translate.x*this.scale,this.translate.y*this.scale)},mxGraphView.prototype.getBoundingBox=function(t,e){e=null==e||e;var n=null;if(null!=t&&(null!=t.shape&&null!=t.shape.boundingBox&&(n=t.shape.boundingBox.clone()),null!=t.text&&null!=t.text.boundingBox&&(null!=n?n.add(t.text.boundingBox):n=t.text.boundingBox.clone()),e))for(var i=this.graph.getModel(),o=i.getChildCount(t.cell),s=0;s<o;s++){var l=this.getBoundingBox(this.getState(i.getChildAt(t.cell,s)));null!=l&&(null==n?n=l:n.add(l))}return n},mxGraphView.prototype.createBackgroundPageShape=function(t){return new mxRectangleShape(t,"white","black")},mxGraphView.prototype.validateBackground=function(){this.validateBackgroundImage(),this.validateBackgroundPage()},mxGraphView.prototype.validateBackgroundImage=function(){var t=this.graph.getBackgroundImage();if(null!=t){if(null==this.backgroundImage||this.backgroundImage.image!=t.src){null!=this.backgroundImage&&this.backgroundImage.destroy();var e=new mxRectangle(0,0,1,1);this.backgroundImage=new mxImageShape(e,t.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(t){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t))}),mxUtils.bind(this,function(t){this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t))}),mxUtils.bind(this,function(t){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t))}))}this.redrawBackgroundImage(this.backgroundImage,t)}else null!=this.backgroundImage&&(this.backgroundImage.destroy(),this.backgroundImage=null)},mxGraphView.prototype.validateBackgroundPage=function(){if(this.graph.pageVisible){var t=this.getBackgroundPageBounds();null==this.backgroundPageShape?(this.backgroundPageShape=this.createBackgroundPageShape(t),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(t){this.graph.dblClick(t)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(t){this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t))}),mxUtils.bind(this,function(t){null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.isHideOnHover()&&this.graph.tooltipHandler.hide(),this.graph.isMouseDown&&!mxEvent.isConsumed(t)&&this.graph.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t))}),mxUtils.bind(this,function(t){this.graph.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t))}))):(this.backgroundPageShape.scale=this.scale,this.backgroundPageShape.bounds=t,this.backgroundPageShape.redraw())}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null)},mxGraphView.prototype.getBackgroundPageBounds=function(){var t=this.graph.pageFormat,e=this.scale*this.graph.pageScale;return new mxRectangle(this.scale*this.translate.x,this.scale*this.translate.y,t.width*e,t.height*e)},mxGraphView.prototype.redrawBackgroundImage=function(t,e){t.scale=this.scale,t.bounds.x=this.scale*this.translate.x,t.bounds.y=this.scale*this.translate.y,t.bounds.width=this.scale*e.width,t.bounds.height=this.scale*e.height,t.redraw()},mxGraphView.prototype.validateCell=function(t,e){if(e=null==e||e,null!=t)if(e=e&&this.graph.isCellVisible(t),null==this.getState(t,e)||e)for(var n=this.graph.getModel(),i=n.getChildCount(t),o=0;o<i;o++)this.validateCell(n.getChildAt(t,o),e&&(!this.isCellCollapsed(t)||t==this.currentRoot));else this.removeState(t);return t},mxGraphView.prototype.validateCellState=function(t,e){e=null==e||e;var n=null;if(null!=t&&null!=(n=this.getState(t))){var i=this.graph.getModel();if(n.invalid&&(n.invalid=!1,null==n.style&&(n.style=this.graph.getCellStyle(n.cell)),t!=this.currentRoot&&this.validateCellState(i.getParent(t),!1),n.setVisibleTerminalState(this.validateCellState(this.getVisibleTerminal(t,!0),!1),!0),n.setVisibleTerminalState(this.validateCellState(this.getVisibleTerminal(t,!1),!1),!1),this.updateCellState(n),t==this.currentRoot||n.invalid||(this.graph.cellRenderer.redraw(n,!1,this.isRendering()),n.updateCachedBounds())),e&&!n.invalid){null!=n.shape&&this.stateValidated(n);for(var o=i.getChildCount(t),s=0;s<o;s++)this.validateCellState(i.getChildAt(t,s))}}return n},mxGraphView.prototype.updateCellState=function(t){if(t.absoluteOffset.x=0,t.absoluteOffset.y=0,t.origin.x=0,t.origin.y=0,t.length=0,t.cell!=this.currentRoot){var e=this.graph.getModel(),n=this.getState(e.getParent(t.cell));null!=n&&n.cell!=this.currentRoot&&(t.origin.x+=n.origin.x,t.origin.y+=n.origin.y);var i=this.graph.getChildOffsetForCell(t.cell);null!=i&&(t.origin.x+=i.x,t.origin.y+=i.y);var o=this.graph.getCellGeometry(t.cell);if(null!=o){if(!e.isEdge(t.cell))if(i=o.offset||this.EMPTY_POINT,o.relative&&null!=n)if(e.isEdge(n.cell)){var s=this.getPoint(n,o);null!=s&&(t.origin.x+=s.x/this.scale-n.origin.x-this.translate.x,t.origin.y+=s.y/this.scale-n.origin.y-this.translate.y)}else t.origin.x+=o.x*n.width/this.scale+i.x,t.origin.y+=o.y*n.height/this.scale+i.y;else t.absoluteOffset.x=this.scale*i.x,t.absoluteOffset.y=this.scale*i.y,t.origin.x+=o.x,t.origin.y+=o.y;t.x=this.scale*(this.translate.x+t.origin.x),t.y=this.scale*(this.translate.y+t.origin.y),t.width=this.scale*o.width,t.unscaledWidth=o.width,t.height=this.scale*o.height,e.isVertex(t.cell)&&this.updateVertexState(t,o),e.isEdge(t.cell)&&this.updateEdgeState(t,o)}}t.updateCachedBounds()},mxGraphView.prototype.isCellCollapsed=function(t){return this.graph.isCellCollapsed(t)},mxGraphView.prototype.updateVertexState=function(t,e){var n=this.graph.getModel(),i=this.getState(n.getParent(t.cell));if(e.relative&&null!=i&&!n.isEdge(i.cell)){var o=mxUtils.toRadians(i.style[mxConstants.STYLE_ROTATION]||"0");if(0!=o){var s=Math.cos(o),l=Math.sin(o),r=new mxPoint(t.getCenterX(),t.getCenterY()),a=new mxPoint(i.getCenterX(),i.getCenterY()),h=mxUtils.getRotatedPoint(r,s,l,a);t.x=h.x-t.width/2,t.y=h.y-t.height/2}}this.updateVertexLabelOffset(t)},mxGraphView.prototype.updateEdgeState=function(t,e){var n=t.getVisibleTerminalState(!0),i=t.getVisibleTerminalState(!1);if(null!=this.graph.model.getTerminal(t.cell,!0)&&null==n||null==n&&null==e.getTerminalPoint(!0)||null!=this.graph.model.getTerminal(t.cell,!1)&&null==i||null==i&&null==e.getTerminalPoint(!1))this.clear(t.cell,!0);else{this.updateFixedTerminalPoints(t,n,i),this.updatePoints(t,e.points,n,i),this.updateFloatingTerminalPoints(t,n,i);var o=t.absolutePoints;t.cell!=this.currentRoot&&(null==o||o.length<2||null==o[0]||null==o[o.length-1])?this.clear(t.cell,!0):(this.updateEdgeBounds(t),this.updateEdgeLabelOffset(t))}},mxGraphView.prototype.updateVertexLabelOffset=function(t){var e=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);if(e==mxConstants.ALIGN_LEFT)null!=(n=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null))?n*=this.scale:n=t.width,t.absoluteOffset.x-=n;else if(e==mxConstants.ALIGN_RIGHT)t.absoluteOffset.x+=t.width;else if(e==mxConstants.ALIGN_CENTER){var n;if(null!=(n=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null))){var i=mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),o=0;i==mxConstants.ALIGN_CENTER?o=.5:i==mxConstants.ALIGN_RIGHT&&(o=1),0!=o&&(t.absoluteOffset.x-=(n*this.scale-t.width)*o)}}var s=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);s==mxConstants.ALIGN_TOP?t.absoluteOffset.y-=t.height:s==mxConstants.ALIGN_BOTTOM&&(t.absoluteOffset.y+=t.height)},mxGraphView.prototype.resetValidationState=function(){this.lastNode=null,this.lastHtmlNode=null,this.lastForegroundNode=null,this.lastForegroundHtmlNode=null},mxGraphView.prototype.stateValidated=function(t){var e=this.graph.getModel().isEdge(t.cell)&&this.graph.keepEdgesInForeground||this.graph.getModel().isVertex(t.cell)&&this.graph.keepEdgesInBackground,n=e&&this.lastForegroundHtmlNode||this.lastHtmlNode,i=e&&this.lastForegroundNode||this.lastNode,o=this.graph.cellRenderer.insertStateAfter(t,i,n);e?(this.lastForegroundHtmlNode=o[1],this.lastForegroundNode=o[0]):(this.lastHtmlNode=o[1],this.lastNode=o[0])},mxGraphView.prototype.updateFixedTerminalPoints=function(t,e,n){this.updateFixedTerminalPoint(t,e,!0,this.graph.getConnectionConstraint(t,e,!0)),this.updateFixedTerminalPoint(t,n,!1,this.graph.getConnectionConstraint(t,n,!1))},mxGraphView.prototype.updateFixedTerminalPoint=function(t,e,n,i){t.setAbsoluteTerminalPoint(this.getFixedTerminalPoint(t,e,n,i),n)},mxGraphView.prototype.getFixedTerminalPoint=function(t,e,n,i){var o=null;if(null!=i&&(o=this.graph.getConnectionPoint(e,i)),null==o&&null==e){var s=this.scale,l=this.translate,r=t.origin;null!=(o=this.graph.getCellGeometry(t.cell).getTerminalPoint(n))&&(o=new mxPoint(s*(l.x+o.x+r.x),s*(l.y+o.y+r.y)))}return o},mxGraphView.prototype.updateBoundsFromStencil=function(t){var e=null;if(null!=t&&null!=t.shape&&null!=t.shape.stencil&&"fixed"==t.shape.stencil.aspect){e=mxRectangle.fromRectangle(t);var n=t.shape.stencil.computeAspect(t.style,t.x,t.y,t.width,t.height);t.setRect(n.x,n.y,t.shape.stencil.w0*n.width,t.shape.stencil.h0*n.height)}return e},mxGraphView.prototype.checkEdgeFirstAndLastPoint=function(t,e,n){var i=this.scale;if(null!=t&&null!=e&&2<e.length){var o="";if(0==n.exitX||1==n.exitX){var s=.5;1<(s=(e[1].y-t.cell.source.geometry.y*i)/(t.cell.source.geometry.height*i))&&(s=1),s<0&&(s=0),t.style.exitY=s,t.cell.style=""}if(0==n.exitY||1==n.exitY){var l=.5;1<(l=(e[1].x-t.cell.source.geometry.x*i)/(t.cell.source.geometry.width*i))&&(l=1),l<0&&(l=0),t.style.exitX=l,t.cell.style=""}if(0==n.entryX||1==n.entryX){var r=.5;1<(r=(e[e.length-2].y-t.cell.target.geometry.y*i)/(t.cell.target.geometry.height*i))&&(r=1),r<0&&(r=0),t.style.entryY=r,t.cell.style=""}if(0==n.entryY||1==n.entryY){var a=.5;1<(a=(e[e.length-2].x-t.cell.target.geometry.x*i)/(t.cell.target.geometry.width*i))&&(a=1),a<0&&(a=0),t.style.entryX=a,t.cell.style=""}for(var h in t.style)o+=h+"="+t.style[h]+";";t.cell.style=o}},mxGraphView.prototype.updatePoints=function(t,e,n,i,o){for(var s=t.cell.style.split(";"),l=0,r=s.length;l<r;++l){var a=s[l].split("=");a[0]&&a[1]&&(t.style[a[0]]=a[1])}var h=this.scale;if(t.cell.setAbsPointNull&&!t.cell.doNotClearAbsPoints&&(e=null,t.cell.geometry.points=null),t.cell.setAbsPointNull||null!=t.cell.isFromMouseUp&&t.cell.isFromMouseUp||null!=t.cell.isStartConnect&&t.cell.isStartConnect||this.isFromScaleChanged,t.cell.isFromMouseUp=!1,t.cell.isStartConnect=!1,null!=t){var d=[];d.push(t.absolutePoints[0]);var u=this.getEdgeStyle(t,e,n,i);if(null!=u){var p=this.getTerminalPort(t,n,!0),m=this.getTerminalPort(t,i,!1),c=this.updateBoundsFromStencil(p),g=this.updateBoundsFromStencil(m);u(t,p,m,e,d),null!=c&&p.setRect(c.x,c.y,c.width,c.height),null!=g&&m.setRect(g.x,g.y,g.width,g.height)}else if(null!=e)for(l=0;l<e.length;l++)if(null!=e[l]){var x=mxUtils.clone(e[l]);d.push(this.transformControlPoint(t,x))}var y=t.absolutePoints;d.push(y[y.length-1]),2<d.length&&(this.checkThePointIsInCell(d[1],p)||this.checkThePointIsInCell(d[d.length-2],m))&&(this.checkThePointIsInCell(d[1],p)&&2<d.length&&(0==t.style.exitY||1==t.style.exitY?d[0].y==d[1].y&&d.shift():0!=t.style.exitX&&1!=t.style.exitX||d[0].x==d[1].x&&d.shift()),this.checkThePointIsInCell(d[d.length-2],m)&&2<d.length&&(0==t.style.entryY||1==t.style.entryY?d[d.length-1].y==d[d.length-2].y&&d.pop():0!=t.style.entryX&&1!=t.style.entryX||d[d.length-1].x==d[d.length-2].x&&d.pop()),this.checkEdgeFirstAndLastPoint(t,d,t.style));var f=d.slice();for(l=0,r=f.length;l<r;++l)f[l]&&f[l].y<30*h&&(f[l].y=30*h);t.absolutePoints=this.adjustTheCellAbsPoints(f)}},mxGraphView.prototype.adjustTheCellAbsPoints=function(t){for(var e=[],n=[],i=0,o=t.length-3;i<=o;++i){var s=t[i],l=t[i+1],r=t[i+2];s&&l&&r&&(s.x==l.x&&l.x==r.x||s.y==l.y&&l.y==r.y)&&n.push(i+1)}for(i=0,o=t.length;i<o;++i)n.indexOf(i)<0&&e.push(t[i]);for(i=0,o=e.length;i<o-1;++i){s=e[i];var a=e[i+1];s&&a&&(Math.abs(s.x-a.x)<10&&(a.x=s.x),Math.abs(s.y-a.y)<10&&(a.y=s.y))}return e},mxGraphView.prototype.checkThePointIsInCell=function(t,e){var n=!1,i=e?e.cellBounds:{};return(t.x+1>=i.x||t.x>=i.x)&&(t.y+1>=i.y||t.y>=i.y)&&(t.x-1<=i.x+i.width||t.x<=i.x+i.width)&&(t.y-1<=i.y+i.height||t.y<=i.y+i.height)&&(n=!0),n},mxGraphView.prototype.checkTheFirstAndLastAbsPoints=function(t,e){var n,i=e.slice(),o=t.cell.source,s=t.cell.target,l=this.scale,r=i[0],a=i[i.length-1],h=o.geometry.x*l,d=o.geometry.h*l,u=o.geometry.width*l,p=o.geometry.height*l,m=s.geometry.x*l,c=s.geometry.h*l,g=s.geometry.width*l,x=s.geometry.height*l;r.x>h&&r.x<h+u&&r.y>d&&r.Fy+p&&("left"==(n=this.calcTheNearestDirection(r,h,d,u,p))?r.x=h:"right"==n?r.x=h+u:r.y="top"==n?d:d+p,i[0]=r);a.x>m&&a.x<m+g&&a.y>c&&a.Ly+x&&("left"==(n=this.calcTheNearestDirection(a,m,c,g,x))?a.x=m:"right"==n?a.x=m+g:a.y="top"==n?c:c+x,i[i.length-1]=a);return e=i},mxGraphView.prototype.calcTheNearestDirection=function(t,e,n,i,o){var s=0<Math.abs(t.x-e)-Math.abs(e+i-t.x)?Math.abs(e+i-t.x):Math.abs(t.x-e);return"x"===((0<Math.abs(t.y-n)-Math.abs(n+o-t.y)?Math.abs(n+o-t.y):Math.abs(t.y-n))<s?"y":"x")?0<Math.abs(t.x-e)-Math.abs(e+i-t.x)?"right":"left":0<Math.abs(t.y-n)-Math.abs(n+o-t.y)?"bottom":"top"},mxGraphView.prototype.transformControlPoint=function(t,e){if(null==t||null==e)return null;var n=t.origin;return new mxPoint(this.scale*(e.x+this.translate.x+n.x),this.scale*(e.y+this.translate.y+n.y))},mxGraphView.prototype.isLoopStyleEnabled=function(t,e,n,i){var o=this.graph.getConnectionConstraint(t,n,!0),s=this.graph.getConnectionConstraint(t,i,!1);return!(!(null==e||e.length<2)||mxUtils.getValue(t.style,mxConstants.STYLE_ORTHOGONAL_LOOP,!1)&&(null!=o&&null!=o.point||null!=s&&null!=s.point))&&(null!=n&&n==i)},mxGraphView.prototype.getEdgeStyle=function(t,e,n,i){var o=this.isLoopStyleEnabled(t,e,n,i)?mxUtils.getValue(t.style,mxConstants.STYLE_LOOP,this.graph.defaultLoopStyle):mxUtils.getValue(t.style,mxConstants.STYLE_NOEDGESTYLE,!1)?null:t.style[mxConstants.STYLE_EDGE];if("string"==typeof o){var s=mxStyleRegistry.getValue(o);null==s&&this.isAllowEval()&&(s=mxUtils.eval(o)),o=s}return"function"==typeof o?o:null},mxGraphView.prototype.updateFloatingTerminalPoints=function(t,e,n){var i=t.absolutePoints,o=i[0];null==i[i.length-1]&&null!=n&&this.updateFloatingTerminalPoint(t,n,e,!1),null==o&&null!=e&&this.updateFloatingTerminalPoint(t,e,n,!0)},mxGraphView.prototype.updateFloatingTerminalPoint=function(t,e,n,i){t.setAbsoluteTerminalPoint(this.getFloatingTerminalPoint(t,e,n,i),i)},mxGraphView.prototype.getFloatingTerminalPoint=function(t,e,n,i){var o=this.getNextPoint(t,n,i),s=this.graph.isOrthogonal(t),l=mxUtils.toRadians(Number(e.style[mxConstants.STYLE_ROTATION]||"0")),r=new mxPoint(e.getCenterX(),e.getCenterY());if(0!=l){var a=Math.cos(-l),h=Math.sin(-l);o=mxUtils.getRotatedPoint(o,a,h,r)}var d=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0);d+=parseFloat(t.style[i?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);var u=this.getPerimeterPoint(e,o,0==l&&s,d);if(0!=l){a=Math.cos(l),h=Math.sin(l);u=mxUtils.getRotatedPoint(u,a,h,r)}return u},mxGraphView.prototype.getTerminalPort=function(t,e,n){var i=n?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT,o=mxUtils.getValue(t.style,i);if(null!=o){var s=this.getState(this.graph.getModel().getCell(o));null!=s&&(e=s)}return e},mxGraphView.prototype.getPerimeterPoint=function(t,e,n,i){var o=null;if(null!=t){var s=this.getPerimeterFunction(t);if(null!=s&&null!=e){var l=this.getPerimeterBounds(t,i);if(0<l.width||0<l.height){o=new mxPoint(e.x,e.y);var r=!1,a=!1;this.graph.model.isVertex(t.cell)&&(r=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPH,0),a=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPV,0),null!=t.shape&&null!=t.shape.stencil&&(r=1==mxUtils.getValue(t.style,"stencilFlipH",0)||r,a=1==mxUtils.getValue(t.style,"stencilFlipV",0)||a),r&&(o.x=2*l.getCenterX()-o.x),a&&(o.y=2*l.getCenterY()-o.y)),null!=(o=s(l,t,o,n))&&(r&&(o.x=2*l.getCenterX()-o.x),a&&(o.y=2*l.getCenterY()-o.y))}}null==o&&(o=this.getPoint(t))}return o},mxGraphView.prototype.getRoutingCenterX=function(t){var e=null!=t.style&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return t.getCenterX()+e*t.width},mxGraphView.prototype.getRoutingCenterY=function(t){var e=null!=t.style&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return t.getCenterY()+e*t.height},mxGraphView.prototype.getPerimeterBounds=function(t,e){return e=null!=e?e:0,null!=t&&(e+=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0)),t.getPerimeterBounds(e*this.scale)},mxGraphView.prototype.getPerimeterFunction=function(t){var e=t.style[mxConstants.STYLE_PERIMETER];if("string"==typeof e){var n=mxStyleRegistry.getValue(e);null==n&&this.isAllowEval()&&(n=mxUtils.eval(e)),e=n}return"function"==typeof e?e:null},mxGraphView.prototype.getNextPoint=function(t,e,n){var i=t.absolutePoints,o=null;if(null!=i&&2<=i.length){var s=i.length;o=i[n?Math.min(1,s-1):Math.max(0,s-2)]}return null==o&&null!=e&&(o=new mxPoint(e.getCenterX(),e.getCenterY())),o},mxGraphView.prototype.getVisibleTerminal=function(t,e){for(var n=this.graph.getModel(),i=n.getTerminal(t,e),o=i;null!=i&&i!=this.currentRoot;)this.graph.isCellVisible(o)&&!this.isCellCollapsed(i)||(o=i),i=n.getParent(i);return n.getParent(o)==n.getRoot()&&(o=null),o},mxGraphView.prototype.updateEdgeBounds=function(t){var e=t.absolutePoints,n=e[0],i=e[e.length-1];if(n.x!=i.x||n.y!=i.y){var o=i.x-n.x,s=i.y-n.y;t.terminalDistance=Math.sqrt(o*o+s*s)}else t.terminalDistance=0;var l=0,r=[],a=n;if(null!=a){for(var h=a.x,d=a.y,u=h,p=d,m=1;m<e.length;m++){var c=e[m];if(null!=c){o=a.x-c.x,s=a.y-c.y;var g=Math.sqrt(o*o+s*s);r.push(g),l+=g,a=c,h=Math.min(a.x,h),d=Math.min(a.y,d),u=Math.max(a.x,u),p=Math.max(a.y,p)}}t.length=l,t.segments=r;t.x=h,t.y=d,t.width=Math.max(1,u-h),t.height=Math.max(1,p-d)}},mxGraphView.prototype.getPoint=function(t,e){var n=t.getCenterX(),i=t.getCenterY();if(null==t.segments||null!=e&&!e.relative){if(null!=e){null!=(m=e.offset)&&(n+=m.x,i+=m.y)}}else{for(var o=null!=e?e.x/2:0,s=t.absolutePoints.length,l=Math.round((.5+o)*t.length),r=t.segments[0],a=0,h=1;l>=Math.round(a+r)&&h<s-1;)a+=r,r=t.segments[h++];var d=0==r?0:(l-a)/r,u=t.absolutePoints[h-1],p=t.absolutePoints[h];if(null!=u&&null!=p){var m,c=0,g=0,x=0;if(null!=e)c=e.y,null!=(m=e.offset)&&(g=m.x,x=m.y);var y=p.x-u.x,f=p.y-u.y,v=0==r?0:f/r,C=0==r?0:y/r;n=u.x+y*d+(v*c+g)*this.scale,i=u.y+f*d-(C*c-x)*this.scale}}return new mxPoint(n,i)},mxGraphView.prototype.getRelativePoint=function(t,e,n){var i=this.graph.getModel().getGeometry(t.cell);if(null!=i){var o=t.absolutePoints.length;if(i.relative&&1<o){for(var s=t.length,l=t.segments,r=t.absolutePoints[0],a=t.absolutePoints[1],h=mxUtils.ptSegDistSq(r.x,r.y,a.x,a.y,e,n),d=0,u=0,p=0,m=2;m<o;m++){u+=l[m-2],a=t.absolutePoints[m];var c=mxUtils.ptSegDistSq(r.x,r.y,a.x,a.y,e,n);c<=h&&(h=c,d=m-1,p=u),r=a}var g=l[d];r=t.absolutePoints[d],a=t.absolutePoints[d+1];var x=r.x,y=r.y,f=a.x,v=a.y,C=e,E=n,w=x-f,S=y-v,b=0,T=(C=w-(C-=f))*w+(E=S-(E-=v))*S;b=T<=0?0:T*T/(w*w+S*S);var A=Math.sqrt(b);g<A&&(A=g);var L=Math.sqrt(mxUtils.ptSegDistSq(r.x,r.y,a.x,a.y,e,n));return-1==mxUtils.relativeCcw(r.x,r.y,a.x,a.y,e,n)&&(L=-L),new mxPoint((s/2-p-A)/s*-2,L/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(t){var e=t.absolutePoints;if(t.absoluteOffset.x=t.getCenterX(),t.absoluteOffset.y=t.getCenterY(),null!=e&&0<e.length&&null!=t.segments){var n=this.graph.getCellGeometry(t.cell);if(n.relative){var i=this.getPoint(t,n);null!=i&&(t.absoluteOffset=i)}else{var o=e[0],s=e[e.length-1];if(null!=o&&null!=s){var l=s.x-o.x,r=s.y-o.y,a=0,h=0,d=n.offset;null!=d&&(a=d.x,h=d.y);var u=o.x+l/2+a*this.scale,p=o.y+r/2+h*this.scale;t.absoluteOffset.x=u,t.absoluteOffset.y=p}}}},mxGraphView.prototype.getState=function(t,e){e=e||!1;var n=null;return null!=t&&(n=this.states.get(t),e&&(null==n||this.updateStyle)&&this.graph.isCellVisible(t)&&(null==n?(n=this.createState(t),this.states.put(t,n)):n.style=this.graph.getCellStyle(t))),n},mxGraphView.prototype.isRendering=function(){return this.rendering},mxGraphView.prototype.setRendering=function(t){this.rendering=t},mxGraphView.prototype.isAllowEval=function(){return this.allowEval},mxGraphView.prototype.setAllowEval=function(t){this.allowEval=t},mxGraphView.prototype.getStates=function(){return this.states},mxGraphView.prototype.setStates=function(t){this.states=t},mxGraphView.prototype.getCellStates=function(t){if(null==t)return this.states;for(var e=[],n=0;n<t.length;n++){var i=this.getState(t[n]);null!=i&&e.push(i)}return e},mxGraphView.prototype.removeState=function(t){var e=null;return null!=t&&null!=(e=this.states.remove(t))&&(this.graph.cellRenderer.destroy(e),e.invalid=!0,e.destroy()),e},mxGraphView.prototype.createState=function(t){return new mxCellState(this,t,this.graph.getCellStyle(t))},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(t){var e=mxEvent.getSource(t);return e==this.graph.container||e.parentNode==this.backgroundPane||null!=e.parentNode&&e.parentNode.parentNode==this.backgroundPane||e==this.canvas.parentNode||e==this.canvas||e==this.backgroundPane||e==this.drawPane||e==this.overlayPane||e==this.decoratorPane},mxGraphView.prototype.isScrollEvent=function(t){var e=mxUtils.getOffset(this.graph.container),n=new mxPoint(t.clientX-e.x,t.clientY-e.y),i=this.graph.container.offsetWidth,o=this.graph.container.clientWidth;if(o<i&&n.x>o+2&&n.x<=i)return!0;var s=this.graph.container.offsetHeight,l=this.graph.container.clientHeight;return l<s&&n.y>l+2&&n.y<=s},mxGraphView.prototype.init=function(){this.installListeners();var t=this.graph;t.dialect==mxConstants.DIALECT_SVG?this.createSvg():t.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()},mxGraphView.prototype.installListeners=function(){var s=this.graph,l=s.container;if(null!=l){mxClient.IS_TOUCH&&(mxEvent.addListener(l,"gesturestart",mxUtils.bind(this,function(t){s.fireGestureEvent(t)})),mxEvent.addListener(l,"gesturechange",mxUtils.bind(this,function(t){s.fireGestureEvent(t)})),mxEvent.addListener(l,"gestureend",mxUtils.bind(this,function(t){s.fireGestureEvent(t)}))),mxEvent.addGestureListeners(l,mxUtils.bind(this,function(t){!this.isContainerEvent(t)||(mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_GC||mxClient.IS_OP||mxClient.IS_SF)&&this.isScrollEvent(t)||(mxClient.IS_READONLY_PAGE?"true"==window.urlParams.isFromWfForm&&mxUtils.hideWfOperatorInfo():s.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t)))}),mxUtils.bind(this,function(t){this.isContainerEvent(t)&&(mxClient.IS_READONLY_PAGE||s.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t)))}),mxUtils.bind(this,function(t){this.isContainerEvent(t)&&(mxClient.IS_READONLY_PAGE||s.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t)))})),mxEvent.addListener(l,"dblclick",mxUtils.bind(this,function(t){this.isContainerEvent(t)&&s.dblClick(t)}));s.addMouseListener({mouseDown:function(t,e){s.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,function(t){t.offsetX<50&&(t.offsetX=50),t.offsetY<50&&(t.offsetY=50),null!=s.tooltipHandler&&s.tooltipHandler.isHideOnHover()&&s.tooltipHandler.hide(),this.captureDocumentGesture&&s.isMouseDown&&null!=s.container&&!this.isContainerEvent(t)&&"none"!=s.container.style.display&&"hidden"!=s.container.style.visibility&&!mxEvent.isConsumed(t)&&s.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,function(t){var e=null;if(mxClient.IS_TOUCH){var n=mxEvent.getClientX(t),i=mxEvent.getClientY(t),o=mxUtils.convertPoint(l,n,i);e=s.view.getState(s.getCellAt(o.x,o.y))}return e}(t)))}),this.endHandler=mxUtils.bind(this,function(t){this.captureDocumentGesture&&s.isMouseDown&&null!=s.container&&!this.isContainerEvent(t)&&"none"!=s.container.style.display&&"hidden"!=s.container.style.visibility&&s.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t))}),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}},mxGraphView.prototype.createHtml=function(){var t=this.graph.container;if(null!=t&&(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),t.appendChild(this.canvas),this.updateContainerStyle(t),mxClient.IS_QUIRKS)){var e=mxUtils.bind(this,function(t){var e=this.getGraphBounds(),n=e.x+e.width+this.graph.border,i=e.y+e.height+this.graph.border;this.updateHtmlCanvasSize(n,i)});mxEvent.addListener(window,"resize",e)}},mxGraphView.prototype.updateHtmlCanvasSize=function(t,e){if(null!=this.graph.container){var n=this.graph.container.offsetWidth,i=this.graph.container.offsetHeight;this.canvas.style.width=n<t?t+"px":"100%",this.canvas.style.height=i<e?e+"px":"100%"}},mxGraphView.prototype.createHtmlPane=function(t,e){var n=document.createElement("DIV");return null!=t&&null!=e?(n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style.width=t,n.style.height=e):n.style.position="relative",n},mxGraphView.prototype.createVml=function(){var t=this.graph.container;if(null!=t){var e=t.offsetWidth,n=t.offsetHeight;this.canvas=this.createVmlPane(e,n),this.canvas.style.overflow="hidden",this.backgroundPane=this.createVmlPane(e,n),this.drawPane=this.createVmlPane(e,n),this.overlayPane=this.createVmlPane(e,n),this.decoratorPane=this.createVmlPane(e,n),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),this.canvas.appendChild(this.decoratorPane),t.appendChild(this.canvas)}},mxGraphView.prototype.createVmlPane=function(t,e){var n=document.createElement(mxClient.VML_PREFIX+":group");return n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.style.width=t+"px",n.style.height=e+"px",n.setAttribute("coordsize",t+","+e),n.setAttribute("coordorigin","0,0"),n},mxGraphView.prototype.createSvg=function(){var t=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 e=document.createElementNS(mxConstants.NS_SVG,"svg");e.style.width="100%",e.style.height="100%",e.style.display="block",e.appendChild(this.canvas),(mxClient.IS_IE||mxClient.IS_IE11)&&(e.style.overflow="hidden"),null!=t&&(t.appendChild(e),this.updateContainerStyle(t))},mxGraphView.prototype.updateContainerStyle=function(t){var e=mxUtils.getCurrentStyle(t);null!=e&&"static"==e.position&&(t.style.position="relative"),mxClient.IS_POINTER&&(t.style.touchAction="auto")},mxGraphView.prototype.destroy=function(){var t=null!=this.canvas?this.canvas.ownerSVGElement:null;null==t&&(t=this.canvas),null!=t&&null!=t.parentNode&&(this.clear(this.currentRoot,!0),mxEvent.removeGestureListeners(document,null,this.moveHandler,this.endHandler),mxEvent.release(this.graph.container),t.parentNode.removeChild(t),this.moveHandler=null,this.endHandler=null,this.canvas=null,this.backgroundPane=null,this.drawPane=null,this.overlayPane=null,this.decoratorPane=null)},mxCurrentRootChange.prototype.execute=function(){var t=this.view.currentRoot;this.view.currentRoot=this.previous,this.previous=t;var e=this.view.graph.getTranslateForRoot(this.view.currentRoot);null!=e&&(this.view.translate=new mxPoint(-e.x,-e.y)),this.isUp?(this.view.clear(this.view.currentRoot,!0),this.view.validate()):this.view.refresh();var n=this.isUp?mxEvent.UP:mxEvent.DOWN;this.view.fireEvent(new mxEventObject(n,"root",this.view.currentRoot,"previous",this.previous)),this.isUp=!this.isUp},mxLoadResources?mxResources.add(mxClient.basePath+"/resources/graph"):mxClient.defaultBundles.push(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=!1,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=.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_WORKFLOW_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=!1,mxGraph.prototype.cellsResizable=!0,mxGraph.prototype.cellsBendable=!0,mxGraph.prototype.cellsSelectable=!0,mxGraph.prototype.cellsDisconnectable=!0,mxGraph.prototype.autoSizeCells=!1,mxGraph.prototype.autoSizeCellsOnAdd=!1,mxGraph.prototype.autoScroll=!0,mxGraph.prototype.ignoreScrollbars=!1,mxGraph.prototype.translateToScrollPosition=!1,mxGraph.prototype.timerAutoScroll=!1,mxGraph.prototype.allowAutoPanning=!1,mxGraph.prototype.autoExtend=!0,mxGraph.prototype.maximumGraphBounds=null,mxGraph.prototype.minimumGraphSize=null,mxGraph.prototype.minimumContainerSize=null,mxGraph.prototype.maximumContainerSize=null,mxGraph.prototype.resizeContainer=!1,mxGraph.prototype.border=0,mxGraph.prototype.keepEdgesInForeground=!1,mxGraph.prototype.keepEdgesInBackground=!1,mxGraph.prototype.allowNegativeCoordinates=!0,mxGraph.prototype.constrainChildren=!0,mxGraph.prototype.constrainRelativeChildren=!1,mxGraph.prototype.extendParents=!0,mxGraph.prototype.extendParentsOnAdd=!0,mxGraph.prototype.extendParentsOnMove=!1,mxGraph.prototype.recursiveResize=!1,mxGraph.prototype.collapseToPreferredSize=!0,mxGraph.prototype.zoomFactor=1.2,mxGraph.prototype.keepSelectionVisibleOnZoom=!1,mxGraph.prototype.centerZoom=!0,mxGraph.prototype.resetViewOnRootChange=!0,mxGraph.prototype.resetEdgesOnResize=!1,mxGraph.prototype.resetEdgesOnMove=!1,mxGraph.prototype.resetEdgesOnConnect=!0,mxGraph.prototype.allowLoops=!1,mxGraph.prototype.defaultLoopStyle=mxEdgeStyle.Loop,mxGraph.prototype.multigraph=!0,mxGraph.prototype.connectableEdges=!1,mxGraph.prototype.allowDanglingEdges=!0,mxGraph.prototype.cloneInvalidEdges=!1,mxGraph.prototype.disconnectOnMove=!0,mxGraph.prototype.labelsVisible=!0,mxGraph.prototype.htmlLabels=!1,mxGraph.prototype.swimlaneSelectionEnabled=!0,mxGraph.prototype.swimlaneNesting=!0,mxGraph.prototype.swimlaneIndicatorColorAttribute=mxConstants.STYLE_FILLCOLOR,mxGraph.prototype.imageBundles=null,mxGraph.prototype.minFitScale=.1,mxGraph.prototype.maxFitScale=8,mxGraph.prototype.panDx=0,mxGraph.prototype.panDy=0,mxGraph.prototype.collapsedImage=new mxImage(mxClient.imageBasePath+"/collapsed.gif",9,9),mxGraph.prototype.expandedImage=new mxImage(mxClient.imageBasePath+"/expanded.gif",9,9),mxGraph.prototype.warningImage=new mxImage(mxClient.imageBasePath+"/warning"+(mxClient.IS_MAC?".png":".gif"),16,16),mxGraph.prototype.alreadyConnectedResource="none"!=mxClient.language?"alreadyConnected":"",mxGraph.prototype.containsValidationErrorsResource="none"!=mxClient.language?"containsValidationErrors":"",mxGraph.prototype.collapseExpandResource="none"!=mxClient.language?"collapse-expand":"",mxGraph.prototype.init=function(t){this.container=t,this.cellEditor=this.createCellEditor(),this.view.init(),this.sizeDidChange(),mxEvent.addListener(t,"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(t,"selectstart",mxUtils.bind(this,function(t){return this.isEditing()||!this.isMouseDown&&!mxEvent.isShiftDown(t)}))),8==document.documentMode&&t.insertAdjacentHTML("beforeend","<"+mxClient.VML_PREFIX+':group style="DISPLAY: none;"></'+mxClient.VML_PREFIX+":group>")},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(t){this.stylesheet=t},mxGraph.prototype.getSelectionModel=function(){return this.selectionModel},mxGraph.prototype.setSelectionModel=function(t){this.selectionModel=t},mxGraph.prototype.getSelectionCellsForChanges=function(t){for(var e=[],n=0;n<t.length;n++){var i=t[n];if(i.constructor!=mxRootChange){var o=null;i instanceof mxChildChange&&null==i.previous?o=i.child:null!=i.cell&&i.cell instanceof mxCell&&(o=i.cell),null!=o&&mxUtils.indexOf(e,o)<0&&e.push(o)}}return this.getModel().getTopmostCells(e)},mxGraph.prototype.graphModelChanged=function(t,e){for(var n=0;n<t.length;n++)this.processChange(t[n]);this.removeSelectionCells(this.getRemovedCellsForChanges(t)),this.view.validate(),this.sizeDidChange(e)},mxGraph.prototype.getRemovedCellsForChanges=function(t){for(var e=[],n=0;n<t.length;n++){var i=t[n];if(i instanceof mxRootChange)break;i instanceof mxChildChange?null!=i.previous&&null==i.parent&&(e=e.concat(this.model.getDescendants(i.child))):i instanceof mxVisibleChange&&(e=e.concat(this.model.getDescendants(i.cell)))}return e},mxGraph.prototype.processChange=function(t){if(t instanceof mxRootChange)this.clearSelection(),this.setDefaultParent(null),this.removeStateForCell(t.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(t instanceof mxChildChange){var e=this.model.getParent(t.child);this.view.invalidate(t.child,!0,!0),null!=e&&!this.isCellCollapsed(e)||(this.view.invalidate(t.child,!0,!0),this.removeStateForCell(t.child),this.view.currentRoot==t.child&&this.home()),e!=t.previous&&(null!=e&&this.view.invalidate(e,!1,!1),null!=t.previous&&this.view.invalidate(t.previous,!1,!1))}else if(t instanceof mxTerminalChange||t instanceof mxGeometryChange)(t instanceof mxTerminalChange||null==t.previous&&null!=t.geometry||null!=t.previous&&!t.previous.equals(t.geometry))&&this.view.invalidate(t.cell);else if(t instanceof mxValueChange)this.view.invalidate(t.cell,!1,!1);else if(t instanceof mxStyleChange){this.view.invalidate(t.cell,!0,!0);var n=this.view.getState(t.cell);null!=n&&(n.style=null)}else null!=t.cell&&t.cell instanceof mxCell&&this.removeStateForCell(t.cell)},mxGraph.prototype.removeStateForCell=function(t){for(var e=this.model.getChildCount(t),n=0;n<e;n++)this.removeStateForCell(this.model.getChildAt(t,n));this.view.invalidate(t,!1,!0),this.view.removeState(t)},mxGraph.prototype.addCellOverlay=function(t,e){null==t.overlays&&(t.overlays=[]),t.overlays.push(e);var n=this.view.getState(t);return null!=n&&this.cellRenderer.redraw(n),this.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY,"cell",t,"overlay",e)),e},mxGraph.prototype.getCellOverlays=function(t){return t.overlays},mxGraph.prototype.removeCellOverlay=function(t,e){if(null==e)this.removeCellOverlays(t);else{var n=mxUtils.indexOf(t.overlays,e);if(0<=n){t.overlays.splice(n,1),0==t.overlays.length&&(t.overlays=null);var i=this.view.getState(t);null!=i&&this.cellRenderer.redraw(i),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",t,"overlay",e))}else e=null}return e},mxGraph.prototype.removeCellOverlays=function(t){var e=t.overlays;if(null!=e){t.overlays=null;var n=this.view.getState(t);null!=n&&this.cellRenderer.redraw(n);for(var i=0;i<e.length;i++)this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",t,"overlay",e[i]))}return e},mxGraph.prototype.clearCellOverlays=function(t){t=null!=t?t:this.model.getRoot(),this.removeCellOverlays(t);for(var e=this.model.getChildCount(t),n=0;n<e;n++){var i=this.model.getChildAt(t,n);this.clearCellOverlays(i)}},mxGraph.prototype.setCellWarning=function(n,t,e,i){if(null!=t&&0<t.length){var o=new mxCellOverlay(e=null!=e?e:this.warningImage,"<font color=red>"+t+"</font>");return i&&o.addListener(mxEvent.CLICK,mxUtils.bind(this,function(t,e){this.isEnabled()&&this.setSelectionCell(n)})),this.addCellOverlay(n,o)}return this.removeCellOverlays(n),null},mxGraph.prototype.startEditing=function(t){this.startEditingAtCell(null,t)},mxGraph.prototype.startEditingAtCell=function(t,e){null!=e&&mxEvent.isMultiTouchEvent(e)||(null==t&&(null==(t=this.getSelectionCell())||this.isCellEditable(t)||(t=null)),null!=t&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",t,"event",e)),this.cellEditor.startEditing(t,e),this.fireEvent(new mxEventObject(mxEvent.EDITING_STARTED,"cell",t,"event",e))))},mxGraph.prototype.getEditingValue=function(t,e){return this.convertValueToString(t)},mxGraph.prototype.stopEditing=function(t){this.cellEditor.stopEditing(t),this.fireEvent(new mxEventObject(mxEvent.EDITING_STOPPED,"cancel",t))},mxGraph.prototype.labelChanged=function(t,e,n){this.model.beginUpdate();try{var i=t.value;this.cellLabelChanged(t,e,this.isAutoSizeCell(t)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",t,"value",e,"old",i,"event",n))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellLabelChanged=function(t,e,n){this.model.beginUpdate();try{this.model.setValue(t,e),n&&this.cellSizeUpdated(t,!1)}finally{this.model.endUpdate()}},mxGraph.prototype.escape=function(t){this.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",t))},mxGraph.prototype.click=function(t){var e=t.getEvent(),n=t.getCell(),i=new mxEventObject(mxEvent.CLICK,"event",e,"cell",n);if(t.isConsumed()&&i.consume(),this.fireEvent(i),this.isEnabled()&&!mxEvent.isConsumed(e)&&!i.isConsumed())if(null!=n){if(this.isTransparentClickEvent(e)){var o=!1,s=this.getCellAt(t.graphX,t.graphY,null,null,null,mxUtils.bind(this,function(t){var e=this.isCellSelected(t.cell);return!(o=o||e)||e}));null!=s&&(n=s)}this.selectCellForEvent(n,e)}else{var l=null;this.isSwimlaneSelectionEnabled()&&(l=this.getSwimlaneAt(t.getGraphX(),t.getGraphY())),null!=l?this.selectCellForEvent(l,e):this.isToggleEvent(e)||this.clearSelection()}},mxGraph.prototype.dblClick=function(t,e){if(!workflowUi.wfEditor.wfTestIsIng){var n=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",t,"cell",e);this.fireEvent(n),!this.isEnabled()||mxEvent.isConsumed(t)||n.isConsumed()||null==e||!this.isCellEditable(e)||this.isEditing(e)||(this.startEditingAtCell(e,t),mxEvent.consume(t))}},mxGraph.prototype.tapAndHold=function(t){var e=t.getEvent(),n=new mxEventObject(mxEvent.TAP_AND_HOLD,"event",e,"cell",t.getCell());if(this.fireEvent(n),n.isConsumed()&&(this.panningHandler.panningTrigger=!1),this.isEnabled()&&!mxEvent.isConsumed(e)&&!n.isConsumed()&&this.connectionHandler.isEnabled()){var i=this.view.getState(this.connectionHandler.marker.getCell(t));null!=i&&(this.connectionHandler.marker.currentColor=this.connectionHandler.marker.validColor,this.connectionHandler.marker.markedState=i,this.connectionHandler.marker.mark(),this.connectionHandler.first=new mxPoint(t.getGraphX(),t.getGraphY()),this.connectionHandler.edgeState=this.connectionHandler.createEdgeState(t),this.connectionHandler.previous=i,this.connectionHandler.fireEvent(new mxEventObject(mxEvent.START,"state",this.connectionHandler.previous)))}},mxGraph.prototype.scrollPointToVisible=function(t,e,n,i){if(this.timerAutoScroll||!this.ignoreScrollbars&&!mxUtils.hasScrollbars(this.container))this.allowAutoPanning&&!this.panningHandler.isActive()&&(null==this.panningManager&&(this.panningManager=this.createPanningManager()),this.panningManager.panTo(t+this.panDx,e+this.panDy));else{var o=this.container;if(i=null!=i?i:20,t>=o.scrollLeft&&e>=o.scrollTop&&t<=o.scrollLeft+o.clientWidth&&e<=o.scrollTop+o.clientHeight){var s=o.scrollLeft+o.clientWidth-t;if(s<i){var l=o.scrollLeft;if(o.scrollLeft+=i-s,n&&l==o.scrollLeft){if(this.dialect==mxConstants.DIALECT_SVG){var r=this.view.getDrawPane().ownerSVGElement,a=this.container.scrollWidth+i-s;r.style.width=a+"px"}else{a=Math.max(o.clientWidth,o.scrollWidth)+i-s;this.view.getCanvas().style.width=a+"px"}o.scrollLeft+=i-s}}else(s=t-o.scrollLeft)<i&&(o.scrollLeft-=i-s);var h=o.scrollTop+o.clientHeight-e;if(h<i){l=o.scrollTop;if(o.scrollTop+=i-h,l==o.scrollTop&&n){if(this.dialect==mxConstants.DIALECT_SVG){r=this.view.getDrawPane().ownerSVGElement;var d=this.container.scrollHeight+i-h;r.style.height=d+"px"}else{d=Math.max(o.clientHeight,o.scrollHeight)+i-h;this.view.getCanvas().style.height=d+"px"}o.scrollTop+=i-h}}else(h=e-o.scrollTop)<i&&(o.scrollTop-=i-h)}}},mxGraph.prototype.createPanningManager=function(){return new mxPanningManager(this)},mxGraph.prototype.getBorderSizes=function(){var t=mxUtils.getCurrentStyle(this.container);return new mxRectangle(mxUtils.parseCssNumber(t.paddingLeft)+("none"!=t.borderLeftStyle?mxUtils.parseCssNumber(t.borderLeftWidth):0),mxUtils.parseCssNumber(t.paddingTop)+("none"!=t.borderTopStyle?mxUtils.parseCssNumber(t.borderTopWidth):0),mxUtils.parseCssNumber(t.paddingRight)+("none"!=t.borderRightStyle?mxUtils.parseCssNumber(t.borderRightWidth):0),mxUtils.parseCssNumber(t.paddingBottom)+("none"!=t.borderBottomStyle?mxUtils.parseCssNumber(t.borderBottomWidth):0))},mxGraph.prototype.getPreferredPageSize=function(t,e,n){this.view.scale;var i=this.view.translate,o=this.pageFormat,s=this.pageScale,l=new mxRectangle(0,0,Math.ceil(o.width*s),Math.ceil(o.height*s)),r=this.pageBreaksVisible?Math.ceil(e/l.width):1,a=this.pageBreaksVisible?Math.ceil(n/l.height):1;return new mxRectangle(0,0,r*l.width+2+i.x,a*l.height+2+i.y)},mxGraph.prototype.fit=function(t,e,n,i,o,s,l){if(null!=this.container){t=null!=t?t:this.getBorder(),e=null!=e&&e,n=null!=n?n:0,i=null==i||i,o=null!=o&&o,s=null!=s&&s;var r=this.getBorderSizes(),a=this.container.offsetWidth-r.x-r.width-1,h=null!=l?l:this.container.offsetHeight-r.y-r.height-1,d=this.view.getGraphBounds();if(0<d.width&&0<d.height){e&&null!=d.x&&null!=d.y&&((d=d.clone()).width+=d.x,d.height+=d.y,d.x=0,d.y=0);var u=this.view.scale,p=d.width/u,m=d.height/u;null!=this.backgroundImage&&(p=Math.max(p,this.backgroundImage.width-d.x/u),m=Math.max(m,this.backgroundImage.height-d.y/u));var c=(e?t:2*t)+n+1;a-=c,h-=c;var g=o?h/m:s?a/p:Math.min(a/p,h/m);if(null!=this.minFitScale&&(g=Math.max(g,this.minFitScale)),null!=this.maxFitScale&&(g=Math.min(g,this.maxFitScale)),!i)return g;if(e)this.view.scale!=g&&this.view.setScale(g);else if(mxUtils.hasScrollbars(this.container)){this.view.setScale(g);var x=this.getGraphBounds();null!=x.x&&(this.container.scrollLeft=x.x),null!=x.y&&(this.container.scrollTop=x.y)}else{var y=null!=d.x?Math.floor(this.view.translate.x-d.x/u+t/g+n/2):t,f=null!=d.y?Math.floor(this.view.translate.y-d.y/u+t/g+n/2):t;this.view.scaleAndTranslate(g,y,f)}}}return this.view.scale},mxGraph.prototype.sizeDidChange=function(t){var e=this.getGraphBounds();if(null!=this.container){var n=this.getBorder(),i=Math.max(0,e.x+e.width+2*n*this.view.scale),o=Math.max(0,e.y+e.height+2*n*this.view.scale);if(null!=this.minimumContainerSize&&(i=Math.max(i,this.minimumContainerSize.width),o=Math.max(o,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(i,o),this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var s=this.getPreferredPageSize(e,Math.max(1,i),Math.max(1,o));null!=s&&(i=s.width*this.view.scale,o=s.height*this.view.scale)}if(null!=this.minimumGraphSize&&(i=Math.max(i,this.minimumGraphSize.width*this.view.scale),o=Math.max(o,this.minimumGraphSize.height*this.view.scale)),i=Math.ceil(i),o=Math.ceil(o),this.dialect==mxConstants.DIALECT_SVG){var l=this.view.getDrawPane().ownerSVGElement;l.style.minWidth=Math.max(1,i)+"px",l.style.minHeight=Math.max(1,o)+"px",i>window.innerWidth?l.style.width=i+"px":l.style.width="100%",o>window.innerHeight?l.style.height=o+"px":l.style.height="100%",mxClient.IS_READONLY_PAGE&&mxClient.IS_FREE_WORKFLOW&&(l.style.minWidth="0px",l.style.minHeight="0px"),mxClient.IS_READONLY_PAGE&&(l.style.zIndex="2")}else mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,i),Math.max(1,o)):(this.view.canvas.style.minWidth=Math.max(1,i)+"px",this.view.canvas.style.minHeight=Math.max(1,o)+"px");this.updatePageBreaks(this.pageBreaksVisible,i,o)}!t&&workflowUi&&workflowUi.wfGroups&&workflowUi.wfGroups.refresh(!0),this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",e))},mxGraph.prototype.doResizeContainer=function(t,e){null!=this.maximumContainerSize&&(t=Math.min(this.maximumContainerSize.width,t),e=Math.min(this.maximumContainerSize.height,e)),this.container.style.width=Math.ceil(t)+"px",this.container.style.height=Math.ceil(e)+"px"},mxGraph.prototype.updatePageBreaks=function(t,e,n){var i=this.view.scale,o=this.view.translate,s=this.pageFormat,l=i*this.pageScale,r=new mxRectangle(0,0,s.width*l,s.height*l),a=mxRectangle.fromRectangle(this.getGraphBounds());a.width=Math.max(1,a.width),a.height=Math.max(1,a.height),r.x=Math.floor((a.x-o.x*i)/r.width)*r.width+o.x*i,r.y=Math.floor((a.y-o.y*i)/r.height)*r.height+o.y*i,a.width=Math.ceil((a.width+(a.x-r.x))/r.width)*r.width,a.height=Math.ceil((a.height+(a.y-r.y))/r.height)*r.height;var h=(t=t&&Math.min(r.width,r.height)>this.minPageBreakDist)?Math.ceil(a.height/r.height)+1:0,d=t?Math.ceil(a.width/r.width)+1:0,u=(d-1)*r.width,p=(h-1)*r.height;null==this.horizontalPageBreaks&&0<h&&(this.horizontalPageBreaks=[]),null==this.verticalPageBreaks&&0<d&&(this.verticalPageBreaks=[]);var m=mxUtils.bind(this,function(t){if(null!=t){for(var e=t==this.horizontalPageBreaks?h:d,n=0;n<=e;n++){var i=t==this.horizontalPageBreaks?[new mxPoint(Math.round(r.x),Math.round(r.y+n*r.height)),new mxPoint(Math.round(r.x+u),Math.round(r.y+n*r.height))]:[new mxPoint(Math.round(r.x+n*r.width),Math.round(r.y)),new mxPoint(Math.round(r.x+n*r.width),Math.round(r.y+p))];if(null!=t[n])t[n].points=i,t[n].redraw();else{var o=new mxPolyline(i,this.pageBreakColor);o.dialect=this.dialect,o.pointerEvents=!1,o.isDashed=this.pageBreakDashed,o.init(this.view.backgroundPane),o.redraw(),t[n]=o}}for(n=e;n<t.length;n++)t[n].destroy();t.splice(e,t.length-e)}});m(this.horizontalPageBreaks),m(this.verticalPageBreaks)},mxGraph.prototype.getCellStyle=function(t){var e=this.model.getStyle(t),n=null;return n=this.model.isEdge(t)?this.stylesheet.getDefaultEdgeStyle():this.stylesheet.getDefaultVertexStyle(),null!=e&&(n=this.postProcessCellStyle(this.stylesheet.getCellStyle(e,n))),null==n&&(n=mxGraph.prototype.EMPTY_ARRAY),n},mxGraph.prototype.postProcessCellStyle=function(t){if(null!=t){var e=t[mxConstants.STYLE_IMAGE],n=this.getImageFromBundles(e);if(null!=n?t[mxConstants.STYLE_IMAGE]=n:n=e,null!=n&&"data:image/"==n.substring(0,11)){if("data:image/svg+xml,<"==n.substring(0,20))n=n.substring(0,19)+encodeURIComponent(n.substring(19));else if("data:image/svg+xml,%3C"!=n.substring(0,22)){var i=n.indexOf(",");0<i&&";base64,"!=n.substring(i-7,i+1)&&(n=n.substring(0,i)+";base64,"+n.substring(i+1))}t[mxConstants.STYLE_IMAGE]=n}}return t},mxGraph.prototype.setCellStyle=function(t,e){if(null!=(e=e||this.getSelectionCells())){this.model.beginUpdate();try{for(var n=0;n<e.length;n++)this.model.setStyle(e[n],t)}finally{this.model.endUpdate()}}},mxGraph.prototype.toggleCellStyle=function(t,e,n){return n=n||this.getSelectionCell(),this.toggleCellStyles(t,e,[n])},mxGraph.prototype.toggleCellStyles=function(t,e,n){e=null!=e&&e;var i=null;if(null!=(n=n||this.getSelectionCells())&&0<n.length){var o=this.view.getState(n[0]),s=null!=o?o.style:this.getCellStyle(n[0]);null!=s&&(i=mxUtils.getValue(s,t,e)?0:1,this.setCellStyles(t,i,n))}return i},mxGraph.prototype.setCellStyles=function(t,e,n){n=n||this.getSelectionCells(),mxUtils.setCellStyles(this.model,n,t,e)},mxGraph.prototype.toggleCellStyleFlags=function(t,e,n){this.setCellStyleFlags(t,e,null,n)},mxGraph.prototype.setCellStyleFlags=function(t,e,n,i){if(null!=(i=i||this.getSelectionCells())&&0<i.length){if(null==n){var o=this.view.getState(i[0]),s=null!=o?o.style:this.getCellStyle(i[0]);if(null!=s)n=!((parseInt(s[t]||0)&e)==e)}mxUtils.setCellStyleFlags(this.model,i,t,e,n)}},mxGraph.prototype.alignCells_SameGaps=function(o,t,e){var s=this;if(null!=t&&2<t.length){t.sort(function(t,e){var n=s.view.getState(t),i=s.view.getState(e);if(null!=n&&!s.model.isEdge(t)&&null!=i&&!s.model.isEdge(e))return o==mxConstants.ALIGN_SAME_TOP_AND_BOTTOM?n.y-i.y:n.x-i.x});var n,i,l=0;n=s.view.getState(t[0]),i=s.view.getState(t[t.length-1]),l=o==mxConstants.ALIGN_SAME_TOP_AND_BOTTOM?(i.y-n.y)/(t.length-1):(i.x-n.x)/(t.length-1);var r=this.view.scale;this.model.beginUpdate();try{for(var a=0;a<t.length;a++){var h=this.view.getState(t[a]),d=t[a].edges||[];if(null!=h){var u=this.getCellGeometry(t[a]);if(null!=u&&!this.model.isEdge(t[a])){u=u.clone(),o==mxConstants.ALIGN_SAME_TOP_AND_BOTTOM?u.y=(n.y+l*a)/r:o==mxConstants.ALIGN_SAME_LEFT_AND_RIGHT&&(u.x=(n.x+l*a)/r);for(var p=0;p<d.length;++p){var m=this.getCellGeometry(d[p]);m.points=null,this.model.setGeometry(d[p],m)}this.resizeCell(t[a],u)}}}this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",o,"cells",t))}finally{this.model.endUpdate()}}},mxGraph.prototype.alignCells=function(t,e,n){if(null==e&&(e=this.getSelectionCells()),t==mxConstants.ALIGN_SAME_TOP_AND_BOTTOM||t==mxConstants.ALIGN_SAME_LEFT_AND_RIGHT){for(var i=[],o=0;o<e.length;o++)this.model.isEdge(e[o])||i.push(e[o]);this.alignCells_SameGaps(t,i)}if(null!=e&&1<e.length&&t!=mxConstants.ALIGN_SAME_TOP_AND_BOTTOM&&t!=mxConstants.ALIGN_SAME_LEFT_AND_RIGHT){if(null==n)for(o=0;o<e.length;o++){if(null!=(l=this.view.getState(e[o]))&&!this.model.isEdge(e[o]))if(null==n){if(t==mxConstants.ALIGN_CENTER){n=l.x+l.width/2;break}if(t==mxConstants.ALIGN_RIGHT)n=l.x+l.width;else if(t==mxConstants.ALIGN_TOP)n=l.y;else{if(t==mxConstants.ALIGN_MIDDLE){n=l.y+l.height/2;break}n=t==mxConstants.ALIGN_BOTTOM?l.y+l.height:l.x}}else n=t==mxConstants.ALIGN_RIGHT?Math.max(n,l.x+l.width):t==mxConstants.ALIGN_TOP?Math.min(n,l.y):t==mxConstants.ALIGN_BOTTOM?Math.max(n,l.y+l.height):Math.min(n,l.x)}if(null!=n){var s=this.view.scale;this.model.beginUpdate();try{for(o=0;o<e.length;o++){var l;if(null!=(l=this.view.getState(e[o]))){var r=this.getCellGeometry(e[o]);null==r||this.model.isEdge(e[o])||(r=r.clone(),t==mxConstants.ALIGN_CENTER?r.x+=(n-l.x-l.width/2)/s:t==mxConstants.ALIGN_RIGHT?r.x+=(n-l.x-l.width)/s:t==mxConstants.ALIGN_TOP?r.y+=(n-l.y)/s:t==mxConstants.ALIGN_MIDDLE?r.y+=(n-l.y-l.height/2)/s:t==mxConstants.ALIGN_BOTTOM?r.y+=(n-l.y-l.height)/s:r.x+=(n-l.x)/s,this.resizeCell(e[o],r))}}this.fireEvent(new mxEventObject(mxEvent.ALIGN_CELLS,"align",t,"cells",e))}finally{this.model.endUpdate()}}}return e},mxGraph.prototype.flipEdge=function(t){if(null!=t&&null!=this.alternateEdgeStyle){this.model.beginUpdate();try{var e=this.model.getStyle(t);null==e||0==e.length?this.model.setStyle(t,this.alternateEdgeStyle):this.model.setStyle(t,null),this.resetEdge(t),this.fireEvent(new mxEventObject(mxEvent.FLIP_EDGE,"edge",t))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.addImageBundle=function(t){this.imageBundles.push(t)},mxGraph.prototype.removeImageBundle=function(t){for(var e=[],n=0;n<this.imageBundles.length;n++)this.imageBundles[n]!=t&&e.push(this.imageBundles[n]);this.imageBundles=e},mxGraph.prototype.getImageFromBundles=function(t){if(null!=t)for(var e=0;e<this.imageBundles.length;e++){var n=this.imageBundles[e].getImage(t);if(null!=n)return n}return null},mxGraph.prototype.orderCells=function(t,e){null==e&&(e=mxUtils.sortCells(this.getSelectionCells(),!0)),this.model.beginUpdate();try{this.cellsOrdered(e,t),this.fireEvent(new mxEventObject(mxEvent.ORDER_CELLS,"back",t,"cells",e))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsOrdered=function(t,e){if(null!=t){this.model.beginUpdate();try{for(var n=0;n<t.length;n++){var i=this.model.getParent(t[n]);e?this.model.add(i,t[n],n):this.model.add(i,t[n],this.model.getChildCount(i)-1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ORDERED,"back",e,"cells",t))}finally{this.model.endUpdate()}}},mxGraph.prototype.groupCells=function(t,e,n){null==n&&(n=mxUtils.sortCells(this.getSelectionCells(),!0)),n=this.getCellsForGroup(n),null==t&&(t=this.createGroupCell(n));var i=this.getBoundsForGroup(t,n,e);if(0<n.length&&null!=i){var o=this.model.getParent(t);null==o&&(o=this.model.getParent(n[0])),this.model.beginUpdate();try{null==this.getCellGeometry(t)&&this.model.setGeometry(t,new mxGeometry);var s=this.model.getChildCount(o);this.cellsAdded([t],o,s,null,null,!1,!1,!1),s=this.model.getChildCount(t),this.cellsAdded(n,t,s,null,null,!1,!1,!1),this.cellsMoved(n,-i.x,-i.y,!1,!1,!1),this.cellsResized([t],[i],!1),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",t,"border",e,"cells",n))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.getCellsForGroup=function(t){var e=[];if(null!=t&&0<t.length){var n=this.model.getParent(t[0]);e.push(t[0]);for(var i=1;i<t.length;i++)this.model.getParent(t[i])==n&&e.push(t[i])}return e},mxGraph.prototype.getBoundsForGroup=function(t,e,n){var i=this.getBoundingBoxFromGeometry(e,!0);if(null!=i){if(this.isSwimlane(t)){var o=this.getStartSize(t);i.x-=o.width,i.y-=o.height,i.width+=o.width,i.height+=o.height}null!=n&&(i.x-=n,i.y-=n,i.width+=2*n,i.height+=2*n)}return i},mxGraph.prototype.createGroupCell=function(t){var e=new mxCell("");return e.setVertex(!0),e.setConnectable(!1),e},mxGraph.prototype.ungroupCells=function(t){var e=[];if(null==t){t=this.getSelectionCells();for(var n=[],i=0;i<t.length;i++)0<this.model.getChildCount(t[i])&&n.push(t[i]);t=n}if(null!=t&&0<t.length){this.model.beginUpdate();try{for(i=0;i<t.length;i++){var o=this.model.getChildren(t[i]);if(null!=o&&0<o.length){o=o.slice();var s=this.model.getParent(t[i]),l=this.model.getChildCount(s);this.cellsAdded(o,s,l,null,null,!0),e=e.concat(o)}}this.removeCellsAfterUngroup(t),this.fireEvent(new mxEventObject(mxEvent.UNGROUP_CELLS,"cells",t))}finally{this.model.endUpdate()}}return e},mxGraph.prototype.removeCellsAfterUngroup=function(t){this.cellsRemoved(this.addAllEdges(t))},mxGraph.prototype.removeCellsFromParent=function(t){null==t&&(t=this.getSelectionCells()),this.model.beginUpdate();try{var e=this.getDefaultParent(),n=this.model.getChildCount(e);this.cellsAdded(t,e,n,null,null,!0),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",t))}finally{this.model.endUpdate()}return t},mxGraph.prototype.updateGroupBounds=function(t,e,n,i,o,s,l){null==t&&(t=this.getSelectionCells()),e=null!=e?e:0,n=null!=n&&n,i=null!=i?i:0,o=null!=o?o:0,s=null!=s?s:0,l=null!=l?l:0,this.model.beginUpdate();try{for(var r=t.length-1;0<=r;r--){var a=this.getCellGeometry(t[r]);if(null!=a){var h=this.getChildCells(t[r]);if(null!=h&&0<h.length){var d=this.getBoundingBoxFromGeometry(h,!0);if(null!=d&&0<d.width&&0<d.height){var u=0,p=0;if(this.isSwimlane(t[r])){var m=this.getStartSize(t[r]);u=m.width,p=m.height}a=a.clone(),n&&(a.x=Math.round(a.x+d.x-e-u-l),a.y=Math.round(a.y+d.y-e-p-i)),a.width=Math.round(d.width+2*e+u+l+o),a.height=Math.round(d.height+2*e+p+i+s),this.model.setGeometry(t[r],a),this.moveCells(h,e+u-d.x+l,e+p-d.y+i)}}}}}finally{this.model.endUpdate()}return t},mxGraph.prototype.getBoundingBox=function(t){var e=null;if(null!=t&&0<t.length)for(var n=0;n<t.length;n++)if(this.model.isVertex(t[n])||this.model.isEdge(t[n])){var i=this.view.getBoundingBox(this.view.getState(t[n]),!0);null!=i&&(null==e?e=mxRectangle.fromRectangle(i):e.add(i))}return e},mxGraph.prototype.cloneCells=function(t,e,n){e=null==e||e;var i=null;if(null!=t){for(var o=new mxDictionary,s=[],l=0;l<t.length;l++)o.put(t[l],!0),s.push(t[l]);if(0<s.length){var r=this.view.scale,a=this.view.translate;i=this.model.cloneCells(t,!0,n);for(l=0;l<t.length;l++)if(!e&&this.model.isEdge(i[l])&&null!=this.getEdgeValidationError(i[l],this.model.getTerminal(i[l],!0),this.model.getTerminal(i[l],!1)))i[l]=null;else{var h=this.model.getGeometry(i[l]);if(null!=h){var d=this.view.getState(t[l]),u=this.view.getState(this.model.getParent(t[l]));if(null!=d&&null!=u){var p=u.origin.x,m=u.origin.y;if(this.model.isEdge(i[l])){for(var c=d.absolutePoints,g=this.model.getTerminal(t[l],!0);null!=g&&!o.get(g);)g=this.model.getParent(g);null==g&&h.setTerminalPoint(new mxPoint(c[0].x/r-a.x,c[0].y/r-a.y),!0);for(var x=this.model.getTerminal(t[l],!1);null!=x&&!o.get(x);)x=this.model.getParent(x);if(null==x){var y=c.length-1;h.setTerminalPoint(new mxPoint(c[y].x/r-a.x,c[y].y/r-a.y),!1)}var f=h.points;if(null!=f)for(var v=0;v<f.length;v++)f[v].x+=p,f[v].y+=m}else h.translate(p,m)}}}}else i=[]}return i},mxGraph.prototype.insertVertex=function(t,e,n,i,o,s,l,r,a){var h=this.createVertex(t,e,n,i,o,s,l,r,a);return this.addCell(h,t)},mxGraph.prototype.createVertex=function(t,e,n,i,o,s,l,r,a){var h=new mxGeometry(i,o,s,l);h.relative=null!=a&&a;var d=new mxCell(n,h,r);return d.setId(e),d.setVertex(!0),d.setConnectable(!0),d},mxGraph.prototype.insertEdge=function(t,e,n,i,o,s){var l=this.createEdge(t,e,n,i,o,s);return this.addEdge(l,t,i,o)},mxGraph.prototype.createEdge=function(t,e,n,i,o,s){var l=new mxCell(n,new mxGeometry,s);return l.setId(e),l.setEdge(!0),l.geometry.relative=!0,l},mxGraph.prototype.addEdge=function(t,e,n,i,o){return this.addCell(t,e,o,n,i)},mxGraph.prototype.addCell=function(t,e,n,i,o){return this.addCells([t],e,n,i,o)[0]},mxGraph.prototype.addCells=function(t,e,n,i,o){null==e&&(e=this.getDefaultParent()),null==n&&(n=this.model.getChildCount(e)),this.model.beginUpdate();try{this.cellsAdded(t,e,n,i,o,!1,!0),this.fireEvent(new mxEventObject(mxEvent.ADD_CELLS,"cells",t,"parent",e,"index",n,"source",i,"target",o))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsAdded=function(t,e,n,i,o,s,l,r){if(null!=t&&null!=e&&null!=n){this.model.beginUpdate();try{for(var a=s?this.view.getState(e):null,h=null!=a?a.origin:null,d=new mxPoint(0,0),u=0;u<t.length;u++)if(null==t[u])n--;else{var p=this.model.getParent(t[u]);if(null!=h&&t[u]!=e&&e!=p){var m=this.view.getState(p),c=null!=m?m.origin:d,g=this.model.getGeometry(t[u]);if(null!=g){var x=c.x-h.x,y=c.y-h.y;(g=g.clone()).translate(x,y),g.relative||!this.model.isVertex(t[u])||this.isAllowNegativeCoordinates()||(g.x=Math.max(0,g.x),g.y=Math.max(0,g.y)),this.model.setGeometry(t[u],g)}}e==p&&n+u>this.model.getChildCount(e)&&n--,this.model.add(e,t[u],n+u),this.autoSizeCellsOnAdd&&this.autoSizeCell(t[u],!0),(null==r||r)&&this.isExtendParentsOnAdd(t[u])&&this.isExtendParent(t[u])&&this.extendParent(t[u]),null!=l&&!l||this.constrainChild(t[u]),null!=i&&this.cellConnected(t[u],i,!0),null!=o&&this.cellConnected(t[u],o,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",t,"parent",e,"index",n,"source",i,"target",o,"absolute",s))}finally{this.model.endUpdate()}}},mxGraph.prototype.autoSizeCell=function(t,e){if(e=null==e||e)for(var n=this.model.getChildCount(t),i=0;i<n;i++)this.autoSizeCell(this.model.getChildAt(t,i));this.getModel().isVertex(t)&&this.isAutoSizeCell(t)&&this.updateCellSize(t)},mxGraph.prototype.removeCells=function(t,e){if(e=null==e||e,e=!0,null==t){t=this.getDeletableCells(this.getSelectionCells());for(var n=!1,i=0;i<t.length;++i)if(!t[i].edge){n=!0;break}n&&wfModal.confirm({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390401,"节点剪切后出口会改变,确定继续吗?"),okText:wfGetLabel(83446,"确定"),cancelText:wfGetLabel(31129,"取消"),onOk:function(){},onCancel:function(){workflowUi.actions.get("undo").funct()}})}e&&(t=this.getDeletableCells(this.addAllEdges(t))),this.model.beginUpdate();try{this.cellsRemoved(t),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS,"cells",t,"includeEdges",e))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsRemoved=function(u){if(null!=u&&0<u.length){var p=this.view.scale,m=this.view.translate;this.model.beginUpdate();try{for(var t=new mxDictionary,c=0;c<u.length;c++)t.put(u[c],!0);for(c=0;c<u.length;c++){for(var g=this.getAllEdges([u[c]]),e=mxUtils.bind(this,function(t,e){var n=this.model.getGeometry(t);if(null!=n){var i=this.view.getState(t);if(null!=i){for(var o=i.getVisibleTerminal(e),s=!1;null!=o;){if(u[c]==o){s=!0;break}o=this.model.getParent(o)}if(s){var l=m.x,r=m.y,a=this.view.getState(this.model.getParent(t));null!=a&&this.model.isVertex(a.cell)&&(l=a.x/p,r=a.y/p),n=n.clone();var h=i.absolutePoints,d=e?0:h.length-1;n.setTerminalPoint(new mxPoint(h[d].x/p-l,h[d].y/p-r),e),this.model.setTerminal(g[x],null,e),this.model.setGeometry(g[x],n)}}}}),x=0;x<g.length;x++)t.get(g[x])||(e(g[x],!0),e(g[x],!1));this.model.remove(u[c])}this.fireEvent(new mxEventObject(mxEvent.CELLS_REMOVED,"cells",u))}finally{this.model.endUpdate()}}},mxGraph.prototype.splitEdge=function(t,e,n,i,o){i=i||0,o=o||0;var s=this.model.getParent(t),l=this.model.getTerminal(t,!0);this.model.beginUpdate();try{if(null==n){n=this.cloneCells([t])[0];var r=this.view.getState(t),a=this.getCellGeometry(n);if(null!=a&&null!=a.points&&null!=r){var h=this.view.translate,d=this.view.scale,u=mxUtils.findNearestSegment(r,(i+h.x)*d,(o+h.y)*d);a.points=a.points.slice(0,u),null!=(a=this.getCellGeometry(t))&&null!=a.points&&((a=a.clone()).points=a.points.slice(u),this.model.setGeometry(t,a))}}this.cellsMoved(e,i,o,!1,!1),this.cellsAdded(e,s,this.model.getChildCount(s),null,null,!0),this.cellsAdded([n],s,this.model.getChildCount(s),l,e[0],!1),this.cellConnected(t,e[0],!0),this.fireEvent(new mxEventObject(mxEvent.SPLIT_EDGE,"edge",t,"cells",e,"newEdge",n,"dx",i,"dy",o))}finally{this.model.endUpdate()}return n},mxGraph.prototype.toggleCells=function(t,e,n){null==e&&(e=this.getSelectionCells()),n&&(e=this.addAllEdges(e)),this.model.beginUpdate();try{this.cellsToggled(e,t),this.fireEvent(new mxEventObject(mxEvent.TOGGLE_CELLS,"show",t,"cells",e,"includeEdges",n))}finally{this.model.endUpdate()}return e},mxGraph.prototype.cellsToggled=function(t,e){if(null!=t&&0<t.length){this.model.beginUpdate();try{for(var n=0;n<t.length;n++)this.model.setVisible(t[n],e)}finally{this.model.endUpdate()}}},mxGraph.prototype.foldCells=function(t,e,n,i,o){e=null!=e&&e,null==n&&(n=this.getFoldableCells(this.getSelectionCells(),t)),this.stopEditing(!1),this.model.beginUpdate();try{this.cellsFolded(n,t,e,i),this.fireEvent(new mxEventObject(mxEvent.FOLD_CELLS,"collapse",t,"recurse",e,"cells",n))}finally{this.model.endUpdate()}return n},mxGraph.prototype.cellsFolded=function(t,e,n,i){if(null!=t&&0<t.length){this.model.beginUpdate();try{for(var o=0;o<t.length;o++)if((!i||this.isCellFoldable(t[o],e))&&e!=this.isCellCollapsed(t[o])){if(this.model.setCollapsed(t[o],e),this.swapBounds(t[o],e),this.isExtendParent(t[o])&&this.extendParent(t[o]),n){var s=this.model.getChildren(t[o]);this.cellsFolded(s,e,n)}this.constrainChild(t[o])}this.fireEvent(new mxEventObject(mxEvent.CELLS_FOLDED,"cells",t,"collapse",e,"recurse",n))}finally{this.model.endUpdate()}}},mxGraph.prototype.swapBounds=function(t,e){if(null!=t){var n=this.model.getGeometry(t);null!=n&&(n=n.clone(),this.updateAlternateBounds(t,n,e),n.swap(),this.model.setGeometry(t,n))}},mxGraph.prototype.updateAlternateBounds=function(t,e,n){if(null!=t&&null!=e){var i=this.view.getState(t),o=null!=i?i.style:this.getCellStyle(t);if(null==e.alternateBounds){var s=e;if(this.collapseToPreferredSize){var l=this.getPreferredSizeForCell(t);if(null!=l){s=l;var r=mxUtils.getValue(o,mxConstants.STYLE_STARTSIZE);0<r&&(s.height=Math.max(s.height,r))}}e.alternateBounds=new mxRectangle(0,0,s.width,s.height)}if(null!=e.alternateBounds){e.alternateBounds.x=e.x,e.alternateBounds.y=e.y;var a=mxUtils.toRadians(o[mxConstants.STYLE_ROTATION]||0);if(0!=a){var h=e.alternateBounds.getCenterX()-e.getCenterX(),d=e.alternateBounds.getCenterY()-e.getCenterY(),u=Math.cos(a),p=Math.sin(a),m=u*h-p*d,c=p*h+u*d;e.alternateBounds.x+=m-h,e.alternateBounds.y+=c-d}}}},mxGraph.prototype.addAllEdges=function(t){var e=t.slice();return mxUtils.removeDuplicates(e.concat(this.getAllEdges(t)))},mxGraph.prototype.getAllEdges=function(t){var e=[];if(null!=t)for(var n=0;n<t.length;n++){for(var i=this.model.getEdgeCount(t[n]),o=0;o<i;o++)e.push(this.model.getEdgeAt(t[n],o));var s=this.model.getChildren(t[n]);e=e.concat(this.getAllEdges(s))}return e},mxGraph.prototype.updateCellSize=function(t,e){e=null!=e&&e,this.model.beginUpdate();try{this.cellSizeUpdated(t,e),this.fireEvent(new mxEventObject(mxEvent.UPDATE_CELL_SIZE,"cell",t,"ignoreChildren",e))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellSizeUpdated=function(t,e){if(null!=t){this.model.beginUpdate();try{var n=this.getPreferredSizeForCell(t),i=this.model.getGeometry(t);if(null!=n&&null!=i){var o=this.isCellCollapsed(t);if(i=i.clone(),this.isSwimlane(t)){var s=this.view.getState(t),l=null!=s?s.style:this.getCellStyle(t),r=this.model.getStyle(t);null==r&&(r=""),mxUtils.getValue(l,mxConstants.STYLE_HORIZONTAL,!0)?(r=mxUtils.setStyle(r,mxConstants.STYLE_STARTSIZE,n.height+8),o&&(i.height=n.height+8),i.width=n.width):(r=mxUtils.setStyle(r,mxConstants.STYLE_STARTSIZE,n.width+8),o&&(i.width=n.width+8),i.height=n.height),this.model.setStyle(t,r)}else i.width=n.width,i.height=n.height;if(!e&&!o){var a=this.view.getBounds(this.model.getChildren(t));if(null!=a){var h=this.view.translate,d=this.view.scale,u=(a.x+a.width)/d-i.x-h.x,p=(a.y+a.height)/d-i.y-h.y;i.width=Math.max(i.width,u),i.height=Math.max(i.height,p)}}this.cellsResized([t],[i],!1)}}finally{this.model.endUpdate()}}},mxGraph.prototype.getPreferredSizeForCell=function(t){var e=null;if(null!=t){var n=this.view.getState(t)||this.view.createState(t),i=n.style;if(!this.model.isEdge(t)){var o=i[mxConstants.STYLE_FONTSIZE]||mxConstants.DEFAULT_FONTSIZE,s=0,l=0;null==this.getImage(n)&&null==i[mxConstants.STYLE_IMAGE]||i[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_LABEL&&(i[mxConstants.STYLE_VERTICAL_ALIGN]==mxConstants.ALIGN_MIDDLE&&(s+=parseFloat(i[mxConstants.STYLE_IMAGE_WIDTH])||mxLabel.prototype.imageSize),i[mxConstants.STYLE_ALIGN]!=mxConstants.ALIGN_CENTER&&(l+=parseFloat(i[mxConstants.STYLE_IMAGE_HEIGHT])||mxLabel.prototype.imageSize)),s+=2*(i[mxConstants.STYLE_SPACING]||0),s+=i[mxConstants.STYLE_SPACING_LEFT]||0,s+=i[mxConstants.STYLE_SPACING_RIGHT]||0,l+=2*(i[mxConstants.STYLE_SPACING]||0),l+=i[mxConstants.STYLE_SPACING_TOP]||0,l+=i[mxConstants.STYLE_SPACING_BOTTOM]||0;var r=this.getFoldingImage(n);null!=r&&(s+=r.width+8);var a=this.cellRenderer.getLabelValue(n);if(null!=a&&0<a.length){this.isHtmlLabel(n.cell)||(a=mxUtils.htmlEntities(a)),a=a.replace(/\n/g,"<br>");var h=mxUtils.getSizeForString(a,o,i[mxConstants.STYLE_FONTFAMILY]),d=h.width+s,u=h.height+l;if(!mxUtils.getValue(i,mxConstants.STYLE_HORIZONTAL,!0)){var p=u;u=d,d=p}this.gridEnabled&&(d=this.snap(d+this.gridSize/2),u=this.snap(u+this.gridSize/2)),e=new mxRectangle(0,0,d,u)}else{var m=4*this.gridSize;e=new mxRectangle(0,0,m,m)}}}return e},mxGraph.prototype.resizeCell=function(t,e,n){return this.resizeCells([t],[e],n)[0]},mxGraph.prototype.resizeCells=function(t,e,n){n=null!=n?n:this.isRecursiveResize(),this.model.beginUpdate();try{this.cellsResized(t,e,n),this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",t,"bounds",e))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsResized=function(t,e,n){if(n=null!=n&&n,null!=t&&null!=e&&t.length==e.length){this.model.beginUpdate();try{for(var i=0;i<t.length;i++)this.cellResized(t[i],e[i],!1,n),this.isExtendParent(t[i])&&this.extendParent(t[i]),this.constrainChild(t[i]);this.resetEdgesOnResize&&this.resetEdges(t),this.fireEvent(new mxEventObject(mxEvent.CELLS_RESIZED,"cells",t,"bounds",e))}finally{this.model.endUpdate()}}},mxGraph.prototype.cellResized=function(t,e,n,i){var o=this.model.getGeometry(t);if(null!=o&&(o.x!=e.x||o.y!=e.y||o.width!=e.width||o.height!=e.height)){if(o=o.clone(),!n&&o.relative){var s=o.offset;null!=s&&(s.x+=e.x-o.x,s.y+=e.y-o.y)}else o.x=e.x,o.y=e.y;o.width=e.width,o.height=e.height,o.relative||!this.model.isVertex(t)||this.isAllowNegativeCoordinates()||(o.x=Math.max(0,o.x),o.y=Math.max(0,o.y)),this.model.beginUpdate();try{i&&this.resizeChildCells(t,o),this.model.setGeometry(t,o),this.constrainChildCells(t)}finally{this.model.endUpdate()}}},mxGraph.prototype.resizeChildCells=function(t,e){for(var n=this.model.getGeometry(t),i=e.width/n.width,o=e.height/n.height,s=this.model.getChildCount(t),l=0;l<s;l++)this.scaleCell(this.model.getChildAt(t,l),i,o,!0)},mxGraph.prototype.constrainChildCells=function(t){for(var e=this.model.getChildCount(t),n=0;n<e;n++)this.constrainChild(this.model.getChildAt(t,n))},mxGraph.prototype.scaleCell=function(t,e,n,i){var o=this.model.getGeometry(t);if(null!=o){var s=this.view.getState(t),l=null!=s?s.style:this.getCellStyle(t),r=(o=o.clone()).x,a=o.y,h=o.width,d=o.height;o.scale(e,n,"fixed"==l[mxConstants.STYLE_ASPECT]),"1"==l[mxConstants.STYLE_RESIZE_WIDTH]?o.width=h*e:"0"==l[mxConstants.STYLE_RESIZE_WIDTH]&&(o.width=h),"1"==l[mxConstants.STYLE_RESIZE_HEIGHT]?o.height=d*n:"0"==l[mxConstants.STYLE_RESIZE_HEIGHT]&&(o.height=d),this.isCellMovable(t)||(o.x=r,o.y=a),this.isCellResizable(t)||(o.width=h,o.height=d),this.model.isVertex(t)?this.cellResized(t,o,!0,i):this.model.setGeometry(t,o)}},mxGraph.prototype.extendParent=function(t){if(null!=t){var e=this.model.getParent(t),n=this.getCellGeometry(e);if(null!=e&&null!=n&&!this.isCellCollapsed(e)){var i=this.getCellGeometry(t);null!=i&&!i.relative&&(n.width<i.x+i.width||n.height<i.y+i.height)&&((n=n.clone()).width=Math.max(n.width,i.x+i.width),n.height=Math.max(n.height,i.y+i.height),this.cellsResized([e],[n],!1))}}},mxGraph.prototype.importCells=function(t,e,n,i,o,s){return this.moveCells(t,e,n,!0,i,o,s)},mxGraph.prototype.moveCells=function(t,e,n,i,o,s,l){if(this.view.isFromScaleChanged=!1,e=null!=e?e:0,n=null!=n?n:0,i=null!=i&&i,null!=t&&(0!=e||0!=n||i||null!=o)){t=this.model.getTopmostCells(t),this.model.beginUpdate();try{for(var r=new mxDictionary,a=0;a<t.length;a++)r.put(t[a],!0);var h=mxUtils.bind(this,function(t){for(;null!=t;){if(r.get(t))return!0;t=this.model.getParent(t)}return!1}),d=[];for(a=0;a<t.length;a++){var u=this.getCellGeometry(t[a]),p=this.model.getParent(t[a]);if(null!=u&&u.relative&&this.model.isEdge(p)&&(h(this.model.getTerminal(p,!0))||h(this.model.getTerminal(p,!1)))||d.push(t[a]),t[a].edge&&null!=u.points)for(var m=0;m<u.points.length;++m)t[a].doNotClearAbsPoints=!0,u.points[m].x+=e,u.points[m].y+=n;if(!t[a].edge){var c=t[a].edges||[];for(m=0;m<c.length;++m)c[m].doNotClearAbsPoints=!1}}t=d,i&&(t=this.cloneCells(t,this.isCloneInvalidEdges(),l),null==o&&(o=this.getDefaultParent()));var g=this.isAllowNegativeCoordinates();if(null!=o&&this.setAllowNegativeCoordinates(!0),this.cellsMoved(t,e,n,!i&&this.isDisconnectOnMove()&&this.isAllowDanglingEdges(),null==o,this.isExtendParentsOnMove()&&null==o),this.setAllowNegativeCoordinates(g),null!=o){var x=this.model.getChildCount(o);this.cellsAdded(t,o,x,null,null,!0)}this.fireEvent(new mxEventObject(mxEvent.MOVE_CELLS,"cells",t,"dx",e,"dy",n,"clone",i,"target",o,"event",s))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.cellsMoved=function(t,e,n,i,o,s){if(null!=t&&(0!=e||0!=n)){s=null!=s&&s,this.model.beginUpdate();try{for(var l=0;l<t.length;l++)-1!=t[l].style.indexOf("entryX")||-1!=t[l].style.indexOf("exitX")?!0:(this.translateCell(t[l],e,n),s&&this.isExtendParent(t[l])?this.extendParent(t[l]):o&&this.constrainChild(t[l]));this.resetEdgesOnMove&&this.resetEdges(t),this.fireEvent(new mxEventObject(mxEvent.CELLS_MOVED,"cells",t,"dx",e,"dy",n,"disconnect",i))}finally{this.model.endUpdate()}}},mxGraph.prototype.translateCell=function(t,e,n){var i=this.model.getGeometry(t);if(null!=i){if(e=parseFloat(e),n=parseFloat(n),(i=i.clone()).translate(e,n),i.relative||!this.model.isVertex(t)||this.isAllowNegativeCoordinates()||(i.x=Math.max(0,parseFloat(i.x)),i.y=Math.max(0,parseFloat(i.y))),i.relative&&!this.model.isEdge(t)){var o=this.model.getParent(t),s=0;if(this.model.isVertex(o)){var l=this.view.getState(o),r=null!=l?l.style:this.getCellStyle(o);s=mxUtils.getValue(r,mxConstants.STYLE_ROTATION,0)}if(0!=s){var a=mxUtils.toRadians(-s),h=Math.cos(a),d=Math.sin(a),u=mxUtils.getRotatedPoint(new mxPoint(e,n),h,d,new mxPoint(0,0));e=u.x,n=u.y}null==i.offset?i.offset=new mxPoint(e,n):(i.offset.x=parseFloat(i.offset.x)+e,i.offset.y=parseFloat(i.offset.y)+n)}this.model.setGeometry(t,i)}},mxGraph.prototype.getCellContainmentArea=function(t){if(null!=t&&!this.model.isEdge(t)){var e=this.model.getParent(t);if(null!=e&&e!=this.getDefaultParent()){var n=this.model.getGeometry(e);if(null!=n){var i=0,o=0,s=n.width,l=n.height;if(this.isSwimlane(e)){var r=this.getStartSize(e),a=this.view.getState(e),h=null!=a?a.style:this.getCellStyle(e),d=mxUtils.getValue(h,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),u=1==mxUtils.getValue(h,mxConstants.STYLE_FLIPH,0),p=1==mxUtils.getValue(h,mxConstants.STYLE_FLIPV,0);if(d==mxConstants.DIRECTION_SOUTH||d==mxConstants.DIRECTION_NORTH){var m=r.width;r.width=r.height,r.height=m}(d==mxConstants.DIRECTION_EAST&&!p||d==mxConstants.DIRECTION_NORTH&&!u||d==mxConstants.DIRECTION_WEST&&p||d==mxConstants.DIRECTION_SOUTH&&u)&&(i=r.width,o=r.height),s-=r.width,l-=r.height}return new mxRectangle(i,o,s,l)}}}return null},mxGraph.prototype.getMaximumGraphBounds=function(){return this.maximumGraphBounds},mxGraph.prototype.constrainChild=function(t,e){if(e=null==e||e,null!=t){var n=this.getCellGeometry(t);if(null!=n&&(this.isConstrainRelativeChildren()||!n.relative)){var i=this.model.getParent(t),o=(this.getCellGeometry(i),this.getMaximumGraphBounds());if(null!=o){var s=this.getBoundingBoxFromGeometry([i],!1);null!=s&&((o=mxRectangle.fromRectangle(o)).x-=s.x,o.y-=s.y)}if(this.isConstrainChild(t)){var l=this.getCellContainmentArea(t);if(null!=l){var r=this.getOverlap(t);0<r&&((l=mxRectangle.fromRectangle(l)).x-=l.width*r,l.y-=l.height*r,l.width+=2*l.width*r,l.height+=2*l.height*r),null==o?o=l:(o=mxRectangle.fromRectangle(o)).intersect(l)}}if(null!=o){var a=[t];if(!this.isCellCollapsed(t))for(var h=this.model.getDescendants(t),d=0;d<h.length;d++)this.isCellVisible(h[d])&&a.push(h[d]);var u=this.getBoundingBoxFromGeometry(a,!1);if(null!=u){var p=0;(n=n.clone()).width>o.width&&(p=n.width-o.width,n.width-=p),u.x+u.width>o.x+o.width&&(p-=u.x+u.width-o.x-o.width-p);var m=0;n.height>o.height&&(m=n.height-o.height,n.height-=m),u.y+u.height>o.y+o.height&&(m-=u.y+u.height-o.y-o.height-m),u.x<o.x&&(p-=u.x-o.x),u.y<o.y&&(m-=u.y-o.y),0==p&&0==m||(n.relative?(null==n.offset&&(n.offset=new mxPoint),n.offset.x+=p,n.offset.y+=m):(n.x+=p,n.y+=m)),this.model.setGeometry(t,n)}}}}},mxGraph.prototype.resetEdges=function(t){if(null!=t){for(var e=new mxDictionary,n=0;n<t.length;n++)e.put(t[n],!0);this.model.beginUpdate();try{for(n=0;n<t.length;n++){var i=this.model.getEdges(t[n]);if(null!=i)for(var o=0;o<i.length;o++){var s=this.view.getState(i[o]),l=null!=s?s.getVisibleTerminal(!0):this.view.getVisibleTerminal(i[o],!0),r=null!=s?s.getVisibleTerminal(!1):this.view.getVisibleTerminal(i[o],!1);e.get(l)&&e.get(r)||this.resetEdge(i[o])}this.resetEdges(this.model.getChildren(t[n]))}}finally{this.model.endUpdate()}}},mxGraph.prototype.resetEdge=function(t){var e=this.model.getGeometry(t);return null!=e&&null!=e.points&&0<e.points.length&&((e=e.clone()).points=[],this.model.setGeometry(t,e)),t},mxGraph.prototype.getOutlineConstraint=function(t,e,n){if(null==e.shape)return null;var i=this.view.getPerimeterBounds(e),o=e.style[mxConstants.STYLE_DIRECTION];if(o==mxConstants.DIRECTION_NORTH||o==mxConstants.DIRECTION_SOUTH){i.x+=i.width/2-i.height/2,i.y+=i.height/2-i.width/2;var s=i.width;i.width=i.height,i.height=s}var l=mxUtils.toRadians(e.shape.getShapeRotation());if(0!=l){var r=Math.cos(-l),a=Math.sin(-l),h=new mxPoint(i.getCenterX(),i.getCenterY());t=mxUtils.getRotatedPoint(t,r,a,h)}var d=1,u=1,p=0,m=0;if(this.getModel().isVertex(e.cell)){var c=e.style[mxConstants.STYLE_FLIPH],g=e.style[mxConstants.STYLE_FLIPV];if(null!=e.shape&&null!=e.shape.stencil&&(c=1==mxUtils.getValue(e.style,"stencilFlipH",0)||c,g=1==mxUtils.getValue(e.style,"stencilFlipV",0)||g),o==mxConstants.DIRECTION_NORTH||o==mxConstants.DIRECTION_SOUTH){s=c;c=g,g=s}c&&(d=-1,p=-i.width),g&&(u=-1,m=-i.height)}return t=new mxPoint((t.x-i.x)*d-p+i.x,(t.y-i.y)*u-m+i.y),new mxConnectionConstraint(new mxPoint(Math.round(1e3*(t.x-i.x)/i.width)/1e3,Math.round(1e3*(t.y-i.y)/i.height)/1e3),!1)},mxGraph.prototype.getAllConnectionConstraints=function(t,e){return null!=t&&null!=t.shape&&null!=t.shape.stencil?t.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(t,e,n){var i=null,o=t.style[n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];t.style[n?mxConstants.STYLE_ENTRY_X:mxConstants.STYLE_EXIT_X];if(null!=o){var s=t.style[n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];t.style[n?mxConstants.STYLE_ENTRY_Y:mxConstants.STYLE_EXIT_Y];null!=s&&(i=new mxPoint(parseFloat(o),parseFloat(s)))}var l=!1;return null!=i&&(l=mxUtils.getValue(t.style,n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0)),new mxConnectionConstraint(i,l)},mxGraph.prototype.setCellEdgesConstraintUtil=function(t,o,e,n){var i=o.edges,s=1,l=n.x,r=n.y,a=[];if(i&&2<=i.length)for(var h=0;h<i.length;++h){var d=this.view.getState(i[h]);t.id!=i[h].id&&(i[h].source.id==o.id?(0==l?0==d.style.exitX&&(s++,a.push(i[h])):1==l&&1==d.style.exitX&&(s++,a.push(i[h])),0==r?0==d.style.exitY&&(s++,a.push(i[h])):1==r&&1==d.style.exitY&&(s++,a.push(i[h]))):(0==l?0==d.style.entryX&&(s++,a.push(i[h])):1==l&&1==d.style.entryX&&(s++,a.push(i[h])),0==r?0==d.style.entryY&&(s++,a.push(i[h])):1==r&&1==d.style.entryY&&(s++,a.push(i[h]))))}if(1<s){var u,p;u=(p=(10-s+1)/2/10)+.1,u=p,a.push(t);var m=a.slice();0==n.x||1==n.x?m.sort(function(t,e){var n,i;return n=t.source.id==o.id?t.target:t.source,i=e.source.id==o.id?e.target:e.source,n.geometry.y-i.geometry.y}):0!=n.y&&1!=n.y||m.sort(function(t,e){var n,i;return n=t.source.id==o.id?t.target:t.source,i=e.source.id==o.id?e.target:e.source,n.geometry.x-i.geometry.x}),a=m.slice();for(h=0;h<a.length;++h)a[h].id!=t.id?a[h].source.id==o.id?0==n.x||1==n.x?(this.setCellStyles("exitY",u,[a[h]]),u+=.1,a[h].isStartConnect=!0):0!=n.y&&1!=n.y||(this.setCellStyles("exitX",u,[a[h]]),u+=.1,a[h].isStartConnect=!0):0==n.x||1==n.x?(this.setCellStyles("entryY",u,[a[h]]),u+=.1,a[h].isStartConnect=!0):0!=n.y&&1!=n.y||(this.setCellStyles("entryX",u,[a[h]]),u+=.1,a[h].isStartConnect=!0):(p=u,u+=.1);0==n.x||1==n.x?r=p:l=p}else 0==l||1==l?r=.5:0!=r&&1!=r||(l=.5);return{x:l,y:r}},mxGraph.prototype.translateConstraintUtil=function(t,e,n,i){if(!(e.style.indexOf("ellipse;")<0&&e.style.indexOf("rhombus;")<0)&&0!=i.x&&1!=i.x&&0!=i.y&&1!=i.y){var o,s;s=n?t.target:t.source;t.target;var l=Math.abs(s.geometry.x-e.geometry.x),r=Math.abs(s.geometry.y-e.geometry.y);o=s.geometry.x>e.geometry.x?0<l-r?"right":s.geometry.y>e.geometry.y?"down":"up":0<l-r?"left":s.geometry.y>e.geometry.y?"down":"up",i.x<.5&&i.y<.5?"left"==o||"right"==o?i.x=0:i.y=0:i.x<.5&&.5<i.y&&i.y<1?"left"==o||"right"==o?i.x=0:i.y=1:.5<i.x&&i.x<1&&i.y<.5?"left"==o||"right"==o?i.x=1:i.y=0:.5<i.x&&i.x<1&&.5<i.y&&i.y<1&&("left"==o||"right"==o?i.x=1:i.y=1)}},mxGraph.prototype.setConnectionConstraint=function(t,e,n,i){if(null!=i&&null==i.point&&e){var o=this.lastEvent.layerX,s=this.lastEvent.layerY,l=e.geometry.x,r=e.geometry.y,a=e.geometry.width,h=e.geometry.height;i.point=new mxPoint((o-l)/a,(s-r)/h)}if(null!=i&&i.point){var d=i.point.x<0?0:1<i.point.x?1:i.point.x,u=i.point.y<0?0:1<i.point.y?1:i.point.y,p={};if(0!=d&&1!=d&&0!=u&&1!=u){(Math.abs(d-0)<Math.abs(d-1)?Math.abs(d-0):Math.abs(d-1))<(Math.abs(u-0)<Math.abs(u-1)?Math.abs(u-0):Math.abs(u-1))?d=Math.abs(d-0)<Math.abs(d-1)?0:1:u=Math.abs(u-0)<Math.abs(u-1)?0:1,p.perimeter=!0}p.perimeter=!0,p.point={x:d,y:u},this.translateConstraintUtil(t,e,n,p.point);var m=this.setCellEdgesConstraintUtil(t,e,n,p.point);d=t.linkId?p.point.x:m.x,u=t.linkId?p.point.y:m.y,this.model.beginUpdate();try{null==p||null==p.point?(this.setCellStyles(n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t])):null!=p.point&&(this.setCellStyles(n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,d,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,u,[t]),i.perimeter?this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t]):this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[t]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(t,e){var n=null;if(null!=t&&null!=e.point){var i=this.view.getPerimeterBounds(t),o=new mxPoint(i.getCenterX(),i.getCenterY()),s=t.style[mxConstants.STYLE_DIRECTION],l=0;null!=s&&1==mxUtils.getValue(t.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(s==mxConstants.DIRECTION_NORTH?l+=270:s==mxConstants.DIRECTION_WEST?l+=180:s==mxConstants.DIRECTION_SOUTH&&(l+=90),s!=mxConstants.DIRECTION_NORTH&&s!=mxConstants.DIRECTION_SOUTH||i.rotate90()),n=new mxPoint(i.x+e.point.x*i.width,i.y+e.point.y*i.height);var r=t.style[mxConstants.STYLE_ROTATION]||0;if(e.perimeter){if(0!=l){var a=0,h=0;90==l?h=1:180==l?a=-1:270==l&&(h=-1),n=mxUtils.getRotatedPoint(n,a,h,o)}}else if(r+=l,this.getModel().isVertex(t.cell)){var d=1==t.style[mxConstants.STYLE_FLIPH],u=1==t.style[mxConstants.STYLE_FLIPV];null!=t.shape&&null!=t.shape.stencil&&(d=1==mxUtils.getValue(t.style,"stencilFlipH",0)||d,u=1==mxUtils.getValue(t.style,"stencilFlipV",0)||u),d&&(n.x=2*i.getCenterX()-n.x),u&&(n.y=2*i.getCenterY()-n.y)}if(0!=r&&null!=n){var p=mxUtils.toRadians(r);a=Math.cos(p),h=Math.sin(p);n=mxUtils.getRotatedPoint(n,a,h,o)}}return null!=n&&(n.x=Math.round(n.x),n.y=Math.round(n.y)),n},mxGraph.prototype.connectCell=function(t,e,n,i){this.model.beginUpdate();try{var o=this.model.getTerminal(t,n);this.cellConnected(t,e,n,i),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",t,"terminal",e,"source",n,"previous",o))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellConnected=function(t,e,n,i){if(null!=t){this.model.beginUpdate();try{var o=this.model.getTerminal(t,n);if(this.setConnectionConstraint(t,e,n,i),this.isPortsEnabled()){var s=null;this.isPort(e)&&(s=e.getId(),e=this.getTerminalForPort(e,n));var l=n?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT;this.setCellStyles(l,s,[t])}this.model.setTerminal(t,e,n),this.resetEdgesOnConnect&&this.resetEdge(t),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",t,"terminal",e,"source",n,"previous",o))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(t){if(null!=t){this.model.beginUpdate();try{for(var e=this.view.scale,n=this.view.translate,i=new mxDictionary,o=0;o<t.length;o++)i.put(t[o],!0);for(o=0;o<t.length;o++)if(this.model.isEdge(t[o])){var s=this.model.getGeometry(t[o]);if(null!=s){var l=this.view.getState(t[o]),r=this.view.getState(this.model.getParent(t[o]));if(null!=l&&null!=r){s=s.clone();var a=-r.origin.x,h=-r.origin.y,d=l.absolutePoints,u=this.model.getTerminal(t[o],!0);if(null!=u&&this.isCellDisconnectable(t[o],u,!0)){for(;null!=u&&!i.get(u);)u=this.model.getParent(u);null==u&&(s.setTerminalPoint(new mxPoint(d[0].x/e-n.x+a,d[0].y/e-n.y+h),!0),this.model.setTerminal(t[o],null,!0))}var p=this.model.getTerminal(t[o],!1);if(null!=p&&this.isCellDisconnectable(t[o],p,!1)){for(;null!=p&&!i.get(p);)p=this.model.getParent(p);if(null==p){var m=d.length-1;s.setTerminalPoint(new mxPoint(d[m].x/e-n.x+a,d[m].y/e-n.y+h),!1),this.model.setTerminal(t[o],null,!1)}}this.model.setGeometry(t[o],s)}}}}finally{this.model.endUpdate()}}},mxGraph.prototype.getCurrentRoot=function(){return this.view.currentRoot},mxGraph.prototype.getTranslateForRoot=function(t){return null},mxGraph.prototype.isPort=function(t){return!1},mxGraph.prototype.getTerminalForPort=function(t,e){return this.model.getParent(t)},mxGraph.prototype.getChildOffsetForCell=function(t){return null},mxGraph.prototype.enterGroup=function(t){null!=(t=t||this.getSelectionCell())&&this.isValidRoot(t)&&(this.view.setCurrentRoot(t),this.clearSelection())},mxGraph.prototype.exitGroup=function(){var t=this.model.getRoot(),e=this.getCurrentRoot();if(null!=e){for(var n=this.model.getParent(e);n!=t&&!this.isValidRoot(n)&&this.model.getParent(n)!=t;)n=this.model.getParent(n);n==t||this.model.getParent(n)==t?this.view.setCurrentRoot(null):this.view.setCurrentRoot(n),null!=this.view.getState(e)&&this.setSelectionCell(e)}},mxGraph.prototype.home=function(){var t=this.getCurrentRoot();null!=t&&(this.view.setCurrentRoot(null),null!=this.view.getState(t)&&this.setSelectionCell(t))},mxGraph.prototype.isValidRoot=function(t){return null!=t},mxGraph.prototype.getGraphBounds=function(){return this.view.getGraphBounds()},mxGraph.prototype.getCellBounds=function(t,e,n){var i=[t];e&&(i=i.concat(this.model.getEdges(t)));var o=this.view.getBounds(i);if(n)for(var s=this.model.getChildCount(t),l=0;l<s;l++){var r=this.getCellBounds(this.model.getChildAt(t,l),e,!0);null!=o?o.add(r):o=r}return o},mxGraph.prototype.getBoundingBoxFromGeometry=function(t,e){e=null!=e&&e;var n=null;if(null!=t)for(var i=0;i<t.length;i++)if(e||this.model.isVertex(t[i])){var o=this.getCellGeometry(t[i]);if(null!=o){var s=null;if(this.model.isEdge(t[i])){function l(t){null!=t&&(null==a?a=new mxRectangle(t.x,t.y,0,0):a.add(new mxRectangle(t.x,t.y,0,0)))}null==this.model.getTerminal(t[i],!0)&&l(o.getTerminalPoint(!0)),null==this.model.getTerminal(t[i],!1)&&l(o.getTerminalPoint(!1));var r=o.points;if(null!=r&&0<r.length)for(var a=new mxRectangle(r[0].x,r[0].y,0,0),h=1;h<r.length;h++)l(r[h]);s=a}else{var d=this.model.getParent(t[i]);if(o.relative){if(this.model.isVertex(d)&&d!=this.view.currentRoot)null!=(a=this.getBoundingBoxFromGeometry([d],!1))&&(s=new mxRectangle(o.x*a.width,o.y*a.height,o.width,o.height),0<=mxUtils.indexOf(t,d)&&(s.x+=a.x,s.y+=a.y))}else if(s=mxRectangle.fromRectangle(o),this.model.isVertex(d)&&0<=mxUtils.indexOf(t,d))null!=(a=this.getBoundingBoxFromGeometry([d],!1))&&(s.x+=a.x,s.y+=a.y);null!=s&&null!=o.offset&&(s.x+=o.offset.x,s.y+=o.offset.y)}null!=s&&(null==n?n=mxRectangle.fromRectangle(s):n.add(s))}}return n},mxGraph.prototype.refresh=function(t){this.view.clear(t,null==t),this.view.validate(),this.sizeDidChange(),this.fireEvent(new mxEventObject(mxEvent.REFRESH))},mxGraph.prototype.snap=function(t){return this.gridEnabled&&(t=Math.round(t/this.gridSize)*this.gridSize),t},mxGraph.prototype.panGraph=function(t,e){if(this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container))this.container.scrollLeft=-t,this.container.scrollTop=-e;else{var n=this.view.getCanvas();if(this.dialect==mxConstants.DIALECT_SVG)if(0==t&&0==e){if(mxClient.IS_IE?n.setAttribute("transform","translate("+t+","+e+")"):n.removeAttribute("transform"),null!=this.shiftPreview1){for(var i=this.shiftPreview1.firstChild;null!=i;){var o=i.nextSibling;this.container.appendChild(i),i=o}for(null!=this.shiftPreview1.parentNode&&this.shiftPreview1.parentNode.removeChild(this.shiftPreview1),this.shiftPreview1=null,this.container.appendChild(n.parentNode),i=this.shiftPreview2.firstChild;null!=i;){o=i.nextSibling;this.container.appendChild(i),i=o}null!=this.shiftPreview2.parentNode&&this.shiftPreview2.parentNode.removeChild(this.shiftPreview2),this.shiftPreview2=null}}else{if(n.setAttribute("transform","translate("+t+","+e+")"),null==this.shiftPreview1){this.shiftPreview1=document.createElement("div"),this.shiftPreview1.style.position="absolute",this.shiftPreview1.style.overflow="visible",this.shiftPreview2=document.createElement("div"),this.shiftPreview2.style.position="absolute",this.shiftPreview2.style.overflow="visible";var s=this.shiftPreview1;for(i=this.container.firstChild;null!=i;){o=i.nextSibling;i!=n.parentNode?s.appendChild(i):s=this.shiftPreview2,i=o}null!=this.shiftPreview1.firstChild&&this.container.insertBefore(this.shiftPreview1,n.parentNode),null!=this.shiftPreview2.firstChild&&this.container.appendChild(this.shiftPreview2)}this.shiftPreview1.style.left=t+"px",this.shiftPreview1.style.top=e+"px",this.shiftPreview2.style.left=t+"px",this.shiftPreview2.style.top=e+"px"}else n.style.left=t+"px",n.style.top=e+"px";this.panDx=t,this.panDy=e,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(t,e){this.zoom(t/this.view.scale,e)},mxGraph.prototype.center=function(t,e,n,i){t=null==t||t,e=null==e||e,n=null!=n?n:.5,i=null!=i?i:.5;var o=mxUtils.hasScrollbars(this.container),s=this.container.clientWidth,l=this.container.clientHeight,r=this.getGraphBounds(),a=this.view.translate,h=this.view.scale,d=t?s-r.width:0,u=e?l-r.height:0;if(o){r.x-=a.x,r.y-=a.y;var p=this.container.scrollWidth,m=this.container.scrollHeight;s<p&&(d=0),l<m&&(u=0),this.view.setTranslate(Math.floor(d/2-r.x),Math.floor(u/2-r.y)),this.container.scrollLeft=(p-s)/2,this.container.scrollTop=(m-l)/2}else this.view.setTranslate(t?Math.floor(a.x-r.x*h+d*n/h):a.x,e?Math.floor(a.y-r.y*h+u*i/h):a.y)},mxGraph.prototype.zoom=function(t,e){if(!mxClient.IS_READONLY_PAGE){e=null!=e?e:this.centerZoom;var n=Math.round(this.view.scale*t*100)/100;2<n&&(n=2),n<.15&&(n=.15);var i=this.view.getState(this.getSelectionCell());t=n/this.view.scale;var o=this.view.scale;this.pageFormat.width=this.pageFormat.width*o/n,this.pageFormat.height=this.pageFormat.height*o/n;var s=document.getElementById("workflow-cellEditor");if(s&&(s.style.left=s.offsetLeft/o*n+"px",s.style.top=s.offsetTop/o*n+"px",s.style.transform="scale("+n+")",s.style.transformOrigin="left top",s.style.msTransform="scale("+n+")",s.style.msTransformOrigin="left top"),!mxClient.IS_READONLY_PAGE){var l=document.getElementById("wf-custom-range-slider"),r=document.getElementById("wf-custom-range-thumb"),a=document.getElementsByClassName("action-area-tip")[4],h=44*n;n<=.15&&(h=0);var d=(l.offsetWidth-r.offsetWidth)/100,u=Math.floor(h/d);r.style.left=h+"px",a.innerHTML=wfGetLabel(32559,"视图")+"("+Math.floor(100*n)+")%",l.style.backgroundSize=u+"% 100%",jQuery(".geDiagramContainer").scrollTop(0),jQuery(".geDiagramContainer").scrollLeft(0)}if(this.keepSelectionVisibleOnZoom&&null!=i){var p=new mxRectangle(i.x*t,i.y*t,i.width*t,i.height*t);this.view.scale=n,this.scrollRectToVisible(p)||(this.view.revalidate(),this.view.setScale(n))}else{var m=mxUtils.hasScrollbars(this.container);if(e&&!m){var c,g=this.container.offsetWidth,x=this.container.offsetHeight;if(1<t)g*=-(c=(t-1)/(2*n)),x*=-c;else g*=c=(1/t-1)/(2*this.view.scale),x*=c;this.view.scaleAndTranslate(n,this.view.translate.x+g,this.view.translate.y+x)}else{var y=this.view.translate.x,f=this.view.translate.y,v=this.container.scrollLeft,C=this.container.scrollTop;if(this.view.isFromScaleChanged=!0,this.view.setScale(n),m){g=0,x=0;e&&(g=this.container.offsetWidth*(t-1)/2,x=this.container.offsetHeight*(t-1)/2),this.container.scrollLeft=(this.view.translate.x-y)*this.view.scale+Math.round(v*t+g),this.container.scrollTop=(this.view.translate.y-f)*this.view.scale+Math.round(C*t+x)}}}}},mxGraph.prototype.zoomToRect=function(t){var e=this.container.clientWidth/t.width/(this.container.clientHeight/t.height);t.x=Math.max(0,t.x),t.y=Math.max(0,t.y);var n=Math.min(this.container.scrollWidth,t.x+t.width),i=Math.min(this.container.scrollHeight,t.y+t.height);if(t.width=n-t.x,t.height=i-t.y,e<1){var o=t.height/e,s=(o-t.height)/2;t.height=o;var l=Math.min(t.y,s);t.y=t.y-l,i=Math.min(this.container.scrollHeight,t.y+t.height),t.height=i-t.y}else{var r=t.width*e,a=(r-t.width)/2;t.width=r;var h=Math.min(t.x,a);t.x=t.x-h,n=Math.min(this.container.scrollWidth,t.x+t.width),t.width=n-t.x}var d=this.container.clientWidth/t.width,u=this.view.scale*d;mxUtils.hasScrollbars(this.container)?(this.view.setScale(u),this.container.scrollLeft=Math.round(t.x*d),this.container.scrollTop=Math.round(t.y*d)):this.view.scaleAndTranslate(u,this.view.translate.x-t.x/this.view.scale,this.view.translate.y-t.y/this.view.scale)},mxGraph.prototype.scrollCellToVisible=function(t,e){var n=-this.view.translate.x,i=-this.view.translate.y,o=this.view.getState(t);if(null!=o){var s=new mxRectangle(n+o.x,i+o.y,o.width,o.height);if(e&&null!=this.container){var l=this.container.clientWidth,r=this.container.clientHeight;s.x=s.getCenterX()-l/2,s.width=l,s.y=s.getCenterY()-r/2,s.height=r}var a=new mxPoint(this.view.translate.x,this.view.translate.y);if(this.scrollRectToVisible(s)){var h=new mxPoint(this.view.translate.x,this.view.translate.y);this.view.translate.x=a.x,this.view.translate.y=a.y,this.view.setTranslate(h.x,h.y)}}},mxGraph.prototype.scrollRectToVisible=function(t){var e=!1;if(null!=t){var n=this.container.offsetWidth,i=this.container.offsetHeight,o=Math.min(n,t.width),s=Math.min(i,t.height);if(mxUtils.hasScrollbars(this.container)){var l=this.container;t.x+=this.view.translate.x,t.y+=this.view.translate.y;var r=l.scrollLeft-t.x,a=Math.max(r-l.scrollLeft,0);0<r?l.scrollLeft-=r+2:0<(r=t.x+o-l.scrollLeft-l.clientWidth)&&(l.scrollLeft+=r+2);var h=l.scrollTop-t.y,d=Math.max(0,h-l.scrollTop);0<h?l.scrollTop-=h+2:0<(h=t.y+s-l.scrollTop-l.clientHeight)&&(l.scrollTop+=h+2),this.useScrollbarsForPanning||0==a&&0==d||this.view.setTranslate(a,d)}else{var u=-this.view.translate.x,p=-this.view.translate.y,m=this.view.scale;t.x+o>u+n&&(this.view.translate.x-=(t.x+o-n-u)/m,e=!0),t.y+s>p+i&&(this.view.translate.y-=(t.y+s-i-p)/m,e=!0),t.x<u&&(this.view.translate.x+=(u-t.x)/m,e=!0),t.y<p&&(this.view.translate.y+=(p-t.y)/m,e=!0),e&&(this.view.refresh(),null!=this.selectionCellsHandler&&this.selectionCellsHandler.refresh())}}return e},mxGraph.prototype.getCellGeometry=function(t){return this.model.getGeometry(t)},mxGraph.prototype.isCellVisible=function(t){return this.model.isVisible(t)},mxGraph.prototype.isCellCollapsed=function(t){return this.model.isCollapsed(t)},mxGraph.prototype.isCellConnectable=function(t){return this.model.isConnectable(t)},mxGraph.prototype.isOrthogonal=function(t){var e=t.style[mxConstants.STYLE_ORTHOGONAL];if(null!=e)return e;var n=this.view.getEdgeStyle(t);return n==mxEdgeStyle.SegmentConnector||n==mxEdgeStyle.ElbowConnector||n==mxEdgeStyle.SideToSide||n==mxEdgeStyle.TopToBottom||n==mxEdgeStyle.EntityRelation||n==mxEdgeStyle.OrthConnector},mxGraph.prototype.isLoop=function(t){var e=t.getVisibleTerminalState(!0),n=t.getVisibleTerminalState(!1);return null!=e&&e==n},mxGraph.prototype.isCloneEvent=function(t){return mxEvent.isControlDown(t)},mxGraph.prototype.isTransparentClickEvent=function(t){return!1},mxGraph.prototype.isToggleEvent=function(t){return mxClient.IS_MAC?mxEvent.isMetaDown(t):mxEvent.isControlDown(t)},mxGraph.prototype.isGridEnabledEvent=function(t){return null!=t&&!mxEvent.isAltDown(t)},mxGraph.prototype.isConstrainedEvent=function(t){return mxEvent.isShiftDown(t)},mxGraph.prototype.isIgnoreTerminalEvent=function(t){return!1},mxGraph.prototype.validationAlert=function(t){mxUtils.alert(t)},mxGraph.prototype.isEdgeValid=function(t,e,n){return null==this.getEdgeValidationError(t,e,n)},mxGraph.prototype.getEdgeValidationError=function(t,e,n){if(null!=t&&!this.isAllowDanglingEdges()&&(null==e||null==n))return"";if(null!=t&&null==this.model.getTerminal(t,!0)&&null==this.model.getTerminal(t,!1))return null;if(!this.allowLoops&&e==n&&null!=e)return"";if(!this.isValidConnection(e,n))return"";if(null==e||null==n)return this.allowDanglingEdges?null:"";var i="";if(!this.multigraph){var o=this.model.getEdgesBetween(e,n,!0);(1<o.length||1==o.length&&o[0]!=t)&&(i+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+"\n")}var s=this.model.getDirectedEdgeCount(e,!0,t),l=this.model.getDirectedEdgeCount(n,!1,t);if(null!=this.multiplicities)for(var r=0;r<this.multiplicities.length;r++){var a;null!=(a=this.multiplicities[r].check(this,t,e,n,s,l))&&(i+=a)}return null!=(a=this.validateEdge(t,e,n))&&(i+=a),0<i.length?i:null},mxGraph.prototype.validateEdge=function(t,e,n){return null},mxGraph.prototype.validateGraph=function(t,e){t=null!=t?t:this.model.getRoot(),e=null!=e?e:new Object;for(var n=!0,i=this.model.getChildCount(t),o=0;o<i;o++){var s=this.model.getChildAt(t,o),l=e;this.isValidRoot(s)&&(l=new Object);var r=this.validateGraph(s,l);null!=r?this.setCellWarning(s,r.replace(/\n/g,"<br>")):this.setCellWarning(s,null),n=n&&null==r}var a="";this.isCellCollapsed(t)&&!n&&(a+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n"),this.model.isEdge(t)?a+=this.getEdgeValidationError(t,this.model.getTerminal(t,!0),this.model.getTerminal(t,!1))||"":a+=this.getCellValidationError(t)||"";var h=this.validateCell(t,e);return null!=h&&(a+=h),null==this.model.getParent(t)&&this.view.validate(),0<a.length||!n?a:null},mxGraph.prototype.getCellValidationError=function(t){var e=this.model.getDirectedEdgeCount(t,!0),n=this.model.getDirectedEdgeCount(t,!1),i=this.model.getValue(t),o="";if(null!=this.multiplicities)for(var s=0;s<this.multiplicities.length;s++){var l=this.multiplicities[s];l.source&&mxUtils.isNode(i,l.type,l.attr,l.value)&&(e>l.max||e<l.min)?o+=l.countError+"\n":!l.source&&mxUtils.isNode(i,l.type,l.attr,l.value)&&(n>l.max||n<l.min)&&(o+=l.countError+"\n")}return 0<o.length?o:null},mxGraph.prototype.validateCell=function(t,e){return null},mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage},mxGraph.prototype.setBackgroundImage=function(t){this.backgroundImage=t},mxGraph.prototype.getFoldingImage=function(t){if(null!=t&&this.foldingEnabled&&!this.getModel().isEdge(t.cell)){var e=this.isCellCollapsed(t.cell);if(this.isCellFoldable(t.cell,!e))return e?this.collapsedImage:this.expandedImage}return null},mxGraph.prototype.convertValueToString=function(t){var e=this.model.getValue(t);if(null!=e){if(mxUtils.isNode(e))return e.nodeName;if("function"==typeof e.toString)return e.toString()}return""},mxGraph.prototype.getLabel=function(t){var e="";if(this.labelsVisible&&null!=t){var n=this.view.getState(t),i=null!=n?n.style:this.getCellStyle(t);mxUtils.getValue(i,mxConstants.STYLE_NOLABEL,!1)||(e=this.convertValueToString(t))}return e},mxGraph.prototype.isHtmlLabel=function(t){return this.isHtmlLabels()},mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels},mxGraph.prototype.setHtmlLabels=function(t){this.htmlLabels=t},mxGraph.prototype.isWrapping=function(t){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return null!=n&&"wrap"==n[mxConstants.STYLE_WHITE_SPACE]},mxGraph.prototype.isLabelClipped=function(t){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return null!=n&&"hidden"==n[mxConstants.STYLE_OVERFLOW]},mxGraph.prototype.getTooltip=function(t,n,e,i){var o=null;if(null!=t){if(null==t.control||n!=t.control.node&&n.parentNode!=t.control.node||(o=this.collapseExpandResource,o=mxUtils.htmlEntities(mxResources.get(o)||o).replace(/\\n/g,"<br>")),null==o&&null!=t.overlays&&t.overlays.visit(function(t,e){null!=o||n!=e.node&&n.parentNode!=e.node||(o=e.overlay.toString())}),null==o){var s=this.selectionCellsHandler.getHandler(t.cell);null!=s&&"function"==typeof s.getTooltipForNode&&(o=s.getTooltipForNode(n))}null==o&&(o=this.getTooltipForCell(t.cell))}return o},mxGraph.prototype.getTooltipForCell=function(t){return null!=t&&null!=t.getTooltip?t.getTooltip():this.convertValueToString(t)},mxGraph.prototype.getLinkForCell=function(t){return null},mxGraph.prototype.getCursorForMouseEvent=function(t){return this.getCursorForCell(t.getCell())},mxGraph.prototype.getCursorForCell=function(t){return null},mxGraph.prototype.getStartSize=function(t){var e=new mxRectangle,n=this.view.getState(t),i=null!=n?n.style:this.getCellStyle(t);if(null!=i){var o=parseInt(mxUtils.getValue(i,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));mxUtils.getValue(i,mxConstants.STYLE_HORIZONTAL,!0)?e.height=o:e.width=o}return e},mxGraph.prototype.getImage=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_IMAGE]:null},mxGraph.prototype.getVerticalAlign=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null},mxGraph.prototype.getIndicatorColor=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_COLOR]:null},mxGraph.prototype.getIndicatorGradientColor=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null},mxGraph.prototype.getIndicatorShape=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_SHAPE]:null},mxGraph.prototype.getIndicatorImage=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_IMAGE]:null},mxGraph.prototype.getBorder=function(){return this.border},mxGraph.prototype.setBorder=function(t){this.border=t},mxGraph.prototype.isSwimlane=function(t){if(null!=t&&this.model.getParent(t)!=this.model.getRoot()){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);if(null!=n&&!this.model.isEdge(t))return n[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE}return!1},mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer},mxGraph.prototype.setResizeContainer=function(t){this.resizeContainer=t},mxGraph.prototype.isEnabled=function(){return this.enabled},mxGraph.prototype.setEnabled=function(t){this.enabled=t},mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled},mxGraph.prototype.setEscapeEnabled=function(t){this.escapeEnabled=t},mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing},mxGraph.prototype.setInvokesStopCellEditing=function(t){this.invokesStopCellEditing=t},mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing},mxGraph.prototype.setEnterStopsCellEditing=function(t){this.enterStopsCellEditing=t},mxGraph.prototype.isCellLocked=function(t){var e=this.model.getGeometry(t);return this.isCellsLocked()||null!=e&&this.model.isVertex(t)&&e.relative},mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked},mxGraph.prototype.setCellsLocked=function(t){this.cellsLocked=t},mxGraph.prototype.getCloneableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(t){return this.isCellCloneable(t)}))},mxGraph.prototype.isCellCloneable=function(t){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return this.isCellsCloneable()&&0!=n[mxConstants.STYLE_CLONEABLE]},mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable},mxGraph.prototype.setCellsCloneable=function(t){this.cellsCloneable=t},mxGraph.prototype.getExportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(t){return this.canExportCell(t)}))},mxGraph.prototype.canExportCell=function(t){return this.exportEnabled},mxGraph.prototype.getImportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(t){return this.canImportCell(t)}))},mxGraph.prototype.canImportCell=function(t){return this.importEnabled},mxGraph.prototype.isCellSelectable=function(t){return this.isCellsSelectable()},mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable},mxGraph.prototype.setCellsSelectable=function(t){this.cellsSelectable=t},mxGraph.prototype.getDeletableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(t){return this.isCellDeletable(t)}))},mxGraph.prototype.isCellDeletable=function(t){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return this.isCellsDeletable()&&0!=n[mxConstants.STYLE_DELETABLE]},mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable},mxGraph.prototype.setCellsDeletable=function(t){this.cellsDeletable=t},mxGraph.prototype.isLabelMovable=function(t){return!this.isCellLocked(t)&&(this.model.isEdge(t)&&this.edgeLabelsMovable||this.model.isVertex(t)&&this.vertexLabelsMovable)},mxGraph.prototype.isCellRotatable=function(t){var e=this.view.getState(t);return 0!=(null!=e?e.style:this.getCellStyle(t))[mxConstants.STYLE_ROTATABLE]},mxGraph.prototype.getMovableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,function(t){return this.isCellMovable(t)}))},mxGraph.prototype.isCellMovable=function(t){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return this.isCellsMovable()&&!this.isCellLocked(t)&&0!=n[mxConstants.STYLE_MOVABLE]},mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable},mxGraph.prototype.setCellsMovable=function(t){this.cellsMovable=t},mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled},mxGraph.prototype.isRuleEnabled=function(){return this.ruleEnabled},mxGraph.prototype.setRuleEnabled=function(t){this.ruleEnabled=t},mxGraph.prototype.setGridEnabled=function(t){this.gridEnabled=t},mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled},mxGraph.prototype.setPortsEnabled=function(t){this.portsEnabled=t},mxGraph.prototype.getGridSize=function(){return this.gridSize},mxGraph.prototype.setGridSize=function(t){this.gridSize=t},mxGraph.prototype.getTolerance=function(){return this.tolerance},mxGraph.prototype.setTolerance=function(t){this.tolerance=t},mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable},mxGraph.prototype.setVertexLabelsMovable=function(t){this.vertexLabelsMovable=t},mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable},mxGraph.prototype.setEdgeLabelsMovable=function(t){this.edgeLabelsMovable=t},mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting},mxGraph.prototype.setSwimlaneNesting=function(t){this.swimlaneNesting=t},mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled},mxGraph.prototype.setSwimlaneSelectionEnabled=function(t){this.swimlaneSelectionEnabled=t},mxGraph.prototype.isMultigraph=function(){return this.multigraph},mxGraph.prototype.setMultigraph=function(t){this.multigraph=t},mxGraph.prototype.isAllowLoops=function(){return this.allowLoops},mxGraph.prototype.setAllowDanglingEdges=function(t){this.allowDanglingEdges=t},mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges},mxGraph.prototype.setConnectableEdges=function(t){this.connectableEdges=t},mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges},mxGraph.prototype.setCloneInvalidEdges=function(t){this.cloneInvalidEdges=t},mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges},mxGraph.prototype.setAllowLoops=function(t){this.allowLoops=t},mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove},mxGraph.prototype.setDisconnectOnMove=function(t){this.disconnectOnMove=t},mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled},mxGraph.prototype.setDropEnabled=function(t){this.dropEnabled=t},mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled},mxGraph.prototype.setSplitEnabled=function(t){this.splitEnabled=t},mxGraph.prototype.isCellResizable=function(t){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return this.isCellsResizable()&&!this.isCellLocked(t)&&"0"!=mxUtils.getValue(n,mxConstants.STYLE_RESIZABLE,"1")},mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable},mxGraph.prototype.setCellsResizable=function(t){this.cellsResizable=t},mxGraph.prototype.isTerminalPointMovable=function(t,e){return!0},mxGraph.prototype.isCellBendable=function(t){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return this.isCellsBendable()&&!this.isCellLocked(t)&&0!=n[mxConstants.STYLE_BENDABLE]},mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable},mxGraph.prototype.setCellsBendable=function(t){this.cellsBendable=t},mxGraph.prototype.isCellEditable=function(t){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return this.isCellsEditable()&&!this.isCellLocked(t)&&0!=n[mxConstants.STYLE_EDITABLE]},mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable},mxGraph.prototype.setCellsEditable=function(t){this.cellsEditable=t},mxGraph.prototype.isCellDisconnectable=function(t,e,n){return this.isCellsDisconnectable()&&!this.isCellLocked(t)},mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable},mxGraph.prototype.setCellsDisconnectable=function(t){this.cellsDisconnectable=t},mxGraph.prototype.isValidSource=function(t){return null==t&&this.allowDanglingEdges||null!=t&&(!this.model.isEdge(t)||this.connectableEdges)&&this.isCellConnectable(t)},mxGraph.prototype.isValidTarget=function(t){return this.isValidSource(t)},mxGraph.prototype.isValidConnection=function(t,e){return this.isValidSource(t)&&this.isValidTarget(e)},mxGraph.prototype.setConnectable=function(t){this.connectionHandler.setEnabled(t)},mxGraph.prototype.isConnectable=function(t){return this.connectionHandler.isEnabled()},mxGraph.prototype.setTooltips=function(t){this.tooltipHandler.setEnabled(t)},mxGraph.prototype.setPanning=function(t){this.panningHandler.panningEnabled=t},mxGraph.prototype.isEditing=function(t){if(null==this.cellEditor)return!1;var e=this.cellEditor.getEditingCell();return null==t?null!=e:t==e},mxGraph.prototype.isAutoSizeCell=function(t){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return this.isAutoSizeCells()||1==n[mxConstants.STYLE_AUTOSIZE]},mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells},mxGraph.prototype.setAutoSizeCells=function(t){this.autoSizeCells=t},mxGraph.prototype.isExtendParent=function(t){return!this.getModel().isEdge(t)&&this.isExtendParents()},mxGraph.prototype.isExtendParents=function(){return this.extendParents},mxGraph.prototype.setExtendParents=function(t){this.extendParents=t},mxGraph.prototype.isExtendParentsOnAdd=function(t){return this.extendParentsOnAdd},mxGraph.prototype.setExtendParentsOnAdd=function(t){this.extendParentsOnAdd=t},mxGraph.prototype.isExtendParentsOnMove=function(){return this.extendParentsOnMove},mxGraph.prototype.setExtendParentsOnMove=function(t){this.extendParentsOnMove=t},mxGraph.prototype.isRecursiveResize=function(t){return this.recursiveResize},mxGraph.prototype.setRecursiveResize=function(t){this.recursiveResize=t},mxGraph.prototype.isConstrainChild=function(t){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(t))},mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren},mxGraph.prototype.setConstrainChildren=function(t){this.constrainChildren=t},mxGraph.prototype.isConstrainRelativeChildren=function(){return this.constrainRelativeChildren},mxGraph.prototype.setConstrainRelativeChildren=function(t){this.constrainRelativeChildren=t},mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates},mxGraph.prototype.setAllowNegativeCoordinates=function(t){this.allowNegativeCoordinates=t},mxGraph.prototype.getOverlap=function(t){return this.isAllowOverlapParent(t)?this.defaultOverlap:0},mxGraph.prototype.isAllowOverlapParent=function(t){return!1},mxGraph.prototype.getFoldableCells=function(t,e){return this.model.filterCells(t,mxUtils.bind(this,function(t){return this.isCellFoldable(t,e)}))},mxGraph.prototype.isCellFoldable=function(t,e){var n=this.view.getState(t),i=null!=n?n.style:this.getCellStyle(t);return 0<this.model.getChildCount(t)&&0!=i[mxConstants.STYLE_FOLDABLE]},mxGraph.prototype.isValidDropTarget=function(t,e,n){return null!=t&&(this.isSplitEnabled()&&this.isSplitTarget(t,e,n)||!this.model.isEdge(t)&&(this.isSwimlane(t)||0<this.model.getChildCount(t)&&!this.isCellCollapsed(t)))},mxGraph.prototype.isSplitTarget=function(t,e,n){if(this.model.isEdge(t)&&null!=e&&1==e.length&&this.isCellConnectable(e[0])&&null==this.getEdgeValidationError(t,this.model.getTerminal(t,!0),e[0])){var i=this.model.getTerminal(t,!0),o=this.model.getTerminal(t,!1);return!this.model.isAncestor(e[0],i)&&!this.model.isAncestor(e[0],o)}return!1},mxGraph.prototype.getDropTarget=function(t,e,n,i){if(!this.isSwimlaneNesting())for(var o=0;o<t.length;o++)if(this.isSwimlane(t[o]))return null;var s=mxUtils.convertPoint(this.container,mxEvent.getClientX(e),mxEvent.getClientY(e));s.x-=this.panDx,s.y-=this.panDy;var l=this.getSwimlaneAt(s.x,s.y);if(null==n)n=l;else if(null!=l){for(var r=this.model.getParent(l);null!=r&&this.isSwimlane(r)&&r!=n;)r=this.model.getParent(r);r==n&&(n=l)}for(;null!=n&&!this.isValidDropTarget(n,t,e)&&!this.model.isLayer(n);)n=this.model.getParent(n);if(null==i||!i)for(var a=n;null!=a&&mxUtils.indexOf(t,a)<0;)a=this.model.getParent(a);return this.model.isLayer(n)||null!=a?null:n},mxGraph.prototype.getDefaultParent=function(){var t=this.getCurrentRoot();if(null==t&&null==(t=this.defaultParent)){var e=this.model.getRoot();t=this.model.getChildAt(e,0)}return t},mxGraph.prototype.setDefaultParent=function(t){this.defaultParent=t},mxGraph.prototype.getSwimlane=function(t){for(;null!=t&&!this.isSwimlane(t);)t=this.model.getParent(t);return t},mxGraph.prototype.getSwimlaneAt=function(t,e,n){if(null!=(n=n||this.getDefaultParent()))for(var i=this.model.getChildCount(n),o=0;o<i;o++){var s=this.model.getChildAt(n,o),l=this.getSwimlaneAt(t,e,s);if(null!=l)return l;if(this.isSwimlane(s)){var r=this.view.getState(s);if(this.intersects(r,t,e))return s}}return null},mxGraph.prototype.getCellAt=function(t,e,n,i,o,s){if(i=null==i||i,o=null==o||o,null==n&&null==(n=this.getCurrentRoot())&&(n=this.getModel().getRoot()),null!=n)for(var l=this.model.getChildCount(n)-1;0<=l;l--){var r=this.model.getChildAt(n,l),a=this.getCellAt(t,e,r,i,o,s);if(null!=a)return a;if(this.isCellVisible(r)&&(o&&this.model.isEdge(r)||i&&this.model.isVertex(r))){var h=this.view.getState(r);if(null!=h&&(null==s||!s(h,t,e))&&this.intersects(h,t,e))return r}}return null},mxGraph.prototype.intersects=function(t,e,n){if(null!=t){var i=t.absolutePoints;if(null!=i)for(var o=this.tolerance*this.tolerance,s=i[0],l=1;l<i.length;l++){var r=i[l];if(mxUtils.ptSegDistSq(s.x,s.y,r.x,r.y,e,n)<=o)return!0;s=r}else{var a=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0);if(0!=a){var h=Math.cos(-a),d=Math.sin(-a),u=new mxPoint(t.getCenterX(),t.getCenterY());e=(s=mxUtils.getRotatedPoint(new mxPoint(e,n),h,d,u)).x,n=s.y}if(mxUtils.contains(t,e,n))return!0}}return!1},mxGraph.prototype.hitsSwimlaneContent=function(t,e,n){var i=this.getView().getState(t),o=this.getStartSize(t);if(null!=i){var s=this.getView().getScale();if(e-=i.x,n-=i.y,0<o.width&&0<e&&e>o.width*s)return!0;if(0<o.height&&0<n&&n>o.height*s)return!0}return!1},mxGraph.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraph.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraph.prototype.getChildCells=function(t,e,n){t=null!=t?t:this.getDefaultParent(),e=null!=e&&e,n=null!=n&&n;for(var i=this.model.getChildCells(t,e,n),o=[],s=0;s<i.length;s++)this.isCellVisible(i[s])&&o.push(i[s]);return o},mxGraph.prototype.getConnections=function(t,e){return this.getEdges(t,e,!0,!0,!1)},mxGraph.prototype.getIncomingEdges=function(t,e){return this.getEdges(t,e,!0,!1,!1)},mxGraph.prototype.getOutgoingEdges=function(t,e){return this.getEdges(t,e,!1,!0,!1)},mxGraph.prototype.getEdges=function(t,e,n,i,o,s){n=null==n||n,i=null==i||i,o=null==o||o,s=null!=s&&s;for(var l=[],r=this.isCellCollapsed(t),a=this.model.getChildCount(t),h=0;h<a;h++){var d=this.model.getChildAt(t,h);!r&&this.isCellVisible(d)||(l=l.concat(this.model.getEdges(d,n,i)))}l=l.concat(this.model.getEdges(t,n,i));var u=[];for(h=0;h<l.length;h++){var p=this.view.getState(l[h]),m=null!=p?p.getVisibleTerminal(!0):this.view.getVisibleTerminal(l[h],!0),c=null!=p?p.getVisibleTerminal(!1):this.view.getVisibleTerminal(l[h],!1);(o&&m==c||m!=c&&(n&&c==t&&(null==e||this.isValidAncestor(m,e,s))||i&&m==t&&(null==e||this.isValidAncestor(c,e,s))))&&u.push(l[h])}return u},mxGraph.prototype.isValidAncestor=function(t,e,n){return n?this.model.isAncestor(e,t):this.model.getParent(t)==e},mxGraph.prototype.getOpposites=function(t,e,n,i){n=null==n||n,i=null==i||i;var o=[],s=new mxDictionary;if(null!=t)for(var l=0;l<t.length;l++){var r=this.view.getState(t[l]),a=null!=r?r.getVisibleTerminal(!0):this.view.getVisibleTerminal(t[l],!0),h=null!=r?r.getVisibleTerminal(!1):this.view.getVisibleTerminal(t[l],!1);a==e&&null!=h&&h!=e&&i?s.get(h)||(s.put(h,!0),o.push(h)):h==e&&null!=a&&a!=e&&n&&(s.get(a)||(s.put(a,!0),o.push(a)))}return o},mxGraph.prototype.getEdgesBetween=function(t,e,n){n=null!=n&&n;for(var i=this.getEdges(t),o=[],s=0;s<i.length;s++){var l=this.view.getState(i[s]),r=null!=l?l.getVisibleTerminal(!0):this.view.getVisibleTerminal(i[s],!0),a=null!=l?l.getVisibleTerminal(!1):this.view.getVisibleTerminal(i[s],!1);(r==t&&a==e||!n&&r==e&&a==t)&&o.push(i[s])}return o},mxGraph.prototype.getPointForEvent=function(t,e){var n=mxUtils.convertPoint(this.container,mxEvent.getClientX(t),mxEvent.getClientY(t)),i=this.view.scale,o=this.view.translate,s=0!=e?this.gridSize/2:0;return n.x=this.snap(n.x/i-o.x-s),n.y=this.snap(n.y/i-o.y-s),n},mxGraph.prototype.getCells=function(t,e,n,i,o,s){if(s=null!=s?s:[],0<n||0<i){var l=this.getModel(),r=t+n,a=e+i;if(null==o&&null==(o=this.getCurrentRoot())&&(o=l.getRoot()),null!=o)for(var h=l.getChildCount(o),d=0;d<h;d++){var u=l.getChildAt(o,d),p=this.view.getState(u);if(null!=p&&this.isCellVisible(u)){var m=mxUtils.getValue(p.style,mxConstants.STYLE_ROTATION)||0,c=p;0!=m&&(c=mxUtils.getBoundingBox(c,m)),(l.isEdge(u)||l.isVertex(u))&&c.x>=t&&c.y+c.height<=a&&c.y>=e&&c.x+c.width<=r?s.push(u):this.getCells(t,e,n,i,u,s)}}}return s},mxGraph.prototype.getCellsBeyond=function(t,e,n,i,o){var s=[];if((i||o)&&(null==n&&(n=this.getDefaultParent()),null!=n))for(var l=this.model.getChildCount(n),r=0;r<l;r++){var a=this.model.getChildAt(n,r),h=this.view.getState(a);this.isCellVisible(a)&&null!=h&&(!i||h.x>=t)&&(!o||h.y>=e)&&s.push(a)}return s},mxGraph.prototype.findTreeRoots=function(t,e,n){e=null!=e&&e,n=null!=n&&n;var i=[];if(null!=t){for(var o=this.getModel(),s=o.getChildCount(t),l=null,r=0,a=0;a<s;a++){var h=o.getChildAt(t,a);if(this.model.isVertex(h)&&this.isCellVisible(h)){for(var d=this.getConnections(h,e?t:null),u=0,p=0,m=0;m<d.length;m++){this.view.getVisibleTerminal(d[m],!0)==h?u++:p++}(n&&0==u&&0<p||!n&&0==p&&0<u)&&i.push(h);var c=n?p-u:u-p;r<c&&(r=c,l=h)}}0==i.length&&null!=l&&i.push(l)}return i},mxGraph.prototype.traverse=function(t,e,n,i,o,s){if(null!=n&&null!=t&&(e=null==e||e,s=null!=s&&s,!(o=o||new mxDictionary).get(t))){o.put(t,!0);var l=n(t,i);if(null==l||l){var r=this.model.getEdgeCount(t);if(0<r)for(var a=0;a<r;a++){var h=this.model.getEdgeAt(t,a),d=this.model.getTerminal(h,!0)==t;if(!e||!s==d){var u=this.model.getTerminal(h,!d);this.traverse(u,e,n,h,o,s)}}}}},mxGraph.prototype.isCellSelected=function(t){return this.getSelectionModel().isSelected(t)},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(t){this.getSelectionModel().setCell(t)},mxGraph.prototype.setSelectionCells=function(t){this.getSelectionModel().setCells(t)},mxGraph.prototype.addSelectionCell=function(t){this.getSelectionModel().addCell(t)},mxGraph.prototype.addSelectionCells=function(t){this.getSelectionModel().addCells(t)},mxGraph.prototype.removeSelectionCell=function(t){this.getSelectionModel().removeCell(t)},mxGraph.prototype.removeSelectionCells=function(t){this.getSelectionModel().removeCells(t)},mxGraph.prototype.selectRegion=function(t,e){var n=this.getCells(t.x,t.y,t.width,t.height);return this.selectCellsForEvent(n,e),n},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(t,e,n){var i=this.selectionModel,o=0<i.cells.length?i.cells[0]:null;1<i.cells.length&&i.clear();var s=null!=o?this.model.getParent(o):this.getDefaultParent(),l=this.model.getChildCount(s);if(null==o&&0<l){var r=this.model.getChildAt(s,0);this.setSelectionCell(r)}else if(null!=o&&!e||null==this.view.getState(s)||null==this.model.getGeometry(s)){if(null!=o&&n){if(0<this.model.getChildCount(o)){r=this.model.getChildAt(o,0);this.setSelectionCell(r)}}else if(0<l){var a=s.getIndex(o);if(t){a++;r=this.model.getChildAt(s,a%l);this.setSelectionCell(r)}else{var h=--a<0?l-1:a;r=this.model.getChildAt(s,h);this.setSelectionCell(r)}}}else this.getCurrentRoot()!=s&&this.setSelectionCell(s)},mxGraph.prototype.selectAll=function(e,t){e=e||this.getDefaultParent();var n=t?this.model.filterDescendants(function(t){return t!=e},e):this.model.getChildren(e);null!=n&&this.setSelectionCells(n)},mxGraph.prototype.selectVertices=function(t){this.selectCells(!0,!1,t)},mxGraph.prototype.selectEdges=function(t){this.selectCells(!1,!0,t)},mxGraph.prototype.selectCells=function(e,n,t){t=t||this.getDefaultParent();var i=mxUtils.bind(this,function(t){return null!=this.view.getState(t)&&(0==this.model.getChildCount(t)&&this.model.isVertex(t)&&e&&!this.model.isEdge(this.model.getParent(t))||this.model.isEdge(t)&&n)}),o=this.model.filterDescendants(i,t);this.setSelectionCells(o)},mxGraph.prototype.selectCellForEvent=function(t,e){var n=this.isCellSelected(t);this.isToggleEvent(e)?n?this.removeSelectionCell(t):this.addSelectionCell(t):n&&1==this.getSelectionCount()||this.setSelectionCell(t)},mxGraph.prototype.selectCellsForEvent=function(t,e){this.isToggleEvent(e)?this.addSelectionCells(t):this.setSelectionCells(t)},mxGraph.prototype.createHandler=function(t){var e=null;if(null!=t)if(this.model.isEdge(t.cell)){var n=t.getVisibleTerminalState(!0),i=t.getVisibleTerminalState(!1),o=this.getCellGeometry(t.cell),s=this.view.getEdgeStyle(t,null!=o?o.points:null,n,i);e=this.createEdgeHandler(t,s)}else e=this.createVertexHandler(t);return e},mxGraph.prototype.createVertexHandler=function(t){return new mxVertexHandler(t)},mxGraph.prototype.createEdgeHandler=function(t,e){return e==mxEdgeStyle.Loop||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom?this.createElbowEdgeHandler(t):e==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.OrthConnector?this.createEdgeSegmentHandler(t):new mxEdgeHandler(t)},mxGraph.prototype.createEdgeSegmentHandler=function(t){return new mxEdgeSegmentHandler(t)},mxGraph.prototype.createElbowEdgeHandler=function(t){return new mxElbowEdgeHandler(t)},mxGraph.prototype.addMouseListener=function(t){null==this.mouseListeners&&(this.mouseListeners=[]),this.mouseListeners.push(t)},mxGraph.prototype.removeMouseListener=function(t){if(null!=this.mouseListeners)for(var e=0;e<this.mouseListeners.length;e++)if(this.mouseListeners[e]==t){this.mouseListeners.splice(e,1);break}},mxGraph.prototype.updateMouseEvent=function(t,e){if(null==t.graphX||null==t.graphY){var n=mxUtils.convertPoint(this.container,t.getX(),t.getY());t.graphX=n.x-this.panDx,t.graphY=n.y-this.panDy,null==t.getCell()&&this.isMouseDown&&e==mxEvent.MOUSE_MOVE&&(t.state=this.view.getState(this.getCellAt(n.x,n.y,null,null,null,function(t){return null==t.shape||t.shape.paintBackground!=mxRectangleShape.prototype.paintBackground||"1"==mxUtils.getValue(t.style,mxConstants.STYLE_POINTER_EVENTS,"1")||null!=t.shape.fill&&t.shape.fill!=mxConstants.NONE})))}return t},mxGraph.prototype.getStateForTouchEvent=function(t){var e=mxEvent.getClientX(t),n=mxEvent.getClientY(t),i=mxUtils.convertPoint(this.container,e,n);return this.view.getState(this.getCellAt(i.x,i.y))},mxGraph.prototype.isEventIgnored=function(t,e,n){var i=mxEvent.isMouseEvent(e.getEvent()),o=!1;return e.getEvent()==this.lastEvent?o=!0:this.lastEvent=e.getEvent(),null!=this.eventSource&&t!=mxEvent.MOUSE_MOVE?(mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveRedirect,this.mouseUpRedirect),this.mouseMoveRedirect=null,this.mouseUpRedirect=null,this.eventSource=null):mxClient.IS_GC||null==this.eventSource||e.getSource()==this.eventSource?!mxClient.IS_TOUCH||t!=mxEvent.MOUSE_DOWN||i||mxEvent.isPenEvent(e.getEvent())||(this.eventSource=e.getSource(),this.mouseMoveRedirect=mxUtils.bind(this,function(t){this.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,this.getStateForTouchEvent(t)))}),this.mouseUpRedirect=mxUtils.bind(this,function(t){this.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t,this.getStateForTouchEvent(t)))}),mxEvent.addGestureListeners(this.eventSource,null,this.mouseMoveRedirect,this.mouseUpRedirect)):o=!0,this.isSyntheticEventIgnored(t,e,n)&&(o=!0),!mxEvent.isPopupTrigger(this.lastEvent)&&t!=mxEvent.MOUSE_MOVE&&2==this.lastEvent.detail||(t==mxEvent.MOUSE_UP&&this.isMouseDown?this.isMouseDown=!1:t!=mxEvent.MOUSE_DOWN||this.isMouseDown?!o&&((!mxClient.IS_FF||t!=mxEvent.MOUSE_MOVE)&&this.isMouseDown&&this.isMouseTrigger!=i||t==mxEvent.MOUSE_DOWN&&this.isMouseDown||t==mxEvent.MOUSE_UP&&!this.isMouseDown)&&(o=!0):(this.isMouseDown=!0,this.isMouseTrigger=i),o||t!=mxEvent.MOUSE_DOWN||(this.lastMouseX=e.getX(),this.lastMouseY=e.getY()),o)},mxGraph.prototype.isSyntheticEventIgnored=function(t,e,n){var i=!1,o=mxEvent.isMouseEvent(e.getEvent());return this.ignoreMouseEvents&&o&&t!=mxEvent.MOUSE_MOVE?(this.ignoreMouseEvents=t!=mxEvent.MOUSE_UP,i=!0):mxClient.IS_FF&&!o&&t==mxEvent.MOUSE_UP&&(this.ignoreMouseEvents=!0),i},mxGraph.prototype.isEventSourceIgnored=function(t,e){var n=e.getSource(),i=null!=n.nodeName?n.nodeName.toLowerCase():"",o=!mxEvent.isMouseEvent(e.getEvent())||mxEvent.isLeftMouseButton(e.getEvent());return t==mxEvent.MOUSE_DOWN&&o&&("select"==i||"option"==i||"input"==i&&"checkbox"!=n.type&&"radio"!=n.type&&"button"!=n.type&&"submit"!=n.type&&"file"!=n.type)},mxGraph.prototype.getEventState=function(t){return t},mxGraph.prototype.fireMouseEvent=function(t,e,n){if(this.isEventSourceIgnored(t,e))null!=this.tooltipHandler&&this.tooltipHandler.hide();else{if(null==n&&(n=this),e=this.updateMouseEvent(e,t),!this.nativeDblClickEnabled&&!mxEvent.isPopupTrigger(e.getEvent())||this.doubleTapEnabled&&mxClient.IS_TOUCH&&(mxEvent.isTouchEvent(e.getEvent())||mxEvent.isPenEvent(e.getEvent()))){var i=(new Date).getTime();if(!mxClient.IS_QUIRKS&&t==mxEvent.MOUSE_DOWN||mxClient.IS_QUIRKS&&t==mxEvent.MOUSE_UP&&!this.fireDoubleClick)if(null!=this.lastTouchEvent&&this.lastTouchEvent!=e.getEvent()&&i-this.lastTouchTime<this.doubleTapTimeout&&Math.abs(this.lastTouchX-e.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-e.getY())<this.doubleTapTolerance&&this.doubleClickCounter<2){this.doubleClickCounter++;var o=!1;if(t==mxEvent.MOUSE_UP){if(e.getCell()==this.lastTouchCell&&null!=this.lastTouchCell){this.lastTouchTime=0;var s=this.lastTouchCell;this.lastTouchCell=null,mxClient.IS_QUIRKS&&e.getSource().fireEvent("ondblclick"),this.dblClick(e.getEvent(),s),o=!0}}else this.fireDoubleClick=!0,this.lastTouchTime=0;if(!mxClient.IS_QUIRKS||o)return void mxEvent.consume(e.getEvent())}else null!=this.lastTouchEvent&&this.lastTouchEvent==e.getEvent()||(this.lastTouchCell=e.getCell(),this.lastTouchX=e.getX(),this.lastTouchY=e.getY(),this.lastTouchTime=i,this.lastTouchEvent=e.getEvent(),this.doubleClickCounter=0);else if((this.isMouseDown||t==mxEvent.MOUSE_UP)&&this.fireDoubleClick){this.fireDoubleClick=!1;s=this.lastTouchCell;return this.lastTouchCell=null,this.isMouseDown=!1,void((null!=s||(mxEvent.isTouchEvent(e.getEvent())||mxEvent.isPenEvent(e.getEvent()))&&(mxClient.IS_GC||mxClient.IS_SF))&&Math.abs(this.lastTouchX-e.getX())<this.doubleTapTolerance&&Math.abs(this.lastTouchY-e.getY())<this.doubleTapTolerance?this.dblClick(e.getEvent(),s):mxEvent.consume(e.getEvent()))}}if(!this.isEventIgnored(t,e,n)){if(e.state=this.getEventState(e.getState()),this.fireEvent(new mxEventObject(mxEvent.FIRE_MOUSE_EVENT,"eventName",t,"event",e)),mxClient.IS_OP||mxClient.IS_SF||mxClient.IS_GC||mxClient.IS_IE11||mxClient.IS_IE&&mxClient.IS_SVG||e.getEvent().target!=this.container){if(t==mxEvent.MOUSE_MOVE&&this.isMouseDown&&this.autoScroll&&!mxEvent.isMultiTouchEvent(e.getEvent))this.scrollPointToVisible(e.getGraphX(),e.getGraphY(),this.autoExtend);else if(t==mxEvent.MOUSE_UP&&this.ignoreScrollbars&&this.translateToScrollPosition&&(0!=this.container.scrollLeft||0!=this.container.scrollTop)){var l=this.view.scale,r=this.view.translate;this.view.setTranslate(r.x-this.container.scrollLeft/l,r.y-this.container.scrollTop/l),this.container.scrollLeft=0,this.container.scrollTop=0}if(null!=this.mouseListeners){var a=[n,e];e.getEvent().preventDefault||(e.getEvent().returnValue=!0);for(var h=0;h<this.mouseListeners.length;h++){var d=this.mouseListeners[h];t==mxEvent.MOUSE_DOWN?d.mouseDown.apply(d,a):t==mxEvent.MOUSE_MOVE?d.mouseMove.apply(d,a):t==mxEvent.MOUSE_UP&&d.mouseUp.apply(d,a)}}t==mxEvent.MOUSE_UP&&this.click(e)}if((mxEvent.isTouchEvent(e.getEvent())||mxEvent.isPenEvent(e.getEvent()))&&t==mxEvent.MOUSE_DOWN&&this.tapAndHoldEnabled&&!this.tapAndHoldInProgress){this.tapAndHoldInProgress=!0,this.initialTouchX=e.getGraphX(),this.initialTouchY=e.getGraphY();this.tapAndHoldThread&&window.clearTimeout(this.tapAndHoldThread),this.tapAndHoldThread=window.setTimeout(mxUtils.bind(this,function(){this.tapAndHoldValid&&this.tapAndHold(e),this.tapAndHoldInProgress=!1,this.tapAndHoldValid=!1}),this.tapAndHoldDelay),this.tapAndHoldValid=!0}else t==mxEvent.MOUSE_UP?(this.tapAndHoldInProgress=!1,this.tapAndHoldValid=!1):this.tapAndHoldValid&&(this.tapAndHoldValid=Math.abs(this.initialTouchX-e.getGraphX())<this.tolerance&&Math.abs(this.initialTouchY-e.getGraphY())<this.tolerance);t==mxEvent.MOUSE_DOWN&&this.isEditing()&&!this.cellEditor.isEventSource(e.getEvent())&&this.stopEditing(!this.isInvokesStopCellEditing()),this.consumeMouseEvent(t,e,n)}}},mxGraph.prototype.consumeMouseEvent=function(t,e,n){t==mxEvent.MOUSE_DOWN&&mxEvent.isTouchEvent(e.getEvent())&&e.consume(!1)},mxGraph.prototype.fireGestureEvent=function(t,e){this.lastTouchTime=0,this.fireEvent(new mxEventObject(mxEvent.GESTURE,"event",t,"cell",e))},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)},mxCellOverlay.prototype=new mxEventSource,mxCellOverlay.prototype.constructor=mxCellOverlay,mxCellOverlay.prototype.image=null,mxCellOverlay.prototype.tooltip=null,mxCellOverlay.prototype.align=mxConstants.ALIGN_RIGHT,mxCellOverlay.prototype.verticalAlign=mxConstants.ALIGN_BOTTOM,mxCellOverlay.prototype.offset=null,mxCellOverlay.prototype.cursor=null,mxCellOverlay.prototype.defaultOverlap=.5,mxCellOverlay.prototype.getBounds=function(t){var e=t.view.graph.getModel().isEdge(t.cell),n=t.view.scale,i=null,o=this.image.width,s=this.image.height;if(e){var l=t.absolutePoints;if(l.length%2==1)i=l[Math.floor(l.length/2)];else{var r=l.length/2,a=l[r-1],h=l[r];i=new mxPoint(a.x+(h.x-a.x)/2,a.y+(h.y-a.y)/2)}}else i=new mxPoint,this.align==mxConstants.ALIGN_LEFT?i.x=t.x:this.align==mxConstants.ALIGN_CENTER?i.x=t.x+t.width/2:i.x=t.x+t.width,this.verticalAlign==mxConstants.ALIGN_TOP?i.y=t.y:this.verticalAlign==mxConstants.ALIGN_MIDDLE?i.y=t.y+t.height/2:i.y=t.y+t.height;return new mxRectangle(Math.round(i.x-(o*this.defaultOverlap-this.offset.x)*n),Math.round(i.y-(s*this.defaultOverlap-this.offset.y)*n),o*n,s*n)},mxCellOverlay.prototype.toString=function(){return this.tooltip},mxOutline.prototype.source=null,mxOutline.prototype.outline=null,mxOutline.prototype.graphRenderHint=mxConstants.RENDERING_HINT_FASTER,mxOutline.prototype.enabled=!0,mxOutline.prototype.showViewport=!0,mxOutline.prototype.border=10,mxOutline.prototype.sizerSize=8,mxOutline.prototype.labelsVisible=!1,mxOutline.prototype.updateOnPan=!1,mxOutline.prototype.sizerImage=null,mxOutline.prototype.minScale=1e-4,mxOutline.prototype.suspended=!1,mxOutline.prototype.forceVmlHandles=8==document.documentMode,mxOutline.prototype.createGraph=function(t){var e=new mxGraph(t,this.source.getModel(),this.graphRenderHint,this.source.getStylesheet());return e.foldingEnabled=!1,e.autoScroll=!1,e},mxOutline.prototype.init=function(t){this.outline=this.createGraph(t);var e=this.outline.graphModelChanged;if(this.outline.graphModelChanged=mxUtils.bind(this,function(t){this.suspended||null==this.outline||e.apply(this.outline,arguments)}),mxClient.IS_SVG){var n=this.outline.getView().getCanvas().parentNode;n.setAttribute("shape-rendering","optimizeSpeed"),n.setAttribute("image-rendering","optimizeSpeed")}this.outline.labelsVisible=this.labelsVisible,this.outline.setEnabled(!1),this.updateHandler=mxUtils.bind(this,function(t,e){this.suspended||this.active||this.update()}),this.source.getModel().addListener(mxEvent.CHANGE,this.updateHandler),this.outline.addMouseListener(this);var i=this.source.getView();i.addListener(mxEvent.SCALE,this.updateHandler),i.addListener(mxEvent.TRANSLATE,this.updateHandler),i.addListener(mxEvent.SCALE_AND_TRANSLATE,this.updateHandler),i.addListener(mxEvent.DOWN,this.updateHandler),i.addListener(mxEvent.UP,this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.panHandler=mxUtils.bind(this,function(t){this.updateOnPan&&this.updateHandler.apply(this,arguments)}),this.source.addListener(mxEvent.PAN,this.panHandler),this.refreshHandler=mxUtils.bind(this,function(t){this.outline.setStylesheet(this.source.getStylesheet()),this.outline.refresh()}),this.source.addListener(mxEvent.REFRESH,this.refreshHandler),this.bounds=new mxRectangle(0,0,0,0),this.selectionBorder=new mxRectangleShape(this.bounds,null,mxConstants.OUTLINE_COLOR,mxConstants.OUTLINE_STROKEWIDTH),this.selectionBorder.dialect=this.outline.dialect,this.forceVmlHandles&&(this.selectionBorder.isHtmlAllowed=function(){return!1}),this.selectionBorder.init(this.outline.getView().getOverlayPane());var o=mxUtils.bind(this,function(t){var e=mxEvent.getSource(t),n=mxUtils.bind(this,function(t){this.outline.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t))}),i=mxUtils.bind(this,function(t){mxEvent.removeGestureListeners(e,null,n,i),this.outline.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t))});mxEvent.addGestureListeners(e,null,n,i),this.outline.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t))});mxEvent.addGestureListeners(this.selectionBorder.node,o),this.sizer=this.createSizer(),this.forceVmlHandles&&(this.sizer.isHtmlAllowed=function(){return!1}),this.sizer.init(this.outline.getView().getOverlayPane()),this.enabled&&(this.sizer.node.style.cursor="nwse-resize"),mxEvent.addGestureListeners(this.sizer.node,o),this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display,this.selectionBorder.node.style.cursor="move",this.update(!1)},mxOutline.prototype.isEnabled=function(){return this.enabled},mxOutline.prototype.setEnabled=function(t){this.enabled=t},mxOutline.prototype.setZoomEnabled=function(t){this.sizer.node.style.visibility=t?"visible":"hidden"},mxOutline.prototype.refresh=function(){this.update(!0)},mxOutline.prototype.createSizer=function(){return null==this.sizerImage?(t=new mxRectangleShape(new mxRectangle(0,0,this.sizerSize,this.sizerSize),mxConstants.OUTLINE_HANDLE_FILLCOLOR,mxConstants.OUTLINE_HANDLE_STROKECOLOR)).dialect=this.outline.dialect:(t=new mxImageShape(new mxRectangle(0,0,this.sizerImage.width,this.sizerImage.height),this.sizerImage.src)).dialect=this.outline.dialect,t;var t},mxOutline.prototype.getSourceContainerSize=function(){return new mxRectangle(0,0,this.source.container.scrollWidth,this.source.container.scrollHeight)},mxOutline.prototype.getOutlineOffset=function(t){return null},mxOutline.prototype.getSourceGraphBounds=function(){return this.source.getGraphBounds()},mxOutline.prototype.update=function(t){if(null!=this.source&&null!=this.source.container&&null!=this.outline&&null!=this.outline.container){var e=this.source.view.scale,n=this.getSourceGraphBounds(),i=new mxRectangle(n.x/e+this.source.panDx,n.y/e+this.source.panDy,n.width/e,n.height/e),o=new mxRectangle(0,0,this.source.container.clientWidth/e,this.source.container.clientHeight/e),s=i.clone();s.add(o);var l=this.getSourceContainerSize(),r=Math.max(l.width/e,s.width),a=Math.max(l.height/e,s.height),h=Math.max(0,this.outline.container.clientWidth-this.border),d=Math.max(0,this.outline.container.clientHeight-this.border),u=Math.min(h/r,d/a),p=isNaN(u)?this.minScale:Math.max(this.minScale,u);if(0<p){this.outline.getView().scale!=p&&(this.outline.getView().scale=p,t=!0);var m=this.outline.getView();m.currentRoot!=this.source.getView().currentRoot&&m.setCurrentRoot(this.source.getView().currentRoot);var c=this.source.view.translate,g=c.x+this.source.panDx,x=c.y+this.source.panDy,y=this.getOutlineOffset(p);null!=y&&(g+=y.x,x+=y.y),i.x<0&&(g-=i.x),i.y<0&&(x-=i.y),m.translate.x==g&&m.translate.y==x||(m.translate.x=g,m.translate.y=x,t=!0);var f=m.translate,v=(p=this.source.getView().scale)/m.scale,C=1/m.scale,E=this.source.container;this.bounds=new mxRectangle((f.x-c.x-this.source.panDx)/C,(f.y-c.y-this.source.panDy)/C,E.clientWidth/v,E.clientHeight/v),this.bounds.x+=this.source.container.scrollLeft*m.scale/p,this.bounds.y+=this.source.container.scrollTop*m.scale/p,(w=this.selectionBorder.bounds).x==this.bounds.x&&w.y==this.bounds.y&&w.width==this.bounds.width&&w.height==this.bounds.height||(this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw());var w=this.sizer.bounds,S=new mxRectangle(this.bounds.x+this.bounds.width-w.width/2,this.bounds.y+this.bounds.height-w.height/2,w.width,w.height);w.x==S.x&&w.y==S.y&&w.width==S.width&&w.height==S.height||(this.sizer.bounds=S,"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw()),t&&this.outline.view.revalidate()}}},mxOutline.prototype.mouseDown=function(t,e){if(this.enabled&&this.showViewport){var n=mxEvent.isMouseEvent(e.getEvent())?0:this.source.tolerance,i=this.source.allowHandleBoundsCheck&&(mxClient.IS_IE||0<n)?new mxRectangle(e.getGraphX()-n,e.getGraphY()-n,2*n,2*n):null;this.zoom=e.isSource(this.sizer)||null!=i&&mxUtils.intersects(shape.bounds,i),this.startX=e.getX(),this.startY=e.getY(),this.active=!0,this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)?(this.dx0=this.source.container.scrollLeft,this.dy0=this.source.container.scrollTop):(this.dx0=0,this.dy0=0)}e.consume()},mxOutline.prototype.mouseMove=function(t,e){if(this.active){this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display;var n=this.getTranslateForEvent(e),i=n.x,o=n.y,s=null;if(this.zoom){var l=this.source.container;o=i/(l.clientWidth/l.clientHeight),s=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+i),Math.max(1,this.bounds.height+o)),this.selectionBorder.bounds=s,this.selectionBorder.redraw()}else{var r=this.outline.getView().scale;s=new mxRectangle(this.bounds.x+i,this.bounds.y+o,this.bounds.width,this.bounds.height),this.selectionBorder.bounds=s,this.selectionBorder.redraw(),i/=r,i*=this.source.getView().scale,o/=r,o*=this.source.getView().scale,this.source.panGraph(-i-this.dx0,-o-this.dy0)}var a=this.sizer.bounds;this.sizer.bounds=new mxRectangle(s.x+s.width-a.width/2,s.y+s.height-a.height/2,a.width,a.height),"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw(),e.consume()}},mxOutline.prototype.getTranslateForEvent=function(t){return new mxPoint(t.getX()-this.startX,t.getY()-this.startY)},mxOutline.prototype.mouseUp=function(t,e){if(this.active){var n=this.getTranslateForEvent(e),i=n.x,o=n.y;if(0<Math.abs(i)||0<Math.abs(o)){if(this.zoom){var s=this.selectionBorder.bounds.width,l=this.source.getView().scale;this.source.zoomTo(Math.max(this.minScale,l-i*l/s),!1)}else if(!this.source.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.source.container)){this.source.panGraph(0,0),i/=this.outline.getView().scale,o/=this.outline.getView().scale;var r=this.source.getView().translate;this.source.getView().setTranslate(r.x-i,r.y-o)}this.update(),e.consume()}this.index=null,this.active=!1}},mxOutline.prototype.destroy=function(){null!=this.source&&(this.source.removeListener(this.panHandler),this.source.removeListener(this.refreshHandler),this.source.getModel().removeListener(this.updateHandler),this.source.getView().removeListener(this.updateHandler),mxEvent.addListener(this.source.container,"scroll",this.updateHandler),this.source=null),null!=this.outline&&(this.outline.removeMouseListener(this),this.outline.destroy(),this.outline=null),null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null),null!=this.sizer&&(this.sizer.destroy(),this.sizer=null)},mxMultiplicity.prototype.type=null,mxMultiplicity.prototype.attr=null,mxMultiplicity.prototype.value=null,mxMultiplicity.prototype.source=null,mxMultiplicity.prototype.min=null,mxMultiplicity.prototype.max=null,mxMultiplicity.prototype.validNeighbors=null,mxMultiplicity.prototype.validNeighborsAllowed=!0,mxMultiplicity.prototype.countError=null,mxMultiplicity.prototype.typeError=null,mxMultiplicity.prototype.check=function(t,e,n,i,o,s){var l="";(this.source&&this.checkTerminal(t,n,e)||!this.source&&this.checkTerminal(t,i,e))&&(null!=this.countError&&(this.source&&(0==this.max||o>=this.max)||!this.source&&(0==this.max||s>=this.max))&&(l+=this.countError+"\n"),null!=this.validNeighbors&&null!=this.typeError&&0<this.validNeighbors.length&&(this.checkNeighbors(t,e,n,i)||(l+=this.typeError+"\n")));return 0<l.length?l:null},mxMultiplicity.prototype.checkNeighbors=function(t,e,n,i){for(var o=t.model.getValue(n),s=t.model.getValue(i),l=!this.validNeighborsAllowed,r=this.validNeighbors,a=0;a<r.length;a++){if(this.source&&this.checkType(t,s,r[a])){l=this.validNeighborsAllowed;break}if(!this.source&&this.checkType(t,o,r[a])){l=this.validNeighborsAllowed;break}}return l},mxMultiplicity.prototype.checkTerminal=function(t,e,n){var i=t.model.getValue(e);return this.checkType(t,i,this.type,this.attr,this.value)},mxMultiplicity.prototype.checkType=function(t,e,n,i,o){return null!=e&&(isNaN(e.nodeType)?e==n:mxUtils.isNode(e,n,i,o))},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(t){this.enabled=t},mxLayoutManager.prototype.isBubbling=function(){return this.bubbling},mxLayoutManager.prototype.setBubbling=function(t){this.bubbling=t},mxLayoutManager.prototype.getGraph=function(){return this.graph},mxLayoutManager.prototype.setGraph=function(t){null!=this.graph&&(this.graph.getModel().removeListener(this.undoHandler),this.graph.removeListener(this.moveHandler));this.graph=t,null!=this.graph&&(this.graph.getModel().addListener(mxEvent.BEFORE_UNDO,this.undoHandler),this.graph.addListener(mxEvent.MOVE_CELLS,this.moveHandler))},mxLayoutManager.prototype.getLayout=function(t){return null},mxLayoutManager.prototype.beforeUndo=function(t){for(var e=this.getCellsForChanges(t.changes),n=this.getGraph().getModel(),i=[],o=0;o<e.length;o++)i=i.concat(n.getDescendants(e[o]));if(e=i,this.isBubbling())for(i=n.getParents(e);0<i.length;)e=e.concat(i),i=n.getParents(i);this.executeLayoutForCells(e)},mxLayoutManager.prototype.executeLayoutForCells=function(t){var e=mxUtils.sortCells(t,!0);e=e.concat(e.slice().reverse()),this.layoutCells(e)},mxLayoutManager.prototype.cellsMoved=function(t,e){if(null!=t&&null!=e)for(var n=mxUtils.convertPoint(this.getGraph().container,mxEvent.getClientX(e),mxEvent.getClientY(e)),i=this.getGraph().getModel(),o=0;o<t.length;o++){var s=i.getParent(t[o]);if(mxUtils.indexOf(t,s)<0){var l=this.getLayout(s);null!=l&&l.moveCell(t[o],n.x,n.y)}}},mxLayoutManager.prototype.getCellsForChanges=function(t){for(var e=new mxDictionary,n=[],i=0;i<t.length;i++){var o=t[i];if(o instanceof mxRootChange)return[];for(var s=this.getCellsForChange(o),l=0;l<s.length;l++)null==s[l]||e.get(s[l])||(e.put(s[l],!0),n.push(s[l]))}return n},mxLayoutManager.prototype.getCellsForChange=function(t){var e=this.getGraph().getModel();return t instanceof mxChildChange?[t.child,t.previous,e.getParent(t.child)]:t instanceof mxTerminalChange||t instanceof mxGeometryChange?[t.cell,e.getParent(t.cell)]:t instanceof mxVisibleChange||t instanceof mxStyleChange?[t.cell]:[]},mxLayoutManager.prototype.layoutCells=function(t){if(0<t.length){var e=this.getGraph().getModel();e.beginUpdate();try{for(var n=null,i=0;i<t.length;i++)t[i]!=e.getRoot()&&t[i]!=n&&this.executeLayout(this.getLayout(t[i]),t[i])&&(n=t[i]);this.fireEvent(new mxEventObject(mxEvent.LAYOUT_CELLS,"cells",t))}finally{e.endUpdate()}}},mxLayoutManager.prototype.executeLayout=function(t,e){var n=!1;return null!=t&&null!=e&&(t.execute(e),n=!0),n},mxLayoutManager.prototype.destroy=function(){this.setGraph(null)},mxSwimlaneManager.prototype=new mxEventSource,mxSwimlaneManager.prototype.constructor=mxSwimlaneManager,mxSwimlaneManager.prototype.graph=null,mxSwimlaneManager.prototype.enabled=!0,mxSwimlaneManager.prototype.horizontal=!0,mxSwimlaneManager.prototype.addEnabled=!0,mxSwimlaneManager.prototype.resizeEnabled=!0,mxSwimlaneManager.prototype.addHandler=null,mxSwimlaneManager.prototype.resizeHandler=null,mxSwimlaneManager.prototype.isEnabled=function(){return this.enabled},mxSwimlaneManager.prototype.setEnabled=function(t){this.enabled=t},mxSwimlaneManager.prototype.isHorizontal=function(){return this.horizontal},mxSwimlaneManager.prototype.setHorizontal=function(t){this.horizontal=t},mxSwimlaneManager.prototype.isAddEnabled=function(){return this.addEnabled},mxSwimlaneManager.prototype.setAddEnabled=function(t){this.addEnabled=t},mxSwimlaneManager.prototype.isResizeEnabled=function(){return this.resizeEnabled},mxSwimlaneManager.prototype.setResizeEnabled=function(t){this.resizeEnabled=t},mxSwimlaneManager.prototype.getGraph=function(){return this.graph},mxSwimlaneManager.prototype.setGraph=function(t){null!=this.graph&&(this.graph.removeListener(this.addHandler),this.graph.removeListener(this.resizeHandler)),this.graph=t,null!=this.graph&&(this.graph.addListener(mxEvent.ADD_CELLS,this.addHandler),this.graph.addListener(mxEvent.CELLS_RESIZED,this.resizeHandler))},mxSwimlaneManager.prototype.isSwimlaneIgnored=function(t){return!this.getGraph().isSwimlane(t)},mxSwimlaneManager.prototype.isCellHorizontal=function(t){if(this.graph.isSwimlane(t)){var e=this.graph.getCellStyle(t);return 1==mxUtils.getValue(e,mxConstants.STYLE_HORIZONTAL,1)}return!this.isHorizontal()},mxSwimlaneManager.prototype.cellsAdded=function(t){if(null!=t){var e=this.getGraph().getModel();e.beginUpdate();try{for(var n=0;n<t.length;n++)this.isSwimlaneIgnored(t[n])||this.swimlaneAdded(t[n])}finally{e.endUpdate()}}},mxSwimlaneManager.prototype.swimlaneAdded=function(t){for(var e=this.getGraph().getModel(),n=e.getParent(t),i=e.getChildCount(n),o=null,s=0;s<i;s++){var l=e.getChildAt(n,s);if(l!=t&&!this.isSwimlaneIgnored(l)&&null!=(o=e.getGeometry(l)))break}if(null!=o){var r=null!=n?this.isCellHorizontal(n):this.horizontal;this.resizeSwimlane(t,o.width,o.height,r)}},mxSwimlaneManager.prototype.cellsResized=function(t){if(null!=t){var e=this.getGraph().getModel();e.beginUpdate();try{for(var n=0;n<t.length;n++)if(!this.isSwimlaneIgnored(t[n])){var i=e.getGeometry(t[n]);if(null!=i){for(var o=new mxRectangle(0,0,i.width,i.height),s=t[n],l=s;null!=l;){s=l,l=e.getParent(l);var r=this.graph.isSwimlane(l)?this.graph.getStartSize(l):new mxRectangle;o.width+=r.width,o.height+=r.height}var a=null!=l?this.isCellHorizontal(l):this.horizontal;this.resizeSwimlane(s,o.width,o.height,a)}}}finally{e.endUpdate()}}},mxSwimlaneManager.prototype.resizeSwimlane=function(t,e,n,i){var o=this.getGraph().getModel();o.beginUpdate();try{var s=this.isCellHorizontal(t);if(!this.isSwimlaneIgnored(t)){var l=o.getGeometry(t);null!=l&&(i&&l.height!=n||!i&&l.width!=e)&&(l=l.clone(),i?l.height=n:l.width=e,o.setGeometry(t,l))}var r=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;e-=r.width,n-=r.height;for(var a=o.getChildCount(t),h=0;h<a;h++){var d=o.getChildAt(t,h);this.resizeSwimlane(d,e,n,s)}}finally{o.endUpdate()}},mxSwimlaneManager.prototype.destroy=function(){this.setGraph(null)},mxTemporaryCellStates.prototype.view=null,mxTemporaryCellStates.prototype.oldStates=null,mxTemporaryCellStates.prototype.oldBounds=null,mxTemporaryCellStates.prototype.oldScale=null,mxTemporaryCellStates.prototype.destroy=function(){this.view.setScale(this.oldScale),this.view.setStates(this.oldStates),this.view.setGraphBounds(this.oldBounds),this.view.validateCellState=this.oldValidateCellState,this.view.graph.cellRenderer.doRedrawShape=this.oldDoRedrawShape},mxCellStatePreview.prototype.graph=null,mxCellStatePreview.prototype.deltas=null,mxCellStatePreview.prototype.count=0,mxCellStatePreview.prototype.isEmpty=function(){return 0==this.count},mxCellStatePreview.prototype.moveState=function(t,e,n,i,o){i=null==i||i,o=null==o||o;var s=this.deltas.get(t.cell);return null==s?(s={point:new mxPoint(e,n),state:t},this.deltas.put(t.cell,s),this.count++):i?(s.point.x+=e,s.point.y+=n):(s.point.x=e,s.point.y=n),o&&this.addEdges(t),s.point},mxCellStatePreview.prototype.show=function(n){this.deltas.visit(mxUtils.bind(this,function(t,e){this.translateState(e.state,e.point.x,e.point.y)})),this.deltas.visit(mxUtils.bind(this,function(t,e){this.revalidateState(e.state,e.point.x,e.point.y,n)}))},mxCellStatePreview.prototype.translateState=function(t,e,n){if(null!=t){var i=this.graph.getModel();if(i.isVertex(t.cell)){t.view.updateCellState(t);var o=i.getGeometry(t.cell);0==e&&0==n||null==o||o.relative&&null==this.deltas.get(t.cell)||(t.x+=e,t.y+=n)}for(var s=i.getChildCount(t.cell),l=0;l<s;l++)this.translateState(t.view.getState(i.getChildAt(t.cell,l)),e,n)}},mxCellStatePreview.prototype.revalidateState=function(t,e,n,i){if(null!=t){var o=this.graph.getModel();o.isEdge(t.cell)&&t.view.updateCellState(t);var s=this.graph.getCellGeometry(t.cell),l=t.view.getState(o.getParent(t.cell));0==e&&0==n||null==s||!s.relative||!o.isVertex(t.cell)||null!=l&&!o.isVertex(l.cell)&&null==this.deltas.get(t.cell)||(t.x+=e,t.y+=n),this.graph.cellRenderer.redraw(t),null!=i&&i(t);for(var r=o.getChildCount(t.cell),a=0;a<r;a++)this.revalidateState(this.graph.view.getState(o.getChildAt(t.cell,a)),e,n,i)}},mxCellStatePreview.prototype.addEdges=function(t){for(var e=this.graph.getModel(),n=e.getEdgeCount(t.cell),i=0;i<n;i++){var o=t.view.getState(e.getEdgeAt(t.cell,i));null!=o&&this.moveState(o,0,0)}},mxConnectionConstraint.prototype.point=null,mxConnectionConstraint.prototype.perimeter=null,mxConnectionConstraint.prototype.name=null,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(t){this.enabled=t},mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled},mxGraphHandler.prototype.setCloneEnabled=function(t){this.cloneEnabled=t},mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled},mxGraphHandler.prototype.setMoveEnabled=function(t){this.moveEnabled=t},mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled},mxGraphHandler.prototype.setSelectEnabled=function(t){this.selectEnabled=t},mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent},mxGraphHandler.prototype.setRemoveCellsFromParent=function(t){this.removeCellsFromParent=t},mxGraphHandler.prototype.getInitialCellForEvent=function(t){return t.getCell()},mxGraphHandler.prototype.isDelayedSelection=function(t,e){return this.graph.isCellSelected(t)},mxGraphHandler.prototype.consumeMouseEvent=function(t,e){e.consume()},mxGraphHandler.prototype.mouseDown=function(t,e){if(window.parent.document.getElementById("workflowDesign_iframe")&&window.parent.document.getElementById("workflowDesign_iframe").focus(),document.getElementById("workflow-cellEditor")){var n=document.getElementById("workflow-cellEditor");mxClient.IS_IE?setTimeout(function(){n.parentNode.removeChild(n)},0):(jQuery("#workflow-cellEditor input")[0]&&jQuery("#workflow-cellEditor input")[0].blur(),n.parentNode.removeChild(n)),jQuery(".ant-popover").css("display","none")}for(var i=document.getElementsByClassName("wf-word-line"),o=0;o<i.length;++o)i[o]&&(i[o].style.visibility="visible");var s=this.graph,l=s.view.scale,r=s.minimumGraphSize.x||0,a=s.minimumGraphSize.y||0,h=s.minimumGraphSize.width*l||1e5,d=s.minimumGraphSize.height*l||1e5,u=s.getAllCells(r,a,h,d);for(o=0;o<u.length;++o)u[o].isEditing=!1;if(!e.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&null!=e.getState()&&!mxEvent.isMultiTouchEvent(e.getEvent())){var p=this.getInitialCellForEvent(e);if(this.delayedSelection=this.isDelayedSelection(p,e),this.cell=null,this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(p,e.getEvent()),this.isMoveEnabled()){var m=this.graph.model,c=m.getGeometry(p);this.graph.isCellMovable(p)&&(!m.isEdge(p)||1<this.graph.getSelectionCount()||null!=c.points&&0<c.points.length||null==m.getTerminal(p,!0)||null==m.getTerminal(p,!1)||this.graph.allowDanglingEdges||this.graph.isCloneEvent(e.getEvent())&&this.graph.isCellsCloneable())?p.isColGroup?this.start(p,e.getX(),p.geometry.y):p.isRowGroup?this.start(p,p.geometry.x,e.getY()):this.start(p,e.getX(),e.getY()):this.delayedSelection&&(this.cell=p),this.cellWasClicked=!0,this.consumeMouseEvent(mxEvent.MOUSE_DOWN,e)}}},mxGraphHandler.prototype.getGuideStates=function(){var t=this.graph.getDefaultParent(),e=this.graph.getModel(),n=mxUtils.bind(this,function(t){return null!=this.graph.view.getState(t)&&e.isVertex(t)&&null!=e.getGeometry(t)&&!e.getGeometry(t).relative});return this.graph.view.getCellStates(e.filterDescendants(n,t))},mxGraphHandler.prototype.getCells=function(t){return!this.delayedSelection&&this.graph.isCellMovable(t)?[t]:this.graph.getMovableCells(this.graph.getSelectionCells())},mxGraphHandler.prototype.getPreviewBounds=function(t){var e=this.getBoundingBox(t);if(null!=e){if(e.width=Math.max(0,e.width-1),e.height=Math.max(0,e.height-1),e.width<this.minimumSize){var n=this.minimumSize-e.width;e.x-=n/2,e.width=this.minimumSize}else e.x=Math.round(e.x),e.width=Math.ceil(e.width);this.graph.view.translate,this.graph.view.scale;if(e.height<this.minimumSize){var i=this.minimumSize-e.height;e.y-=i/2,e.height=this.minimumSize}else e.y=Math.round(e.y),e.height=Math.ceil(e.height)}return e},mxGraphHandler.prototype.getBoundingBox=function(t){var e=null;if(null!=t&&0<t.length)for(var n=this.graph.getModel(),i=0;i<t.length;i++)if(n.isVertex(t[i])||n.isEdge(t[i])){var o=this.graph.view.getState(t[i]);if(null!=o){var s=o;n.isVertex(t[i])&&null!=o.shape&&null!=o.shape.boundingBox&&(s=o.shape.boundingBox),null==e?e=mxRectangle.fromRectangle(s):e.add(s)}}return e},mxGraphHandler.prototype.createPreviewShape=function(t){var e=new mxRectangleShape(t,null,this.previewColor);return e.isDashed=!0,this.htmlPreview?(e.dialect=mxConstants.DIALECT_STRICTHTML,e.init(this.graph.container)):(e.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,e.init(this.graph.getView().getOverlayPane()),e.pointerEvents=!1,mxClient.IS_IOS&&(e.getSvgScreenOffset=function(){return 0})),e},mxGraphHandler.prototype.start=function(t,e,n){this.cell=t,this.first=mxUtils.convertPoint(this.graph.container,e,n),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(t){return null==this.guide||this.guide.isEnabledForEvent(t.getEvent())},mxGraphHandler.prototype.snap=function(t){var e=this.scaleGrid?this.graph.view.scale:1;return t.x=this.graph.snap(t.x/e)*e,t.y=this.graph.snap(t.y/e)*e,t},mxGraphHandler.prototype.getDelta=function(t){var e=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY()),n=this.graph.view.scale;return new mxPoint(this.roundLength((e.x-this.first.x)/n)*n,this.roundLength((e.y-this.first.y)/n)*n)},mxGraphHandler.prototype.updateHint=function(t){},mxGraphHandler.prototype.removeHint=function(){},mxGraphHandler.prototype.roundLength=function(t){return Math.round(2*t)/2},mxGraphHandler.prototype.mouseMove=function(t,e){var n=this.graph;if(!e.isConsumed()&&n.isMouseDown&&null!=this.cell&&null!=this.first&&null!=this.bounds){if(mxEvent.isMultiTouchEvent(e.getEvent()))return void this.reset();var i=this.getDelta(e),o=i.x,s=i.y,l=n.tolerance;if(null!=this.shape||Math.abs(o)>l||Math.abs(s)>l){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3)),null==this.shape&&(this.shape=this.createPreviewShape(this.bounds));var r=n.isGridEnabledEvent(e.getEvent()),a=!0;if(null!=this.guide&&this.useGuidesForEvent(e))a=!1,o=(i=this.guide.move(this.bounds,new mxPoint(o,s),r)).x,s=i.y;else if(r){var h=n.getView().translate,d=n.getView().scale,u=this.bounds.x-(n.snap(this.bounds.x/d-h.x)+h.x)*d,p=this.bounds.y-(n.snap(this.bounds.y/d-h.y)+h.y)*d,m=this.snap(new mxPoint(o,s));o=m.x-u,s=m.y-p}null!=this.guide&&a&&this.guide.hide(),n.isConstrainedEvent(e.getEvent())&&(Math.abs(o)>Math.abs(s)?s=0:o=0),this.currentDx=o,this.currentDy=s,this.updatePreviewShape();var c=null,g=e.getCell(),x=n.isCloneEvent(e.getEvent())&&n.isCellsCloneable()&&this.isCloneEnabled();n.isDropEnabled()&&this.highlightEnabled&&(c=n.getDropTarget(this.cells,e.getEvent(),g,x));var y=n.getView().getState(c),f=!1;if(null==y||n.model.getParent(this.cell)==c&&!x){if(this.target=null,this.connectOnDrop&&null!=g&&1==this.cells.length&&n.getModel().isVertex(g)&&n.isCellConnectable(g)&&null!=(y=n.getView().getState(g))){var v=null==n.getEdgeValidationError(null,this.cell,g)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR;this.setHighlightColor(v),f=!0}}else this.target!=c&&(this.target=c,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),f=!0;null!=y&&f?this.highlight.highlight(y):this.highlight.hide()}this.updateHint(e),this.consumeMouseEvent(mxEvent.MOUSE_MOVE,e),mxEvent.consume(e.getEvent())}else if((this.isMoveEnabled()||this.isCloneEnabled())&&this.updateCursor&&!e.isConsumed()&&(null!=e.getState()||null!=e.sourceState)&&!n.isMouseDown){var C=n.getCursorForMouseEvent(e);if(null==C&&n.isEnabled()&&n.isCellMovable(e.getCell())){g=e.getCell();C=n.getModel().isEdge(e.getCell())?g.isRowGroup?"ns-resize":g.isColGroup?"ew-resize":"default":g.isRowGroup?"ns-resize":g.isColGroup?"ew-resize":mxConstants.CURSOR_MOVABLE_VERTEX}null!=C&&null!=e.sourceState&&e.sourceState.setCursor(C)}},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.bounds.x<50&&(this.shape.bounds.x=50),this.shape.bounds.y<50&&(this.shape.bounds.y=50),this.shape.redraw())},mxGraphHandler.prototype.setHighlightColor=function(t){null!=this.highlight&&this.highlight.setHighlightColor(t)},mxGraphHandler.prototype.mouseUp=function(t,e){if(!e.isConsumed()){var n=this.graph;if(null!=this.cell&&null!=this.first&&null!=this.shape&&null!=this.currentDx&&null!=this.currentDy){if(!this.cell.edge){var i=this.cell.edges;if(i)for(var o=0;o<i.length;++o)i[o].setAbsPointNull||(i[o].setAbsPointNull=!0)}var s=e.getCell();if(this.connectOnDrop&&null==this.target&&null!=s&&n.getModel().isVertex(s)&&n.isCellConnectable(s)&&n.isEdgeValid(null,this.cell,s))n.connectionHandler.connect(this.cell,s,e.getEvent());else{var l=n.isCloneEvent(e.getEvent())&&n.isCellsCloneable()&&this.isCloneEnabled(),r=n.getView().scale,a=this.roundLength(this.currentDx/r),h=this.roundLength(this.currentDy/r),d=this.target;if(n.isSplitEnabled()&&n.isSplitTarget(d,this.cells,e.getEvent()))n.splitEdge(d,this.cells,null,a,h);else if(1==this.cells.length&&(this.cells[0].isColGroup||this.cells[0].isRowGroup))this.cells[0].isColGroup?this.moveCells(this.cells,a,0,l,this.target,e.getEvent()):this.cells[0].isRowGroup?this.moveCells(this.cells,0,h,l,this.target,e.getEvent()):this.moveCells(this.cells,a,h,l,this.target,e.getEvent());else{var u=[];for(o=0;o<this.cells.length;++o)this.cells[o].isColGroup||this.cells[o].isRowGroup||u.push(this.cells[o]);var p=a,m=h;for(o=0;o<u.length;++o)!u[o].edge&&u[o].geometry.x+a<50&&(p=50-u[o].geometry.x),!u[o].edge&&u[o].geometry.y+h<50&&(m=50-u[o].geometry.y);this.moveCells(u,p,m,l,this.target,e.getEvent())}}}else this.isSelectEnabled()&&this.delayedSelection&&null!=this.cell&&this.selectDelayed(e)}this.cellWasClicked&&this.consumeMouseEvent(mxEvent.MOUSE_UP,e),this.reset()},mxGraphHandler.prototype.selectDelayed=function(t){this.graph.isCellSelected(this.cell)&&this.graph.popupMenuHandler.isPopupTrigger(t)||this.graph.selectCellForEvent(this.cell,t.getEvent())},mxGraphHandler.prototype.reset=function(){this.destroyShapes(),this.removeHint(),this.cellWasClicked=!1,this.delayedSelection=!1,this.currentDx=null,this.currentDy=null,this.guides=null,this.first=null,this.cell=null,this.target=null},mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(t,e,n){if(this.graph.getModel().isVertex(t)){var i=this.graph.getView().getState(t);if(null!=i){var o=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(n),mxEvent.getClientY(n)),s=mxUtils.toRadians(mxUtils.getValue(i.style,mxConstants.STYLE_ROTATION)||0);if(0!=s){var l=Math.cos(-s),r=Math.sin(-s),a=new mxPoint(i.getCenterX(),i.getCenterY());o=mxUtils.getRotatedPoint(o,l,r,a)}return!mxUtils.contains(i,o.x,o.y)}}return!1},mxGraphHandler.prototype.moveCells=function(t,e,n,i,o,s){i&&(t=this.graph.getCloneableCells(t)),null==o&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(this.graph.getModel().getParent(this.cell),t,s)&&(o=this.graph.getDefaultParent()),i=i&&!this.graph.isCellLocked(o||this.graph.getDefaultParent()),t=this.graph.moveCells(t,e-this.graph.panDx/this.graph.view.scale,n-this.graph.panDy/this.graph.view.scale,i,o,s),this.isSelectEnabled()&&this.scrollOnMove&&this.graph.scrollCellToVisible(t[0]),i&&this.graph.setSelectionCells(t)},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()},mxPanningHandler.prototype=new mxEventSource,mxPanningHandler.prototype.constructor=mxPanningHandler,mxPanningHandler.prototype.graph=null,mxPanningHandler.prototype.useLeftButtonForPanning=!1,mxPanningHandler.prototype.usePopupTrigger=!0,mxPanningHandler.prototype.ignoreCell=!1,mxPanningHandler.prototype.previewEnabled=!0,mxPanningHandler.prototype.useGrid=!1,mxPanningHandler.prototype.panningEnabled=!0,mxPanningHandler.prototype.pinchEnabled=!0,mxPanningHandler.prototype.maxScale=8,mxPanningHandler.prototype.minScale=.01,mxPanningHandler.prototype.dx=null,mxPanningHandler.prototype.dy=null,mxPanningHandler.prototype.startX=0;mxPanningHandler.prototype.startY=0,mxPanningHandler.prototype.isActive=function(){return this.active||null!=this.initialScale},mxPanningHandler.prototype.isPanningEnabled=function(){return this.panningEnabled},mxPanningHandler.prototype.setPanningEnabled=function(t){this.panningEnabled=t},mxPanningHandler.prototype.isPinchEnabled=function(){return this.pinchEnabled},mxPanningHandler.prototype.setPinchEnabled=function(t){this.pinchEnabled=t},mxPanningHandler.prototype.isPanningTrigger=function(t){var e=t.getEvent();return this.useLeftButtonForPanning&&null==t.getState()&&mxEvent.isLeftMouseButton(e)||mxEvent.isControlDown(e)&&mxEvent.isShiftDown(e)||this.usePopupTrigger&&mxEvent.isPopupTrigger(e)},mxPanningHandler.prototype.isForcePanningEvent=function(t){return this.ignoreCell||mxEvent.isMultiTouchEvent(t.getEvent())},mxPanningHandler.prototype.mouseDown=function(t,e){!(this.mouseDownEvent=e).isConsumed()&&this.isPanningEnabled()&&!this.active&&this.isPanningTrigger(e)&&(this.start(e),this.consumePanningTrigger(e))},mxPanningHandler.prototype.start=function(t){this.dx0=-this.graph.container.scrollLeft,this.dy0=-this.graph.container.scrollTop,this.startX=t.getX(),this.startY=t.getY(),this.dx=null,this.dy=null,this.panningTrigger=!0},mxPanningHandler.prototype.consumePanningTrigger=function(t){t.consume()},mxPanningHandler.prototype.mouseMove=function(t,e){if(this.dx=e.getX()-this.startX,this.dy=e.getY()-this.startY,this.active)this.previewEnabled&&(this.useGrid&&(this.dx=this.graph.snap(this.dx),this.dy=this.graph.snap(this.dy)),this.graph.panGraph(this.dx+this.dx0,this.dy+this.dy0)),this.fireEvent(new mxEventObject(mxEvent.PAN,"event",e));else if(this.panningTrigger){var n=this.active;this.active=Math.abs(this.dx)>this.graph.tolerance||Math.abs(this.dy)>this.graph.tolerance,!n&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",e))}(this.active||this.panningTrigger)&&e.consume()},mxPanningHandler.prototype.mouseUp=function(t,e){if(this.active){if(null!=this.dx&&null!=this.dy){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){var n=this.graph.getView().scale,i=this.graph.getView().translate;this.graph.panGraph(0,0),this.panGraph(i.x+this.dx/n,i.y+this.dy/n)}e.consume()}this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",e))}this.reset()},mxPanningHandler.prototype.reset=function(){this.panningTrigger=!1,this.mouseDownEvent=null,this.active=!1,this.dx=null,this.dy=null},mxPanningHandler.prototype.panGraph=function(t,e){this.graph.getView().setTranslate(t,e)},mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.forcePanningHandler),this.graph.removeListener(this.gestureHandler),mxEvent.removeListener(document,"mouseup",this.mouseUpListener)},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(t){this.graph.tooltipHandler.hide()}))},mxPopupMenuHandler.prototype.isSelectOnPopup=function(t){return this.selectOnPopup},mxPopupMenuHandler.prototype.mouseDown=function(t,e){this.isEnabled()&&!mxEvent.isMultiTouchEvent(e.getEvent())&&(this.hideMenu(),this.triggerX=e.getGraphX(),this.triggerY=e.getGraphY(),this.screenX=mxEvent.getMainEvent(e.getEvent()).screenX,this.screenY=mxEvent.getMainEvent(e.getEvent()).screenY,this.popupTrigger=this.isPopupTrigger(e),this.inTolerance=!0)},mxPopupMenuHandler.prototype.mouseMove=function(t,e){this.inTolerance&&null!=this.screenX&&null!=this.screenY&&(Math.abs(mxEvent.getMainEvent(e.getEvent()).screenX-this.screenX)>this.graph.tolerance||Math.abs(mxEvent.getMainEvent(e.getEvent()).screenY-this.screenY)>this.graph.tolerance)&&(this.inTolerance=!1)},mxPopupMenuHandler.prototype.mouseUp=function(t,e){if(this.popupTrigger&&this.inTolerance&&null!=this.triggerX&&null!=this.triggerY){var n=this.getCellForPopupEvent(e);this.graph.isEnabled()&&this.isSelectOnPopup(e)&&null!=n&&!this.graph.isCellSelected(n)?this.graph.setSelectionCell(n):this.clearSelectionOnBackground&&null==n&&this.graph.clearSelection(),this.graph.tooltipHandler.hide();var i=mxUtils.getScrollOrigin();this.popup(e.getX()+i.x+1,e.getY()+i.y+1,n,e.getEvent()),e.consume()}this.popupTrigger=!1,this.inTolerance=!1},mxPopupMenuHandler.prototype.getCellForPopupEvent=function(t){return t.getCell()},mxPopupMenuHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.gestureHandler),mxPopupMenu.prototype.destroy.apply(this)},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(t){this.enabled=t},mxCellMarker.prototype.isEnabled=function(){return this.enabled},mxCellMarker.prototype.setHotspot=function(t){this.hotspot=t},mxCellMarker.prototype.getHotspot=function(){return this.hotspot},mxCellMarker.prototype.setHotspotEnabled=function(t){this.hotspotEnabled=t},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)!=this.markedState&&(this.markedState=null,this.unmark())},mxCellMarker.prototype.process=function(t){var e=null;return this.isEnabled()&&(e=this.getState(t),this.setCurrentState(e,t)),e},mxCellMarker.prototype.setCurrentState=function(t,e,n){var i=null!=t&&this.isValidState(t);n=null!=n?n:this.getMarkerColor(e.getEvent(),t,i),this.validState=i?t:null,t==this.markedState&&n==this.currentColor||(this.currentColor=n,null!=t&&null!=this.currentColor?(this.markedState=t,this.mark()):null!=this.markedState&&(this.markedState=null,this.unmark()))},mxCellMarker.prototype.markCell=function(t,e){var n=this.graph.getView().getState(t);null!=n&&(this.currentColor=null!=e?e:this.validColor,this.markedState=n,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(t){return!0},mxCellMarker.prototype.getMarkerColor=function(t,e,n){return n?this.validColor:this.invalidColor},mxCellMarker.prototype.getState=function(t){var e=this.graph.getView(),n=this.getCell(t),i=this.getStateToMark(e.getState(n));return null!=i&&this.intersects(i,t)?i:null},mxCellMarker.prototype.getCell=function(t){return t.getCell()},mxCellMarker.prototype.getStateToMark=function(t){return t},mxCellMarker.prototype.intersects=function(t,e){return!this.hotspotEnabled||mxUtils.intersectsHotspot(t,e.getGraphX(),e.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE)},mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),this.highlight.destroy()},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(t){this.enabled=t},mxSelectionCellsHandler.prototype.getHandler=function(t){return this.handlers.get(t)},mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit(function(t,e){e.reset.apply(e)})},mxSelectionCellsHandler.prototype.refresh=function(){var t=this.handlers;this.handlers=new mxDictionary;for(var e=this.graph.getSelectionCells(),n=0;n<e.length;n++){var i=this.graph.view.getState(e[n]);if(null!=i){var o=t.remove(e[n]);null!=o&&(o.state!=i?(o.destroy(),o=null):this.isHandlerActive(o)||(null!=o.refresh&&o.refresh(),o.redraw())),null==o&&(o=this.graph.createHandler(i),this.fireEvent(new mxEventObject(mxEvent.ADD,"state",i))),null!=o&&this.handlers.put(e[n],o)}}t.visit(mxUtils.bind(this,function(t,e){this.fireEvent(new mxEventObject(mxEvent.REMOVE,"state",e.state)),e.destroy()}))},mxSelectionCellsHandler.prototype.isHandlerActive=function(t){return null!=t.index},mxSelectionCellsHandler.prototype.updateHandler=function(t){var e=this.handlers.remove(t.cell);null!=e&&(e.destroy(),null!=(e=this.graph.createHandler(t))&&this.handlers.put(t.cell,e))},mxSelectionCellsHandler.prototype.mouseDown=function(t,e){if(this.graph.isEnabled()&&this.isEnabled()){var n=[t,e];this.handlers.visit(function(t,e){e.mouseDown.apply(e,n)})}},mxSelectionCellsHandler.prototype.mouseMove=function(t,e){if(this.graph.isEnabled()&&this.isEnabled()){var n=[t,e];this.handlers.visit(function(t,e){e.mouseMove.apply(e,n)})}},mxSelectionCellsHandler.prototype.mouseUp=function(t,e){if(this.graph.isEnabled()&&this.isEnabled()){var n=[t,e];this.handlers.visit(function(t,e){e.mouseUp.apply(e,n)})}},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)},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(t){this.enabled=t},mxConnectionHandler.prototype.isInsertBefore=function(t,e,n,i,o){return this.insertBeforeSource&&e!=n},mxConnectionHandler.prototype.isCreateTarget=function(t){return this.createTarget},mxConnectionHandler.prototype.setCreateTarget=function(t){this.createTarget=t},mxConnectionHandler.prototype.createShape=function(){var t=this.livePreview&&null!=this.edgeState?this.graph.cellRenderer.createShape(this.edgeState):new mxPolyline([],mxConstants.INVALID_COLOR);return t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,t.scale=this.graph.view.scale,t.pointerEvents=!1,t.isDashed=!0,t.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(t.node,this.graph,null),t},mxConnectionHandler.prototype.init=function(){this.graph.addMouseListener(this),this.marker=this.createMarker(),this.constraintHandler=new mxConstraintHandler(this.graph),this.changeHandler=mxUtils.bind(this,function(t){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(t){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(t){return!0},mxConnectionHandler.prototype.createMarker=function(){var i=new mxCellMarker(this.graph);return i.hotspotEnabled=!0,i.getCell=mxUtils.bind(this,function(t){var e=mxCellMarker.prototype.getCell.apply(i,arguments);if((this.error=null)==e&&null!=this.currentPoint&&(e=this.graph.getCellAt(this.currentPoint.x,this.currentPoint.y)),null!=e&&!this.graph.isCellConnectable(e)){var n=this.graph.getModel().getParent(e);this.graph.getModel().isVertex(n)&&this.graph.isCellConnectable(n)&&(e=n)}return(this.graph.isSwimlane(e)&&null!=this.currentPoint&&this.graph.hitsSwimlaneContent(e,this.currentPoint.x,this.currentPoint.y)||!this.isConnectableCell(e))&&(e=null),null!=e?this.isConnecting()?null!=this.previous&&(this.error=this.validateConnection(this.previous.cell,e),null!=this.error&&0==this.error.length&&(e=null,this.isCreateTarget(t.getEvent())&&(this.error=null))):this.isValidSource(e,t)||(e=null):!this.isConnecting()||this.isCreateTarget(t.getEvent())||this.graph.allowDanglingEdges||(this.error=""),e}),i.isValidState=mxUtils.bind(this,function(t){return this.isConnecting()?null==this.error:mxCellMarker.prototype.isValidState.apply(i,arguments)}),i.getMarkerColor=mxUtils.bind(this,function(t,e,n){return null==this.connectImage||this.isConnecting()?mxCellMarker.prototype.getMarkerColor.apply(i,arguments):null}),i.intersects=mxUtils.bind(this,function(t,e){return!(null==this.connectImage&&!this.isConnecting())||mxCellMarker.prototype.intersects.apply(i,arguments)}),i},mxConnectionHandler.prototype.start=function(t,e,n,i){this.previous=t,this.first=new mxPoint(e,n),this.edgeState=null!=i?i:this.createEdgeState(null),this.marker.currentColor=this.marker.validColor,this.marker.markedState=t,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(t,e){return this.graph.isValidSource(t)},mxConnectionHandler.prototype.isValidTarget=function(t){return!0},mxConnectionHandler.prototype.validateConnection=function(t,e){return this.isValidTarget(e)?this.graph.getEdgeValidationError(null,t,e):""},mxConnectionHandler.prototype.getConnectImage=function(t){return this.connectImage},mxConnectionHandler.prototype.isMoveIconToFrontForState=function(t){return null!=t.text&&t.text.node.parentNode==this.graph.container||this.moveIconFront},mxConnectionHandler.prototype.createIcons=function(t){var e=this.getConnectImage(t);if(null==e||null==t)return null;this.iconState=t;var n=[],i=new mxImageShape(new mxRectangle(0,0,e.width,e.height),e.src,null,null,0);i.preserveImageAspect=!1,this.isMoveIconToFrontForState(t)?(i.dialect=mxConstants.DIALECT_STRICTHTML,i.init(this.graph.container)):(i.dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,i.init(this.graph.getView().getOverlayPane()),this.moveIconBack&&null!=i.node.previousSibling&&i.node.parentNode.insertBefore(i.node,i.node.parentNode.firstChild)),i.node.style.cursor=mxConstants.CURSOR_CONNECT;var o=mxUtils.bind(this,function(){return null!=this.currentState?this.currentState:t}),s=mxUtils.bind(this,function(t){mxEvent.isConsumed(t)||(this.icon=i,this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,o())))});return mxEvent.redirectMouseEvents(i.node,this.graph,o,s),n.push(i),this.redrawIcons(n,this.iconState),n},mxConnectionHandler.prototype.redrawIcons=function(t,e){if(null!=t&&null!=t[0]&&null!=e){var n=this.getIconPosition(t[0],e);t[0].bounds.x=n.x,t[0].bounds.y=n.y,t[0].redraw()}},mxConnectionHandler.prototype.getIconPosition=function(t,e){var n=this.graph.getView().scale,i=e.getCenterX(),o=e.getCenterY();if(this.graph.isSwimlane(e.cell)){var s=this.graph.getStartSize(e.cell);i=0!=s.width?e.x+s.width*n/2:i,o=0!=s.height?e.y+s.height*n/2:o;var l=mxUtils.toRadians(mxUtils.getValue(e.style,mxConstants.STYLE_ROTATION)||0);if(0!=l){var r=Math.cos(l),a=Math.sin(l),h=new mxPoint(e.getCenterX(),e.getCenterY()),d=mxUtils.getRotatedPoint(new mxPoint(i,o),r,a,h);i=d.x,o=d.y}}return new mxPoint(i-t.bounds.width/2,o-t.bounds.height/2)},mxConnectionHandler.prototype.destroyIcons=function(){if(null!=this.icons){for(var t=0;t<this.icons.length;t++)this.icons[t].destroy();this.icons=null,this.icon=null,this.selectedIcon=null,this.iconState=null}},mxConnectionHandler.prototype.isStartEvent=function(t){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(t,e){if(this.mouseDownCounter++,this.isEnabled()&&this.graph.isEnabled()&&!e.isConsumed()&&!this.isConnecting()&&this.isStartEvent(e)){if(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(e.getGraphX(),e.getGraphY()),this.edgeState=this.createEdgeState(e),this.mouseDownCounter=1,this.waypointsEnabled&&null==this.shape&&(this.waypoints=null,this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState)),null==this.previous&&null!=this.edgeState){var n=this.graph.getPointForEvent(e.getEvent());this.edgeState.cell.geometry.setTerminalPoint(n,!0)}this.fireEvent(new mxEventObject(mxEvent.START,"state",this.previous)),e.consume()}this.selectedIcon=this.icon,this.icon=null},mxConnectionHandler.prototype.isImmediateConnectSource=function(t){return!this.graph.isCellMovable(t.cell)},mxConnectionHandler.prototype.createEdgeState=function(t){return null},mxConnectionHandler.prototype.isOutlineConnectEvent=function(t){var e=mxUtils.getOffset(this.graph.container),n=t.getEvent(),i=mxEvent.getClientX(n),o=mxEvent.getClientY(n),s=document.documentElement,l=(window.pageXOffset||s.scrollLeft)-(s.clientLeft||0),r=(window.pageYOffset||s.scrollTop)-(s.clientTop||0),a=this.currentPoint.x-this.graph.container.scrollLeft+e.x-l,h=this.currentPoint.y-this.graph.container.scrollTop+e.y-r;return this.outlineConnect&&!mxEvent.isShiftDown(t.getEvent())&&(t.isSource(this.marker.highlight.shape)||mxEvent.isAltDown(t.getEvent())&&null!=t.getState()||this.marker.highlight.isHighlightAt(i,o)||(a!=i||h!=o)&&null==t.getState()&&this.marker.highlight.isHighlightAt(a,h))},mxConnectionHandler.prototype.updateCurrentState=function(t,e){if(this.constraintHandler.update(t,null==this.first,!1,null==this.first||t.isSource(this.marker.highlight.shape)?null:e),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(t.getEvent())?(this.marker.reset(),this.currentState=null):(this.marker.process(t),this.currentState=this.marker.getValidState(),null==this.currentState||this.isCellEnabled(this.currentState.cell)||(this.currentState=null));var n=this.isOutlineConnectEvent(t);if(null!=this.currentState&&n){t.isSource(this.marker.highlight.shape)&&(e=new mxPoint(t.getGraphX(),t.getGraphY()));var i=this.graph.getOutlineConstraint(e,this.currentState,t);this.constraintHandler.setFocus(t,this.currentState,!1),this.constraintHandler.currentConstraint=i,this.constraintHandler.currentPoint=e}if(this.outlineConnect&&null!=this.marker.highlight&&null!=this.marker.highlight.shape){var o=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/o/o,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.marker.getValidState()!=t.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/o/o,this.marker.highlight.repaint())}}},mxConnectionHandler.prototype.isCellEnabled=function(t){return!0},mxConnectionHandler.prototype.convertWaypoint=function(t){var e=this.graph.getView().getScale(),n=this.graph.getView().getTranslate();t.x=t.x/e-n.x,t.y=t.y/e-n.y},mxConnectionHandler.prototype.snapToPreview=function(t,e){if(!mxEvent.isAltDown(t.getEvent())&&null!=this.previous){var n=this.graph.gridSize*this.graph.view.scale/2,i=null!=this.sourceConstraint?this.first:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY());Math.abs(i.x-t.getGraphX())<n&&(e.x=i.x),Math.abs(i.y-t.getGraphY())<n&&(e.y=i.y)}},mxConnectionHandler.prototype.mouseMove=function(t,e){if(e.graphX<50&&(e.graphX=50),e.graphY<50&&(e.graphY=50),e.isConsumed()||!this.ignoreMouseDown&&null==this.first&&this.graph.isMouseDown)this.constraintHandler.reset();else{this.isEnabled()||null==this.currentState||(this.destroyIcons(),this.currentState=null);var n=this.graph.getView(),i=n.scale,o=n.translate,s=new mxPoint(e.getGraphX(),e.getGraphY());if(this.error=null,this.graph.isGridEnabledEvent(e.getEvent())&&(s=new mxPoint((this.graph.snap(s.x/i-o.x)+o.x)*i,(this.graph.snap(s.y/i-o.y)+o.y)*i)),this.snapToPreview(e,s),this.currentPoint=s,(null!=this.first||this.isEnabled()&&this.graph.isEnabled())&&this.updateCurrentState(e,s),null!=this.first){var l=null,r=s;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(l=this.constraintHandler.currentConstraint,r=this.constraintHandler.currentPoint.clone()):null!=this.previous&&!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&(Math.abs(this.previous.getCenterX()-s.x)<Math.abs(this.previous.getCenterY()-s.y)?s.x=this.previous.getCenterX():s.y=this.previous.getCenterY());var a=this.first;if(null!=this.selectedIcon){var h=this.selectedIcon.bounds.width,d=this.selectedIcon.bounds.height;if(null!=this.currentState&&this.targetConnectImage){var u=this.getIconPosition(this.selectedIcon,this.currentState);this.selectedIcon.bounds.x=u.x,this.selectedIcon.bounds.y=u.y}else{var p=new mxRectangle(e.getGraphX()+this.connectIconOffset.x,e.getGraphY()+this.connectIconOffset.y,h,d);this.selectedIcon.bounds=p}this.selectedIcon.redraw()}if(null!=this.edgeState)this.updateEdgeState(r,l),r=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-1],a=this.edgeState.absolutePoints[0];else{if(null!=this.currentState)if(null==this.constraintHandler.currentConstraint)null!=(c=this.getTargetPerimeterPoint(this.currentState,e))&&(r=c);if(null==this.sourceConstraint&&null!=this.previous){var m=null!=this.waypoints&&0<this.waypoints.length?this.waypoints[0]:r;null!=(c=this.getSourcePerimeterPoint(this.previous,m,e))&&(a=c)}}if(null==this.currentState&&this.movePreviewAway){var c=a;if(null!=this.edgeState&&2<=this.edgeState.absolutePoints.length){var g=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2];null!=g&&(c=g)}var x=r.x-c.x,y=r.y-c.y,f=Math.sqrt(x*x+y*y);if(0==f)return;this.originalPoint=r.clone(),r.x-=4*x/f,r.y-=4*y/f}else this.originalPoint=null;if(null==this.shape){x=Math.abs(s.x-this.first.x),y=Math.abs(s.y-this.first.y);(x>this.graph.tolerance||y>this.graph.tolerance)&&(this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState),this.updateCurrentState(e,s))}if(null!=this.shape){if(null!=this.edgeState)this.shape.points=this.edgeState.absolutePoints;else{var v=[a];null!=this.waypoints&&(v=v.concat(this.waypoints)),v.push(r),this.shape.points=v}this.drawPreview()}null!=this.cursor&&(this.graph.container.style.cursor=this.cursor),mxEvent.consume(e.getEvent()),e.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(),null!=this.currentState&&null==this.error&&null==this.constraintHandler.currentConstraint&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),e.consume())),this.previous=this.currentState):this.previous!=this.currentState||null==this.currentState||null!=this.icons||this.graph.isMouseDown||e.consume():this.constraintHandler.reset();if(!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){for(var C=!1,E=e.getSource(),w=0;w<this.icons.length&&!C;w++)C=E==this.icons[w].node||E.parentNode==this.icons[w].node;C||this.updateIcons(this.currentState,this.icons,e)}}},mxConnectionHandler.prototype.updateEdgeState=function(t,e){if(null==this.sourceConstraint){var n=new mxPoint(this.first.x,this.first.y),i=this.previous.cell.geometry;n.x<=i.x?(this.edgeState.style[mxConstants.STYLE_EXIT_X]=0,this.edgeState.style[mxConstants.STYLE_EXIT_Y]=.5):n.x>=i.x+i.width?(this.edgeState.style[mxConstants.STYLE_EXIT_X]=1,this.edgeState.style[mxConstants.STYLE_EXIT_Y]=.5):n.y<=i.y?(this.edgeState.style[mxConstants.STYLE_EXIT_X]=.5,this.edgeState.style[mxConstants.STYLE_EXIT_Y]=0):(this.edgeState.style[mxConstants.STYLE_EXIT_X]=.5,this.edgeState.style[mxConstants.STYLE_EXIT_Y]=1),this.sourceConstraint={name:null,perimeter:!0,point:new mxPoint(this.edgeState.style[mxConstants.STYLE_EXIT_X],this.edgeState.style[mxConstants.STYLE_EXIT_Y])}}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!=e&&null!=e.point?(this.edgeState.style[mxConstants.STYLE_ENTRY_X]=e.point.x,this.edgeState.style[mxConstants.STYLE_ENTRY_Y]=e.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:t],this.graph.view.updateFixedTerminalPoint(this.edgeState,this.previous,!0,this.sourceConstraint),null!=this.currentState&&(null==e&&(e=this.graph.getConnectionConstraint(this.edgeState,this.previous,!1)),this.edgeState.setAbsoluteTerminalPoint(null,!1),this.graph.view.updateFixedTerminalPoint(this.edgeState,this.currentState,!1,e));var o=null;if(null!=this.waypoints){o=[];for(var s=0;s<this.waypoints.length;s++){n=this.waypoints[s].clone();this.convertWaypoint(n),o[s]=n}}this.graph.view.isFromScaleChanged=!1,this.graph.view.updatePoints(this.edgeState,o,this.previous,this.currentState),this.graph.view.updateFloatingTerminalPoints(this.edgeState,this.previous,this.currentState)},mxConnectionHandler.prototype.getTargetPerimeterPoint=function(t,e){var n=null,i=t.view,o=i.getPerimeterFunction(t);if(null!=o){var s=null!=this.waypoints&&0<this.waypoints.length?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY()),l=o(i.getPerimeterBounds(t),this.edgeState,s,!1);null!=l&&(n=l)}else n=new mxPoint(t.getCenterX(),t.getCenterY());return n},mxConnectionHandler.prototype.getSourcePerimeterPoint=function(t,e,n){var i=null,o=t.view,s=o.getPerimeterFunction(t),l=new mxPoint(t.getCenterX(),t.getCenterY());if(null!=s){var r=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),a=-r*(Math.PI/180);0!=r&&(e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(a),Math.sin(a),l));var h=s(o.getPerimeterBounds(t),t,e,!1);null!=h&&(0!=r&&(h=mxUtils.getRotatedPoint(new mxPoint(h.x,h.y),Math.cos(-a),Math.sin(-a),l)),i=h)}else i=l;return i},mxConnectionHandler.prototype.updateIcons=function(t,e,n){},mxConnectionHandler.prototype.isStopEvent=function(t){return null!=t.getState()},mxConnectionHandler.prototype.addWaypointForEvent=function(t){var e=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY()),n=Math.abs(e.x-this.first.x),i=Math.abs(e.y-this.first.y);if(null!=this.waypoints||1<this.mouseDownCounter&&(n>this.graph.tolerance||i>this.graph.tolerance)){null==this.waypoints&&(this.waypoints=[]);var o=this.graph.view.scale;e=new mxPoint(this.graph.snap(t.getGraphX()/o)*o,this.graph.snap(t.getGraphY()/o)*o);this.waypoints.push(e)}},mxConnectionHandler.prototype.mouseUp=function(t,e){if(!e.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(e))return this.addWaypointForEvent(e),void e.consume();if(null==this.error){var n=null!=this.previous?this.previous.cell:null,i=null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(i=this.constraintHandler.currentFocus.cell),null==i&&null!=this.currentState&&(i=this.currentState.cell),3==n.nodeType)wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390402,"起点不能是归档节点!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}});else{null!=i&&("2"==n.nodeAttriBute&&"2"!=i.nodeAttriBute&&"3"!=i.nodeAttriBute&&"4"!=i.nodeAttriBute&&"5"!=i.nodeAttriBute?wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390403,"分叉中间点只能指向本分支中间节点或合并节点!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}}):"2"!=i.nodeAttriBute||"3"!=n.nodeAttriBute&&"4"!=n.nodeAttriBute&&"5"!=n.nodeAttriBute?"3"!=i.nodeAttriBute&&"4"!=i.nodeAttriBute&&"5"!=i.nodeAttriBute||"1"!=n.nodeAttriBute?"2"==i.nodeAttriBute&&1!=n.nodeAttriBute&&2!=n.nodeAttriBute?wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390406,"分叉中间点的起始节点和结束节点不能为一般节点!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}}):(i.id==n.id&&wfModal.confirm({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390407,"确定要添加指向本身的出口?"),okText:wfGetLabel(83446,"确定"),cancelText:wfGetLabel(31129,"取消"),onOk:function(){},onCancel:function(){workflowUi.actions.get("undo").funct()}}),this.connect(n,i,e.getEvent(),e.getCell())):wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390405,"起始节点不能指向合并节点!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}}):wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390404,"合并节点不能指向分叉中间点!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}}))}}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(),e.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.originalPoint=null,this.currentPoint=null,this.edgeState=null,this.previous=null,this.error=null,this.sourceConstraint=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(t){this.shape.strokewidth=this.getEdgeWidth(t),this.shape.stroke=this.getEdgeColor(t)},mxConnectionHandler.prototype.getEdgeColor=function(t){return t?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR},mxConnectionHandler.prototype.getEdgeWidth=function(t){return t?3:1},mxConnectionHandler.prototype.connect=function(t,e,n,i){if(null!=e||this.isCreateTarget(n)||this.graph.allowDanglingEdges){var o=this.graph.getModel(),s=!1,l=null;o.beginUpdate();try{if(null!=t&&null==e&&!this.graph.isIgnoreTerminalEvent(n)&&this.isCreateTarget(n)&&null!=(e=this.createTargetVertex(n,t))){if(i=this.graph.getDropTarget([e],n,i),s=!0,null!=i&&this.graph.getModel().isEdge(i))i=this.graph.getDefaultParent();else{var r=this.graph.getView().getState(i);if(null!=r)(p=o.getGeometry(e)).x-=r.origin.x,p.y-=r.origin.y}this.graph.addCell(e,i)}var a=this.graph.getDefaultParent();null!=t&&null!=e&&o.getParent(t)==o.getParent(e)&&o.getParent(o.getParent(t))!=o.getRoot()&&(a=o.getParent(t),null!=t.geometry&&t.geometry.relative&&null!=e.geometry&&e.geometry.relative&&(a=o.getParent(a)));var h=null,d=null;if(null!=this.edgeState&&(h=this.edgeState.cell.value,d=this.edgeState.cell.style),l=this.insertEdge(a,null,h,t,e,d),mxClient.workflowDatas.maxLinkOrder++,l.value=wfGetLabel(15587,"出口")+mxClient.workflowDatas.maxLinkOrder,l.order=mxClient.workflowDatas.maxLinkOrder,null!=l){this.sourceConstraint||this.calcFloatingStartPointConstraint(l,t),this.constraintHandler.currentConstraint||this.calcFloatingEndPointConstraint(l,e),this.graph.setConnectionConstraint(l,t,!0,this.sourceConstraint),this.graph.setConnectionConstraint(l,e,!1,this.constraintHandler.currentConstraint),null!=this.edgeState&&o.setGeometry(l,this.edgeState.cell.geometry);a=o.getParent(t);if(this.isInsertBefore(l,t,e,n,i)){for(var u=null,p=t;null!=p.parent&&null!=p.geometry&&p.geometry.relative&&p.parent!=l.parent;)p=this.graph.model.getParent(p);if(null!=p&&null!=p.parent&&p.parent==l.parent){u=p.parent.getIndex(p);p.parent.insert(l,u)}}var m=o.getGeometry(l);if(null==m&&((m=new mxGeometry).relative=!0,o.setGeometry(l,m)),null!=this.waypoints&&0<this.waypoints.length){var c=this.graph.view.scale,g=this.graph.view.translate;m.points=[];for(var x=0;x<this.waypoints.length;x++){var y=this.waypoints[x];m.points.push(new mxPoint(y.x/c-g.x,y.y/c-g.y))}}if(null==e){var f=this.graph.view.translate;c=this.graph.view.scale;(y=null!=this.originalPoint?new mxPoint(this.originalPoint.x/c-f.x,this.originalPoint.y/c-f.y):new mxPoint(this.currentPoint.x/c-f.x,this.currentPoint.y/c-f.y)).x-=this.graph.panDx/this.graph.view.scale,y.y-=this.graph.panDy/this.graph.view.scale,m.setTerminalPoint(y,!1)}this.fireEvent(new mxEventObject(mxEvent.CONNECT,"cell",l,"terminal",e,"event",n,"target",i,"terminalInserted",s))}}catch(t){mxLog.show(),mxLog.debug(t.message)}finally{o.endUpdate()}this.select&&this.selectCells(l,s?e:null)}},mxConnectionHandler.prototype.calcFloatingStartPointConstraint=function(t,e){var n,i,o=this.edgeState.absolutePoints,s=(o[0],o[0].x),l=o[0].y,r=e.geometry.x,a=e.geometry.y;n=(s-r)/e.geometry.width,i=(l-a)/e.geometry.height;var h=new mxConnectionConstraint,d=new mxPoint(n,i);h.point=d,this.sourceConstraint=h},mxConnectionHandler.prototype.calcFloatingEndPointConstraint=function(t,e){var n,i,o=this.edgeState.absolutePoints,s=o[o.length-1],l=s.x,r=s.y,a=e.geometry.x,h=e.geometry.y;n=(l-a)/e.geometry.width,i=(r-h)/e.geometry.height;var d=new mxConnectionConstraint,u=new mxPoint(n,i);d.point=u,this.constraintHandler.currentConstraint=d},mxConnectionHandler.prototype.checkIsSamePostion=function(t,e,n,i,o){var s=this.graph.getAllEdges([e]),l=this.graph.getAllEdges([n]),r=[t],a=[t];if(!(!s&&!l||s.length<=1&&l.length<=1)){for(var h=0;h<s.length;++h)if(t.id!=s[h].id){var d=this.graph.view.getState(s[h]);i.point.x==d.style.exitX&&i.point.y==d.style.exitY&&r.push(s[h])}for(h=0;h<l.length;++h)if(t.id!=l[h].id){d=this.graph.view.getState(l[h]);o.point.x==d.style.entryX&&o.point.y==d.style.entryY&&a.push(l[h])}1<r.length&&this.resetSamePosEdgeStyle(r,"exit"),1<a.length&&this.resetSamePosEdgeStyle(a,"entry")}},mxConnectionHandler.prototype.resetSamePosEdgeStyle=function(t,e){for(var n=0;n<t.length-1;++n){var i=this.graph.view.getState(t[n]),o=this.graph.view.getState(t[n+1]);"exit"==e?0==i.exitX||1==o.exitX?(0==n&&i.exitY,o.exitY):0!=i.exitY&&1!=o.exitY||(0==n&&i.exitY,o.exitX):0==i.entryX||1==o.entryX?(0==n&&i.exitY,o.entryY):0!=i.entryY&&1!=o.entryY||(0==n&&i.exitY,o.entryX)}},mxConnectionHandler.prototype.selectCells=function(t,e){this.graph.setSelectionCell(t)},mxConnectionHandler.prototype.insertEdge=function(t,e,n,i,o,s){if(null==this.factoryMethod)return this.graph.insertEdge(t,e,n,i,o,s);var l=this.createEdge(n,i,o,s);return l=this.graph.addEdge(l,t,i,o)},mxConnectionHandler.prototype.createTargetVertex=function(t,e){for(var n=this.graph.getCellGeometry(e);null!=n&&n.relative;)e=this.graph.getModel().getParent(e),n=this.graph.getCellGeometry(e);var i=this.graph.cloneCells([e])[0];if(null!=(n=this.graph.getModel().getGeometry(i))){var o=this.graph.view.translate,s=this.graph.view.scale,l=new mxPoint(this.currentPoint.x/s-o.x,this.currentPoint.y/s-o.y);n.x=Math.round(l.x-n.width/2-this.graph.panDx/s),n.y=Math.round(l.y-n.height/2-this.graph.panDy/s);var r=this.getAlignmentTolerance();if(0<r){var a=this.graph.view.getState(e);if(null!=a){var h=a.x/s-o.x,d=a.y/s-o.y;Math.abs(h-n.x)<=r&&(n.x=Math.round(h)),Math.abs(d-n.y)<=r&&(n.y=Math.round(d))}}}return i},mxConnectionHandler.prototype.getAlignmentTolerance=function(t){return this.graph.isGridEnabled()?this.graph.gridSize/2:this.graph.tolerance},mxConnectionHandler.prototype.createEdge=function(t,e,n,i){var o=null;if(null!=this.factoryMethod&&(o=this.factoryMethod(e,n,i)),null==o){(o=new mxCell(t||"")).setEdge(!0),o.setStyle(i);var s=new mxGeometry;s.relative=!0,o.setGeometry(s)}return o},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)},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(t){this.enabled=t},mxConstraintHandler.prototype.reset=function(){if(null!=this.focusIcons){for(var t=0;t<this.focusIcons.length;t++)this.focusIcons[t].destroy();this.focusIcons=null}null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null),this.currentConstraint=null,this.currentFocusArea=null,this.currentPoint=null,this.currentFocus=null,this.focusPoints=null},mxConstraintHandler.prototype.getTolerance=function(t){return this.graph.getTolerance()},mxConstraintHandler.prototype.getImageForConstraint=function(t,e,n){return this.pointImage},mxConstraintHandler.prototype.isEventIgnored=function(t,e){return!1},mxConstraintHandler.prototype.isStateIgnored=function(t,e){return!1},mxConstraintHandler.prototype.destroyIcons=function(){if(null!=this.focusIcons){for(var t=0;t<this.focusIcons.length;t++)this.focusIcons[t].destroy();this.focusIcons=null,this.focusPoints=null}},mxConstraintHandler.prototype.destroyFocusHighlight=function(){null!=this.focusHighlight&&(this.focusHighlight.destroy(),this.focusHighlight=null)},mxConstraintHandler.prototype.isKeepFocusEvent=function(t){return mxEvent.isShiftDown(t.getEvent())},mxConstraintHandler.prototype.getCellForEvent=function(t,e){var n=t.getCell();if(null!=n||null==e||t.getGraphX()==e.x&&t.getGraphY()==e.y||(n=this.graph.getCellAt(e.x,e.y)),null!=n&&!this.graph.isCellConnectable(n)){var i=this.graph.getModel().getParent(n);this.graph.getModel().isVertex(i)&&this.graph.isCellConnectable(i)&&(n=i)}return this.graph.isCellLocked(n)?null:n},mxConstraintHandler.prototype.update=function(t,e,n,i){if(this.isEnabled()&&!this.isEventIgnored(t)){null==this.mouseleaveHandler&&null!=this.graph.container&&(this.mouseleaveHandler=mxUtils.bind(this,function(){this.reset()}),mxEvent.addListener(this.graph.container,"mouseleave",this.resetHandler));var o=this.getTolerance(t),s=new mxRectangle((null!=i?i.x:t.getGraphX())-o,(null!=i?i.y:t.getGraphY())-o,2*o,2*o),l=new mxRectangle(t.getGraphX()-o,t.getGraphY()-o,2*o,2*o),r=this.graph.view.getState(this.getCellForEvent(t,i));this.isKeepFocusEvent(t)||null!=this.currentFocusArea&&null!=this.currentFocus&&null==r&&this.graph.getModel().isVertex(this.currentFocus.cell)&&mxUtils.intersects(this.currentFocusArea,l)||r==this.currentFocus||(this.currentFocusArea=null,this.currentFocus=null,this.setFocus(t,r,e)),this.currentConstraint=null;var a=this.currentPoint=null;if(null!=this.focusIcons&&null!=this.constraints&&(null==r||this.currentFocus==r))for(var h=l.getCenterX(),d=l.getCenterY(),u=0;u<this.focusIcons.length;u++){var p=h-this.focusIcons[u].bounds.getCenterX(),m=d-this.focusIcons[u].bounds.getCenterY(),c=p*p+m*m;if((this.intersects(this.focusIcons[u],l,e,n)||null!=i&&this.intersects(this.focusIcons[u],s,e,n))&&(null==a||c<a)){if(this.currentConstraint=this.constraints[u],this.currentPoint=this.focusPoints[u],a=c,(c=this.focusIcons[u].bounds.clone()).grow(mxConstants.HIGHLIGHT_SIZE+1),c.width-=1,c.height-=1,null==this.focusHighlight){var g=this.createHighlightShape();g.dialect=this.graph.dialect==mxConstants.DIALECT_SVG?mxConstants.DIALECT_SVG:mxConstants.DIALECT_VML,g.pointerEvents=!1,g.init(this.graph.getView().getOverlayPane()),this.focusHighlight=g;var x=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:r});mxEvent.redirectMouseEvents(g.node,this.graph,x)}this.focusHighlight.bounds=c,this.focusHighlight.redraw()}}null==this.currentConstraint&&this.destroyFocusHighlight()}else this.currentConstraint=null,this.currentFocus=null,this.currentPoint=null},mxConstraintHandler.prototype.redraw=function(){if(null!=this.currentFocus&&null!=this.constraints&&null!=this.focusIcons){var t=this.graph.view.getState(this.currentFocus.cell);this.currentFocus=t,this.currentFocusArea=new mxRectangle(t.x,t.y,t.width,t.height);for(var e=0;e<this.constraints.length;e++){var n=this.graph.getConnectionPoint(t,this.constraints[e]),i=this.getImageForConstraint(t,this.constraints[e],n),o=new mxRectangle(Math.round(n.x-i.width/2),Math.round(n.y-i.height/2),i.width,i.height);this.focusIcons[e].bounds=o,this.focusIcons[e].redraw(),this.currentFocusArea.add(this.focusIcons[e].bounds),this.focusPoints[e]=n}}},mxConstraintHandler.prototype.setFocus=function(t,e,n){if(this.constraints=null!=e&&!this.isStateIgnored(e,n)&&this.graph.isCellConnectable(e.cell)?this.isEnabled()&&this.graph.getAllConnectionConstraints(e,n)||[]:null,null!=this.constraints){if(this.currentFocus=e,this.currentFocusArea=new mxRectangle(e.x,e.y,e.width,e.height),null!=this.focusIcons){for(var i=0;i<this.focusIcons.length;i++)this.focusIcons[i].destroy();this.focusIcons=null,this.focusPoints=null}this.focusPoints=[],this.focusIcons=[];for(i=0;i<this.constraints.length;i++){var o=this.graph.getConnectionPoint(e,this.constraints[i]),s=this.getImageForConstraint(e,this.constraints[i],o),l=s.src,r=new mxImageShape(new mxRectangle(Math.round(o.x-s.width/2),Math.round(o.y-s.height/2),s.width,s.height),l);r.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,r.preserveImageAspect=!1,r.init(this.graph.getView().getDecoratorPane()),!mxClient.IS_QUIRKS&&8!=document.documentMode||mxEvent.addListener(r.node,"dragstart",function(t){return mxEvent.consume(t),!1}),null!=r.node.previousSibling&&r.node.parentNode.insertBefore(r.node,r.node.parentNode.firstChild);var a=mxUtils.bind(this,function(){return null!=this.currentFocus?this.currentFocus:e});r.redraw(),mxEvent.redirectMouseEvents(r.node,this.graph,a),this.currentFocusArea.add(r.bounds),this.focusIcons.push(r),this.focusPoints.push(o)}this.currentFocusArea.grow(this.getTolerance(t))}else this.destroyIcons(),this.destroyFocusHighlight()},mxConstraintHandler.prototype.createHighlightShape=function(){var t=new mxRectangleShape(null,this.highlightColor,this.highlightColor,mxConstants.HIGHLIGHT_STROKEWIDTH);return t.opacity=mxConstants.HIGHLIGHT_OPACITY,t},mxConstraintHandler.prototype.intersects=function(t,e,n,i){return mxUtils.intersects(t.bounds,e)},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)},mxRubberband.prototype.defaultOpacity=20,mxRubberband.prototype.enabled=!0,mxRubberband.prototype.div=null,mxRubberband.prototype.sharedDiv=null,mxRubberband.prototype.currentX=0,mxRubberband.prototype.currentY=0,mxRubberband.prototype.fadeOut=!1,mxRubberband.prototype.isEnabled=function(){return this.enabled},mxRubberband.prototype.setEnabled=function(t){this.enabled=t},mxRubberband.prototype.isForceRubberbandEvent=function(t){return mxEvent.isAltDown(t.getEvent())},mxRubberband.prototype.mouseDown=function(t,e){if(!e.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&null==e.getState()&&!mxEvent.isMultiTouchEvent(e.getEvent())){var n=mxUtils.getOffset(this.graph.container),i=mxUtils.getScrollOrigin(this.graph.container);i.x-=n.x,i.y-=n.y,this.start(e.getX()+i.x,e.getY()+i.y),e.consume(!1)}},mxRubberband.prototype.start=function(t,e){this.first=new mxPoint(t,e);var i=this.graph.container;function n(t){var e=new mxMouseEvent(t),n=mxUtils.convertPoint(i,e.getX(),e.getY());return e.graphX=n.x,e.graphY=n.y,e}this.dragHandler=mxUtils.bind(this,function(t){this.mouseMove(this.graph,n(t))}),this.dropHandler=mxUtils.bind(this,function(t){this.mouseUp(this.graph,n(t))}),mxClient.IS_FF&&mxEvent.addGestureListeners(document,null,this.dragHandler,this.dropHandler)},mxRubberband.prototype.mouseMove=function(t,e){if(!e.isConsumed()&&null!=this.first){var n=mxUtils.getScrollOrigin(this.graph.container),i=mxUtils.getOffset(this.graph.container);n.x-=i.x,n.y-=i.y;var o=e.getX()+n.x,s=e.getY()+n.y,l=this.first.x-o,r=this.first.y-s,a=this.graph.tolerance;(null!=this.div||Math.abs(l)>a||Math.abs(r)>a)&&(null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(o,s),e.consume())}},mxRubberband.prototype.createShape=function(){null==this.sharedDiv&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity)),this.graph.container.appendChild(this.sharedDiv);var t=this.sharedDiv;return mxClient.IS_SVG&&(!mxClient.IS_IE||10<=document.documentMode)&&this.fadeOut&&(this.sharedDiv=null),t},mxRubberband.prototype.isActive=function(t,e){return null!=this.div&&"none"!=this.div.style.display},mxRubberband.prototype.mouseUp=function(t,e){var n=this.isActive();this.reset(),n&&(this.execute(e.getEvent()),e.consume())},mxRubberband.prototype.execute=function(t){var e=new mxRectangle(this.x,this.y,this.width,this.height);this.graph.selectRegion(e,t)},mxRubberband.prototype.reset=function(){if(null!=this.div)if(mxClient.IS_SVG&&(!mxClient.IS_IE||10<=document.documentMode)&&this.fadeOut){var t=this.div;mxUtils.setPrefixedStyle(t.style,"transition","all 0.2s linear"),t.style.pointerEvents="none",t.style.opacity=0,window.setTimeout(function(){t.parentNode.removeChild(t)},200)}else this.div.parentNode.removeChild(this.div);mxEvent.removeGestureListeners(document,null,this.dragHandler,this.dropHandler),this.dragHandler=null,this.dropHandler=null,this.currentX=0,this.currentY=0,this.first=null,this.div=null},mxRubberband.prototype.update=function(t,e){this.currentX=t,this.currentY=e,this.repaint()},mxRubberband.prototype.repaint=function(){if(null!=this.div){var t=this.currentX-this.graph.panDx,e=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,t),this.y=Math.min(this.first.y,e),this.width=Math.max(this.first.x,t)-this.x,this.height=Math.max(this.first.y,e)-this.y;var n=mxClient.IS_VML?this.graph.panDx:0,i=mxClient.IS_VML?this.graph.panDy:0;this.div.style.left=this.x+n+"px",this.div.style.top=this.y+i+"px",this.div.style.width=Math.max(1,this.width)+"px",this.div.style.height=Math.max(1,this.height)+"px"}},mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.forceRubberbandHandler),this.graph.removeListener(this.panHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))},mxHandle.prototype.cursor="default",mxHandle.prototype.image=null,mxHandle.prototype.ignoreGrid=!1,mxHandle.prototype.getPosition=function(t){},mxHandle.prototype.setPosition=function(t,e,n){},mxHandle.prototype.execute=function(){},mxHandle.prototype.copyStyle=function(t){this.graph.setCellStyles(t,this.state.style[t],[this.state.cell])},mxHandle.prototype.processEvent=function(t){var e=this.graph.view.scale,n=this.graph.view.translate,i=new mxPoint(t.getGraphX()/e-n.x,t.getGraphY()/e-n.y);null!=this.shape&&null!=this.shape.bounds&&(i.x-=this.shape.bounds.width/e/4,i.y-=this.shape.bounds.height/e/4);var o=-mxUtils.toRadians(this.getRotation()),s=-mxUtils.toRadians(this.getTotalRotation())-o;i=this.flipPoint(this.rotatePoint(this.snapPoint(this.rotatePoint(i,o),this.ignoreGrid||!this.graph.isGridEnabledEvent(t.getEvent())),s)),this.setPosition(this.state.getPaintBounds(),i,t),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 t=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(t),this.initShape(t)},mxHandle.prototype.createShape=function(t){return new mxRectangleShape(new mxRectangle(0,0,mxConstants.HANDLE_SIZE,mxConstants.HANDLE_SIZE),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxHandle.prototype.initShape=function(t){t&&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 t=this.getPosition(this.state.getPaintBounds());if(null!=t){var e=mxUtils.toRadians(this.getTotalRotation());t=this.rotatePoint(this.flipPoint(t),e);var n=this.graph.view.scale,i=this.graph.view.translate;this.shape.bounds.x=Math.floor((t.x+i.x)*n-this.shape.bounds.width/2),this.shape.bounds.y=Math.floor((t.y+i.y)*n-this.shape.bounds.height/2),this.shape.redraw()}}},mxHandle.prototype.isHtmlRequired=function(){return null!=this.state.text&&this.state.text.node.parentNode==this.graph.container},mxHandle.prototype.rotatePoint=function(t,e){var n=this.state.getCellBounds(),i=new mxPoint(n.getCenterX(),n.getCenterY()),o=Math.cos(e),s=Math.sin(e);return mxUtils.getRotatedPoint(t,o,s,i)},mxHandle.prototype.flipPoint=function(t){if(null!=this.state.shape){var e=this.state.getCellBounds();this.state.shape.flipH&&(t.x=2*e.x+e.width-t.x),this.state.shape.flipV&&(t.y=2*e.y+e.height-t.y)}return t},mxHandle.prototype.snapPoint=function(t,e){return e||(t.x=this.graph.snap(t.x),t.y=this.graph.snap(t.y)),t},mxHandle.prototype.setVisible=function(t){null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display=t?"":"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)},mxVertexHandler.prototype.graph=null,mxVertexHandler.prototype.state=null,mxVertexHandler.prototype.singleSizer=!1,mxVertexHandler.prototype.index=null,mxVertexHandler.prototype.allowHandleBoundsCheck=!0,mxVertexHandler.prototype.handleImage=null,mxVertexHandler.prototype.tolerance=0,mxVertexHandler.prototype.rotationEnabled=!1,mxVertexHandler.prototype.parentHighlightEnabled=!1,mxVertexHandler.prototype.rotationRaster=!0,mxVertexHandler.prototype.rotationCursor="crosshair",mxVertexHandler.prototype.livePreview=!1,mxVertexHandler.prototype.manageSizers=!1,mxVertexHandler.prototype.constrainGroupByChildren=!1,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxVertexHandler.prototype.horizontalOffset=0,mxVertexHandler.prototype.verticalOffset=0,mxVertexHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.selectionBorder=this.createSelectionShape(this.bounds),this.selectionBorder.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.pointerEvents=!1,this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.selectionBorder.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state),this.graph.isCellMovable(this.state.cell)&&this.selectionBorder.setCursor(mxConstants.CURSOR_MOVABLE_VERTEX),mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells){var t=this.graph.isCellResizable(this.state.cell);if(this.sizers=[],t||this.graph.isLabelMovable(this.state.cell)&&2<=this.state.width&&2<=this.state.height){var e=0;t&&(this.singleSizer||(this.sizers.push(this.createSizer("nw-resize",e++)),this.sizers.push(this.createSizer("n-resize",e++)),this.sizers.push(this.createSizer("ne-resize",e++)),this.sizers.push(this.createSizer("w-resize",e++)),this.sizers.push(this.createSizer("e-resize",e++)),this.sizers.push(this.createSizer("sw-resize",e++)),this.sizers.push(this.createSizer("s-resize",e++))),this.sizers.push(this.createSizer("se-resize",e++)));var n=this.graph.model.getGeometry(this.state.cell);null==n||n.relative||this.graph.isSwimlane(this.state.cell)||!this.graph.isLabelMovable(this.state.cell)||(this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}else this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellResizable(this.state.cell)&&this.state.width<2&&this.state.height<2&&(this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,mxEvent.LABEL_HANDLE,null,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}this.customHandles=this.createCustomHandles(),this.redraw(),this.constrainGroupByChildren&&this.updateMinBounds()},mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)&&2<=this.state.width&&2<=this.state.height},mxVertexHandler.prototype.isConstrainedEvent=function(t){return mxEvent.isShiftDown(t.getEvent())||"fixed"==this.state.style[mxConstants.STYLE_ASPECT]},mxVertexHandler.prototype.isCenteredEvent=function(t,e){return!1},mxVertexHandler.prototype.createCustomHandles=function(){return null},mxVertexHandler.prototype.updateMinBounds=function(){var t=this.graph.getChildCells(this.state.cell);if(0<t.length&&(this.minBounds=this.graph.view.getBounds(t),null!=this.minBounds)){var e=this.state.view.scale,n=this.state.view.translate;this.minBounds.x-=this.state.x,this.minBounds.y-=this.state.y,this.minBounds.x/=e,this.minBounds.y/=e,this.minBounds.width/=e,this.minBounds.height/=e,this.x0=this.state.x/e-n.x,this.y0=this.state.y/e-n.y}},mxVertexHandler.prototype.getSelectionBounds=function(t){return new mxRectangle(Math.round(t.x),Math.round(t.y),Math.round(t.width),Math.round(t.height))},mxVertexHandler.prototype.createParentHighlightShape=function(t){return this.createSelectionShape(t)},mxVertexHandler.prototype.createSelectionShape=function(t){var e=new mxRectangleShape(t,null,this.getSelectionColor());return e.strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxVertexHandler.prototype.getSelectionColor=function(){return mxConstants.VERTEX_SELECTION_COLOR},mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH},mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED},mxVertexHandler.prototype.createSizer=function(t,e,n,i){var o=new mxRectangle(0,0,n=n||mxConstants.HANDLE_SIZE,n),s=this.createSizerShape(o,e,i);return s.isHtmlAllowed()&&null!=this.state.text&&this.state.text.node.parentNode==this.graph.container?(s.bounds.height-=1,s.bounds.width-=1,s.dialect=mxConstants.DIALECT_STRICTHTML,s.init(this.graph.container)):(s.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,s.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(s.node,this.graph,this.state),this.graph.isEnabled()&&s.setCursor(t),this.isSizerVisible(e)||(s.visible=!1),s},mxVertexHandler.prototype.isSizerVisible=function(t){return!0},mxVertexHandler.prototype.createSizerShape=function(t,e,n){if(null==this.handleImage)return e==mxEvent.ROTATION_HANDLE?new mxEllipse(t,n||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(t,n||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR);var i=new mxImageShape(t=new mxRectangle(t.x,t.y,this.handleImage.width,this.handleImage.height),this.handleImage.src);return i.preserveImageAspect=!1,i},mxVertexHandler.prototype.moveSizerTo=function(t,e,n){null!=t&&(t.bounds.x=Math.floor(e-t.bounds.width/2),t.bounds.y=Math.floor(n-t.bounds.height/2),null!=t.node&&"none"!=t.node.style.display&&t.redraw())},mxVertexHandler.prototype.getHandleForEvent=function(e){var t=mxEvent.isMouseEvent(e.getEvent())?1:this.tolerance,n=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<t)?new mxRectangle(e.getGraphX()-t,e.getGraphY()-t,2*t,2*t):null;function i(t){return null!=t&&(e.isSource(t)||null!=n&&mxUtils.intersects(t.bounds,n)&&"none"!=t.node.style.display&&"hidden"!=t.node.style.visibility)}if(null!=this.customHandles&&this.isCustomHandleEvent(e))for(var o=this.customHandles.length-1;0<=o;o--)if(i(this.customHandles[o].shape))return mxEvent.CUSTOM_HANDLE-o;if(i(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(i(this.labelShape))return mxEvent.LABEL_HANDLE;if(null!=this.sizers)for(o=0;o<this.sizers.length;o++)if(i(this.sizers[o]))return o;return null},mxVertexHandler.prototype.isCustomHandleEvent=function(t){return!0},mxVertexHandler.prototype.mouseDown=function(t,e){var n=mxEvent.isMouseEvent(e.getEvent())?0:this.tolerance;if(!e.isConsumed()&&this.graph.isEnabled()&&(0<n||e.getState()==this.state)){var i=this.getHandleForEvent(e);null!=i&&(this.start(e.getGraphX(),e.getGraphY(),i),e.consume())}},mxVertexHandler.prototype.isLivePreviewBorder=function(){return null!=this.state.shape&&null==this.state.shape.fill&&null==this.state.shape.stroke},mxVertexHandler.prototype.start=function(t,e,n){this.inTolerance=!0,this.childOffsetX=0,this.childOffsetY=0,this.index=n,this.startX=t,this.startY=e;var i=this.state.view.graph.model,o=i.getParent(this.state.cell);if(this.state.view.currentRoot!=o&&(i.isVertex(o)||i.isEdge(o))&&(this.parentState=this.state.view.graph.view.getState(o)),this.selectionBorder.node.style.display=n==mxEvent.ROTATION_HANDLE?"inline":"none",this.livePreview&&!this.isLivePreviewBorder()||(this.preview=this.createSelectionShape(this.bounds),mxClient.IS_SVG&&0!=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")||null==this.state.text||this.state.text.node.parentNode!=this.graph.container?(this.preview.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane())):(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container))),this.livePreview){this.hideSizers(),n==mxEvent.ROTATION_HANDLE?this.rotationShape.node.style.display="":n==mxEvent.LABEL_HANDLE?this.labelShape.node.style.display="":null!=this.sizers&&null!=this.sizers[n]?this.sizers[n].node.style.display="":n<=mxEvent.CUSTOM_HANDLE&&null!=this.customHandles&&this.customHandles[mxEvent.CUSTOM_HANDLE-n].setVisible(!0);var s=this.graph.getEdges(this.state.cell);this.edgeHandlers=[];for(var l=0;l<s.length;l++){var r=this.graph.selectionCellsHandler.getHandler(s[l]);null!=r&&this.edgeHandlers.push(r)}}},mxVertexHandler.prototype.setHandlesVisible=function(t){if(null!=this.sizers)for(var e=0;e<this.sizers.length;e++)this.sizers[e].node.style.display=t?"":"none";if(null!=this.customHandles)for(e=0;e<this.customHandles.length;e++)this.customHandles[e].setVisible(t)},mxVertexHandler.prototype.hideSizers=function(){this.setHandlesVisible(!1)},mxVertexHandler.prototype.checkTolerance=function(t){this.inTolerance&&null!=this.startX&&null!=this.startY&&(mxEvent.isMouseEvent(t.getEvent())||Math.abs(t.getGraphX()-this.startX)>this.graph.tolerance||Math.abs(t.getGraphY()-this.startY)>this.graph.tolerance)&&(this.inTolerance=!1)},mxVertexHandler.prototype.updateHint=function(t){},mxVertexHandler.prototype.removeHint=function(){},mxVertexHandler.prototype.roundAngle=function(t){return Math.round(10*t)/10},mxVertexHandler.prototype.roundLength=function(t){return Math.round(t)},mxVertexHandler.prototype.mouseMove=function(t,e){e.isConsumed()||null==this.index?this.graph.isMouseDown||null==this.getHandleForEvent(e)||e.consume(!1):(this.checkTolerance(e),this.inTolerance||(this.index<=mxEvent.CUSTOM_HANDLE?null!=this.customHandles&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].active=!0):this.index==mxEvent.LABEL_HANDLE?this.moveLabel(e):this.index==mxEvent.ROTATION_HANDLE?this.rotateVertex(e):this.resizeVertex(e),this.updateHint(e)),e.consume())},mxVertexHandler.prototype.moveLabel=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),n=this.graph.view.translate,i=this.graph.view.scale;this.graph.isGridEnabledEvent(t.getEvent())&&(e.x=(this.graph.snap(e.x/i-n.x)+n.x)*i,e.y=(this.graph.snap(e.y/i-n.y)+n.y)*i);var o=null!=this.rotationShape?this.sizers.length-2:this.sizers.length-1;this.moveSizerTo(this.sizers[o],e.x,e.y)},mxVertexHandler.prototype.rotateVertex=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),n=this.state.x+this.state.width/2-e.x,i=this.state.y+this.state.height/2-e.y;if(this.currentAlpha=0!=n?180*Math.atan(i/n)/Math.PI+90:i<0?180:0,0<n&&(this.currentAlpha-=180),this.rotationRaster&&this.graph.isGridEnabledEvent(t.getEvent())){n=e.x-this.state.getCenterX(),i=e.y-this.state.getCenterY();var o=3*Math.abs(Math.sqrt(n*n+i*i)-20),s=Math.max(1,5*Math.min(3,Math.max(0,Math.round(80/Math.abs(o)))));this.currentAlpha=Math.round(this.currentAlpha/s)*s}else this.currentAlpha=this.roundAngle(this.currentAlpha);this.selectionBorder.rotation=this.currentAlpha,this.selectionBorder.redraw(),this.livePreview&&this.redrawHandles()},mxVertexHandler.prototype.resizeVertex=function(t){var e=this.graph.minimumGraphSize.width,n=this.graph.minimumGraphSize.height;t.graphY<50&&(t.graphY=50),t.graphX<50&&(t.graphX=50),t.graphY>n-10&&(t.graphY=n-10),t.graphX>e-5&&(t.graphX=e-5);var i=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),o=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),s=new mxPoint(t.getGraphX(),t.getGraphY()),l=this.graph.view.translate,r=this.graph.view.scale,a=Math.cos(-o),h=Math.sin(-o),d=h*(y=s.x-this.startX)+a*(f=s.y-this.startY);y=a*y-h*f,f=d;var u=this.graph.getCellGeometry(this.state.cell);this.unscaledBounds=this.union(u,y/r,f/r,this.index,this.graph.isGridEnabledEvent(t.getEvent()),1,new mxPoint(0,0),this.isConstrainedEvent(t),this.isCenteredEvent(this.state,t));var p=this.state.cell.isHelpfulText?80:160,m=this.state.cell.isHelpfulText?40:140;if(this.unscaledBounds.width<p&&(this.unscaledBounds.width=p),this.unscaledBounds.height<m&&(this.unscaledBounds.height=m),!u.relative){var c=this.graph.getMaximumGraphBounds();if(null!=c&&null!=this.parentState&&((c=mxRectangle.fromRectangle(c)).x-=(this.parentState.x-l.x*r)/r,c.y-=(this.parentState.y-l.y*r)/r),this.graph.isConstrainChild(this.state.cell)){var g=this.graph.getCellContainmentArea(this.state.cell);if(null!=g){var x=this.graph.getOverlap(this.state.cell);0<x&&((g=mxRectangle.fromRectangle(g)).x-=g.width*x,g.y-=g.height*x,g.width+=2*g.width*x,g.height+=2*g.height*x),null==c?c=g:(c=mxRectangle.fromRectangle(c)).intersect(g)}}null!=c&&(this.unscaledBounds.x<c.x&&(this.unscaledBounds.width-=c.x-this.unscaledBounds.x,this.unscaledBounds.x=c.x),this.unscaledBounds.y<c.y&&(this.unscaledBounds.height-=c.y-this.unscaledBounds.y,this.unscaledBounds.y=c.y),this.unscaledBounds.x+this.unscaledBounds.width>c.x+c.width&&(this.unscaledBounds.width-=this.unscaledBounds.x+this.unscaledBounds.width-c.x-c.width),this.unscaledBounds.y+this.unscaledBounds.height>c.y+c.height&&(this.unscaledBounds.height-=this.unscaledBounds.y+this.unscaledBounds.height-c.y-c.height))}this.bounds=new mxRectangle((null!=this.parentState?this.parentState.x:l.x*r)+this.unscaledBounds.x*r,(null!=this.parentState?this.parentState.y:l.y*r)+this.unscaledBounds.y*r,this.unscaledBounds.width*r,this.unscaledBounds.height*r),u.relative&&null!=this.parentState&&(this.bounds.x+=this.state.x-this.parentState.x,this.bounds.y+=this.state.y-this.parentState.y),a=Math.cos(o),h=Math.sin(o);var y,f,v=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY()),C=a*(y=v.x-i.x)-h*(f=v.y-i.y)-y,E=h*y+a*f-f,w=this.bounds.x-this.state.x,S=this.bounds.y-this.state.y,b=a*w-h*S,T=h*w+a*S;this.bounds.x+=C,this.bounds.y+=E,this.unscaledBounds.x=this.roundLength(this.unscaledBounds.x+C/r),this.unscaledBounds.y=this.roundLength(this.unscaledBounds.y+E/r),this.unscaledBounds.width=this.roundLength(this.unscaledBounds.width),this.unscaledBounds.height=this.roundLength(this.unscaledBounds.height),this.graph.isCellCollapsed(this.state.cell)||0==C&&0==E?(this.childOffsetX=0,this.childOffsetY=0):(this.childOffsetX=this.state.x-this.bounds.x+b,this.childOffsetY=this.state.y-this.bounds.y+T),this.livePreview&&this.updateLivePreview(t),null!=this.preview&&this.drawPreview();var A=document.getElementById("wf-word-line-"+this.state.cell.id);A&&this.state.cell.isHelpfulText&&(A.style.width=this.bounds.width+"px",A.style.height=this.bounds.height+"px")},mxVertexHandler.prototype.updateLivePreview=function(t){var e=this.graph.view.scale,n=this.graph.view.translate,i=this.state.clone();this.state.x=this.bounds.x,this.state.y=this.bounds.y,this.state.origin=new mxPoint(this.state.x/e-n.x,this.state.y/e-n.y),this.state.width=this.bounds.width,this.state.height=this.bounds.height,this.state.unscaledWidth=null;var o=this.state.absoluteOffset;o=new mxPoint(o.x,o.y),this.state.absoluteOffset.x=0,this.state.absoluteOffset.y=0;var s=this.graph.getCellGeometry(this.state.cell);if(null!=s){var l=s.offset||this.EMPTY_POINT;null==l||s.relative||(this.state.absoluteOffset.x=this.state.view.scale*l.x,this.state.absoluteOffset.y=this.state.view.scale*l.y),this.state.view.updateVertexLabelOffset(this.state)}this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate(),this.redrawHandles(),this.state.setState(i)},mxVertexHandler.prototype.mouseUp=function(t,e){if(null!=this.index&&null!=this.state){var n=new mxPoint(e.getGraphX(),e.getGraphY());this.graph.getModel().beginUpdate();try{if(this.index<=mxEvent.CUSTOM_HANDLE)null!=this.customHandles&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].active=!1,this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].execute());else if(this.index==mxEvent.ROTATION_HANDLE)if(null!=this.currentAlpha){var i=this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0);0!=i&&this.rotateCell(this.state.cell,i)}else this.rotateClick();else{var o=this.graph.isGridEnabledEvent(e.getEvent()),s=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),l=Math.cos(-s),r=Math.sin(-s),a=n.x-this.startX,h=n.y-this.startY,d=r*a+l*h;a=l*a-r*h,h=d;var u=this.graph.view.scale,p=this.isRecursiveResize(this.state,e);this.resizeCell(this.state.cell,this.roundLength(a/u),this.roundLength(h/u),this.index,o,this.isConstrainedEvent(e),p)}}finally{this.graph.getModel().endUpdate()}e.consume(),this.reset()}},mxVertexHandler.prototype.isRecursiveResize=function(t,e){return this.graph.isRecursiveResize(this.state)},mxVertexHandler.prototype.rotateClick=function(){},mxVertexHandler.prototype.rotateCell=function(t,e,n){if(0!=e){var i=this.graph.getModel();if(i.isVertex(t)||i.isEdge(t)){if(!i.isEdge(t)){var o=this.graph.view.getState(t),s=null!=o?o.style:this.graph.getCellStyle(t);if(null!=s){var l=(s[mxConstants.STYLE_ROTATION]||0)+e;this.graph.setCellStyles(mxConstants.STYLE_ROTATION,l,[t])}}var r=this.graph.getCellGeometry(t);if(null!=r){var a=this.graph.getCellGeometry(n);if(null==a||i.isEdge(n)||((r=r.clone()).rotate(e,new mxPoint(a.width/2,a.height/2)),i.setGeometry(t,r)),i.isVertex(t)&&!r.relative||i.isEdge(t))for(var h=i.getChildCount(t),d=0;d<h;d++)this.rotateCell(i.getChildAt(t,d),e,t)}}}},mxVertexHandler.prototype.reset=function(){if(null!=this.sizers&&null!=this.index&&null!=this.sizers[this.index]&&"none"==this.sizers[this.index].node.style.display&&(this.sizers[this.index].node.style.display=""),this.currentAlpha=null,this.inTolerance=null,(this.index=null)!=this.preview&&(this.preview.destroy(),this.preview=null),this.livePreview&&null!=this.sizers)for(var t=0;t<this.sizers.length;t++)null!=this.sizers[t]&&(this.sizers[t].node.style.display="");if(null!=this.customHandles)for(t=0;t<this.customHandles.length;t++)this.customHandles[t].active?(this.customHandles[t].active=!1,this.customHandles[t].reset()):this.customHandles[t].setVisible(!0);null!=this.selectionBorder&&(this.selectionBorder.node.style.display="inline",this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview()),this.removeHint(),this.redrawHandles(),this.edgeHandlers=null,this.unscaledBounds=null},mxVertexHandler.prototype.resizeCell=function(t,e,n,i,o,s,l){var r=this.graph.model.getGeometry(t);if(null!=r)if(i==mxEvent.LABEL_HANDLE){var a=this.graph.view.scale;e=Math.round((this.labelShape.bounds.getCenterX()-this.startX)/a),n=Math.round((this.labelShape.bounds.getCenterY()-this.startY)/a),null==(r=r.clone()).offset?r.offset=new mxPoint(e,n):(r.offset.x+=e,r.offset.y+=n),this.graph.model.setGeometry(t,r)}else if(null!=this.unscaledBounds){a=this.graph.view.scale;0==this.childOffsetX&&0==this.childOffsetY||this.moveChildren(t,Math.round(this.childOffsetX/a),Math.round(this.childOffsetY/a)),this.graph.resizeCell(t,this.unscaledBounds,l)}},mxVertexHandler.prototype.moveChildren=function(t,e,n){for(var i=this.graph.getModel(),o=i.getChildCount(t),s=0;s<o;s++){var l=i.getChildAt(t,s),r=this.graph.getCellGeometry(l);null!=r&&((r=r.clone()).translate(e,n),i.setGeometry(l,r))}},mxVertexHandler.prototype.union=function(t,e,n,i,o,s,l,r,a){if(this.singleSizer){var h=t.x+t.width+e,d=t.y+t.height+n;o&&(h=this.graph.snap(h/s)*s,d=this.graph.snap(d/s)*s);var u=new mxRectangle(t.x,t.y,0,0);return u.add(new mxRectangle(h,d,0,0)),u}var p=t.width,m=t.height,c=t.x-l.x*s,g=c+p,x=t.y-l.y*s,y=x+m,f=c+p/2,v=x+m/2;4<i?(y+=n,o&&(y=this.graph.snap(y/s)*s)):i<3&&(x+=n,o&&(x=this.graph.snap(x/s)*s)),0==i||3==i||5==i?(c+=e,o&&(c=this.graph.snap(c/s)*s)):2!=i&&4!=i&&7!=i||(g+=e,o&&(g=this.graph.snap(g/s)*s));var C=g-c,E=y-x;if(r){var w=this.graph.getCellGeometry(this.state.cell);if(null!=w){var S=w.width/w.height;1==i||2==i||7==i||6==i?C=E*S:E=C/S,0==i&&(c=g-C,x=y-E)}}if(a){var b=f-(c+(C+=C-p)/2),T=v-(x+(E+=E-m)/2);c+=b,x+=T,g+=b,y+=T}C<0&&(c+=C,C=Math.abs(C)),E<0&&(x+=E,E=Math.abs(E));var A=new mxRectangle(c+l.x*s,x+l.y*s,C,E);return null!=this.minBounds&&(A.width=Math.max(A.width,this.minBounds.x*s+this.minBounds.width*s+Math.max(0,this.x0*s-A.x)),A.height=Math.max(A.height,this.minBounds.y*s+this.minBounds.height*s+Math.max(0,this.y0*s-A.y))),A},mxVertexHandler.prototype.redraw=function(){this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.redrawHandles(),this.drawPreview()},mxVertexHandler.prototype.getHandlePadding=function(){var t=new mxPoint(0,0),e=this.tolerance;return null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]&&(this.bounds.width<2*this.sizers[0].bounds.width+2*e||this.bounds.height<2*this.sizers[0].bounds.height+2*e)&&(e/=2,t.x=this.sizers[0].bounds.width+e,t.y=this.sizers[0].bounds.height+e),t},mxVertexHandler.prototype.redrawHandles=function(){var t=this.tolerance;this.horizontalOffset=0,this.verticalOffset=0;var e=this.bounds;if(null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]){if(null==this.index&&this.manageSizers&&8<=this.sizers.length){var n=this.getHandlePadding();this.horizontalOffset=n.x,this.verticalOffset=n.y,0==this.horizontalOffset&&0==this.verticalOffset||((e=new mxRectangle(e.x,e.y,e.width,e.height)).x-=this.horizontalOffset/2,e.width+=this.horizontalOffset,e.y-=this.verticalOffset/2,e.height+=this.verticalOffset),8<=this.sizers.length&&(e.width<2*this.sizers[0].bounds.width+2*t||e.height<2*this.sizers[0].bounds.height+2*t?(this.sizers[0].node.style.display="none",this.sizers[2].node.style.display="none",this.sizers[5].node.style.display="none",this.sizers[7].node.style.display="none"):(this.sizers[0].node.style.display="",this.sizers[2].node.style.display="",this.sizers[5].node.style.display="",this.sizers[7].node.style.display=""))}var i=e.x+e.width,o=e.y+e.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],i,o);else{var s=e.x+e.width/2,l=e.y+e.height/2;if(8<=this.sizers.length){var r=["nw-resize","n-resize","ne-resize","e-resize","se-resize","s-resize","sw-resize","w-resize"],a=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),h=Math.cos(a),d=Math.sin(a),u=Math.round(4*a/Math.PI),p=new mxPoint(e.getCenterX(),e.getCenterY()),m=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),h,d,p);this.moveSizerTo(this.sizers[0],m.x,m.y),this.sizers[0].setCursor(r[mxUtils.mod(0+u,r.length)]),m.x=s,m.y=e.y,m=mxUtils.getRotatedPoint(m,h,d,p),this.moveSizerTo(this.sizers[1],m.x,m.y),this.sizers[1].setCursor(r[mxUtils.mod(1+u,r.length)]),m.x=i,m.y=e.y,m=mxUtils.getRotatedPoint(m,h,d,p),this.moveSizerTo(this.sizers[2],m.x,m.y),this.sizers[2].setCursor(r[mxUtils.mod(2+u,r.length)]),m.x=e.x,m.y=l,m=mxUtils.getRotatedPoint(m,h,d,p),this.moveSizerTo(this.sizers[3],m.x,m.y),this.sizers[3].setCursor(r[mxUtils.mod(7+u,r.length)]),m.x=i,m.y=l,m=mxUtils.getRotatedPoint(m,h,d,p),this.moveSizerTo(this.sizers[4],m.x,m.y),this.sizers[4].setCursor(r[mxUtils.mod(3+u,r.length)]),m.x=e.x,m.y=o,m=mxUtils.getRotatedPoint(m,h,d,p),this.moveSizerTo(this.sizers[5],m.x,m.y),this.sizers[5].setCursor(r[mxUtils.mod(6+u,r.length)]),m.x=s,m.y=o,m=mxUtils.getRotatedPoint(m,h,d,p),this.moveSizerTo(this.sizers[6],m.x,m.y),this.sizers[6].setCursor(r[mxUtils.mod(5+u,r.length)]),m.x=i,m.y=o,m=mxUtils.getRotatedPoint(m,h,d,p),this.moveSizerTo(this.sizers[7],m.x,m.y),this.sizers[7].setCursor(r[mxUtils.mod(4+u,r.length)]),this.moveSizerTo(this.sizers[8],s+this.state.absoluteOffset.x,l+this.state.absoluteOffset.y)}else 2<=this.state.width&&2<=this.state.height?this.moveSizerTo(this.sizers[0],s+this.state.absoluteOffset.x,l+this.state.absoluteOffset.y):this.moveSizerTo(this.sizers[0],this.state.x,this.state.y)}}if(null!=this.rotationShape){a=mxUtils.toRadians(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),h=Math.cos(a),d=Math.sin(a),p=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),m=mxUtils.getRotatedPoint(this.getRotationHandlePosition(),h,d,p);null!=this.rotationShape.node&&(this.moveSizerTo(this.rotationShape,m.x,m.y),this.rotationShape.node.style.visibility=this.state.view.graph.isEditing()?"hidden":"")}if(null!=this.selectionBorder&&(this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")),null!=this.edgeHandlers)for(var c=0;c<this.edgeHandlers.length;c++)this.edgeHandlers[c].redraw();if(null!=this.customHandles)for(c=0;c<this.customHandles.length;c++){var g=this.customHandles[c].shape.node.style.display;this.customHandles[c].redraw(),this.customHandles[c].shape.node.style.display=g,this.customHandles[c].shape.node.style.visibility=this.graph.isEditing()?"hidden":""}this.updateParentHighlight()},mxVertexHandler.prototype.getRotationHandlePosition=function(){return new mxPoint(this.bounds.x+this.bounds.width/2,this.bounds.y+this.rotationHandleVSpacing)},mxVertexHandler.prototype.updateParentHighlight=function(){if(null!=this.selectionBorder)if(null!=this.parentHighlight){var t=this.graph.model.getParent(this.state.cell);if(this.graph.model.isVertex(t)){var e=this.graph.view.getState(t),n=this.parentHighlight.bounds;null==e||n.x==e.x&&n.y==e.y&&n.width==e.width&&n.height==e.height||(this.parentHighlight.bounds=e,this.parentHighlight.redraw())}else this.parentHighlight.destroy(),this.parentHighlight=null}else if(this.parentHighlightEnabled){t=this.graph.model.getParent(this.state.cell);if(this.graph.model.isVertex(t))null!=(e=this.graph.view.getState(t))&&(this.parentHighlight=this.createParentHighlightShape(e),this.parentHighlight.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.parentHighlight.pointerEvents=!1,this.parentHighlight.rotation=Number(e.style[mxConstants.STYLE_ROTATION]||"0"),this.parentHighlight.init(this.graph.getView().getOverlayPane()))}},mxVertexHandler.prototype.drawPreview=function(){null!=this.preview&&(this.preview.bounds=this.bounds,this.preview.node.parentNode==this.graph.container&&(this.preview.bounds.width=Math.max(0,this.preview.bounds.width-1),this.preview.bounds.height=Math.max(0,this.preview.bounds.height-1)),this.preview.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.preview.redraw());var t=this.bounds;t.x=t.x-5,t.y=t.y-5,t.width=t.width+10,t.height=t.height+10,this.selectionBorder.bounds=t,this.selectionBorder.redraw(),null!=this.parentHighlight&&this.parentHighlight.redraw()},mxVertexHandler.prototype.destroy=function(){if(null!=this.escapeHandler&&(this.state.view.graph.removeListener(this.escapeHandler),this.escapeHandler=null),null!=this.preview&&(this.preview.destroy(),this.preview=null),null!=this.parentHighlight&&(this.parentHighlight.destroy(),this.parentHighlight=null),null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null),this.labelShape=null,this.removeHint(),null!=this.sizers){for(var t=0;t<this.sizers.length;t++)this.sizers[t].destroy();this.sizers=null}if(null!=this.customHandles){for(t=0;t<this.customHandles.length;t++)this.customHandles[t].destroy();this.customHandles=null}},mxEdgeHandler.prototype.graph=null,mxEdgeHandler.prototype.state=null,mxEdgeHandler.prototype.marker=null,mxEdgeHandler.prototype.constraintHandler=null,mxEdgeHandler.prototype.error=null,mxEdgeHandler.prototype.shape=null,mxEdgeHandler.prototype.bends=null,mxEdgeHandler.prototype.labelShape=null,mxEdgeHandler.prototype.cloneEnabled=!0,mxEdgeHandler.prototype.addEnabled=!1,mxEdgeHandler.prototype.removeEnabled=!1,mxEdgeHandler.prototype.dblClickRemoveEnabled=!1,mxEdgeHandler.prototype.mergeRemoveEnabled=!1,mxEdgeHandler.prototype.straightRemoveEnabled=!1,mxEdgeHandler.prototype.virtualBendsEnabled=!1,mxEdgeHandler.prototype.virtualBendOpacity=20,mxEdgeHandler.prototype.parentHighlightEnabled=!1,mxEdgeHandler.prototype.preferHtml=!1,mxEdgeHandler.prototype.allowHandleBoundsCheck=!0,mxEdgeHandler.prototype.snapToTerminals=!1,mxEdgeHandler.prototype.handleImage=null,mxEdgeHandler.prototype.tolerance=0,mxEdgeHandler.prototype.outlineConnect=!1,mxEdgeHandler.prototype.manageLabelHandle=!1,mxEdgeHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.marker=this.createMarker(),this.constraintHandler=new mxConstraintHandler(this.graph),this.points=[],this.abspoints=this.getSelectionPoints(this.state),this.shape=this.createSelectionShape(this.abspoints),this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,this.shape.init(this.graph.getView().getOverlayPane()),this.shape.pointerEvents=!1,this.shape.setCursor(mxConstants.CURSOR_MOVABLE_EDGE),mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state),this.preferHtml=null!=this.state.text&&this.state.text.node.parentNode==this.graph.container,!this.preferHtml){var t=this.state.getVisibleTerminalState(!0);if(null!=t&&(this.preferHtml=null!=t.text&&t.text.node.parentNode==this.graph.container),!this.preferHtml){var e=this.state.getVisibleTerminalState(!1);null!=e&&(this.preferHtml=null!=e.text&&e.text.node.parentNode==this.graph.container)}}if(this.parentHighlightEnabled){var n=this.graph.model.getParent(this.state.cell);if(this.graph.model.isVertex(n)){var i=this.graph.view.getState(n);null!=i&&(this.parentHighlight=this.createParentHighlightShape(i),this.parentHighlight.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.parentHighlight.pointerEvents=!1,this.parentHighlight.rotation=Number(i.style[mxConstants.STYLE_ROTATION]||"0"),this.parentHighlight.init(this.graph.getView().getOverlayPane()))}}(this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells||mxGraphHandler.prototype.maxCells<=0)&&(this.bends=this.createBends(),this.isVirtualBendsEnabled()&&(this.virtualBends=this.createVirtualBends())),this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y),this.labelShape=this.createLabelHandleShape(),this.initBend(this.labelShape),this.labelShape.setCursor(mxConstants.CURSOR_LABEL_HANDLE),this.customHandles=this.createCustomHandles(),this.redraw()},mxEdgeHandler.prototype.createCustomHandles=function(){return null},mxEdgeHandler.prototype.isVirtualBendsEnabled=function(t){return this.virtualBendsEnabled&&(null==this.state.style[mxConstants.STYLE_EDGE]||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.NONE||1==this.state.style[mxConstants.STYLE_NOEDGESTYLE])&&"arrow"!=mxUtils.getValue(this.state.style,mxConstants.STYLE_SHAPE,null)},mxEdgeHandler.prototype.isAddPointEvent=function(t){return mxEvent.isShiftDown(t)},mxEdgeHandler.prototype.isRemovePointEvent=function(t){return mxEvent.isShiftDown(t)},mxEdgeHandler.prototype.getSelectionPoints=function(t){return t.absolutePoints},mxEdgeHandler.prototype.createParentHighlightShape=function(t){var e=new mxRectangleShape(t,null,this.getSelectionColor());return e.strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxEdgeHandler.prototype.createSelectionShape=function(t){var e=new this.state.shape.constructor;return e.outline=!0,e.apply(this.state),e.isDashed=this.isSelectionDashed(),e.stroke=this.getSelectionColor(),e.isShadow=!1,e},mxEdgeHandler.prototype.getSelectionColor=function(){return mxConstants.EDGE_SELECTION_COLOR},mxEdgeHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.EDGE_SELECTION_STROKEWIDTH},mxEdgeHandler.prototype.isSelectionDashed=function(){return mxConstants.EDGE_SELECTION_DASHED},mxEdgeHandler.prototype.isConnectableCell=function(t){return!0},mxEdgeHandler.prototype.getCellAt=function(t,e){return this.outlineConnect?null:this.graph.getCellAt(t,e)},mxEdgeHandler.prototype.createMarker=function(){var t=new mxCellMarker(this.graph),l=this;return t.getCell=function(t){var e=mxCellMarker.prototype.getCell.apply(this,arguments);if(e!=l.state.cell&&null!=e||null==l.currentPoint||(e=l.graph.getCellAt(l.currentPoint.x,l.currentPoint.y)),null!=e&&!this.graph.isCellConnectable(e)){var n=this.graph.getModel().getParent(e);this.graph.getModel().isVertex(n)&&this.graph.isCellConnectable(n)&&(e=n)}var i=l.graph.getModel();return(this.graph.isSwimlane(e)&&null!=l.currentPoint&&this.graph.hitsSwimlaneContent(e,l.currentPoint.x,l.currentPoint.y)||!l.isConnectableCell(e)||e==l.state.cell||null!=e&&!l.graph.connectableEdges&&i.isEdge(e)||i.isAncestor(l.state.cell,e))&&(e=null),this.graph.isCellConnectable(e)||(e=null),e},t.isValidState=function(t){var e=l.graph.getModel(),n=l.graph.view.getTerminalPort(t,l.graph.view.getState(e.getTerminal(l.state.cell,!l.isSource)),!l.isSource),i=null!=n?n.cell:null,o=l.isSource?t.cell:i,s=l.isSource?i:t.cell;return l.error=l.validateConnection(o,s),null==l.error},t},mxEdgeHandler.prototype.validateConnection=function(t,e){return this.graph.getEdgeValidationError(this.state.cell,t,e)},mxEdgeHandler.prototype.createBends=function(){for(var t=this.state.cell,n=[],i=0;i<this.abspoints.length;i++)if(this.isHandleVisible(i)){var e=0==i,o=i==this.abspoints.length-1,s=e||o;(s||this.graph.isCellBendable(t))&&mxUtils.bind(this,function(t){var e=this.createHandleShape(t);this.initBend(e,mxUtils.bind(this,mxUtils.bind(this,function(){this.dblClickRemoveEnabled&&this.removePoint(this.state,t)}))),this.isHandleEnabled(i)&&e.setCursor(s?mxConstants.CURSOR_TERMINAL_HANDLE:mxConstants.CURSOR_BEND_HANDLE),n.push(e),s||(this.points.push(new mxPoint(0,0)),e.node.style.visibility="hidden")})(i)}return n},mxEdgeHandler.prototype.createVirtualBends=function(){var t=this.state.cell,e=(this.abspoints[0],[]);if(this.graph.isCellBendable(t))for(var n=1;n<this.abspoints.length;n++)mxUtils.bind(this,function(t){this.initBend(t),t.setCursor(mxConstants.CURSOR_VIRTUAL_BEND_HANDLE),e.push(t)})(this.createHandleShape());return e},mxEdgeHandler.prototype.isHandleEnabled=function(t){return!0},mxEdgeHandler.prototype.isHandleVisible=function(t){var e=this.state.getVisibleTerminalState(!0),n=this.state.getVisibleTerminalState(!1),i=this.graph.getCellGeometry(this.state.cell);return(null!=i?this.graph.view.getEdgeStyle(this.state,i.points,e,n):null)!=mxEdgeStyle.EntityRelation||0==t||t==this.abspoints.length-1},mxEdgeHandler.prototype.createHandleShape=function(t){if(null!=this.handleImage){var e=new mxImageShape(new mxRectangle(0,0,this.handleImage.width,this.handleImage.height),this.handleImage.src);return e.preserveImageAspect=!1,e}var n=mxConstants.HANDLE_SIZE;return this.preferHtml&&(n-=1),new mxRectangleShape(new mxRectangle(0,0,n,n),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxEdgeHandler.prototype.createLabelHandleShape=function(){if(null!=this.labelHandleImage){var t=new mxImageShape(new mxRectangle(0,0,this.labelHandleImage.width,this.labelHandleImage.height),this.labelHandleImage.src);return t.preserveImageAspect=!1,t}var e=mxConstants.LABEL_HANDLE_SIZE;return new mxRectangleShape(new mxRectangle(0,0,e,e),mxConstants.LABEL_HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxEdgeHandler.prototype.initBend=function(t,e){this.preferHtml?(t.dialect=mxConstants.DIALECT_STRICTHTML,t.init(this.graph.container)):(t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,t.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(t.node,this.graph,this.state,null,null,null,e),!mxClient.IS_QUIRKS&&8!=document.documentMode||mxEvent.addListener(t.node,"dragstart",function(t){return mxEvent.consume(t),!1}),mxClient.IS_TOUCH&&t.node.setAttribute("pointer-events","none")},mxEdgeHandler.prototype.getHandleForEvent=function(o){var t=mxEvent.isMouseEvent(o.getEvent())?1:this.tolerance,s=this.allowHandleBoundsCheck&&(mxClient.IS_IE||0<t)?new mxRectangle(o.getGraphX()-t,o.getGraphY()-t,2*t,2*t):null,l=null,e=null;function n(t){if(null!=t&&"none"!=t.node.style.display&&"hidden"!=t.node.style.visibility&&(o.isSource(t)||null!=s&&mxUtils.intersects(t.bounds,s))){var e=o.getGraphX()-t.bounds.getCenterX(),n=o.getGraphY()-t.bounds.getCenterY(),i=e*e+n*n;if(null==l||i<=l)return l=i,!0}return!1}if(null!=this.customHandles&&this.isCustomHandleEvent(o))for(var i=this.customHandles.length-1;0<=i;i--)if(n(this.customHandles[i].shape))return mxEvent.CUSTOM_HANDLE-i;if((o.isSource(this.state.text)||n(this.labelShape))&&(e=mxEvent.LABEL_HANDLE),null!=this.bends)for(i=0;i<this.bends.length;i++)n(this.bends[i])&&(e=i);if(null!=this.virtualBends&&this.isAddVirtualBendEvent(o))for(i=0;i<this.virtualBends.length;i++)n(this.virtualBends[i])&&(e=mxEvent.VIRTUAL_HANDLE-i);return e},mxEdgeHandler.prototype.isAddVirtualBendEvent=function(t){return!0},mxEdgeHandler.prototype.isCustomHandleEvent=function(t){return!0},mxEdgeHandler.prototype.mouseDown=function(t,e){var n=this.getHandleForEvent(e);if(null!=this.bends&&null!=this.bends[n]){var i=this.bends[n].bounds;this.snapPoint=new mxPoint(i.getCenterX(),i.getCenterY())}this.addEnabled&&null==n&&this.isAddPointEvent(e.getEvent())?(this.addPoint(this.state,e.getEvent()),e.consume()):null!=n&&!e.isConsumed()&&this.graph.isEnabled()&&(this.removeEnabled&&this.isRemovePointEvent(e.getEvent())?this.removePoint(this.state,n):n==mxEvent.LABEL_HANDLE&&!this.graph.isLabelMovable(e.getCell())||(n<=mxEvent.VIRTUAL_HANDLE&&mxUtils.setOpacity(this.virtualBends[mxEvent.VIRTUAL_HANDLE-n].node,100),this.start(e.getX(),e.getY(),n)),e.consume())},mxEdgeHandler.prototype.start=function(t,e,n){if(this.startX=t,this.startY=e,this.isSource=null!=this.bends&&0==n,this.isTarget=null!=this.bends&&n==this.bends.length-1,this.isLabel=n==mxEvent.LABEL_HANDLE,this.isSource||this.isTarget){var i=this.state.cell,o=this.graph.model.getTerminal(i,this.isSource);(null==o&&this.graph.isTerminalPointMovable(i,this.isSource)||null!=o&&this.graph.isCellDisconnectable(i,o,this.isSource))&&(this.index=n)}else this.index=n;if(this.index<=mxEvent.CUSTOM_HANDLE&&this.index>mxEvent.VIRTUAL_HANDLE&&null!=this.customHandles)for(var s=0;s<this.customHandles.length;s++)s!=mxEvent.CUSTOM_HANDLE-this.index&&this.customHandles[s].setVisible(!1)},mxEdgeHandler.prototype.clonePreviewState=function(t,e){return this.state.clone()},mxEdgeHandler.prototype.getSnapToTerminalTolerance=function(){return this.graph.gridSize*this.graph.view.scale/2},mxEdgeHandler.prototype.updateHint=function(t,e){},mxEdgeHandler.prototype.removeHint=function(){},mxEdgeHandler.prototype.roundLength=function(t){return Math.round(t)},mxEdgeHandler.prototype.isSnapToTerminalsEvent=function(t){return this.snapToTerminals&&!mxEvent.isAltDown(t.getEvent())},mxEdgeHandler.prototype.getPointForEvent=function(t){var e=this.graph.getView(),n=e.scale,i=new mxPoint(this.roundLength(t.getGraphX()/n)*n,this.roundLength(t.getGraphY()/n)*n),o=this.getSnapToTerminalTolerance(),s=!1,l=!1;if(0<o&&this.isSnapToTerminalsEvent(t)){function r(t){if(null!=t){var e=t.x;Math.abs(i.x-e)<o&&(i.x=e,s=!0);var n=t.y;Math.abs(i.y-n)<o&&(i.y=n,l=!0)}}function a(t){null!=t&&r.call(this,new mxPoint(e.getRoutingCenterX(t),e.getRoutingCenterY(t)))}if(a.call(this,this.state.getVisibleTerminalState(!0)),a.call(this,this.state.getVisibleTerminalState(!1)),null!=this.state.absolutePoints)for(var h=0;h<this.state.absolutePoints.length;h++)r.call(this,this.state.absolutePoints[h])}if(this.graph.isGridEnabledEvent(t.getEvent())){var d=e.translate;s||(i.x=(this.graph.snap(i.x/n-d.x)+d.x)*n),l||(i.y=(this.graph.snap(i.y/n-d.y)+d.y)*n)}return i},mxEdgeHandler.prototype.getPreviewTerminalState=function(t){if(this.constraintHandler.update(t,this.isSource,!0,t.isSource(this.marker.highlight.shape)?null:this.currentPoint),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");var e=this.graph.getModel(),n=this.graph.view.getTerminalPort(this.state,this.graph.view.getState(e.getTerminal(this.state.cell,!this.isSource)),!this.isSource),i=null!=n?n.cell:null,o=this.isSource?this.constraintHandler.currentFocus.cell:i,s=this.isSource?i:this.constraintHandler.currentFocus.cell;this.error=this.validateConnection(o,s);var l=null;return null==this.error?l=this.constraintHandler.currentFocus:this.constraintHandler.reset(),l}if(this.graph.isIgnoreTerminalEvent(t.getEvent()))return this.marker.reset(),null;this.marker.process(t);var r=this.marker.getValidState();return null!=r&&this.graph.isCellLocked(r.cell)&&this.marker.reset(),this.marker.getValidState()},mxEdgeHandler.prototype.getPreviewPoints=function(t,e){var n,i,o=this.graph.getCellGeometry(this.state.cell),s=null!=o.points?o.points.slice():null,l=new mxPoint(t.x,t.y),r=null;if(this.isSource||this.isTarget)this.graph.resetEdgesOnConnect&&(s=null);else if(this.convertPoint(l,!1),null==s)s=[l];else{if(this.index<=mxEvent.VIRTUAL_HANDLE&&s.splice(mxEvent.VIRTUAL_HANDLE-this.index,0,l),!this.isSource&&!this.isTarget){for(var a=0;a<this.bends.length;a++)if(a!=this.index){var h=this.bends[a];null!=h&&mxUtils.contains(h.bounds,t.x,t.y)&&(this.index<=mxEvent.VIRTUAL_HANDLE?s.splice(mxEvent.VIRTUAL_HANDLE-this.index,1):s.splice(this.index-1,1),r=s)}if(null==r&&this.straightRemoveEnabled&&(null==e||!mxEvent.isAltDown(e.getEvent()))){var d=this.graph.tolerance*this.graph.tolerance,u=this.state.absolutePoints.slice();u[this.index]=t;var p=this.state.getVisibleTerminalState(!0);if(null!=p)null!=(m=this.graph.getConnectionConstraint(this.state,p,!0))&&null!=this.graph.getConnectionPoint(p,m)||(u[0]=new mxPoint(p.view.getRoutingCenterX(p),p.view.getRoutingCenterY(p)));var m,c=this.state.getVisibleTerminalState(!1);if(null!=c)null!=(m=this.graph.getConnectionConstraint(this.state,c,!1))&&null!=this.graph.getConnectionPoint(c,m)||(u[u.length-1]=new mxPoint(c.view.getRoutingCenterX(c),c.view.getRoutingCenterY(c)));n=this.index,i=t,0<n&&n<u.length-1&&mxUtils.ptSegDistSq(u[n-1].x,u[n-1].y,u[n+1].x,u[n+1].y,i.x,i.y)<d&&(s.splice(n-1,1),r=s)}}null==r&&this.index>mxEvent.VIRTUAL_HANDLE&&(s[this.index-1]=l)}return null!=r?r:s},mxEdgeHandler.prototype.isOutlineConnectEvent=function(t){var e=mxUtils.getOffset(this.graph.container),n=t.getEvent(),i=mxEvent.getClientX(n),o=mxEvent.getClientY(n),s=document.documentElement,l=(window.pageXOffset||s.scrollLeft)-(s.clientLeft||0),r=(window.pageYOffset||s.scrollTop)-(s.clientTop||0),a=this.currentPoint.x-this.graph.container.scrollLeft+e.x-l,h=this.currentPoint.y-this.graph.container.scrollTop+e.y-r;return this.outlineConnect&&!mxEvent.isShiftDown(t.getEvent())&&(t.isSource(this.marker.highlight.shape)||mxEvent.isAltDown(t.getEvent())&&null!=t.getState()||this.marker.highlight.isHighlightAt(i,o)||(a!=i||h!=o)&&null==t.getState()&&this.marker.highlight.isHighlightAt(a,h))},mxEdgeHandler.prototype.updatePreviewState=function(t,e,n,i,o){var s=this.isSource?n:this.state.getVisibleTerminalState(!0),l=this.isTarget?n:this.state.getVisibleTerminalState(!1),r=this.graph.getConnectionConstraint(t,s,!0),a=this.graph.getConnectionConstraint(t,l,!1),h=this.constraintHandler.currentConstraint;if(null==h&&o&&(null!=n?(i.isSource(this.marker.highlight.shape)&&(e=new mxPoint(i.getGraphX(),i.getGraphY())),h=this.graph.getOutlineConstraint(e,n,i),this.constraintHandler.setFocus(i,n,this.isSource),this.constraintHandler.currentConstraint=h,this.constraintHandler.currentPoint=e):h=new mxConnectionConstraint),this.outlineConnect&&null!=this.marker.highlight&&null!=this.marker.highlight.shape){var d=this.graph.view.scale;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(this.marker.highlight.shape.stroke=o?mxConstants.OUTLINE_HIGHLIGHT_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/d/d,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.marker.highlight.shape.stroke=this.marker.getValidState()==i.getState()?mxConstants.DEFAULT_VALID_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/d/d,this.marker.highlight.repaint())}this.isSource?r=h:this.isTarget&&(a=h),(this.isSource||this.isTarget)&&(null!=h&&null!=h.point?(t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X]=h.point.x,t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]=h.point.y):(delete t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X],delete t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y])),t.setVisibleTerminalState(s,!0),t.setVisibleTerminalState(l,!1),this.isSource&&null==s||t.view.updateFixedTerminalPoint(t,s,!0,r),this.isTarget&&null==l||t.view.updateFixedTerminalPoint(t,l,!1,a),(this.isSource||this.isTarget)&&null==n&&(t.setAbsoluteTerminalPoint(e,this.isSource),null==this.marker.getMarkedState()&&(this.error=this.graph.allowDanglingEdges?null:"")),t.view.isFromScaleChanged=!1,t.view.updatePoints(t,this.points,s,l),t.view.updateFloatingTerminalPoints(t,s,l)},mxEdgeHandler.prototype.mouseMove=function(t,e){if(e.graphX<50&&(e.graphX=50),e.graphY<50&&(e.graphY=50),null!=this.index&&null!=this.marker){if(null!=this.points&&e.state&&e.state.cell&&(e.state.cell.setAbsPointNull=!1),this.currentPoint=this.getPointForEvent(e),this.error=null,!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&null!=this.snapPoint&&(Math.abs(this.snapPoint.x-this.currentPoint.x)<Math.abs(this.snapPoint.y-this.currentPoint.y)?this.currentPoint.x=this.snapPoint.x:this.currentPoint.y=this.snapPoint.y),this.index<=mxEvent.CUSTOM_HANDLE&&this.index>mxEvent.VIRTUAL_HANDLE)null!=this.customHandles&&this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e);else if(this.isLabel)this.label.x=this.currentPoint.x,this.label.y=this.currentPoint.y;else{this.points=this.getPreviewPoints(this.currentPoint,e);var n=this.isSource||this.isTarget?this.getPreviewTerminalState(e):null;if(this.isSource||this.isTarget){var i=this.graph.getCellGeometry(this.state.cell);null!=i.points&&(this.pre_clone_geo=i.clone(),i.points=null,this.graph.model.setGeometry(this.state.cell,i))}if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint)this.currentPoint=this.constraintHandler.currentPoint.clone();else if(this.outlineConnect){var o=!(!this.isSource&&!this.isTarget)&&this.isOutlineConnectEvent(e);o?n=this.marker.highlight.state:null!=n&&n!=e.getState()&&null!=this.marker.highlight.shape&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint(),n=null)}null!=n&&this.graph.isCellLocked(n.cell)&&(n=null,this.marker.reset());var s=this.clonePreviewState(this.currentPoint,null!=n?n.cell:null);this.updatePreviewState(s,this.currentPoint,n,e,o);var l=this.marker?null==this.error?this.marker.validColor:this.marker.invalidColor:"";this.setPreviewColor(l||"#00a8ff"),this.abspoints=s.absolutePoints,this.active=!0}this.updateHint(e,this.currentPoint),this.drawPreview(),mxEvent.consume(e.getEvent()),e.consume()}else mxClient.IS_IE&&null!=this.getHandleForEvent(e)&&e.consume(!1)},mxEdgeHandler.prototype.mouseUp=function(t,e){if(null!=this.index&&null!=this.marker){var n=this.state.cell;if(e.getX()!=this.startX||e.getY()!=this.startY){var i=!this.graph.isIgnoreTerminalEvent(e.getEvent())&&this.graph.isCloneEvent(e.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable();if(null!=this.error)0<this.error.length&&this.graph.validationAlert(this.error);else if(this.index<=mxEvent.CUSTOM_HANDLE&&this.index>mxEvent.VIRTUAL_HANDLE){if(null!=this.customHandles){(s=this.graph.getModel()).beginUpdate();try{this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].execute()}finally{s.endUpdate()}}}else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget){var o=null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(o=this.constraintHandler.currentFocus.cell),null==o&&this.marker.hasValidState()&&null!=this.marker.highlight&&null!=this.marker.highlight.shape&&"transparent"!=this.marker.highlight.shape.stroke&&"white"!=this.marker.highlight.shape.stroke&&(o=this.marker.validState.cell),null==o){if(null!=this.pre_clone_geo){this.graph.getCellGeometry(this.state.cell);this.graph.model.setGeometry(this.state.cell,this.pre_clone_geo),this.pre_clone_geo=null}return}if(null!=o){var s,l=(s=this.graph.getModel()).getParent(n);s.beginUpdate();try{if(i){var r=s.getGeometry(n);i=this.graph.cloneCells([n])[0];s.add(l,i,s.getChildCount(l)),null!=r&&(r=r.clone(),s.setGeometry(i,r));var a=s.getTerminal(n,!this.isSource);this.graph.connectCell(i,a,!this.isSource),n=i}if(n.linkId&&this.isTarget&&o.id!=n.target.id){if(2==o.nodeAttriBute&&1!=n.source.nodeAttriBute&&2!=n.source.nodeAttriBute||2==n.source.nodeAttriBute&&1!=o.nodeAttriBute&&2!=o.nodeAttriBute)return void wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390403,"分叉中间点只能指向本分支中间节点或合并节点!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}});if(2==n.source.nodeAttriBute&&(2!=o.nodeAttriBute||"3"==o.nodeAttriBute||"4"==o.nodeAttriBute||"5"==o.nodeAttriBute))return void wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390403,"分叉中间点只能指向本分支中间节点或合并节点!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}});wfModal.confirm({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390408,"确定要将出口:")+n.value+" "+wfGetLabel(390409,"的目标节点从")+n.target.value+" "+wfGetLabel(390410,"改成")+" "+o.value+" "+wfGetLabel(82179,"吗?"),okText:wfGetLabel(83446,"确定"),cancelText:wfGetLabel(31129,"取消"),onOk:function(){},onCancel:function(){workflowUi.actions.get("undo").funct()}})}if(n.linkId&&this.isSource&&o.id!=n.source.id){if(2==o.nodeAttriBute&&1!=n.target.nodeAttriBute&&2!=n.target.nodeAttriBute||2==n.target.nodeAttriBute&&1!=o.nodeAttriBute&&2!=o.nodeAttriBute)return void wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390406,"分叉中间点的起始节点和结束节点不能为一般节点!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}});wfModal.confirm({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390411,"修改源节点,会清除原有的生成编号、出口条件、附加规则及出口提示信息等设置,确定要修改吗?"),okText:wfGetLabel(83446,"确定"),cancelText:wfGetLabel(31129,"取消"),onOk:function(){},onCancel:function(){workflowUi.actions.get("undo").funct()}})}n=this.connect(n,o,this.isSource,i,e)}finally{s.endUpdate()}}else if(this.graph.isAllowDanglingEdges()){var h=this.abspoints[this.isSource?0:this.abspoints.length-1];h.x=this.roundLength(h.x/this.graph.view.scale-this.graph.view.translate.x),h.y=this.roundLength(h.y/this.graph.view.scale-this.graph.view.translate.y);var d=this.graph.getView().getState(this.graph.getModel().getParent(n));null!=d&&(h.x-=d.origin.x,h.y-=d.origin.y),h.x-=this.graph.panDx/this.graph.view.scale,h.y-=this.graph.panDy/this.graph.view.scale,n=this.changeTerminalPoint(n,h,this.isSource,i)}}else this.active?(n.isFromMouseUp=!0,n=this.changePoints(n,this.points,i)):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().validate(this.state.cell))}null!=this.marker&&(this.reset(),n!=this.state.cell&&this.graph.setSelectionCell(n)),e.consume()}},mxEdgeHandler.prototype.reset=function(){if(this.active&&this.refresh(),this.error=null,this.index=null,this.label=null,this.points=null,this.snapPoint=null,this.isLabel=!1,this.isSource=!1,this.isTarget=!1,this.active=!1,this.livePreview&&null!=this.sizers)for(var t=0;t<this.sizers.length;t++)null!=this.sizers[t]&&(this.sizers[t].node.style.display="");if(null!=this.marker&&this.marker.reset(),null!=this.constraintHandler&&this.constraintHandler.reset(),null!=this.customHandles)for(t=0;t<this.customHandles.length;t++)this.customHandles[t].reset();this.setPreviewColor(mxConstants.EDGE_SELECTION_COLOR),this.removeHint(),this.redraw()},mxEdgeHandler.prototype.setPreviewColor=function(t){null!=this.shape&&(this.shape.stroke=t)},mxEdgeHandler.prototype.convertPoint=function(t,e){var n=this.graph.getView().getScale(),i=this.graph.getView().getTranslate();e&&(t.x=this.graph.snap(t.x),t.y=this.graph.snap(t.y)),t.x=Math.round(t.x/n-i.x),t.y=Math.round(t.y/n-i.y);var o=this.graph.getView().getState(this.graph.getModel().getParent(this.state.cell));return null!=o&&(t.x-=o.origin.x,t.y-=o.origin.y),t},mxEdgeHandler.prototype.moveLabel=function(t,e,n){var i=this.graph.getModel(),o=i.getGeometry(t.cell);if(null!=o){var s=this.graph.getView().scale;if((o=o.clone()).relative){var l=this.graph.getView().getRelativePoint(t,e,n);o.x=Math.round(1e4*l.x)/1e4,o.y=Math.round(l.y),o.offset=new mxPoint(0,0);l=this.graph.view.getPoint(t,o);o.offset=new mxPoint(Math.round((e-l.x)/s),Math.round((n-l.y)/s))}else{var r=t.absolutePoints,a=r[0],h=r[r.length-1];if(null!=a&&null!=h){var d=a.x+(h.x-a.x)/2,u=a.y+(h.y-a.y)/2;o.offset=new mxPoint(Math.round((e-d)/s),Math.round((n-u)/s)),o.x=0,o.y=0}}i.setGeometry(t.cell,o)}},mxEdgeHandler.prototype.connect=function(t,e,n,i,o){var s=this.graph.getModel();s.getParent(t);s.beginUpdate();try{var l=this.constraintHandler.currentConstraint;null==l&&(l=new mxConnectionConstraint),this.graph.connectCell(t,e,n,l)}finally{s.endUpdate()}return t},mxEdgeHandler.prototype.changeTerminalPoint=function(t,e,n,i){var o=this.graph.getModel();o.beginUpdate();try{if(i){var s=o.getParent(t),l=o.getTerminal(t,!n);t=this.graph.cloneCells([t])[0],o.add(s,t,o.getChildCount(s)),o.setTerminal(t,l,!n)}var r=o.getGeometry(t);null!=r&&((r=r.clone()).setTerminalPoint(e,n),o.setGeometry(t,r),this.graph.connectCell(t,null,n,new mxConnectionConstraint))}finally{o.endUpdate()}return t},mxEdgeHandler.prototype.changePoints=function(t,e,n){var i=this.graph.getModel();i.beginUpdate();try{if(n){var o=i.getParent(t),s=i.getTerminal(t,!0),l=i.getTerminal(t,!1);t=this.graph.cloneCells([t])[0],i.add(o,t,i.getChildCount(o)),i.setTerminal(t,s,!0),i.setTerminal(t,l,!1)}var r=i.getGeometry(t);null!=r&&((r=r.clone()).points=e,i.setGeometry(t,r))}finally{i.endUpdate()}return t},mxEdgeHandler.prototype.addPoint=function(t,e){var n=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e)),i=this.graph.isGridEnabledEvent(e);this.convertPoint(n,i),this.addPointAt(t,n.x,n.y),mxEvent.consume(e)},mxEdgeHandler.prototype.addPointAt=function(t,e,n){var i=this.graph.getCellGeometry(t.cell),o=new mxPoint(e,n);if(null!=i){i=i.clone();var s=this.graph.view.translate,l=this.graph.view.scale,r=new mxPoint(s.x*l,s.y*l),a=this.graph.model.getParent(this.state.cell);if(this.graph.model.isVertex(a)){var h=this.graph.view.getState(a);r=new mxPoint(h.x,h.y)}var d=mxUtils.findNearestSegment(t,o.x*l+r.x,o.y*l+r.y);null==i.points?i.points=[o]:i.points.splice(d,0,o),this.graph.getModel().setGeometry(t.cell,i),this.refresh(),this.redraw()}},mxEdgeHandler.prototype.removePoint=function(t,e){if(0<e&&e<this.abspoints.length-1){var n=this.graph.getCellGeometry(this.state.cell);null!=n&&null!=n.points&&((n=n.clone()).points.splice(e-1,1),this.graph.getModel().setGeometry(t.cell,n),this.refresh(),this.redraw())}},mxEdgeHandler.prototype.getHandleFillColor=function(t){var e=0==t,n=this.state.cell,i=this.graph.getModel().getTerminal(n,e),o=mxConstants.HANDLE_FILLCOLOR;return null!=i&&!this.graph.isCellDisconnectable(n,i,e)||null==i&&!this.graph.isTerminalPointMovable(n,e)?o=mxConstants.LOCKED_HANDLE_FILLCOLOR:null!=i&&this.graph.isCellDisconnectable(n,i,e)&&(o=mxConstants.CONNECT_HANDLE_FILLCOLOR),o},mxEdgeHandler.prototype.redraw=function(){this.abspoints=this.state.absolutePoints.slice(),this.redrawHandles();var t=this.graph.getModel().getGeometry(this.state.cell).points;if(null!=this.bends&&0<this.bends.length&&null!=t){null==this.points&&(this.points=[]);for(var e=1;e<this.bends.length-1;e++)null!=this.bends[e]&&null!=this.abspoints[e]&&(this.points[e-1]=t[e-1])}this.drawPreview()},mxEdgeHandler.prototype.redrawHandles=function(){var t=this.state.cell,e=this.labelShape.bounds;this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y),this.labelShape.bounds=new mxRectangle(Math.round(this.label.x-e.width/2),Math.round(this.label.y-e.height/2),e.width,e.height);var n=this.graph.getLabel(t);if(this.labelShape.visible=null!=n&&0<n.length&&this.graph.isLabelMovable(t),null!=this.bends&&0<this.bends.length){var i=this.abspoints.length-1,o=this.abspoints[0],s=o.x,l=o.y;e=this.bends[0].bounds,this.bends[0].bounds=new mxRectangle(Math.floor(s-e.width/2),Math.floor(l-e.height/2),e.width,e.height),this.bends[0].fill=this.getHandleFillColor(0),this.bends[0].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[0].bounds);var r=this.abspoints[i],a=r.x,h=r.y,d=this.bends.length-1;e=this.bends[d].bounds,this.bends[d].bounds=new mxRectangle(Math.floor(a-e.width/2),Math.floor(h-e.height/2),e.width,e.height),this.bends[d].fill=this.getHandleFillColor(d),this.bends[d].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[d].bounds),this.redrawInnerBends(o,r)}if(null!=this.abspoints&&null!=this.virtualBends&&0<this.virtualBends.length)for(var u=this.abspoints[0],p=0;p<this.virtualBends.length;p++)if(null!=this.virtualBends[p]&&null!=this.abspoints[p+1]){var m=this.abspoints[p+1],c=(e=this.virtualBends[p],u.x+(m.x-u.x)/2),g=u.y+(m.y-u.y)/2;e.bounds=new mxRectangle(Math.floor(c-e.bounds.width/2),Math.floor(g-e.bounds.height/2),e.bounds.width,e.bounds.height),e.redraw(),mxUtils.setOpacity(e.node,this.virtualBendOpacity),u=m,this.manageLabelHandle&&this.checkLabelHandle(e.bounds)}if(this.labelShape,null!=this.customHandles)for(p=0;p<this.customHandles.length;p++)this.customHandles[p].redraw()},mxEdgeHandler.prototype.setHandlesVisible=function(t){if(null!=this.bends)for(var e=0;e<this.bends.length;e++)this.bends[e].node.style.display=t?"":"none";if(null!=this.virtualBends)for(e=0;e<this.virtualBends.length;e++)this.virtualBends[e].node.style.display=t?"":"none";if(null!=this.labelShape&&(this.labelShape.node.style.display=t?"":"none"),null!=this.customHandles)for(e=0;e<this.customHandles.length;e++)this.customHandles[e].setVisible(t)},mxEdgeHandler.prototype.redrawInnerBends=function(t,e){for(var n=1;n<this.bends.length-1;n++)if(null!=this.bends[n])if(null!=this.abspoints[n]){var i=this.abspoints[n].x,o=this.abspoints[n].y,s=this.bends[n].bounds;this.bends[n].node.style.visibility="visible",this.bends[n].bounds=new mxRectangle(Math.round(i-s.width/2),Math.round(o-s.height/2),s.width,s.height),this.manageLabelHandle?this.checkLabelHandle(this.bends[n].bounds):null==this.handleImage&&this.labelShape.visible&&mxUtils.intersects(this.bends[n].bounds,this.labelShape.bounds)&&(w=mxConstants.HANDLE_SIZE+3,h=mxConstants.HANDLE_SIZE+3,this.bends[n].bounds=new mxRectangle(Math.round(i-w/2),Math.round(o-h/2),w,h)),this.bends[n].redraw()}else this.bends[n].destroy(),this.bends[n]=null},mxEdgeHandler.prototype.checkLabelHandle=function(t){if(null!=this.labelShape){var e=this.labelShape.bounds;mxUtils.intersects(t,e)&&(t.getCenterY()<e.getCenterY()?e.y=t.y+t.height:e.y=t.y-e.height)}},mxEdgeHandler.prototype.drawPreview=function(){if(this.isLabel){var t=this.labelShape.bounds,e=new mxRectangle(Math.round(this.label.x-t.width/2),Math.round(this.label.y-t.height/2),t.width,t.height);this.labelShape.bounds=e}else null!=this.shape&&(this.shape.apply(this.state),this.shape.points=this.abspoints,this.shape.scale=this.state.view.scale,this.shape.isDashed=this.isSelectionDashed(),this.shape.stroke=this.getSelectionColor(),this.shape.strokewidth=this.getSelectionStrokeWidth()/this.shape.scale/this.shape.scale,this.shape.isShadow=!1,this.shape.redraw());null!=this.parentHighlight&&this.parentHighlight.redraw()},mxEdgeHandler.prototype.refresh=function(){this.abspoints=this.getSelectionPoints(this.state),this.points=[],null!=this.shape&&(this.shape.points=this.abspoints),null!=this.bends&&(this.destroyBends(this.bends),this.bends=this.createBends()),null!=this.virtualBends&&(this.destroyBends(this.virtualBends),this.virtualBends=this.createVirtualBends()),null!=this.customHandles&&(this.destroyBends(this.customHandles),this.customHandles=this.createCustomHandles()),null!=this.labelShape&&null!=this.labelShape.node&&null!=this.labelShape.node.parentNode&&this.labelShape.node.parentNode.appendChild(this.labelShape.node)},mxEdgeHandler.prototype.destroyBends=function(t){if(null!=t)for(var e=0;e<t.length;e++)null!=t[e]&&t[e].destroy()},mxEdgeHandler.prototype.destroy=function(){null!=this.escapeHandler&&(this.state.view.graph.removeListener(this.escapeHandler),this.escapeHandler=null),null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.parentHighlight&&(this.parentHighlight.destroy(),this.parentHighlight=null),null!=this.labelShape&&(this.labelShape.destroy(),this.labelShape=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),this.destroyBends(this.virtualBends),this.virtualBends=null,this.destroyBends(this.customHandles),this.customHandles=null,this.destroyBends(this.bends),this.bends=null,this.removeHint()},mxUtils.extend(mxElbowEdgeHandler,mxEdgeHandler),mxElbowEdgeHandler.prototype.flipEnabled=!0,mxElbowEdgeHandler.prototype.doubleClickOrientationResource="none"!=mxClient.language?"doubleClickOrientation":"",mxElbowEdgeHandler.prototype.createBends=function(){var t=[],e=this.createHandleShape(0);return this.initBend(e),e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE),t.push(e),t.push(this.createVirtualBend(mxUtils.bind(this,function(t){!mxEvent.isConsumed(t)&&this.flipEnabled&&(this.graph.flipEdge(this.state.cell,t),mxEvent.consume(t))}))),this.points.push(new mxPoint(0,0)),e=this.createHandleShape(2),this.initBend(e),e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE),t.push(e),t},mxElbowEdgeHandler.prototype.createVirtualBend=function(t){var e=this.createHandleShape();return this.initBend(e,t),e.setCursor(this.getCursorForBend()),this.graph.isCellBendable(this.state.cell)||(e.node.style.display="none"),e},mxElbowEdgeHandler.prototype.getCursorForBend=function(){return this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.TopToBottom||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_TOPTOBOTTOM||(this.state.style[mxConstants.STYLE_EDGE]==mxEdgeStyle.ElbowConnector||this.state.style[mxConstants.STYLE_EDGE]==mxConstants.EDGESTYLE_ELBOW)&&this.state.style[mxConstants.STYLE_ELBOW]==mxConstants.ELBOW_VERTICAL?"row-resize":"col-resize"},mxElbowEdgeHandler.prototype.getTooltipForNode=function(t){var e=null;return null==this.bends||null==this.bends[1]||t!=this.bends[1].node&&t.parentNode!=this.bends[1].node||(e=this.doubleClickOrientationResource,e=mxResources.get(e)||e),e},mxElbowEdgeHandler.prototype.convertPoint=function(t,e){var n=this.graph.getView().getScale(),i=this.graph.getView().getTranslate(),o=this.state.origin;return e&&(t.x=this.graph.snap(t.x),t.y=this.graph.snap(t.y)),t.x=Math.round(t.x/n-i.x-o.x),t.y=Math.round(t.y/n-i.y-o.y),t},mxElbowEdgeHandler.prototype.redrawInnerBends=function(t,e){var n=this.graph.getModel().getGeometry(this.state.cell),i=this.state.absolutePoints,o=null;1<i.length?(t=i[1],e=i[i.length-2]):null!=n.points&&0<n.points.length&&(o=i[0]),o=null==o?new mxPoint(t.x+(e.x-t.x)/2,t.y+(e.y-t.y)/2):new mxPoint(this.graph.getView().scale*(o.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(o.y+this.graph.getView().translate.y+this.state.origin.y));var s=this.bends[1].bounds,l=s.width,r=s.height,a=new mxRectangle(Math.round(o.x-l/2),Math.round(o.y-r/2),l,r);this.manageLabelHandle?this.checkLabelHandle(a):null==this.handleImage&&this.labelShape.visible&&mxUtils.intersects(a,this.labelShape.bounds)&&(l=mxConstants.HANDLE_SIZE+3,r=mxConstants.HANDLE_SIZE+3,a=new mxRectangle(Math.floor(o.x-l/2),Math.floor(o.y-r/2),l,r)),this.bends[1].bounds=a,this.bends[1].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[1].bounds)},mxUtils.extend(mxEdgeSegmentHandler,mxElbowEdgeHandler),mxEdgeSegmentHandler.prototype.getCurrentPoints=function(){var t=this.state.absolutePoints;if(null!=t){var e=Math.max(1,this.graph.view.scale);if(2==t.length||3==t.length&&(Math.abs(t[0].x-t[1].x)<e&&Math.abs(t[1].x-t[2].x)<e||Math.abs(t[0].y-t[1].y)<e&&Math.abs(t[1].y-t[2].y)<e)){var n=t[0].x+(t[t.length-1].x-t[0].x)/2,i=t[0].y+(t[t.length-1].y-t[0].y)/2;t=[t[0],new mxPoint(n,i),new mxPoint(n,i),t[t.length-1]]}}return t},mxEdgeSegmentHandler.prototype.getPreviewPoints=function(t){if(this.isSource||this.isTarget)return mxElbowEdgeHandler.prototype.getPreviewPoints.apply(this,arguments);var e=this.getCurrentPoints(),n=this.convertPoint(e[0].clone(),!1);t=this.convertPoint(t.clone(),!1);for(var i=[],o=1;o<e.length;o++){var s=this.convertPoint(e[o].clone(),!1);o==this.index&&(0==Math.round(n.x-s.x)&&(n.x=t.x,s.x=t.x),0==Math.round(n.y-s.y)&&(n.y=t.y,s.y=t.y)),o<e.length-1&&i.push(s),n=s}if(1==i.length){var l=this.state.getVisibleTerminalState(!0),r=this.state.getVisibleTerminalState(!1),a=this.state.view.getScale(),h=this.state.view.getTranslate(),d=i[0].x*a+h.x,u=i[0].y*a+h.y;(null!=l&&mxUtils.contains(l,d,u)||null!=r&&mxUtils.contains(r,d,u))&&(i=[t,t])}return i},mxEdgeSegmentHandler.prototype.updatePreviewState=function(t,e,n,i){if(mxEdgeHandler.prototype.updatePreviewState.apply(this,arguments),!this.isSource&&!this.isTarget){e=this.convertPoint(e.clone(),!1);for(var o=t.absolutePoints,s=o[0],l=o[1],r=[],a=2;a<o.length;a++){var h=o[a];0==Math.round(s.x-l.x)&&0==Math.round(l.x-h.x)||0==Math.round(s.y-l.y)&&0==Math.round(l.y-h.y)||r.push(this.convertPoint(l.clone(),!1)),s=l,l=h}var d=this.state.getVisibleTerminalState(!0),u=this.state.getVisibleTerminalState(!1),p=this.state.absolutePoints;if(0!=r.length||0!=Math.round(o[0].x-o[o.length-1].x)&&0!=Math.round(o[0].y-o[o.length-1].y)){if(5==o.length&&2==r.length&&null!=d&&null!=u&&null!=p&&0==Math.round(p[0].x-p[p.length-1].x)){var m=this.graph.getView(),c=m.getScale(),g=m.getTranslate(),x=m.getRoutingCenterY(d)/c-g.y,y=this.graph.getConnectionConstraint(t,d,!0);if(null!=y)null!=(f=this.graph.getConnectionPoint(d,y))&&(this.convertPoint(f,!1),x=f.y);var f,v=m.getRoutingCenterY(u)/c-g.y,C=this.graph.getConnectionConstraint(t,u,!1);if(C)null!=(f=this.graph.getConnectionPoint(u,C))&&(this.convertPoint(f,!1),v=f.y);r=[new mxPoint(e.x,x),new mxPoint(e.x,v)]}}else r=[e,e];this.points=r,t.view.updateFixedTerminalPoints(t,d,u),t.view.updatePoints(t,this.points,d,u),t.view.updateFloatingTerminalPoints(t,d,u)}},mxEdgeSegmentHandler.prototype.connect=function(t,e,n,i,o){var s=this.graph.getModel(),l=null;if(null!=(p=s.getGeometry(t))&&null!=p.points&&0<p.points.length){var r=this.abspoints,a=r[0],h=r[1];l=[];for(var d=2;d<r.length;d++){var u=r[d];0==Math.round(a.x-h.x)&&0==Math.round(h.x-u.x)||0==Math.round(a.y-h.y)&&0==Math.round(h.y-u.y)||l.push(this.convertPoint(h.clone(),!1)),a=h,h=u}}s.beginUpdate();try{var p;if(null!=l)null!=(p=s.getGeometry(t))&&((p=p.clone()).points=l,s.setGeometry(t,p));t=mxEdgeHandler.prototype.connect.apply(this,arguments)}finally{s.endUpdate()}return t},mxEdgeSegmentHandler.prototype.getTooltipForNode=function(t){return null},mxEdgeSegmentHandler.prototype.start=function(t,e,n){mxEdgeHandler.prototype.start.apply(this,arguments),null==this.bends[n]||this.isSource||this.isTarget||mxUtils.setOpacity(this.bends[n].node,100)},mxEdgeSegmentHandler.prototype.createBends=function(){var t=[],e=this.createHandleShape(0);this.initBend(e),e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE),t.push(e);var n=this.getCurrentPoints();if(this.graph.isCellBendable(this.state.cell)){null==this.points&&(this.points=[]);for(var i=0;i<n.length-1;i++){e=this.createVirtualBend(),t.push(e);var o=0==Math.round(n[i].x-n[i+1].x);0==Math.round(n[i].y-n[i+1].y)&&i<n.length-2&&(o=0==Math.round(n[i].x-n[i+2].x)),e.setCursor(o?"col-resize":"row-resize"),this.points.push(new mxPoint(0,0))}}e=this.createHandleShape(n.length);return this.initBend(e),e.setCursor(mxConstants.CURSOR_TERMINAL_HANDLE),t.push(e),t},mxEdgeSegmentHandler.prototype.redraw=function(){this.refresh(),mxEdgeHandler.prototype.redraw.apply(this,arguments)},mxEdgeSegmentHandler.prototype.redrawInnerBends=function(t,e){if(this.graph.isCellBendable(this.state.cell)){var n=this.getCurrentPoints();if(null!=n&&1<n.length){var i=!1;if(4==n.length&&0==Math.round(n[1].x-n[2].x)&&0==Math.round(n[1].y-n[2].y))if(i=!0,0==Math.round(n[0].y-n[n.length-1].y)){var o=n[0].x+(n[n.length-1].x-n[0].x)/2;n[1]=new mxPoint(o,n[1].y),n[2]=new mxPoint(o,n[2].y)}else{var s=n[0].y+(n[n.length-1].y-n[0].y)/2;n[1]=new mxPoint(n[1].x,s),n[2]=new mxPoint(n[2].x,s)}for(var l=0;l<n.length-1;l++)if(null!=this.bends[l+1]){t=n[l],e=n[l+1];var r=new mxPoint(t.x+(e.x-t.x)/2,t.y+(e.y-t.y)/2),a=this.bends[l+1].bounds;this.bends[l+1].bounds=new mxRectangle(Math.floor(r.x-a.width/2),Math.floor(r.y-a.height/2),a.width,a.height),this.bends[l+1].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[l+1].bounds)}i&&(mxUtils.setOpacity(this.bends[1].node,this.virtualBendOpacity),mxUtils.setOpacity(this.bends[3].node,this.virtualBendOpacity))}}},mxKeyHandler.prototype.graph=null,mxKeyHandler.prototype.target=null,mxKeyHandler.prototype.normalKeys=null,mxKeyHandler.prototype.shiftKeys=null,mxKeyHandler.prototype.controlKeys=null,mxKeyHandler.prototype.controlShiftKeys=null,mxKeyHandler.prototype.enabled=!0,mxKeyHandler.prototype.isEnabled=function(){return this.enabled},mxKeyHandler.prototype.setEnabled=function(t){this.enabled=t},mxKeyHandler.prototype.bindKey=function(t,e){this.normalKeys[t]=e},mxKeyHandler.prototype.bindShiftKey=function(t,e){this.shiftKeys[t]=e},mxKeyHandler.prototype.bindControlKey=function(t,e){this.controlKeys[t]=e},mxKeyHandler.prototype.bindControlShiftKey=function(t,e){this.controlShiftKeys[t]=e},mxKeyHandler.prototype.isControlDown=function(t){return mxEvent.isControlDown(t)},mxKeyHandler.prototype.getFunction=function(t){return null==t||mxEvent.isAltDown(t)?null:this.isControlDown(t)?mxEvent.isShiftDown(t)?this.controlShiftKeys[t.keyCode]:this.controlKeys[t.keyCode]:mxEvent.isShiftDown(t)?this.shiftKeys[t.keyCode]:this.normalKeys[t.keyCode]},mxKeyHandler.prototype.isGraphEvent=function(t){var e=mxEvent.getSource(t);return!!(e==this.target||e.parentNode==this.target||null!=this.graph.cellEditor&&this.graph.cellEditor.isEventSource(t))||mxUtils.isAncestorNode(this.graph.container,e)},mxKeyHandler.prototype.keyDown=function(t){if(this.isEnabledForEvent(t))if(27==t.keyCode)this.escape(t);else if(!this.isEventIgnored(t)){var e=this.getFunction(t);null!=e&&(e(t),mxEvent.consume(t))}},mxKeyHandler.prototype.isEnabledForEvent=function(t){return this.graph.isEnabled()&&!mxEvent.isConsumed(t)&&this.isGraphEvent(t)&&this.isEnabled()},mxKeyHandler.prototype.isEventIgnored=function(t){return this.graph.isEditing()},mxKeyHandler.prototype.escape=function(t){this.graph.isEscapeEnabled()&&this.graph.escape(t)},mxKeyHandler.prototype.destroy=function(){null!=this.target&&null!=this.keydownHandler&&(mxEvent.removeListener(this.target,"keydown",this.keydownHandler),this.keydownHandler=null),this.target=null},mxTooltipHandler.prototype.zIndex=10005,mxTooltipHandler.prototype.graph=null,mxTooltipHandler.prototype.delay=500,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(t){this.enabled=t},mxTooltipHandler.prototype.isHideOnHover=function(){return this.hideOnHover},mxTooltipHandler.prototype.setHideOnHover=function(t){this.hideOnHover=t},mxTooltipHandler.prototype.init=function(){null!=document.body&&(this.div=document.createElement("div"),this.div.className="mxTooltip",this.div.id="workflowLink-TipInfo",this.div.style.visibility="hidden",document.body.appendChild(this.div),mxEvent.addGestureListeners(this.div,mxUtils.bind(this,function(t){this.hideTooltip()})),mxEvent.addListener(this.graph.container,"mousemove",mxUtils.bind(this,function(t){t.target.outerHTML;if(!this.checkIsInCell(t)){this.hideTooltip()}})))},mxTooltipHandler.prototype.checkIsInCell=function(t){t.target;var e=t.offsetX,n=t.offsetY,i=this.state||null,o=i?i.cellBounds:null;return!!(o&&e>=o.x&&e<=o.x+o.width&&n>=o.y&&n<=o.y+o.height)},mxTooltipHandler.prototype.getStateForEvent=function(t){return t.getState()},mxTooltipHandler.prototype.mouseDown=function(t,e){this.reset(e,!1),this.hideTooltip()},mxTooltipHandler.prototype.mouseMove=function(t,e){e.getX()==this.lastX&&e.getY()==this.lastY||(this.reset(e,!0),this.getStateForEvent(e)!=this.state&&this.hideTooltip());this.lastX=e.getX(),this.lastY=e.getY()},mxTooltipHandler.prototype.mouseUp=function(t,e){this.reset(e,!0),this.hideTooltip()},mxTooltipHandler.prototype.resetTimer=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null)},mxTooltipHandler.prototype.reset=function(t,e,s){if((!this.ignoreTouchEvents||mxEvent.isMouseEvent(t.getEvent()))&&(this.resetTimer(),s=null!=s?s:this.getStateForEvent(t),e&&this.isEnabled()&&null!=s&&(null==this.div||"hidden"==this.div.style.visibility))){var n=t.getSource(),l=t.getX(),r=t.getY(),a=t.isSource(s.shape)||t.isSource(s.text);this.thread=window.setTimeout(mxUtils.bind(this,function(){if(!this.graph.isEditing()&&!this.graph.popupMenuHandler.isMenuShowing()&&!this.graph.isMouseDown){var i=this.graph.getTooltip(s,n,l,r),o=this;if(s.cell.edge&&!s.cell.isPostedCondition){var t=s.cell&&s.cell.linkId||"";mxUtils.post(WORKFLOW_GET_TOOLTIPS,"linkId="+t,function(t){var e=t.request.responseText,n=JSON.parse(e);s.cell.isPostedCondition=!0,s.cell.linkConditionInfo=n.allcondition,o.show(i,l,r,s)})}else this.show(i,l,r,s);this.state=s,this.node=n,this.stateSource=a}}),this.delay)}},mxTooltipHandler.prototype.hide=function(){this.resetTimer(),this.hideTooltip()},mxTooltipHandler.prototype.hideTooltip=function(){null!=this.div&&(this.div.style.visibility="hidden",this.div.innerHTML="")},mxTooltipHandler.prototype.show=function(t,e,n,i,o){if(i.cell.edge&&(t=mxClient.IS_READONLY_PAGE?i.cell.linkConditionInfo?i.cell.value+"["+i.cell.linkConditionInfo+"]":i.cell.value:i.cell.linkConditionInfo?wfFormatMultiLang(i.cell.value)+"["+wfFormatMultiLang(i.cell.linkConditionInfo)+"]":wfFormatMultiLang(i.cell.value)),!this.destroyed&&null!=t&&0<t.length){null==this.div&&this.init();var s=mxUtils.getScrollOrigin();this.div.style.width="auto",this.div.style.left=e+s.x+"px",this.div.style.top=n+mxConstants.TOOLTIP_VERTICAL_OFFSET+s.y+"px",this.div.style.zIndex=this.zIndex,mxUtils.isNode(t)?(this.div.innerHTML="",this.div.appendChild(t)):this.div.innerHTML=t.replace(/\n/g,"<br>"),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)},mxUtils.extend(mxCellTracker,mxCellMarker),mxCellTracker.prototype.mouseDown=function(t,e){},mxCellTracker.prototype.mouseMove=function(t,e){this.isEnabled()&&this.process(e)},mxCellTracker.prototype.mouseUp=function(t,e){},mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))},mxCellHighlight.prototype.keepOnTop=!1,mxCellHighlight.prototype.graph=!0,mxCellHighlight.prototype.state=null,mxCellHighlight.prototype.spacing=2,mxCellHighlight.prototype.resetHandler=null,mxCellHighlight.prototype.setHighlightColor=function(t){this.highlightColor=t,null!=this.shape&&(this.shape.stroke=t)},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 t=this.graph.cellRenderer.createShape(this.state);return t.svgStrokeTolerance=this.graph.tolerance,t.points=this.state.absolutePoints,t.apply(this.state),t.stroke=this.highlightColor,t.opacity=this.opacity,t.isDashed=this.dashed,t.isShadow=!1,t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,t.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(t.node,this.graph,this.state),this.graph.dialect!=mxConstants.DIALECT_SVG?t.pointerEvents=!1:t.svgPointerEvents="stroke",t},mxCellHighlight.prototype.getStrokeWidth=function(t){return this.strokeWidth},mxCellHighlight.prototype.repaint=function(){null!=this.state&&null!=this.shape&&(this.shape.scale=this.state.view.scale,this.graph.model.isEdge(this.state.cell)?(this.shape.strokewidth=this.getStrokeWidth(),this.shape.points=this.state.absolutePoints,this.shape.outline=!1):(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),this.shape.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.shape.strokewidth=this.getStrokeWidth()/this.state.view.scale,this.shape.outline=!0),null!=this.state.shape&&this.shape.setCursor(this.state.shape.getCursor()),!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(t){this.state!=t&&(null!=this.shape&&(this.shape.destroy(),this.shape=null),this.state=t,null!=this.state&&this.drawHighlight())},mxCellHighlight.prototype.isHighlightAt=function(t,e){var n=!1;if(null!=this.shape&&null!=document.elementFromPoint&&!mxClient.IS_QUIRKS)for(var i=document.elementFromPoint(t,e);null!=i;){if(i==this.shape.node){n=!0;break}i=i.parentNode}return n},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)},mxDefaultKeyHandler.prototype.editor=null,mxDefaultKeyHandler.prototype.handler=null,mxDefaultKeyHandler.prototype.bindAction=function(t,e,n){var i=mxUtils.bind(this,function(){this.editor.execute(e)});n?this.handler.bindControlKey(t,i):this.handler.bindKey(t,i)},mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy(),this.handler=null},mxDefaultPopupMenu.prototype.imageBasePath=null,mxDefaultPopupMenu.prototype.config=null,mxDefaultPopupMenu.prototype.createMenu=function(t,e,n,i){if(null!=this.config){var o=this.createConditions(t,n,i),s=this.config.firstChild;this.addItems(t,e,n,i,o,s,null)}},mxDefaultPopupMenu.prototype.addItems=function(t,e,n,i,o,s,l){for(var r=!1;null!=s;){if("add"==s.nodeName){var a=s.getAttribute("if");if(null==a||o[a]){var h=s.getAttribute("as");h=mxResources.get(h)||h;var d=mxUtils.eval(mxUtils.getTextContent(s)),u=s.getAttribute("action"),p=s.getAttribute("icon"),m=s.getAttribute("iconCls"),c=s.getAttribute("enabled-if"),g=null==c||o[c];r&&(e.addSeparator(l),r=!1),null!=p&&this.imageBasePath&&(p=this.imageBasePath+p);var x=this.addAction(e,t,h,p,d,u,n,l,m,g);this.addItems(t,e,n,i,o,s.firstChild,x)}}else"separator"==s.nodeName&&(r=!0);s=s.nextSibling}},mxDefaultPopupMenu.prototype.addAction=function(t,e,n,i,o,s,l,r,a,h){return t.addItem(n,i,function(t){"function"==typeof o&&o.call(e,e,l,t),null!=s&&e.execute(s,l,t)},r,a,h)},mxDefaultPopupMenu.prototype.createConditions=function(t,e,n){var i=t.graph.getModel(),o=i.getChildCount(e),s=[];s.nocell=null==e,s.ncells=1<t.graph.getSelectionCount(),s.notRoot=i.getRoot()!=i.getParent(t.graph.getDefaultParent()),s.cell=null!=e;var l=null!=e&&1==t.graph.getSelectionCount();s.nonEmpty=l&&0<o,s.expandable=l&&t.graph.isCellFoldable(e,!1),s.collapsable=l&&t.graph.isCellFoldable(e,!0),s.validRoot=l&&t.graph.isValidRoot(e),s.emptyValidRoot=s.validRoot&&0==o,s.swimlane=l&&t.graph.isSwimlane(e);for(var r=this.config.getElementsByTagName("condition"),a=0;a<r.length;a++){var h=mxUtils.eval(mxUtils.getTextContent(r[a])),d=r[a].getAttribute("name");null!=d&&"function"==typeof h&&(s[d]=h(t,e,n))}return s},mxDefaultToolbar.prototype.editor=null,mxDefaultToolbar.prototype.toolbar=null,mxDefaultToolbar.prototype.resetHandler=null,mxDefaultToolbar.prototype.spacing=4,mxDefaultToolbar.prototype.connectOnDrop=!1,mxDefaultToolbar.prototype.init=function(t){null!=t&&(this.toolbar=new mxToolbar(t),this.toolbar.addListener(mxEvent.SELECT,mxUtils.bind(this,function(t,e){var n=e.getProperty("function");this.editor.insertFunction=null!=n?mxUtils.bind(this,function(){n.apply(this,arguments),this.toolbar.resetMode()}):null})),this.resetHandler=mxUtils.bind(this,function(){null!=this.toolbar&&this.toolbar.resetMode(!0)}),this.editor.graph.addListener(mxEvent.DOUBLE_CLICK,this.resetHandler),this.editor.addListener(mxEvent.ESCAPE,this.resetHandler))},mxDefaultToolbar.prototype.addItem=function(t,e,n,i){var o=mxUtils.bind(this,function(){null!=n&&0<n.length&&this.editor.execute(n)});return this.toolbar.addItem(t,e,o,i)},mxDefaultToolbar.prototype.addSeparator=function(t){t=t||mxClient.imageBasePath+"/separator.gif",this.toolbar.addSeparator(t)},mxDefaultToolbar.prototype.addCombo=function(){return this.toolbar.addCombo()},mxDefaultToolbar.prototype.addActionCombo=function(t){return this.toolbar.addActionCombo(t)},mxDefaultToolbar.prototype.addActionOption=function(t,e,n){var i=mxUtils.bind(this,function(){this.editor.execute(n)});this.addOption(t,e,i)},mxDefaultToolbar.prototype.addOption=function(t,e,n){return this.toolbar.addOption(t,e,n)},mxDefaultToolbar.prototype.addMode=function(t,e,n,i,o){var s=mxUtils.bind(this,function(){this.editor.setMode(n),null!=o&&o(this.editor)});return this.toolbar.addSwitchMode(t,e,s,i)},mxDefaultToolbar.prototype.addPrototype=function(t,e,n,i,o,s){var l=mxUtils.bind(this,function(){return"function"==typeof n?n():null!=n?this.editor.graph.cloneCells([n])[0]:null}),r=mxUtils.bind(this,function(t,e){"function"==typeof o?o(this.editor,l(),t,e):this.drop(l(),t,e),this.toolbar.resetMode(),mxEvent.consume(t)}),a=this.toolbar.addMode(t,e,r,i,null,s);return this.installDropHandler(a,function(t,e,n){r(e,n)}),a},mxDefaultToolbar.prototype.drop=function(t,e,n){var i=this.editor.graph,o=i.getModel();if(null!=n&&!o.isEdge(n)&&this.connectOnDrop&&i.isCellConnectable(n))this.connect(t,e,n);else{for(;null!=n&&!i.isValidDropTarget(n,[t],e);)n=o.getParent(n);this.insert(t,e,n)}},mxDefaultToolbar.prototype.insert=function(t,e,n){var i=this.editor.graph;if(i.canImportCell(t)){var o=mxEvent.getClientX(e),s=mxEvent.getClientY(e),l=mxUtils.convertPoint(i.container,o,s);return i.isSplitEnabled()&&i.isSplitTarget(n,[t],e)?i.splitEdge(n,[t],null,l.x,l.y):this.editor.addVertex(n,t,l.x,l.y)}return null},mxDefaultToolbar.prototype.connect=function(t,e,n){var i=this.editor.graph,o=i.getModel();if(null!=n&&i.isCellConnectable(t)&&i.isEdgeValid(null,n,t)){var s=null;o.beginUpdate();try{var l=o.getGeometry(n),r=o.getGeometry(t).clone();r.x=l.x+(l.width-r.width)/2,r.y=l.y+(l.height-r.height)/2;var a=this.spacing*i.gridSize,h=20*o.getDirectedEdgeCount(n,!0);this.editor.horizontalFlow?r.x+=(r.width+l.width)/2+a+h:r.y+=(r.height+l.height)/2+a+h,t.setGeometry(r);var d=o.getParent(n);if(i.addCell(t,d),i.constrainChild(t),s=this.editor.createEdge(n,t),null==o.getGeometry(s)){var u=new mxGeometry;u.relative=!0,o.setGeometry(s,u)}i.addEdge(s,d,n,t)}finally{o.endUpdate()}i.setSelectionCells([t,s]),i.scrollCellToVisible(t)}},mxDefaultToolbar.prototype.installDropHandler=function(e,n){var i=document.createElement("img");i.setAttribute("src",e.getAttribute("src"));var o=mxUtils.bind(this,function(t){i.style.width=2*e.offsetWidth+"px",i.style.height=2*e.offsetHeight+"px",mxUtils.makeDraggable(e,this.editor.graph,n,i),mxEvent.removeListener(i,"load",o)});mxClient.IS_IE?o():mxEvent.addListener(i,"load",o)},mxDefaultToolbar.prototype.destroy=function(){null!=this.resetHandler&&(this.editor.graph.removeListener("dblclick",this.resetHandler),this.editor.removeListener("escape",this.resetHandler),this.resetHandler=null),null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null)},mxLoadResources?mxResources.add(mxClient.basePath+"/resources/editor"):mxClient.defaultBundles.push(mxClient.basePath+"/resources/editor"),mxEditor.prototype=new mxEventSource,mxEditor.prototype.constructor=mxEditor,mxEditor.prototype.askZoomResource="none"!=mxClient.language?"askZoom":"",mxEditor.prototype.lastSavedResource="none"!=mxClient.language?"lastSaved":"",mxEditor.prototype.currentFileResource="none"!=mxClient.language?"currentFile":"",mxEditor.prototype.propertiesResource="none"!=mxClient.language?"properties":"",mxEditor.prototype.tasksResource="none"!=mxClient.language?"tasks":"",mxEditor.prototype.helpResource="none"!=mxClient.language?"help":"",mxEditor.prototype.outlineResource="none"!=mxClient.language?"outline":"",mxEditor.prototype.outline=null,mxEditor.prototype.graph=null,mxEditor.prototype.graphRenderHint=null,mxEditor.prototype.toolbar=null,mxEditor.prototype.status=null,mxEditor.prototype.popupHandler=null,mxEditor.prototype.undoManager=null,mxEditor.prototype.keyHandler=null,mxEditor.prototype.actions=null,mxEditor.prototype.dblClickAction="edit",mxEditor.prototype.swimlaneRequired=!1,mxEditor.prototype.disableContextMenu=!0,mxEditor.prototype.insertFunction=null,mxEditor.prototype.forcedInserting=!1,mxEditor.prototype.templates=null,mxEditor.prototype.defaultEdge=null,mxEditor.prototype.defaultEdgeStyle=null,mxEditor.prototype.defaultGroup=null,mxEditor.prototype.groupBorderSize=null,mxEditor.prototype.filename=null,mxEditor.prototype.linefeed="&#xa;",mxEditor.prototype.postParameterName="xml",mxEditor.prototype.escapePostData=!0,mxEditor.prototype.urlPost=null,mxEditor.prototype.urlImage=null,mxEditor.prototype.horizontalFlow=!1,mxEditor.prototype.layoutDiagram=!1,mxEditor.prototype.swimlaneSpacing=0,mxEditor.prototype.maintainSwimlanes=!1,mxEditor.prototype.layoutSwimlanes=!1,mxEditor.prototype.cycleAttributeValues=null,mxEditor.prototype.cycleAttributeIndex=0,mxEditor.prototype.cycleAttributeName="fillColor",mxEditor.prototype.tasks=null,mxEditor.prototype.tasksWindowImage=null,mxEditor.prototype.tasksTop=20,mxEditor.prototype.help=null,mxEditor.prototype.helpWindowImage=null,mxEditor.prototype.urlHelp=null,mxEditor.prototype.helpWidth=300,mxEditor.prototype.helpHeight=260,mxEditor.prototype.propertiesWidth=240,mxEditor.prototype.propertiesHeight=null,mxEditor.prototype.movePropertiesDialog=!1,mxEditor.prototype.validating=!1,mxEditor.prototype.modified=!1,mxEditor.prototype.isModified=function(){return this.modified},mxEditor.prototype.setModified=function(t){this.modified=t},mxEditor.prototype.addActions=function(){this.addAction("save",function(t){t.save()}),this.addAction("print",function(t){new mxPrintPreview(t.graph,1).open()}),this.addAction("show",function(t){mxUtils.show(t.graph,null,10,10)}),this.addAction("exportImage",function(t){var e=t.getUrlImage();if(null==e||mxClient.IS_LOCAL)t.execute("show");else{var n=mxUtils.getViewXml(t.graph,1),i=mxUtils.getXml(n,"\n");mxUtils.submit(e,t.postParameterName+"="+encodeURIComponent(i),document,"_blank")}}),this.addAction("refresh",function(t){t.graph.refresh()}),this.addAction("cut",function(t){t.graph.isEnabled()&&mxClipboard.cut(t.graph)}),this.addAction("copy",function(t){t.graph.isEnabled()&&mxClipboard.copy(t.graph)}),this.addAction("paste",function(t){t.graph.isEnabled()&&mxClipboard.paste(t.graph)}),this.addAction("delete",function(t){t.graph.isEnabled()&&t.graph.removeCells()}),this.addAction("group",function(t){t.graph.isEnabled()&&t.graph.setSelectionCell(t.groupCells())}),this.addAction("ungroup",function(t){t.graph.isEnabled()&&t.graph.setSelectionCells(t.graph.ungroupCells())}),this.addAction("removeFromParent",function(t){t.graph.isEnabled()&&t.graph.removeCellsFromParent()}),this.addAction("undo",function(t){t.graph.isEnabled()&&t.undo()}),this.addAction("redo",function(t){t.graph.isEnabled()&&t.redo()}),this.addAction("zoomIn",function(t){t.graph.zoomIn()}),this.addAction("zoomOut",function(t){t.graph.zoomOut()}),this.addAction("actualSize",function(t){t.graph.zoomActual()}),this.addAction("fit",function(t){t.graph.fit()}),this.addAction("showProperties",function(t,e){t.showProperties(e)}),this.addAction("selectAll",function(t){t.graph.isEnabled()&&t.graph.selectAll()}),this.addAction("selectNone",function(t){t.graph.isEnabled()&&t.graph.clearSelection()}),this.addAction("selectVertices",function(t){t.graph.isEnabled()&&t.graph.selectVertices()}),this.addAction("selectEdges",function(t){t.graph.isEnabled()&&t.graph.selectEdges()}),this.addAction("edit",function(t,e){t.graph.isEnabled()&&t.graph.isCellEditable(e)&&t.graph.startEditingAtCell(e)}),this.addAction("toBack",function(t,e){t.graph.isEnabled()&&t.graph.orderCells(!0)}),this.addAction("toFront",function(t,e){t.graph.isEnabled()&&t.graph.orderCells(!1)}),this.addAction("enterGroup",function(t,e){t.graph.enterGroup(e)}),this.addAction("exitGroup",function(t){t.graph.exitGroup()}),this.addAction("home",function(t){t.graph.home()}),this.addAction("selectPrevious",function(t){t.graph.isEnabled()&&t.graph.selectPreviousCell()}),this.addAction("selectNext",function(t){t.graph.isEnabled()&&t.graph.selectNextCell()}),this.addAction("selectParent",function(t){t.graph.isEnabled()&&t.graph.selectParentCell()}),this.addAction("selectChild",function(t){t.graph.isEnabled()&&t.graph.selectChildCell()}),this.addAction("collapse",function(t){t.graph.isEnabled()&&t.graph.foldCells(!0)}),this.addAction("collapseAll",function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(!0,!1,e)}}),this.addAction("expand",function(t){t.graph.isEnabled()&&t.graph.foldCells(!1)}),this.addAction("expandAll",function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(!1,!1,e)}}),this.addAction("bold",function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD)}),this.addAction("italic",function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC)}),this.addAction("underline",function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE)}),this.addAction("alignCellsLeft",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_LEFT)}),this.addAction("alignCellsCenter",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_CENTER)}),this.addAction("alignCellsRight",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_RIGHT)}),this.addAction("alignCellsTop",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_TOP)}),this.addAction("alignCellsMiddle",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_MIDDLE)}),this.addAction("alignCellsBottom",function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_BOTTOM)}),this.addAction("alignFontLeft",function(t){t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT)}),this.addAction("alignFontCenter",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER)}),this.addAction("alignFontRight",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_RIGHT)}),this.addAction("alignFontTop",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP)}),this.addAction("alignFontMiddle",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)}),this.addAction("alignFontBottom",function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_BOTTOM)}),this.addAction("zoom",function(t){var e=100*t.graph.getView().scale,n=parseFloat(mxUtils.prompt(mxResources.get(t.askZoomResource)||t.askZoomResource,e))/100;isNaN(n)||t.graph.getView().setScale(n)}),this.addAction("toggleTasks",function(t){null!=t.tasks?t.tasks.setVisible(!t.tasks.isVisible()):t.showTasks()}),this.addAction("toggleHelp",function(t){null!=t.help?t.help.setVisible(!t.help.isVisible()):t.showHelp()}),this.addAction("toggleOutline",function(t){null==t.outline?t.showOutline():t.outline.setVisible(!t.outline.isVisible())}),this.addAction("toggleConsole",function(t){mxLog.setVisible(!mxLog.isVisible())})},mxEditor.prototype.configure=function(t){null!=t&&(new mxCodec(t.ownerDocument).decode(t,this),this.resetHistory())},mxEditor.prototype.resetFirstTime=function(){document.cookie="mxgraph=seen; expires=Fri, 27 Jul 2001 02:47:11 UTC; path=/"},mxEditor.prototype.resetHistory=function(){this.lastSnapshot=(new Date).getTime(),this.undoManager.clear(),this.ignoredChanges=0,this.setModified(!1)},mxEditor.prototype.addAction=function(t,e){this.actions[t]=e},mxEditor.prototype.execute=function(e,t,n){var i=this.actions[e];if(null!=i)try{var o=arguments;o[0]=this,i.apply(this,o)}catch(t){throw mxUtils.error("Cannot execute "+e+": "+t.message,280,!0),t}else mxUtils.error("Cannot find action "+e,280,!0)},mxEditor.prototype.addTemplate=function(t,e){this.templates[t]=e},mxEditor.prototype.getTemplate=function(t){return this.templates[t]},mxEditor.prototype.createGraph=function(){var t=new mxGraph(null,null,this.graphRenderHint);return t.setTooltips(!0),t.setPanning(!0),this.installDblClickHandler(t),this.installUndoHandler(t),this.installDrillHandler(t),this.installChangeHandler(t),this.installInsertHandler(t),t.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(t,e,n){return this.createPopupMenu(t,e,n)}),t.connectionHandler.factoryMethod=mxUtils.bind(this,function(t,e){return this.createEdge(t,e)}),this.createSwimlaneManager(t),this.createLayoutManager(t),t},mxEditor.prototype.createSwimlaneManager=function(t){var e=new mxSwimlaneManager(t,!1);return e.isHorizontal=mxUtils.bind(this,function(){return this.horizontalFlow}),e.isEnabled=mxUtils.bind(this,function(){return this.maintainSwimlanes}),e},mxEditor.prototype.createLayoutManager=function(i){var t=new mxLayoutManager(i),o=this;return t.getLayout=function(t){var e=null,n=o.graph.getModel();return null!=n.getParent(t)&&(o.layoutSwimlanes&&i.isSwimlane(t)?(null==o.swimlaneLayout&&(o.swimlaneLayout=o.createSwimlaneLayout()),e=o.swimlaneLayout):o.layoutDiagram&&(i.isValidRoot(t)||null==n.getParent(n.getParent(t)))&&(null==o.diagramLayout&&(o.diagramLayout=o.createDiagramLayout()),e=o.diagramLayout)),e},t},mxEditor.prototype.setGraphContainer=function(t){null==this.graph.container&&(this.graph.init(t),this.rubberband=new mxRubberband(this.graph),this.disableContextMenu&&mxEvent.disableContextMenu(t),mxClient.IS_QUIRKS&&new mxDivResizer(t))},mxEditor.prototype.installDblClickHandler=function(i){i.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,function(t,e){var n=e.getProperty("cell");null!=n&&i.isEnabled()&&null!=this.dblClickAction&&(this.execute(this.dblClickAction,n),e.consume())}))},mxEditor.prototype.installUndoHandler=function(i){var t=mxUtils.bind(this,function(t,e){var n=e.getProperty("edit");this.undoManager.undoableEditHappened(n)});i.getModel().addListener(mxEvent.UNDO,t),i.getView().addListener(mxEvent.UNDO,t);function e(t,e){var n=e.getProperty("edit").changes;i.setSelectionCells(i.getSelectionCellsForChanges(n))}this.undoManager.addListener(mxEvent.UNDO,e),this.undoManager.addListener(mxEvent.REDO,e)},mxEditor.prototype.installDrillHandler=function(t){var e=mxUtils.bind(this,function(t){this.fireEvent(new mxEventObject(mxEvent.ROOT))});t.getView().addListener(mxEvent.DOWN,e),t.getView().addListener(mxEvent.UP,e)},mxEditor.prototype.installChangeHandler=function(s){var t=mxUtils.bind(this,function(t,e){this.setModified(!0),1==this.validating&&s.validateGraph();for(var n=e.getProperty("edit").changes,i=0;i<n.length;i++){var o=n[i];if(o instanceof mxRootChange||o instanceof mxValueChange&&o.cell==this.graph.model.root||o instanceof mxCellAttributeChange&&o.cell==this.graph.model.root){this.fireEvent(new mxEventObject(mxEvent.ROOT));break}}});s.getModel().addListener(mxEvent.CHANGE,t)},mxEditor.prototype.installInsertHandler=function(t){var n=this,e={mouseDown:function(t,e){null==n.insertFunction||e.isPopupTrigger()||!n.forcedInserting&&null!=e.getState()||(n.graph.clearSelection(),n.insertFunction(e.getEvent(),e.getCell()),this.isActive=!0,e.consume())},mouseMove:function(t,e){this.isActive&&e.consume()},mouseUp:function(t,e){this.isActive&&(this.isActive=!1,e.consume())}};t.addMouseListener(e)},mxEditor.prototype.createDiagramLayout=function(){var t=this.graph.gridSize,e=new mxStackLayout(this.graph,!this.horizontalFlow,this.swimlaneSpacing,2*t,2*t);return e.isVertexIgnored=function(t){return!e.graph.isSwimlane(t)},e},mxEditor.prototype.createSwimlaneLayout=function(){return new mxCompactTreeLayout(this.graph,this.horizontalFlow)},mxEditor.prototype.createToolbar=function(){return new mxDefaultToolbar(null,this)},mxEditor.prototype.setToolbarContainer=function(t){this.toolbar.init(t),mxClient.IS_QUIRKS&&new mxDivResizer(t)},mxEditor.prototype.setStatusContainer=function(t){null==this.status&&(this.status=t,this.addListener(mxEvent.SAVE,mxUtils.bind(this,function(){var t=(new Date).toLocaleString();this.setStatus((mxResources.get(this.lastSavedResource)||this.lastSavedResource)+": "+t)})),this.addListener(mxEvent.OPEN,mxUtils.bind(this,function(){this.setStatus((mxResources.get(this.currentFileResource)||this.currentFileResource)+": "+this.filename)})),mxClient.IS_QUIRKS&&new mxDivResizer(t))},mxEditor.prototype.setStatus=function(t){null!=this.status&&null!=t&&(this.status.innerHTML=t)},mxEditor.prototype.setTitleContainer=function(e){this.addListener(mxEvent.ROOT,mxUtils.bind(this,function(t){e.innerHTML=this.getTitle()})),mxClient.IS_QUIRKS&&new mxDivResizer(e)},mxEditor.prototype.treeLayout=function(t,e){null!=t&&new mxCompactTreeLayout(this.graph,e).execute(t)},mxEditor.prototype.getTitle=function(){for(var t="",e=this.graph,n=e.getCurrentRoot();null!=n&&null!=e.getModel().getParent(e.getModel().getParent(n));)e.isValidRoot(n)&&(t=" > "+e.convertValueToString(n)+t),n=e.getModel().getParent(n);return this.getRootTitle()+t},mxEditor.prototype.getRootTitle=function(){var t=this.graph.getModel().getRoot();return this.graph.convertValueToString(t)},mxEditor.prototype.undo=function(){this.undoManager.undo()},mxEditor.prototype.redo=function(){this.undoManager.redo()},mxEditor.prototype.groupCells=function(){var t=null!=this.groupBorderSize?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),t)},mxEditor.prototype.createGroup=function(){return this.graph.getModel().cloneCell(this.defaultGroup)},mxEditor.prototype.open=function(t){if(null!=t){var e=mxUtils.load(t).getXml();this.readGraphModel(e.documentElement),this.filename=t,this.fireEvent(new mxEventObject(mxEvent.OPEN,"filename",t))}},mxEditor.prototype.readGraphModel=function(t){new mxCodec(t.ownerDocument).decode(t,this.graph.getModel()),this.resetHistory()},mxEditor.prototype.save=function(t,e){if(null!=(t=t||this.getUrlPost())&&0<t.length){var n=this.writeGraphModel(e);this.postDiagram(t,n),this.setModified(!1)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",t))},mxEditor.prototype.postDiagram=function(e,n){this.escapePostData&&(n=encodeURIComponent(n)),mxUtils.post(e,this.postParameterName+"="+n,mxUtils.bind(this,function(t){this.fireEvent(new mxEventObject(mxEvent.POST,"request",t,"url",e,"data",n))}))},mxEditor.prototype.writeGraphModel=function(t){t=null!=t?t:this.linefeed;var e=(new mxCodec).encode(this.graph.getModel());return mxUtils.getXml(e,t)},mxEditor.prototype.getUrlPost=function(){return this.urlPost},mxEditor.prototype.getUrlImage=function(){return this.urlImage},mxEditor.prototype.swapStyles=function(t,e){var n=this.graph.getStylesheet().styles[e];this.graph.getView().getStylesheet().putCellStyle(e,this.graph.getStylesheet().styles[t]),this.graph.getStylesheet().putCellStyle(t,n),this.graph.refresh()},mxEditor.prototype.showProperties=function(t){if(null==(t=t||this.graph.getSelectionCell())&&null==(t=this.graph.getCurrentRoot())&&(t=this.graph.getModel().getRoot()),null!=t){this.graph.stopEditing(!0);var e=mxUtils.getOffset(this.graph.container),n=e.x+10,i=e.y;if(null==this.properties||this.movePropertiesDialog){var o=this.graph.getCellBounds(t);null!=o&&(n+=o.x+Math.min(200,o.width),i+=o.y)}else n=this.properties.getX(),i=this.properties.getY();this.hideProperties();var s=this.createProperties(t);null!=s&&(this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,s,n,i,this.propertiesWidth,this.propertiesHeight,!1),this.properties.setVisible(!0))}},mxEditor.prototype.isPropertiesVisible=function(){return null!=this.properties},mxEditor.prototype.createProperties=function(n){var i=this.graph.getModel(),t=i.getValue(n);if(mxUtils.isNode(t)){var e=new mxForm("properties");e.addText("ID",n.getId()).setAttribute("readonly","true");var o=null,s=null,l=null,r=null,a=null;i.isVertex(n)&&null!=(o=i.getGeometry(n))&&(s=e.addText("top",o.y),l=e.addText("left",o.x),r=e.addText("width",o.width),a=e.addText("height",o.height));for(var h=i.getStyle(n),d=e.addText("Style",h||""),u=t.attributes,p=[],m=0;m<u.length;m++){var c=u[m].value;p[m]=e.addTextarea(u[m].nodeName,c,"label"==u[m].nodeName?4:2)}var g=mxUtils.bind(this,function(){this.hideProperties(),i.beginUpdate();try{null!=o&&((o=o.clone()).x=parseFloat(l.value),o.y=parseFloat(s.value),o.width=parseFloat(r.value),o.height=parseFloat(a.value),i.setGeometry(n,o)),0<d.value.length?i.setStyle(n,d.value):i.setStyle(n,null);for(var t=0;t<u.length;t++){var e=new mxCellAttributeChange(n,u[t].nodeName,p[t].value);i.execute(e)}this.graph.isAutoSizeCell(n)&&this.graph.updateCellSize(n)}finally{i.endUpdate()}}),x=mxUtils.bind(this,function(){this.hideProperties()});return e.addButtons(g,x),e.table}return null},mxEditor.prototype.hideProperties=function(){null!=this.properties&&(this.properties.destroy(),this.properties=null)},mxEditor.prototype.showTasks=function(){if(null==this.tasks){var e=document.createElement("div");e.style.padding="4px",e.style.paddingLeft="20px";var t=document.body.clientWidth,n=new mxWindow(mxResources.get(this.tasksResource)||this.tasksResource,e,t-220,this.tasksTop,200);n.setClosable(!0),n.destroyOnClose=!1;var i=mxUtils.bind(this,function(t){mxEvent.release(e),e.innerHTML="",this.createTasks(e)});this.graph.getModel().addListener(mxEvent.CHANGE,i),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,i),this.graph.addListener(mxEvent.ROOT,i),null!=this.tasksWindowImage&&n.setImage(this.tasksWindowImage),this.tasks=n,this.createTasks(e)}this.tasks.setVisible(!0)},mxEditor.prototype.refreshTasks=function(t){if(null!=this.tasks){t=this.tasks.content;mxEvent.release(t),t.innerHTML="",this.createTasks(t)}},mxEditor.prototype.createTasks=function(t){},mxEditor.prototype.showHelp=function(t){if(null==this.help){var n=document.createElement("iframe");n.setAttribute("src",mxResources.get("urlHelp")||this.urlHelp),n.setAttribute("height","100%"),n.setAttribute("width","100%"),n.setAttribute("frameBorder","0"),n.style.backgroundColor="white";var e=document.body.clientWidth,i=document.body.clientHeight||document.documentElement.clientHeight,o=new mxWindow(mxResources.get(this.helpResource)||this.helpResource,n,(e-this.helpWidth)/2,(i-this.helpHeight)/3,this.helpWidth,this.helpHeight);if(o.setMaximizable(!0),o.setClosable(!0),o.destroyOnClose=!1,o.setResizable(!0),null!=this.helpWindowImage&&o.setImage(this.helpWindowImage),mxClient.IS_NS){function s(t){var e=o.div.offsetHeight;n.setAttribute("height",e-26+"px")}o.addListener(mxEvent.RESIZE_END,s),o.addListener(mxEvent.MAXIMIZE,s),o.addListener(mxEvent.NORMALIZE,s),o.addListener(mxEvent.SHOW,s)}this.help=o}this.help.setVisible(!0)},mxEditor.prototype.showOutline=function(){if(null==this.outline){var t=document.createElement("div");t.style.overflow="hidden",t.style.position="relative",t.style.width="100%",t.style.height="100%",t.style.background="white",t.style.cursor="move",8==document.documentMode&&(t.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=100)");var e=new mxWindow(mxResources.get(this.outlineResource)||this.outlineResource,t,600,480,200,200,!1),n=new mxOutline(this.graph,t);e.setClosable(!0),e.setResizable(!0),e.destroyOnClose=!1,e.addListener(mxEvent.RESIZE_END,function(){n.update()}),this.outline=e,this.outline.outline=n}this.outline.setVisible(!0),this.outline.outline.update(!0)},mxEditor.prototype.setMode=function(t){"select"==t?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!1)):"connect"==t?(this.graph.panningHandler.useLeftButtonForPanning=!1,this.graph.setConnectable(!0)):"pan"==t&&(this.graph.panningHandler.useLeftButtonForPanning=!0,this.graph.setConnectable(!1))},mxEditor.prototype.createPopupMenu=function(t,e,n){this.popupHandler.createMenu(this,t,e,n)},mxEditor.prototype.createEdge=function(t,e){var n=null;if(null!=this.defaultEdge){n=this.graph.getModel().cloneCell(this.defaultEdge)}else{(n=new mxCell("")).setEdge(!0);var i=new mxGeometry;i.relative=!0,n.setGeometry(i)}var o=this.getEdgeStyle();return null!=o&&n.setStyle(o),n},mxEditor.prototype.getEdgeStyle=function(){return this.defaultEdgeStyle},mxEditor.prototype.consumeCycleAttribute=function(t){return null!=this.cycleAttributeValues&&0<this.cycleAttributeValues.length&&this.graph.isSwimlane(t)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null},mxEditor.prototype.cycleAttribute=function(t){if(null!=this.cycleAttributeName){var e=this.consumeCycleAttribute(t);null!=e&&t.setStyle(t.getStyle()+";"+this.cycleAttributeName+"="+e)}},mxEditor.prototype.addVertex=function(t,e,n,i){for(var o=this.graph.getModel();null!=t&&!this.graph.isValidDropTarget(t);)t=o.getParent(t);t=null!=t?t:this.graph.getSwimlaneAt(n,i);var s=this.graph.getView().scale,l=o.getGeometry(e),r=o.getGeometry(t);if(this.graph.isSwimlane(e)&&!this.graph.swimlaneNesting)t=null;else{if(null==t&&this.swimlaneRequired)return null;if(null!=t&&null!=r){var a=this.graph.getView().getState(t);if(null!=a){if(n-=a.origin.x*s,i-=a.origin.y*s,this.graph.isConstrainedMoving){var h=l.width,d=l.height,u=a.x+a.width;u<n+h&&(n-=n+h-u),(u=a.y+a.height)<i+d&&(i-=i+d-u)}}else null!=r&&(n-=r.x*s,i-=r.y*s)}}(l=l.clone()).x=this.graph.snap(n/s-this.graph.getView().translate.x-this.graph.gridSize/2),l.y=this.graph.snap(i/s-this.graph.getView().translate.y-this.graph.gridSize/2),e.setGeometry(l),null==t&&(t=this.graph.getDefaultParent()),this.cycleAttribute(e),this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",e,"parent",t)),o.beginUpdate();try{null!=(e=this.graph.addCell(e,t))&&(this.graph.constrainChild(e),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",e)))}finally{o.endUpdate()}return null!=e&&(this.graph.setSelectionCell(e),this.graph.scrollCellToVisible(e),this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",e))),e},mxEditor.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tasks&&this.tasks.destroy(),null!=this.outline&&this.outline.destroy(),null!=this.properties&&this.properties.destroy(),null!=this.keyHandler&&this.keyHandler.destroy(),null!=this.rubberband&&this.rubberband.destroy(),null!=this.toolbar&&this.toolbar.destroy(),null!=this.graph&&this.graph.destroy(),this.status=null,this.templates=null)};var mxCodecRegistry={codecs:[],aliases:[],register:function(t){if(null!=t){var e=t.getName();mxCodecRegistry.codecs[e]=t;var n=mxUtils.getFunctionName(t.template.constructor);n!=e&&mxCodecRegistry.addAlias(n,e)}return t},addAlias:function(t,e){mxCodecRegistry.aliases[t]=e},getCodec:function(t){var e=null;if(null!=t){var n=mxUtils.getFunctionName(t),i=mxCodecRegistry.aliases[n];if(null!=i&&(n=i),null==(e=mxCodecRegistry.codecs[n]))try{e=new mxObjectCodec(new t),mxCodecRegistry.register(e)}catch(t){}}return e}};function mxCodec(t){this.document=t||mxUtils.createXmlDocument(),this.objects=[]}function mxObjectCodec(t,e,n,i){for(var o in this.template=t,this.exclude=null!=e?e:[],this.idrefs=null!=n?n:[],this.mapping=null!=i?i:[],this.reverse=new Object,this.mapping)this.reverse[this.mapping[o]]=o}mxCodec.prototype.document=null,mxCodec.prototype.objects=null,mxCodec.prototype.elements=null,mxCodec.prototype.encodeDefaults=!1,mxCodec.prototype.putObject=function(t,e){return this.objects[t]=e},mxCodec.prototype.getObject=function(t){var e=null;if(null!=t&&null==(e=this.objects[t])&&null==(e=this.lookup(t))){var n=this.getElementById(t);null!=n&&(e=this.decode(n))}return e},mxCodec.prototype.lookup=function(t){return null},mxCodec.prototype.getElementById=function(t){if(null==this.elements){if(null==this.document.documentElement)throw new Error("mxCodec constructor needs document parameter");this.elements=new Object,this.addElement(this.document.documentElement)}return this.elements[t]},mxCodec.prototype.addElement=function(t){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var e=t.getAttribute("id");null!=e&&null==this.elements[e]&&(this.elements[e]=t)}for(t=t.firstChild;null!=t;)this.addElement(t),t=t.nextSibling},mxCodec.prototype.getId=function(t){var e=null;return null!=t&&null==(e=this.reference(t))&&t instanceof mxCell&&null==(e=t.getId())&&0==(e=mxCellPath.create(t)).length&&(e="root"),e},mxCodec.prototype.reference=function(t){return null},mxCodec.prototype.encode=function(t){var e=null;if(null!=t&&null!=t.constructor){var n=mxCodecRegistry.getCodec(t.constructor);null!=n?e=n.encode(this,t):mxUtils.isNode(t)?e=mxUtils.importNode(this.document,t,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(t.constructor))}return e},mxCodec.prototype.decode=function(t,e){var n=null;if(null!=t&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var i=null;try{i=window[t.nodeName]}catch(t){}var o=mxCodecRegistry.getCodec(i);null!=o?n=o.decode(this,t,e):(n=t.cloneNode(!0)).removeAttribute("as")}return n},mxCodec.prototype.encodeCell=function(t,e,n){if(e.appendChild(this.encode(t)),null==n||n)for(var i=t.getChildCount(),o=0;o<i;o++)this.encodeCell(t.getChildAt(o),e)},mxCodec.prototype.isCellCodec=function(t){return null!=t&&"function"==typeof t.isCellCodec&&t.isCellCodec()},mxCodec.prototype.decodeCell=function(t,e){e=null==e||e;var n=null;if(null!=t&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var i=mxCodecRegistry.getCodec(t.nodeName);if(!this.isCellCodec(i))for(var o=t.firstChild;null!=o&&!this.isCellCodec(i);)i=mxCodecRegistry.getCodec(o.nodeName),o=o.nextSibling;this.isCellCodec(i)||(i=mxCodecRegistry.getCodec(mxCell)),n=i.decode(this,t),e&&this.insertIntoGraph(n)}return n},mxCodec.prototype.insertIntoGraph=function(t){var e=t.parent,n=t.getTerminal(!0),i=t.getTerminal(!1);t.setTerminal(null,!1),t.setTerminal(null,!0),(t.parent=null)!=e&&e.insert(t),null!=n&&n.insertEdge(t,!0),null!=i&&i.insertEdge(t,!1)},mxCodec.prototype.setAttribute=function(t,e,n){null!=e&&null!=n&&t.setAttribute(e,n)},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(t){if(null!=t){var e=this.reverse[t];null!=e&&(t=e)}return t},mxObjectCodec.prototype.getAttributeName=function(t){if(null!=t){var e=this.mapping[t];null!=e&&(t=e)}return t},mxObjectCodec.prototype.isExcluded=function(t,e,n,i){return e==mxObjectIdentity.FIELD_NAME||0<=mxUtils.indexOf(this.exclude,e)},mxObjectCodec.prototype.isReference=function(t,e,n,i){return 0<=mxUtils.indexOf(this.idrefs,e)},mxObjectCodec.prototype.encode=function(t,e){var n=t.document.createElement(this.getName());return e=this.beforeEncode(t,e,n),this.encodeObject(t,e,n),this.afterEncode(t,e,n)},mxObjectCodec.prototype.encodeObject=function(t,e,n){for(var i in t.setAttribute(n,"id",t.getId(e)),e){var o=i,s=e[o];null==s||this.isExcluded(e,o,s,!0)||(mxUtils.isInteger(o)&&(o=null),this.encodeValue(t,e,o,s,n))}},mxObjectCodec.prototype.encodeValue=function(t,e,n,i,o){if(null!=i){if(this.isReference(e,n,i,!0)){var s=t.getId(i);if(null==s)return void mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+n+"="+i);i=s}var l=this.template[n];null!=n&&!t.encodeDefaults&&l==i||(n=this.getAttributeName(n),this.writeAttribute(t,e,n,i,o))}},mxObjectCodec.prototype.writeAttribute=function(t,e,n,i,o){"object"!=typeof i?this.writePrimitiveAttribute(t,e,n,i,o):this.writeComplexAttribute(t,e,n,i,o)},mxObjectCodec.prototype.writePrimitiveAttribute=function(t,e,n,i,o){if(i=this.convertAttributeToXml(t,e,n,i,o),null==n){var s=t.document.createElement("add");"function"==typeof i?s.appendChild(t.document.createTextNode(i)):t.setAttribute(s,"value",i),o.appendChild(s)}else"function"!=typeof i&&t.setAttribute(o,n,i)},mxObjectCodec.prototype.writeComplexAttribute=function(t,e,n,i,o){var s=t.encode(i);null!=s?(null!=n&&s.setAttribute("as",n),o.appendChild(s)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+n+": "+i)},mxObjectCodec.prototype.convertAttributeToXml=function(t,e,n,i){return this.isBooleanAttribute(t,e,n,i)&&(i=1==i?"1":"0"),i},mxObjectCodec.prototype.isBooleanAttribute=function(t,e,n,i){return void 0===i.length&&(1==i||0==i)},mxObjectCodec.prototype.convertAttributeFromXml=function(t,e,n){var i=e.value;return this.isNumericAttribute(t,e,n)&&"operatorNameStr"!==e.name&&(i=parseFloat(i)),i},mxObjectCodec.prototype.isNumericAttribute=function(t,e,n){return mxUtils.isNumeric(e.value)},mxObjectCodec.prototype.beforeEncode=function(t,e,n){return e},mxObjectCodec.prototype.afterEncode=function(t,e,n){return n},mxObjectCodec.prototype.decode=function(t,e,n){var i=e.getAttribute("id"),o=t.objects[i];return null==o&&(o=n||this.cloneTemplate(),null!=i&&t.putObject(i,o)),e=this.beforeDecode(t,e,o),this.decodeNode(t,e,o),this.afterDecode(t,e,o)},mxObjectCodec.prototype.decodeNode=function(t,e,n){null!=e&&(this.decodeAttributes(t,e,n),this.decodeChildren(t,e,n))},mxObjectCodec.prototype.decodeAttributes=function(t,e,n){var i=e.attributes;if(null!=i)for(var o=0;o<i.length;o++)this.decodeAttribute(t,i[o],n)},mxObjectCodec.prototype.isIgnoredAttribute=function(t,e,n){return"as"==e.nodeName||"id"==e.nodeName},mxObjectCodec.prototype.decodeAttribute=function(t,e,n){if(!this.isIgnoredAttribute(t,e,n)){var i=e.nodeName,o=this.convertAttributeFromXml(t,e,n),s=this.getFieldName(i);if(this.isReference(n,s,o,!1)){var l=t.getObject(o);if(null==l)return void mxLog.warn("mxObjectCodec.decode: No object for "+this.getName()+"."+i+"="+o);o=l}this.isExcluded(n,i,o,!1)||(n[i]=o)}},mxObjectCodec.prototype.decodeChildren=function(t,e,n){for(var i=e.firstChild;null!=i;){var o=i.nextSibling;i.nodeType!=mxConstants.NODETYPE_ELEMENT||this.processInclude(t,i,n)||this.decodeChild(t,i,n),i=o}},mxObjectCodec.prototype.decodeChild=function(t,e,n){var i=this.getFieldName(e.getAttribute("as"));if(null==i||!this.isExcluded(n,i,e,!1)){var o=this.getFieldTemplate(n,i,e),s=null;"add"==e.nodeName?null==(s=e.getAttribute("value"))&&mxObjectCodec.allowEval&&(s=mxUtils.eval(mxUtils.getTextContent(e))):s=t.decode(e,o),this.addObjectValue(n,i,s,o)}},mxObjectCodec.prototype.getFieldTemplate=function(t,e,n){var i=t[e];return i instanceof Array&&0<i.length&&(i=null),i},mxObjectCodec.prototype.addObjectValue=function(t,e,n,i){null!=n&&n!=i&&(null!=e&&0<e.length?t[e]=n:t.push(n))},mxObjectCodec.prototype.processInclude=function(t,e,n){if("include"!=e.nodeName)return!1;var i=e.getAttribute("name");if(null!=i)try{var o=mxUtils.load(i).getDocumentElement();null!=o&&t.decode(o,n)}catch(t){}return!0},mxObjectCodec.prototype.beforeDecode=function(t,e,n){return e},mxObjectCodec.prototype.afterDecode=function(t,e,n){return n},mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);return t.isCellCodec=function(){return!0},t.isNumericAttribute=function(t,e,n){return"value"!==e.nodeName&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)},t.isExcluded=function(t,e,n,i){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||i&&"value"==e&&n.nodeType==mxConstants.NODETYPE_ELEMENT},t.afterEncode=function(t,e,n){if(null!=e.value&&e.value.nodeType==mxConstants.NODETYPE_ELEMENT){var i=n;(n=mxUtils.importNode(t.document,e.value,!0)).appendChild(i);var o=i.getAttribute("id");n.setAttribute("id",o),i.removeAttribute("id")}return n},t.beforeDecode=function(t,e,n){var i=e.cloneNode(!0),o=this.getName();if(e.nodeName!=o){var s=e.getElementsByTagName(o)[0];i=null!=s&&s.parentNode==e?(mxUtils.removeWhitespace(s,!0),mxUtils.removeWhitespace(s,!1),s.parentNode.removeChild(s),s):null,n.value=e.cloneNode(!0);var l=n.value.getAttribute("id");null!=l&&(n.setId(l),n.value.removeAttribute("id"))}else n.setId(e.getAttribute("id"));if(null!=i)for(var r=0;r<this.idrefs.length;r++){var a=this.idrefs[r],h=i.getAttribute(a);if(null!=h){i.removeAttribute(a);var d=t.objects[h]||t.lookup(h);if(null==d){var u=t.getElementById(h);if(null!=u)d=(mxCodecRegistry.codecs[u.nodeName]||this).decode(t,u)}n[a]=d}}return i},t}()),mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxGraphModel);return t.encodeObject=function(t,e,n){var i=t.document.createElement("root");t.encodeCell(e.getRoot(),i),n.appendChild(i)},t.decodeChild=function(t,e,n){"root"==e.nodeName?this.decodeRoot(t,e,n):mxObjectCodec.prototype.decodeChild.apply(this,arguments)},t.decodeRoot=function(t,e,n){for(var i=null,o=e.firstChild;null!=o;){var s=t.decodeCell(o);null!=s&&null==s.getParent()&&(i=s),o=o.nextSibling}null!=i&&n.setRoot(i)},t}()),mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxRootChange,["model","previous","root"]);return t.afterEncode=function(t,e,n){return t.encodeCell(e.root,n),n},t.beforeDecode=function(t,e,n){if(null!=e.firstChild&&e.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var i=(e=e.cloneNode(!0)).firstChild;n.root=t.decodeCell(i,!1);var o=i.nextSibling;for(i.parentNode.removeChild(i),i=o;null!=i;)o=i.nextSibling,t.decodeCell(i),i.parentNode.removeChild(i),i=o}return e},t.afterDecode=function(t,e,n){return n.previous=n.root,n},t}()),mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxChildChange,["model","child","previousIndex"],["parent","previous"]);return t.isReference=function(t,e,n,i){return!("child"!=e||null==t.previous&&i)||0<=mxUtils.indexOf(this.idrefs,e)},t.afterEncode=function(t,e,n){return this.isReference(e,"child",e.child,!0)?n.setAttribute("child",t.getId(e.child)):t.encodeCell(e.child,n),n},t.beforeDecode=function(t,e,n){if(null!=e.firstChild&&e.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var i=(e=e.cloneNode(!0)).firstChild;n.child=t.decodeCell(i,!1);var o=i.nextSibling;for(i.parentNode.removeChild(i),i=o;null!=i;){if(o=i.nextSibling,i.nodeType==mxConstants.NODETYPE_ELEMENT){var s=i.getAttribute("id");null==t.lookup(s)&&t.decodeCell(i)}i.parentNode.removeChild(i),i=o}}else{var l=e.getAttribute("child");n.child=t.getObject(l)}return e},t.afterDecode=function(t,e,n){return null!=n.child&&(null!=n.child.parent&&null!=n.previous&&n.child.parent!=n.previous&&(n.previous=n.child.parent),n.child.parent=n.previous,n.previous=n.parent,n.previousIndex=n.index),n},t}()),mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);return t.afterDecode=function(t,e,n){return n.previous=n.terminal,n},t}());var mxGenericChangeCodec=function(t,i){var e=new mxObjectCodec(t,["model","previous"],["cell"]);return e.afterDecode=function(t,e,n){return mxUtils.isNode(n.cell)&&(n.cell=t.decodeCell(n.cell,!1)),n.previous=n[i],n},e};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value")),mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style")),mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed")),mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value")),mxCodecRegistry.register(new mxObjectCodec(new mxGraph,["graphListeners","eventListeners","view","container","cellRenderer","editor","selection"])),mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxGraphView);return t.encode=function(t,e){return this.encodeCell(t,e,e.graph.getModel().getRoot())},t.encodeCell=function(t,e,n){var i=e.graph.getModel(),o=e.getState(n),s=i.getParent(n);if(null==s||null!=o){var l=i.getChildCount(n),r=e.graph.getCellGeometry(n),a=null;if(s==i.getRoot()?a="layer":null==s?a="graph":i.isEdge(n)?a="edge":0<l&&null!=r?a="group":i.isVertex(n)&&(a="vertex"),null!=a){var h=t.document.createElement(a);if(null!=e.graph.getLabel(n)&&(h.setAttribute("label",e.graph.getLabel(n)),e.graph.isHtmlLabel(n)&&h.setAttribute("html",!0)),null==s){var d=e.getGraphBounds();null!=d&&(h.setAttribute("x",Math.round(d.x)),h.setAttribute("y",Math.round(d.y)),h.setAttribute("width",Math.round(d.width)),h.setAttribute("height",Math.round(d.height))),h.setAttribute("scale",e.scale)}else if(null!=o&&null!=r){for(var u in o.style){var p=o.style[u];"function"==typeof p&&"object"==typeof p&&(p=mxStyleRegistry.getName(p)),null!=p&&"function"!=typeof p&&"object"!=typeof p&&h.setAttribute(u,p)}var m=o.absolutePoints;if(null!=m&&0<m.length){var c=Math.round(m[0].x)+","+Math.round(m[0].y);for(u=1;u<m.length;u++)c+=" "+Math.round(m[u].x)+","+Math.round(m[u].y);h.setAttribute("points",c)}else h.setAttribute("x",Math.round(o.x)),h.setAttribute("y",Math.round(o.y)),h.setAttribute("width",Math.round(o.width)),h.setAttribute("height",Math.round(o.height));var g=o.absoluteOffset;null!=g&&(0!=g.x&&h.setAttribute("dx",Math.round(g.x)),0!=g.y&&h.setAttribute("dy",Math.round(g.y)))}for(u=0;u<l;u++){var x=this.encodeCell(t,e,i.getChildAt(n,u));null!=x&&h.appendChild(x)}}}return h},t}());var mxStylesheetCodec=mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxStylesheet);return t.encode=function(t,e){var n=t.document.createElement(this.getName());for(var i in e.styles){var o=e.styles[i],s=t.document.createElement("add");if(null!=i){for(var l in s.setAttribute("as",i),o){var r=this.getStringValue(l,o[l]);if(null!=r){var a=t.document.createElement("add");a.setAttribute("value",r),a.setAttribute("as",l),s.appendChild(a)}}0<s.childNodes.length&&n.appendChild(s)}}return n},t.getStringValue=function(t,e){var n=typeof e;return"function"==n?e=mxStyleRegistry.getName(style[j]):"object"==n&&(e=null),e},t.decode=function(t,e,n){var i=n||new this.template.constructor,o=e.getAttribute("id");for(null!=o&&(t.objects[o]=i),e=e.firstChild;null!=e;){if(!this.processInclude(t,e,i)&&"add"==e.nodeName){var s=e.getAttribute("as");if(null!=s){var l=e.getAttribute("extend"),r=null!=l?mxUtils.clone(i.styles[l]):null;null==r&&(null!=l&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+l+" not found to extend"),r=new Object);for(var a=e.firstChild;null!=a;){if(a.nodeType==mxConstants.NODETYPE_ELEMENT){var h=a.getAttribute("as");if("add"==a.nodeName){var d=mxUtils.getTextContent(a),u=null;null!=d&&0<d.length&&mxStylesheetCodec.allowEval?u=mxUtils.eval(d):(u=a.getAttribute("value"),mxUtils.isNumeric(u)&&(u=parseFloat(u))),null!=u&&(r[h]=u)}else"remove"==a.nodeName&&delete r[h]}a=a.nextSibling}i.putCellStyle(s,r)}}e=e.nextSibling}return i},t}());mxStylesheetCodec.allowEval=!0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultKeyHandler);return t.encode=function(t,e){return null},t.decode=function(t,e,n){if(null!=n){n.editor;for(e=e.firstChild;null!=e;){if(!this.processInclude(t,e,n)&&"add"==e.nodeName){var i=e.getAttribute("as"),o=e.getAttribute("action"),s=e.getAttribute("control");n.bindAction(i,o,s)}e=e.nextSibling}}return n},t}());var mxDefaultToolbarCodec=mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultToolbar);return t.encode=function(t,e){return null},t.decode=function(t,e,n){if(null!=n){var i=n.editor;for(e=e.firstChild;null!=e;){if(e.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(t,e,n))if("separator"==e.nodeName)n.addSeparator();else if("br"==e.nodeName)n.toolbar.addBreak();else if("hr"==e.nodeName)n.toolbar.addLine();else if("add"==e.nodeName){var o=e.getAttribute("as");o=mxResources.get(o)||o;var s=e.getAttribute("icon"),l=e.getAttribute("pressedIcon"),r=e.getAttribute("action"),a=e.getAttribute("mode"),h=e.getAttribute("template"),d="0"!=e.getAttribute("toggle"),u=mxUtils.getTextContent(e),p=null;if(null!=r)p=n.addItem(o,s,r,l);else if(null!=a){var m=mxDefaultToolbarCodec.allowEval?mxUtils.eval(u):null;p=n.addMode(o,s,a,l,m)}else if(null!=h||null!=u&&0<u.length){var c=i.templates[h],g=e.getAttribute("style");null!=c&&null!=g&&(c=i.graph.cloneCells([c])[0]).setStyle(g);var x=null;null!=u&&0<u.length&&mxDefaultToolbarCodec.allowEval&&(x=mxUtils.eval(u)),p=n.addPrototype(o,s,c,l,x,d)}else{var y=mxUtils.getChildNodes(e);if(0<y.length)if(null==s)for(var f=n.addActionCombo(o),v=0;v<y.length;v++){if("separator"==(b=y[v]).nodeName)n.addOption(f,"---");else if("add"==b.nodeName){var C=b.getAttribute("as"),E=b.getAttribute("action");n.addActionOption(f,C,E)}}else{var w=null,S=n.addPrototype(o,s,function(){var t=i.templates[w.value];if(null==t)return mxLog.warn("Template "+t+" not found"),null;var e=t.clone(),n=w.options[w.selectedIndex].cellStyle;return null!=n&&e.setStyle(n),e},null,null,d);w=n.addCombo(),mxEvent.addListener(w,"change",function(){n.toolbar.selectMode(S,function(t){var e=mxUtils.convertPoint(i.graph.container,mxEvent.getClientX(t),mxEvent.getClientY(t));return i.addVertex(null,m(),e.x,e.y)}),n.toolbar.noReset=!1});for(v=0;v<y.length;v++){var b;if("separator"==(b=y[v]).nodeName)n.addOption(w,"---");else if("add"==b.nodeName){C=b.getAttribute("as");var T=b.getAttribute("template");n.addOption(w,C,T||h).cellStyle=b.getAttribute("style")}}}}if(null!=p){var A=e.getAttribute("id");null!=A&&0<A.length&&p.setAttribute("id",A)}}e=e.nextSibling}}return n},t}());function ChangePageSetup(t,e,n,i){this.ui=t,this.color=e,this.previousColor=e,this.image=n,this.previousImage=n,this.format=i,this.previousFormat=i,this.ignoreColor=!1,this.ignoreImage=!1}function getXmlAndDatas(t,e){if(e){var n=window.ReactDOM||window.parent.ReactDOM||null,i=window.React||window.parent.React||null,o=window.antd||window.parent.antd||null;n&&i&&o&&!mxClient.IS_IE&&n.render(i.createElement(o.Spin,{spinning:!0}),document.getElementById("Spin-container"))}var s,l=[];for(var r in window.urlParams)l.push(r+"="+window.urlParams[r]);s=l.join("&"),e||(wfMessage&&wfMessage.destroy(),wfMessage&&wfMessage.loading(wfGetLabel(129500," 正在获取数据,请稍候..."),0)),t.editor.graph.workflowDetailDatas={},wfPostGetWfInfo(s,t,e)}function wf_flowDesign_getWfInfoCB(t,e,n,i){if(t.hasOwnProperty("userRight")&&0==t.userRight){if(i){var o=document.getElementById("Spin-container");o&&o.parentNode.removeChild(o)}wfMessage&&wfMessage.destroy(),wfModal.confirm({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(382445,"用户无效,请登录后再试!"),okText:wfGetLabel(83446,"确定"),cancelText:wfGetLabel(31129,"取消"),onOk:function(){window.location.href="/wui/index.html"},onCancel:function(){}})}else{for(var s in workflowUiIsLoaded=!0,t)n.editor.graph.workflowDetailDatas[s]=t[s],"labelMap"==s?mxClient.labelMap=t[s]:"workflowDatas"==s&&(mxClient.workflowDatas=t[s]);document.title=t.workflowDatas.workflowName||location.href,wfPostGetXml(e,n,i,t)}}function wf_flowDesign_getWfXMLCB(t,e,n,i,o){if(i){var s=document.getElementById("Spin-container");s&&s.parentNode.removeChild(s)}wfMessage&&wfMessage.destroy();var l=t;if(1==l.userRight){mxClient.IS_E9_SAVED=l.isE9Save;var r=mxUtils.parseXml(l.xml);workflowUi&&workflowUi.wfEditor&&workflowUi.wfEditor.createSaveMask(!1),n.editor.graph.model.clear(),n.editor.graph.workflowDetailDatas.form_nodesInfo=l.nodeInfo;for(var a=n.editor.graph.importGraphModel(r.documentElement),h={nodeIds:[],linkIds:[]},d=[],u=[],p={curNextNode:[]},m=0,c=0,g=!1,x=0;x<a.length;++x)a[x]&&a[x].nodeId?("1"==a[x].isCurrentNode&&(p=Object.assign(p,{x:a[x].geometry.x,y:a[x].geometry.y,width:a[x].geometry.width,height:a[x].geometry.height,currentNode:a[x]})),h.nodeIds.push(a[x].nodeId),u.push(a[x]),m=m>a[x].geometry.y+a[x].geometry.height?m:a[x].geometry.y+a[x].geometry.height,c=c>a[x].geometry.x+a[x].geometry.width?c:a[x].geometry.x+a[x].geometry.width):a[x]&&a[x].linkId&&(h.linkIds.push(a[x].linkId),"1"==a[x].source.isCurrentNode&&p.curNextNode.push(a[x].target)),a[x]&&a[x].isGroupArea&&d.push(a[x]);if(mxClient.IS_READONLY_PAGE&&(mxClient.IS_FREE_WORKFLOW||mxClient.IS_FREE_FREEFLOW_NODE||mxClient.FREE_WORKFLOW_HAS_FREENODE)&&mxClient.OPEN_FREE_WORKFLOW){if(g=!0,p.allNodesInfo=u,!p.currentNode)for(x=0;x<u.length;++x)0!=u[x].nodeType?3!=u[x].nodeType||p.curNextNode.push(u[x]):p.currentNode=u[x];var y=(new Date).getTime();loadjs(["/cloudstore/resource/pc/mobx-3.1.16/mobx.umd.js","/cloudstore/resource/pc/mobx-react-4.2.1/index.js","/cloudstore/resource/pc/react-router/ReactRouter.min.js","/spa/coms/index.mobx.js","/spa/workflow/static4public/index.js","/spa/workflow/static4public/index.css"],{success:function(){var t=(new Date).getTime();mxClient.IS_IE||null==window.console||console.log("loaded js",(t-y)/1e3),this.wfNewDesignRenderFreeWfSvg(p,m,c,n)},async:!1})}0<u.length&&n.editor.graph.orderCells(!0,u),0<d.length&&n.editor.graph.orderCells(!0,d),n.wfEditor.wfPanelNowCellsNum=h.nodeIds?h.nodeIds.length:0,n.wfEditor.wfPanelNowLinksNum=h.linkIds?h.linkIds.length:0,h.groupDetail=o.groupDetail,n.editor.graph.existParams=h,n.editor.undoManager.clear(),mxClient.cellMaxHeight=m+50,mxClient.cellMaxWidth=c+50,n.wfGroups.init(o.groupDetail);var f=o.groupDetail,v=0;if(0<f.col.length){var C=f.col[f.col.length-1];v=C.position.left+C.panelWidth}mxClient.cellMaxWidth=mxClient.cellMaxWidth>v?mxClient.cellMaxWidth:v,initialData(n,mxClient.cellMaxWidth,m,n.editor.graph,g)}else renderUserNoRight()}function wfPostGetWfInfo(n,i,o){mxClient.IS_TOUCH&&window.sso_callApi?window.sso_callApi({url:WORKFLOW_GETDETAILINFO_PATH,method:"POST",params:window.urlParams}).then(function(t){wf_flowDesign_getWfInfoCB(t,n,i,o)}):mxUtils.post(WORKFLOW_GETDETAILINFO_PATH,n,function(t){var e=t.request.responseText;wf_flowDesign_getWfInfoCB(JSON.parse(e),n,i,o)})}function wfPostGetXml(n,i,o,s){mxClient.IS_TOUCH&&window.sso_callApi?window.sso_callApi({url:WORKFLOW_GETWFINFO_PATH,method:"POST",params:window.urlParams}).then(function(t){wf_flowDesign_getWfXMLCB(t,n,i,o,s)}):mxUtils.post(WORKFLOW_GETWFINFO_PATH,n,function(t){var e=t.request.responseText;wf_flowDesign_getWfXMLCB(JSON.parse(e),n,i,o,s)})}function wfNewDesignRenderFreeWfSvg(t,e,n,i){var o=document.createElement("div");o.id="workflowDesign-free-svg-container",i.diagramContainer.appendChild(o),o.style.top=e+20+"px",o.style.minWidth=n+100+"px",o.style.height="calc(100% - "+(e+20)+"px)";var s=wfFree_getUrlParam("nodeid"),l=wfFree_getUrlParam("isMobile")||"0",r=wfFree_getUrlParam("isReadOnlyModel")||"false";"false"==r&&jQuery("#workflow-test-mask").css({bottom:"60px",right:"400px",height:e+20+"px"});var a=window.weaWorkflowPublic?window.weaWorkflowPublic.FreeFlowDesignContainer:null,h=window.weaWorkflowPublic?window.weaWorkflowPublic.FreeFlowDesignSvg:null,d=window.weaWorkflowPublic?window.weaWorkflowPublic.WorkflowNewDesignStore:null,u=window.ecCom?window.ecCom.WeaPopoverHrm:null;t.x=t.currentNode.geometry.x,t.y=t.currentNode.geometry.y,t.width=t.currentNode.geometry.width,t.height=t.currentNode.geometry.height;var p={createNodeInfo:t,cellMaxHeight:e+20,cellMaxWidth:n+100,isSingle:!0,requestid:mxClient.WORKFLOW_REQUEST_ID,workflowid:mxClient.FREE_WORKFLOW_ID,isFree:mxClient.IS_FREE_WORKFLOW?"1":"0",isAllowNodeFreeFlow:mxClient.IS_FREE_FREEFLOW_NODE?"1":"0",isReadOnlyModel:r,nodeid:s,isMobile:l,f_weaver_belongto_userid:wfFree_getUrlParam("f_weaver_belongto_userid"),f_weaver_belongto_usertype:wfFree_getUrlParam("f_weaver_belongto_usertype"),authSignatureStr:wfFree_getUrlParam("authSignatureStr"),authStr:wfFree_getUrlParam("authStr"),wfTestStr:wfFree_getUrlParam("wfTestStr"),belongTest:wfFree_getUrlParam("belongTest"),showForecastNode:window.urlParams.showForecastNode};mxClient&&mxClient.IS_FROMAUTO_DIRECT&&(p.wf_chart_ready_windowClose=wf_windowClose),u&&"0"==l&&ReactDOM.render(React.createElement(u),document.getElementById("workflowDesign-HrmContainer"));var m=d?new d:null,c=Object.assign(p,{isOutterFrame:!0,workflowNewDesignStore:m,isFromHtmlPage:!0});a&&ReactDOM.render(React.createElement(a,c),document.getElementById("workflowDesign-free-container")),h&&ReactDOM.render(React.createElement(h,c),document.getElementById("workflowDesign-free-svg-container"))}function wfFree_getUrlParam(t){var e=new RegExp("(^|&)"+t+"=([^&]*)(&|$)"),n=window.location.search.substr(1).match(e);return null!=n?unescape(n[2]):null}function wfDesignContainerResize(t,e){var n=t.editor.graph,i=(n.view,t.wfNodeInfo.nodePanelHide),o=n.isRuleEnabled(),s=t.wfEditor?t.wfEditor.container.clientHeight:0,l=wfFree_getUrlParam("isReadOnlyModel")||"false",r=wfFree_getUrlParam("isMobile")||"0";mxClient.IS_READONLY_PAGE&&(mxClient.IS_FREE_WORKFLOW||mxClient.IS_FREE_FREEFLOW_NODE)&&"false"==l&&"0"==r?(t.wfPanelContainer.style.bottom="60px",t.wfPanelContainer.style.right="400px"):t.wfPanelContainer.style.top=s+"px",n.pageFormat.width=i?t.isFromWfForm?window.innerWidth-20:o?window.innerWidth-22:window.innerWidth-18:t.isFromWfForm?window.innerWidth-20:o?window.innerWidth-(e?270:258):window.innerWidth-258,n.pageFormat.height=t.isFromWfForm?window.innerHeight-22:o?window.innerHeight-s-(e?32:22):window.innerHeight-s-20,n.refresh()}function renderUserNoRight(){document.body.innerHTML="";var t=document.createElement("div"),e=document.createElement("div"),n=document.createElement("div"),i=document.createElement("i");i.className="icon-coms-locking",i.style.color="rgb(203, 203, 203)",i.style.fontSize="120px",e.appendChild(i),n.innerHTML=wfGetLabel?wfGetLabel(2012," 对不起,您暂时没有权限! "):"对不起,您暂时没有权限!",n.style.fontSize="14px",n.style.padding="10px",t.appendChild(e),t.appendChild(n),t.style.width="300px",t.style.margin="0 auto",t.style.textAlign="center",t.style.paddingTop="15%",document.body.appendChild(t)}mxDefaultToolbarCodec.allowEval=!0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultPopupMenu);return t.encode=function(t,e){return null},t.decode=function(t,e,n){var i=e.getElementsByTagName("include")[0];return null!=i?this.processInclude(t,i,n):null!=n&&(n.config=e),n},t}()),mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxEditor,["modified","lastSnapshot","ignoredChanges","undoManager","graphContainer","toolbarContainer"]);return t.afterDecode=function(t,e,n){var i=e.getAttribute("defaultEdge");null!=i&&(e.removeAttribute("defaultEdge"),n.defaultEdge=n.templates[i]);var o=e.getAttribute("defaultGroup");return null!=o&&(e.removeAttribute("defaultGroup"),n.defaultGroup=n.templates[o]),n},t.decodeChild=function(t,e,n){if("Array"==e.nodeName){if("templates"==e.getAttribute("as"))return void this.decodeTemplates(t,e,n)}else if("ui"==e.nodeName)return void this.decodeUi(t,e,n);mxObjectCodec.prototype.decodeChild.apply(this,arguments)},t.decodeUi=function(t,e,n){for(var i=e.firstChild;null!=i;){if("add"==i.nodeName){var o=i.getAttribute("as"),s=i.getAttribute("element"),l=i.getAttribute("style"),r=null;if(null!=s)null!=(r=document.getElementById(s))&&null!=l&&(r.style.cssText+=";"+l);else{var a=parseInt(i.getAttribute("x")),h=parseInt(i.getAttribute("y")),d=i.getAttribute("width"),u=i.getAttribute("height");(r=document.createElement("div")).style.cssText=l,new mxWindow(mxResources.get(o)||o,r,a,h,d,u,!1,!0).setVisible(!0)}"graph"==o?n.setGraphContainer(r):"toolbar"==o?n.setToolbarContainer(r):"title"==o?n.setTitleContainer(r):"status"==o?n.setStatusContainer(r):"map"==o&&n.setMapContainer(r)}else"resource"==i.nodeName?mxResources.add(i.getAttribute("basename")):"stylesheet"==i.nodeName&&mxClient.link("stylesheet",i.getAttribute("name"));i=i.nextSibling}},t.decodeTemplates=function(t,e,n){null==n.templates&&(n.templates=[]);for(var i=mxUtils.getChildNodes(e),o=0;o<i.length;o++){for(var s=i[o].getAttribute("as"),l=i[o].firstChild;null!=l&&1!=l.nodeType;)l=l.nextSibling;null!=l&&(n.templates[s]=t.decodeCell(l))}},t}()),EditorUi=function(t,e,n){this.isFromWfForm=!1,this.currentIsHorizon=!1,this.beforeTransformStyles={},this.cusPreInitScale="1",window.urlParams&&window.urlParams.isFromWfForm&&"true"==window.urlParams.isFromWfForm&&(this.isFromWfForm=!0),window.urlParams&&window.urlParams.backstageReadOnly&&"true"==window.urlParams.backstageReadOnly&&(this.isFromWfForm=!0),mxEventSource.call(this),this.destroyFunctions=[],this.editor=t||new Editor,this.container=e||document.body;var S=this.editor.graph;S.lightbox=n,S.useCssTransforms=this.editor.isChromelessView()&&S.isCssTransformsSupported(),S.useCssTransforms&&(this.lazyZoomDelay=0),mxClient.IS_SVG?mxPopupMenu.prototype.submenuImage="data:image/gif;base64,R0lGODlhCQAJAIAAAP///zMzMyH5BAEAAAAALAAAAAAJAAkAAAIPhI8WebHsHopSOVgb26AAADs=":(new Image).src=mxPopupMenu.prototype.submenuImage,mxClient.IS_SVG||null==mxConnectionHandler.prototype.connectImage||((new Image).src=mxConnectionHandler.prototype.connectImage.src),this.editor.chromeless&&!this.editor.editable&&(this.footerHeight=0,S.isEnabled=function(){return!1},S.panningHandler.isForcePanningEvent=function(t){return!mxEvent.isPopupTrigger(t.getEvent())}),this.actions=new Actions(this),this.menus=this.createMenus(),this.createDivs(),this.createUi(),this.refresh();var i=mxUtils.bind(this,function(t){return null==t&&(t=window.event),this.isSelectionAllowed(t)||S.isEditing()||t&&"INPUT"==t.target.tagName||t&&"TEXTAREA"==t.target.tagName});if(this.container==document.body&&(this.menubarContainer.onselectstart=i,this.menubarContainer.onmousedown=i,this.toolbarContainer.onselectstart=i,this.toolbarContainer.onmousedown=i,this.diagramContainer.onselectstart=i,this.diagramContainer.onmousedown=i,this.sidebarContainer.onselectstart=i,this.sidebarContainer.onmousedown=i,this.formatContainer.onselectstart=i,this.formatContainer.onmousedown=i,this.footerContainer.onselectstart=i,this.footerContainer.onmousedown=i,null!=this.tabContainer&&(this.tabContainer.onselectstart=i)),!this.editor.chromeless||this.editor.editable){function o(t){var e=mxEvent.getSource(t);if("A"==e.nodeName)for(;null!=e;){if("geHint"==e.className)return!0;e=e.parentNode}return i(t)}mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?mxEvent.addListener(this.diagramContainer,"contextmenu",o):this.diagramContainer.oncontextmenu=o}else S.panningHandler.usePopupTrigger=!1;if(S.init(this.diagramContainer),mxClient.IS_SVG&&null!=S.view.getDrawPane()){var s=S.view.getDrawPane().ownerSVGElement;null!=s&&(s.style.position="absolute")}this.hoverIcons=this.createHoverIcons(),mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(t){var e=mxUtils.getOffset(this.diagramContainer);0<mxEvent.getClientX(t)-e.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(t)-e.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var l=!1,r=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(t,e){return l||r.apply(this,arguments)},this.keydownHandler=mxUtils.bind(this,function(t){32==t.which?(l=!0,this.hoverIcons.reset(),S.container.style.cursor="move",S.isEditing()||mxEvent.getSource(t)!=S.container||mxEvent.consume(t)):mxEvent.isConsumed(t)||27!=t.keyCode||this.hideDialog()}),mxEvent.addListener(document,"keydown",this.keydownHandler),this.keyupHandler=mxUtils.bind(this,function(t){S.container.style.cursor="",l=!1}),mxEvent.addListener(document,"keyup",this.keyupHandler);var a=S.panningHandler.isForcePanningEvent;S.panningHandler.isForcePanningEvent=function(t){return a.apply(this,arguments)||l||mxEvent.isMouseEvent(t.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(t.getEvent()))&&(!mxEvent.isControlDown(t.getEvent())&&mxEvent.isRightMouseButton(t.getEvent())||mxEvent.isMiddleMouseButton(t.getEvent()))};var h=S.cellEditor.isStopEditingEvent,d=!(S.cellEditor.isStopEditingEvent=function(t){return h.apply(this,arguments)||13==t.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(t)||mxClient.IS_MAC&&mxEvent.isMetaDown(t)||mxClient.IS_SF&&mxEvent.isShiftDown(t))}),u=null,p=null,m=null,c=mxUtils.bind(this,function(){if(null!=this.toolbar&&d!=S.cellEditor.isContentEditing()){for(var t=this.toolbar.container.firstChild,e=[];null!=t;){var n=t.nextSibling;mxUtils.indexOf(this.toolbar.staticElements,t)<0&&(t.parentNode.removeChild(t),e.push(t)),t=n}var i=this.toolbar.fontMenu,o=this.toolbar.sizeMenu;if(null==m)this.toolbar.createTextToolbar();else{for(var s=0;s<m.length;s++)this.toolbar.container.appendChild(m[s]);this.toolbar.fontMenu=u,this.toolbar.sizeMenu=p}d=S.cellEditor.isContentEditing(),u=i,p=o,m=e}}),g=this,x=S.cellEditor.startEditing;S.cellEditor.startEditing=function(){if(x.apply(this,arguments),c(),S.cellEditor.isContentEditing()){function t(){i||(i=!0,window.setTimeout(function(){for(var t=S.getSelectedElement();null!=t&&t.nodeType!=mxConstants.NODETYPE_ELEMENT;)t=t.parentNode;if(null!=t){var e=mxUtils.getCurrentStyle(t);if(null!=e&&null!=g.toolbar){var n=e.fontFamily;"'"==n.charAt(0)&&(n=n.substring(1)),"'"==n.charAt(n.length-1)&&(n=n.substring(0,n.length-1)),g.toolbar.setFontName(n),g.toolbar.setFontSize(parseInt(e.fontSize))}}i=!1},0))}var i=!1;mxEvent.addListener(S.cellEditor.textarea,"input",t),mxEvent.addListener(S.cellEditor.textarea,"touchend",t),mxEvent.addListener(S.cellEditor.textarea,"mouseup",t),mxEvent.addListener(S.cellEditor.textarea,"keyup",t),t()}};var y=S.cellEditor.stopEditing;if(S.cellEditor.stopEditing=function(t,e){y.apply(this,arguments),c()},S.container.setAttribute("tabindex","0"),S.container.style.cursor="default",window.self===window.top&&null!=S.container.parentNode)try{S.container.focus()}catch(t){}var f=S.fireMouseEvent;S.fireMouseEvent=function(t,e,n){mxEvent.MOUSE_DOWN,f.apply(this,arguments)},S.popupMenuHandler.autoExpand=!0,null!=this.menus&&(S.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(t,e,n){})),mxEvent.addGestureListeners(document,mxUtils.bind(this,function(t){S.popupMenuHandler.hideMenu()})),this.keyHandler=this.createKeyHandler(t),this.getKeyHandler=function(){return keyHandler};var b=["rounded","shadow","glass","dashed","dashPattern","comic","labelBackgroundColor"],T=["shape","edgeStyle","curved","rounded","elbow","comic","jumpStyle","jumpSize"];this.setDefaultStyle=function(t){var e=S.view.getState(t);if(null!=e){var n=t.clone();n.style="";var i=S.getCellStyle(n),o=[],s=[];for(var l in e.style)i[l]!=e.style[l]&&(o.push(e.style[l]),s.push(l));for(var r=S.getModel().getStyle(e.cell),a=null!=r?r.split(";"):[],h=0;h<a.length;h++){var d=a[h],u=d.indexOf("=");if(0<=u){l=d.substring(0,u);var p=d.substring(u+1);null!=i[l]&&"none"==p&&(o.push(p),s.push(l))}}S.getModel().isEdge(e.cell)?S.currentEdgeStyle={}:S.currentVertexStyle={},this.fireEvent(new mxEventObject("styleChanged","keys",s,"values",o,"cells",[e.cell]))}},this.clearDefaultStyle=function(){S.currentEdgeStyle=mxUtils.clone(S.defaultEdgeStyle),S.currentVertexStyle=mxUtils.clone(S.defaultVertexStyle),this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};for(var v=["fontFamily","fontSize","fontColor"],C=["edgeStyle","startArrow","startFill","startSize","endArrow","endFill","endSize","jettySize","orthogonalLoop"],A=[["startArrow","startFill","startSize","endArrow","endFill","endSize","jettySize","orthogonalLoop"],["strokeColor","strokeWidth"],["fillColor","gradientColor"],v,["opacity"],["align"],["html"]],E=0;E<A.length;E++)for(var w=0;w<A[E].length;w++)b.push(A[E][w]);for(E=0;E<T.length;E++)mxUtils.indexOf(b,T[E])<0&&b.push(T[E]);function L(t,e){var n=S.getModel();n.beginUpdate();try{if(e)for(var i=(C=n.isEdge(a))?S.currentEdgeStyle:S.currentVertexStyle,o=["fontSize","fontFamily","fontColor"],s=0;s<o.length;s++){var l=i[o[s]];null!=l&&S.setCellStyles(o[s],l,t)}else for(var r=0;r<t.length;r++){var a=t[r],h=n.getStyle(a),d=null!=h?h.split(";"):[],u=b.slice();for(s=0;s<d.length;s++){var p=d[s],m=p.indexOf("=");if(0<=m){var c=p.substring(0,m),g=mxUtils.indexOf(u,c);0<=g&&u.splice(g,1);for(var x=0;x<A.length;x++){var y=A[x];if(0<=mxUtils.indexOf(y,c))for(var f=0;f<y.length;f++){var v=mxUtils.indexOf(u,y[f]);0<=v&&u.splice(v,1)}}}}i=(C=n.isEdge(a))?S.currentEdgeStyle:S.currentVertexStyle;var C,E=n.getStyle(a);for(s=0;s<u.length;s++){var w=i[c=u[s]];null==w||"shape"==c&&!C||(!C||mxUtils.indexOf(T,c)<0)&&(E=mxUtils.setStyle(E,c,w))}n.setStyle(a,E)}}finally{n.endUpdate()}}if(S.addListener("cellsInserted",function(t,e){L(e.getProperty("cells"))}),S.addListener("textInserted",function(t,e){L(e.getProperty("cells"),!0)}),S.connectionHandler.addListener(mxEvent.CONNECT,function(t,e){var n=[e.getProperty("cell")];e.getProperty("terminalInserted")&&n.push(e.getProperty("terminal")),L(n)}),this.addListener("styleChanged",mxUtils.bind(this,function(t,e){var n=e.getProperty("cells"),i=!1,o=!1;if(0<n.length)for(var s=0;s<n.length&&(i=S.getModel().isVertex(n[s])||i,!(o=S.getModel().isEdge(n[s])||o)||!i);s++);else o=i=!0;var l=e.getProperty("keys"),r=e.getProperty("values");for(s=0;s<l.length;s++){var a=0<=mxUtils.indexOf(v,l[s]);("strokeColor"!=l[s]||null!=r[s]&&"none"!=r[s])&&(0<=mxUtils.indexOf(T,l[s])?o||0<=mxUtils.indexOf(C,l[s])?null==r[s]?delete S.currentEdgeStyle[l[s]]:S.currentEdgeStyle[l[s]]=r[s]:i&&0<=mxUtils.indexOf(b,l[s])&&(null==r[s]?delete S.currentVertexStyle[l[s]]:S.currentVertexStyle[l[s]]=r[s]):0<=mxUtils.indexOf(b,l[s])&&((i||a)&&(null==r[s]?delete S.currentVertexStyle[l[s]]:S.currentVertexStyle[l[s]]=r[s]),(o||a||0<=mxUtils.indexOf(C,l[s]))&&(null==r[s]?delete S.currentEdgeStyle[l[s]]:S.currentEdgeStyle[l[s]]=r[s])))}if(null!=this.toolbar){if(this.toolbar.setFontName(S.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(S.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu){var h=this.toolbar.edgeStyleMenu.getElementsByTagName("div")[0];"orthogonalEdgeStyle"==S.currentEdgeStyle.edgeStyle&&"1"==S.currentEdgeStyle.curved?h.className="geSprite geSprite-curved":"straight"==S.currentEdgeStyle.edgeStyle||"none"==S.currentEdgeStyle.edgeStyle||null==S.currentEdgeStyle.edgeStyle?h.className="geSprite geSprite-straight":"entityRelationEdgeStyle"==S.currentEdgeStyle.edgeStyle?h.className="geSprite geSprite-entity":"elbowEdgeStyle"==S.currentEdgeStyle.edgeStyle?h.className="geSprite geSprite-"+("vertical"==S.currentEdgeStyle.elbow?"verticalelbow":"horizontalelbow"):"isometricEdgeStyle"==S.currentEdgeStyle.edgeStyle?h.className="geSprite geSprite-"+("vertical"==S.currentEdgeStyle.elbow?"verticalisometric":"horizontalisometric"):h.className="geSprite geSprite-orthogonal"}if(null!=this.toolbar.edgeShapeMenu){var d=this.toolbar.edgeShapeMenu.getElementsByTagName("div")[0];"link"==S.currentEdgeStyle.shape?d.className="geSprite geSprite-linkedge":"flexArrow"==S.currentEdgeStyle.shape?d.className="geSprite geSprite-arrow":"arrow"==S.currentEdgeStyle.shape?d.className="geSprite geSprite-simplearrow":d.className="geSprite geSprite-connection"}if(null!=this.toolbar.lineStartMenu)this.toolbar.lineStartMenu.getElementsByTagName("div")[0].className=this.getCssClassForMarker("start",S.currentEdgeStyle.shape,S.currentEdgeStyle[mxConstants.STYLE_STARTARROW],mxUtils.getValue(S.currentEdgeStyle,"startFill","1"));if(null!=this.toolbar.lineEndMenu)this.toolbar.lineEndMenu.getElementsByTagName("div")[0].className=this.getCssClassForMarker("end",S.currentEdgeStyle.shape,S.currentEdgeStyle[mxConstants.STYLE_ENDARROW],mxUtils.getValue(S.currentEdgeStyle,"endFill","1"))}})),null!=this.toolbar){var I=mxUtils.bind(this,function(){var t=S.currentVertexStyle.fontFamily||"Helvetica",e=String(S.currentVertexStyle.fontSize||"12"),n=S.getView().getState(S.getSelectionCell());null!=n&&(t=n.style[mxConstants.STYLE_FONTFAMILY]||t,e=n.style[mxConstants.STYLE_FONTSIZE]||e,10<t.length&&(t=t.substring(0,8)+"...")),this.toolbar.setFontName(t),this.toolbar.setFontSize(e)});S.getSelectionModel().addListener(mxEvent.CHANGE,I),S.getModel().addListener(mxEvent.CHANGE,I)}S.addListener(mxEvent.CELLS_ADDED,function(t,e){var n=e.getProperty("cells"),i=e.getProperty("parent");S.getModel().isLayer(i)&&!S.isCellVisible(i)&&null!=n&&0<n.length&&S.getModel().setVisible(i,!0)}),this.gestureHandler=mxUtils.bind(this,function(t){null!=this.currentMenu&&mxEvent.getSource(t)!=this.currentMenu.div&&this.hideCurrentMenu()}),mxEvent.addGestureListeners(document,this.gestureHandler),this.resizeHandler=mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.refresh()}),0)}),mxEvent.addListener(window,"resize",this.resizeHandler),this.orientationChangeHandler=mxUtils.bind(this,function(){this.refresh()}),mxEvent.addListener(window,"orientationchange",this.orientationChangeHandler),mxClient.IS_IOS&&!window.navigator.standalone&&(this.scrollHandler=mxUtils.bind(this,function(){window.scrollTo(0,0)}),mxEvent.addListener(window,"scroll",this.scrollHandler)),this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.resetScrollbars()})),this.addListener("gridEnabledChanged",mxUtils.bind(this,function(){S.view.validateBackground()})),this.addListener("ruleEnabledChanged",mxUtils.bind(this,function(){S.view.validateBackground()})),this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){S.view.validateBackground()})),S.addListener("gridSizeChanged",mxUtils.bind(this,function(){S.isGridEnabled()&&S.view.validateBackground()})),this.editor.resetGraph(),this.init(),this.open()},mxUtils.extend(EditorUi,mxEventSource),EditorUi.compactUi=!0,EditorUi.prototype.splitSize=mxClient.IS_TOUCH||mxClient.IS_POINTER?12:8,EditorUi.prototype.menubarHeight=30,EditorUi.prototype.formatEnabled=!0,EditorUi.prototype.formatWidth=240,EditorUi.prototype.toolbarHeight=34,EditorUi.prototype.footerHeight=28,EditorUi.prototype.sidebarFooterHeight=34,EditorUi.prototype.hsplitPosition=screen.width<=640?118:208,EditorUi.prototype.allowAnimation=!0,EditorUi.prototype.lightboxMaxFitScale=2,EditorUi.prototype.lightboxVerticalDivider=4,EditorUi.prototype.hsplitClickEnabled=!1,EditorUi.prototype.init=function(){var t=this.editor.graph;mxEvent.addListener(t.container,"keydown",mxUtils.bind(this,function(t){"group-item-input"==t.target.className&&t.stopPropagation(),this.onKeyDown(t)})),mxEvent.addListener(t.container,"keypress",mxUtils.bind(this,function(t){-1<t.target.className.indexOf("ant-input")||this.onKeyPress(t)})),this.addUndoListener(),mxClient.IS_READONLY_PAGE||this.addBeforeUnloadListener(),t.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()})),t.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));var e=t.setDefaultParent,n=this;this.editor.graph.setDefaultParent=function(){e.apply(this,arguments),n.updateActionStates()},t.editLink=n.actions.get("editLink").funct,this.updateActionStates(),this.initClipboard(),this.initCanvas(),null!=this.format&&this.format.init()},EditorUi.prototype.onKeyDown=function(t){var e=this.editor.graph;9==t.which&&e.isEnabled()&&!mxEvent.isAltDown(t)&&(e.isEditing()?e.stopEditing(!1):e.selectCell(!mxEvent.isShiftDown(t)),mxEvent.consume(t))},EditorUi.prototype.onKeyPress=function(t){var e=this.editor.graph;if(this.isImmediateEditingEvent(t)&&!e.isEditing()&&!e.isSelectionEmpty()&&0!==t.which&&!mxEvent.isAltDown(t)&&!mxEvent.isControlDown(t)&&!mxEvent.isMetaDown(t)&&(e.escape(),e.startEditing(),mxClient.IS_FF)){var n=e.cellEditor;n.textarea.innerHTML=String.fromCharCode(t.which);var i=document.createRange();i.selectNodeContents(n.textarea),i.collapse(!1);var o=window.getSelection();o.removeAllRanges(),o.addRange(i)}},EditorUi.prototype.isImmediateEditingEvent=function(t){return!0},EditorUi.prototype.getCssClassForMarker=function(t,e,n,i){return"flexArrow"==e?null!=n&&n!=mxConstants.NONE?"geSprite geSprite-"+t+"blocktrans":"geSprite geSprite-noarrow":n==mxConstants.ARROW_CLASSIC?"1"==i?"geSprite geSprite-"+t+"classic":"geSprite geSprite-"+t+"classictrans":n==mxConstants.ARROW_CLASSIC_THIN?"1"==i?"geSprite geSprite-"+t+"classicthin":"geSprite geSprite-"+t+"classicthintrans":n==mxConstants.ARROW_OPEN?"geSprite geSprite-"+t+"open":n==mxConstants.ARROW_OPEN_THIN?"geSprite geSprite-"+t+"openthin":n==mxConstants.ARROW_BLOCK?"1"==i?"geSprite geSprite-"+t+"block":"geSprite geSprite-"+t+"blocktrans":n==mxConstants.ARROW_BLOCK_THIN?"1"==i?"geSprite geSprite-"+t+"blockthin":"geSprite geSprite-"+t+"blockthintrans":n==mxConstants.ARROW_OVAL?"1"==i?"geSprite geSprite-"+t+"oval":"geSprite geSprite-"+t+"ovaltrans":n==mxConstants.ARROW_DIAMOND?"1"==i?"geSprite geSprite-"+t+"diamond":"geSprite geSprite-"+t+"diamondtrans":n==mxConstants.ARROW_DIAMOND_THIN?"1"==i?"geSprite geSprite-"+t+"thindiamond":"geSprite geSprite-"+t+"thindiamondtrans":"openAsync"==n?"geSprite geSprite-"+t+"openasync":"dash"==n?"geSprite geSprite-"+t+"dash":"cross"==n?"geSprite geSprite-"+t+"cross":"async"==n?"1"==i?"geSprite geSprite-"+t+"async":"geSprite geSprite-"+t+"asynctrans":"circle"==n||"circlePlus"==n?"1"==i||"circle"==n?"geSprite geSprite-"+t+"circle":"geSprite geSprite-"+t+"circleplus":"ERone"==n?"geSprite geSprite-"+t+"erone":"ERmandOne"==n?"geSprite geSprite-"+t+"eronetoone":"ERmany"==n?"geSprite geSprite-"+t+"ermany":"ERoneToMany"==n?"geSprite geSprite-"+t+"eronetomany":"ERzeroToOne"==n?"geSprite geSprite-"+t+"eroneopt":"ERzeroToMany"==n?"geSprite geSprite-"+t+"ermanyopt":"geSprite geSprite-noarrow"},EditorUi.prototype.createMenus=function(){return null},EditorUi.prototype.updatePasteActionStates=function(){var t=this.editor.graph,e=this.actions.get("paste"),n=this.actions.get("pasteHere");e.setEnabled(this.editor.graph.cellEditor.isContentEditing()||!mxClipboard.isEmpty()&&t.isEnabled()&&!t.isCellLocked(t.getDefaultParent())),n.setEnabled(e.isEnabled())},EditorUi.prototype.initClipboard=function(){var n=this,e=mxClipboard.cut;mxClipboard.cut=function(t){t.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):e.apply(this,arguments),n.updatePasteActionStates()};var i=mxClipboard.copy;mxClipboard.copy=function(t){t.cellEditor.isContentEditing()?document.execCommand("copy",!1,null):i.apply(this,arguments),n.updatePasteActionStates()};var o=mxClipboard.paste;mxClipboard.paste=function(t){var e=null;return t.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):e=o.apply(this,arguments),n.updatePasteActionStates(),e};var t=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){t.apply(this,arguments),n.updatePasteActionStates()};var s=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(t,e){s.apply(this,arguments),n.updatePasteActionStates()},this.updatePasteActionStates()},EditorUi.prototype.lazyZoomDelay=20,EditorUi.prototype.initCanvas=function(){var f=this.editor.graph;f.timerAutoScroll=!0,f.getPagePadding=function(){return new mxPoint(Math.max(0,0),Math.max(0,0))},f.view.getBackgroundPageBounds=function(){var t=this.graph.getPageLayout(),e=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+t.x*e.width),this.scale*(this.translate.y+t.y*e.height),this.scale*t.width*e.width,this.scale*t.height*e.height)},f.getPreferredPageSize=function(t,e,n){var i=this.getPageLayout(),o=this.getPageSize();return new mxRectangle(0,0,i.width*o.width,i.height*o.height)};var o=null,s=this;if(this.editor.isChromelessView()){o=mxUtils.bind(this,function(t,e,n,i){if(null!=f.container){n=null!=n?n:0,i=null!=i?i:0;var o=f.pageVisible?f.view.getBackgroundPageBounds():f.getGraphBounds(),s=mxUtils.hasScrollbars(f.container),l=f.view.translate,r=f.view.scale,a=mxRectangle.fromRectangle(o);a.x=a.x/r-l.x,a.y=a.y/r-l.y,a.width/=r,a.height/=r;var h=f.container.scrollTop,d=f.container.scrollLeft,u=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;8!=document.documentMode&&9!=document.documentMode||(u+=3);var p=f.container.offsetWidth-u,m=f.container.offsetHeight-u,c=t?Math.max(.3,Math.min(e||1,p/a.width)):r,g=(p-c*a.width)/2/c,x=0==this.lightboxVerticalDivider?0:(m-c*a.height)/this.lightboxVerticalDivider/c;if(s&&(g=Math.max(g,0),x=Math.max(x,0)),s||o.width<p||o.height<m)f.view.scaleAndTranslate(c,Math.floor(g-a.x),Math.floor(x-a.y)),f.container.scrollTop=h*c/r,f.container.scrollLeft=d*c/r;else if(0!=n||0!=i){var y=f.view.translate;f.view.setTranslate(Math.floor(y.x+n/r),Math.floor(y.y+i/r))}}}),this.chromelessResize=o,this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var t=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});if(mxEvent.addListener(window,"resize",t),this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",t)}),this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.chromelessResize(!0)})),this.actions.get("zoomIn").funct=mxUtils.bind(this,function(t){f.zoomIn(),this.chromelessResize(!1)}),this.actions.get("zoomOut").funct=mxUtils.bind(this,function(t){f.zoomOut(),this.chromelessResize(!1)}),"0"!=urlParams.toolbar){this.chromelessToolbar=document.createElement("div"),this.chromelessToolbar.style.position="fixed",this.chromelessToolbar.style.overflow="hidden",this.chromelessToolbar.style.boxSizing="border-box",this.chromelessToolbar.style.whiteSpace="nowrap",this.chromelessToolbar.style.backgroundColor="#000000",this.chromelessToolbar.style.padding="10px 10px 8px 10px",this.chromelessToolbar.style.left="50%",mxClient.IS_VML||(mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","20px"),mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out"));var e=mxUtils.bind(this,function(){var t=mxUtils.getCurrentStyle(f.container);this.chromelessToolbar.style.bottom=(null!=t?parseInt(t["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",e),e();var n=mxUtils.bind(this,function(t,e,n){0;var i=document.createElement("span");i.style.paddingLeft="8px",i.style.paddingRight="8px",i.style.cursor="pointer",mxEvent.addListener(i,"click",t),null!=n&&i.setAttribute("title",n);var o=document.createElement("img");return o.setAttribute("border","0"),o.setAttribute("src",e),i.appendChild(o),this.chromelessToolbar.appendChild(i),i}),i=n(mxUtils.bind(this,function(t){this.actions.get("previousPage").funct(),mxEvent.consume(t)}),Editor.previousLargeImage,mxResources.get("previousPage")),l=document.createElement("div");l.style.display="inline-block",l.style.verticalAlign="top",l.style.fontFamily="Helvetica,Arial",l.style.marginTop="8px",l.style.color="#ffffff",this.chromelessToolbar.appendChild(l);var r=n(mxUtils.bind(this,function(t){this.actions.get("nextPage").funct(),mxEvent.consume(t)}),Editor.nextLargeImage,mxResources.get("nextPage")),a=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&(l.innerHTML="",mxUtils.write(l,mxUtils.indexOf(this.pages,this.currentPage)+1+" / "+this.pages.length))});i.style.paddingLeft="0px",i.style.paddingRight="4px",r.style.paddingLeft="4px",r.style.paddingRight="0px";var h=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(r.style.display="",i.style.display="",l.style.display="inline-block"):(r.style.display="none",i.style.display="none",l.style.display="none"),a()});this.editor.addListener("resetGraphView",h),this.editor.addListener("pageSelected",a),n(mxUtils.bind(this,function(t){this.actions.get("zoomOut").funct(),mxEvent.consume(t)}),Editor.zoomOutLargeImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)"),n(mxUtils.bind(this,function(t){this.actions.get("zoomIn").funct(),mxEvent.consume(t)}),Editor.zoomInLargeImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)"),n(mxUtils.bind(this,function(t){f.isLightboxView()?(1==f.view.scale?this.lightboxFit():f.zoomTo(1),this.chromelessResize(!1)):this.chromelessResize(!0),mxEvent.consume(t)}),Editor.actualSizeLargeImage,mxResources.get("fit"));var d=null,u=null,p=mxUtils.bind(this,function(t){null!=d&&(window.clearTimeout(d),fadeThead=null),null!=u&&(window.clearTimeout(u),fadeThead2=null),d=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0),d=null,u=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none",u=null}),600)}),t||200)}),m=mxUtils.bind(this,function(t){null!=d&&(window.clearTimeout(d),fadeThead=null),null!=u&&(window.clearTimeout(u),fadeThead2=null),this.chromelessToolbar.style.display="",mxUtils.setOpacity(this.chromelessToolbar,t||30)});if("1"==urlParams.layers){this.layersDialog=null;var c=n(mxUtils.bind(this,function(t){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=f.createLayersDialog(),mxEvent.addListener(this.layersDialog,"mouseleave",mxUtils.bind(this,function(){this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null}));var e=c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.layersDialog.style,"borderRadius","5px"),this.layersDialog.style.position="fixed",this.layersDialog.style.fontFamily="Helvetica,Arial",this.layersDialog.style.backgroundColor="#000000",this.layersDialog.style.width="160px",this.layersDialog.style.padding="4px 2px 4px 2px",this.layersDialog.style.color="#ffffff",mxUtils.setOpacity(this.layersDialog,70),this.layersDialog.style.left=e.left+"px",this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";var n=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=n.zIndex,document.body.appendChild(this.layersDialog)}mxEvent.consume(t)}),Editor.layersLargeImage,mxResources.get("layers")),g=f.getModel();g.addListener(mxEvent.CHANGE,function(){c.style.display=1<g.getChildCount(g.root)?"":"none"})}this.addChromelessToolbarItems(n),null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||n(mxUtils.bind(this,function(t){null!=this.editor.editButtonFunc?this.editor.editButtonFunc():"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):f.openLink(this.editor.editButtonLink,"editWindow"),mxEvent.consume(t)}),Editor.editLargeImage,mxResources.get("edit")),!f.lightbox||"1"!=urlParams.close&&this.container==document.body||n(mxUtils.bind(this,function(t){"1"==urlParams.close?window.close():(this.destroy(),mxEvent.consume(t))}),Editor.closeLargeImage,mxResources.get("close")+" (Escape)"),this.chromelessToolbar.style.display="none",mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)"),f.container.appendChild(this.chromelessToolbar),mxEvent.addListener(f.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(t){mxEvent.isTouchEvent(t)||(mxEvent.isShiftDown(t)||m(30),p())})),mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(t){mxEvent.consume(t)}),mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(t){mxEvent.isShiftDown(t)?p():m(100)})),mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(t){mxEvent.isShiftDown(t)?p():m(100),mxEvent.consume(t)})),mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(t){mxEvent.isTouchEvent(t)||m(30)}));var x=f.getTolerance();f.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(t,e){this.startX=e.getGraphX(),this.startY=e.getGraphY(),this.scrollLeft=f.container.scrollLeft,this.scrollTop=f.container.scrollTop},mouseMove:function(t,e){},mouseUp:function(t,e){mxEvent.isTouchEvent(e.getEvent())&&Math.abs(this.scrollLeft-f.container.scrollLeft)<x&&Math.abs(this.scrollTop-f.container.scrollTop)<x&&Math.abs(this.startX-e.getGraphX())<x&&Math.abs(this.startY-e.getGraphY())<x&&(0<parseFloat(s.chromelessToolbar.style.opacity||0)?p():m(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var y=f.view.validate;f.view.validate=function(){if(null!=this.graph.container&&mxUtils.hasScrollbars(this.graph.container)){var t=this.graph.getPagePadding(),e=this.graph.getPageSize();this.translate.x,this.translate.y;this.translate.x=t.x-(this.x0||0)*e.width,this.translate.y=t.y-(this.y0||0)*e.height}y.apply(this,arguments)};var v=f.sizeDidChange;f.sizeDidChange=function(){if(null!=this.container&&(mxUtils.hasScrollbars(this.container)||mxClient.IS_IE||mxClient.IS_EDGE||mxClient.IS_IE11)){var t=this.getPageLayout(),e=this.getPagePadding(),n=this.getPageSize(),i=Math.ceil(2*e.x+t.width*n.width),o=Math.ceil(2*e.y+t.height*n.height),s=f.minimumGraphSize;null!=s&&s.width==i&&s.height==o||(f.minimumGraphSize=new mxRectangle(0,0,i,o));var l=e.x-t.x*n.width,r=e.y-t.y*n.height;if(!(this.autoTranslate||this.view.translate.x==l&&this.view.translate.y==r||mxClient.IS_TOUCH)){this.autoTranslate=!0,this.view.x0=t.x,this.view.y0=t.y;var a=f.view.translate.x,h=f.view.translate.y;return f.view.setTranslate(l,r),f.container.scrollLeft+=Math.round((l-a)*f.view.scale),f.container.scrollTop+=Math.round((r-h)*f.view.scale),void(this.autoTranslate=!1)}v.apply(this,arguments)}}}f.updateZoomTimeout=null,f.cumulativeZoomFactor=1;var C=null;f.lazyZoom=function(t){null!=this.updateZoomTimeout&&window.clearTimeout(this.updateZoomTimeout),t?this.view.scale*this.cumulativeZoomFactor<.15?this.cumulativeZoomFactor=(this.view.scale+.01)/this.view.scale:(this.cumulativeZoomFactor*=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale):this.view.scale*this.cumulativeZoomFactor<=.15?this.cumulativeZoomFactor=(this.view.scale-.01)/this.view.scale:(this.cumulativeZoomFactor/=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale),this.cumulativeZoomFactor=Math.max(.01,Math.min(this.view.scale*this.cumulativeZoomFactor,160)/this.view.scale),this.updateZoomTimeout=window.setTimeout(mxUtils.bind(this,function(){var t=mxUtils.getOffset(f.container),e=0,n=0;null!=C&&(e=f.container.offsetWidth/2-C.x+t.x,n=f.container.offsetHeight/2-C.y+t.y);var i=this.view.scale;this.zoom(this.cumulativeZoomFactor),this.view.scale!=i&&(null!=o&&s.chromelessResize(!1,null,e*(this.cumulativeZoomFactor-1),n*(this.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(f.container)||0==e&&0==n||(f.container.scrollLeft-=e*(this.cumulativeZoomFactor-1),f.container.scrollTop-=n*(this.cumulativeZoomFactor-1))),this.cumulativeZoomFactor=1,this.updateZoomTimeout=null}),this.lazyZoomDelay)},mxEvent.addMouseWheelListener(mxUtils.bind(this,function(t,e){if((null==this.dialogs||0==this.dialogs.length)&&f.isZoomWheelEvent(t))for(var n=mxEvent.getSource(t);null!=n;){if(n==f.container)return C=new mxPoint(mxEvent.getClientX(t),mxEvent.getClientY(t)),f.lazyZoom(e),void mxEvent.consume(t);n=n.parentNode}}))},EditorUi.prototype.addChromelessToolbarItems=function(t){t(mxUtils.bind(this,function(t){this.actions.get("print").funct(),mxEvent.consume(t)}),Editor.printLargeImage,mxResources.get("print"))},EditorUi.prototype.createTemporaryGraph=function(t){var e=new Graph(document.createElement("div"),null,null,t);return e.resetViewOnRootChange=!1,e.setConnectable(!1),e.gridEnabled=!1,e.autoScroll=!1,e.setTooltips(!1),e.setEnabled(!1),e.container.style.visibility="hidden",e.container.style.position="absolute",e.container.style.overflow="hidden",e.container.style.height="1px",e.container.style.width="1px",e},EditorUi.prototype.addChromelessClickHandler=function(){var t=urlParams.highlight;null!=t&&0<t.length&&(t="#"+t),this.editor.graph.addClickHandler(t)},EditorUi.prototype.toggleFormatPanel=function(t){this.formatWidth=t||0<this.formatWidth?0:240,this.formatContainer.style.display=t||0<this.formatWidth?"":"none",this.refresh(),this.format.refresh(),this.fireEvent(new mxEventObject("formatWidthChanged"))},EditorUi.prototype.lightboxFit=function(t){if(this.isDiagramEmpty())this.editor.graph.view.setScale(1);else{var e=urlParams.border,n=60;null!=e&&(n=parseInt(e)),this.editor.graph.maxFitScale=this.lightboxMaxFitScale,this.editor.graph.fit(n,null,null,null,null,null,t),this.editor.graph.maxFitScale=null}},EditorUi.prototype.isDiagramEmpty=function(){var t=this.editor.graph.getModel();return 1==t.getChildCount(t.root)&&0==t.getChildCount(t.getChildAt(t.root,0))},EditorUi.prototype.isSelectionAllowed=function(t){return"SELECT"==mxEvent.getSource(t).nodeName||"INPUT"==mxEvent.getSource(t).nodeName&&mxUtils.isAncestorNode(this.formatContainer,mxEvent.getSource(t))},EditorUi.prototype.addBeforeUnloadListener=function(){window.onbeforeunload=mxUtils.bind(this,function(){if(!this.wfEditor.WfPanelNoNeedRefresh)return this.editor.isChromelessView()?void 0:this.onBeforeUnload();this.wfEditor.WfPanelNoNeedRefresh=!1})},EditorUi.prototype.onBeforeUnload=function(){if(this.editor.modified)return mxResources.get("allChangesLost")},EditorUi.prototype.open=function(){try{null!=window.opener&&null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(t,e){try{var n=mxUtils.parseXml(t);return this.editor.setGraphXml(n.documentElement),this.editor.setModified(!1),this.editor.undoManager.clear(),void(null!=e&&(this.editor.setFilename(e),this.updateDocumentTitle()))}catch(t){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+t.message)}}))}catch(t){}this.editor.graph.view.validate(),this.editor.graph.sizeDidChange(),this.editor.fireEvent(new mxEventObject("resetGraphView"))},EditorUi.prototype.setCurrentMenu=function(t,e){this.currentMenuElt=e,this.currentMenu=t},EditorUi.prototype.resetCurrentMenu=function(){this.currentMenuElt=null,this.currentMenu=null},EditorUi.prototype.hideCurrentMenu=function(){null!=this.currentMenu&&(this.currentMenu.hideMenu(),this.resetCurrentMenu())},EditorUi.prototype.updateDocumentTitle=function(){var t=this.editor.getOrCreateFilename();null!=this.editor.appName&&(t+=" - "+this.editor.appName),document.title=t},EditorUi.prototype.createHoverIcons=function(){return new HoverIcons(this.editor.graph)},EditorUi.prototype.redo=function(){try{this.editor.graph.isEditing()?document.execCommand("redo",!1,null):this.editor.undoManager.redo()}catch(t){}},EditorUi.prototype.undo=function(){try{var t=this.editor.graph;if(t.isEditing()){var e=t.cellEditor.textarea.innerHTML;document.execCommand("undo",!1,null),e==t.cellEditor.textarea.innerHTML&&(t.stopEditing(!0),this.editor.undoManager.undo())}else this.editor.undoManager.undo()}catch(t){}},EditorUi.prototype.canRedo=function(){return this.editor.graph.isEditing()||this.editor.undoManager.canRedo()},EditorUi.prototype.canUndo=function(){return this.editor.graph.isEditing()||this.editor.undoManager.canUndo()},EditorUi.prototype.getEditBlankXml=function(){return mxUtils.getXml(this.editor.getGraphXml())},EditorUi.prototype.getUrl=function(t){var e=null!=t?t:window.location.pathname,n=0<e.indexOf("?")?1:0;for(var i in urlParams)e+=0==n?"?":"&",e+=i+"="+urlParams[i],n++;return e},EditorUi.prototype.setScrollbars=function(t){var e=this.editor.graph,n=e.container.style.overflow;if(e.scrollbars=t,this.editor.updateGraphComponents(),n!=e.container.style.overflow)if("hidden"==e.container.style.overflow){var i=e.view.translate;e.view.setTranslate(i.x-e.container.scrollLeft/e.view.scale,i.y-e.container.scrollTop/e.view.scale),e.container.scrollLeft=0,e.container.scrollTop=0,e.minimumGraphSize=null,e.sizeDidChange()}else{var o=e.view.translate.x,s=e.view.translate.y;e.view.translate.x=0,e.view.translate.y=0,e.sizeDidChange(),e.container.scrollLeft-=Math.round(o*e.view.scale),e.container.scrollTop-=Math.round(s*e.view.scale)}this.fireEvent(new mxEventObject("scrollbarsChanged"))},EditorUi.prototype.hasScrollbars=function(){return this.editor.graph.scrollbars},EditorUi.prototype.resetScrollbars=function(){var t=this.editor.graph;if(this.editor.extendCanvas){if(!this.editor.isChromelessView())if(mxUtils.hasScrollbars(t.container))if(t.pageVisible){var e=t.getPagePadding();t.container.scrollTop=Math.floor(e.y-this.editor.initialTopSpacing)-1,t.container.scrollLeft=Math.floor(Math.min(e.x,(t.container.scrollWidth-t.container.clientWidth)/2))-1,0<(n=t.getGraphBounds()).width&&0<n.height&&(n.x>t.container.scrollLeft+.9*t.container.clientWidth&&(t.container.scrollLeft=Math.min(n.x+n.width-t.container.clientWidth,n.x-10)),n.y>t.container.scrollTop+.9*t.container.clientHeight&&(t.container.scrollTop=Math.min(n.y+n.height-t.container.clientHeight,n.y-10)))}else{var n=t.getGraphBounds(),i=Math.max(n.width,t.scrollTileSize.width*t.view.scale),o=Math.max(n.height,t.scrollTileSize.height*t.view.scale);t.container.scrollTop=Math.floor(Math.max(0,n.y-Math.max(20,(t.container.clientHeight-o)/4))),t.container.scrollLeft=Math.floor(Math.max(0,n.x-Math.max(0,(t.container.clientWidth-i)/2)))}else if(t.pageVisible){var s=t.view.getBackgroundPageBounds();t.view.setTranslate(Math.floor(Math.max(0,(t.container.clientWidth-s.width)/2)-s.x),Math.floor(Math.max(0,(t.container.clientHeight-s.height)/2)-s.y))}else{n=t.getGraphBounds();t.view.setTranslate(Math.floor(Math.max(0,Math.max(0,(t.container.clientWidth-n.width)/2)-n.x)),Math.floor(Math.max(0,Math.max(20,(t.container.clientHeight-n.height)/4))-n.y))}}else t.container.scrollTop=0,t.container.scrollLeft=0,mxUtils.hasScrollbars(t.container)||t.view.setTranslate(0,0)},EditorUi.prototype.setPageVisible=function(t){var e=this.editor.graph,n=mxUtils.hasScrollbars(e.container),i=0,o=0;if(n&&(i=e.view.translate.x*e.view.scale-e.container.scrollLeft,o=e.view.translate.y*e.view.scale-e.container.scrollTop),e.pageVisible=t,e.pageBreaksVisible=t,e.preferPageSize=t,e.view.validateBackground(),n){var s=e.getSelectionCells();e.clearSelection(),e.setSelectionCells(s)}e.sizeDidChange(),n&&(e.container.scrollLeft=e.view.translate.x*e.view.scale-i,e.container.scrollTop=e.view.translate.y*e.view.scale-o),this.fireEvent(new mxEventObject("pageViewChanged"))},ChangePageSetup.prototype.execute=function(){var t=this.ui.editor.graph;if(!this.ignoreColor){this.color=this.previousColor;var e=t.background;this.ui.setBackgroundColor(this.previousColor),this.previousColor=e}if(!this.ignoreImage){this.image=this.previousImage;e=t.backgroundImage;this.ui.setBackgroundImage(this.previousImage),this.previousImage=e}if(null!=this.previousFormat){this.format=this.previousFormat;e=t.pageFormat;this.previousFormat.width==e.width&&this.previousFormat.height==e.height||(this.ui.setPageFormat(this.previousFormat),this.previousFormat=e)}null!=this.foldingEnabled&&this.foldingEnabled!=this.ui.editor.graph.foldingEnabled&&(this.ui.setFoldingEnabled(this.foldingEnabled),this.foldingEnabled=!this.foldingEnabled)},function(){var t=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);t.afterDecode=function(t,e,n){return n.previousColor=n.color,n.previousImage=n.image,n.previousFormat=n.format,null!=n.foldingEnabled&&(n.foldingEnabled=!n.foldingEnabled),n},mxCodecRegistry.register(t)}(),EditorUi.prototype.setBackgroundColor=function(t){this.editor.graph.background=t,this.editor.graph.view.validateBackground(),this.fireEvent(new mxEventObject("backgroundColorChanged"))},EditorUi.prototype.setFoldingEnabled=function(t){this.editor.graph.foldingEnabled=t,this.editor.graph.view.revalidate(),this.fireEvent(new mxEventObject("foldingEnabledChanged"))},EditorUi.prototype.setPageFormat=function(t){this.editor.graph.pageFormat=t,this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct(),this.fireEvent(new mxEventObject("pageFormatChanged"))},EditorUi.prototype.setPageScale=function(t){this.editor.graph.pageScale=t,this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct(),this.fireEvent(new mxEventObject("pageScaleChanged"))},EditorUi.prototype.setGridColor=function(t){this.editor.graph.view.gridColor=t,this.editor.graph.view.validateBackground(),this.fireEvent(new mxEventObject("gridColorChanged"))},EditorUi.prototype.addUndoListener=function(){var t=this.actions.get("undo"),e=this.actions.get("redo"),n=this.editor.undoManager,i=mxUtils.bind(this,function(){t.setEnabled(this.canUndo()),e.setEnabled(this.canRedo())});n.addListener(mxEvent.ADD,i),n.addListener(mxEvent.UNDO,i),n.addListener(mxEvent.REDO,i),n.addListener(mxEvent.CLEAR,i);var o=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){o.apply(this,arguments),i()};var s=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(t,e){s.apply(this,arguments),i()},i()},EditorUi.prototype.updateActionStates=function(){var t=this.editor.graph,e=!t.isSelectionEmpty(),n=!1,i=!1,o=t.getSelectionCells();if(null!=o)for(var s=0;s<o.length;s++){var l=o[s];if(t.getModel().isEdge(l)&&(i=!0),t.getModel().isVertex(l)&&(n=!0),i&&n)break}var r=["cut","copy","bold","italic","underline","delete","duplicate","editStyle","editTooltip","editLink","backgroundColor","borderColor","edit","toFront","toBack","lockUnlock","solid","dashed","pasteSize","dotted","fillColor","gradientColor","shadow","fontColor","formattedText","rounded","toggleRounded","sharp","strokeColor"];for(s=0;s<r.length;s++)this.actions.get(r[s]).setEnabled(e);this.actions.get("setAsDefaultStyle").setEnabled(1==t.getSelectionCount()),this.actions.get("clearWaypoints").setEnabled(!t.isSelectionEmpty()),this.actions.get("copySize").setEnabled(1==t.getSelectionCount()),this.actions.get("turn").setEnabled(!t.isSelectionEmpty()),this.actions.get("curved").setEnabled(i),this.actions.get("rotation").setEnabled(n),this.actions.get("wordWrap").setEnabled(n),this.actions.get("autosize").setEnabled(n);var a=n&&1==t.getSelectionCount();this.actions.get("group").setEnabled(1<t.getSelectionCount()||a&&!t.isContainer(t.getSelectionCell())),this.actions.get("ungroup").setEnabled(1==t.getSelectionCount()&&(0<t.getModel().getChildCount(t.getSelectionCell())||a&&t.isContainer(t.getSelectionCell()))),this.actions.get("removeFromGroup").setEnabled(a&&t.getModel().isVertex(t.getModel().getParent(t.getSelectionCell())));t.view.getState(t.getSelectionCell());this.menus.get("navigation").setEnabled(e||null!=t.view.currentRoot),this.actions.get("collapsible").setEnabled(n&&(t.isContainer(t.getSelectionCell())||0<t.model.getChildCount(t.getSelectionCell()))),this.actions.get("home").setEnabled(null!=t.view.currentRoot),this.actions.get("exitGroup").setEnabled(null!=t.view.currentRoot),this.actions.get("enterGroup").setEnabled(1==t.getSelectionCount()&&t.isValidRoot(t.getSelectionCell()));var h=1==t.getSelectionCount()&&t.isCellFoldable(t.getSelectionCell());this.actions.get("expand").setEnabled(h),this.actions.get("collapse").setEnabled(h),this.actions.get("editLink").setEnabled(1==t.getSelectionCount()),this.actions.get("openLink").setEnabled(1==t.getSelectionCount()&&null!=t.getLinkForCell(t.getSelectionCell())),this.actions.get("guides").setEnabled(t.isEnabled()),this.actions.get("grid").setEnabled(!this.editor.chromeless||this.editor.editable);var d=t.isEnabled()&&!t.isCellLocked(t.getDefaultParent());this.menus.get("layout").setEnabled(d),this.menus.get("insert").setEnabled(d),this.menus.get("direction").setEnabled(d&&n),this.menus.get("align").setEnabled(d&&n&&1<t.getSelectionCount()),this.menus.get("distribute").setEnabled(d&&n&&1<t.getSelectionCount()),this.actions.get("selectVertices").setEnabled(d),this.actions.get("selectEdges").setEnabled(d),this.actions.get("selectAll").setEnabled(d),this.actions.get("selectNone").setEnabled(d),this.updatePasteActionStates()},EditorUi.prototype.refresh=function(t){t=null==t||t;var e=mxClient.IS_IE&&(null==document.documentMode||5==document.documentMode),n=this.container.clientWidth,i=this.container.clientHeight;this.container==document.body&&(n=document.body.clientWidth||document.documentElement.clientWidth,i=e&&document.body.clientHeight||document.documentElement.clientHeight);var o=0;mxClient.IS_IOS&&!window.navigator.standalone&&window.innerHeight!=document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-window.innerHeight,window.scrollTo(0,0));var s=Math.max(0,Math.min(this.hsplitPosition,n-this.splitSize-20)),l=0;null!=this.menubar&&(this.menubarContainer.style.height=this.menubarHeight+"px",l+=this.menubarHeight),null!=this.toolbar&&(this.toolbarContainer.style.top="0px",this.toolbarContainer.style.height=this.toolbarHeight+"px",l+=this.toolbarHeight),0<l&&!mxClient.IS_QUIRKS&&(l+=1);var r=0;if(null!=this.sidebarFooterContainer){var a=this.footerHeight+o;r=Math.max(0,Math.min(i-l-a,this.sidebarFooterHeight)),this.sidebarFooterContainer.style.width=s+"px",this.sidebarFooterContainer.style.height=r+"px",this.sidebarFooterContainer.style.bottom=a+"px"}var h=null!=this.format?this.formatWidth:0;if(this.sidebarContainer.style.top=l+"px",this.sidebarContainer.style.width="100%",this.sidebarContainer.style.height="100px",this.formatContainer.style.top="0px",this.formatContainer.style.width=h+"px",this.formatContainer.style.display=null!=this.format?"":"none",this.wfPanelContainer.style.left=null!=this.hsplit.parentNode?s+this.splitSize+"px":"0px",this.diagramContainer.style.left="0px",this.wfPanelContainer.style.top=this.isFromWfForm?0:this.wfPanelContainer.offsetTop+"px",mxClient.IS_READONLY_FORM&&(this.wfPanelContainer.style.background="#f5f5f5",this.diagramContainer.style.background="#f5f5f5",this.diagramContainer.style.border="none",jQuery(".geBackgroundPage").css({background:"transparent",border:"none"})),this.diagramContainer.style.top="0px",this.footerContainer.style.height=this.footerHeight+"px",this.hsplit.style.top=this.sidebarContainer.style.top,this.hsplit.style.bottom=this.footerHeight+o+"px",this.hsplit.style.left=s+"px",null!=this.tabContainer&&(this.tabContainer.style.left=this.wfPanelContainer.style.left),e){this.menubarContainer.style.width=n+"px",this.toolbarContainer.style.width=this.menubarContainer.style.width;var d=Math.max(0,i-this.footerHeight-this.menubarHeight-this.toolbarHeight);this.sidebarContainer.style.height=d-r+"px",this.formatContainer.style.height=d+"px",this.wfPanelContainer.style.width=null!=this.hsplit.parentNode?Math.max(0,n-s-this.splitSize-h)+"px":n+"px",this.footerContainer.style.width=this.menubarContainer.style.width;var u=Math.max(0,i-this.footerHeight-this.menubarHeight-this.toolbarHeight);null!=this.tabContainer&&(this.tabContainer.style.width=this.wfPanelContainer.style.width,this.tabContainer.style.bottom=this.footerHeight+o+"px",u-=this.tabContainer.clientHeight),this.wfPanelContainer.style.height=u+"px",this.diagramContainer.style.height=u-20+"px",this.hsplit.style.height=u+"px"}else{0<this.footerHeight&&(this.footerContainer.style.bottom=o+"px"),this.diagramContainer.style.right="0px",this.wfPanelContainer.style.right=this.isFromWfForm?"0px":"240px";null!=this.tabContainer&&(this.tabContainer.style.bottom=this.footerHeight+o+"px",this.tabContainer.style.right=this.wfPanelContainer.style.right,this.tabContainer.clientHeight),this.sidebarContainer.style.bottom=this.footerHeight+r+o+"px",this.formatContainer.style.bottom="0px",this.wfPanelContainer.style.bottom="0px",this.diagramContainer.style.bottom="10px"}t&&this.editor.graph.sizeDidChange(),mxClient.IS_READONLY_PAGE&&(mxClient.IS_FREE_WORKFLOW||mxClient.IS_FREE_FREEFLOW_NODE)&&!mxClient.FREE_WORKFLOW_ISREADONLY_MODEL&&(jQuery(".geEditor").css({background:"#fff"}),mxClient.IS_TOUCH||(this.wfPanelContainer.style.bottom="60px",this.wfPanelContainer.style.right="400px"),this.wfPanelContainer.style.background="#fff",this.diagramContainer.style.left="0",this.diagramContainer.style.right="0",this.diagramContainer.style.top="0",this.diagramContainer.style.bottom="0",this.diagramContainer.style.background="#fff")},EditorUi.prototype.createTabContainer=function(){return null},EditorUi.prototype.createDivs=function(){this.wfEditorContainer=this.createDiv("wfEditorContainer"),this.wfPanelContainer=this.createDiv("wfPanelContainer"),this.wfGroupsContainer=this.createDiv("wfGroupsContainer"),this.wfNodeInfoContainer=this.createDiv("wfNodeInfoContainer"),this.menubarContainer=this.createDiv("geMenubarContainer"),this.toolbarContainer=this.createDiv("geToolbarContainer"),this.sidebarContainer=this.createDiv("geSidebarContainer"),this.formatContainer=this.createDiv("geSidebarContainer geFormatContainer"),this.diagramContainer=this.createDiv("geDiagramContainer"),this.footerContainer=this.createDiv("geFooterContainer"),this.hsplit=this.createDiv("geHsplit"),this.hsplit.setAttribute("title",mxResources.get("collapseExpand")),this.menubarContainer.style.top="0px",this.menubarContainer.style.left="0px",this.menubarContainer.style.right="0px",this.toolbarContainer.style.left="0px",this.toolbarContainer.style.right="0px",this.sidebarContainer.style.left="0px",this.formatContainer.style.right="0px",this.formatContainer.style.zIndex="1",this.wfPanelContainer.style.right="240px",this.footerContainer.style.left="0px",this.footerContainer.style.right="0px",this.footerContainer.style.bottom="0px",this.footerContainer.style.zIndex=mxPopupMenu.prototype.zIndex-2,this.hsplit.style.width=this.splitSize+"px",this.sidebarFooterContainer=this.createSidebarFooterContainer(),this.sidebarFooterContainer&&(this.sidebarFooterContainer.style.left="0px"),this.editor.chromeless?this.diagramContainer.style.border="none":this.tabContainer=this.createTabContainer()},EditorUi.prototype.createSidebarFooterContainer=function(){return null},EditorUi.prototype.transFormSvgContainer=function(){this.beforeTransformStyles={left:this.diagramContainer.style.left,top:this.diagramContainer.style.top},this.currentIsHorizon?(this.diagramContainer.style.transform="",this.diagramContainer.style.MsTransform="",this.diagramContainer.style.left="0px",this.diagramContainer.style.top="0px",this.diagramContainer.style.width="",this.diagramContainer.style.height="",this.currentIsHorizon=!1):(this.diagramContainer.style.transform="rotate(90deg)",this.diagramContainer.style.MsTransform="rotate(90deg)",this.diagramContainer.style.left="calc(50vw - 50vh)",this.diagramContainer.style.top="calc(50vh - 50vw)",this.diagramContainer.style.width="100vh",this.diagramContainer.style.height="100vw",this.currentIsHorizon=!0)},EditorUi.prototype.createUi=function(){if(this.wfEditor=this.editor.chromeless?null:this.createWfEditor(this.wfEditorContainer),null!=this.wfEditor&&(this.wfEditorContainer.onselectstart=this.wfEditorContainer.ondrag=function(){return!1},this.isFromWfForm||this.container.appendChild(this.wfEditorContainer),this.isFromWfForm&&this.wfEditor.createTestMask()),this.wfNodeInfo=this.editor.chromeless?null:this.createWfNodeInfo(this.wfNodeInfoContainer),null!=this.wfNodeInfo&&(this.wfNodeInfoContainer.id="wfNodeInfoContainerId",this.isFromWfForm||this.container.appendChild(this.wfNodeInfoContainer)),this.wfGroups=this.editor.chromeless?null:this.createWfGroups(this.wfGroupsContainer),null!=this.wfGroups&&(this.wfGroupsContainer.id="wfGroupsContainer",this.diagramContainer.appendChild(this.wfGroupsContainer)),null!=this.sidebar&&this.sidebarFooterContainer&&this.container.appendChild(this.sidebarFooterContainer),this.container.appendChild(this.wfPanelContainer),mxClient.IS_TOUCH){var n=this,t=this.cusSetGesture(this.diagramContainer);t.gesturestart=function(t){var e=workflowUi.editor.graph.view.scale;n.cusPreInitScale=e},t.gesturemove=function(t){var e=n.cusPreInitScale*t.scale;workflowUi.editor.graph.zoomTo(e)},t.gestureend=function(t){var e=workflowUi.editor.graph.view.scale;n.cusPreInitScale=e}}this.wfPanelContainer.appendChild(this.diagramContainer),null!=this.container&&null!=this.tabContainer&&this.container.appendChild(this.tabContainer)},EditorUi.prototype.cusSetGesture=function(o){var s={},l=!1,r=[],a=this;return o.addEventListener("touchstart",function(t){2<=t.touches.length&&(l=!0,r=t.touches,s.gesturestart&&s.gesturestart.call(o))},!1),document.addEventListener("touchmove",function(t){if(2<=t.touches.length&&l){var e=t.touches,n=a.cusGetDistance(e[0],e[1])/a.cusGetDistance(r[0],r[1]),i=a.cusGetAngle(e[0],e[1])-a.cusGetAngle(r[0],r[1]);t.scale=n.toFixed(2),t.rotation=i.toFixed(2),s.gesturemove&&s.gesturemove.call(o,t)}},!1),document.addEventListener("touchend",function(t){l&&(l=!1,s.gestureend&&s.gestureend.call(o))},!1),s},EditorUi.prototype.cusGetDistance=function(t,e){var n=e.pageX-t.pageX,i=e.pageY-t.pageY;return Math.sqrt(n*n+i*i)},EditorUi.prototype.cusGetAngle=function(t,e){var n=t.pageX-e.pageX,i=t.pageY-e.pageY;return 180*Math.atan2(i,n)/Math.PI},EditorUi.prototype.doSaveLocalFile=function(t,e,n,i,o){if(window.Blob&&navigator.msSaveOrOpenBlob)t=i?this.base64ToBlob(t,n):new Blob([t],{type:n}),navigator.msSaveOrOpenBlob(t,e);else if(mxClient.IS_IE)null==(n=window.open("about:blank","_blank"))?mxUtils.popup(t,!0):(n.document.write(t),n.document.close(),n.document.execCommand("SaveAs",!0,e),n.close());else if(mxClient.IS_IOS)(e=new TextareaDialog(this,e+":",t,null,null,mxResources.get("close"))).textarea.style.width="600px",e.textarea.style.height="380px",this.showDialog(e.container,620,460,!0,!0),e.init(),document.execCommand("selectall",!1,null);else{var s=document.createElement("a"),l=!mxClient.IS_SF&&navigator.userAgent.indexOf("PaleMoon/")<0&&void 0!==s.download;if(mxClient.IS_GC){var r=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);l=65!=(!!r&&parseInt(r[2],10))&&l}if(l||this.isOffline()){s.href=URL.createObjectURL(i?this.base64ToBlob(t,n):new Blob([t],{type:n})),l?s.download=e:s.setAttribute("target","_blank"),document.body.appendChild(s);try{window.setTimeout(function(){URL.revokeObjectURL(s.href)},0),s.click(),s.parentNode.removeChild(s)}catch(t){}}else this.createEchoRequest(t,e,n,i,o).simulate(document,"_blank")}},EditorUi.prototype.createEchoRequest=function(t,e,n,i,o,s){return t="xml="+encodeURIComponent(t),new mxXmlRequest(SAVE_URL,t+(null!=n?"&mime="+n:"")+(null!=o?"&format="+o:"")+(null!=s?"&base64="+s:"")+(null!=e?"&filename="+encodeURIComponent(e):"")+(i?"&binary=1":""))},EditorUi.prototype.base64ToBlob=function(t,e){e=e||"";for(var n=atob(t),i=n.length,o=Math.ceil(i/1024),s=Array(o),l=0;l<o;++l){for(var r=1024*l,a=Math.min(r+1024,i),h=Array(a-r),d=0;r<a;++d,++r)h[d]=n[r].charCodeAt(0);s[l]=new Uint8Array(h)}return new Blob(s,{type:e})},EditorUi.prototype.createStatusContainer=function(){var t=document.createElement("a");return t.className="geItem geStatus",screen.width<420&&(t.style.maxWidth=Math.max(20,screen.width-320)+"px",t.style.overflow="hidden"),t},EditorUi.prototype.setStatusText=function(t){this.statusContainer.innerHTML=t},EditorUi.prototype.createToolbar=function(t){return new Toolbar(this,t)},EditorUi.prototype.createSidebar=function(t){return new Sidebar(this,t)},EditorUi.prototype.createWfEditor=function(t){return new WfPanel(this,t)},EditorUi.prototype.createWfGroups=function(t){return new wfGroups(this,t)},EditorUi.prototype.createWfNodeInfo=function(t){return new WfNodeInfo(this,t)},EditorUi.prototype.createFormat=function(t){return new Format(this,t)},EditorUi.prototype.createFooter=function(){return this.createDiv("geFooter")},EditorUi.prototype.createDiv=function(t){var e=document.createElement("div");return e.className=t,e},EditorUi.prototype.addSplitHandler=function(e,n,i,o){var s=null,l=null,r=!0,a=null;mxClient.IS_POINTER&&(e.style.touchAction="none");var h=mxUtils.bind(this,function(){var t=parseInt(n?e.style.left:""==e.style.bottom?0:e.style.bottom);return n||(t+=i),t});function d(t){if(null!=s){var e=new mxPoint(mxEvent.getClientX(t),mxEvent.getClientY(t));o(Math.max(0,l+(n?e.x-s.x:s.y-e.y)-i)),mxEvent.consume(t),l!=h()&&(r=!0,a=null)}}function t(t){d(t),s=l=null}mxEvent.addGestureListeners(e,function(t){s=new mxPoint(mxEvent.getClientX(t),mxEvent.getClientY(t)),l=h(),r=!1,mxEvent.consume(t)}),mxEvent.addListener(e,"click",mxUtils.bind(this,function(t){if(!r&&this.hsplitClickEnabled){var e=null!=a?a-i:0;a=h(),o(e),mxEvent.consume(t)}})),mxEvent.addGestureListeners(document,null,d,t),this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,d,t)})},EditorUi.prototype.showDialog=function(t,e,n,i,o,s,l){this.editor.graph.tooltipHandler.hideTooltip(),null==this.dialogs&&(this.dialogs=[]),this.dialog=new Dialog(this,t,e,n,i,o,s,l),this.dialogs.push(this.dialog)},EditorUi.prototype.hideDialog=function(t){null!=this.dialogs&&0<this.dialogs.length&&(this.dialogs.pop().close(t),this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,null==this.dialog&&"hidden"!=this.editor.graph.container.style.visibility&&this.editor.graph.container.focus(),mxUtils.clearSelection(),this.editor.fireEvent(new mxEventObject("hideDialog")))},EditorUi.prototype.pickColor=function(t,e){var n=this.editor.graph,i=n.cellEditor.saveSelection(),o=new ColorDialog(this,t||"none",function(t){n.cellEditor.restoreSelection(i),e(t)},function(){n.cellEditor.restoreSelection(i)});this.showDialog(o.container,230,430,!0,!1),o.init()},EditorUi.prototype.openFile=function(){window.openFile=new OpenFile(mxUtils.bind(this,function(t){this.hideDialog(t)})),this.showDialog(new OpenDialog(this).container,Editor.useLocalStorage?640:320,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null})},EditorUi.prototype.extractGraphModelFromHtml=function(t){var e=null;try{var n=t.indexOf("&lt;mxGraphModel ");if(0<=n){var i=t.lastIndexOf("&lt;/mxGraphModel&gt;");n<i&&(e=t.substring(n,i+21).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}}catch(t){}return e},EditorUi.prototype.extractGraphModelFromEvent=function(t){var e=null,n=null;if(null!=t){var i=null!=t.dataTransfer?t.dataTransfer:t.clipboardData;if(null!=i&&(10==document.documentMode||11==document.documentMode?n=i.getData("Text"):(n=0<=mxUtils.indexOf(i.types,"text/html")?i.getData("text/html"):null,mxUtils.indexOf(i.types,null==n||0==n.length)&&(n=i.getData("text/plain"))),null!=n)){n=this.editor.graph.zapGremlins(mxUtils.trim(n));var o=this.extractGraphModelFromHtml(n);null!=o&&(n=o)}}return null!=n&&this.isCompatibleString(n)&&(e=n),e},EditorUi.prototype.isCompatibleString=function(t){return!1},EditorUi.prototype.saveFile=function(t){this.editor.modified;var e=this.editor.undoManager.history||[],n=this.wfEditor,i=this;0<e.length&&this.editor.modified?wfModal.confirm({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390413,"改动未进行测试,是否需要测试?"),okText:wfGetLabel(83446,"确定"),cancelText:wfGetLabel(31129,"取消"),onOk:function(){n.doWorkflowTest(),i.editor.setModified(!1)},onCancel:function(){i.save(1)}}):this.save(1)},EditorUi.prototype.save=function(t){if(window.workflowUiIsLoaded){if(null!=t){this.editor.graph.isEditing()&&this.editor.graph.stopEditing();for(var e=this.editor.graph,n=e.view.scale,i=e.minimumGraphSize.x,o=e.minimumGraphSize.y,s=e.minimumGraphSize.width*n||1e5,l=e.minimumGraphSize.height*n||1e5,r=e.getAllCells(i,o,s,l),a=!1,h=!1,d=0;d<r.length;++d)0==r[d].nodeType?a=!0:3==r[d].nodeType&&(h=!0);var u=mxUtils.getXml(this.editor.getGraphXml()),p=this.editor.graph.existParams;mxUtils.parseXml(u);if(!a)return wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390415,"创建节点不存在,请添加!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}}),!1;if(!h)return wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390416,"归档节点不存在,请添加!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}}),!1;var m=[],c=[];for(d=0;d<r.length;++d)r[d].edge?m.push(r[d]):c.push(r[d]);var g=[],x=[];for(d=0;d<c.length;++d)c[d]&&c[d].nodeId&&g.push(c[d].nodeId);for(d=0;d<m.length;++d)m[d]&&m[d].linkId&&x.push(m[d].linkId);var y=[],f=[];if(p){for(d=0;d<p.nodeIds.length;++d)g.indexOf(p.nodeIds[d])<0&&y.push(p.nodeIds[d]);for(d=0;d<p.linkIds.length;++d)x.indexOf(p.linkIds[d])<0&&f.push(p.linkIds[d])}var v=p?y:[],C=p?f:[];u=u.replace(/&/g,"_amp_");var E=this.wfGroups.getGroupsValue();E&&(0<E.col.length||0<E.row.length)||(p.groupDetail||(p.groupDetail={}),localStorage.wfDesign_initGroups=JSON.stringify(p.groupDetail),E=p?p.groupDetail:{col:[],row:[]}),localStorage.groups=JSON.stringify(E);try{var w=this,S=window.urlParams.workflowId||window.urlParams.workflowid||"";wfMessage.destroy(),wfMessage&&wfMessage.loading(wfGetLabel(129514,"正在保存数据,请稍候..."),0),jQuery(".workflow-test").stop(!0),workflowUi.wfEditor.createSaveMask(!0),window.ecCom.WeaTools.callApi("/api/workflow/layout/saveLayout","POST",{workflowId:S,xml:window.ecCom.WeaTools.Base64.encode(u),deleteLinks:C.join(","),deleteNodes:v.join(","),groups:JSON.stringify(E).replace(/&/g,"_amp_")}).then(function(t){wfMessage.destroy(),t.result?(wfMessage&&wfMessage.success(wfGetLabel(83551,"保存成功!"),2),getXmlAndDatas(w)):(wfMessage&&wfMessage.error(wfGetLabel(84544,"保存失败!"),2),workflowUi.wfEditor.createSaveMask(!1))})}catch(t){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("errorSavingFile")))}}}else wfModal.confirm({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390414,"当前用户未登陆,请先登陆!"),okText:wfGetLabel(83446,"确定"),cancelText:wfGetLabel(31129,"取消"),onOk:function(){window.location.href="/wui/index.html"},onCancel:function(){}})},EditorUi.prototype.executeLayout=function(t,e,n){var i=this.editor.graph;if(i.isEnabled()){i.getModel().beginUpdate();try{t()}catch(t){throw t}finally{if(this.allowAnimation&&e&&navigator.userAgent.indexOf("Camino")<0){var o=new mxMorphing(i);o.addListener(mxEvent.DONE,mxUtils.bind(this,function(){i.getModel().endUpdate(),null!=n&&n()})),o.startAnimation()}else i.getModel().endUpdate(),null!=n&&n()}}},EditorUi.prototype.showImageDialog=function(t,e,n,i){var o=this.editor.graph.cellEditor,s=o.saveSelection(),l=mxUtils.prompt(t,e);if(o.restoreSelection(s),null!=l&&0<l.length){var r=new Image;r.onload=function(){n(l,r.width,r.height)},r.onerror=function(){n(null),mxUtils.alert(mxResources.get("fileNotFound"))},r.src=l}else n(null)},EditorUi.prototype.showLinkDialog=function(t,e,n){var i=new LinkDialog(this,t,e,n);this.showDialog(i.container,420,90,!0,!0),i.init()},EditorUi.prototype.showDataDialog=function(t){if(null!=t){var e=new EditDataDialog(this,t);this.showDialog(e.container,340,340,!0,!1,null,!1),e.init()}},EditorUi.prototype.showBackgroundImageDialog=function(t){t=null!=t?t:mxUtils.bind(this,function(t){var e=new ChangePageSetup(this,null,t);e.ignoreColor=!0,this.editor.graph.model.execute(e)});var e=mxUtils.prompt(mxResources.get("backgroundImage"),"");if(null!=e&&0<e.length){var n=new Image;n.onload=function(){t(new mxImage(e,n.width,n.height))},n.onerror=function(){t(null),mxUtils.alert(mxResources.get("fileNotFound"))},n.src=e}else t(null)},EditorUi.prototype.setBackgroundImage=function(t){this.editor.graph.setBackgroundImage(t),this.editor.graph.view.validateBackgroundImage(),this.fireEvent(new mxEventObject("backgroundImageChanged"))},EditorUi.prototype.confirm=function(t,e,n){mxUtils.confirm(t)?null!=e&&e():null!=n&&n()},EditorUi.prototype.createOutline=function(t){var e=new mxOutline(this.editor.graph);return e.border=20,mxEvent.addListener(window,"resize",function(){e.update()}),this.addListener("pageFormatChanged",function(){e.update()}),e},EditorUi.prototype.createKeyHandler=function(t){var n=this,p=this.editor.graph,l=new mxKeyHandler(p),e=l.isEventIgnored;l.isEventIgnored=function(t){return(!this.isControlDown(t)||mxEvent.isShiftDown(t)||90!=t.keyCode&&89!=t.keyCode&&188!=t.keyCode&&190!=t.keyCode&&85!=t.keyCode)&&(66!=t.keyCode&&73!=t.keyCode||!this.isControlDown(t)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&!mxClient.IS_SF)&&e.apply(this,arguments)},l.isEnabledForEvent=function(t){return!mxEvent.isConsumed(t)&&this.isGraphEvent(t)&&this.isEnabled()&&(null==n.dialogs||0==n.dialogs.length)},l.isControlDown=function(t){return mxEvent.isControlDown(t)||mxClient.IS_MAC&&t.metaKey};var i=[],o=null;function s(h,d,u){i.push(function(){if(!p.isSelectionEmpty()&&p.isEnabled())if(d=null!=d?d:1,u){p.getModel().beginUpdate();try{for(var t=p.getSelectionCells(),e=0;e<t.length;e++)if(p.getModel().isVertex(t[e])&&p.isCellResizable(t[e])){var n=p.getCellGeometry(t[e]);null!=n&&(n=n.clone(),37==h?n.width=Math.max(0,n.width-d):38==h?n.height=Math.max(0,n.height-d):39==h?n.width+=d:40==h&&(n.height+=d),p.getModel().setGeometry(t[e],n))}}finally{p.getModel().endUpdate()}}else{var i=p.getSelectionCell(),o=p.model.getParent(i),s=null;if(1==p.getSelectionCount()&&p.model.isVertex(i)&&null!=p.layoutManager&&!p.isCellLocked(i)&&(s=p.layoutManager.getLayout(o)),null!=s&&s.constructor==mxStackLayout){var l=o.getIndex(i);37==h||38==h?p.model.add(o,i,Math.max(0,l-1)):39!=h&&40!=h||p.model.add(o,i,Math.min(p.model.getChildCount(o),l+1))}else{var r=0,a=0;37==h?r=-d:38==h?a=-d:39==h?r=d:40==h&&(a=d),p.moveCells(p.getMovableCells(p.getSelectionCells()),r,a)}}}),null!=o&&window.clearTimeout(o),o=window.setTimeout(function(){if(0<i.length){p.getModel().beginUpdate();try{for(var t=0;t<i.length;t++)i[t]();i=[]}finally{p.getModel().endUpdate()}p.scrollCellToVisible(p.getSelectionCell())}},200)}var r={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},a=l.getFunction,h={67:this.actions.get("clearWaypoints"),65:this.actions.get("connectionArrows"),76:this.actions.get("editLink"),80:this.actions.get("connectionPoints"),84:this.actions.get("editTooltip"),86:this.actions.get("pasteSize"),88:this.actions.get("copySize")};mxKeyHandler.prototype.getFunction=function(e){if(p.isEnabled()){if(mxEvent.isShiftDown(e)&&mxEvent.isAltDown(e)){var t=h[e.keyCode];if(null!=t)return t.funct}if(9==e.keyCode&&mxEvent.isAltDown(e))return mxEvent.isShiftDown(e)?function(){p.selectParentCell()}:function(){p.selectChildCell()};if(null!=r[e.keyCode]&&!p.isSelectionEmpty()){if(!mxEvent.isShiftDown(e)||!mxEvent.isAltDown(e))return this.isControlDown(e)?function(){s(e.keyCode,mxEvent.isShiftDown(e)?p.gridSize:null,!0)}:function(){s(e.keyCode,mxEvent.isShiftDown(e)?p.gridSize:null)};if(p.model.isVertex(p.getSelectionCell()))return function(){var t=p.connectVertex(p.getSelectionCell(),r[e.keyCode],p.defaultEdgeLength,e,!0);null!=t&&0<t.length&&(1==t.length&&p.model.isEdge(t[0])?p.setSelectionCell(p.model.getTerminal(t[0],!1)):p.setSelectionCell(t[t.length-1]),p.scrollCellToVisible(p.getSelectionCell()),null!=n.hoverIcons&&n.hoverIcons.update(p.view.getState(p.getSelectionCell())))}}}return a.apply(this,arguments)},l.bindAction=mxUtils.bind(this,function(t,e,n,i){var o=this.actions.get(n);if(null!=o){function s(){o.isEnabled()&&o.funct()}e?i?l.bindControlShiftKey(t,s):l.bindControlKey(t,s):i?l.bindShiftKey(t,s):l.bindKey(t,s)}});var d=l.escape;return l.escape=function(t){d.apply(this,arguments)},l.enter=function(){},l.bindControlShiftKey(36,function(){p.exitGroup()}),l.bindControlShiftKey(35,function(){p.enterGroup()}),l.bindKey(36,function(){p.home()}),l.bindKey(35,function(){p.refresh()}),l.bindAction(107,!0,"zoomIn"),l.bindAction(109,!0,"zoomOut"),l.bindAction(80,!0,"print"),l.bindAction(79,!0,"outline",!0),l.bindAction(112,!1,"about"),this.editor.chromeless&&!this.editor.editable||(l.bindControlKey(36,function(){p.isEnabled()&&p.foldCells(!0)}),l.bindControlKey(35,function(){p.isEnabled()&&p.foldCells(!1)}),l.bindControlKey(13,function(){p.isEnabled()&&p.setSelectionCells(p.duplicateCells(p.getSelectionCells(),!1))}),l.bindAction(46,!1,"delete"),l.bindAction(46,!0,"deleteAll"),l.bindAction(72,!0,"resetView"),l.bindAction(72,!0,"fitWindow",!0),l.bindAction(74,!0,"fitPage"),l.bindAction(74,!0,"fitTwoPages",!0),l.bindAction(48,!0,"customZoom"),l.bindAction(82,!0,"turn"),l.bindAction(82,!0,"clearDefaultStyle",!0),l.bindAction(83,!0,"save"),l.bindAction(83,!0,"saveAs",!0),l.bindAction(65,!0,"selectAll"),l.bindAction(65,!0,"selectNone",!0),l.bindAction(73,!0,"selectVertices",!0),l.bindAction(69,!0,"selectEdges",!0),l.bindAction(69,!0,"editStyle"),l.bindAction(66,!0,"bold"),l.bindAction(66,!0,"toBack",!0),l.bindAction(70,!0,"toFront",!0),l.bindAction(68,!0,"setAsDefaultStyle",!0),l.bindAction(90,!0,"undo"),l.bindAction(89,!0,"autosize",!0),l.bindAction(88,!0,"cut"),l.bindAction(71,!0,"group"),l.bindAction(77,!0,"editData"),l.bindAction(71,!0,"grid",!0),l.bindAction(73,!0,"italic"),l.bindAction(76,!0,"lockUnlock"),l.bindAction(76,!0,"layers",!0),l.bindAction(80,!0,"formatPanel",!0),l.bindAction(85,!0,"underline"),l.bindAction(85,!0,"ungroup",!0),l.bindAction(190,!0,"superscript"),l.bindAction(188,!0,"subscript"),l.bindKey(13,function(){p.isEnabled()&&p.startEditingAtCell()}),l.bindKey(113,function(){p.isEnabled()&&p.startEditingAtCell()})),mxClient.IS_WIN?l.bindAction(89,!0,"redo"):l.bindAction(90,!0,"redo",!0),l},EditorUi.prototype.destroy=function(){if(null!=this.editor&&(this.editor.destroy(),this.editor=null),null!=this.menubar&&(this.menubar.destroy(),this.menubar=null),null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null),null!=this.sidebar&&(this.sidebar.destroy(),this.sidebar=null),null!=this.keyHandler&&(this.keyHandler.destroy(),this.keyHandler=null),null!=this.keydownHandler&&(mxEvent.removeListener(document,"keydown",this.keydownHandler),this.keydownHandler=null),null!=this.keyupHandler&&(mxEvent.removeListener(document,"keyup",this.keyupHandler),this.keyupHandler=null),null!=this.resizeHandler&&(mxEvent.removeListener(window,"resize",this.resizeHandler),this.resizeHandler=null),null!=this.gestureHandler&&(mxEvent.removeGestureListeners(document,this.gestureHandler),this.gestureHandler=null),null!=this.orientationChangeHandler&&(mxEvent.removeListener(window,"orientationchange",this.orientationChangeHandler),this.orientationChangeHandler=null),null!=this.scrollHandler&&(mxEvent.removeListener(window,"scroll",this.scrollHandler),this.scrollHandler=null),null!=this.destroyFunctions){for(var t=0;t<this.destroyFunctions.length;t++)this.destroyFunctions[t]();this.destroyFunctions=null}var e=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.footerContainer,this.chromelessToolbar,this.hsplit,this.sidebarFooterContainer,this.layersDialog];for(t=0;t<e.length;t++)null!=e[t]&&null!=e[t].parentNode&&e[t].parentNode.removeChild(e[t])};var initialData=function(t,e,n,i,o){var s=wfFree_getUrlParam("isReadOnlyModel")||"false";mxClient&&mxClient.IS_TOUCH&&"false"!=s?setCurrentMetaInitScale(e,i):(window.parent&&window.parent.getinitialScale||window.parent.cancelLoadingMask)&&window.parent.getinitialScale(1),mxClient&&mxClient.IS_FROMAUTO_DIRECT&&!o&&setTimeout(wf_windowClose,500)};function setCurrentMetaInitScale(t,e){t=e.minimumGraphSize?e.minimumGraphSize.width:t;var n=window.screen.width,i=(window.screen.height,n/t);(window.parent?window.parent.document:document).getElementsByTagName("meta").viewport;(window.parent&&window.parent.getinitialScale||window.parent.cancelLoadingMask)&&window.parent.getinitialScale(i)}function wf_windowClose(){var t=mxClient.labelMap||{};alert(t[21430]||"alertMsg");try{window.close()}catch(t){}try{window.parent.close()}catch(t){}}function wf_detectZoom(){var t=0,e=window.screen,n=navigator.userAgent.toLowerCase();return void 0!==window.devicePixelRatio?t=window.devicePixelRatio:~n.indexOf("msie")?e.deviceXDPI&&e.logicalXDPI&&(t=e.deviceXDPI/e.logicalXDPI):void 0!==window.outerWidth&&void 0!==window.innerWidth&&(t=window.outerWidth/window.innerWidth),t=t&&Math.round(100*t)}function Dialog(e,n,i,o,t,s,l,r){var a=0;mxClient.IS_VML&&(null==document.documentMode||document.documentMode<8)&&(a=80);var h=i+=a,d=o+=a,u=0<document.documentElement.clientHeight?document.documentElement.clientHeight:Math.max(document.body.clientHeight||0,document.documentElement.clientHeight),p=Math.max(1,Math.round((document.body.clientWidth-i-64)/2)),m=Math.max(1,Math.round((u-o-e.footerHeight)/3));mxClient.IS_QUIRKS||(n.style.maxHeight="100%"),i=Math.min(i,document.body.scrollWidth-64),o=Math.min(o,u-64),0<e.dialogs.length&&(this.zIndex+=2*e.dialogs.length),null==this.bg&&(this.bg=e.createDiv("background"),this.bg.style.position="absolute",this.bg.style.background=Dialog.backdropColor,this.bg.style.height=u+"px",this.bg.style.right="0px",this.bg.style.zIndex=this.zIndex-2,mxUtils.setOpacity(this.bg,this.bgOpacity),mxClient.IS_QUIRKS&&new mxDivResizer(this.bg));var c=mxUtils.getDocumentScrollOrigin(document);this.bg.style.left=c.x+"px",this.bg.style.top=c.y+"px",p+=c.x,m+=c.y,t&&document.body.appendChild(this.bg);var g=e.createDiv("geDialog"),x=this.getPosition(p,m,i,o);if(p=x.x,m=x.y,g.style.width=i+"px",g.style.height=o+"px",g.style.left=p+"px",g.style.top=m+"px",g.style.zIndex=this.zIndex,g.appendChild(n),document.body.appendChild(g),!r&&n.clientHeight>g.clientHeight-64&&(n.style.overflowY="auto"),s){var y=document.createElement("img");y.setAttribute("src",Dialog.prototype.closeImage),y.setAttribute("title",mxResources.get("close")),y.className="geDialogClose",y.style.top=m+14+"px",y.style.left=p+i+38-a+"px",y.style.zIndex=this.zIndex,mxEvent.addListener(y,"click",mxUtils.bind(this,function(){e.hideDialog(!0)})),document.body.appendChild(y),this.dialogImg=y,mxEvent.addGestureListeners(this.bg,null,null,mxUtils.bind(this,function(t){e.hideDialog(!0)}))}this.resizeListener=mxUtils.bind(this,function(){u=Math.max(document.body.clientHeight,document.documentElement.clientHeight),this.bg.style.height=u+"px",p=Math.max(1,Math.round((document.body.clientWidth-i-64)/2)),m=Math.max(1,Math.round((u-o-e.footerHeight)/3)),i=Math.min(h,document.body.scrollWidth-64),o=Math.min(d,u-64);var t=this.getPosition(p,m,i,o);p=t.x,m=t.y,g.style.left=p+"px",g.style.top=m+"px",g.style.width=i+"px",g.style.height=o+"px",!r&&n.clientHeight>g.clientHeight-64&&(n.style.overflowY="auto"),null!=this.dialogImg&&(this.dialogImg.style.top=m+14+"px",this.dialogImg.style.left=p+i+38-a+"px")}),mxEvent.addListener(window,"resize",this.resizeListener),this.onDialogClose=l,this.container=g,e.editor.fireEvent(new mxEventObject("showDialog"))}Editor=function(t,e,n,i,o){mxEventSource.call(this),this.chromeless=null!=t?t:this.chromeless,this.initStencilRegistry(),this.graph=i||this.createGraph(e,n),this.editable=null!=o?o:!t,this.undoManager=this.createUndoManager(),this.status="",this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[Editor.pageCounter])+".xml"},this.getFilename=function(){return this.filename},this.setStatus=function(t){this.status=t,this.fireEvent(new mxEventObject("statusChanged"))},this.getStatus=function(){return this.status},this.graphChangeListener=function(t,e){var n=null!=e?e.getProperty("edit"):null;null!=n&&n.ignoreEdit||this.setModified(!0)},this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)})),this.graph.resetViewOnRootChange=!1,this.init()},Editor.pageCounter=0,function(){try{for(var t=window;null!=t.opener&&void 0!==t.opener.Editor&&!isNaN(t.opener.Editor.pageCounter)&&t.opener!=t;)t=t.opener;null!=t&&(t.Editor.pageCounter++,Editor.pageCounter=t.Editor.pageCounter)}catch(t){}}(),Editor.useLocalStorage="undefined"!=typeof Storage&&mxClient.IS_IOS,Editor.helpImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAXVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC5BxTwAAAAH3RSTlMAlUF8boNQIE0LBgOgkGlHNSwqFIx/dGVUOjApmV9ezNACSAAAAIVJREFUGNNtjNsOgzAMQ5NeoVcKDAZs+//PXLKI8YKlWvaRU7jXuFpb9qsbdK05XILUiE8JHQox1Pv3OgFUzf1AGqWqUg+QBwLF0YAeegBlCNgRWOpB5vUfTCmeoHQ/wNdy0jLH/cM+b+wLTw4n/7ACEmHVVy8h6qy8V7MNcGowWpsNbvUFcGUEdSi1s/oAAAAASUVORK5CYII=":IMAGE_PATH+"/help.png",Editor.checkmarkImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhFQAVAMQfAGxsbHx8fIqKioaGhvb29nJycvr6+sDAwJqamltbW5OTk+np6YGBgeTk5Ly8vJiYmP39/fLy8qWlpa6ursjIyOLi4vj4+N/f3+3t7fT09LCwsHZ2dubm5r6+vmZmZv///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OEY4NTZERTQ5QUFBMTFFMUE5MTVDOTM5MUZGMTE3M0QiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OEY4NTZERTU5QUFBMTFFMUE5MTVDOTM5MUZGMTE3M0QiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4Rjg1NkRFMjlBQUExMUUxQTkxNUM5MzkxRkYxMTczRCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4Rjg1NkRFMzlBQUExMUUxQTkxNUM5MzkxRkYxMTczRCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAB8ALAAAAAAVABUAAAVI4CeOZGmeaKqubKtylktSgCOLRyLd3+QJEJnh4VHcMoOfYQXQLBcBD4PA6ngGlIInEHEhPOANRkaIFhq8SuHCE1Hb8Lh8LgsBADs=":IMAGE_PATH+"/checkmark.gif",Editor.maximizeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVBAMAAABbObilAAAAElBMVEUAAAAAAAAAAAAAAAAAAAAAAADgKxmiAAAABXRSTlMA758vX1Pw3BoAAABJSURBVAjXY8AJQkODGBhUQ0MhbAUGBiYY24CBgRnGFmZgMISwgwwDGRhEhVVBbAVmEQYGRwMmBjIAQi/CTIRd6G5AuA3dzYQBAHj0EFdHkvV4AAAAAElFTkSuQmCC",Editor.zoomOutImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVBAMAAABbObilAAAAElBMVEUAAAAAAAAsLCxxcXEhISFgYGChjTUxAAAAAXRSTlMAQObYZgAAAEdJREFUCNdjIAMwCQrB2YKCggJQJqMwA7MglK1owMBgqABVApITgLJZXFxgbIQ4Qj3CHIT5ggoIe5kgNkM1KSDYKBKqxPkDAPo5BAZBE54hAAAAAElFTkSuQmCC",Editor.zoomInImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVBAMAAABbObilAAAAElBMVEUAAAAAAAAsLCwhISFxcXFgYGBavKaoAAAAAXRSTlMAQObYZgAAAElJREFUCNdjIAMwCQrB2YKCggJQJqMIA4sglK3owMzgqABVwsDMwCgAZTMbG8PYCHGEeoQ5CPMFFRD2MkFshmpSQLBRJFSJ8wcAEqcEM2uhl2MAAAAASUVORK5CYII=",Editor.zoomFitImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVBAMAAABbObilAAAAD1BMVEUAAAAAAAAwMDBwcHBgYGC1xl09AAAAAXRSTlMAQObYZgAAAEFJREFUCNdjIAMwCQrB2YKCggJQJqMwA7MglK1owMBgqABVApITwMdGqEeYgzBfUAFhLxPEZqgmBQQbRUKFOH8AAK5OA3lA+FFOAAAAAElFTkSuQmCC",Editor.layersImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAAaVBMVEUAAAAgICAICAgdHR0PDw8WFhYICAgLCwsXFxcvLy8ODg4uLi4iIiIqKiokJCQYGBgKCgonJycFBQUCAgIqKiocHBwcHBwODg4eHh4cHBwnJycJCQkUFBQqKiojIyMuLi4ZGRkgICAEBATOWYXAAAAAGnRSTlMAD7+fnz8/H7/ff18/77+vr5+fn39/b28fH2xSoKsAAACQSURBVBjTrYxJEsMgDARZZMAY73sgCcn/HxnhKtnk7j6oRq0psfuoyndZ/SuODkHPLzfVT6KeyPePnJ7KrnkRjWMXTn4SMnN8mXe2SSM3ts8L/ZUxxrbAULSYJJULE0Iw9pjpenoICcgcX61mGgTgtCv9Be99pzCoDhNQWQnchD1mup5++CYGcoQexajZbfwAj/0MD8ZOaUgAAAAASUVORK5CYII=",Editor.previousImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAAAh0lEQVQ4je3UsQnCUBCA4U8hpa1NsoEjpHQJS0dxADdwEMuMIJkgA1hYChbGQgMi+JC8q4L/AB/vDu7x74cWWEZhJU44RmA1zujR5GIbXF9YNrjD/Q0bDRY4fEBZ4P4LlgTnCbAf84pUM8/9hY08tMUtEoQ1LpEgrNBFglChFXR6Q6GfwwR6AGKJMF74Vtt3AAAAAElFTkSuQmCC",Editor.nextImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAAAi0lEQVQ4jeXUIQ7CUAwA0MeGxWI2yylwnALJUdBcgYvM7QYLmjOQIAkIPmJZghiIvypoUtX0tfnJL38X5ZfaEgUeUcManFBHgS0SLlhHggk3bCPBhCf2keCQR8wjwYTDp6YiZxJmOU1jGw7vGALescuBxsArNlOwd/CM1VSM/ut1qCIw+uOwiMJ+OF4CQzBCXm3hyAAAAABJRU5ErkJggg==",Editor.editImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCwALAIABAFdXV////yH5BAEAAAEALAAAAAALAAsAAAIZjB8AiKuc4jvLOGqzrjX6zmkWyChXaUJBAQA7":IMAGE_PATH+"/edit.gif",Editor.zoomOutLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAilBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////2N2iNAAAALXRSTlMA+vTcKMM96GRBHwXxi0YaX1HLrKWhiHpWEOnOr52Vb2xKSDcT19PKv5l/Ngdk8+viAAABJklEQVQ4y4WT2XaDMAxEvWD2nSSUNEnTJN3r//+9Sj7ILAY6L0ijC4ONYVZRpo6cByrz2YKSUGorGTpz71lPVHvT+avoB5wIkU/mxk8veceSuNoLg44IzziXjvpih72wKQnm8yc2UoiP/LAd8jQfe2Xf4Pq+2EyYIvv9wbzHHCgwxDdlBtWZOdqDfTCVgqpygQpsZaojVAVc9UjQxnAJDIBhiQv84tq3gMQCAVTxVoSibXJf8tMuc7e1TB/DCmejBNg/w1Y3c+AM5vv4w7xM59/oXamrHaLVqPQ+OTCnmMZxgz0SdL5zji0/ld6j88qGa5KIiBB6WeJGKfUKwSMKLuXgvl1TW0tm5R9UQL/efSDYsnzxD8CinhBsTTdugJatKpJwf8v+ADb8QmvW7AeAAAAAAElFTkSuQmCC",Editor.zoomInLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAilBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////2N2iNAAAALXRSTlMA+vTcKMM96GRBHwXxi0YaX1HLrKWhiHpWEOnOr52Vb2xKSDcT19PKv5l/Ngdk8+viAAABKElEQVQ4y4WT6WKCMBCENwkBwn2oFKvWqr3L+79es4EkQIDOH2d3Pxk2ABiJlB8JCXjqw4LikHVGLHTm3nM3UeVN5690GBBN0GwyV/3kkrUQR+WeKnREeKpzaXWd77CmJiXGfPIEI4V4yQ9TIW/ntlcMBe731Vts9w5TWG8F5j3mQI4hvrKpdGeYA7CX9qAcl650gVJartxRuhyHVghF8idQAIbFLvCLu28BsQEC6aKtCK6Pyb3JT7PmbmtNH8Ny56CotD/2qOs5cJbuffxgXmCib+xddVU5RNOhkvvkhTlFehzVWCOh3++MYElOhfdovaImnRYVmqDdsuhNp1QrBBE6uGC2+3ZNjGdg5B94oD+9uyVgWT79BwAxEBTWdOu3bWBVgsn/N/AHUD9IC01Oe40AAAAASUVORK5CYII=",Editor.actualSizeLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAilBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////2N2iNAAAALXRSTlMA+vTcKMM96GRBHwXxi0YaX1HLrKWhiHpWEOnOr52Vb2xKSDcT19PKv5l/Ngdk8+viAAABIUlEQVQ4y4WT2XqDIBCFBxDc9yTWNEnTJN3r+79eGT4BEbXnaubMr8dBBaM450dCQp4LWFAascGIRd48eB4cNYE7f6XjgGiCFs5c+dml6CFN6j1V6IQIlHPpdV/usKcmJcV88gQTRXjLD9Mhb+fWq8YG9/uCmTCFjeeDeY85UGKIUGUuqzN42kv7oCouq9oHamlzVR1lVfpAIu1QVRiW+sAv7r4FpAYIZZVsRXB9TP5Dfpo1d1trCgzz1iiptH/sUbdz4CzN9+mLeXHn3+hdddd4RDegsrvzwZwSs2GLPRJidAqCLTlVwaMPqpYMWjTWBB2WRW86pVkhSKyDK2bdt2tmagZG4sBD/evdLQHLEvQfAOKRoLCmG1FAB6uKmby+gz+REDn7O5+EwQAAAABJRU5ErkJggg==",Editor.printLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAXVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9RKvvlAAAAHnRSTlMAydnl77qbMLT093H7K4Nd4Ktn082+lYt5bkklEgP44nQSAAAApUlEQVQ4y73P2Q6DIBRF0cOgbRHHzhP//5m9mBAQKjG1cT0Yc7ITAMu1LNQgUZiQ2DYoNQ0sCQb6qgHAfRx48opq3J9AZ6xuF7uOew8Ik1OsCZRS2UAC9V+D9a+QZYxNA45YFQftPtSkATOhw7dAc0vPBwKWiIOjP0JZ0yMuQJ27g36DipOUsqRAM0dR8KD1/ILHaHSE/w8DIx09E3g/BTce6rHUB5sAPKvfF+JdAAAAAElFTkSuQmCC",Editor.layersLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAmVBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+/v7///+bnZkkAAAAMnRSTlMABPr8ByiD88KsTi/rvJb272mjeUA1CuPe1M/KjVxYHxMP6KZ0S9nYzGRGGRaznpGIbzaGUf0AAAHESURBVDjLbZLZYoIwEEVDgLCjbKIgAlqXqt3m/z+uNwu1rcyDhjl3ktnYL7OY254C0VX3yWFZfzDrOClbbgKxi0YDHjwl4jbnRkXxJS/C1YP3DbBhD1n7Ex4uaAqdVDb3yJ/4J/3nJD2to/ngQz/DfUvzMp4JJ5sSCaF5oXmemgQDfDxzbi+Kq4sU+vNcuAmx94JtyOP2DD4Epz2asWSCz4Z/4fECxyNj9zC9xNLHcdPEO+awDKeSaUu0W4twZQiO2hYVisTR3RCtK/c1X6t4xMEpiGqXqVntEBLolkZZsKY4QtwH6jzq67dEHlJysB1aNOD3XT7n1UkasQN59L4yC2RELMDSeCRtz3yV22Ub3ozIUTknYx8JWqDdQxbUes98cR2kZtUSveF/bAhcedwEWmlxIkpZUy4XOCb6VBjjxHvbwo/1lBAHHi2JCr0NI570QhyHq/DhJoE2lLgyA4RVe6KmZ47O/3b86MCP0HWa73A8/C3SUc5Qc1ajt6fgpXJ+RGpMvDSchepZDOOQRcZVIKcK90x2D7etqtI+56+u6n3sPriO6nfphitR4+O2m3EbM7lh3me1FM1o+LMI887rN+s3/wZdTFlpNVJiOAAAAABJRU5ErkJggg==",Editor.closeLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAUVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////8IN+deAAAAGnRSTlMAuvAIg/dDM/QlOeuFhj0S5s4vKgzjxJRQNiLSey0AAADNSURBVDjLfZLbEoMgDEQjRRRs1XqX///QNmOHJSnjPkHOGR7IEmeoGtJZstnwjqbRfIsmgEdtPCqe9Ynz7ZSc07rE2QiSc+qv8TvjRXA2PDUm3dpe82iJhOEUfxJJo3aCv+jKmRmH4lcCjCjeh9GWOdL/GZZkXH3PYYDrHBnfc4D/RVZf5sjoC1was+Y6HQxwaUxFvq/a0Pv343VCTxfBSRiB+ab3M3eiQZXmMNBJ3Y8pGRZtYQ7DgHMXJEdPLTaN/qBjzJOBc3nmNcbsA16bMR0oLqf+AAAAAElFTkSuQmCC",Editor.editLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAgVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9d3yJTAAAAKnRSTlMA+hzi3nRQWyXzkm0h2j3u54gzEgSXjlYoTBgJxL2loGpAOS3Jt7Wxm35Ga7gRAAAA6UlEQVQ4y63Q2XaCMBSF4Q0JBasoQ5DJqbXjfv8HbCK2BZNwo/8FXHx7rcMC7lQu0iX8qU/qtvAWCpoqH8dYzS0SwaV5eK/UAf8X9pd2CWKzuF5Jrftp1owXwnIGLUaL3PYndOHf4kNNXWrXK/m7CHunk7K8LE6YtBpcknwG9GKxnroY+ylBXcx4xKyx/u/EuXi509cP9V7OO1oyHnzrdFTcqLG/4ibBA5pIMr/4xvKzuQDkVy9wW8SgBFD6HDvuzMvrZcC9QlkfMzI7w64m+b4PqBMNHB05lH21PVxJo2/fBXxV4hB38PcD+5AkI4FuETsAAAAASUVORK5CYII=",Editor.previousLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAPFBMVEUAAAD////////////////////////////////////////////////////////////////////////////YSWgTAAAAE3RSTlMA7fci493c0MW8uJ6CZks4MxQHEZL6ewAAAFZJREFUOMvdkskRgDAMA4lDwg2B7b9XOlge/KKvdsa25KFb5XlRvxXC/DNBEv8IFNjBgGdDgXtFgTyhwDXiQAUHCvwa4Uv6mR6UR+1led2mVonvl+tML45qCQNQLIx7AAAAAElFTkSuQmCC",Editor.nextLargeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAPFBMVEUAAAD////////////////////////////////////////////////////////////////////////////YSWgTAAAAE3RSTlMA7fci493c0MW8uJ6CZks4MxQHEZL6ewAAAFRJREFUOMvd0skRgCAQBVEFwQ0V7fxzNQP6wI05v6pZ/kyj1b7FNgik2gQzzLcAwiUAigHOTwDHK4A1CmB5BJANJG1hQ9qafYcqFlZP3IFc9eVGrR+iIgkDQRUXIAAAAABJRU5ErkJggg==",Editor.ctrlKey=mxClient.IS_MAC?"Cmd":"Ctrl",Editor.popupsAllowed=!0,mxUtils.extend(Editor,mxEventSource),Editor.prototype.originalNoForeignObject=mxClient.NO_FO,Editor.prototype.transparentImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhMAAwAIAAAP///wAAACH5BAEAAAAALAAAAAAwADAAAAIxhI+py+0Po5y02ouz3rz7D4biSJbmiabqyrbuC8fyTNf2jef6zvf+DwwKh8Si8egpAAA7":IMAGE_PATH+"/transparent.gif",Editor.prototype.extendCanvas=!0,Editor.prototype.chromeless=!1,Editor.prototype.cancelFirst=!0,Editor.prototype.enabled=!0,Editor.prototype.filename=null,Editor.prototype.modified=!1,Editor.prototype.autosave=!0,Editor.prototype.initialTopSpacing=0,Editor.prototype.appName=document.title,Editor.prototype.editBlankUrl=window.location.protocol+"//"+window.location.host+"/",Editor.prototype.init=function(){},Editor.prototype.isChromelessView=function(){return this.chromeless},Editor.prototype.setAutosave=function(t){this.autosave=t,this.fireEvent(new mxEventObject("autosaveChanged"))},Editor.prototype.getEditBlankUrl=function(t){return this.editBlankUrl+t},Editor.prototype.editAsNew=function(e,t){var n=null!=t?"?title="+encodeURIComponent(t):"";null!=urlParams.ui&&(n+=(0<n.length?"&":"?")+"ui="+urlParams.ui),null==this.editorWindow||this.editorWindow.closed?void 0!==window.postMessage&&(null==document.documentMode||10<=document.documentMode)?(null==this.editorWindow&&mxEvent.addListener(window,"message",mxUtils.bind(this,function(t){"ready"==t.data&&t.source==this.editorWindow&&this.editorWindow.postMessage(e,"*")})),this.editorWindow=this.graph.openLink(this.getEditBlankUrl(n+(0<n.length?"&":"?")+"client=1"))):this.editorWindow=this.graph.openLink(this.getEditBlankUrl(n)+"#R"+encodeURIComponent(e)):this.editorWindow.focus()},Editor.prototype.createGraph=function(t,e){var n=new Graph(null,e,null,null,t);return n.transparentBackground=!1,this.chromeless||(n.isBlankLink=function(t){return!this.isExternalProtocol(t)}),n},Editor.prototype.resetGraph=function(){this.graph.gridEnabled=!this.isChromelessView()||"1"==urlParams.grid,this.graph.graphHandler.guidesEnabled=!0,this.graph.setTooltips(!0),this.graph.setConnectable(!0),this.graph.foldingEnabled=!0,this.graph.scrollbars=this.graph.defaultScrollbars,this.graph.pageVisible=this.graph.defaultPageVisible,this.graph.pageBreaksVisible=this.graph.pageVisible,this.graph.preferPageSize=this.graph.pageBreaksVisible,this.graph.background=this.graph.defaultGraphBackground,this.graph.pageScale=mxGraph.prototype.pageScale,this.graph.pageFormat=mxGraph.prototype.pageFormat,this.graph.currentScale=1,this.graph.currentTranslate.x=0,this.graph.currentTranslate.y=0,this.updateGraphComponents(),this.graph.view.setScale(1)},Editor.prototype.readGraphState=function(t){this.graph.gridEnabled="0"!=t.getAttribute("grid")&&(!this.isChromelessView()||"1"==urlParams.grid),this.graph.gridSize=parseFloat(t.getAttribute("gridSize"))||mxGraph.prototype.gridSize,this.graph.graphHandler.guidesEnabled="0"!=t.getAttribute("guides"),this.graph.setTooltips("0"!=t.getAttribute("tooltips")),this.graph.setConnectable("0"!=t.getAttribute("connect")),this.graph.connectionArrowsEnabled="0"!=t.getAttribute("arrows"),this.graph.foldingEnabled="0"!=t.getAttribute("fold"),this.isChromelessView()&&this.graph.foldingEnabled&&(this.graph.foldingEnabled="1"==urlParams.nav,this.graph.cellRenderer.forceControlClickHandler=this.graph.foldingEnabled);var e=t.getAttribute("pageScale");if(this.graph.pageScale=null!=e?e:mxGraph.prototype.pageScale,this.graph.isLightboxView())this.graph.pageVisible=!1;else{var n=t.getAttribute("page");this.graph.pageVisible=null!=n?"0"!=n:this.graph.defaultPageVisible}this.graph.pageBreaksVisible=this.graph.pageVisible,this.graph.preferPageSize=this.graph.pageBreaksVisible;var i=t.getAttribute("pageWidth"),o=t.getAttribute("pageHeight");null!=i&&null!=o&&(this.graph.pageFormat=new mxRectangle(0,0,parseFloat(i),parseFloat(o)));var s=t.getAttribute("background");null!=s&&0<s.length?this.graph.background=s:this.graph.background=this.graph.defaultGraphBackground},Editor.prototype.setGraphXml=function(t){if(null!=t){var e=new mxCodec(t.ownerDocument);if("mxGraphModel"==t.nodeName){this.graph.model.beginUpdate();try{this.graph.model.clear(),this.graph.view.scale=1,this.readGraphState(t),this.updateGraphComponents(),e.decode(t,this.graph.getModel())}finally{this.graph.model.endUpdate()}this.fireEvent(new mxEventObject("resetGraphView"))}else{if("root"!=t.nodeName)throw{message:mxResources.get("cannotOpenFile"),node:t,toString:function(){return this.message}};this.resetGraph();var n=e.document.createElement("mxGraphModel");n.appendChild(t),e.decode(n,this.graph.getModel()),this.updateGraphComponents(),this.fireEvent(new mxEventObject("resetGraphView"))}}else this.resetGraph(),this.graph.model.clear(),this.fireEvent(new mxEventObject("resetGraphView"))},Editor.prototype.getGraphXml=function(t){var e=null;(t=null==t||t)?e=new mxCodec(mxUtils.createXmlDocument()).encode(this.graph.getModel()):e=this.graph.encodeCells(mxUtils.sortCells(this.graph.model.getTopmostCells(this.graph.getSelectionCells())));return 0==this.graph.view.translate.x&&0==this.graph.view.translate.y||(e.setAttribute("dx",Math.round(100*this.graph.view.translate.x)/100),e.setAttribute("dy",Math.round(100*this.graph.view.translate.y)/100)),e.setAttribute("grid",this.graph.isGridEnabled()?"1":"0"),e.setAttribute("gridSize",this.graph.gridSize),e.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0"),e.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0"),e.setAttribute("connect",this.graph.connectionHandler.isEnabled()?"1":"0"),e.setAttribute("arrows",this.graph.connectionArrowsEnabled?"1":"0"),e.setAttribute("fold",this.graph.foldingEnabled?"1":"0"),e.setAttribute("page",this.graph.pageVisible?"1":"0"),e.setAttribute("pageScale",this.graph.pageScale),e.setAttribute("pageWidth",this.graph.pageFormat.width),e.setAttribute("pageHeight",this.graph.pageFormat.height),null!=this.graph.background&&e.setAttribute("background",this.graph.background),e},Editor.prototype.updateGraphComponents=function(){var t=this.graph;null!=t.container&&(t.view.validateBackground(),t.container.style.overflow="auto",this.fireEvent(new mxEventObject("updateGraphComponents")))},Editor.prototype.setModified=function(t){this.modified=t},Editor.prototype.setFilename=function(t){this.filename=t},Editor.prototype.createUndoManager=function(){var l=this.graph,n=new mxUndoManager;this.undoListener=function(t,e){n.undoableEditHappened(e.getProperty("edit"))};var t=mxUtils.bind(this,function(t,e){this.undoListener.apply(this,arguments)});l.getModel().addListener(mxEvent.UNDO,t),l.getView().addListener(mxEvent.UNDO,t);function e(t,e){for(var n=l.getSelectionCellsForChanges(e.getProperty("edit").changes),i=l.getModel(),o=[],s=0;s<n.length;s++)(i.isVertex(n[s])||i.isEdge(n[s]))&&null!=l.view.getState(n[s])&&o.push(n[s])}return n.addListener(mxEvent.UNDO,e),n.addListener(mxEvent.REDO,e),n},Editor.prototype.initStencilRegistry=function(){},Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)},OpenFile=function(t){this.producer=null,this.consumer=null,this.done=t,this.args=null},OpenFile.prototype.setConsumer=function(t){this.consumer=t,this.execute()},OpenFile.prototype.setData=function(){this.args=arguments,this.execute()},OpenFile.prototype.error=function(t){this.cancel(!0),mxUtils.alert(t)},OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.args&&(this.cancel(!1),this.consumer.apply(this,this.args))},OpenFile.prototype.cancel=function(t){null!=this.done&&this.done(null==t||t)},Dialog.backdropColor="white",Dialog.prototype.zIndex=mxPopupMenu.prototype.zIndex-1,Dialog.prototype.noColorImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC":IMAGE_PATH+"/nocolor.png",Dialog.prototype.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAQMAAADaX5RTAAAABlBMVEV7mr3///+wksspAAAAAnRSTlP/AOW3MEoAAAAdSURBVAgdY9jXwCDDwNDRwHCwgeExmASygSL7GgB12QiqNHZZIwAAAABJRU5ErkJggg==":IMAGE_PATH+"/close.png",Dialog.prototype.clearImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQAKAIABAMDAwP///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OUIzOEM1NzI4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUIzOEM1NzM4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5QjM4QzU3MDg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5QjM4QzU3MTg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAAEALAAAAAANAAoAAAIXTGCJebD9jEOTqRlttXdrB32PJ2ncyRQAOw==":IMAGE_PATH+"/clear.gif",Dialog.prototype.lockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzdDMDZCODExNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzdDMDZCODIxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDozN0MwNkI3RjE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDozN0MwNkI4MDE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvqMCFYAAAAVUExURZmZmb+/v7KysqysrMzMzLGxsf///4g8N1cAAAAHdFJOU////////wAaSwNGAAAAPElEQVR42lTMQQ4AIQgEwUa0//9kTQirOweYOgDqAMbZUr10AGlAwx4/BJ2QJ4U0L5brYjovvpv32xZgAHZaATFtMbu4AAAAAElFTkSuQmCC":IMAGE_PATH+"/locked.png",Dialog.prototype.unlockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzdDMDZCN0QxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzdDMDZCN0UxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDozN0MwNkI3QjE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDozN0MwNkI3QzE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkKMpVwAAAAYUExURZmZmbKysr+/v6ysrOXl5czMzLGxsf///zHN5lwAAAAIdFJOU/////////8A3oO9WQAAADxJREFUeNpUzFESACAEBNBVsfe/cZJU+8Mzs8CIABCidtfGOndnYsT40HDSiCcbPdoJo10o9aI677cpwACRoAF3dFNlswAAAABJRU5ErkJggg==":IMAGE_PATH+"/unlocked.png",Dialog.prototype.bgOpacity=80,Dialog.prototype.getPosition=function(t,e){return new mxPoint(t,e)},Dialog.prototype.close=function(t){null!=this.onDialogClose&&(this.onDialogClose(t),this.onDialogClose=null),null!=this.dialogImg&&(this.dialogImg.parentNode.removeChild(this.dialogImg),this.dialogImg=null),null!=this.bg&&null!=this.bg.parentNode&&this.bg.parentNode.removeChild(this.bg),mxEvent.removeListener(window,"resize",this.resizeListener),this.container.parentNode.removeChild(this.container)};var PrintDialog=function(t,e){this.create(t,e)};PrintDialog.prototype.create=function(t){var e,n,d=t.editor.graph,i=document.createElement("table");i.style.width="100%",i.style.height="100%";var o=document.createElement("tbody");e=document.createElement("tr");var u=document.createElement("input");u.setAttribute("type","checkbox"),(n=document.createElement("td")).setAttribute("colspan","2"),n.style.fontSize="10pt",n.appendChild(u);var s=document.createElement("span");mxUtils.write(s," "+mxResources.get("fitPage")),n.appendChild(s),mxEvent.addListener(s,"click",function(t){u.checked=!u.checked,p.checked=!u.checked,mxEvent.consume(t)}),mxEvent.addListener(u,"change",function(){p.checked=!u.checked}),e.appendChild(n),o.appendChild(e),e=e.cloneNode(!1);var p=document.createElement("input");p.setAttribute("type","checkbox"),(n=document.createElement("td")).style.fontSize="10pt",n.appendChild(p);s=document.createElement("span");mxUtils.write(s," "+mxResources.get("posterPrint")+":"),n.appendChild(s),mxEvent.addListener(s,"click",function(t){p.checked=!p.checked,u.checked=!p.checked,mxEvent.consume(t)}),e.appendChild(n);var m=document.createElement("input");m.setAttribute("value","1"),m.setAttribute("type","number"),m.setAttribute("min","1"),m.setAttribute("size","4"),m.setAttribute("disabled","disabled"),m.style.width="50px",(n=document.createElement("td")).style.fontSize="10pt",n.appendChild(m),mxUtils.write(n," "+mxResources.get("pages")+" (max)"),e.appendChild(n),o.appendChild(e),mxEvent.addListener(p,"change",function(){p.checked?m.removeAttribute("disabled"):m.setAttribute("disabled","disabled"),u.checked=!p.checked}),e=e.cloneNode(!1),n=document.createElement("td"),mxUtils.write(n,mxResources.get("pageScale")+":"),e.appendChild(n),n=document.createElement("td");var c=document.createElement("input");function l(t){var e=u.checked||p.checked,n=parseInt(c.value)/100;isNaN(n)&&(n=1,c.value="100%"),n*=.75;var i=d.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,o=1/d.pageScale;if(e){var s=u.checked?1:parseInt(m.value);isNaN(s)||(o=mxUtils.getScaleForPageCount(s,d,i))}d.getGraphBounds();var l=0,r=0;if((i=mxRectangle.fromRectangle(i)).width=Math.ceil(i.width*n),i.height=Math.ceil(i.height*n),o*=n,!e&&d.pageVisible){var a=d.getPageLayout();l-=a.x*i.width,r-=a.y*i.height}else e=!0;var h=PrintDialog.createPrintPreview(d,o,i,0,l,r,e);h.open(),t&&PrintDialog.printPreview(h)}c.setAttribute("value","100 %"),c.setAttribute("size","5"),c.style.width="50px",n.appendChild(c),e.appendChild(n),o.appendChild(e),e=document.createElement("tr"),(n=document.createElement("td")).colSpan=2,n.style.paddingTop="20px",n.setAttribute("align","right");var r=mxUtils.button(mxResources.get("cancel"),function(){t.hideDialog()});if(r.className="geBtn",t.editor.cancelFirst&&n.appendChild(r),PrintDialog.previewEnabled){var a=mxUtils.button(mxResources.get("preview"),function(){t.hideDialog(),l(!1)});a.className="geBtn",n.appendChild(a)}var h=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){t.hideDialog(),l(!0)});h.className="geBtn gePrimaryBtn",n.appendChild(h),t.editor.cancelFirst||n.appendChild(r),e.appendChild(n),o.appendChild(e),i.appendChild(o),this.container=i},PrintDialog.printPreview=function(t){if(null!=t.wnd){function e(){t.wnd.focus(),t.wnd.print(),t.wnd.close()}mxClient.IS_GC?window.setTimeout(e,500):e()}},PrintDialog.createPrintPreview=function(t,e,n,i,o,s,l){var r=new mxPrintPreview(t,e,n,i,o,s);r.title=mxResources.get("preview"),r.printBackgroundImage=!0,r.autoOrigin=l;var a=t.background;null!=a&&""!=a&&a!=mxConstants.NONE||(a="#ffffff"),r.backgroundColor=a;var h=r.writeHead;return r.writeHead=function(t){h.apply(this,arguments),t.writeln('<style type="text/css">'),t.writeln("@media screen {"),t.writeln("  body > div { padding:30px;box-sizing:content-box; }"),t.writeln("}"),t.writeln("</style>")},r},PrintDialog.previewEnabled=!0;var PageSetupDialog=function(i){var t,e,o=i.editor.graph,n=document.createElement("table");n.style.width="100%",n.style.height="100%";var s=document.createElement("tbody");t=document.createElement("tr"),(e=document.createElement("td")).style.verticalAlign="top",e.style.fontSize="10pt",mxUtils.write(e,mxResources.get("paperSize")+":"),t.appendChild(e),(e=document.createElement("td")).style.verticalAlign="top",e.style.fontSize="10pt";var l=PageSetupDialog.addPageFormatPanel(e,"pagesetupdialog",o.pageFormat);t.appendChild(e),s.appendChild(t),t=document.createElement("tr"),e=document.createElement("td"),mxUtils.write(e,mxResources.get("background")+":"),t.appendChild(e),(e=document.createElement("td")).style.whiteSpace="nowrap",document.createElement("input").setAttribute("type","text");var r=document.createElement("button");r.style.width="18px",r.style.height="18px",r.style.marginRight="20px",r.style.backgroundPosition="center center",r.style.backgroundRepeat="no-repeat";var a=o.background;function h(){null==a||a==mxConstants.NONE?(r.style.backgroundColor="",r.style.backgroundImage="url('"+Dialog.prototype.noColorImage+"')"):(r.style.backgroundColor=a,r.style.backgroundImage="")}h(),mxEvent.addListener(r,"click",function(t){i.pickColor(a||"none",function(t){a=t,h()}),mxEvent.consume(t)}),e.appendChild(r),mxUtils.write(e,mxResources.get("gridSize")+":");var d=document.createElement("input");d.setAttribute("type","number"),d.setAttribute("min","0"),d.style.width="40px",d.style.marginLeft="6px",d.value=o.getGridSize(),e.appendChild(d),mxEvent.addListener(d,"change",function(){var t=parseInt(d.value);d.value=Math.max(1,isNaN(t)?o.getGridSize():t)}),t.appendChild(e),s.appendChild(t),t=document.createElement("tr"),e=document.createElement("td"),mxUtils.write(e,mxResources.get("image")+":"),t.appendChild(e),e=document.createElement("td");var u=document.createElement("a");u.style.textDecoration="underline",u.style.cursor="pointer",u.style.color="#a0a0a0";var p=o.backgroundImage;function m(){null==p?(u.removeAttribute("title"),u.style.fontSize="",u.innerHTML=mxResources.get("change")+"..."):(u.setAttribute("title",p.src),u.style.fontSize="11px",u.innerHTML=p.src.substring(0,42)+"...")}mxEvent.addListener(u,"click",function(t){i.showBackgroundImageDialog(function(t){p=t,m()}),mxEvent.consume(t)}),m(),e.appendChild(u),t.appendChild(e),s.appendChild(t),t=document.createElement("tr"),(e=document.createElement("td")).colSpan=2,e.style.paddingTop="16px",e.setAttribute("align","right");var c=mxUtils.button(mxResources.get("cancel"),function(){i.hideDialog()});c.className="geBtn",i.editor.cancelFirst&&e.appendChild(c);var g=mxUtils.button(mxResources.get("apply"),function(){i.hideDialog(),o.gridSize!==d.value&&o.setGridSize(parseInt(d.value));var t=new ChangePageSetup(i,a,p,l.get());t.ignoreColor=o.background==a;var e=null!=o.backgroundImage?o.backgroundImage.src:null,n=null!=p?p.src:null;t.ignoreImage=e===n,o.pageFormat.width==t.previousFormat.width&&o.pageFormat.height==t.previousFormat.height&&t.ignoreColor&&t.ignoreImage||o.model.execute(t)});g.className="geBtn gePrimaryBtn",e.appendChild(g),i.editor.cancelFirst||e.appendChild(c),t.appendChild(e),s.appendChild(t),n.appendChild(s),this.container=n},workflowUi;function Actions(t){this.editorUi=t,this.actions=new Object,this.init()}function Action(t,e,n,i,o){mxEventSource.call(this),this.label=t,this.funct=this.createFunction(e),this.enabled=null==n||n,this.iconCls=i,this.shortcut=o,this.visible=!0}function Menubar(t,e){this.editorUi=t,this.container=e}function Menu(t,e){mxEventSource.call(this),this.funct=t,this.enabled=null==e||e}function WfPanel(t,e){this.editorUi=t,workflowUi=t,this.container=e;var n=t.editor.graph;this.palettes=new Object,this.showTooltips=!1,this.graph=t.createTemporaryGraph(this.editorUi.editor.graph.getStylesheet()),this.graph.cellRenderer.antiAlias=!1,this.graph.foldingEnabled=!1,this.graph.container.style.visibility="hidden",document.body.appendChild(this.graph.container),this.init(),this.tipInfoDisplay="block",this.pointerUpHandler=mxUtils.bind(this,function(){this.showTooltips=!1}),this.pointerMoveHandler=mxUtils.bind(this,function(t){for(var e=mxEvent.getSource(t);null!=e;){if(e==this.currentElt)return;e=e.parentNode}this.hideTooltip()}),this.pointerDownHandler=mxUtils.bind(this,function(){this.showTooltips=!1,this.hideTooltip()}),this.pointerOutHandler=mxUtils.bind(this,function(t){null==t.toElement&&null==t.relatedTarget&&this.hideTooltip()}),mxEvent.addListener(e,"scroll",mxUtils.bind(this,function(){this.showTooltips=!1,this.hideTooltip()})),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerup":"mouseup",this.pointerUpHandler),mxEvent.addListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.pointerMoveHandler),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerdown":"mousedown",this.pointerDownHandler),mxEvent.addListener(document,mxClient.IS_POINTER?"pointerout":"mouseout",this.pointerOutHandler),this.update=mxUtils.bind(this,function(t,e){this.refresh(t,e)}),n.getSelectionModel().addListener(mxEvent.CHANGE,this.update),n.addListener(mxEvent.EDITING_STARTED,this.update),n.addListener(mxEvent.EDITING_STOPPED,this.update),n.getModel().addListener(mxEvent.CHANGE,this.update),n.addListener(mxEvent.ROOT,mxUtils.bind(this,function(){this.refresh()})),this.refresh()}function WfNodeInfo(t,e){var n=(this.editorUi=t).editor;this.container=e;var i=n.graph;this.preCells=null,this.nodePanelHide=!1,this.update=mxUtils.bind(this,function(t,e){this.clearSelectionState(),this.noNeedRefresh||this.refresh(),this.noNeedRefresh=!1}),i.getSelectionModel().addListener(mxEvent.CHANGE,this.update),i.addListener(mxEvent.EDITING_STARTED,this.update),i.addListener(mxEvent.EDITING_STOPPED,this.update),i.getModel().addListener(mxEvent.CHANGE,this.update),i.addListener(mxEvent.ROOT,mxUtils.bind(this,function(){this.refresh()})),this.refresh(),this.nodeNameRef=null}PageSetupDialog.addPageFormatPanel=function(t,e,l,o){var n="format-"+e,r=document.createElement("input");r.setAttribute("name",n),r.setAttribute("type","radio"),r.setAttribute("value","portrait");var a=document.createElement("input");a.setAttribute("name",n),a.setAttribute("type","radio"),a.setAttribute("value","landscape");var h=document.createElement("select");h.style.marginBottom="8px",h.style.width="202px";var d=document.createElement("div");d.style.marginLeft="4px",d.style.width="210px",d.style.height="24px",r.style.marginRight="6px",d.appendChild(r);var i=document.createElement("span");i.style.maxWidth="100px",mxUtils.write(i,mxResources.get("portrait")),d.appendChild(i),a.style.marginLeft="10px",a.style.marginRight="6px",d.appendChild(a);var s=document.createElement("span");s.style.width="100px",mxUtils.write(s,mxResources.get("landscape")),d.appendChild(s);var u=document.createElement("div");u.style.marginLeft="4px",u.style.width="210px",u.style.height="24px";var p=document.createElement("input");p.setAttribute("size","7"),p.style.textAlign="right",u.appendChild(p),mxUtils.write(u," in x ");var m=document.createElement("input");m.setAttribute("size","7"),m.style.textAlign="right",u.appendChild(m),mxUtils.write(u," in"),d.style.display="none",u.style.display="none";for(var c=new Object,g=PageSetupDialog.getFormats(),x=0;x<g.length;x++){var y=g[x];c[y.key]=y;var f=document.createElement("option");f.setAttribute("value",y.key),mxUtils.write(f,y.title),h.appendChild(f)}var v=!1;function C(t,e,n){if(n||p!=document.activeElement&&m!=document.activeElement){for(var i=!1,o=0;o<g.length;o++){var s=g[o];v?"custom"==s.key&&(h.value=s.key,v=!1):null!=s.format&&("a4"==s.key?826==l.width?(l=mxRectangle.fromRectangle(l)).width=827:826==l.height&&((l=mxRectangle.fromRectangle(l)).height=827):"a5"==s.key&&(584==l.width?(l=mxRectangle.fromRectangle(l)).width=583:584==l.height&&((l=mxRectangle.fromRectangle(l)).height=583)),l.width==s.format.width&&l.height==s.format.height?(h.value=s.key,r.setAttribute("checked","checked"),r.defaultChecked=!0,r.checked=!0,a.removeAttribute("checked"),a.defaultChecked=!1,i=!(a.checked=!1)):l.width==s.format.height&&l.height==s.format.width&&(h.value=s.key,r.removeAttribute("checked"),r.defaultChecked=!1,r.checked=!1,a.setAttribute("checked","checked"),a.defaultChecked=!0,i=a.checked=!0))}i?(d.style.display="",u.style.display="none"):(p.value=l.width/100,m.value=l.height/100,r.setAttribute("checked","checked"),h.value="custom",d.style.display="none",u.style.display="")}}C(),t.appendChild(h),mxUtils.br(t),t.appendChild(d),t.appendChild(u);function E(t,e){var n=c[h.value];null!=n.format?(p.value=n.format.width/100,m.value=n.format.height/100,u.style.display="none",d.style.display=""):(d.style.display="none",u.style.display=""),isNaN(parseFloat(p.value))&&(p.value=l.width/100),isNaN(parseFloat(m.value))&&(m.value=l.height/100);var i=new mxRectangle(0,0,Math.floor(100*parseFloat(p.value)),Math.floor(100*parseFloat(m.value)));"custom"!=h.value&&a.checked&&(i=new mxRectangle(0,0,i.height,i.width)),e&&v||i.width==w.width&&i.height==w.height||(w=i,null!=o&&o(w))}var w=l;return mxEvent.addListener(i,"click",function(t){r.checked=!0,E(),mxEvent.consume(t)}),mxEvent.addListener(s,"click",function(t){a.checked=!0,E(),mxEvent.consume(t)}),mxEvent.addListener(p,"blur",E),mxEvent.addListener(p,"click",E),mxEvent.addListener(m,"blur",E),mxEvent.addListener(m,"click",E),mxEvent.addListener(a,"change",E),mxEvent.addListener(r,"change",E),mxEvent.addListener(h,"change",function(t){v="custom"==h.value,E(0,!0)}),E(),{set:function(t){l=t,C(0,0,!0)},get:function(){return w},widthInput:p,heightInput:m}},PageSetupDialog.getFormats=function(){return[{key:"letter",title:'US-Letter (8,5" x 11")',format:mxConstants.PAGE_FORMAT_LETTER_PORTRAIT},{key:"legal",title:'US-Legal (8,5" x 14")',format:new mxRectangle(0,0,850,1400)},{key:"tabloid",title:"US-Tabloid (279 mm x 432 mm)",format:new mxRectangle(0,0,1100,1700)},{key:"a0",title:"A0 (841 mm x 1189 mm)",format:new mxRectangle(0,0,3300,4681)},{key:"a1",title:"A1 (594 mm x 841 mm)",format:new mxRectangle(0,0,2339,3300)},{key:"a2",title:"A2 (420 mm x 594 mm)",format:new mxRectangle(0,0,1654,2336)},{key:"a3",title:"A3 (297 mm x 420 mm)",format:new mxRectangle(0,0,1169,1654)},{key:"a4",title:"A4 (210 mm x 297 mm)",format:mxConstants.PAGE_FORMAT_A4_PORTRAIT},{key:"a5",title:"A5 (148 mm x 210 mm)",format:new mxRectangle(0,0,583,827)},{key:"a6",title:"A6 (105 mm x 148 mm)",format:new mxRectangle(0,0,413,583)},{key:"a7",title:"A7 (74 mm x 105 mm)",format:new mxRectangle(0,0,291,413)},{key:"custom",title:mxResources.get("custom"),format:null}]},function(){mxGraphView.prototype.validateBackgroundPage=function(){var e=this.graph;if(null!=e.container&&!e.transparentBackground){if(e.pageVisible){var t=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var n=e.container.firstChild;null!=n&&n.nodeType!=mxConstants.NODETYPE_ELEMENT;)n=n.nextSibling;null!=n&&(this.backgroundPageShape=this.createBackgroundPageShape(t),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!mxClient.IS_QUIRKS,this.backgroundPageShape.dialect=mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(e.container),n.style.position="absolute",e.container.insertBefore(this.backgroundPageShape.node,n),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(t){e.dblClick(t)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(t){e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t))}),mxUtils.bind(this,function(t){null!=e.tooltipHandler&&e.tooltipHandler.isHideOnHover()&&e.tooltipHandler.hide(),e.isMouseDown&&!mxEvent.isConsumed(t)&&e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t))}),mxUtils.bind(this,function(t){e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=t,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=null);this.validateBackgroundStyles()}},mxGraphView.prototype.validateBackgroundStyles=function(){var t=this.graph,e=null==t.background||t.background==mxConstants.NONE?t.defaultPageBackgroundColor:t.background,n=null!=e&&this.gridColor!=e.toLowerCase()?this.gridColor:"#ffffff",i="none",o="";if(t.isGridEnabled()){var s=10;mxClient.IS_SVG?(i=unescape(encodeURIComponent(this.createSvgGrid(n))),i=window.btoa?btoa(i):Base64.encode(i,!0),mxClient.IS_IE&&(i=i.replace(/-/g,"+")),i="url(data:image/svg+xml;base64,"+i+")",s=t.gridSize*this.scale*this.gridSteps):i="url("+this.gridImage+")";var l=0,r=0;if(null!=t.view.backgroundPageShape){var a=this.getBackgroundPageBounds();l=1+a.x,r=1+a.y}o=-Math.round(s-mxUtils.mod(this.translate.x*this.scale-l,s))+"px "+-Math.round(s-mxUtils.mod(this.translate.y*this.scale-r,s))+"px"}var h=t.view.canvas;if(null!=h.ownerSVGElement&&(h=h.ownerSVGElement),null!=t.view.backgroundPageShape?(t.view.backgroundPageShape.node.style.backgroundPosition=o,t.view.backgroundPageShape.node.style.backgroundImage=i,mxClient.IS_READONLY_FORM||(t.view.backgroundPageShape.node.style.backgroundColor=e),t.container.className="geDiagramContainer geDiagramBackdrop",h.style.backgroundImage="none",h.style.backgroundColor=""):(t.container.className="geDiagramContainer",h.style.backgroundPosition=o,h.style.backgroundColor=e,h.style.backgroundImage=i),t.isRuleEnabled())this.createBoundRules();else if(!t.isRuleEnabled()&&document.getElementById("wf-row-rule-canvas")){var d,u,p=workflowUi.wfPanelContainer;d=document.getElementById("wf-row-rule-canvas"),u=document.getElementById("wf-col-rule-canvas"),p.removeChild(d),p.removeChild(u)}},mxGraphView.prototype.createBoundRules=function(){var t,e,n=workflowUi.wfPanelContainer;this.graph,this.graph.gridSize,this.scale;document.getElementById("wf-row-rule-canvas")?(t=document.getElementById("wf-row-rule-canvas"),e=document.getElementById("wf-col-rule-canvas")):(t=document.createElement("canvas"),e=document.createElement("canvas"),t.id="wf-row-rule-canvas",e.id="wf-col-rule-canvas",n.appendChild(e),n.appendChild(t)),e.height=n.clientHeight,e.width=20,t.width=n.clientWidth,t.height=20;var i=t.getContext("2d"),o=e.getContext("2d");i.strokeStyle="#A9A9A9",i.moveTo(19.5,-.5),i.lineTo(19.5,19.5),i.stroke();for(var s=1,l=1,r=25;r<n.clientWidth;r+=5)i.moveTo(r-.5,19.5),s%5==0?i.lineTo(r-.5,-.5):i.lineTo(r-.5,11.5),i.stroke(),s++;o.strokeStyle="#A9A9A9",o.moveTo(-.5,-.5),o.lineTo(19.5,-.5),o.stroke();for(r=5;r<n.clientHeight;r+=5)o.moveTo(19.5,r-.5),l%5==0?o.lineTo(-.5,r-.5):o.lineTo(11.5,r-.5),o.stroke(),l++},mxGraphView.prototype.createSvgGrid=function(t){for(var e=this.graph.gridSize*this.scale;e<this.minGridSize;)e*=2;for(var n=this.gridSteps*e,i=[],o=1;o<this.gridSteps;o++){var s=o*e;i.push("M 0 "+s+" L "+n+" "+s+" M "+s+" 0 L "+s+" "+n)}return'<svg width="'+n+'" height="'+n+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+n+'" height="'+n+'" patternUnits="userSpaceOnUse"><path d="'+i.join(" ")+'" fill="none" stroke="'+t+'" opacity="0.2" stroke-width="1"/><path d="M '+n+" 0 L 0 0 0 "+n+'" fill="none" stroke="'+t+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var s=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(t,e){if(s.apply(this,arguments),null!=this.shiftPreview1){var n=this.view.canvas;null!=n.ownerSVGElement&&(n=n.ownerSVGElement);var i=this.gridSize*this.view.scale*this.view.gridSteps,o=-Math.round(i-mxUtils.mod(this.view.translate.x*this.view.scale+t,i))+"px "+-Math.round(i-mxUtils.mod(this.view.translate.y*this.view.scale+e,i))+"px";n.style.backgroundPosition=o}},mxGraph.prototype.updatePageBreaks=function(t,e,n){var i=this.view.scale,o=this.view.translate,s=this.pageFormat,l=i*this.pageScale,r=this.view.getBackgroundPageBounds();e=r.width,n=r.height;var a=new mxRectangle(i*o.x,i*o.y,s.width*l,s.height*l),h=(t=t&&Math.min(a.width,a.height)>this.minPageBreakDist)?Math.ceil(n/a.height)-1:0,d=t?Math.ceil(e/a.width)-1:0,u=r.x+e,p=r.y+n;null==this.horizontalPageBreaks&&0<h&&(this.horizontalPageBreaks=[]),null==this.verticalPageBreaks&&0<d&&(this.verticalPageBreaks=[]);mxUtils.bind(this,function(t){if(null!=t){for(var e=t==this.horizontalPageBreaks?h:d,n=0;n<=e;n++){var i=t==this.horizontalPageBreaks?[new mxPoint(Math.round(r.x),Math.round(r.y+(n+1)*a.height)),new mxPoint(Math.round(u),Math.round(r.y+(n+1)*a.height))]:[new mxPoint(Math.round(r.x+(n+1)*a.width),Math.round(r.y)),new mxPoint(Math.round(r.x+(n+1)*a.width),Math.round(p))];if(null!=t[n])t[n].points=i,t[n].redraw();else{var o=new mxPolyline(i,this.pageBreakColor);o.dialect=this.dialect,o.isDashed=this.pageBreakDashed,o.pointerEvents=!1,o.init(this.view.backgroundPane),o.redraw(),t[n]=o}}for(n=e;n<t.length;n++)t[n].destroy();t.splice(e,t.length-e)}})};var l=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(t,e,n){for(var i=0;i<e.length;i++)if(this.graph.getModel().isVertex(e[i])){var o=this.graph.getCellGeometry(e[i]);if(null!=o&&o.relative)return!1}return l.apply(this,arguments)};var t=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var n=t.apply(this,arguments);return n.intersects=mxUtils.bind(this,function(t,e){return!!this.isConnecting()||mxCellMarker.prototype.intersects.apply(n,arguments)}),n},mxGraphView.prototype.createBackgroundPageShape=function(t){return new mxRectangleShape(t,mxClient.IS_READONLY_FORM?"none":"#ffffff",mxClient.IS_READONLY_FORM?"none":this.graph.defaultPageBorderColor)},mxGraphView.prototype.getBackgroundPageBounds=function(){var t=this.getGraphBounds(),e=0<t.width?t.x/this.scale-this.translate.x:0,n=0<t.height?t.y/this.scale-this.translate.y:0,i=t.width/this.scale,o=t.height/this.scale,s=this.graph.pageFormat,l=this.graph.pageScale,r=s.width*l,a=s.height*l,h=Math.floor(Math.min(0,e)/r),d=Math.floor(Math.min(0,n)/a),u=Math.ceil(Math.max(1,e+i)/r)-h,p=Math.ceil(Math.max(1,n+o)/a)-d;return new mxRectangle(this.scale*(this.translate.x+h*r),this.scale*(this.translate.y+d*a),this.scale*u*r,this.scale*p*a)};var n=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(t,e){n.apply(this,arguments),this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=t+"px",this.view.backgroundPageShape.node.style.marginTop=e+"px")};var r=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(t,e,n,i,o,s){var l=r.apply(this,arguments);return null==s||s||mxEvent.addListener(l,"mousedown",function(t){mxEvent.consume(t)}),l};var a=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(t){var e=this.graph.getModel(),n=e.getParent(this.graph.getSelectionCell()),i=a.apply(this,arguments),o=e.getParent(i);if(null==n||n!=i&&n!=o)for(;!this.graph.isCellSelected(i)&&!this.graph.isCellSelected(o)&&e.isVertex(o)&&!this.graph.isContainer(o);)i=o,o=this.graph.getModel().getParent(i);return i};var h=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(t,e){var n=h.apply(this,arguments);if(!n)for(var i=this.graph.getModel(),o=i.getParent(t);null!=o;){if(this.graph.isCellSelected(o)&&i.isVertex(o)){n=!0;break}o=i.getParent(o)}return n},mxGraphHandler.prototype.selectDelayed=function(t){if(!this.graph.popupMenuHandler.isPopupTrigger(t)){var e=t.getCell();null==e&&(e=this.cell);var n=this.graph.view.getState(e);if(null!=n&&t.isSource(n.control))this.graph.selectCellForEvent(e,t.getEvent());else{for(var i=this.graph.getModel(),o=i.getParent(e);!this.graph.isCellSelected(o)&&i.isVertex(o);)e=o,o=i.getParent(e);this.graph.selectCellForEvent(e,t.getEvent())}}},mxPopupMenuHandler.prototype.getCellForPopupEvent=function(t){for(var e=t.getCell(),n=this.graph.getModel(),i=n.getParent(e);n.isVertex(i)&&!this.graph.isContainer(i);)this.graph.isCellSelected(i)&&(e=i),i=n.getParent(i);return e}}(),"undefined"!=typeof html4&&(html4.ATTRIBS["a::target"]=0,html4.ATTRIBS["source::src"]=0,html4.ATTRIBS["video::src"]=0),mxConstants.SHADOW_OPACITY=.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 t=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===t||"en-ca"===t||"es-mx"===t?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(t){}}(),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=":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(t,e,n,i,o){mxGraph.call(this,t,e,n,i),this.themes=o||this.defaultThemes,this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle),this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);var s=this.baseUrl,l=s.indexOf("//");if(this.domainUrl="",this.domainPathUrl="",0<l){var r=s.indexOf("/",l+2);0<r&&(this.domainUrl=s.substring(0,r)),0<(r=s.lastIndexOf("/"))&&(this.domainPathUrl=s.substring(0,r+1))}if(this.isHtmlLabel=function(t){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return"1"==n.html||"wrap"==n[mxConstants.STYLE_WHITE_SPACE]},this.edgeMode){var c={point:null,event:null,state:null,handle:null,selected:!1};this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(t,e){if("mouseDown"==e.getProperty("eventName")&&this.isEnabled()){var n=e.getProperty("event");if(!mxEvent.isControlDown(n.getEvent())&&!mxEvent.isShiftDown(n.getEvent())){var i=n.getState();if(null!=i&&this.model.isEdge(i.cell))if(c.point=new mxPoint(n.getGraphX(),n.getGraphY()),c.selected=this.isCellSelected(i.cell),c.state=i,c.event=n,null!=i.text&&null!=i.text.boundingBox&&mxUtils.contains(i.text.boundingBox,n.getGraphX(),n.getGraphY()))c.handle=mxEvent.LABEL_HANDLE;else{var o=this.selectionCellsHandler.getHandler(i.cell);null!=o&&null!=o.bends&&0<o.bends.length&&(c.handle=o.getHandleForEvent(n))}}}}));this.addMouseListener({mouseDown:function(t,e){},mouseMove:mxUtils.bind(this,function(t,e){var n=this.selectionCellsHandler.handlers.map;for(var i in n)if(null!=n[i].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isControlDown(e.getEvent())&&!mxEvent.isShiftDown(e.getEvent())&&!mxEvent.isAltDown(e.getEvent())){var o=this.tolerance;if(null!=c.point&&null!=c.state&&null!=c.event){var s=c.state;if(Math.abs(c.point.x-e.getGraphX())>o||Math.abs(c.point.y-e.getGraphY())>o){this.isCellSelected(s.cell)||this.setSelectionCell(s.cell);var l=this.selectionCellsHandler.getHandler(s.cell);if(null!=l&&null!=l.bends&&0<l.bends.length){var r=l.getHandleForEvent(c.event),a=this.view.getEdgeStyle(s),h=a==mxEdgeStyle.EntityRelation;if(c.selected||c.handle!=mxEvent.LABEL_HANDLE||(r=c.handle),h&&0!=r&&r!=l.bends.length-1&&r!=mxEvent.LABEL_HANDLE)!h||null==s.visibleSourceState&&null==s.visibleTargetState||(this.graphHandler.reset(),e.consume());else if(r==mxEvent.LABEL_HANDLE||0==r||null!=s.visibleSourceState||r==l.bends.length-1||null!=s.visibleTargetState){if(!h&&r!=mxEvent.LABEL_HANDLE){if(null!=(d=s.absolutePoints)&&(null==a&&null==r||a==mxEdgeStyle.OrthConnector))if(null==(r=c.handle))if((u=new mxRectangle(c.point.x,c.point.y)).grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(u,d[0].x,d[0].y))r=0;else if(mxUtils.contains(u,d[d.length-1].x,d[d.length-1].y))r=l.bends.length-1;else{null!=a&&(2==d.length||3==d.length&&(0==Math.round(d[0].x-d[1].x)&&0==Math.round(d[1].x-d[2].x)||0==Math.round(d[0].y-d[1].y)&&0==Math.round(d[1].y-d[2].y)))?r=2:(r=mxUtils.findNearestSegment(s,c.point.x,c.point.y),null==a?r=mxEvent.VIRTUAL_HANDLE-r:r+=1)}null==r&&(r=mxEvent.VIRTUAL_HANDLE)}l.start(e.getGraphX(),e.getGraphX(),r),c.state=null,c.event=null,c.point=null,c.handle=null,c.selected=!1,e.consume(),this.graphHandler.reset()}}}}else{if(null!=(s=e.getState())&&this.model.isEdge(s.cell)){var d,u,p=null;if(null!=(d=s.absolutePoints))if((u=new mxRectangle(e.getGraphX(),e.getGraphY())).grow(mxEdgeHandler.prototype.handleImage.width/2),null!=s.text&&null!=s.text.boundingBox&&mxUtils.contains(s.text.boundingBox,e.getGraphX(),e.getGraphY()))p="move";else if(mxUtils.contains(u,d[0].x,d[0].y)||mxUtils.contains(u,d[d.length-1].x,d[d.length-1].y))p="pointer";else if(null!=s.visibleSourceState||null!=s.visibleTargetState){if(p="crosshair",this.view.getEdgeStyle(s)!=mxEdgeStyle.EntityRelation&&this.isOrthogonal(s)){var m=mxUtils.findNearestSegment(s,e.getGraphX(),e.getGraphY());m<d.length-1&&0<=m&&(p=0==Math.round(d[m].x-d[m+1].x)?"col-resize":"row-resize")}}null!=p&&s.setCursor(p)}}}}),mouseUp:mxUtils.bind(this,function(t,e){c.state=null,c.event=null,c.point=null,c.handle=null})})}if(this.cellRenderer.getLabelValue=function(t){var e=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);return t.view.graph.isHtmlLabel(t.cell)&&(e=1!=t.style.html?mxUtils.htmlEntities(e,!1):t.view.graph.sanitizeHtml(e)),e},void 0!==mxVertexHandler){this.setConnectable(!0),this.setDropEnabled(!0),this.setPanning(!0),this.setTooltips(!0),this.setAllowLoops(!0),this.allowAutoPanning=!0,this.resetEdgesOnConnect=!1,this.constrainChildren=!1,this.constrainRelativeChildren=!0,this.graphHandler.scrollOnMove=!1,this.graphHandler.scaleGrid=!0,this.connectionHandler.setCreateTarget(!1),this.connectionHandler.insertBeforeSource=!0,this.connectionHandler.isValidSource=function(t,e){return!1},this.alternateEdgeStyle="vertical",null==i&&this.loadStylesheet();var u=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=function(){var t=u.apply(this,arguments);if(this.graph.pageVisible){for(var e=[],n=this.graph.pageFormat,i=this.graph.pageScale,o=n.width*i,s=n.height*i,l=this.graph.view.translate,r=this.graph.view.scale,a=this.graph.getPageLayout(),h=0;h<a.width;h++)e.push(new mxRectangle(((a.x+h)*o+l.x)*r,(a.y*s+l.y)*r,o*r,s*r));for(var d=0;d<a.height;d++)e.push(new mxRectangle((a.x*o+l.x)*r,((a.y+d)*s+l.y)*r,o*r,s*r));t=e.concat(t)}return t},mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex,mxGuide.prototype.getGuideColor=function(t,e){return null==t.cell?"#ffa500":mxConstants.GUIDE_COLOR},this.graphHandler.createPreviewShape=function(t){return this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor,mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)},this.graphHandler.getCells=function(t){for(var e=mxGraphHandler.prototype.getCells.apply(this,arguments),n=[],i=0;i<e.length;i++){var o=this.graph.view.getState(e[i]),s=null!=o?o.style:this.graph.getCellStyle(e[i]);if("1"==mxUtils.getValue(s,"part","0")){var l=this.graph.model.getParent(e[i]);this.graph.model.isVertex(l)&&mxUtils.indexOf(e,l)<0&&n.push(l)}else n.push(e[i])}return n},this.connectionHandler.createTargetVertex=function(t,e){var n=this.graph.view.getState(e),i=null!=n?n.style:this.graph.getCellStyle(e);if(mxUtils.getValue(i,"part",!1)){var o=this.graph.model.getParent(e);this.graph.model.isVertex(o)&&(e=o)}return mxConnectionHandler.prototype.createTargetVertex.apply(this,arguments)};var a=new mxRubberband(this);this.getRubberband=function(){return a};var h=(new Date).getTime(),d=0,p=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var t=this.currentState;p.apply(this,arguments),d=t!=this.currentState?(h=(new Date).getTime(),0):(new Date).getTime()-h};var m=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(t){return null!=this.currentState&&t.getState()==this.currentState&&2e3<d||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&m.apply(this,arguments)};var g=this.isToggleEvent;this.isToggleEvent=function(t){return g.apply(this,arguments)||mxEvent.isShiftDown(t)};var x=a.isForceRubberbandEvent;a.isForceRubberbandEvent=function(t){return x.apply(this,arguments)||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==t.getState()&&mxEvent.isTouchEvent(t.getEvent())};var y=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(y=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=y)})),this.popupMenuHandler.autoExpand=!0,this.popupMenuHandler.isSelectOnPopup=function(t){return mxEvent.isMouseEvent(t.getEvent())};var f=this.click;this.click=function(t){var e=null==t.state&&null!=t.sourceState&&this.isCellLocked(t.sourceState.cell);if(this.isEnabled()&&!e||t.isConsumed())return f.apply(this,arguments);var n=e?t.sourceState.cell:t.getCell();if(null!=n){var i=this.getLinkForCell(n);null!=i&&(this.isCustomLink(i)?this.customLinkClicked(i):this.openLink(i))}},this.tooltipHandler.getStateForEvent=function(t){return t.sourceState};this.getCursorForMouseEvent;this.getCursorForMouseEvent=function(t){var e=null==t.state&&null!=t.sourceState&&this.isCellLocked(t.sourceState.cell);return this.getCursorForCell(e?t.sourceState.cell:t.getCell())};var v=this.getCursorForCell;this.getCursorForCell=function(t){if(!this.isEnabled()||this.isCellLocked(t)){if(null!=this.getLinkForCell(t))return"pointer";if(this.isCellLocked(t))return"default"}return v.apply(this,arguments)},this.selectRegion=function(t,e){var n=this.getAllCells(t.x,t.y,t.width,t.height);return this.selectCellsForEvent(n,e),n},this.getAllCells=function(t,e,n,i,o,s){if(s=null!=s?s:[],0<n||0<i){var l=this.getModel(),r=t+n,a=e+i;if(null==o&&null==(o=this.getCurrentRoot())&&(o=l.getRoot()),null!=o)for(var h=l.getChildCount(o),d=0;d<h;d++){var u=l.getChildAt(o,d),p=this.view.getState(u);if(null!=p&&this.isCellVisible(u)&&"1"!=mxUtils.getValue(p.style,"locked","0")){var m=mxUtils.getValue(p.style,mxConstants.STYLE_ROTATION)||0,c=p;0!=m&&(c=mxUtils.getBoundingBox(c,m)),(l.isEdge(u)||l.isVertex(u))&&c.x>=t&&c.y+c.height<=a&&c.y>=e&&c.x+c.width<=r&&s.push(u),this.getAllCells(t,e,n,i,u,s)}}}return s};var C=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(t,e,n){return!this.graph.isCellSelected(t)&&C.apply(this,arguments)},this.isCellLocked=function(t){for(var e=this.view.getState(t);null!=e;){if("1"==mxUtils.getValue(e.style,"locked","0"))return!0;e=this.view.getState(this.model.getParent(e.cell))}return!1};var E=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(t,e){if("mouseDown"==e.getProperty("eventName")){var n=e.getProperty("event").getState();E=null==n||this.isSelectionEmpty()||this.isCellSelected(n.cell)?null:this.getSelectionCells()}})),this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(t,e){if(!mxEvent.isMultiTouchEvent(e)){var n=e.getProperty("event"),i=e.getProperty("cell");if(null==i){var o=mxUtils.convertPoint(this.container,mxEvent.getClientX(n),mxEvent.getClientY(n));a.start(o.x,o.y)}else null!=E?this.addSelectionCells(E):1<this.getSelectionCount()&&this.isCellSelected(i)&&this.removeSelectionCell(i);E=null,e.consume()}})),this.connectionHandler.selectCells=function(t,e){this.graph.setSelectionCell(e||t)},this.connectionHandler.constraintHandler.isStateIgnored=function(t,e){return e&&t.view.graph.isCellSelected(t.cell)},this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var t=this.connectionHandler.constraintHandler;null!=t.currentFocus&&t.isStateIgnored(t.currentFocus,!0)&&(t.currentFocus=null,t.constraints=null,t.destroyIcons()),t.destroyFocusHighlight()})),Graph.touchStyle&&this.initTouch();var w=this.updateMouseEvent;this.updateMouseEvent=function(t){return null!=(t=w.apply(this,arguments)).state&&this.isCellLocked(t.getCell())&&(t.state=null),t}}this.currentTranslate=new mxPoint(0,0)},Graph.touchStyle=mxClient.IS_TOUCH||mxClient.IS_FF&&mxClient.IS_WIN||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints||null==window.urlParams||"1"==urlParams.touch,Graph.fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList&&(null==window.urlParams||"0"!=urlParams.filesupport),Graph.lineJumpsEnabled=!0,Graph.defaultJumpSize=6,Graph.createSvgImage=function(t,e,n){var i=unescape(encodeURIComponent('<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+t+'px" height="'+e+'px" version="1.1">'+n+"</svg>"));return new mxImage("data:image/svg+xml;base64,"+(window.btoa?btoa(i):Base64.encode(i,!0)),t,e)},mxUtils.extend(Graph,mxGraph),Graph.prototype.workflowDetailDatas=null,Graph.prototype.minFitScale=null,Graph.prototype.maxFitScale=null,Graph.prototype.linkPolicy="frame"==urlParams.target?"blank":urlParams.target||"auto",Graph.prototype.linkTarget="frame"==urlParams.target?"_self":"_blank",Graph.prototype.defaultScrollbars=!mxClient.IS_IOS,Graph.prototype.defaultPageVisible=!mxClient.IS_READONLY_FORM,Graph.prototype.lightbox=!1,Graph.prototype.defaultPageBackgroundColor="#ffffff",Graph.prototype.defaultPageBorderColor="#ffffff",Graph.prototype.defaultGraphBackground=mxClient.IS_READONLY_FORM?"transparent":"#ffffff",Graph.prototype.scrollTileSize=mxClient.IS_TOUCH?new mxRectangle(0,0,100,100):new mxRectangle(0,0,400,400),Graph.prototype.transparentBackground=!0,Graph.prototype.defaultEdgeLength=80,Graph.prototype.edgeMode=!1,Graph.prototype.connectionArrowsEnabled=!0,Graph.prototype.placeholderPattern=new RegExp("%(date{.*}|[^%^{^}]+)%","g"),Graph.prototype.absoluteUrlPattern=new RegExp("^(?:[a-z]+:)?//","i"),Graph.prototype.defaultThemeName="default",Graph.prototype.defaultThemes={},Graph.prototype.baseUrl=null!=urlParams.base?decodeURIComponent(urlParams.base):(window!=window.top?document.referrer:document.location.toString()).split("#")[0],Graph.prototype.editAfterInsert=!1,Graph.prototype.init=function(t){mxGraph.prototype.init.apply(this,arguments),this.cellRenderer.initializeLabel=function(n,i){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var e=n.view.graph.tolerance,o=!0,s=null,t=mxUtils.bind(this,function(t){o=!0,s=new mxPoint(mxEvent.getClientX(t),mxEvent.getClientY(t))}),l=mxUtils.bind(this,function(t){o=o&&null!=s&&Math.abs(s.x-mxEvent.getClientX(t))<e&&Math.abs(s.y-mxEvent.getClientY(t))<e}),r=mxUtils.bind(this,function(t){if(o)for(var e=mxEvent.getSource(t);null!=e&&e!=i.node;){if("a"==e.nodeName.toLowerCase()){n.view.graph.labelLinkClicked(n,e,t);break}e=e.parentNode}});mxEvent.addGestureListeners(i.node,t,l,r),mxEvent.addListener(i.node,"click",function(t){mxEvent.consume(t)})},this.initLayoutManager()},function(){Graph.prototype.useCssTransforms=!1,Graph.prototype.currentScale=1,Graph.prototype.currentTranslate=new mxPoint(0,0),Graph.prototype.isCssTransformsSupported=function(){return this.dialect==mxConstants.DIALECT_SVG&&!mxClient.NO_FO},Graph.prototype.getCellAt=function(t,e,n,i,o,s){return this.useCssTransforms&&(t=t/this.currentScale-this.currentTranslate.x,e=e/this.currentScale-this.currentTranslate.y),this.getScaledCellAt.apply(this,arguments)},Graph.prototype.getScaledCellAt=function(t,e,n,i,o,s){if(i=null==i||i,o=null==o||o,null==n&&null==(n=this.getCurrentRoot())&&(n=this.getModel().getRoot()),null!=n)for(var l=this.model.getChildCount(n)-1;0<=l;l--){var r=this.model.getChildAt(n,l),a=this.getScaledCellAt(t,e,r,i,o,s);if(null!=a)return a;if(this.isCellVisible(r)&&(o&&this.model.isEdge(r)||i&&this.model.isVertex(r))){var h=this.view.getState(r);if(null!=h&&(null==s||!s(h,t,e))&&this.intersects(h,t,e))return r}}return null},mxCellHighlight.prototype.getStrokeWidth=function(t){var e=this.strokeWidth;return this.graph.useCssTransforms&&(e/=this.graph.currentScale),e},mxGraphView.prototype.getGraphBounds=function(){var t=this.graphBounds;if(this.graph.useCssTransforms){var e=this.graph.currentTranslate,n=this.graph.currentScale;t=new mxRectangle((t.x+e.x)*n,(t.y+e.y)*n,t.width*n,t.height*n)}return t},mxGraphView.prototype.viewStateChanged=function(){this.graph.useCssTransforms?this.validate():this.revalidate(),this.graph.sizeDidChange()};var e=mxGraphView.prototype.validate;mxGraphView.prototype.validate=function(t){this.graph.useCssTransforms&&(this.graph.currentScale=this.scale,this.graph.currentTranslate.x=this.translate.x,this.graph.currentTranslate.y=this.translate.y,this.scale=1,this.translate.x=0,this.translate.y=0),e.apply(this,arguments),this.graph.useCssTransforms&&(this.graph.updateCssTransform(),this.scale=this.graph.currentScale,this.translate.x=this.graph.currentTranslate.x,this.translate.y=this.graph.currentTranslate.y)},Graph.prototype.updateCssTransform=function(){if(null!=this.view.getDrawPane()){var t=this.view.getDrawPane().parentNode,e=t.getAttribute("transform");if(t.setAttribute("transformOrigin","0 0"),t.setAttribute("transform","scale("+this.currentScale+","+this.currentScale+")translate("+this.currentTranslate.x+","+this.currentTranslate.y+")"),e!=t.getAttribute("transform"))try{if(mxClient.IS_GC)!this.mathEnabled||null!=this.webKitForceRepaintNode&&null!=this.webKitForceRepaintNode.parentNode||"svg"!=this.container.firstChild.nodeName?null==this.webKitForceRepaintNode||this.mathEnabled&&("svg"==this.container.firstChild.nodeName||this.container.firstChild==this.webKitForceRepaintNode)||(null!=this.webKitForceRepaintNode.parentNode&&this.webKitForceRepaintNode.parentNode.removeChild(this.webKitForceRepaintNode),this.webKitForceRepaintNode=null):(this.webKitForceRepaintNode=document.createElement("div"),this.webKitForceRepaintNode.style.cssText="position:absolute;",t.ownerSVGElement.parentNode.insertBefore(this.webKitForceRepaintNode,t.ownerSVGElement));else if(mxClient.IS_EDGE){var n=t.style.display;t.style.display="none",t.getBBox(),t.style.display=n}}catch(t){console.log("err",t)}}};var i=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){var t=this.graph.useCssTransforms,e=this.scale,n=this.translate;t&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate),i.apply(this,arguments),t&&(this.scale=e,this.translate=n)};var l=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(t,e,n){var i=this.useCssTransforms,o=this.view.scale,s=this.view.translate;i&&(this.view.scale=1,this.view.translate=new mxPoint(0,0),this.useCssTransforms=!1),l.apply(this,arguments),i&&(this.view.scale=o,this.view.translate=s,this.useCssTransforms=!0)}}(),Graph.prototype.isLightboxView=function(){return this.lightbox},Graph.prototype.labelLinkClicked=function(t,e,n){var i=e.getAttribute("href");if(null!=i&&!this.isCustomLink(i)&&mxEvent.isLeftMouseButton(n)&&!mxEvent.isPopupTrigger(n)||mxEvent.isTouchEvent(n)){if(!this.isEnabled()||this.isCellLocked(t.cell)){var o=this.isBlankLink(i)?this.linkTarget:"_top";this.openLink(this.getAbsoluteUrl(i),o)}mxEvent.consume(n)}},Graph.prototype.openLink=function(t,e){var n=window;if("_self"==e&&window!=window.top)window.location.href=t;else if(t.substring(0,this.baseUrl.length)==this.baseUrl&&"#"==t.charAt(this.baseUrl.length)&&"_top"==e&&window==window.top){var i=t.split("#")[1];window.location.hash=="#"+i&&(window.location.hash=""),window.location.hash=i}else n=window.open(t,e);return n},Graph.prototype.getLinkTitle=function(t){return t.substring(t.lastIndexOf("/")+1)},Graph.prototype.isCustomLink=function(t){return"data:"==t.substring(0,5)},Graph.prototype.customLinkClicked=function(t){console.log("customLinkClicked not implemented")},Graph.prototype.isExternalProtocol=function(t){return"mailto:"===t.substring(0,7)},Graph.prototype.isBlankLink=function(t){return!this.isExternalProtocol(t)&&("blank"===this.linkPolicy||"self"!==this.linkPolicy&&!this.isRelativeUrl(t)&&t.substring(0,this.domainUrl.length)!==this.domainUrl)},Graph.prototype.isRelativeUrl=function(t){return null!=t&&!this.absoluteUrlPattern.test(t)&&"data:"!==t.substring(0,5)&&!this.isExternalProtocol(t)},Graph.prototype.initLayoutManager=function(){this.layoutManager=new mxLayoutManager(this),this.layoutManager.getLayout=function(t){var e=this.graph.view.getState(t),n=null!=e?e.style:this.graph.getCellStyle(t);if("stackLayout"==n.childLayout){var i=new mxStackLayout(this.graph,!0);return i.resizeParentMax="1"==mxUtils.getValue(n,"resizeParentMax","1"),i.horizontal="1"==mxUtils.getValue(n,"horizontalStack","1"),i.resizeParent="1"==mxUtils.getValue(n,"resizeParent","1"),i.resizeLast="1"==mxUtils.getValue(n,"resizeLast","0"),i.spacing=n.stackSpacing||i.spacing,i.border=n.stackBorder||i.border,i.marginLeft=n.marginLeft||0,i.marginRight=n.marginRight||0,i.marginTop=n.marginTop||0,i.marginBottom=n.marginBottom||0,i.fill=!0,i}if("treeLayout"==n.childLayout){var o=new mxCompactTreeLayout(this.graph);return o.horizontal="1"==mxUtils.getValue(n,"horizontalTree","1"),o.resizeParent="1"==mxUtils.getValue(n,"resizeParent","1"),o.groupPadding=mxUtils.getValue(n,"parentPadding",20),o.levelDistance=mxUtils.getValue(n,"treeLevelDistance",30),o.maintainParentLocation=!0,o.edgeRouting=!1,o.resetEdges=!1,o}if("flowLayout"!=n.childLayout)return null;var s=new mxHierarchicalLayout(this.graph,mxUtils.getValue(n,"flowOrientation",mxConstants.DIRECTION_EAST));return s.resizeParent="1"==mxUtils.getValue(n,"resizeParent","1"),s.parentBorder=mxUtils.getValue(n,"parentPadding",20),s.maintainParentLocation=!0,s.intraCellSpacing=mxUtils.getValue(n,"intraCellSpacing",mxHierarchicalLayout.prototype.intraCellSpacing),s.interRankCellSpacing=mxUtils.getValue(n,"interRankCellSpacing",mxHierarchicalLayout.prototype.interRankCellSpacing),s.interHierarchySpacing=mxUtils.getValue(n,"interHierarchySpacing",mxHierarchicalLayout.prototype.interHierarchySpacing),s.parallelEdgeSpacing=mxUtils.getValue(n,"parallelEdgeSpacing",mxHierarchicalLayout.prototype.parallelEdgeSpacing),s}},Graph.prototype.getPageSize=function(){return this.pageVisible?new mxRectangle(0,0,this.pageFormat.width*this.pageScale,this.pageFormat.height*this.pageScale):this.scrollTileSize},Graph.prototype.getPageLayout=function(){var t=this.getPageSize(),e=this.getGraphBounds();if(0==e.width||0==e.height)return new mxRectangle(0,0,1,1);var n=Math.ceil(e.x/this.view.scale-this.view.translate.x),i=Math.ceil(e.y/this.view.scale-this.view.translate.y),o=Math.floor(e.width/this.view.scale),s=Math.floor(e.height/this.view.scale),l=workflowUi.wfGroups&&workflowUi.wfGroups.colGroups,r=workflowUi.wfGroups&&workflowUi.wfGroups.rowGroups,a=l[l.length-1],h=r[r.length-1];o=n+o>(a?a.position.left:0)?n+o:a?a.position.left:0,s=i+s>(h?h.position.top:0)?i+s:h?h.position.top:0;var d=Math.floor(n/t.width),u=Math.floor(i/t.height);return new mxRectangle(d,u,Math.ceil(o/t.width)-d,Math.ceil(s/t.height)-u)},Graph.prototype.sanitizeHtml=function(t,e){return html_sanitize(t,function(t){return null!=t&&"javascript:"!==t.toString().toLowerCase().substring(0,11)?t:null},function(t){return t})},Graph.prototype.updatePlaceholders=function(){this.model;var t=!1;for(var e in this.model.cells){var n=this.model.cells[e];this.isReplacePlaceholders(n)&&(this.view.invalidate(n,!1,!1),t=!0)}t&&this.view.validate()},Graph.prototype.isReplacePlaceholders=function(t){return null!=t.value&&"object"==typeof t.value&&"1"==t.value.getAttribute("placeholders")},Graph.prototype.isZoomWheelEvent=function(t){return mxEvent.isAltDown(t)||mxEvent.isMetaDown(t)&&mxClient.IS_MAC||mxEvent.isControlDown(t)&&!mxClient.IS_MAC},Graph.prototype.isTransparentClickEvent=function(t){return mxEvent.isAltDown(t)},Graph.prototype.isIgnoreTerminalEvent=function(t){return mxEvent.isShiftDown(t)&&mxEvent.isControlDown(t)},Graph.prototype.isSplitTarget=function(t,e,n){return!this.model.isEdge(e[0])&&!mxEvent.isAltDown(n)&&!mxEvent.isShiftDown(n)&&mxGraph.prototype.isSplitTarget.apply(this,arguments)},Graph.prototype.getLabel=function(t){var e=mxGraph.prototype.getLabel.apply(this,arguments);return null!=e&&this.isReplacePlaceholders(t)&&null==t.getAttribute("placeholder")&&(e=this.replacePlaceholders(t,e)),e},Graph.prototype.isLabelMovable=function(t){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return!this.isCellLocked(t)&&(this.model.isEdge(t)&&this.edgeLabelsMovable||this.model.isVertex(t)&&(this.vertexLabelsMovable||"1"==mxUtils.getValue(n,"labelMovable","0")))},Graph.prototype.setGridSize=function(t){this.gridSize=t,this.fireEvent(new mxEventObject("gridSizeChanged"))},Graph.prototype.getGlobalVariable=function(t){var e=null;if("date"==t)e=(new Date).toLocaleDateString();else if("time"==t)e=(new Date).toLocaleTimeString();else if("timestamp"==t)e=(new Date).toLocaleString();else if("date{"==t.substring(0,5)){var n=t.substring(5,t.length-1);e=this.formatDate(new Date,n)}return e},Graph.prototype.formatDate=function(t,e,n){null==this.dateFormatCache&&(this.dateFormatCache={i18n:{dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],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"]},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'"}});function i(t,e){for(t=String(t),e=e||2;t.length<e;)t="0"+t;return t}var o=this.dateFormatCache;if(1!=arguments.length||"[object String]"!=Object.prototype.toString.call(t)||/\d/.test(t)||(e=t,t=void 0),t=t?new Date(t):new Date,isNaN(t))throw SyntaxError("invalid date");"UTC:"==(e=String(o.masks[e]||e||o.masks.default)).slice(0,4)&&(e=e.slice(4),n=!0);var s=n?"getUTC":"get",l=t[s+"Date"](),r=t[s+"Day"](),a=t[s+"Month"](),h=t[s+"FullYear"](),d=t[s+"Hours"](),u=t[s+"Minutes"](),p=t[s+"Seconds"](),m=t[s+"Milliseconds"](),c=n?0:t.getTimezoneOffset(),g={d:l,dd:i(l),ddd:o.i18n.dayNames[r],dddd:o.i18n.dayNames[r+7],m:a+1,mm:i(a+1),mmm:o.i18n.monthNames[a],mmmm:o.i18n.monthNames[a+12],yy:String(h).slice(2),yyyy:h,h:d%12||12,hh:i(d%12||12),H:d,HH:i(d),M:u,MM:i(u),s:p,ss:i(p),l:i(m,3),L:i(99<m?Math.round(m/10):m),t:d<12?"a":"p",tt:d<12?"am":"pm",T:d<12?"A":"P",TT:d<12?"AM":"PM",Z:n?"UTC":(String(t).match(/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g)||[""]).pop().replace(/[^-+\dA-Z]/g,""),o:(0<c?"-":"+")+i(100*Math.floor(Math.abs(c)/60)+Math.abs(c)%60,4),S:["th","st","nd","rd"][3<l%10?0:(l%100-l%10!=10)*l%10]};return e.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(t){return t in g?g[t]:t.slice(1,t.length-1)})},Graph.prototype.createLayersDialog=function(){var o=document.createElement("div");o.style.position="absolute";for(var s=this.getModel(),t=s.getChildCount(s.root),e=0;e<t;e++)mxUtils.bind(this,function(t){var e=document.createElement("div");e.style.overflow="hidden",e.style.textOverflow="ellipsis",e.style.padding="2px",e.style.whiteSpace="nowrap";var n=document.createElement("input");n.style.display="inline-block",n.setAttribute("type","checkbox"),s.isVisible(t)&&(n.setAttribute("checked","checked"),n.defaultChecked=!0),e.appendChild(n);var i=this.convertValueToString(t)||mxResources.get("background")||"Background";e.setAttribute("title",i),mxUtils.write(e,i),o.appendChild(e),mxEvent.addListener(n,"click",function(){null!=n.getAttribute("checked")?n.removeAttribute("checked"):n.setAttribute("checked","checked"),s.setVisible(t,n.checked)})})(s.getChildAt(s.root,e));return o},Graph.prototype.replacePlaceholders=function(t,e){var n=[];if(null!=e){for(var i=0;match=this.placeholderPattern.exec(e);){var o=match[0];if(2<o.length&&"%label%"!=o&&"%tooltip%"!=o){var s=null;if(match.index>i&&"%"==e.charAt(match.index-1))s=o.substring(1);else{var l=o.substring(1,o.length-1);if(l.indexOf("{")<0)for(var r=t;null==s&&null!=r;)null!=r.value&&"object"==typeof r.value&&(s=r.hasAttribute(l)?null!=r.getAttribute(l)?r.getAttribute(l):"":null),r=this.model.getParent(r);null==s&&(s=this.getGlobalVariable(l))}n.push(e.substring(i,match.index)+(null!=s?s:o)),i=match.index+o.length}}n.push(e.substring(i))}return n.join("")},Graph.prototype.selectCellsForConnectVertex=function(t,e,n){2==t.length&&this.model.isVertex(t[1])?(this.setSelectionCell(t[1]),null!=n&&(mxEvent.isTouchEvent(e)?n.update(n.getState(this.view.getState(t[1]))):n.reset()),this.scrollCellToVisible(t[1])):this.setSelectionCells(t)},Graph.prototype.connectVertex=function(t,e,n,i,o,s){s=s||!1;var l=t.geometry.relative&&null!=t.parent.geometry?new mxPoint(t.parent.geometry.width*t.geometry.x,t.parent.geometry.height*t.geometry.y):new mxPoint(t.geometry.x,t.geometry.y);e==mxConstants.DIRECTION_NORTH?(l.x+=t.geometry.width/2,l.y-=n):e==mxConstants.DIRECTION_SOUTH?(l.x+=t.geometry.width/2,l.y+=t.geometry.height+n):(e==mxConstants.DIRECTION_WEST?l.x-=n:l.x+=t.geometry.width+n,l.y+=t.geometry.height/2);var r=this.view.getState(this.model.getParent(t)),a=this.view.scale,h=this.view.translate,d=h.x*a,u=h.y*a;this.model.isVertex(r.cell)&&(d=r.x,u=r.y),this.model.isVertex(t.parent)&&t.geometry.relative&&(l.x+=t.parent.geometry.x,l.y+=t.parent.geometry.y);var p=s||mxEvent.isControlDown(i)&&!o?null:this.getCellAt(d+l.x*a,u+l.y*a);this.model.isAncestor(p,t)&&(p=null);for(var m=p;null!=m;){if(this.isCellLocked(m)){p=null;break}m=this.model.getParent(m)}if(null!=p){var c=this.view.getState(t),g=this.view.getState(p);null!=c&&null!=g&&mxUtils.intersects(c,g)&&(p=null)}var x=!mxEvent.isShiftDown(i)||o;if(x&&(e==mxConstants.DIRECTION_NORTH?l.y-=t.geometry.height/2:e==mxConstants.DIRECTION_SOUTH?l.y+=t.geometry.height/2:e==mxConstants.DIRECTION_WEST?l.x-=t.geometry.width/2:l.x+=t.geometry.width/2),null!=p&&!this.isCellConnectable(p)){var y=this.getModel().getParent(p);this.getModel().isVertex(y)&&this.isCellConnectable(y)&&(p=y)}p!=t&&!this.model.isEdge(p)&&this.isCellConnectable(p)||(p=null);var f=[];this.model.beginUpdate();try{var v=p;if(null==v&&x){for(var C=t,E=this.getCellGeometry(t);null!=E&&E.relative;)C=this.getModel().getParent(C),E=this.getCellGeometry(C);var w=this.view.getState(C),S=null!=w?w.style:this.getCellStyle(C);if(mxUtils.getValue(S,"part",!1)){var b=this.model.getParent(C);this.model.isVertex(b)&&(C=b)}v=this.duplicateCells([C],!1)[0],null!=(E=this.getCellGeometry(v))&&(E.x=l.x-E.width/2,E.y=l.y-E.height/2)}var T=null;null!=this.layoutManager&&(T=this.layoutManager.getLayout(this.model.getParent(t)));var A=mxEvent.isControlDown(i)&&x||null==p&&null!=T&&T.constructor==mxStackLayout?null:this.insertEdge(this.model.getParent(t),null,"",t,v,this.createCurrentEdgeStyle());if(null!=A&&this.connectionHandler.insertBeforeSource){for(var L=null,I=t;null!=I.parent&&null!=I.geometry&&I.geometry.relative&&I.parent!=A.parent;)I=this.model.getParent(I);if(null!=I&&null!=I.parent&&I.parent==A.parent){L=I.parent.getIndex(I);this.model.add(I.parent,A,L)}}if(null==p&&null!=v&&null!=T&&null!=t.parent&&T.constructor==mxStackLayout&&e==mxConstants.DIRECTION_WEST){L=t.parent.getIndex(t);this.model.add(t.parent,v,L)}null!=A&&f.push(A),null==p&&null!=v&&f.push(v),null==v&&null!=A&&A.geometry.setTerminalPoint(l,!1),null!=A&&this.fireEvent(new mxEventObject("cellsInserted","cells",[A]))}finally{this.model.endUpdate()}return f},Graph.prototype.getIndexableText=function(){var t=document.createElement("div"),e=[],n="";for(var i in this.model.cells){var o=this.model.cells[i];(this.model.isVertex(o)||this.model.isEdge(o))&&(n=this.isHtmlLabel(o)?(t.innerHTML=this.getLabel(o),mxUtils.extractTextWithWhitespace([t])):this.getLabel(o),0<(n=mxUtils.trim(n.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," "))).length&&e.push(n))}return e.join(" ")},Graph.prototype.convertValueToString=function(t){if(null==t.value||"object"!=typeof t.value)return mxGraph.prototype.convertValueToString.apply(this,arguments);if(this.isReplacePlaceholders(t)&&null!=t.getAttribute("placeholder")){for(var e=t.getAttribute("placeholder"),n=t,i=null;null==i&&null!=n;)null!=n.value&&"object"==typeof n.value&&(i=n.hasAttribute(e)?null!=n.getAttribute(e)?n.getAttribute(e):"":null),n=this.model.getParent(n);return i||""}return t.value.getAttribute("label")},Graph.prototype.getLinksForState=function(t){return null!=t&&null!=t.text&&null!=t.text.node?t.text.node.getElementsByTagName("a"):null},Graph.prototype.getLinkForCell=function(t){if(null==t.value||"object"!=typeof t.value)return null;var e=t.value.getAttribute("link");return null!=e&&"javascript:"===e.toLowerCase().substring(0,11)&&(e=e.substring(11)),e},Graph.prototype.getCellStyle=function(t){var e=mxGraph.prototype.getCellStyle.apply(this,arguments);if(null!=t&&null!=this.layoutManager){var n=this.model.getParent(t);if(this.model.isVertex(n)&&this.isCellCollapsed(t)){var i=this.layoutManager.getLayout(n);null!=i&&i.constructor==mxStackLayout&&(e[mxConstants.STYLE_HORIZONTAL]=!i.horizontal)}}return e},Graph.prototype.updateAlternateBounds=function(t,e,n){if(null!=t&&null!=e&&null!=this.layoutManager&&null!=e.alternateBounds){var i=this.layoutManager.getLayout(this.model.getParent(t));null!=i&&i.constructor==mxStackLayout&&(i.horizontal?e.alternateBounds.height=0:e.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)},Graph.prototype.isMoveCellsEvent=function(t){return mxEvent.isShiftDown(t)},Graph.prototype.foldCells=function(t,e,n,i,o){if(e=null!=e&&e,null==n&&(n=this.getFoldableCells(this.getSelectionCells(),t)),null!=n){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var s=0;s<n.length;s++){var l=this.view.getState(n[s]),r=this.getCellGeometry(n[s]);if(null!=l&&null!=r){var a=Math.round(r.width-l.width/this.view.scale),h=Math.round(r.height-l.height/this.view.scale);if(0!=h||0!=a){var d=this.model.getParent(n[s]),u=this.layoutManager.getLayout(d);null==u?null!=o&&this.isMoveCellsEvent(o)&&this.moveSiblings(l,d,a,h):null!=o&&mxEvent.isAltDown(o)||u.constructor!=mxStackLayout||u.resizeLast||this.resizeParentStacks(d,u,a,h)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(n)}},Graph.prototype.moveSiblings=function(t,e,n,i){this.model.beginUpdate();try{for(var o=this.getCellsBeyond(t.x,t.y,e,!0,!0),s=0;s<o.length;s++)if(o[s]!=t.cell){var l=this.view.getState(o[s]),r=this.getCellGeometry(o[s]);null!=l&&null!=r&&((r=r.clone()).translate(Math.round(n*Math.max(0,Math.min(1,(l.x-t.x)/t.width))),Math.round(i*Math.max(0,Math.min(1,(l.y-t.y)/t.height)))),this.model.setGeometry(o[s],r))}}finally{this.model.endUpdate()}},Graph.prototype.resizeParentStacks=function(t,e,n,i){if(null!=this.layoutManager&&null!=e&&e.constructor==mxStackLayout&&!e.resizeLast){this.model.beginUpdate();try{for(var o=e.horizontal;null!=t&&null!=e&&e.constructor==mxStackLayout&&e.horizontal==o&&!e.resizeLast;){var s=this.getCellGeometry(t),l=this.view.getState(t);null!=l&&null!=s&&(s=s.clone(),e.horizontal?s.width+=n+Math.min(0,l.width/this.view.scale-s.width):s.height+=i+Math.min(0,l.height/this.view.scale-s.height),this.model.setGeometry(t,s)),t=this.model.getParent(t),e=this.layoutManager.getLayout(t)}}finally{this.model.endUpdate()}}},Graph.prototype.isContainer=function(t){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return this.isSwimlane(t)?"0"!=n.container:"1"==n.container},Graph.prototype.isCellConnectable=function(t){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return null!=n.connectable?"0"!=n.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments)},Graph.prototype.selectAll=function(t){t=t||this.getDefaultParent(),this.isCellLocked(t)||mxGraph.prototype.selectAll.apply(this,arguments)},Graph.prototype.selectCells=function(t,e,n){n=n||this.getDefaultParent(),this.isCellLocked(n)||mxGraph.prototype.selectCells.apply(this,arguments)},Graph.prototype.getSwimlaneAt=function(t,e,n){return n=n||this.getDefaultParent(),this.isCellLocked(n)?null:mxGraph.prototype.getSwimlaneAt.apply(this,arguments)},Graph.prototype.isCellFoldable=function(t){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return this.foldingEnabled&&!this.isCellLocked(t)&&(this.isContainer(t)&&"0"!=n.collapsible||!this.isContainer(t)&&"1"==n.collapsible)},Graph.prototype.reset=function(){this.isEditing()&&this.stopEditing(!0),this.escape(),this.isSelectionEmpty()||this.clearSelection()},Graph.prototype.zoom=function(t,e){t=Math.max(.01,Math.min(this.view.scale*t,160))/this.view.scale,mxGraph.prototype.zoom.apply(this,arguments)},Graph.prototype.zoomIn=function(){this.view.scale<.15?this.zoom((this.view.scale+.01)/this.view.scale):2<Math.round(this.view.scale*this.zoomFactor*20)/20?this.zoom(2/this.view.scale):this.zoom(Math.round(this.view.scale*this.zoomFactor*20)/20/this.view.scale)},Graph.prototype.zoomOut=function(){this.view.scale<=.15||this.zoom(Math.round(this.view.scale*(1/this.zoomFactor)*20)/20/this.view.scale)},Graph.prototype.getTooltipForCell=function(t){var e="";if(mxUtils.isNode(t.value)){var n=t.value.getAttribute("tooltip");if(null!=n)null!=n&&this.isReplacePlaceholders(t)&&(n=this.replacePlaceholders(t,n)),e=this.sanitizeHtml(n);else{var i=["label","tooltip","placeholders","placeholder"],o=t.value.attributes,s=[];this.isEnabled()&&i.push("link");for(var l=0;l<o.length;l++)mxUtils.indexOf(i,o[l].nodeName)<0&&0<o[l].nodeValue.length&&s.push({name:o[l].nodeName,value:o[l].nodeValue});s.sort(function(t,e){return t.name<e.name?-1:t.name>e.name?1:0});for(l=0;l<s.length;l++)"link"==s[l].name&&this.isCustomLink(s[l].value)||(e+=("link"!=s[l].name?"<b>"+s[l].name+":</b> ":"")+mxUtils.htmlEntities(s[l].value)+"\n");0<e.length&&(e=e.substring(0,e.length-1),mxClient.IS_SVG&&(e='<div style="max-width:360px;">'+e+"</div>"))}}return e},Graph.prototype.stringToBytes=function(t){for(var e=new Array(t.length),n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e},Graph.prototype.bytesToString=function(t){for(var e=new Array(t.length),n=0;n<t.length;n++)e[n]=String.fromCharCode(t[n]);return e.join("")},Graph.prototype.compress=function(t){if(null==t||0==t.length||"undefined"==typeof pako)return t;var e=this.bytesToString(pako.deflateRaw(encodeURIComponent(t)));return window.btoa?btoa(e):Base64.encode(e,!0)},Graph.prototype.decompress=function(t){if(null==t||0==t.length||"undefined"==typeof pako)return t;var e=window.atob?atob(t):Base64.decode(t,!0);return this.zapGremlins(decodeURIComponent(this.bytesToString(pako.inflateRaw(e))))},Graph.prototype.zapGremlins=function(t){for(var e=[],n=0;n<t.length;n++){var i=t.charCodeAt(n);(32<=i||9==i||10==i||13==i)&&e.push(t.charAt(n))}return e.join("")},HoverIcons=function(t){this.graph=t,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.cssCursor="copy",HoverIcons.prototype.checkCollisions=!0,HoverIcons.prototype.triangleUp=mxClient.IS_SVG?Graph.createSvgImage(26,14,'<path d="m 1 14 L 13 1 L 26 14 z" stroke="#fff" fill="#007dfc"/>'):new mxImage(IMAGE_PATH+"/triangle-up.png",26,14),HoverIcons.prototype.triangleRight=mxClient.IS_SVG?Graph.createSvgImage(14,26,'<path d="m 1 1 L 14 13 L 1 26 z" stroke="#fff" fill="#007dfc"/>'):new mxImage(IMAGE_PATH+"/triangle-right.png",14,26),HoverIcons.prototype.triangleDown=mxClient.IS_SVG?Graph.createSvgImage(26,14,'<path d="m 1 1 L 13 14 L 26 1 z" stroke="#fff" fill="#007dfc"/>'):new mxImage(IMAGE_PATH+"/triangle-down.png",26,14),HoverIcons.prototype.triangleLeft=mxClient.IS_SVG?Graph.createSvgImage(14,26,'<path d="m 14 1 L 1 13 L 14 26 z" stroke="#fff" fill="#007dfc"/>'):new mxImage(IMAGE_PATH+"/triangle-left.png",14,26),HoverIcons.prototype.roundDrop=mxClient.IS_SVG?Graph.createSvgImage(26,26,'<circle cx="13" cy="13" r="12" stroke="#fff" fill="#007dfc"/>'):new mxImage(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=":IMAGE_PATH+"/refresh.png",38,38),HoverIcons.prototype.tolerance=mxClient.IS_TOUCH?6:0,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(t){null!=t.relatedTarget&&mxEvent.getSource(t)==this.graph.container&&this.setDisplay("none")})),this.graph.addListener(mxEvent.START_EDITING,mxUtils.bind(this,function(t){this.reset()}));var e=this.graph.click;this.graph.click=mxUtils.bind(this,function(t){e.apply(this.graph,arguments),null==this.currentState||this.graph.isCellSelected(this.currentState.cell)||!mxEvent.isTouchEvent(t.getEvent())||this.graph.model.isVertex(t.getCell())||this.reset()});var o=!1;this.graph.addMouseListener({mouseDown:mxUtils.bind(this,function(t,e){o=!1;var n=e.getEvent();if(this.isResetEvent(n))this.reset();else if(!this.isActive()){var i=this.getState(e.getState());null==i&&mxEvent.isTouchEvent(n)||this.update(i)}this.setDisplay("none")}),mouseMove:mxUtils.bind(this,function(t,e){var n=e.getEvent();this.isResetEvent(n)?this.reset():this.graph.isMouseDown||mxEvent.isTouchEvent(n)||this.update(this.getState(e.getState()),e.getGraphX(),e.getGraphY()),null!=this.graph.connectionHandler&&null!=this.graph.connectionHandler.shape&&(o=!0)}),mouseUp:mxUtils.bind(this,function(t,e){var n=e.getEvent();this.isResetEvent(n)?this.reset():this.isActive()&&null!=this.mouseDownPoint&&Math.abs(e.getGraphX()-this.mouseDownPoint.x)<this.graph.tolerance&&Math.abs(e.getGraphY()-this.mouseDownPoint.y)<this.graph.tolerance?o||this.click(this.currentState,this.getDirection(),e):this.isActive()?1==this.graph.getSelectionCount()&&this.graph.model.isEdge(this.graph.getSelectionCell())?this.reset():this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(e.getGraphX(),e.getGraphY())))):mxEvent.isTouchEvent(n)||null!=this.bbox&&mxUtils.contains(this.bbox,e.getGraphX(),e.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(n)||this.reset(),o=!1,this.resetActiveArrow()})})},HoverIcons.prototype.isResetEvent=function(t,e){return mxEvent.isAltDown(t)||null==this.activeArrow&&mxEvent.isShiftDown(t)||mxEvent.isMetaDown(t)||mxEvent.isPopupTrigger(t)&&!mxEvent.isControlDown(t)},HoverIcons.prototype.createArrow=function(t,e){var n=null;mxClient.IS_IE&&!mxClient.IS_SVG?(mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?((n=document.createElement(mxClient.VML_PREFIX+":image")).setAttribute("src",t.src),n.style.borderStyle="none"):((n=document.createElement("div")).style.backgroundImage="url("+t.src+")",n.style.backgroundPosition="center",n.style.backgroundRepeat="no-repeat"),n.style.width=t.width+4+"px",n.style.height=t.height+4+"px",n.style.display=mxClient.IS_QUIRKS?"inline":"inline-block"):((n=mxUtils.createImage(t.src)).style.width=t.width+"px",n.style.height=t.height+"px",n.style.padding=this.tolerance+"px"),null!=e&&n.setAttribute("title",e),n.style.position="absolute",n.style.zIndex=1e4,n.style.cursor=this.cssCursor,mxEvent.addGestureListeners(n,mxUtils.bind(this,function(t){null==this.currentState||this.isResetEvent(t)||(this.mouseDownPoint=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(t),mxEvent.getClientY(t)),this.drag(t,this.mouseDownPoint.x,this.mouseDownPoint.y),this.activeArrow=n,this.setDisplay("none"),mxEvent.consume(t))}));var i=mxUtils.bind(this,function(t){mxEvent.isConsumed(t)||this.graph.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,this.currentState))});return mxEvent.redirectMouseEvents(n,this.graph,this.currentState,i),mxEvent.addListener(n,"mouseenter",mxUtils.bind(this,function(t){mxEvent.isMouseEvent(t)&&(null!=this.activeArrow&&this.activeArrow!=n&&mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.graph.connectionHandler.constraintHandler.reset(),mxUtils.setOpacity(n,100),this.activeArrow=n)})),mxEvent.addListener(n,"mouseleave",mxUtils.bind(this,function(t){this.graph.isMouseDown||this.resetActiveArrow()})),n},HoverIcons.prototype.resetActiveArrow=function(){null!=this.activeArrow&&(mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.activeArrow=null)},HoverIcons.prototype.getDirection=function(){var t=mxConstants.DIRECTION_EAST;return this.activeArrow==this.arrowUp?t=mxConstants.DIRECTION_NORTH:this.activeArrow==this.arrowDown?t=mxConstants.DIRECTION_SOUTH:this.activeArrow==this.arrowLeft&&(t=mxConstants.DIRECTION_WEST),t},HoverIcons.prototype.visitNodes=function(t){for(var e=0;e<this.elts.length;e++)null!=this.elts[e]&&t(this.elts[e])},HoverIcons.prototype.removeNodes=function(){this.visitNodes(function(t){null!=t.parentNode&&t.parentNode.removeChild(t)})},HoverIcons.prototype.setDisplay=function(e){this.visitNodes(function(t){t.style.display=e})},HoverIcons.prototype.isActive=function(){return null!=this.activeArrow&&null!=this.currentState},HoverIcons.prototype.drag=function(t,e,n){if(this.graph.popupMenuHandler.hideMenu(),this.graph.stopEditing(!1),null!=this.currentState){this.graph.connectionHandler.start(this.currentState,e,n),this.graph.isMouseTrigger=mxEvent.isMouseEvent(t),this.graph.isMouseDown=!0;var i=this.graph.selectionCellsHandler.getHandler(this.currentState.cell);null!=i&&i.setHandlesVisible(!1)}},HoverIcons.prototype.getStateAt=function(t,e,n){return this.graph.view.getState(this.graph.getCellAt(e,n))},HoverIcons.prototype.click=function(t,e,n){},HoverIcons.prototype.reset=function(t){(t=null==t||t)&&null!=this.updateThread&&window.clearTimeout(this.updateThread),this.mouseDownPoint=null,this.currentState=null,this.activeArrow=null,this.removeNodes(),this.bbox=null},HoverIcons.prototype.repaint=function(){if((this.bbox=null)!=this.currentState){if(this.currentState=this.getState(this.currentState),null!=this.currentState&&this.graph.model.isVertex(this.currentState.cell)&&this.graph.isCellConnectable(this.currentState.cell)){var t=mxRectangle.fromRectangle(this.currentState);null!=this.currentState.shape&&null!=this.currentState.shape.boundingBox&&(t=mxRectangle.fromRectangle(this.currentState.shape.boundingBox)),t.grow(this.graph.tolerance),t.grow(this.arrowSpacing);var e=this.graph.selectionCellsHandler.getHandler(this.currentState.cell);if(null!=e&&(t.x-=e.horizontalOffset/2,t.y-=e.verticalOffset/2,t.width+=e.horizontalOffset,t.height+=e.verticalOffset,null!=e.rotationShape&&null!=e.rotationShape.node&&"hidden"!=e.rotationShape.node.style.visibility&&"none"!=e.rotationShape.node.style.display&&null!=e.rotationShape.boundingBox&&t.add(e.rotationShape.boundingBox)),this.arrowUp.style.left=Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance)+"px",this.arrowUp.style.top=Math.round(t.y-this.triangleUp.height-this.tolerance)+"px",mxUtils.setOpacity(this.arrowUp,this.inactiveOpacity),this.arrowRight.style.left=Math.round(t.x+t.width-this.tolerance)+"px",this.arrowRight.style.top=Math.round(this.currentState.getCenterY()-this.triangleRight.height/2-this.tolerance)+"px",mxUtils.setOpacity(this.arrowRight,this.inactiveOpacity),this.arrowDown.style.left=this.arrowUp.style.left,this.arrowDown.style.top=Math.round(t.y+t.height-this.tolerance)+"px",mxUtils.setOpacity(this.arrowDown,this.inactiveOpacity),this.arrowLeft.style.left=Math.round(t.x-this.triangleLeft.width-this.tolerance)+"px",this.arrowLeft.style.top=this.arrowRight.style.top,mxUtils.setOpacity(this.arrowLeft,this.inactiveOpacity),this.checkCollisions){var n=this.graph.getCellAt(t.x+t.width+this.triangleRight.width/2,this.currentState.getCenterY()),i=this.graph.getCellAt(t.x-this.triangleLeft.width/2,this.currentState.getCenterY()),o=this.graph.getCellAt(this.currentState.getCenterX(),t.y-this.triangleUp.height/2),s=this.graph.getCellAt(this.currentState.getCenterX(),t.y+t.height+this.triangleDown.height/2);null!=n&&n==i&&i==o&&o==s&&(s=o=i=n=null);this.graph.getCellGeometry(this.currentState.cell);var l=mxUtils.bind(this,function(t,e){this.graph.model.isVertex(t)&&this.graph.getCellGeometry(t);e.style.visibility="visible"});l(n,this.arrowRight),l(i,this.arrowLeft),l(o,this.arrowUp),l(s,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.arrowLeft.removeAttribute("title"),this.arrowRight.removeAttribute("title"),this.arrowUp.removeAttribute("title"),this.arrowDown.removeAttribute("title")}else this.reset();null!=this.currentState&&(this.bbox=this.computeBoundingBox(),null!=this.bbox&&this.bbox.grow(10))}},HoverIcons.prototype.computeBoundingBox=function(){var n=this.graph.model.isEdge(this.currentState.cell)?null:mxRectangle.fromRectangle(this.currentState);return this.visitNodes(function(t){if(null!=t.parentNode){var e=new mxRectangle(t.offsetLeft,t.offsetTop,t.offsetWidth,t.offsetHeight);null==n?n=e:n.add(e)}}),n},HoverIcons.prototype.getState=function(t){if(null!=t){var e=t.cell;if(this.graph.getModel().isVertex(e)&&!this.graph.isCellConnectable(e)){var n=this.graph.getModel().getParent(e);this.graph.getModel().isVertex(n)&&this.graph.isCellConnectable(n)&&(e=n)}(this.graph.isCellLocked(e)||this.graph.model.isEdge(e))&&(e=null),t=this.graph.view.getState(e)}return t},HoverIcons.prototype.update=function(t,e,n){if(this.graph.connectionArrowsEnabled){var i=null;this.prev!=t||this.isActive()?(this.startTime=(new Date).getTime(),this.prev=t,i=0,null!=this.updateThread&&window.clearTimeout(this.updateThread),null!=t&&(this.updateThread=window.setTimeout(mxUtils.bind(this,function(){this.isActive()||this.graph.isMouseDown||this.graph.panningHandler.isActive()||(this.prev=t,this.update(t,e,n))}),this.updateDelay+10))):null!=this.startTime&&(i=(new Date).getTime()-this.startTime),this.setDisplay(""),null!=this.currentState&&this.currentState!=t&&i<this.activationDelay&&null!=this.bbox&&!mxUtils.contains(this.bbox,e,n)?this.reset(!1):(null!=this.currentState||i>this.activationDelay)&&this.currentState!=t&&(i>this.updateDelay&&null!=t||null==this.bbox||null==e||null==n||!mxUtils.contains(this.bbox,e,n))&&(null!=t&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(t),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!=t&&this.graph.connectionHandler.constraintHandler.reset()):this.reset())}else this.reset()},HoverIcons.prototype.setCurrentState=function(t){"eastwest"!=t.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=t},function(){var t=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){t.apply(this,arguments),this.validEdges=[]};var i=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(t,e){var n=this.getState(t);return null!=n&&this.graph.model.isEdge(n.cell)&&null!=n.style&&1!=n.style[mxConstants.STYLE_CURVED]&&!n.invalid&&this.updateLineJumps(n)&&this.graph.cellRenderer.redraw(n,!1,this.isRendering()),null!=(n=i.apply(this,arguments))&&this.graph.model.isEdge(n.cell)&&1!=n.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(n),n};var n=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(t,e){return n.apply(this,arguments)||null!=t.routedPoints&&null!=e.routedPoints&&!mxUtils.equalPoints(e.routedPoints,t.routedPoints)};var e=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(t){e.apply(this,arguments),this.graph.model.isEdge(t.cell)&&1!=t.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(t)},mxGraphView.prototype.updateLineJumps=function(s){var t=s.absolutePoints;if(Graph.lineJumpsEnabled){var e=null!=s.routedPoints,l=null;if(null!=t&&null!=this.validEdges&&"none"!==mxUtils.getValue(s.style,"jumpStyle","none")){var n=.5*this.scale;function i(t,e,n){var i=new mxPoint(e,n);i.type=t,l.push(i);var o=null!=s.routedPoints?s.routedPoints[l.length-1]:null;return null==o||o.type!=t||o.x!=e||o.y!=n}e=!1,l=[];for(var o=0;o<t.length-1;o++){for(var r=t[o+1],a=t[o],h=[],d=t[o+2];o<t.length-2&&mxUtils.ptSegDistSq(a.x,a.y,d.x,d.y,r.x,r.y)<1*this.scale*this.scale;)r=d,d=t[++o+2];e=i(0,a.x,a.y)||e;for(var u=0;u<this.validEdges.length;u++){var p=this.validEdges[u],m=p.absolutePoints;if(null!=m&&mxUtils.intersects(s,p)&&"1"!=p.style.noJump)for(var c=0;c<m.length-1;c++){var g,x=m[c+1],y=m[c];for(d=m[c+2];c<m.length-2&&mxUtils.ptSegDistSq(y.x,y.y,d.x,d.y,x.x,x.y)<1*this.scale*this.scale;)x=d,d=m[++c+2];if(null!=(g=mxUtils.intersection(a.x,a.y,r.x,r.y,y.x,y.y,x.x,x.y))&&(Math.abs(g.x-y.x)>n||Math.abs(g.y-y.y)>n)&&(Math.abs(g.x-x.x)>n||Math.abs(g.y-x.y)>n)){for(var f=g.x-a.x,v=g.y-a.y,C={distSq:f*f+v*v,x:g.x,y:g.y},E=0;E<h.length;E++)if(h[E].distSq>C.distSq){h.splice(E,0,C),C=null;break}null==C||0!=h.length&&h[h.length-1].x===C.x&&h[h.length-1].y===C.y||h.push(C)}}}for(c=0;c<h.length;c++)e=i(1,h[c].x,h[c].y)||e}e=i(0,(g=t[t.length-1]).x,g.y)||e}return s.routedPoints=l,e}return!1};var w=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(t,e,n){if(this.routedPoints=null!=this.state?this.state.routedPoints:null,this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)w.apply(this,arguments);else{var i=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,o=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,s=mxUtils.getValue(this.style,"jumpStyle","none"),l=Editor.jumpSizeRatio,r=!0,a=null,h=null,d=[],u=null;t.begin();for(var p=0;p<this.state.routedPoints.length;p++){var m=this.state.routedPoints[p],c=new mxPoint(m.x/this.scale,m.y/this.scale);0==p?c=e[0]:p==this.state.routedPoints.length-1&&(c=e[e.length-1]);var g=!1;if(null!=a&&1==m.type){var x,y,f=this.state.routedPoints[p+1],v=(x=f.x/this.scale-c.x)*x+(y=f.y/this.scale-c.y)*y;if(null==u&&(u=new mxPoint(c.x-a.x,c.y-a.y),h=Math.sqrt(u.x*u.x+u.y*u.y),u.x=u.x*o/h,u.y=u.y*o/h),o*o<v&&0<h)if(o*o<(v=(x=a.x-c.x)*x+(y=a.y-c.y)*y)){var C=new mxPoint(c.x-u.x,c.y-u.y),E=new mxPoint(c.x+u.x,c.y+u.y);d.push(C),this.addPoints(t,d,n,i,!1,null,r);l=Math.round(u.x)<0||0==Math.round(u.x)&&Math.round(u.y)<=0?1:-1;r=!1,"sharp"==s?(t.lineTo(C.x-u.y*l,C.y+u.x*l),t.lineTo(E.x-u.y*l,E.y+u.x*l),t.lineTo(E.x,E.y)):"arc"==s?(l*=1.3,t.curveTo(C.x-u.y*l,C.y+u.x*l,E.x-u.y*l,E.y+u.x*l,E.x,E.y)):(t.moveTo(E.x,E.y),r=!0),d=[E],g=!0}}else u=null;g||(d.push(c),a=c)}this.addPoints(t,d,n,i,!1,null,r),t.stroke()}};var p=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(t,e,n,i){if(null==e||null==t||"1"!=e.style.snapToPoint&&"1"!=t.style.snapToPoint)p.apply(this,arguments);else{e=this.getTerminalPort(t,e,i);var o=this.getNextPoint(t,n,i),s=this.graph.isOrthogonal(t),l=mxUtils.toRadians(Number(e.style[mxConstants.STYLE_ROTATION]||"0")),r=new mxPoint(e.getCenterX(),e.getCenterY());if(0!=l){var a=Math.cos(-l),h=Math.sin(-l);o=mxUtils.getRotatedPoint(o,a,h,r)}var d=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0);d+=parseFloat(t.style[i?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);var u=this.getPerimeterPoint(e,o,0==l&&s,d);if(0!=l){a=Math.cos(l),h=Math.sin(l);u=mxUtils.getRotatedPoint(u,a,h,r)}t.setAbsoluteTerminalPoint(this.snapToAnchorPoint(t,e,n,i,u),i)}},mxGraphView.prototype.snapToAnchorPoint=function(t,e,n,i,o){if(null!=e&&null!=t){var s=this.graph.getAllConnectionConstraints(e),l=null,r=null;if(null!=s)for(var a=0;a<s.length;a++){var h=this.graph.getConnectionPoint(e,s[a]);if(null!=h){var d=(h.x-o.x)*(h.x-o.x)+(h.y-o.y)*(h.y-o.y);(null==r||d<r)&&(l=h,r=d)}}null!=l&&(o=l)}return o};var o=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(t,e,n){var i=o.apply(this,arguments);return"1"==t.getAttribute("placeholders")&&null!=n.state&&(i=n.state.view.graph.replacePlaceholders(n.state.cell,i)),i};var s=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(t){if(null!=t.style&&"undefined"!=typeof pako){var e=mxUtils.getValue(t.style,mxConstants.STYLE_SHAPE,null);if(null!=e&&"stencil("==e.substring(0,8))try{var n=e.substring(8,e.length-1);return new mxShape(new mxStencil(mxUtils.parseXml(t.view.graph.decompress(n)).documentElement))}catch(t){null!=window.console&&console.log("Error in shape: "+t)}}return s.apply(this,arguments)}}(),mxStencilRegistry.libraries={},mxStencilRegistry.dynamicLoading=!0,mxStencilRegistry.allowEval=!0,mxStencilRegistry.packages=[],mxStencilRegistry.getStencil=function(t){var e=mxStencilRegistry.stencils[t];if(null==e&&null==mxCellRenderer.defaultShapes[t]&&mxStencilRegistry.dynamicLoading){var n=mxStencilRegistry.getBasenameForStencil(t);if(null!=n){var i=mxStencilRegistry.libraries[n];if(null!=i){if(null==mxStencilRegistry.packages[n]){for(var o=0;o<i.length;o++){var s=i[o];if(".xml"==s.toLowerCase().substring(s.length-4,s.length))mxStencilRegistry.loadStencilSet(s,null);else if(".js"==s.toLowerCase().substring(s.length-3,s.length))try{if(mxStencilRegistry.allowEval){var l=mxUtils.load(s);null!=l&&200<=l.getStatus()&&l.getStatus()<=299&&eval.call(window,l.getText())}}catch(t){null!=window.console&&console.log("error in getStencil:",s,t)}}mxStencilRegistry.packages[n]=1}}else n=n.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+n+".xml",null);e=mxStencilRegistry.stencils[t]}}return e},mxStencilRegistry.getBasenameForStencil=function(t){var e=null;if(null!=t){var n=t.split(".");if(0<n.length&&"mxgraph"==n[0]){e=n[1];for(var i=2;i<n.length-1;i++)e+="/"+n[i]}}return e},mxStencilRegistry.loadStencilSet=function(e,n,t,i){t=null!=t&&t;var o=mxStencilRegistry.packages[e];if(t||null==o){var s=!1;if(null==o)try{if(i)return void mxStencilRegistry.loadStencil(e,mxUtils.bind(this,function(t){null!=t&&null!=t.documentElement&&(mxStencilRegistry.packages[e]=t,s=!0,mxStencilRegistry.parseStencilSet(t.documentElement,n,s))}));o=mxStencilRegistry.loadStencil(e),mxStencilRegistry.packages[e]=o,s=!0}catch(t){null!=window.console&&console.log("error in loadStencilSet:",e,t)}null!=o&&null!=o.documentElement&&mxStencilRegistry.parseStencilSet(o.documentElement,n,s)}},mxStencilRegistry.loadStencil=function(t,e){if(null==e)return mxUtils.load(t).getXml();mxUtils.get(t,mxUtils.bind(this,function(t){e(200<=t.getStatus()&&t.getStatus()<=299?t.getXml():null)}))},mxStencilRegistry.parseStencilSets=function(t){for(var e=0;e<t.length;e++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(t[e]).documentElement)},mxStencilRegistry.parseStencilSet=function(t,e,n){if("stencils"==t.nodeName)for(var i=t.firstChild;null!=i;)"shapes"==i.nodeName&&mxStencilRegistry.parseStencilSet(i,e,n),i=i.nextSibling;else{n=null==n||n;var o=t.firstChild,s="",l=t.getAttribute("name");for(null!=l&&(s=l+".");null!=o;){if(o.nodeType==mxConstants.NODETYPE_ELEMENT&&null!=(l=o.getAttribute("name"))){s=s.toLowerCase();var r=l.replace(/ /g,"_");if(n&&mxStencilRegistry.addStencil(s+r.toLowerCase(),new mxStencil(o)),null!=e){var a=o.getAttribute("w"),h=o.getAttribute("h");e(s,r,l,a=null==a?80:parseInt(a,10),h=null==h?80:parseInt(h,10))}}o=o.nextSibling}}},void 0!==mxVertexHandler&&function(){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,mxRubberband.prototype.fadeOut=!0,mxGuide.prototype.isEnabledForEvent=function(t){return!mxEvent.isAltDown(t)};var e=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(t){return mxEvent.isControlDown(t)||e.apply(this,arguments)},mxConstraintHandler.prototype.createHighlightShape=function(){var t=new mxEllipse(null,this.highlightColor,this.highlightColor,0);return t.opacity=mxConstants.HIGHLIGHT_OPACITY,t},mxConnectionHandler.prototype.livePreview=!0,mxConnectionHandler.prototype.cursor="crosshair",mxConnectionHandler.prototype.createEdgeState=function(t){var e=this.graph.createCurrentEdgeStyle(),n=this.graph.createEdge(null,null,null,null,null,e),i=new mxCellState(this.graph.view,n,this.graph.getCellStyle(n));for(var o in this.graph.currentEdgeStyle)i.style[o]=this.graph.currentEdgeStyle[o];return i};var n=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var t=n.apply(this,arguments);return t.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED],t},mxConnectionHandler.prototype.updatePreview=function(t){};var i=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var t=i.apply(this,arguments),n=t.getCell;return t.getCell=mxUtils.bind(this,function(t){var e=n.apply(this,arguments);return this.error=null,e}),t},mxConnectionHandler.prototype.isCellEnabled=function(t){return!this.graph.isCellLocked(t)},Graph.prototype.defaultVertexStyle={},Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"},Graph.prototype.createCurrentEdgeStyle=function(){var t="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";";return null!=this.currentEdgeStyle.shape&&(t+="shape="+this.currentEdgeStyle.shape+";"),null!=this.currentEdgeStyle.curved&&(t+="curved="+this.currentEdgeStyle.curved+";"),null!=this.currentEdgeStyle.rounded&&(t+="rounded="+this.currentEdgeStyle.rounded+";"),null!=this.currentEdgeStyle.comic&&(t+="comic="+this.currentEdgeStyle.comic+";"),null!=this.currentEdgeStyle.jumpStyle&&(t+="jumpStyle="+this.currentEdgeStyle.jumpStyle+";"),null!=this.currentEdgeStyle.jumpSize&&(t+="jumpSize="+this.currentEdgeStyle.jumpSize+";"),"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(t+="elbow="+this.currentEdgeStyle.elbow+";"),null!=this.currentEdgeStyle.html?t+="html="+this.currentEdgeStyle.html+";":t+="html=1;",t},Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)},Graph.prototype.loadStylesheet=function(){var t=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=t&&new mxCodec(t.ownerDocument).decode(t,this.getStylesheet())},Graph.prototype.worlfowDesign_adjust_edges=function(t){for(var e=t?t.slice():[],n=0,i=e.length;n<i;++n){var o=e[n];if(!o.edge&&o.edges&&0<o.edges.length){var s=o.edges;this.wfCheckCellEdges(s,o)}}return e},Graph.prototype.wfCheckCellEdges=function(t,e){for(var n=[],i=[],o=[],s=[],l=0,r=t.length;l<r;++l){var a=t[l],h=this.wfGetEdgeStyleToObj(a);a.source.id==e.id?0==h.exitX?n.push(a):1==h.exitX?o.push(a):0==h.exitY?i.push(a):1==h.exitY&&s.push(a):a.target.id==e.id&&(0==h.entryX?n.push(a):1==h.entryX?o.push(a):0==h.entryY?i.push(a):1==h.entryY&&s.push(a))}this.wfCalcNewEdgesCodition(n,i,o,s,e)},Graph.prototype.wfCalcNewEdgesCodition=function(t,e,n,i,o){t=this.wfCheckDirenctionEdgeNum(t,o,"left"),e=this.wfCheckDirenctionEdgeNum(e,o,"top"),n=this.wfCheckDirenctionEdgeNum(n,o,"right"),i=this.wfCheckDirenctionEdgeNum(i,o,"bottom");for(var s=this.wfTestEdgeShouldReCalc(t,o,"left")?this.wfTransferEdgesArr(t,o,"left"):t,l=this.wfTestEdgeShouldReCalc(e,o,"top")?this.wfTransferEdgesArr(e,o,"top"):e,r=this.wfTestEdgeShouldReCalc(n,o,"right")?this.wfTransferEdgesArr(n,o,"right"):n,a=this.wfTestEdgeShouldReCalc(i,o,"bottom")?this.wfTransferEdgesArr(i,o,"bottom"):i,h=s.concat(l).concat(r).concat(a),d=0,u=h.length;d<u;++d){var p=h[d],m=this.wfGetEdgeStyleToObj(p);p.isBeautifulEd||(m=p.source.id==o.id?this.wfTransferEdgesBeautiful(p,m,!1):this.wfTransferEdgesBeautiful(p,m,!0)),1<m.exitX&&(m.exitX=1),1<m.exitY&&(m.exitY=1),1<m.entryX&&(m.entryX=1),1<m.entryY&&(m.entryY=1),m.exitX<0&&(m.exitX=0),m.exitY<0&&(m.exitY=0),m.entryX<0&&(m.entryX=0),m.entryY<0&&(m.entryY=0);var c=this.wfGetEdgeStyleToString(m);p.style=c}o.edges=h},Graph.prototype.wfCheckDirenctionEdgeNum=function(t,e,n){if(1!=t.length)return t;var i=t[0],o=this.wfGetEdgeStyleToObj(i),s=!1;(o.exitX<0||1<o.exitX)&&(o.exitX=.5),(o.exitY<0||1<o.exitY)&&(o.exitY=.5),(o.entryX<0||1<o.entryX)&&(o.entryX=.5),(o.entryY<0||1<o.entryY)&&(o.entryY=.5),!i.isBeautifulEd&&this.wfCheckEdgeInCells(i,o)&&("left"==n||"right"==n?i.source.id==e.id?.5!=o.exitY&&(o.exitY=.5,s=!0):.5!=o.entryY&&(o.entryY=.5,s=!0):i.source.id==e.id?.5!=o.exitX&&(o.exitX=.5,s=!0):.5!=o.entryX&&(o.entryX=.5,s=!0),o=i.source.id==e.id?this.wfTransferEdgesBeautiful(i,o,!1):this.wfTransferEdgesBeautiful(i,o,!0)),s&&i.geometry.points&&(i.geometry.points=null);var l=this.wfGetEdgeStyleToString(o);return i.style=l,t[0]=i,t},Graph.prototype.wfTransferEdgesArr=function(t,e,n){for(var i=t.slice(),o=(10-i.length+1)/2/10,s=0,l=i.length;s<l;++s){var r=i[s],a=this.wfGetEdgeStyleToObj(r);if(!r.isBeautifulEd){a=r.source.id==e.id?("left"==n||"right"==n?a.exitY=o:a.exitX=o,this.wfTransferEdgesBeautiful(r,a,!1)):("left"==n||"right"==n?a.entryY=o:a.entryX=o,this.wfTransferEdgesBeautiful(r,a,!0));var h=this.wfGetEdgeStyleToString(a);r.style=h,r.geometry.points&&(r.geometry.points=null),this.wfHandleIntoHimSelfEdge(r,a),1<(o+=.1)&&(o=1),o<0&&(o=0)}}return i},Graph.prototype.wfHandleIntoHimSelfEdge=function(t,e){if(t.source.id==t.target.id){var n=t.source,i=n.geometry.x,o=n.geometry.y,s=n.geometry.width,l=n.geometry.height,r=e.exitX,a=e.exitY,h=e.entryX,d=e.entryY,u=[];u[0]=new mxPoint(i-20<30?30:i-20,o-20<30?30:o-20),u[1]=new mxPoint(i+s+20,o-20<30?30:o-20),u[2]=new mxPoint(i+s+20,o+l+20),u[3]=new mxPoint(i-20<30?30:i-20,o+l+20);var p=[];1==r&&0==d||0==a&&1==h?(1==r&&0==d?(p[0]=new mxPoint(i+s+20,o+l*a),p[2]=new mxPoint(i+s*h,o-20<30?30:o-20)):(p[0]=new mxPoint(i+s*r,o-20<30?30:o-20),p[2]=new mxPoint(i+s+20,o+l*d)),p[1]=u[1]):0==r&&0==d||0==a&&0==h?(0==r&&0==d?(p[0]=new mxPoint(i-20<30?30:i-20,o+l*a),p[2]=new mxPoint(i+s*h,o-20<30?30:o-20)):(p[0]=new mxPoint(i+s*r,o-20<30?30:o-20),p[2]=new mxPoint(i-20<30?30:i-20,o+l*d)),p[1]=u[0]):0==r&&1==d||1==a&&0==h?(0==r&&1==d?(p[0]=new mxPoint(i-20<30?30:i-20,o+l*a),p[2]=new mxPoint(i+s*h,o+l+20)):(p[0]=new mxPoint(i+s*r,o+l+20),p[2]=new mxPoint(i-20<30?30:i-20,o+l*d)),p[1]=u[3]):1==r&&1==d||1==a&&1==h?(1==r&&1==d?(p[0]=new mxPoint(i+s+20,o+l*a),p[2]=new mxPoint(i+s*h,o+l+20)):(p[0]=new mxPoint(i+s*r,o+l+20),p[2]=new mxPoint(i+s+20,o+l*d)),p[1]=u[2]):1==r&&0==h||0==r&&1==h?(1==r&&0==h?(p[0]=new mxPoint(i+s+20,o+l*a),p[3]=new mxPoint(i-20<30?30:i-20,o+l*d)):(p[0]=new mxPoint(i-20<30?30:i-20,o+l*a),p[3]=new mxPoint(i+s+20,o+l*d)),.5<=a?1==r&&0==h?(p[1]=u[1],p[2]=u[0]):(p[1]=u[0],p[2]=u[1]):1==r&&0==h?(p[1]=u[2],p[2]=u[3]):(p[1]=u[3],p[2]=u[2])):(1==a&&0==d||0==a&&1==d)&&(1==a&&0==d?(p[0]=new mxPoint(i+s*r,o+l+20),p[3]=new mxPoint(i+s*h,o-20<30?30:o-20)):(p[0]=new mxPoint(i+s*r,o-20<30?30:o-20),p[3]=new mxPoint(i+s*h,o+l+20)),.5<=r?1==a&&0==d?(p[1]=u[2],p[2]=u[1]):(p[1]=u[1],p[2]=u[2]):1==a&&0==d?(p[1]=u[3],p[2]=u[0]):(p[1]=u[0],p[2]=u[3])),t.geometry.points=p}},Graph.prototype.wfTransferEdgesBeautiful=function(t,e,n){var i=t.source,o=t.target,s=e.exitX,l=e.exitY,r=e.entryX,a=e.entryY,h=!1,d=!1;if(0==s&&1==r||1==s&&0==r||0==l&&1==a||1==l&&0==a)if(0==s&&1==r||1==s&&0==r){var u=i.geometry.y+i.geometry.height*l,p=o.geometry.y+o.geometry.height*a;0==s&&1==r?0<i.geometry.x-(o.geometry.x+o.geometry.width)&&(h=!0):0<o.geometry.x-(i.geometry.x+i.geometry.width)&&(h=!0);var m=n?p:u;n?(m=p)>i.geometry.y+.2*i.geometry.height&&m<i.geometry.y+.8*i.geometry.height&&h&&(e.exitY=(m-i.geometry.y)/i.geometry.height,d=!0):(m=u)>o.geometry.y+.2*o.geometry.height&&m<o.geometry.y+.8*o.geometry.height&&h&&(e.entryY=(m-o.geometry.y)/o.geometry.height,d=!0)}else if(0==l&&1==a||1==l&&0==a){var c=i.geometry.x+i.geometry.width*s,g=o.geometry.x+o.geometry.width*r;0==l&&1==a?0<i.geometry.y-(o.geometry.y+o.geometry.height)&&(h=!0):0<o.geometry.y-(i.geometry.y+i.geometry.height)&&(h=!0);m=n?g:c;n?(m=g)>i.geometry.x+.2*i.geometry.width&&m<i.geometry.x+.8*i.geometry.width&&h&&(e.exitX=(m-i.geometry.x)/i.geometry.width,d=!0):(m=c)>o.geometry.x+.2*o.geometry.width&&m<o.geometry.x+.8*o.geometry.width&&h&&(e.entryX=(m-o.geometry.x)/o.geometry.width,d=!0)}return d&&(t.isBeautifulEd=!0,t.geometry.points=null),e},Graph.prototype.wfCheckEdgeInCells=function(t,e){var n=t.source,i=t.target,o=e.exitX,s=e.exitY,l=e.entryX,r=e.entryY,a=!1;return(0==o&&1==l||1==o&&0==l||0==s&&1==r||1==s&&0==r)&&(0==o&&1==l||1==o&&0==l?0==o&&1==l?0<n.geometry.x-(i.geometry.x+i.geometry.width)&&(a=!0):0<i.geometry.x-(n.geometry.x+n.geometry.width)&&(a=!0):(0==s&&1==r||1==s&&0==r)&&(0==s&&1==r?0<n.geometry.y-(i.geometry.y+i.geometry.height)&&(a=!0):0<i.geometry.y-(n.geometry.y+n.geometry.height)&&(a=!0))),a},Graph.prototype.wfTestEdgeShouldReCalc=function(t,e,n){for(var i=t.slice(),o=[],s=[],l=[],r=[],a=!1,h=0,d=i.length;h<d;++h){var u=i[h],p=this.wfGetEdgeStyleToObj(u);if(u.source.id==e.id){if("left"==n){if(!(o.indexOf(p.exitY)<0)){a=!0;break}o.push(p.exitY)}else if("top"==n){if(!(s.indexOf(p.exitX)<0)){a=!0;break}s.push(p.exitX)}else if("right"==n){if(!(l.indexOf(p.exitY)<0)){a=!0;break}l.push(p.exitY)}else if("bottom"==n){if(!(r.indexOf(p.exitX)<0)){a=!0;break}r.push(p.exitX)}}else if("left"==n){if(!(o.indexOf(p.entryY)<0)){a=!0;break}o.push(p.entryY)}else if("top"==n){if(!(s.indexOf(p.entryX)<0)){a=!0;break}s.push(p.entryX)}else if("right"==n){if(!(l.indexOf(p.entryY)<0)){a=!0;break}l.push(p.entryY)}else if("bottom"==n){if(!(r.indexOf(p.entryX)<0)){a=!0;break}r.push(p.entryX)}}var m=!1,c="left"==n?o:"top"==n?s:"right"==n?l:r;for(h=0,d=c.length;h<d-1;++h){var g=c[h],x=c[h+1];Math.abs(g-x)<.05&&(m=!0)}return a||m},Graph.prototype.wfGetEdgeStyleToString=function(t){var e="";for(var n in t)n&&(e+=n+"="+t[n]+";");return e},Graph.prototype.wfGetEdgeStyleToObj=function(t){for(var e=t.style.split(";"),n={},i=0,o=e.length;i<o;++i){var s=e[i].split("=");n[s[0]]=s[1]}return n},Graph.prototype.importGraphModel=function(t,e,n,i){e=null!=e?e:0,n=null!=n?n:0;var o=[],s=new mxGraphModel;new mxCodec(t.ownerDocument).decode(t,s);var l=s.getChildCount(s.getRoot());this.model.getChildCount(this.model.getRoot());this.model.beginUpdate();try{for(var r=new Object,a=0;a<l;a++){var h=s.getChildAt(s.getRoot(),a);if(1!=l||this.isCellLocked(this.getDefaultParent())){h=this.importCells([h],0,0,this.model.getRoot(),null,r)[0];d=this.model.getChildren(h);this.moveCells(d,e,n),o=o.concat(d)}else{var d=s.getChildren(h);mxClient.IS_E9_SAVED||this.worlfowDesign_adjust_edges(d),o=o.concat(this.importCells(d,e,n,this.getDefaultParent(),null,r))}}if(i){this.isGridEnabled()&&(e=this.snap(e),n=this.snap(n));var u=this.getBoundingBoxFromGeometry(o,!0);null!=u&&this.moveCells(o,e-u.x,n-u.y)}}finally{this.model.endUpdate()}return o},Graph.prototype.getAllConnectionConstraints=function(t,e){if(null!=t){var n=mxUtils.getValue(t.style,"points",null);if(null!=n){var i=[];try{for(var o=JSON.parse(n),s=0;s<o.length;s++){var l=o[s];i.push(new mxConnectionConstraint(new mxPoint(l[0],l[1]),!(2<l.length)||"0"!=l[2]))}}catch(t){}return i}if(null!=t.shape)if(null!=t.shape.stencil){if(null!=t.shape.stencil)return t.shape.stencil.constraints}else if(null!=t.shape.constraints){var r=[];if("rhombus"==t.style.shape||"ellipse"==t.style.shape)for(s=4;s<t.shape.constraints.length;s++)r.push(t.shape.constraints[s]);else r=t.shape.constraints;return r}}return null},Graph.prototype.flipEdge=function(t){if(null!=t){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);if(null!=n){var i=mxUtils.getValue(n,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL;this.setCellStyles(mxConstants.STYLE_ELBOW,i,[t])}}},Graph.prototype.isValidRoot=function(t){for(var e=this.model.getChildCount(t),n=0,i=0;i<e;i++){var o=this.model.getChildAt(t,i);if(this.model.isVertex(o)){var s=this.getCellGeometry(o);null==s||s.relative||n++}}return 0<n||this.isContainer(t)},Graph.prototype.isValidDropTarget=function(t){var e=this.view.getState(t),n=null!=e?e.style:this.getCellStyle(t);return"1"!=mxUtils.getValue(n,"part","0")&&(this.isContainer(t)||mxGraph.prototype.isValidDropTarget.apply(this,arguments)&&"0"!=mxUtils.getValue(n,"dropTarget","1"))},Graph.prototype.createGroupCell=function(){var t=mxGraph.prototype.createGroupCell.apply(this,arguments);return t.setStyle("group"),t},Graph.prototype.isExtendParentsOnAdd=function(t){var e=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(e&&null!=t&&null!=this.layoutManager){var n=this.model.getParent(t);if(null!=n){var i=this.layoutManager.getLayout(n);null!=i&&i.constructor==mxStackLayout&&(e=!1)}}return e},Graph.prototype.getPreferredSizeForCell=function(t){var e=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);return null!=e&&(e.width+=10,e.height+=4,this.gridEnabled&&(e.width=this.snap(e.width),e.height=this.snap(e.height))),e},Graph.prototype.turnShapes=function(t){var e=this.getModel(),n=[];e.beginUpdate();try{for(var i=0;i<t.length;i++){var o=t[i];if(e.isEdge(o)){var s=e.getTerminal(o,!0),l=e.getTerminal(o,!1);if(e.setTerminal(o,l,!0),e.setTerminal(o,s,!1),null!=(c=e.getGeometry(o))){null!=(c=c.clone()).points&&c.points.reverse();var r=c.getTerminalPoint(!0),a=c.getTerminalPoint(!1);c.setTerminalPoint(r,!1),c.setTerminalPoint(a,!0),e.setGeometry(o,c);var h=this.view.getState(o),d=this.view.getState(s),u=this.view.getState(l);if(null!=h){var p=null!=d?this.getConnectionConstraint(h,d,!0):null,m=null!=u?this.getConnectionConstraint(h,u,!1):null;this.setConnectionConstraint(o,s,!0,m),this.setConnectionConstraint(o,l,!1,p)}n.push(o)}}else if(e.isVertex(o)){var c;if(null!=(c=this.getCellGeometry(o))){(c=c.clone()).x+=c.width/2-c.height/2,c.y+=c.height/2-c.width/2;var g=c.width;c.width=c.height,c.height=g,e.setGeometry(o,c);var x=this.view.getState(o);if(null!=x){var y=x.style[mxConstants.STYLE_DIRECTION]||"east";"east"==y?y="south":"south"==y?y="west":"west"==y?y="north":"north"==y&&(y="east"),this.setCellStyles(mxConstants.STYLE_DIRECTION,y,[o])}n.push(o)}}}}finally{e.endUpdate()}return n},Graph.prototype.processChange=function(t){if(mxGraph.prototype.processChange.apply(this,arguments),t instanceof mxValueChange&&null!=t.cell&&null!=t.cell.value&&"object"==typeof t.cell.value){var e=this.model.getDescendants(t.cell);if(0<e.length)for(var n=0;n<e.length;n++)this.isReplacePlaceholders(e[n])&&this.view.invalidate(e[n],!1,!1)}},Graph.prototype.replaceElement=function(t,e){for(var n=t.ownerDocument.createElement(null!=e?e:"span"),i=Array.prototype.slice.call(t.attributes);attr=i.pop();)n.setAttribute(attr.nodeName,attr.nodeValue);n.innerHTML=t.innerHTML,t.parentNode.replaceChild(n,t)},Graph.prototype.updateLabelElements=function(t,e,n){t=null!=t?t:this.getSelectionCells();for(var i=document.createElement("div"),o=0;o<t.length;o++)if(this.isHtmlLabel(t[o])){var s=this.convertValueToString(t[o]);if(null!=s&&0<s.length){i.innerHTML=s;for(var l=i.getElementsByTagName(null!=n?n:"*"),r=0;r<l.length;r++)e(l[r]);i.innerHTML!=s&&this.cellLabelChanged(t[o],i.innerHTML)}}},Graph.prototype.cellLabelChanged=function(t,e,n){e=this.zapGremlins(e),this.model.beginUpdate();try{if(null!=t.value&&"object"==typeof t.value){if(this.isReplacePlaceholders(t)&&null!=t.getAttribute("placeholder"))for(var i=t.getAttribute("placeholder"),o=t;null!=o;){if(o==this.model.getRoot()||null!=o.value&&"object"==typeof o.value&&o.hasAttribute(i)){this.setAttributeForCell(o,i,e);break}o=this.model.getParent(o)}var s=t.value.cloneNode(!0);s.setAttribute("label",e),e=s}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}},Graph.prototype.cellsRemoved=function(t){if(null!=t){for(var e=new mxDictionary,n=0;n<t.length;n++)e.put(t[n],!0);var i=[];for(n=0;n<t.length;n++){var o=this.model.getParent(t[n]);null==o||e.get(o)||(e.put(o,!0),i.push(o))}for(n=0;n<i.length;n++){var s=this.view.getState(i[n]);if(null!=s&&(this.model.isEdge(s.cell)||this.model.isVertex(s.cell))&&this.isCellDeletable(s.cell)){var l=mxUtils.getValue(s.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),r=mxUtils.getValue(s.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);if(l==mxConstants.NONE&&r==mxConstants.NONE){for(var a=!0,h=0;h<this.model.getChildCount(s.cell)&&a;h++)e.get(this.model.getChildAt(s.cell,h))||(a=!1);a&&t.push(s.cell)}}}}mxGraph.prototype.cellsRemoved.apply(this,arguments)},Graph.prototype.removeCellsAfterUngroup=function(t){for(var e=[],n=0;n<t.length;n++)if(this.isCellDeletable(t[n])){var i=this.view.getState(t[n]);if(null!=i){var o=mxUtils.getValue(i.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),s=mxUtils.getValue(i.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);o==mxConstants.NONE&&s==mxConstants.NONE&&e.push(t[n])}}t=e,mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)},Graph.prototype.setLinkForCell=function(t,e){this.setAttributeForCell(t,"link",e)},Graph.prototype.setTooltipForCell=function(t,e){this.setAttributeForCell(t,"tooltip",e)},Graph.prototype.setAttributeForCell=function(t,e,n){var i=null;null!=t.value&&"object"==typeof t.value?i=t.value.cloneNode(!0):(i=mxUtils.createXmlDocument().createElement("UserObject")).setAttribute("label",t.value||"");null!=n&&0<n.length?i.setAttribute(e,n):i.removeAttribute(e),this.model.setValue(t,i)},Graph.prototype.getDropTarget=function(t,e,n,i){this.getModel();if(mxEvent.isAltDown(e))return null;for(var o=0;o<t.length;o++)if(this.model.isEdge(this.model.getParent(t[o])))return null;return mxGraph.prototype.getDropTarget.apply(this,arguments)},Graph.prototype.click=function(t){mxGraph.prototype.click.call(this,t),this.firstClickState=t.getState(),this.firstClickSource=t.getSource()},Graph.prototype.dblClick=function(t,e){if(this.isEnabled()){var n=mxUtils.convertPoint(this.container,mxEvent.getClientX(t),mxEvent.getClientY(t));if(null!=t&&!this.model.isVertex(e)){var i=this.model.isEdge(e)?this.view.getState(e):null,o=mxEvent.getSource(t);this.firstClickState==i&&this.firstClickSource==o&&(null!=i&&null!=i.text&&null!=i.text.node&&(mxUtils.contains(i.text.boundingBox,n.x,n.y)||mxUtils.isAncestorNode(i.text.node,mxEvent.getSource(t)))||(null==i&&!this.isCellLocked(this.getDefaultParent())||null!=i&&!this.isCellLocked(i.cell))&&(null!=i||mxClient.IS_VML&&o==this.view.getCanvas()||mxClient.IS_SVG&&this.view.getCanvas().ownerSVGElement))}mxGraph.prototype.dblClick.call(this,t,e)}},Graph.prototype.getInsertPoint=function(){var t=this.getGridSize(),e=this.container.scrollLeft/this.view.scale-this.view.translate.x,n=this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible){var i=this.getPageLayout(),o=this.getPageSize();e=Math.max(e,i.x*o.width),n=Math.max(n,i.y*o.height)}return new mxPoint(this.snap(e+t),this.snap(n+t))},Graph.prototype.getFreeInsertPoint=function(){var t=this.view,e=this.getGraphBounds(),n=this.getInsertPoint();return new mxPoint(this.snap(Math.round(Math.max(n.x,e.x/t.scale-t.translate.x+(0==e.width?2*this.gridSize:0)))),this.snap(Math.round(Math.max(n.y,(e.y+e.height)/t.scale-t.translate.y+2*this.gridSize))))},Graph.prototype.isMouseInsertPoint=function(){return!1},Graph.prototype.addText=function(t,e,n){var i=new mxCell;if(i.value="Text",i.style="text;html=1;resizable=0;points=[];",i.geometry=new mxGeometry(0,0,0,0),i.vertex=!0,null!=n){i.style+="align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;",i.geometry.relative=!0,i.connectable=!1;var o=this.view.getRelativePoint(n,t,e);i.geometry.x=Math.round(1e4*o.x)/1e4,i.geometry.y=Math.round(o.y),i.geometry.offset=new mxPoint(0,0),o=this.view.getPoint(n,i.geometry);var s=this.view.scale;i.geometry.offset=new mxPoint(Math.round((t-o.x)/s),Math.round((e-o.y)/s))}else{i.style+="autosize=1;align=left;verticalAlign=top;spacingTop=-4;";var l=this.view.translate;i.geometry.width=40,i.geometry.height=20,i.geometry.x=Math.round(t/this.view.scale)-l.x,i.geometry.y=Math.round(e/this.view.scale)-l.y}this.getModel().beginUpdate();try{this.addCells([i],null!=n?n.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[i])),this.autoSizeCell(i)}finally{this.getModel().endUpdate()}return i},Graph.prototype.getAbsoluteUrl=function(t){return null!=t&&this.isRelativeUrl(t)&&(t="#"==t.charAt(0)?this.baseUrl+t:"/"==t.charAt(0)?this.domainUrl+t:this.domainPathUrl+t),t},Graph.prototype.addClickHandler=function(t,r,a){var e=mxUtils.bind(this,function(){var t=this.container.getElementsByTagName("a");if(null!=t)for(var e=0;e<t.length;e++){var n=this.getAbsoluteUrl(t[e].getAttribute("href"));null!=n&&(t[e].setAttribute("href",n),null!=r&&mxEvent.addGestureListeners(t[e],null,null,r))}});this.model.addListener(mxEvent.CHANGE,e),e();var n=this.container.style.cursor,h=this.getTolerance(),d=this,i={currentState:null,currentLink:null,highlight:null!=t&&""!=t&&t!=mxConstants.NONE?new mxCellHighlight(d,t,4):null,startX:0,startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(t){var e=t.sourceState;if(null==e||null==d.getLinkForCell(e.cell)){var n=d.getCellAt(t.getGraphX(),t.getGraphY(),null,null,null,function(t,e,n){return null==d.getLinkForCell(t.cell)});e=d.view.getState(n)}e!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=e,null!=this.currentState&&this.activate(this.currentState))},mouseDown:function(t,e){this.startX=e.getGraphX(),this.startY=e.getGraphY(),this.scrollLeft=d.container.scrollLeft,this.scrollTop=d.container.scrollTop,null==this.currentLink&&"auto"==d.container.style.overflow&&(d.container.style.cursor="move"),this.updateCurrentState(e)},mouseMove:function(t,e){if(d.isMouseDown){if(null!=this.currentLink){var n=Math.abs(this.startX-e.getGraphX()),i=Math.abs(this.startY-e.getGraphY());(h<n||h<i)&&this.clear()}}else{for(var o=e.getSource();null!=o&&"a"!=o.nodeName.toLowerCase();)o=o.parentNode;if(null!=o)this.clear();else{if(null!=d.tooltipHandler&&null!=this.currentLink&&null!=this.currentState&&d.tooltipHandler.reset(e,!0,this.currentState),null!=this.currentState&&(e.getState()==this.currentState||null==e.sourceState)&&d.intersects(this.currentState,e.getGraphX(),e.getGraphY()))return;this.updateCurrentState(e)}}},mouseUp:function(t,e){for(var n=e.getSource(),i=e.getEvent(),o=n;null!=o&&"a"!=o.nodeName.toLowerCase();)o=o.parentNode;if(null==o&&Math.abs(this.scrollLeft-d.container.scrollLeft)<h&&Math.abs(this.scrollTop-d.container.scrollTop)<h&&(null==e.sourceState||!e.isSource(e.sourceState.control))&&((mxEvent.isLeftMouseButton(i)||mxEvent.isMiddleMouseButton(i))&&!mxEvent.isPopupTrigger(i)||mxEvent.isTouchEvent(i)))if(null!=this.currentLink){var s=d.isBlankLink(this.currentLink);if("data:"!==this.currentLink.substring(0,5)&&s||null==r||r(i,this.currentLink),!mxEvent.isConsumed(i)){var l=mxEvent.isMiddleMouseButton(i)?"_blank":s?d.linkTarget:"_top";d.openLink(this.currentLink,l),e.consume()}}else null!=a&&!e.isConsumed()&&Math.abs(this.scrollLeft-d.container.scrollLeft)<h&&Math.abs(this.scrollTop-d.container.scrollTop)<h&&Math.abs(this.startX-e.getGraphX())<h&&Math.abs(this.startY-e.getGraphY())<h&&a(e.getEvent());this.clear()},activate:function(t){this.currentLink=d.getAbsoluteUrl(d.getLinkForCell(t.cell)),null!=this.currentLink&&(d.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(t))},clear:function(){null!=d.container&&(d.container.style.cursor=n),this.currentState=null,(this.currentLink=null)!=this.highlight&&this.highlight.hide(),null!=d.tooltipHandler&&d.tooltipHandler.hide()}};d.click=function(t){},d.addMouseListener(i),mxEvent.addListener(document,"mouseleave",function(t){i.clear()})},Graph.prototype.duplicateCells=function(t,e){t=null!=t?t:this.getSelectionCells(),e=null==e||e,t=this.model.getTopmostCells(t);for(var n,i=!1,o=0;o<t.length;++o)if(0==t[o].nodeType){i=!0,n=o;break}i&&(t.splice(n,1),wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(389951,"必须有一个创建节点!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}}));var s=this.getModel(),l=this.gridSize,r=[];s.beginUpdate();try{var a=this.cloneCells(t,!1);for(o=0;o<t.length;o++){var h=s.getParent(t[o]),d=this.moveCells([a[o]],l,l,!1)[0];if(r.push(d),e)s.add(h,a[o]);else{var u=h.getIndex(t[o]);s.add(h,a[o],u+1)}}}finally{s.endUpdate()}return r},Graph.prototype.insertImage=function(t,e,n){if(null!=t){for(var i=this.cellEditor.textarea.getElementsByTagName("img"),o=[],s=0;s<i.length;s++)o.push(i[s]);document.execCommand("insertimage",!1,t);var l=this.cellEditor.textarea.getElementsByTagName("img");if(l.length==o.length+1)for(s=l.length-1;0<=s;s--)if(0==s||l[s]!=o[s-1]){l[s].setAttribute("width",e),l[s].setAttribute("height",n);break}}},Graph.prototype.insertLink=function(t){0==t.length?document.execCommand("unlink",!1):document.execCommand("createlink",!1,mxUtils.trim(t))},Graph.prototype.isCellResizable=function(t){var e=mxGraph.prototype.isCellResizable.apply(this,arguments),n=this.view.getState(t),i=null!=n?n.style:this.getCellStyle(t);return e||"0"!=mxUtils.getValue(i,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==i[mxConstants.STYLE_WHITE_SPACE]},Graph.prototype.distributeCells=function(n,t){if(null==t&&(t=this.getSelectionCells()),null!=t&&1<t.length){for(var e=[],i=null,o=null,s=0;s<t.length;s++)if(this.getModel().isVertex(t[s])){var l=this.view.getState(t[s]);if(null!=l){var r=n?l.getCenterX():l.getCenterY();i=null!=i?Math.max(i,r):r,o=null!=o?Math.min(o,r):r,e.push(l)}}if(2<e.length){e.sort(function(t,e){return n?t.x-e.x:t.y-e.y});var a=this.view.translate,h=this.view.scale;o=o/h-(n?a.x:a.y),i=i/h-(n?a.x:a.y),this.getModel().beginUpdate();try{var d=(i-o)/(e.length-1),u=o;for(s=1;s<e.length-1;s++){var p=this.view.getState(this.model.getParent(e[s].cell)),m=this.getCellGeometry(e[s].cell);u+=d,null!=m&&null!=p&&(m=m.clone(),n?m.x=Math.round(u-m.width/2)-p.origin.x:m.y=Math.round(u-m.height/2)-p.origin.y,this.getModel().setGeometry(e[s].cell,m))}}finally{this.getModel().endUpdate()}}}return t},Graph.prototype.isCloneEvent=function(t){return!1},Graph.prototype.encodeCells=function(t){for(var e=this.cloneCells(t),n=new mxDictionary,i=0;i<t.length;i++)n.put(t[i],!0);for(i=0;i<e.length;i++){var o=this.view.getState(t[i]);if(null!=o){var s=this.getCellGeometry(e[i]);null==s||!s.relative||this.model.isEdge(t[i])||n.get(this.model.getParent(t[i]))||(s.relative=!1,s.x=o.x/o.view.scale-o.view.translate.x,s.y=o.y/o.view.scale-o.view.translate.y)}}var l=new mxCodec,r=new mxGraphModel,a=r.getChildAt(r.getRoot(),0);for(i=0;i<t.length;i++)r.add(a,e[i]);return l.encode(r)},Graph.prototype.createSvgImageExport=function(){var t=new mxImageExport;return t.getLinkForCellState=mxUtils.bind(this,function(t,e){return this.getLinkForCell(t.cell)}),t},Graph.prototype.getSvg=function(t,e,n,i,o,s,l,r){var a=this.useCssTransforms;a&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{e=null!=e?e:1,n=null!=n?n:0,o=null==o||o,l=null==l||l;var h=(s=null==s||s)||i?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==h)throw Error(mxResources.get("drawingEmpty"));var d=this.view.scale,u=mxUtils.createXmlDocument(),p=null!=u.createElementNS?u.createElementNS(mxConstants.NS_SVG,"svg"):u.createElement("svg");null!=t&&(null!=p.style?p.style.backgroundColor=t:p.setAttribute("style","background-color:"+t)),null==u.createElementNS?(p.setAttribute("xmlns",mxConstants.NS_SVG),p.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):p.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);var m=e/d;p.setAttribute("width",Math.max(1,Math.ceil(h.width*m)+2*n)+"px"),p.setAttribute("height",Math.max(1,Math.ceil(h.height*m)+2*n)+"px"),p.setAttribute("version","1.1");var c=p;if(o){var g=null!=u.createElementNS?u.createElementNS(mxConstants.NS_SVG,"g"):u.createElement("g");g.setAttribute("transform","translate(0.5,0.5)"),p.appendChild(g),u.appendChild(p),c=g}else u.appendChild(p);var x=this.createSvgCanvas(c);(Graph.prototype.svgCanvas=x).foOffset=o?-.5:0,x.textOffset=o?-.5:0,x.imageOffset=o?-.5:0,x.translate(Math.floor((n/e-h.x)/d),Math.floor((n/e-h.y)/d));var y=document.createElement("textarea"),f=x.createAlternateContent;x.createAlternateContent=function(t,e,n,i,o,s,l,r,a,h,d,u,p){var m=this.state;if(null==this.foAltText||!(0==i||0!=m.fontSize&&s.length<5*i/m.fontSize))return f.apply(this,arguments);var c=this.createElement("text");c.setAttribute("x",Math.round(i/2)),c.setAttribute("y",Math.round((o+m.fontSize)/2)),c.setAttribute("fill",m.fontColor||"black"),c.setAttribute("text-anchor","middle"),c.setAttribute("font-size",Math.round(m.fontSize)+"px"),c.setAttribute("font-family",m.fontFamily),(m.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&c.setAttribute("font-weight","bold"),(m.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&c.setAttribute("font-style","italic"),(m.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&c.setAttribute("text-decoration","underline");try{return y.innerHTML=s,c.textContent=y.value,c}catch(t){return f.apply(this,arguments)}};var v=this.backgroundImage;if(null!=v){var C=d/e,E=this.view.translate,w=new mxRectangle(E.x*C,E.y*C,v.width*C,v.height*C);mxUtils.intersects(h,w)&&x.image(E.x,E.y,v.width,v.height,v.src,!0)}x.scale(m),x.textEnabled=l;var S=(r=null!=r?r:this.createSvgImageExport()).drawCellState;return r.drawCellState=function(t,e){for(var n=t.view.graph,i=n.isCellSelected(t.cell),o=n.model.getParent(t.cell);!s&&!i&&null!=o;)i=n.isCellSelected(o),o=n.model.getParent(o);(s||i)&&S.apply(this,arguments)},r.drawState(this.getView().getState(this.model.root),x),p}finally{a&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}},Graph.prototype.createSvgCanvas=function(t){return new mxSvgCanvas2D(t)},Graph.prototype.getSelectedElement=function(){var t=null;if(window.getSelection){var e=window.getSelection();if(e.getRangeAt&&e.rangeCount)t=e.getRangeAt(0).commonAncestorContainer}else document.selection&&(t=document.selection.createRange().parentElement());return t},Graph.prototype.getParentByName=function(t,e,n){for(;null!=t;){if(t.nodeName==e)return t;if(t==n)return null;t=t.parentNode}return t},Graph.prototype.selectNode=function(t){var e=null;if(window.getSelection)(e=window.getSelection()).getRangeAt&&e.rangeCount&&((n=document.createRange()).selectNode(t),e.removeAllRanges(),e.addRange(n));else if((e=document.selection)&&"Control"!=e.type){var n,i=e.createRange();i.collapse(!0),(n=e.createRange()).setEndPoint("StartToStart",i),n.select()}},Graph.prototype.insertRow=function(t,e){for(var n=t.tBodies[0],i=n.rows[0].cells,o=0,s=0;s<i.length;s++){var l=i[s].getAttribute("colspan");o=null!=l?parseInt(l):1}var r=n.insertRow(e);for(s=0;s<o;s++)mxUtils.br(r.insertCell(-1));return r.cells[0]},Graph.prototype.deleteRow=function(t,e){t.tBodies[0].deleteRow(e)},Graph.prototype.insertColumn=function(t,e){var n=t.tHead;if(null!=n)for(var i=0;i<n.rows.length;i++){var o=document.createElement("th");n.rows[i].appendChild(o),mxUtils.br(o)}for(var s=t.tBodies[0],l=0;l<s.rows.length;l++){var r=s.rows[l].insertCell(e);mxUtils.br(r)}return s.rows[0].cells[0<=e?e:s.rows[0].cells.length-1]},Graph.prototype.deleteColumn=function(t,e){if(0<=e)for(var n=t.tBodies[0].rows,i=0;i<n.length;i++)n[i].cells.length>e&&n[i].deleteCell(e)},Graph.prototype.pasteHtmlAtCaret=function(t){var e,n;if(window.getSelection){if((e=window.getSelection()).getRangeAt&&e.rangeCount){(n=e.getRangeAt(0)).deleteContents();var i=document.createElement("div");i.innerHTML=t;for(var o,s=document.createDocumentFragment();o=i.firstChild;)lastNode=s.appendChild(o);n.insertNode(s)}}else(e=document.selection)&&"Control"!=e.type&&e.createRange().pasteHTML(t)},Graph.prototype.createLinkForHint=function(t,e){e=null!=e?e:t;var n=document.createElement("a");n.setAttribute("href",this.getAbsoluteUrl(t)),null==t||this.isCustomLink(t)||n.setAttribute("title",t),null!=this.linkTarget&&n.setAttribute("target",this.linkTarget);return 40<e.length&&(e=e.substring(0,26)+"..."+e.substring(e.length-10)),mxUtils.write(n,e),n},Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first},this.addListener(mxEvent.START_EDITING,function(t,e){this.popupMenuHandler.hideMenu()});var n=this.updateMouseEvent,i=!(this.updateMouseEvent=function(t){if(t=n.apply(this,arguments),mxEvent.isTouchEvent(t.getEvent())&&null==t.getState()){var e=this.getCellAt(t.graphX,t.graphY);null!=e&&this.isSwimlane(e)&&this.hitsSwimlaneContent(e,t.graphX,t.graphY)?e=null:(t.state=this.view.getState(e),null!=t.state&&null!=t.state.shape&&(this.container.style.cursor=t.state.shape.node.style.cursor))}return null==t.getState()&&this.isEnabled()&&(this.container.style.cursor="default"),t}),o=!1,s=!1,l=this.fireMouseEvent;this.fireMouseEvent=function(t,e,n){t==mxEvent.MOUSE_DOWN&&(e=this.updateMouseEvent(e),i=this.isCellSelected(e.getCell()),o=this.isSelectionEmpty(),s=this.popupMenuHandler.isMenuShowing()),l.apply(this,arguments)},this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(t,e){this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==e.getState()||!e.isSource(e.getState().control))&&(this.popupMenuHandler.popupTrigger||!s&&!mxEvent.isMouseEvent(e.getEvent())&&(o&&null==e.getCell()&&this.isSelectionEmpty()||i&&this.isCellSelected(e.getCell()))),mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,arguments)})},mxCellEditor.prototype.isContentEditing=function(){var t=this.graph.view.getState(this.editingCell);return null!=t&&1==t.style.html},mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var t=window.getSelection();if(t.getRangeAt&&t.rangeCount){for(var e=[],n=0,i=t.rangeCount;n<i;++n)e.push(t.getRangeAt(n));return e}}else if(document.selection&&document.selection.createRange)return document.selection.createRange();return null},mxCellEditor.prototype.restoreSelection=function(t){try{if(t)if(window.getSelection){sel=window.getSelection(),sel.removeAllRanges();for(var e=0,n=t.length;e<n;++e)sel.addRange(t[e])}else document.selection&&t.select&&t.select()}catch(t){}};var o=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(t){null!=t.text&&(t.text.replaceLinefeeds="0"!=mxUtils.getValue(t.style,"nl2Br","1")),o.apply(this,arguments)};var s=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(t,e){this.isKeepFocusEvent(t)||!mxEvent.isAltDown(t.getEvent())?s.apply(this,arguments):this.reset()},mxGuide.prototype.createGuideShape=function(t){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)},mxCellEditor.prototype.escapeCancelsEditing=!1;var l=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(t,e){l.apply(this,arguments)};var r=mxCellEditor.prototype.installListeners;mxCellEditor.prototype.installListeners=function(t){function o(t){for(var e=t.firstChild;null!=e;){var n=e.nextSibling;o(e),e=n}1==t.nodeType&&("BR"===t.nodeName||null!=t.firstChild)||3==t.nodeType&&0!=mxUtils.trim(mxUtils.getTextContent(t)).length?(3==t.nodeType&&mxUtils.setTextContent(t,mxUtils.getTextContent(t).replace(/\n|\r/g,"")),1==t.nodeType&&(t.removeAttribute("style"),t.removeAttribute("class"),t.removeAttribute("width"),t.removeAttribute("cellpadding"),t.removeAttribute("cellspacing"),t.removeAttribute("border"))):t.parentNode.removeChild(t)}r.apply(this,arguments),mxClient.IS_QUIRKS||7===document.documentMode||8===document.documentMode||mxEvent.addListener(this.textarea,"paste",mxUtils.bind(this,function(t){var e=function t(e,n){e=(n.originalNode=e).firstChild;for(var i=n.firstChild;null!=e&&null!=i;)t(e,i),e=e.nextSibling,i=i.nextSibling;return n}(this.textarea,this.textarea.cloneNode(!0));window.setTimeout(mxUtils.bind(this,function(){!function t(e,n){if(null!=e)if(n.originalNode!=e)o(e);else for(e=e.firstChild,n=n.firstChild;null!=e;){var i=e.nextSibling;null==n?o(e):(t(e,n),n=n.nextSibling),e=i}}(this.textarea,e)}),0)}))},mxCellEditor.prototype.toggleViewMode=function(){var t=this.graph.view.getState(this.editingCell),e=null!=t&&"0"!=mxUtils.getValue(t.style,"nl2Br","1"),n=this.saveSelection();if(this.codeViewMode){0<(a=mxUtils.extractTextWithWhitespace(this.textarea.childNodes)).length&&"\n"==a.charAt(a.length-1)&&(a=a.substring(0,a.length-1)),a=this.graph.sanitizeHtml(e?a.replace(/\n/g,"<br/>"):a,!0),this.textarea.className="mxCellEditor geContentEditable";h=mxUtils.getValue(t.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE);var i=mxUtils.getValue(t.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),o=mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),s=(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,l=(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,r=(mxUtils.getValue(t.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(h*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT,this.textarea.style.fontSize=Math.round(h)+"px",this.textarea.style.textDecoration=r?"underline":"",this.textarea.style.fontWeight=s?"bold":"normal",this.textarea.style.fontStyle=l?"italic":"",this.textarea.style.fontFamily=i,this.textarea.style.textAlign=o,this.textarea.style.padding="0px",this.textarea.innerHTML!=a&&(this.textarea.innerHTML=a,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 a=mxUtils.htmlEntities(this.textarea.innerHTML);mxClient.IS_QUIRKS||8==document.documentMode||(a=mxUtils.replaceTrailingNewlines(a,"<div><br></div>")),a=this.graph.sanitizeHtml(e?a.replace(/\n/g,"").replace(/&lt;br\s*.?&gt;/g,"<br>"):a,!0),this.textarea.className="mxCellEditor mxPlainTextEditor";var h=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(h*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT,this.textarea.style.fontSize=Math.round(h)+"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!=a&&(this.textarea.innerHTML=a),this.codeViewMode=!0}this.textarea.focus(),null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState),this.switchSelectionState=n,this.resize()};var a=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(t,e){if(null!=this.textarea){t=this.graph.getView().getState(this.editingCell);if(this.codeViewMode&&null!=t){var n=t.view.scale;if(this.bounds=mxRectangle.fromRectangle(t),0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*n,this.bounds.height=60*n;var i=null!=t.text?t.text.margin:null;null==i&&(i=mxUtils.getAlignmentAsPoint(mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE))),this.bounds.x+=i.x*this.bounds.width,this.bounds.y+=i.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/n)+"px",this.textarea.style.height=Math.round((this.bounds.height-4)/n)+"px",this.textarea.style.overflow="auto",this.textarea.clientHeight<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/n)+(this.textarea.offsetHeight-this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*n),this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/n)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*n),this.textarea.style.left=Math.round(this.bounds.x)+"px",this.textarea.style.top=Math.round(this.bounds.y)-16+"px",mxClient.IS_VML?this.textarea.style.zoom=n:mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+n+","+n+")")}else this.textarea.style.height="",this.textarea.style.overflow="",a.apply(this,arguments)}},mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue,mxCellEditor.prototype.getInitialValue=function(t,e){if("0"==mxUtils.getValue(t.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var n=this.graph.getEditingValue(t.cell,e);return"1"==mxUtils.getValue(t.style,"nl2Br","1")&&(n=n.replace(/\n/g,"<br/>")),n=this.graph.sanitizeHtml(n,!0)},mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue,mxCellEditor.prototype.getCurrentValue=function(t){if("0"==mxUtils.getValue(t.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);var e=this.graph.sanitizeHtml(this.textarea.innerHTML,!0);return e="1"==mxUtils.getValue(t.style,"nl2Br","1")?e.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"):e.replace(/\r\n/g,"").replace(/\n/g,"")};var h=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(t){this.codeViewMode&&this.toggleViewMode(),h.apply(this,arguments),this.focusContainer()},mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(t){}};var d=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(t,e){this.graph.getModel().beginUpdate();try{if(d.apply(this,arguments),this.graph.isCellDeletable(t.cell)&&0==this.graph.model.getChildCount(t.cell)){var n=mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),i=mxUtils.getValue(t.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);""==e&&n==mxConstants.NONE&&i==mxConstants.NONE&&this.graph.removeCells([t.cell],!1)}}finally{this.graph.getModel().endUpdate()}},mxCellEditor.prototype.getBackgroundColor=function(t){var e=null;(this.graph.getModel().isEdge(t.cell)||this.graph.getModel().isEdge(this.graph.getModel().getParent(t.cell)))&&(e=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null))==mxConstants.NONE&&(e=null);return e},mxCellEditor.prototype.getMinimumSize=function(t){var e=this.graph.getView().scale;return new mxRectangle(0,0,null==t.text?30:t.text.size*e+20,30)};var u=mxGraphHandler.prototype.moveCells;function p(){var t=document.createElement("div");return t.className="geHint",t.style.whiteSpace="nowrap",t.style.position="absolute",t}mxGraphHandler.prototype.moveCells=function(t,e,n,i,o,s){mxEvent.isAltDown(s)&&(o=null),u.apply(this,arguments)},mxGraphHandler.prototype.updateHint=function(t){if(null!=this.shape){null==this.hint&&(this.hint=p(),this.graph.container.appendChild(this.hint));var e=this.graph.view.translate,n=this.graph.view.scale,i=this.roundLength((this.bounds.x+this.currentDx)/n-e.x),o=this.roundLength((this.bounds.y+this.currentDy)/n-e.y);this.hint.innerHTML=i+", "+o,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(t,e){return!this.graph.isSwimlane(t.cell)&&0<this.graph.model.getChildCount(t.cell)&&!mxEvent.isControlDown(e.getEvent())&&!this.graph.isCellCollapsed(t.cell)&&"1"==mxUtils.getValue(t.style,"recursiveResize","1")&&null==mxUtils.getValue(t.style,"childLayout",null)},mxVertexHandler.prototype.isCenteredEvent=function(t,e){return!(!this.graph.isSwimlane(t.cell)&&0<this.graph.model.getChildCount(t.cell)&&!this.graph.isCellCollapsed(t.cell)&&"1"==mxUtils.getValue(t.style,"recursiveResize","1")&&null==mxUtils.getValue(t.style,"childLayout",null))&&mxEvent.isControlDown(e.getEvent())||mxEvent.isMetaDown(e.getEvent())};var m=mxVertexHandler.prototype.getHandlePadding;if(mxVertexHandler.prototype.getHandlePadding=function(){var t=new mxPoint(0,0),e=this.tolerance;return this.graph.cellEditor.getEditingCell()==this.state.cell&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(e/=2,t.x=this.sizers[0].bounds.width+e,t.y=this.sizers[0].bounds.height+e):t=m.apply(this,arguments),t},mxVertexHandler.prototype.updateHint=function(t){if(this.index!=mxEvent.LABEL_HANDLE){if(null==this.hint&&(this.hint=p(),this.state.view.graph.container.appendChild(this.hint)),this.index==mxEvent.ROTATION_HANDLE)this.hint.innerHTML=this.currentAlpha+"&deg;";else{var e=this.state.view.scale;this.hint.innerHTML=this.roundLength(this.bounds.width/e)+" x "+this.roundLength(this.bounds.height/e)}var n=null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0",i=mxUtils.getBoundingBox(this.bounds,n);null==i&&(i=this.bounds),this.hint.style.left=i.x+Math.round((i.width-this.hint.clientWidth)/2)+"px",this.hint.style.top=i.y+i.height+12+"px",null!=this.linkHint&&(this.linkHint.style.display="none")}},mxVertexHandler.prototype.removeHint=function(){mxGraphHandler.prototype.removeHint.apply(this,arguments),null!=this.linkHint&&(this.linkHint.style.display="")},mxEdgeHandler.prototype.updateHint=function(t,e){null==this.hint&&(this.hint=p(),this.state.view.graph.container.appendChild(this.hint));var n=this.graph.view.translate,i=this.graph.view.scale,o=this.roundLength(e.x/i-n.x),s=this.roundLength(e.y/i-n.y);if(this.hint.innerHTML=o+", "+s,this.hint.style.visibility="visible",this.isSource||this.isTarget)if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus){var l=this.constraintHandler.currentConstraint.point;this.hint.innerHTML="["+Math.round(100*l.x)+"%, "+Math.round(100*l.y)+"%]"}else this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(t.getGraphX()-this.hint.clientWidth/2)+"px",this.hint.style.top=Math.max(t.getGraphY(),e.y)+this.state.view.graph.gridSize+"px",null!=this.linkHint&&(this.linkHint.style.display="none")},mxEdgeHandler.prototype.removeHint=mxVertexHandler.prototype.removeHint,HoverIcons.prototype.mainHandle=mxClient.IS_SVG?Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="#007dfc" stroke-width="1"/>'):new mxImage(IMAGE_PATH+"/handle-main.png",17,17),HoverIcons.prototype.secondaryHandle=mxClient.IS_SVG?Graph.createSvgImage(16,16,'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>'):new mxImage(IMAGE_PATH+"/handle-secondary.png",17,17),HoverIcons.prototype.fixedHandle=mxClient.IS_SVG?Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="#007dfc" stroke-width="1"/><path d="m 7 7 L 11 11 M 7 11 L 11 7" stroke="#fff"/>'):new mxImage(IMAGE_PATH+"/handle-fixed.png",17,17),HoverIcons.prototype.terminalHandle=mxClient.IS_SVG?Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="#007dfc" stroke-width="1"/><circle cx="9" cy="9" r="2" stroke="#fff" fill="transparent"/>'):new mxImage(IMAGE_PATH+"/handle-terminal.png",17,17),HoverIcons.prototype.rotationHandle=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=":IMAGE_PATH+"/handle-rotate.png",19,21),mxClient.IS_SVG&&(mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="#007dfc"/>')),mxVertexHandler.prototype.handleImage=HoverIcons.prototype.mainHandle,mxVertexHandler.prototype.secondaryHandleImage=HoverIcons.prototype.secondaryHandle,mxEdgeHandler.prototype.handleImage=HoverIcons.prototype.mainHandle,mxEdgeHandler.prototype.terminalHandleImage=HoverIcons.prototype.terminalHandle,mxEdgeHandler.prototype.fixedHandleImage=HoverIcons.prototype.fixedHandle,mxEdgeHandler.prototype.labelHandleImage=HoverIcons.prototype.secondaryHandle,mxOutline.prototype.sizerImage=HoverIcons.prototype.mainHandle,null!=window.Sidebar&&(Sidebar.prototype.triangleUp=HoverIcons.prototype.triangleUp,Sidebar.prototype.triangleRight=HoverIcons.prototype.triangleRight,Sidebar.prototype.triangleDown=HoverIcons.prototype.triangleDown,Sidebar.prototype.triangleLeft=HoverIcons.prototype.triangleLeft,Sidebar.prototype.refreshTarget=HoverIcons.prototype.refreshTarget,Sidebar.prototype.roundDrop=HoverIcons.prototype.roundDrop),null!=window.WfPanel&&(WfPanel.prototype.triangleUp=HoverIcons.prototype.triangleUp,WfPanel.prototype.triangleRight=HoverIcons.prototype.triangleRight,WfPanel.prototype.triangleDown=HoverIcons.prototype.triangleDown,WfPanel.prototype.triangleLeft=HoverIcons.prototype.triangleLeft,WfPanel.prototype.refreshTarget=HoverIcons.prototype.refreshTarget,WfPanel.prototype.roundDrop=HoverIcons.prototype.roundDrop),mxClient.IS_SVG||((new Image).src=HoverIcons.prototype.mainHandle.src,(new Image).src=HoverIcons.prototype.fixedHandle.src,(new Image).src=HoverIcons.prototype.terminalHandle.src,(new Image).src=HoverIcons.prototype.secondaryHandle.src,(new Image).src=HoverIcons.prototype.rotationHandle.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(t){return!mxEvent.isShiftDown(t.getEvent())},mxEdgeHandler.prototype.isCustomHandleEvent=function(t){return!mxEvent.isShiftDown(t.getEvent())},Graph.touchStyle){(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(t){return mxEvent.isMouseEvent(t.getEvent())?4:this.graph.getTolerance()}),mxPanningHandler.prototype.isPanningTrigger=function(t){var e=t.getEvent();return null==t.getState()&&!mxEvent.isMouseEvent(e)||mxEvent.isPopupTrigger(e)&&(null==t.getState()||mxEvent.isControlDown(e)||mxEvent.isShiftDown(e))};var c=mxGraphHandler.prototype.mouseDown;mxGraphHandler.prototype.mouseDown=function(t,e){c.apply(this,arguments),mxEvent.isTouchEvent(e.getEvent())&&this.graph.isCellSelected(e.getCell())&&1<this.graph.getSelectionCount()&&(this.delayedSelection=!1)}}else mxPanningHandler.prototype.isPanningTrigger=function(t){var e=t.getEvent();return mxEvent.isLeftMouseButton(e)&&(this.useLeftButtonForPanning&&null==t.getState()||mxEvent.isControlDown(e)&&!mxEvent.isShiftDown(e))||this.usePopupTrigger&&mxEvent.isPopupTrigger(e)};mxRubberband.prototype.isSpaceEvent=function(t){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&mxEvent.isControlDown(t.getEvent())&&mxEvent.isShiftDown(t.getEvent())},mxRubberband.prototype.mouseUp=function(t,e){var n=null!=this.div&&"none"!=this.div.style.display,i=null,o=null,s=null,l=null;if(null!=this.first&&null!=this.currentX&&null!=this.currentY&&(i=this.first.x,o=this.first.y,s=(this.currentX-i)/this.graph.view.scale,l=(this.currentY-o)/this.graph.view.scale,mxEvent.isAltDown(e.getEvent())||(s=this.graph.snap(s),l=this.graph.snap(l),this.graph.isGridEnabled()||(Math.abs(s)<this.graph.tolerance&&(s=0),Math.abs(l)<this.graph.tolerance&&(l=0)))),this.reset(),n){if(mxEvent.isAltDown(e.getEvent())&&this.graph.isToggleEvent(e.getEvent())){var r=new mxRectangle(this.x,this.y,this.width,this.height),a=this.graph.getCells(r.x,r.y,r.width,r.height);this.graph.removeSelectionCells(a)}else if(this.isSpaceEvent(e)){this.graph.model.beginUpdate();try{a=this.graph.getCellsBeyond(i,o,this.graph.getDefaultParent(),!0,!0);for(var h=0;h<a.length;h++)if(this.graph.isCellMovable(a[h])){var d=this.graph.view.getState(a[h]),u=this.graph.getCellGeometry(a[h]);null!=d&&null!=u&&((u=u.clone()).translate(s,l),this.graph.model.setGeometry(a[h],u))}}finally{this.graph.model.endUpdate()}}else{r=new mxRectangle(this.x,this.y,this.width,this.height);this.graph.selectRegion(r,e.getEvent())}e.consume()}},mxRubberband.prototype.mouseMove=function(t,e){if(!e.isConsumed()&&null!=this.first){var n=mxUtils.getScrollOrigin(this.graph.container),i=mxUtils.getOffset(this.graph.container);n.x-=i.x,n.y-=i.y;var o=e.getX()+n.x,s=e.getY()+n.y,l=this.first.x-o,r=this.first.y-s,a=this.graph.tolerance;if(null!=this.div||Math.abs(l)>a||Math.abs(r)>a){if(null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(o,s),this.isSpaceEvent(e)){var h=this.x+this.width,d=this.y+this.height,u=this.graph.view.scale;mxEvent.isAltDown(e.getEvent())||(this.width=this.graph.snap(this.width/u)*u,this.height=this.graph.snap(this.height/u)*u,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=h-this.width),this.y<this.first.y&&(this.y=d-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor="white",this.div.style.left=this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=this.width<=0?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+"px",this.secondDiv.style.width=this.graph.container.clientWidth+"px",this.secondDiv.style.height=Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=this.height<=0?"1px 0px 0px 0px":"1px 0px 1px 0px"}else this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null);e.consume()}}};var t=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null),t.apply(this,arguments)};var g=(new Date).getTime(),x=0,y=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(t,e,n,i){y.apply(this,arguments),x=n!=this.currentTerminalState?(g=(new Date).getTime(),0):(new Date).getTime()-g,this.currentTerminalState=n};var f=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(t){return null!=this.currentTerminalState&&t.getState()==this.currentTerminalState&&2e3<x||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&f.apply(this,arguments)},mxVertexHandler.prototype.isCustomHandleEvent=function(t){return!mxEvent.isShiftDown(t.getEvent())},mxEdgeHandler.prototype.createHandleShape=function(t,e){var n=null!=t&&0==t,i=this.state.getVisibleTerminalState(n),o=null!=t&&(0==t||t>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==t)?this.graph.getConnectionConstraint(this.state,i,n):null,s=null!=(null!=o?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(n),o):null)?this.fixedHandleImage:null!=o&&null!=i?this.terminalHandleImage:this.handleImage;if(null!=s){var l=new mxImageShape(new mxRectangle(0,0,s.width,s.height),s.src);return l.preserveImageAspect=!1,l}var r=mxConstants.HANDLE_SIZE;return this.preferHtml&&(r-=1),new mxRectangleShape(new mxRectangle(0,0,r,r),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var v=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(t,e,n){return this.handleImage=e==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:e==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage,v.apply(this,arguments)};var C=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(t){if(null!=t&&1==t.length){var e=this.graph.getModel(),n=e.getParent(t[0]),i=this.graph.getCellGeometry(t[0]);if(e.isEdge(n)&&null!=i&&i.relative){var o=this.graph.view.getState(t[0]);if(null!=o&&o.width<2&&o.height<2&&null!=o.text&&null!=o.text.boundingBox)return mxRectangle.fromRectangle(o.text.boundingBox)}}return C.apply(this,arguments)};var E=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(t){var e=this.graph.getModel(),n=e.getParent(t.cell),i=this.graph.getCellGeometry(t.cell);if(e.isEdge(n)&&null!=i&&i.relative&&t.width<2&&t.height<2&&null!=t.text&&null!=t.text.boundingBox){var o=t.text.unrotatedBoundingBox||t.text.boundingBox;return new mxRectangle(Math.round(o.x),Math.round(o.y),Math.round(o.width),Math.round(o.height))}return E.apply(this,arguments)};var w=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(t,e){var n=this.graph.getModel(),i=n.getParent(this.state.cell),o=this.graph.getCellGeometry(this.state.cell);(this.getHandleForEvent(e)==mxEvent.ROTATION_HANDLE||!n.isEdge(i)||null==o||!o.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&w.apply(this,arguments)},mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()<mxGraphHandler.prototype.maxCells)},mxVertexHandler.prototype.rotateClick=function(){this.state.view.graph.turnShapes([this.state.cell])};var S=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(t,e){S.apply(this,arguments),null!=this.graph.graphHandler.first&&null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none")};var b=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(t,e){b.apply(this,arguments),null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none")};var T=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){T.apply(this,arguments);var t=!1;null!=this.rotationShape&&this.rotationShape.node.setAttribute("title",mxResources.get("rotateTooltip"));var n=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(t,e){n()}),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionHandler),this.changeHandler=mxUtils.bind(this,function(t,e){this.updateLinkHint(this.graph.getLinkForCell(this.state.cell),this.graph.getLinksForState(this.state)),n()}),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler),this.editingHandler=mxUtils.bind(this,function(t,e){this.redrawHandles()}),this.graph.addListener(mxEvent.EDITING_STOPPED,this.editingHandler);var e=this.graph.getLinkForCell(this.state.cell),i=this.graph.getLinksForState(this.state);this.updateLinkHint(e,i),(null!=e||null!=i&&0<i.length)&&(t=!0),t&&this.redrawHandles()},mxVertexHandler.prototype.updateLinkHint=function(t,e){if(null==t&&(null==e||0==e.length)||1<this.graph.getSelectionCount())null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=t||null!=e&&0<e.length){if(null==this.linkHint&&(this.linkHint=p(),this.linkHint.style.padding="6px 8px 6px 8px",this.linkHint.style.fontSize="90%",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint)),this.linkHint.innerHTML="",null!=t&&(this.linkHint.appendChild(this.graph.createLinkForHint(t)),this.graph.isEnabled()&&"function"==typeof this.graph.editLink)){var n=document.createElement("img");n.setAttribute("src",Editor.editImage),n.setAttribute("title",mxResources.get("editLink")),n.setAttribute("width","11"),n.setAttribute("height","11"),n.style.marginLeft="10px",n.style.marginBottom="-1px",n.style.cursor="pointer",this.linkHint.appendChild(n),mxEvent.addListener(n,"click",mxUtils.bind(this,function(t){this.graph.setSelectionCell(this.state.cell),this.graph.editLink(),mxEvent.consume(t)}));var i=document.createElement("img");i.setAttribute("src",Dialog.prototype.clearImage),i.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")])),i.setAttribute("width","13"),i.setAttribute("height","10"),i.style.marginLeft="4px",i.style.marginBottom="-1px",i.style.cursor="pointer",this.linkHint.appendChild(i),mxEvent.addListener(i,"click",mxUtils.bind(this,function(t){this.graph.setLinkForCell(this.state.cell,null),mxEvent.consume(t)}))}if(null!=e)for(var o=0;o<e.length;o++){var s=document.createElement("div");s.style.marginTop=null!=t||0<o?"6px":"0px",s.appendChild(this.graph.createLinkForHint(e[o].getAttribute("href"),mxUtils.getTextContent(e[o]))),this.linkHint.appendChild(s)}}},mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var A=mxEdgeHandler.prototype.init;mxEdgeHandler.prototype.init=function(){A.apply(this,arguments),this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.state.view.graph.connectionHandler.isEnabled()});var n=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(t,e){n()}),this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionHandler),this.changeHandler=mxUtils.bind(this,function(t,e){this.updateLinkHint(this.graph.getLinkForCell(this.state.cell),this.graph.getLinksForState(this.state)),n(),this.redrawHandles()}),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler);var t=this.graph.getLinkForCell(this.state.cell),e=this.graph.getLinksForState(this.state);(null!=t||null!=e&&0<e.length)&&(this.updateLinkHint(t,e),this.redrawHandles())};var L=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){L.apply(this,arguments),this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var I=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){if(I.apply(this),null!=this.state&&null!=this.linkHint){var t=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),e=new mxRectangle(this.state.x,this.state.y-22,this.state.width+24,this.state.height+22),n=mxUtils.getBoundingBox(e,this.state.style[mxConstants.STYLE_ROTATION]||"0",t),i=null!=n?mxUtils.getBoundingBox(this.state,this.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,o=null!=this.state.text?this.state.text.boundingBox:null;null==n&&(n=this.state);var s=n.y+n.height;null!=o&&(s=Math.max(s,o.y+o.height)),this.linkHint.style.left=Math.max(0,Math.round(i.x+(i.width-this.linkHint.clientWidth)/2))+"px",this.linkHint.style.top=Math.round(s+this.verticalOffset/2+6+this.state.view.graph.tolerance)+"px"}};var M=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=function(){M.apply(this,arguments),null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none")};var R=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){R.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 P=mxEdgeHandler.prototype.redrawHandles;mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(P.apply(this),null!=this.state&&null!=this.linkHint)){var t=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(t=new mxRectangle(t.x,t.y,t.width,t.height)).add(this.state.text.bounds),this.linkHint.style.left=Math.max(0,Math.round(t.x+(t.width-this.linkHint.clientWidth)/2))+"px",this.linkHint.style.top=Math.round(t.y+t.height+6+this.state.view.graph.tolerance)+"px"}};var O=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=function(){O.apply(this,arguments),null!=this.linkHint&&(this.linkHint.style.visibility="")};var N=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){N.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 t(){mxCylinder.call(this)}mxUtils.extend(t,mxCylinder),t.prototype.size=20,t.prototype.redrawPath=function(t,e,n,i,o,s){var l=Math.max(0,Math.min(i,Math.min(o,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));s?(t.moveTo(l,o),t.lineTo(l,l),t.lineTo(0,0),t.moveTo(l,l),t.lineTo(i,l)):(t.moveTo(0,0),t.lineTo(i-l,0),t.lineTo(i,l),t.lineTo(i,o),t.lineTo(l,o),t.lineTo(0,o-l),t.lineTo(0,0),t.close()),t.end()},t.prototype.getLabelMargins=function(t){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale;return new mxRectangle(e,e,0,0)}return null},mxCellRenderer.registerShape("cube",t);var r=Math.tan(mxUtils.toRadians(30)),a=(.5-r)/2;function e(){mxActor.call(this)}function n(){mxCylinder.call(this)}function i(){mxCylinder.call(this)}function o(){mxCylinder.call(this)}function s(){mxActor.call(this)}function l(){mxCylinder.call(this)}function h(){mxActor.call(this)}function d(){mxActor.call(this)}function u(){mxActor.call(this)}mxUtils.extend(e,mxActor),e.prototype.size=20,e.prototype.redrawPath=function(t,e,n,i,o){var s=Math.min(i,o/r);t.translate((i-s)/2,(o-s)/2+s/4),t.moveTo(0,.25*s),t.lineTo(.5*s,s*a),t.lineTo(s,.25*s),t.lineTo(.5*s,(.5-a)*s),t.lineTo(0,.25*s),t.close(),t.end()},mxCellRenderer.registerShape("isoRectangle",e),mxUtils.extend(n,mxCylinder),n.prototype.size=20,n.prototype.redrawPath=function(t,e,n,i,o,s){var l=Math.min(i,o/(.5+r));s?(t.moveTo(0,.25*l),t.lineTo(.5*l,(.5-a)*l),t.lineTo(l,.25*l),t.moveTo(.5*l,(.5-a)*l),t.lineTo(.5*l,(1-a)*l)):(t.translate((i-l)/2,(o-l)/2),t.moveTo(0,.25*l),t.lineTo(.5*l,l*a),t.lineTo(l,.25*l),t.lineTo(l,.75*l),t.lineTo(.5*l,(1-a)*l),t.lineTo(0,.75*l),t.close()),t.end()},mxCellRenderer.registerShape("isoCube",n),mxUtils.extend(i,mxCylinder),i.prototype.redrawPath=function(t,e,n,i,o,s){var l=Math.min(o/2,Math.round(o/8)+this.strokewidth-1);(s&&null!=this.fill||!s&&null==this.fill)&&(t.moveTo(0,l),t.curveTo(0,2*l,i,2*l,i,l),s||(t.stroke(),t.begin()),t.translate(0,l/2),t.moveTo(0,l),t.curveTo(0,2*l,i,2*l,i,l),s||(t.stroke(),t.begin()),t.translate(0,l/2),t.moveTo(0,l),t.curveTo(0,2*l,i,2*l,i,l),s||(t.stroke(),t.begin()),t.translate(0,-l)),s||(t.moveTo(0,l),t.curveTo(0,-l/3,i,-l/3,i,l),t.lineTo(i,o-l),t.curveTo(i,o+l/3,0,o+l/3,0,o-l),t.close())},i.prototype.getLabelMargins=function(t){return new mxRectangle(0,2.5*Math.min(t.height/2,Math.round(t.height/8)+this.strokewidth-1)*this.scale,0,0)},mxCellRenderer.registerShape("datastore",i),mxUtils.extend(o,mxCylinder),o.prototype.size=30,o.prototype.redrawPath=function(t,e,n,i,o,s){var l=Math.max(0,Math.min(i,Math.min(o,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));s?(t.moveTo(i-l,0),t.lineTo(i-l,l),t.lineTo(i,l)):(t.moveTo(0,0),t.lineTo(i-l,0),t.lineTo(i,l),t.lineTo(i,o),t.lineTo(0,o),t.lineTo(0,0),t.close()),t.end()},mxCellRenderer.registerShape("note",o),mxUtils.extend(s,mxActor),s.prototype.redrawPath=function(t,e,n,i,o){t.moveTo(0,0),t.quadTo(i/2,.5*o,i,0),t.quadTo(.5*i,o/2,i,o),t.quadTo(i/2,.5*o,0,o),t.quadTo(.5*i,o/2,0,0),t.end()},mxCellRenderer.registerShape("switch",s),mxUtils.extend(l,mxCylinder),l.prototype.tabWidth=60,l.prototype.tabHeight=20,l.prototype.tabPosition="right",l.prototype.redrawPath=function(t,e,n,i,o,s){var l=Math.max(0,Math.min(i,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))),r=Math.max(0,Math.min(o,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight)))),a=mxUtils.getValue(this.style,"tabPosition",this.tabPosition);s?"left"==a?(t.moveTo(0,r),t.lineTo(l,r)):(t.moveTo(i-l,r),t.lineTo(i,r)):("left"==a?(t.moveTo(0,0),t.lineTo(l,0),t.lineTo(l,r),t.lineTo(i,r)):(t.moveTo(0,r),t.lineTo(i-l,r),t.lineTo(i-l,0),t.lineTo(i,0)),t.lineTo(i,o),t.lineTo(0,o),t.lineTo(0,r),t.close()),t.end()},mxCellRenderer.registerShape("folder",l),mxUtils.extend(h,mxActor),h.prototype.size=30,h.prototype.redrawPath=function(t,e,n,i,o){var s=Math.max(0,Math.min(i,Math.min(o,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(s,0),new mxPoint(i,0),new mxPoint(i,o),new mxPoint(0,o),new mxPoint(0,s)],this.isRounded,l,!0),t.end()},mxCellRenderer.registerShape("card",h),mxUtils.extend(d,mxActor),d.prototype.size=.4,d.prototype.redrawPath=function(t,e,n,i,o){var s=o*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));t.moveTo(0,s/2),t.quadTo(i/4,1.4*s,i/2,s/2),t.quadTo(3*i/4,s*(1-1.4),i,s/2),t.lineTo(i,o-s/2),t.quadTo(3*i/4,o-1.4*s,i/2,o-s/2),t.quadTo(i/4,o-s*(1-1.4),0,o-s/2),t.lineTo(0,s/2),t.close(),t.end()},d.prototype.getLabelBounds=function(t){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var e=mxUtils.getValue(this.style,"size",this.size),n=t.width,i=t.height;if(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST){var o=i*e;return new mxRectangle(t.x,t.y+o,n,i-2*o)}var s=n*e;return new mxRectangle(t.x+s,t.y,n-2*s,i)}return t},mxCellRenderer.registerShape("tape",d),mxUtils.extend(u,mxActor),u.prototype.size=.3,u.prototype.getLabelMargins=function(t){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*t.height):null},u.prototype.redrawPath=function(t,e,n,i,o){var s=o*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));t.moveTo(0,0),t.lineTo(i,0),t.lineTo(i,o-s/2),t.quadTo(3*i/4,o-1.4*s,i/2,o-s/2),t.quadTo(i/4,o-s*(1-1.4),0,o-s/2),t.lineTo(0,s/2),t.close(),t.end()},mxCellRenderer.registerShape("document",u);var p=mxCylinder.prototype.getCylinderSize;function c(){mxActor.call(this)}function g(){mxActor.call(this)}function m(){mxActor.call(this)}function x(){mxActor.call(this)}function y(t,e){this.canvas=t,this.canvas.setLineJoin("round"),this.canvas.setLineCap("round"),this.defaultVariation=e,this.originalLineTo=this.canvas.lineTo,this.canvas.lineTo=mxUtils.bind(this,y.prototype.lineTo),this.originalMoveTo=this.canvas.moveTo,this.canvas.moveTo=mxUtils.bind(this,y.prototype.moveTo),this.originalClose=this.canvas.close,this.canvas.close=mxUtils.bind(this,y.prototype.close),this.originalQuadTo=this.canvas.quadTo,this.canvas.quadTo=mxUtils.bind(this,y.prototype.quadTo),this.originalCurveTo=this.canvas.curveTo,this.canvas.curveTo=mxUtils.bind(this,y.prototype.curveTo),this.originalArcTo=this.canvas.arcTo,this.canvas.arcTo=mxUtils.bind(this,y.prototype.arcTo)}mxCylinder.prototype.getCylinderSize=function(t,e,n,i){var o=mxUtils.getValue(this.style,"size");return null!=o?i*Math.max(0,Math.min(1,o)):p.apply(this,arguments)},mxCylinder.prototype.getLabelMargins=function(t){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var e=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale,t.height*e),0,0)}return null},mxUtils.extend(c,mxActor),c.prototype.size=.2,c.prototype.redrawPath=function(t,e,n,i,o){var s=i*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,o),new mxPoint(s,0),new mxPoint(i,0),new mxPoint(i-s,o)],this.isRounded,l,!0),t.end()},mxCellRenderer.registerShape("parallelogram",c),mxUtils.extend(g,mxActor),g.prototype.size=.2,g.prototype.redrawPath=function(t,e,n,i,o){var s=i*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,o),new mxPoint(s,0),new mxPoint(i-s,0),new mxPoint(i,o)],this.isRounded,l,!0)},mxCellRenderer.registerShape("trapezoid",g),mxUtils.extend(m,mxActor),m.prototype.size=.5,m.prototype.redrawPath=function(t,e,n,i,o){t.setFillColor(null);var s=i*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(i,0),new mxPoint(s,0),new mxPoint(s,o/2),new mxPoint(0,o/2),new mxPoint(s,o/2),new mxPoint(s,o),new mxPoint(i,o)],this.isRounded,l,!1),t.end()},mxCellRenderer.registerShape("curlyBracket",m),mxUtils.extend(x,mxActor),x.prototype.redrawPath=function(t,e,n,i,o){t.setStrokeWidth(1),t.setFillColor(this.stroke);var s=i/5;t.rect(0,0,s,o),t.fillAndStroke(),t.rect(2*s,0,s,o),t.fillAndStroke(),t.rect(4*s,0,s,o),t.fillAndStroke()},mxCellRenderer.registerShape("parallelMarker",x),y.prototype.moveTo=function(t,e){this.originalMoveTo.apply(this.canvas,arguments),this.lastX=t,this.lastY=e,this.firstX=t,this.firstY=e},y.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)},y.prototype.quadTo=function(t,e,n,i){this.originalQuadTo.apply(this.canvas,arguments),this.lastX=n,this.lastY=i},y.prototype.curveTo=function(t,e,n,i,o,s){this.originalCurveTo.apply(this.canvas,arguments),this.lastX=o,this.lastY=s},y.prototype.arcTo=function(t,e,n,i,o,s,l){this.originalArcTo.apply(this.canvas,arguments),this.lastX=s,this.lastY=l},y.prototype.lineTo=function(t,e){if(null!=this.lastX&&null!=this.lastY){var n=Math.abs(t-this.lastX),i=Math.abs(e-this.lastY),o=Math.sqrt(n*n+i*i);if(o<2)return this.originalLineTo.apply(this.canvas,arguments),this.lastX=t,void(this.lastY=e);var s=Math.round(o/10),l=this.defaultVariation;function r(t){return"number"==typeof t?t?t<0?-1:1:t==t?0:NaN:NaN}s<5&&(s=5,l/=3);for(var a=r(t-this.lastX)*n/s,h=r(e-this.lastY)*i/s,d=n/o,u=i/o,p=0;p<s;p++){var m=a*p+this.lastX,c=h*p+this.lastY,g=(Math.random()-.5)*l;this.originalLineTo.call(this.canvas,m-g*u,c-g*d)}this.originalLineTo.call(this.canvas,t,e),this.lastX=t,this.lastY=e}else this.originalLineTo.apply(this.canvas,arguments),this.lastX=t,this.lastY=e},y.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 f=mxShape.prototype.paint;mxShape.prototype.defaultJiggle=1.5,mxShape.prototype.paint=function(t){null!=this.style&&"0"!=mxUtils.getValue(this.style,"comic","0")&&null==t.handHiggle&&(t.handJiggle=new y(t,mxUtils.getValue(this.style,"jiggle",this.defaultJiggle))),f.apply(this,arguments),null!=t.handJiggle&&(t.handJiggle.destroy(),delete t.handJiggle)},mxRhombus.prototype.defaultJiggle=2;var v=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return(null==this.style||"0"==mxUtils.getValue(this.style,"comic","0"))&&v.apply(this,arguments)};var C=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(t,e,n,i,o){if(null==t.handJiggle)C.apply(this,arguments);else{var s=!0;if(null!=this.style&&(s="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),s||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE){if(s||null!=this.fill&&this.fill!=mxConstants.NONE||(t.pointerEvents=!1),t.begin(),this.isRounded){var l=0;if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))l=Math.min(i/2,Math.min(o/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else{var r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;l=Math.min(i*r,o*r)}t.moveTo(e+l,n),t.lineTo(e+i-l,n),t.quadTo(e+i,n,e+i,n+l),t.lineTo(e+i,n+o-l),t.quadTo(e+i,n+o,e+i-l,n+o),t.lineTo(e+l,n+o),t.quadTo(e,n+o,e,n+o-l),t.lineTo(e,n+l),t.quadTo(e,n,e+l,n)}else t.moveTo(e,n),t.lineTo(e+i,n),t.lineTo(e+i,n+o),t.lineTo(e,n+o),t.lineTo(e,n);t.close(),t.end(),t.fillAndStroke()}}};var E=mxRectangleShape.prototype.paintForeground;function w(){mxRectangleShape.call(this)}function S(){mxRectangleShape.call(this)}function b(){mxActor.call(this)}function T(){mxActor.call(this)}function A(){mxActor.call(this)}function L(){mxRectangleShape.call(this)}mxRectangleShape.prototype.paintForeground=function(t,e,n,i,o){null==t.handJiggle&&E.apply(this,arguments)},mxUtils.extend(w,mxRectangleShape),w.prototype.size=.1,w.prototype.isHtmlAllowed=function(){return!1},w.prototype.getLabelBounds=function(t){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,!0)!=(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST))return t;var e=t.width,n=t.height,i=new mxRectangle(t.x,t.y,e,n),o=e*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;o=Math.max(o,Math.min(e*s,n*s))}return i.x+=Math.round(o),i.width-=Math.round(2*o),i},w.prototype.paintForeground=function(t,e,n,i,o){var s=i*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded){var l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;s=Math.max(s,Math.min(i*l,o*l))}s=Math.round(s),t.begin(),t.moveTo(e+s,n),t.lineTo(e+s,n+o),t.moveTo(e+i-s,n),t.lineTo(e+i-s,n+o),t.end(),t.stroke(),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxCellRenderer.registerShape("process",w),mxUtils.extend(S,mxRectangleShape),S.prototype.paintBackground=function(t,e,n,i,o){t.setFillColor(mxConstants.NONE),t.rect(e,n,i,o),t.fill()},S.prototype.paintForeground=function(t,e,n,i,o){},mxCellRenderer.registerShape("transparent",S),mxUtils.extend(b,mxHexagon),b.prototype.size=30,b.prototype.position=.5,b.prototype.position2=.5,b.prototype.base=20,b.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)},b.prototype.redrawPath=function(t,e,n,i,o){var s=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,l=Math.max(0,Math.min(o,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),r=i*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),a=i*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),h=Math.max(0,Math.min(i,parseFloat(mxUtils.getValue(this.style,"base",this.base))));this.addPoints(t,[new mxPoint(0,0),new mxPoint(i,0),new mxPoint(i,o-l),new mxPoint(Math.min(i,r+h),o-l),new mxPoint(a,o),new mxPoint(Math.max(0,r),o-l),new mxPoint(0,o-l)],this.isRounded,s,!0,[4])},mxCellRenderer.registerShape("callout",b),mxUtils.extend(T,mxActor),T.prototype.size=.2,T.prototype.fixedSize=20,T.prototype.redrawPath=function(t,e,n,i,o){var s="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(i,parseFloat(mxUtils.getValue(this.style,"size",this.fixedSize)))):i*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,0),new mxPoint(i-s,0),new mxPoint(i,o/2),new mxPoint(i-s,o),new mxPoint(0,o),new mxPoint(s,o/2)],this.isRounded,l,!0),t.end()},mxCellRenderer.registerShape("step",T),mxUtils.extend(A,mxHexagon),A.prototype.size=.25,A.prototype.redrawPath=function(t,e,n,i,o){var s=i*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(s,0),new mxPoint(i-s,0),new mxPoint(i,.5*o),new mxPoint(i-s,o),new mxPoint(s,o),new mxPoint(0,.5*o)],this.isRounded,l,!0)},mxCellRenderer.registerShape("hexagon",A),mxUtils.extend(L,mxRectangleShape),L.prototype.isHtmlAllowed=function(){return!1},L.prototype.paintForeground=function(t,e,n,i,o){var s=Math.min(i/5,o/5)+1;t.begin(),t.moveTo(e+i/2,n+s),t.lineTo(e+i/2,n+o-s),t.moveTo(e+s,n+o/2),t.lineTo(e+i-s,n+o/2),t.end(),t.stroke(),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxCellRenderer.registerShape("plus",L);var I,M,R=mxRhombus.prototype.paintVertexShape;function P(){mxRectangleShape.call(this)}function O(){mxCylinder.call(this)}function N(){mxShape.call(this)}function G(){mxShape.call(this)}function H(){mxEllipse.call(this)}function D(){mxShape.call(this)}function _(){mxShape.call(this)}function U(){mxRectangleShape.call(this)}function k(){mxShape.call(this)}function V(){mxShape.call(this)}function F(){mxShape.call(this)}function B(){mxCylinder.call(this)}function Y(){mxDoubleEllipse.call(this)}function z(){Y.call(this)}function W(){mxArrowConnector.call(this),this.spacing=0}function X(){mxArrowConnector.call(this),this.spacing=0}function j(){mxActor.call(this)}function Z(){mxRectangleShape.call(this)}function K(){mxActor.call(this)}function Q(){mxActor.call(this)}function J(){mxActor.call(this)}function q(){mxActor.call(this)}function $(){mxActor.call(this)}function tt(){mxActor.call(this)}function et(){mxActor.call(this)}function nt(){mxActor.call(this)}function it(){mxActor.call(this)}function ot(){mxActor.call(this)}function st(){mxEllipse.call(this)}function lt(){mxEllipse.call(this)}function rt(){mxEllipse.call(this)}function at(){mxRhombus.call(this)}function ht(){mxEllipse.call(this)}function dt(){mxEllipse.call(this)}function ut(){mxEllipse.call(this)}function pt(){mxEllipse.call(this)}function mt(){mxActor.call(this)}function ct(){mxActor.call(this)}function gt(){mxActor.call(this)}function xt(){mxConnector.call(this)}function yt(t,e,n,i,o,s,l,r,a,h){l+=a;var d=i.clone();return i.x-=o*(2*l+a),i.y-=s*(2*l+a),o*=l+a,s*=l+a,function(){t.ellipse(d.x-o-l,d.y-s-l,2*l,2*l),h?t.fillAndStroke():t.stroke()}}if(mxRhombus.prototype.getLabelBounds=function(t){if(1!=this.style.double)return t;var e=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(t.x+e,t.y+e,t.width-2*e,t.height-2*e)},mxRhombus.prototype.paintVertexShape=function(t,e,n,i,o){if(R.apply(this,arguments),!this.outline&&1==this.style.double){var s=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);e+=s,n+=s,o-=2*s,0<(i-=2*s)&&0<o&&(t.setShadow(!1),R.apply(this,[t,e,n,i,o]))}},mxUtils.extend(P,mxRectangleShape),P.prototype.isHtmlAllowed=function(){return!1},P.prototype.getLabelBounds=function(t){if(1!=this.style.double)return t;var e=(Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(t.x+e,t.y+e,t.width-2*e,t.height-2*e)},P.prototype.paintForeground=function(t,e,n,i,o){if(null!=this.style){if(!this.outline&&1==this.style.double){var s=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);e+=s,n+=s,o-=2*s,0<(i-=2*s)&&0<o&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}t.setDashed(!1);var l=0,r=null;do{if(null!=(r=mxCellRenderer.defaultShapes[this.style["symbol"+l]])){var a=this.style["symbol"+l+"Align"],h=this.style["symbol"+l+"VerticalAlign"],d=this.style["symbol"+l+"Width"],u=this.style["symbol"+l+"Height"],p=this.style["symbol"+l+"Spacing"]||0,m=this.style["symbol"+l+"VSpacing"]||p,c=this.style["symbol"+l+"ArcSpacing"];if(null!=c){var g=this.getArcSize(i+this.strokewidth,o+this.strokewidth)*c;p+=g,m+=g}var x=e,y=n;a==mxConstants.ALIGN_CENTER?x+=(i-d)/2:a==mxConstants.ALIGN_RIGHT?x+=i-d-p:x+=p,h==mxConstants.ALIGN_MIDDLE?y+=(o-u)/2:h==mxConstants.ALIGN_BOTTOM?y+=o-u-m:y+=m,t.save();var f=new r;f.style=this.style,r.prototype.paintVertexShape.call(f,t,x,y,d,u),t.restore()}l++}while(null!=r)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxCellRenderer.registerShape("ext",P),mxUtils.extend(O,mxCylinder),O.prototype.redrawPath=function(t,e,n,i,o,s){s?(t.moveTo(0,0),t.lineTo(i/2,o/2),t.lineTo(i,0),t.end()):(t.moveTo(0,0),t.lineTo(i,0),t.lineTo(i,o),t.lineTo(0,o),t.close())},mxCellRenderer.registerShape("message",O),mxUtils.extend(N,mxShape),N.prototype.paintBackground=function(t,e,n,i,o){t.translate(e,n),t.ellipse(i/4,0,i/2,o/4),t.fillAndStroke(),t.begin(),t.moveTo(i/2,o/4),t.lineTo(i/2,2*o/3),t.moveTo(i/2,o/3),t.lineTo(0,o/3),t.moveTo(i/2,o/3),t.lineTo(i,o/3),t.moveTo(i/2,2*o/3),t.lineTo(0,o),t.moveTo(i/2,2*o/3),t.lineTo(i,o),t.end(),t.stroke()},mxCellRenderer.registerShape("umlActor",N),mxUtils.extend(G,mxShape),G.prototype.getLabelMargins=function(t){return new mxRectangle(t.width/6,0,0,0)},G.prototype.paintBackground=function(t,e,n,i,o){t.translate(e,n),t.begin(),t.moveTo(0,o/4),t.lineTo(0,3*o/4),t.end(),t.stroke(),t.begin(),t.moveTo(0,o/2),t.lineTo(i/6,o/2),t.end(),t.stroke(),t.ellipse(i/6,0,5*i/6,o),t.fillAndStroke()},mxCellRenderer.registerShape("umlBoundary",G),mxUtils.extend(H,mxEllipse),H.prototype.paintVertexShape=function(t,e,n,i,o){mxEllipse.prototype.paintVertexShape.apply(this,arguments),t.begin(),t.moveTo(e+i/8,n+o),t.lineTo(e+7*i/8,n+o),t.end(),t.stroke()},mxCellRenderer.registerShape("umlEntity",H),mxUtils.extend(D,mxShape),D.prototype.paintVertexShape=function(t,e,n,i,o){t.translate(e,n),t.begin(),t.moveTo(i,0),t.lineTo(0,o),t.moveTo(0,0),t.lineTo(i,o),t.end(),t.stroke()},mxCellRenderer.registerShape("umlDestroy",D),mxUtils.extend(_,mxShape),_.prototype.getLabelBounds=function(t){return new mxRectangle(t.x,t.y+t.height/8,t.width,7*t.height/8)},_.prototype.paintBackground=function(t,e,n,i,o){t.translate(e,n),t.begin(),t.moveTo(3*i/8,o/8*1.1),t.lineTo(5*i/8,0),t.end(),t.stroke(),t.ellipse(0,o/8,i,7*o/8),t.fillAndStroke()},_.prototype.paintForeground=function(t,e,n,i,o){t.begin(),t.moveTo(3*i/8,o/8*1.1),t.lineTo(5*i/8,o/4),t.end(),t.stroke()},mxCellRenderer.registerShape("umlControl",_),mxUtils.extend(U,mxRectangleShape),U.prototype.size=40,U.prototype.isHtmlAllowed=function(){return!1},U.prototype.getLabelBounds=function(t){var e=Math.max(0,Math.min(t.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(t.x,t.y,t.width,e)},U.prototype.paintBackground=function(t,e,n,i,o){var s=Math.max(0,Math.min(o,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),l=mxUtils.getValue(this.style,"participant");if(null==l||null==this.state)mxRectangleShape.prototype.paintBackground.call(this,t,e,n,i,s);else{var r=this.state.view.graph.cellRenderer.getShape(l);if(null!=r&&r!=U){var a=new r;a.apply(this.state),t.save(),a.paintVertexShape(t,e,n,i,s),t.restore()}}s<o&&(t.setDashed(!0),t.begin(),t.moveTo(e+i/2,n+s),t.lineTo(e+i/2,n+o),t.end(),t.stroke())},U.prototype.paintForeground=function(t,e,n,i,o){var s=Math.max(0,Math.min(o,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,t,e,n,i,Math.min(o,s))},mxCellRenderer.registerShape("umlLifeline",U),mxUtils.extend(k,mxShape),k.prototype.width=60,k.prototype.height=30,k.prototype.corner=10,k.prototype.getLabelMargins=function(t){return new mxRectangle(0,0,t.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),t.height-parseFloat(mxUtils.getValue(this.style,"height",this.height)*this.scale))},k.prototype.paintBackground=function(t,e,n,i,o){var s=this.corner,l=Math.min(i,Math.max(s,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),r=Math.min(o,Math.max(1.5*s,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),a=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);if(a!=mxConstants.NONE&&(t.setFillColor(a),t.rect(e,n,i,o),t.fill()),null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){this.getGradientBounds(t,e,n,i,o);t.setGradient(this.fill,this.gradient,e,n,i,o,this.gradientDirection)}else t.setFillColor(this.fill);t.begin(),t.moveTo(e,n),t.lineTo(e+l,n),t.lineTo(e+l,n+Math.max(0,r-1.5*s)),t.lineTo(e+Math.max(0,l-s),n+r),t.lineTo(e,n+r),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(e+l,n),t.lineTo(e+i,n),t.lineTo(e+i,n+o),t.lineTo(e,n+o),t.lineTo(e,n+r),t.stroke()},mxCellRenderer.registerShape("umlFrame",k),mxPerimeter.LifelinePerimeter=function(t,e,n,i){var o=U.prototype.size;null!=e&&(o=mxUtils.getValue(e.style,"size",o)*e.view.scale);var s=parseFloat(e.style[mxConstants.STYLE_STROKEWIDTH]||1)*e.view.scale/2-1;return n.x<t.getCenterX()&&(s+=1,s*=-1),new mxPoint(t.getCenterX()+s,Math.min(t.y+t.height,Math.max(t.y+o,n.y)))},mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter),mxPerimeter.OrthogonalPerimeter=function(t,e,n,i){return i=!0,mxPerimeter.RectanglePerimeter.apply(this,arguments)},mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter),mxPerimeter.BackbonePerimeter=function(t,e,n,i){var o=parseFloat(e.style[mxConstants.STYLE_STROKEWIDTH]||1)*e.view.scale/2-1;return null!=e.style.backboneSize&&(o+=parseFloat(e.style.backboneSize)*e.view.scale/2-1),"south"==e.style[mxConstants.STYLE_DIRECTION]||"north"==e.style[mxConstants.STYLE_DIRECTION]?(n.x<t.getCenterX()&&(o+=1,o*=-1),new mxPoint(t.getCenterX()+o,Math.min(t.y+t.height,Math.max(t.y,n.y)))):(n.y<t.getCenterY()&&(o+=1,o*=-1),new mxPoint(Math.min(t.x+t.width,Math.max(t.x,n.x)),t.getCenterY()+o))},mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter),mxPerimeter.CalloutPerimeter=function(t,e,n,i){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(t,new mxRectangle(0,0,0,Math.max(0,Math.min(t.height,parseFloat(mxUtils.getValue(e.style,"size",b.prototype.size))*e.view.scale))),e.style),e,n,i)},mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter),mxPerimeter.ParallelogramPerimeter=function(t,e,n,i){var o=c.prototype.size;null!=e&&(o=mxUtils.getValue(e.style,"size",o));var s,l=t.x,r=t.y,a=t.width,h=t.height,d=null!=e?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;if(d==mxConstants.DIRECTION_NORTH||d==mxConstants.DIRECTION_SOUTH){var u=h*Math.max(0,Math.min(1,o));s=[new mxPoint(l,r),new mxPoint(l+a,r+u),new mxPoint(l+a,r+h),new mxPoint(l,r+h-u),new mxPoint(l,r)]}else{var p=a*Math.max(0,Math.min(1,o));s=[new mxPoint(l+p,r),new mxPoint(l+a,r),new mxPoint(l+a-p,r+h),new mxPoint(l,r+h),new mxPoint(l+p,r)]}var m=new mxPoint(t.getCenterX(),t.getCenterY());return i&&(n.x<l||n.x>l+a?m.y=n.y:m.x=n.x),mxUtils.getPerimeterPoint(s,m,n)},mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter),mxPerimeter.TrapezoidPerimeter=function(t,e,n,i){var o=g.prototype.size;null!=e&&(o=mxUtils.getValue(e.style,"size",o));var s,l=t.x,r=t.y,a=t.width,h=t.height,d=null!=e?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;if(d==mxConstants.DIRECTION_EAST)s=[new mxPoint(l+(u=a*Math.max(0,Math.min(1,o))),r),new mxPoint(l+a-u,r),new mxPoint(l+a,r+h),new mxPoint(l,r+h),new mxPoint(l+u,r)];else if(d==mxConstants.DIRECTION_WEST){var u=a*Math.max(0,Math.min(1,o));s=[new mxPoint(l,r),new mxPoint(l+a,r),new mxPoint(l+a-u,r+h),new mxPoint(l+u,r+h),new mxPoint(l,r)]}else if(d==mxConstants.DIRECTION_NORTH){s=[new mxPoint(l,r+(p=h*Math.max(0,Math.min(1,o)))),new mxPoint(l+a,r),new mxPoint(l+a,r+h),new mxPoint(l,r+h-p),new mxPoint(l,r+p)]}else{var p=h*Math.max(0,Math.min(1,o));s=[new mxPoint(l,r),new mxPoint(l+a,r+p),new mxPoint(l+a,r+h-p),new mxPoint(l,r+h),new mxPoint(l,r)]}var m=new mxPoint(t.getCenterX(),t.getCenterY());return i&&(n.x<l||n.x>l+a?m.y=n.y:m.x=n.x),mxUtils.getPerimeterPoint(s,m,n)},mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter),mxPerimeter.StepPerimeter=function(t,e,n,i){var o="0"!=mxUtils.getValue(e.style,"fixedSize","0"),s=o?T.prototype.fixedSize:T.prototype.size;null!=e&&(s=mxUtils.getValue(e.style,"size",s));var l,r=t.x,a=t.y,h=t.width,d=t.height,u=t.getCenterX(),p=t.getCenterY(),m=null!=e?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;if(m==mxConstants.DIRECTION_EAST){var c=o?Math.max(0,Math.min(h,s)):h*Math.max(0,Math.min(1,s));l=[new mxPoint(r,a),new mxPoint(r+h-c,a),new mxPoint(r+h,p),new mxPoint(r+h-c,a+d),new mxPoint(r,a+d),new mxPoint(r+c,p),new mxPoint(r,a)]}else if(m==mxConstants.DIRECTION_WEST){l=[new mxPoint(r+(c=o?Math.max(0,Math.min(h,s)):h*Math.max(0,Math.min(1,s))),a),new mxPoint(r+h,a),new mxPoint(r+h-c,p),new mxPoint(r+h,a+d),new mxPoint(r+c,a+d),new mxPoint(r,p),new mxPoint(r+c,a)]}else if(m==mxConstants.DIRECTION_NORTH){l=[new mxPoint(r,a+(g=o?Math.max(0,Math.min(d,s)):d*Math.max(0,Math.min(1,s)))),new mxPoint(u,a),new mxPoint(r+h,a+g),new mxPoint(r+h,a+d),new mxPoint(u,a+d-g),new mxPoint(r,a+d),new mxPoint(r,a+g)]}else{var g=o?Math.max(0,Math.min(d,s)):d*Math.max(0,Math.min(1,s));l=[new mxPoint(r,a),new mxPoint(u,a+g),new mxPoint(r+h,a),new mxPoint(r+h,a+d-g),new mxPoint(u,a+d),new mxPoint(r,a+d-g),new mxPoint(r,a)]}var x=new mxPoint(u,p);return i&&(n.x<r||n.x>r+h?x.y=n.y:x.x=n.x),mxUtils.getPerimeterPoint(l,x,n)},mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter),mxPerimeter.HexagonPerimeter2=function(t,e,n,i){var o=A.prototype.size;null!=e&&(o=mxUtils.getValue(e.style,"size",o));var s,l=t.x,r=t.y,a=t.width,h=t.height,d=t.getCenterX(),u=t.getCenterY(),p=null!=e?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;if(p==mxConstants.DIRECTION_NORTH||p==mxConstants.DIRECTION_SOUTH){var m=h*Math.max(0,Math.min(1,o));s=[new mxPoint(d,r),new mxPoint(l+a,r+m),new mxPoint(l+a,r+h-m),new mxPoint(d,r+h),new mxPoint(l,r+h-m),new mxPoint(l,r+m),new mxPoint(d,r)]}else{var c=a*Math.max(0,Math.min(1,o));s=[new mxPoint(l+c,r),new mxPoint(l+a-c,r),new mxPoint(l+a,u),new mxPoint(l+a-c,r+h),new mxPoint(l+c,r+h),new mxPoint(l,u),new mxPoint(l+c,r)]}var g=new mxPoint(d,u);return i&&(n.x<l||n.x>l+a?g.y=n.y:g.x=n.x),mxUtils.getPerimeterPoint(s,g,n)},mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2),mxUtils.extend(V,mxShape),V.prototype.size=10,V.prototype.paintBackground=function(t,e,n,i,o){var s=parseFloat(mxUtils.getValue(this.style,"size",this.size));t.translate(e,n),t.ellipse((i-s)/2,0,s,s),t.fillAndStroke(),t.begin(),t.moveTo(i/2,s),t.lineTo(i/2,o),t.end(),t.stroke()},mxCellRenderer.registerShape("lollipop",V),mxUtils.extend(F,mxShape),F.prototype.size=10,F.prototype.inset=2,F.prototype.paintBackground=function(t,e,n,i,o){var s=parseFloat(mxUtils.getValue(this.style,"size",this.size)),l=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;t.translate(e,n),t.begin(),t.moveTo(i/2,s+l),t.lineTo(i/2,o),t.end(),t.stroke(),t.begin(),t.moveTo((i-s)/2-l,s/2),t.quadTo((i-s)/2-l,s+l,i/2,s+l),t.quadTo((i+s)/2+l,s+l,(i+s)/2+l,s/2),t.end(),t.stroke()},mxCellRenderer.registerShape("requires",F),mxUtils.extend(B,mxCylinder),B.prototype.jettyWidth=32,B.prototype.jettyHeight=12,B.prototype.redrawPath=function(t,e,n,i,o,s){var l=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth)),r=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight)),a=l/2,h=a+l/2,d=.3*o-r/2,u=.7*o-r/2;s?(t.moveTo(a,d),t.lineTo(h,d),t.lineTo(h,d+r),t.lineTo(a,d+r),t.moveTo(a,u),t.lineTo(h,u),t.lineTo(h,u+r),t.lineTo(a,u+r)):(t.moveTo(a,0),t.lineTo(i,0),t.lineTo(i,o),t.lineTo(a,o),t.lineTo(a,u+r),t.lineTo(0,u+r),t.lineTo(0,u),t.lineTo(a,u),t.lineTo(a,d+r),t.lineTo(0,d+r),t.lineTo(0,d),t.lineTo(a,d),t.close()),t.end()},mxCellRenderer.registerShape("component",B),mxUtils.extend(Y,mxDoubleEllipse),Y.prototype.outerStroke=!0,Y.prototype.paintVertexShape=function(t,e,n,i,o){var s=Math.min(4,Math.min(i/5,o/5));0<i&&0<o&&(t.ellipse(e+s,n+s,i-2*s,o-2*s),t.fillAndStroke()),t.setShadow(!1),this.outerStroke&&(t.ellipse(e,n,i,o),t.stroke())},mxCellRenderer.registerShape("endState",Y),mxUtils.extend(z,Y),z.prototype.outerStroke=!1,mxCellRenderer.registerShape("startState",z),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.registerShape("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.registerShape("flexArrow",X),mxUtils.extend(j,mxActor),j.prototype.size=30,j.prototype.redrawPath=function(t,e,n,i,o){var s=Math.min(o,parseFloat(mxUtils.getValue(this.style,"size",this.size))),l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,o),new mxPoint(0,s),new mxPoint(i,0),new mxPoint(i,o)],this.isRounded,l,!0),t.end()},mxCellRenderer.registerShape("manualInput",j),mxUtils.extend(Z,mxRectangleShape),Z.prototype.dx=20,Z.prototype.dy=20,Z.prototype.isHtmlAllowed=function(){return!1},Z.prototype.paintForeground=function(t,e,n,i,o){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var s=0;if(this.isRounded){var l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;s=Math.max(s,Math.min(i*l,o*l))}var r=Math.max(s,Math.min(i,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),a=Math.max(s,Math.min(o,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));t.begin(),t.moveTo(e,n+a),t.lineTo(e+i,n+a),t.end(),t.stroke(),t.begin(),t.moveTo(e+r,n),t.lineTo(e+r,n+o),t.end(),t.stroke()},mxCellRenderer.registerShape("internalStorage",Z),mxUtils.extend(K,mxActor),K.prototype.dx=20,K.prototype.dy=20,K.prototype.redrawPath=function(t,e,n,i,o){var s=Math.max(0,Math.min(i,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),l=Math.max(0,Math.min(o,parseFloat(mxUtils.getValue(this.style,"dy",this.dy)))),r=(Math.min(i/2,Math.min(o,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2);this.addPoints(t,[new mxPoint(0,0),new mxPoint(i,0),new mxPoint(i,l),new mxPoint(s,l),new mxPoint(s,o),new mxPoint(0,o)],this.isRounded,r,!0),t.end()},mxCellRenderer.registerShape("corner",K),mxUtils.extend(Q,mxActor),Q.prototype.redrawPath=function(t,e,n,i,o){t.moveTo(0,0),t.lineTo(0,o),t.end(),t.moveTo(i,0),t.lineTo(i,o),t.end(),t.moveTo(0,o/2),t.lineTo(i,o/2),t.end()},mxCellRenderer.registerShape("crossbar",Q),mxUtils.extend(J,mxActor),J.prototype.dx=20,J.prototype.dy=20,J.prototype.redrawPath=function(t,e,n,i,o){var s=Math.max(0,Math.min(i,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),l=Math.max(0,Math.min(o,parseFloat(mxUtils.getValue(this.style,"dy",this.dy)))),r=(Math.abs(i-s),Math.min(i/2,Math.min(o,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2);this.addPoints(t,[new mxPoint(0,0),new mxPoint(i,0),new mxPoint(i,l),new mxPoint((i+s)/2,l),new mxPoint((i+s)/2,o),new mxPoint((i-s)/2,o),new mxPoint((i-s)/2,l),new mxPoint(0,l)],this.isRounded,r,!0),t.end()},mxCellRenderer.registerShape("tee",J),mxUtils.extend(q,mxActor),q.prototype.arrowWidth=.3,q.prototype.arrowSize=.2,q.prototype.redrawPath=function(t,e,n,i,o){var s=o*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),l=i*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize)))),r=(o-s)/2,a=r+s,h=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,r),new mxPoint(i-l,r),new mxPoint(i-l,0),new mxPoint(i,o/2),new mxPoint(i-l,o),new mxPoint(i-l,a),new mxPoint(0,a)],this.isRounded,h,!0),t.end()},mxCellRenderer.registerShape("singleArrow",q),mxUtils.extend($,mxActor),$.prototype.redrawPath=function(t,e,n,i,o){var s=o*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",q.prototype.arrowWidth)))),l=i*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",q.prototype.arrowSize)))),r=(o-s)/2,a=r+s,h=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,o/2),new mxPoint(l,0),new mxPoint(l,r),new mxPoint(i-l,r),new mxPoint(i-l,0),new mxPoint(i,o/2),new mxPoint(i-l,o),new mxPoint(i-l,a),new mxPoint(l,a),new mxPoint(l,o)],this.isRounded,h,!0),t.end()},mxCellRenderer.registerShape("doubleArrow",$),mxUtils.extend(tt,mxActor),tt.prototype.size=.1,tt.prototype.redrawPath=function(t,e,n,i,o){var s=i*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));t.moveTo(s,0),t.lineTo(i,0),t.quadTo(i-2*s,o/2,i,o),t.lineTo(s,o),t.quadTo(s-2*s,o/2,s,0),t.close(),t.end()},mxCellRenderer.registerShape("dataStorage",tt),mxUtils.extend(et,mxActor),et.prototype.redrawPath=function(t,e,n,i,o){t.moveTo(0,0),t.quadTo(i,0,i,o/2),t.quadTo(i,o,0,o),t.close(),t.end()},mxCellRenderer.registerShape("or",et),mxUtils.extend(nt,mxActor),nt.prototype.redrawPath=function(t,e,n,i,o){t.moveTo(0,0),t.quadTo(i,0,i,o/2),t.quadTo(i,o,0,o),t.quadTo(i/2,o/2,0,0),t.close(),t.end()},mxCellRenderer.registerShape("xor",nt),mxUtils.extend(it,mxActor),it.prototype.size=20,it.prototype.redrawPath=function(t,e,n,i,o){var s=Math.min(i/2,Math.min(o,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(s,0),new mxPoint(i-s,0),new mxPoint(i,.8*s),new mxPoint(i,o),new mxPoint(0,o),new mxPoint(0,.8*s)],this.isRounded,l,!0),t.end()},mxCellRenderer.registerShape("loopLimit",it),mxUtils.extend(ot,mxActor),ot.prototype.size=3/8,ot.prototype.redrawPath=function(t,e,n,i,o){var s=o*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,0),new mxPoint(i,0),new mxPoint(i,o-s),new mxPoint(i/2,o),new mxPoint(0,o-s)],this.isRounded,l,!0),t.end()},mxCellRenderer.registerShape("offPageConnector",ot),mxUtils.extend(st,mxEllipse),st.prototype.paintVertexShape=function(t,e,n,i,o){mxEllipse.prototype.paintVertexShape.apply(this,arguments),t.begin(),t.moveTo(e+i/2,n+o),t.lineTo(e+i,n+o),t.end(),t.stroke()},mxCellRenderer.registerShape("tapeData",st),mxUtils.extend(lt,mxEllipse),lt.prototype.paintVertexShape=function(t,e,n,i,o){mxEllipse.prototype.paintVertexShape.apply(this,arguments),t.setShadow(!1),t.begin(),t.moveTo(e,n+o/2),t.lineTo(e+i,n+o/2),t.end(),t.stroke(),t.begin(),t.moveTo(e+i/2,n),t.lineTo(e+i/2,n+o),t.end(),t.stroke()},mxCellRenderer.registerShape("orEllipse",lt),mxUtils.extend(rt,mxEllipse),rt.prototype.paintVertexShape=function(t,e,n,i,o){mxEllipse.prototype.paintVertexShape.apply(this,arguments);t.setShadow(!1),t.begin(),t.moveTo(e+.145*i,n+.145*o),t.lineTo(e+.855*i,n+.855*o),t.end(),t.stroke(),t.begin(),t.moveTo(e+.855*i,n+.145*o),t.lineTo(e+.145*i,n+.855*o),t.end(),t.stroke()},mxCellRenderer.registerShape("sumEllipse",rt),mxUtils.extend(at,mxRhombus),at.prototype.paintVertexShape=function(t,e,n,i,o){mxRhombus.prototype.paintVertexShape.apply(this,arguments),t.setShadow(!1),t.begin(),t.moveTo(e,n+o/2),t.lineTo(e+i,n+o/2),t.end(),t.stroke()},mxCellRenderer.registerShape("sortShape",at),mxUtils.extend(ht,mxEllipse),ht.prototype.paintVertexShape=function(t,e,n,i,o){t.begin(),t.moveTo(e,n),t.lineTo(e+i,n),t.lineTo(e+i/2,n+o/2),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(e,n+o),t.lineTo(e+i,n+o),t.lineTo(e+i/2,n+o/2),t.close(),t.fillAndStroke()},mxCellRenderer.registerShape("collate",ht),mxUtils.extend(dt,mxEllipse),dt.prototype.paintVertexShape=function(t,e,n,i,o){var s=n+o-5;t.begin(),t.moveTo(e,n),t.lineTo(e,n+o),t.moveTo(e,s),t.lineTo(e+10,s-5),t.moveTo(e,s),t.lineTo(e+10,5+s),t.moveTo(e,s),t.lineTo(e+i,s),t.moveTo(e+i,n),t.lineTo(e+i,n+o),t.moveTo(e+i,s),t.lineTo(e+i-10,s-5),t.moveTo(e+i,s),t.lineTo(e+i-10,5+s),t.end(),t.stroke()},mxCellRenderer.registerShape("dimension",dt),mxUtils.extend(ut,mxEllipse),ut.prototype.paintVertexShape=function(t,e,n,i,o){this.outline||t.setStrokeColor(null),mxRectangleShape.prototype.paintBackground.apply(this,arguments),null!=this.style&&(t.setStrokeColor(this.stroke),t.rect(e,n,i,o),t.fill(),t.begin(),t.moveTo(e,n),"1"==mxUtils.getValue(this.style,"top","1")?t.lineTo(e+i,n):t.moveTo(e+i,n),"1"==mxUtils.getValue(this.style,"right","1")?t.lineTo(e+i,n+o):t.moveTo(e+i,n+o),"1"==mxUtils.getValue(this.style,"bottom","1")?t.lineTo(e,n+o):t.moveTo(e,n+o),"1"==mxUtils.getValue(this.style,"left","1")&&t.lineTo(e,n-this.strokewidth/2),t.end(),t.stroke())},mxCellRenderer.registerShape("partialRectangle",ut),mxUtils.extend(pt,mxEllipse),pt.prototype.paintVertexShape=function(t,e,n,i,o){mxEllipse.prototype.paintVertexShape.apply(this,arguments),t.setShadow(!1),t.begin(),"vertical"==mxUtils.getValue(this.style,"line")?(t.moveTo(e+i/2,n),t.lineTo(e+i/2,n+o)):(t.moveTo(e,n+o/2),t.lineTo(e+i,n+o/2)),t.end(),t.stroke()},mxCellRenderer.registerShape("lineEllipse",pt),mxUtils.extend(mt,mxActor),mt.prototype.redrawPath=function(t,e,n,i,o){var s=Math.min(i,o/2);t.moveTo(0,0),t.lineTo(i-s,0),t.quadTo(i,0,i,o/2),t.quadTo(i,o,i-s,o),t.lineTo(0,o),t.close(),t.end()},mxCellRenderer.registerShape("delay",mt),mxUtils.extend(ct,mxActor),ct.prototype.size=.2,ct.prototype.redrawPath=function(t,e,n,i,o){var s=Math.min(o,i),l=Math.max(0,Math.min(s,s*parseFloat(mxUtils.getValue(this.style,"size",this.size)))),r=(o-l)/2,a=r+l,h=(i-l)/2,d=h+l;t.moveTo(0,r),t.lineTo(h,r),t.lineTo(h,0),t.lineTo(d,0),t.lineTo(d,r),t.lineTo(i,r),t.lineTo(i,a),t.lineTo(d,a),t.lineTo(d,o),t.lineTo(h,o),t.lineTo(h,a),t.lineTo(0,a),t.close(),t.end()},mxCellRenderer.registerShape("cross",ct),mxUtils.extend(gt,mxActor),gt.prototype.size=.25,gt.prototype.redrawPath=function(t,e,n,i,o){var s=Math.min(i,o/2),l=Math.min(i-s,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*i);t.moveTo(0,o/2),t.lineTo(l,0),t.lineTo(i-s,0),t.quadTo(i,0,i,o/2),t.quadTo(i,o,i-s,o),t.lineTo(l,o),t.close(),t.end()},mxCellRenderer.registerShape("display",gt),mxUtils.extend(xt,mxConnector),xt.prototype.origPaintEdgeShape=xt.prototype.paintEdgeShape,xt.prototype.paintEdgeShape=function(t,e,n){for(var i=[],o=0;o<e.length;o++)i.push(mxUtils.clone(e[o]));var s=t.state.dashed,l=t.state.fixDash;if(xt.prototype.origPaintEdgeShape.apply(this,[t,i,n]),3<=t.state.strokeWidth){var r=mxUtils.getValue(this.style,"fillColor",null);null!=r&&(t.setStrokeColor(r),t.setStrokeWidth(t.state.strokeWidth-2),t.setDashed(s,l),xt.prototype.origPaintEdgeShape.apply(this,[t,e,n]))}},mxCellRenderer.registerShape("filledEdge",xt),"undefined"!=typeof StyleFormatPanel&&(I=StyleFormatPanel.prototype.getCustomColors,StyleFormatPanel.prototype.getCustomColors=function(){var t=this.format.getSelectionState(),e=I.apply(this,arguments);return"umlFrame"==t.style.shape&&e.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"#ffffff"}),e}),mxMarker.addMarker("dash",function(t,e,n,i,o,s,l,r,a,h){var d=o*(l+a+1),u=s*(l+a+1);return function(){t.begin(),t.moveTo(i.x-d/2-u/2,i.y-u/2+d/2),t.lineTo(i.x+u/2-3*d/2,i.y-3*u/2-d/2),t.stroke()}}),mxMarker.addMarker("cross",function(t,e,n,i,o,s,l,r,a,h){var d=o*(l+a+1),u=s*(l+a+1);return function(){t.begin(),t.moveTo(i.x-d/2-u/2,i.y-u/2+d/2),t.lineTo(i.x+u/2-3*d/2,i.y-3*u/2-d/2),t.moveTo(i.x-d/2+u/2,i.y-u/2-d/2),t.lineTo(i.x-u/2-3*d/2,i.y-3*u/2+d/2),t.stroke()}}),mxMarker.addMarker("circle",yt),mxMarker.addMarker("circlePlus",function(t,e,n,i,o,s,l,r,a,h){var d=i.clone(),u=yt.apply(this,arguments),p=o*(l+2*a),m=s*(l+2*a);return function(){u.apply(this,arguments),t.begin(),t.moveTo(d.x-o*a,d.y-s*a),t.lineTo(d.x-2*p+o*a,d.y-2*m+s*a),t.moveTo(d.x-p-m+s*a,d.y-m+p-o*a),t.lineTo(d.x+m-p-s*a,d.y-m-p+o*a),t.stroke()}}),mxMarker.addMarker("async",function(t,e,n,i,o,s,l,r,a,h){var d=o*a*1.118,u=s*a*1.118;o*=l+a,s*=l+a;var p=i.clone();p.x-=d,p.y-=u;return i.x+=1*-o-d,i.y+=1*-s-u,function(){t.begin(),t.moveTo(p.x,p.y),r?t.lineTo(p.x-o-s/2,p.y-s+o/2):t.lineTo(p.x+s/2-o,p.y-s-o/2),t.lineTo(p.x-o,p.y-s),t.close(),h?t.fillAndStroke():t.stroke()}}),mxMarker.addMarker("openAsync",(M=null!=(M=2)?M:2,function(t,e,n,i,o,s,l,r,a,h){o*=l+a,s*=l+a;var d=i.clone();return function(){t.begin(),t.moveTo(d.x,d.y),r?t.lineTo(d.x-o-s/M,d.y-s+o/M):t.lineTo(d.x+s/M-o,d.y-s-o/M),t.stroke()}})),void 0!==mxVertexHandler){function ft(t,e,n,i,o,s){var l=new mxHandle(t,null,mxVertexHandler.prototype.secondaryHandleImage);if(l.execute=function(){for(var t=0;t<e.length;t++)this.copyStyle(e[t])},l.getPosition=n,l.setPosition=i,l.ignoreGrid=null==o||o,s){var r=l.positionChanged;l.positionChanged=function(){r.apply(this,arguments),t.view.invalidate(this.state.cell),t.view.validate()}}return l}function vt(o,i){return ft(o,[mxConstants.STYLE_ARCSIZE],function(t){var e=null!=i?i:t.height/8;if("1"==mxUtils.getValue(o.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var n=mxUtils.getValue(o.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(t.x+t.width-Math.min(t.width/2,n),t.y+e)}n=Math.max(0,parseFloat(mxUtils.getValue(o.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(t.x+t.width-Math.min(Math.max(t.width/2,t.height/2),Math.min(t.width,t.height)*n),t.y+e)},function(t,e,n){if("1"==mxUtils.getValue(o.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(t.width,2*(t.x+t.width-e.x))));else{var i=Math.min(50,Math.max(0,100*(t.width-e.x+t.x)/Math.min(t.width,t.height)));this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(i)}})}function Ct(){return function(t){var e=[];return mxUtils.getValue(t.style,mxConstants.STYLE_ROUNDED,!1)&&e.push(vt(t)),e}}function Et(n){return function(t){var e=[ft(t,["size"],function(t){var e=Math.max(0,Math.min(n,parseFloat(mxUtils.getValue(this.state.style,"size",g.prototype.size))));return new mxPoint(t.x+e*t.width*.75,t.y+t.height/4)},function(t,e){this.state.style.size=Math.max(0,Math.min(n,(e.x-t.x)/(.75*t.width)))},null,!0)];return mxUtils.getValue(t.style,mxConstants.STYLE_ROUNDED,!1)&&e.push(vt(t)),e}}function wt(i,e,l,n,r){return l=null!=l?l:1,function(s){var t=[ft(s,["size"],function(t){var e=null!=r?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,n=parseFloat(mxUtils.getValue(this.state.style,"size",e?r:i));return new mxPoint(t.x+Math.max(0,Math.min(t.width,n*(e?1:t.width))),t.getCenterY())},function(t,e,n){var i=null!=r?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,o=i?e.x-t.x:Math.max(0,Math.min(l,(e.x-t.x)/t.width));i&&!mxEvent.isAltDown(n.getEvent())&&(o=s.view.graph.snap(o)),this.state.style.size=o},null,n)];return e&&mxUtils.getValue(s.style,mxConstants.STYLE_ROUNDED,!1)&&t.push(vt(s)),t}}function St(n,i,o){return function(t){var e=[ft(t,["size"],function(t){var e=Math.max(0,Math.min(t.width,Math.min(t.height,parseFloat(mxUtils.getValue(this.state.style,"size",i)))))*n;return new mxPoint(t.x+e,t.y+e)},function(t,e){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(t.width,e.x-t.x),Math.min(t.height,e.y-t.y)))/n)})];return o&&mxUtils.getValue(t.style,mxConstants.STYLE_ROUNDED,!1)&&e.push(vt(t)),e}}function bt(i){return function(t){return[ft(t,["arrowWidth","arrowSize"],function(t){var e=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",q.prototype.arrowWidth))),n=Math.max(0,Math.min(i,mxUtils.getValue(this.state.style,"arrowSize",q.prototype.arrowSize)));return new mxPoint(t.x+(1-n)*t.width,t.y+(1-e)*t.height/2)},function(t,e){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(t.y+t.height/2-e.y)/t.height*2)),this.state.style.arrowSize=Math.max(0,Math.min(i,(t.x+t.width-e.x)/t.width))})]}}function Tt(p,t,m,u,c){return ft(p,t,function(t){var e=p.absolutePoints,n=e.length-1,i=p.view.translate,o=p.view.scale,s=m?e[0]:e[n],l=m?e[1]:e[n-1],r=l.x-s.x,a=l.y-s.y,h=Math.sqrt(r*r+a*a),d=u.call(this,h,r/h,a/h,s,l);return new mxPoint(d.x/o-i.x,d.y/o-i.y)},function(t,e,n){var i=p.absolutePoints,o=i.length-1,s=p.view.translate,l=p.view.scale,r=m?i[0]:i[o],a=m?i[1]:i[o-1],h=a.x-r.x,d=a.y-r.y,u=Math.sqrt(h*h+d*d);e.x=(e.x+s.x)*l,e.y=(e.y+s.y)*l,c.call(this,u,h/u,d/u,r,a,e,n)})}function At(r,t,a){return Tt(r,["width"],t,function(t,e,n,i,o){var s=r.shape.getEdgeWidth()*r.view.scale+a;return new mxPoint(i.x+e*t/4+n*s/2,i.y+n*t/4-e*s/2)},function(t,e,n,i,o,s){var l=Math.sqrt(mxUtils.ptSegDistSq(i.x,i.y,o.x,o.y,s.x,s.y));r.style.width=Math.round(2*l)/r.view.scale-a})}var Lt={link:function(t){return[At(t,!0,10),At(t,!1,10)]},flexArrow:function(h){var d=h.view.graph.gridSize/h.view.scale,t=[];return mxUtils.getValue(h.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(t.push(Tt(h,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(t,e,n,i,o){var s=(h.shape.getEdgeWidth()-h.shape.strokewidth)*h.view.scale,l=3*mxUtils.getNumber(h.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*h.view.scale;return new mxPoint(i.x+e*(l+h.shape.strokewidth*h.view.scale)+n*s/2,i.y+n*(l+h.shape.strokewidth*h.view.scale)-e*s/2)},function(t,e,n,i,o,s,l){var r=Math.sqrt(mxUtils.ptSegDistSq(i.x,i.y,o.x,o.y,s.x,s.y)),a=mxUtils.ptLineDist(i.x,i.y,i.x+n,i.y-e,s.x,s.y);h.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(a-h.shape.strokewidth)/3)/100/h.view.scale,h.style.width=Math.round(2*r)/h.view.scale,mxEvent.isControlDown(l.getEvent())&&(h.style[mxConstants.STYLE_ENDSIZE]=h.style[mxConstants.STYLE_STARTSIZE]),mxEvent.isAltDown(l.getEvent())||Math.abs(parseFloat(h.style[mxConstants.STYLE_STARTSIZE])-parseFloat(h.style[mxConstants.STYLE_ENDSIZE]))<d/6&&(h.style[mxConstants.STYLE_STARTSIZE]=h.style[mxConstants.STYLE_ENDSIZE])})),t.push(Tt(h,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(t,e,n,i,o){var s=(h.shape.getStartArrowWidth()-h.shape.strokewidth)*h.view.scale,l=3*mxUtils.getNumber(h.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*h.view.scale;return new mxPoint(i.x+e*(l+h.shape.strokewidth*h.view.scale)+n*s/2,i.y+n*(l+h.shape.strokewidth*h.view.scale)-e*s/2)},function(t,e,n,i,o,s,l){var r=Math.sqrt(mxUtils.ptSegDistSq(i.x,i.y,o.x,o.y,s.x,s.y)),a=mxUtils.ptLineDist(i.x,i.y,i.x+n,i.y-e,s.x,s.y);h.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(a-h.shape.strokewidth)/3)/100/h.view.scale,h.style.startWidth=Math.max(0,Math.round(2*r)-h.shape.getEdgeWidth())/h.view.scale,mxEvent.isControlDown(l.getEvent())&&(h.style[mxConstants.STYLE_ENDSIZE]=h.style[mxConstants.STYLE_STARTSIZE],h.style.endWidth=h.style.startWidth),mxEvent.isAltDown(l.getEvent())||(Math.abs(parseFloat(h.style[mxConstants.STYLE_STARTSIZE])-parseFloat(h.style[mxConstants.STYLE_ENDSIZE]))<d/6&&(h.style[mxConstants.STYLE_STARTSIZE]=h.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(h.style.startWidth)-parseFloat(h.style.endWidth))<d&&(h.style.startWidth=h.style.endWidth))}))),mxUtils.getValue(h.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(t.push(Tt(h,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(t,e,n,i,o){var s=(h.shape.getEdgeWidth()-h.shape.strokewidth)*h.view.scale,l=3*mxUtils.getNumber(h.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*h.view.scale;return new mxPoint(i.x+e*(l+h.shape.strokewidth*h.view.scale)-n*s/2,i.y+n*(l+h.shape.strokewidth*h.view.scale)+e*s/2)},function(t,e,n,i,o,s,l){var r=Math.sqrt(mxUtils.ptSegDistSq(i.x,i.y,o.x,o.y,s.x,s.y)),a=mxUtils.ptLineDist(i.x,i.y,i.x+n,i.y-e,s.x,s.y);h.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(a-h.shape.strokewidth)/3)/100/h.view.scale,h.style.width=Math.round(2*r)/h.view.scale,mxEvent.isControlDown(l.getEvent())&&(h.style[mxConstants.STYLE_STARTSIZE]=h.style[mxConstants.STYLE_ENDSIZE]),mxEvent.isAltDown(l.getEvent())||Math.abs(parseFloat(h.style[mxConstants.STYLE_ENDSIZE])-parseFloat(h.style[mxConstants.STYLE_STARTSIZE]))<d/6&&(h.style[mxConstants.STYLE_ENDSIZE]=h.style[mxConstants.STYLE_STARTSIZE])})),t.push(Tt(h,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(t,e,n,i,o){var s=(h.shape.getEndArrowWidth()-h.shape.strokewidth)*h.view.scale,l=3*mxUtils.getNumber(h.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*h.view.scale;return new mxPoint(i.x+e*(l+h.shape.strokewidth*h.view.scale)-n*s/2,i.y+n*(l+h.shape.strokewidth*h.view.scale)+e*s/2)},function(t,e,n,i,o,s,l){var r=Math.sqrt(mxUtils.ptSegDistSq(i.x,i.y,o.x,o.y,s.x,s.y)),a=mxUtils.ptLineDist(i.x,i.y,i.x+n,i.y-e,s.x,s.y);h.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(a-h.shape.strokewidth)/3)/100/h.view.scale,h.style.endWidth=Math.max(0,Math.round(2*r)-h.shape.getEdgeWidth())/h.view.scale,mxEvent.isControlDown(l.getEvent())&&(h.style[mxConstants.STYLE_STARTSIZE]=h.style[mxConstants.STYLE_ENDSIZE],h.style.startWidth=h.style.endWidth),mxEvent.isAltDown(l.getEvent())||(Math.abs(parseFloat(h.style[mxConstants.STYLE_ENDSIZE])-parseFloat(h.style[mxConstants.STYLE_STARTSIZE]))<d/6&&(h.style[mxConstants.STYLE_ENDSIZE]=h.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(h.style.endWidth)-parseFloat(h.style.startWidth))<d&&(h.style.endWidth=h.style.startWidth))}))),t},swimlane:function(n){var t=[ft(n,[mxConstants.STYLE_STARTSIZE],function(t){var e=parseFloat(mxUtils.getValue(n.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(n.style,mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(t.getCenterX(),t.y+Math.max(0,Math.min(t.height,e))):new mxPoint(t.x+Math.max(0,Math.min(t.width,e)),t.getCenterY())},function(t,e){n.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(t.height,e.y-t.y))):Math.round(Math.max(0,Math.min(t.width,e.x-t.x)))})];if(mxUtils.getValue(n.style,mxConstants.STYLE_ROUNDED)){var e=parseFloat(mxUtils.getValue(n.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));t.push(vt(n,e/2))}return t},label:Ct(),ext:Ct(),rectangle:Ct(),triangle:Ct(),rhombus:Ct(),umlLifeline:function(t){return[ft(t,["size"],function(t){var e=Math.max(0,Math.min(t.height,parseFloat(mxUtils.getValue(this.state.style,"size",U.prototype.size))));return new mxPoint(t.getCenterX(),t.y+e)},function(t,e){this.state.style.size=Math.round(Math.max(0,Math.min(t.height,e.y-t.y)))},!1)]},umlFrame:function(t){return[ft(t,["width","height"],function(t){var e=Math.max(k.prototype.corner,Math.min(t.width,mxUtils.getValue(this.state.style,"width",k.prototype.width))),n=Math.max(1.5*k.prototype.corner,Math.min(t.height,mxUtils.getValue(this.state.style,"height",k.prototype.height)));return new mxPoint(t.x+e,t.y+n)},function(t,e){this.state.style.width=Math.round(Math.max(k.prototype.corner,Math.min(t.width,e.x-t.x))),this.state.style.height=Math.round(Math.max(1.5*k.prototype.corner,Math.min(t.height,e.y-t.y)))},!1)]},process:function(t){var e=[ft(t,["size"],function(t){var e=Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.state.style,"size",w.prototype.size))));return new mxPoint(t.x+t.width*e,t.y+t.height/4)},function(t,e){this.state.style.size=Math.max(0,Math.min(.5,(e.x-t.x)/t.width))})];return mxUtils.getValue(t.style,mxConstants.STYLE_ROUNDED,!1)&&e.push(vt(t)),e},cross:function(t){return[ft(t,["size"],function(t){var e=Math.min(t.width,t.height),n=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"size",ct.prototype.size)))*e/2;return new mxPoint(t.getCenterX()-n,t.getCenterY()-n)},function(t,e){var n=Math.min(t.width,t.height);this.state.style.size=Math.max(0,Math.min(1,Math.min(Math.max(0,t.getCenterY()-e.y)/n*2,Math.max(0,t.getCenterX()-e.x)/n*2)))})]},note:function(t){return[ft(t,["size"],function(t){var e=Math.max(0,Math.min(t.width,Math.min(t.height,parseFloat(mxUtils.getValue(this.state.style,"size",o.prototype.size)))));return new mxPoint(t.x+t.width-e,t.y+e)},function(t,e){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(t.width,t.x+t.width-e.x),Math.min(t.height,e.y-t.y))))})]},manualInput:function(t){var e=[ft(t,["size"],function(t){var e=Math.max(0,Math.min(t.height,mxUtils.getValue(this.state.style,"size",j.prototype.size)));return new mxPoint(t.x+t.width/4,t.y+3*e/4)},function(t,e){this.state.style.size=Math.round(Math.max(0,Math.min(t.height,4*(e.y-t.y)/3)))})];return mxUtils.getValue(t.style,mxConstants.STYLE_ROUNDED,!1)&&e.push(vt(t)),e},dataStorage:function(t){return[ft(t,["size"],function(t){var e=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",tt.prototype.size))));return new mxPoint(t.x+(1-e)*t.width,t.getCenterY())},function(t,e){this.state.style.size=Math.max(0,Math.min(1,(t.x+t.width-e.x)/t.width))})]},callout:function(t){var e=[ft(t,["size","position"],function(t){var e=Math.max(0,Math.min(t.height,mxUtils.getValue(this.state.style,"size",b.prototype.size))),n=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",b.prototype.position)));Math.max(0,Math.min(t.width,mxUtils.getValue(this.state.style,"base",b.prototype.base)));return new mxPoint(t.x+n*t.width,t.y+t.height-e)},function(t,e){Math.max(0,Math.min(t.width,mxUtils.getValue(this.state.style,"base",b.prototype.base)));this.state.style.size=Math.round(Math.max(0,Math.min(t.height,t.y+t.height-e.y))),this.state.style.position=Math.round(100*Math.max(0,Math.min(1,(e.x-t.x)/t.width)))/100}),ft(t,["position2"],function(t){var e=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",b.prototype.position2)));return new mxPoint(t.x+e*t.width,t.y+t.height)},function(t,e){this.state.style.position2=Math.round(100*Math.max(0,Math.min(1,(e.x-t.x)/t.width)))/100}),ft(t,["base"],function(t){var e=Math.max(0,Math.min(t.height,mxUtils.getValue(this.state.style,"size",b.prototype.size))),n=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",b.prototype.position))),i=Math.max(0,Math.min(t.width,mxUtils.getValue(this.state.style,"base",b.prototype.base)));return new mxPoint(t.x+Math.min(t.width,n*t.width+i),t.y+t.height-e)},function(t,e){var n=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",b.prototype.position)));this.state.style.base=Math.round(Math.max(0,Math.min(t.width,e.x-t.x-n*t.width)))})];return mxUtils.getValue(t.style,mxConstants.STYLE_ROUNDED,!1)&&e.push(vt(t)),e},internalStorage:function(t){var e=[ft(t,["dx","dy"],function(t){var e=Math.max(0,Math.min(t.width,mxUtils.getValue(this.state.style,"dx",Z.prototype.dx))),n=Math.max(0,Math.min(t.height,mxUtils.getValue(this.state.style,"dy",Z.prototype.dy)));return new mxPoint(t.x+e,t.y+n)},function(t,e){this.state.style.dx=Math.round(Math.max(0,Math.min(t.width,e.x-t.x))),this.state.style.dy=Math.round(Math.max(0,Math.min(t.height,e.y-t.y)))})];return mxUtils.getValue(t.style,mxConstants.STYLE_ROUNDED,!1)&&e.push(vt(t)),e},corner:function(t){return[ft(t,["dx","dy"],function(t){var e=Math.max(0,Math.min(t.width,mxUtils.getValue(this.state.style,"dx",K.prototype.dx))),n=Math.max(0,Math.min(t.height,mxUtils.getValue(this.state.style,"dy",K.prototype.dy)));return new mxPoint(t.x+e,t.y+n)},function(t,e){this.state.style.dx=Math.round(Math.max(0,Math.min(t.width,e.x-t.x))),this.state.style.dy=Math.round(Math.max(0,Math.min(t.height,e.y-t.y)))})]},tee:function(t){return[ft(t,["dx","dy"],function(t){var e=Math.max(0,Math.min(t.width,mxUtils.getValue(this.state.style,"dx",J.prototype.dx))),n=Math.max(0,Math.min(t.height,mxUtils.getValue(this.state.style,"dy",J.prototype.dy)));return new mxPoint(t.x+(t.width+e)/2,t.y+n)},function(t,e){this.state.style.dx=Math.round(Math.max(0,2*Math.min(t.width/2,e.x-t.x-t.width/2))),this.state.style.dy=Math.round(Math.max(0,Math.min(t.height,e.y-t.y)))})]},singleArrow:bt(1),doubleArrow:bt(.5),folder:function(t){return[ft(t,["tabWidth","tabHeight"],function(t){var e=Math.max(0,Math.min(t.width,mxUtils.getValue(this.state.style,"tabWidth",l.prototype.tabWidth))),n=Math.max(0,Math.min(t.height,mxUtils.getValue(this.state.style,"tabHeight",l.prototype.tabHeight)));return mxUtils.getValue(this.state.style,"tabPosition",l.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(e=t.width-e),new mxPoint(t.x+e,t.y+n)},function(t,e){var n=Math.max(0,Math.min(t.width,e.x-t.x));mxUtils.getValue(this.state.style,"tabPosition",l.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(n=t.width-n),this.state.style.tabWidth=Math.round(n),this.state.style.tabHeight=Math.round(Math.max(0,Math.min(t.height,e.y-t.y)))})]},document:function(t){return[ft(t,["size"],function(t){var e=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",u.prototype.size))));return new mxPoint(t.x+3*t.width/4,t.y+(1-e)*t.height)},function(t,e){this.state.style.size=Math.max(0,Math.min(1,(t.y+t.height-e.y)/t.height))})]},tape:function(t){return[ft(t,["size"],function(t){var e=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",d.prototype.size))));return new mxPoint(t.getCenterX(),t.y+e*t.height/2)},function(t,e){this.state.style.size=Math.max(0,Math.min(1,(e.y-t.y)/t.height*2))})]},offPageConnector:function(t){return[ft(t,["size"],function(t){var e=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",ot.prototype.size))));return new mxPoint(t.getCenterX(),t.y+(1-e)*t.height)},function(t,e){this.state.style.size=Math.max(0,Math.min(1,(t.y+t.height-e.y)/t.height))})]},step:wt(T.prototype.size,!0,null,!0,T.prototype.fixedSize),hexagon:wt(A.prototype.size,!0,.5,!0),curlyBracket:wt(m.prototype.size,!1),display:wt(gt.prototype.size,!1),cube:St(1,t.prototype.size,!1),card:St(.5,h.prototype.size,!0),loopLimit:St(.5,it.prototype.size,!0),trapezoid:Et(.5),parallelogram:Et(1)};Graph.createHandle=ft,Graph.handleFactory=Lt,mxVertexHandler.prototype.createCustomHandles=function(){if(1==this.state.view.graph.getSelectionCount()&&this.graph.isCellRotatable(this.state.cell)){var t=this.state.style.shape;null==mxCellRenderer.defaultShapes[t]&&null==mxStencilRegistry.getStencil(t)&&(t=mxConstants.SHAPE_RECTANGLE);var e=Lt[t];if(null==e&&null!=this.state.shape&&this.state.shape.isRoundable()&&(e=Lt[mxConstants.SHAPE_RECTANGLE]),null!=e)return e(this.state)}return null},mxEdgeHandler.prototype.createCustomHandles=function(){if(1==this.state.view.graph.getSelectionCount()){var t=this.state.style.shape;null==mxCellRenderer.defaultShapes[t]&&null==mxStencilRegistry.getStencil(t)&&(t=mxConstants.SHAPE_CONNECTOR);var e=Lt[t];if(null!=e)return e(this.state)}return null}}else Graph.createHandle=function(){},Graph.handleFactory={};var It=new mxPoint(1,0),Mt=new mxPoint(1,0),Rt=mxUtils.toRadians(-30),Pt=Math.cos(Rt),Ot=Math.sin(Rt);It=mxUtils.getRotatedPoint(It,Pt,Ot);var Nt=mxUtils.toRadians(-150),Gt=Math.cos(Nt),Ht=Math.sin(Nt);Mt=mxUtils.getRotatedPoint(Mt,Gt,Ht),mxEdgeStyle.IsometricConnector=function(t,e,n,i,r){var o=t.view,s=null!=i&&0<i.length?i[0]:null,l=t.absolutePoints,a=l[0],h=l[l.length-1];null!=s&&(s=o.transformControlPoint(t,s)),null==a&&null!=e&&(a=new mxPoint(e.getCenterX(),e.getCenterY())),null==h&&null!=n&&(h=new mxPoint(n.getCenterX(),n.getCenterY()));var d=It.x,u=It.y,p=Mt.x,m=Mt.y,c="horizontal"==mxUtils.getValue(t.style,"elbow","horizontal");if(null!=h&&null!=a){var g=a;function x(t,e,n){var i=t-g.x,o=e-g.y,s=(m*i-p*o)/(d*m-u*p),l=(u*i-d*o)/(u*p-d*m);g=c?(n&&(g=new mxPoint(g.x+d*s,g.y+u*s),r.push(g)),new mxPoint(g.x+p*l,g.y+m*l)):(n&&(g=new mxPoint(g.x+p*l,g.y+m*l),r.push(g)),new mxPoint(g.x+d*s,g.y+u*s)),r.push(g)}null==s&&(s=new mxPoint(a.x+(h.x-a.x)/2,a.y+(h.y-a.y)/2)),x(s.x,s.y,!0),x(h.x,h.y,!1)}},mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Dt=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(t,e){if(e!=mxEdgeStyle.IsometricConnector)return Dt.apply(this,arguments);var n=new mxElbowEdgeHandler(t);return n.snapToTerminals=!1,n},e.prototype.constraints=[],n.prototype.constraints=[],b.prototype.constraints=[],mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.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(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5))],mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints,mxImageShape.prototype.constraints=mxRectangleShape.prototype.constraints,mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints,L.prototype.constraints=mxRectangleShape.prototype.constraints,o.prototype.constraints=mxRectangleShape.prototype.constraints,h.prototype.constraints=mxRectangleShape.prototype.constraints,t.prototype.constraints=mxRectangleShape.prototype.constraints,l.prototype.constraints=mxRectangleShape.prototype.constraints,Z.prototype.constraints=mxRectangleShape.prototype.constraints,tt.prototype.constraints=mxRectangleShape.prototype.constraints,st.prototype.constraints=mxEllipse.prototype.constraints,lt.prototype.constraints=mxEllipse.prototype.constraints,rt.prototype.constraints=mxEllipse.prototype.constraints,pt.prototype.constraints=mxEllipse.prototype.constraints,j.prototype.constraints=mxRectangleShape.prototype.constraints,mt.prototype.constraints=mxRectangleShape.prototype.constraints,gt.prototype.constraints=mxRectangleShape.prototype.constraints,it.prototype.constraints=mxRectangleShape.prototype.constraints,ot.prototype.constraints=mxRectangleShape.prototype.constraints,mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.3),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.7),!0),new mxConnectionConstraint(new mxPoint(.15,.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)],N.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,1),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1)],B.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)],mxActor.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.25,.2),!1),new mxConnectionConstraint(new mxPoint(.1,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.75,.25),!1),new mxConnectionConstraint(new mxPoint(.9,.5),!1),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)],s.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(.5,.25),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.5,.75),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)],d.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.35),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.65),!1),new mxConnectionConstraint(new mxPoint(1,.35),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,.65),!1),new mxConnectionConstraint(new mxPoint(.25,1),!1),new mxConnectionConstraint(new mxPoint(.75,0),!1)],T.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)],mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)],V.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.5,1),!1)],mxDoubleEllipse.prototype.constraints=mxEllipse.prototype.constraints,mxRhombus.prototype.constraints=mxEllipse.prototype.constraints,mxTriangle.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0)],mxHexagon.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.375,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.625,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.375,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.625,1),!0)],mxCloud.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.25),!1),new mxConnectionConstraint(new mxPoint(.4,.1),!1),new mxConnectionConstraint(new mxPoint(.16,.55),!1),new mxConnectionConstraint(new mxPoint(.07,.4),!1),new mxConnectionConstraint(new mxPoint(.31,.8),!1),new mxConnectionConstraint(new mxPoint(.13,.77),!1),new mxConnectionConstraint(new mxPoint(.8,.8),!1),new mxConnectionConstraint(new mxPoint(.55,.95),!1),new mxConnectionConstraint(new mxPoint(.875,.5),!1),new mxConnectionConstraint(new mxPoint(.96,.7),!1),new mxConnectionConstraint(new mxPoint(.625,.2),!1),new mxConnectionConstraint(new mxPoint(.88,.25),!1)],c.prototype.constraints=mxRectangleShape.prototype.constraints,g.prototype.constraints=mxRectangleShape.prototype.constraints,u.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)],mxArrow.prototype.constraints=null,K.prototype.constraints=J.prototype.constraints=null,Q.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)],q.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)],$.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)],ct.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.5,1),!1)],U.prototype.constraints=null,et.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)],nt.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.175,.25),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.175,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)]}(),Actions.prototype.init=function(){function t(){return Action.prototype.isEnabled.apply(this,arguments)&&g.isEnabled()}var r=this.editorUi,d=r.editor,g=d.graph;function e(m){g.escape();var c=g.getDeletableCells(g.getSelectionCells());null!=c&&0<c.length?wfModal.confirm({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(384133," 确定要删除吗?"),okText:wfGetLabel(83446,"确定"),cancelText:wfGetLabel(31129,"取消"),onOk:function(){var t=g.model.getParents(c);g.removeCells(c,m);for(var e=g.minimumGraphSize.x,n=g.minimumGraphSize.y,i=g.minimumGraphSize.width,o=g.minimumGraphSize.height,s=g.getAllCells(e,n,i,o),l=[],r=0;r<c.length;++r)c[r].edge&&l.push(c[r].id);for(var a=0;a<s.length;++a)if(s[a].targrtBranchValue){for(var h=s[a].targrtBranchValue.split(","),d=[],u=0;u<h.length;++u)l.indexOf(h[u])<0&&d.push(h[u]);s[a].targrtBranchValue=d.join(",")}if(null!=t){var p=[];for(r=0;r<t.length;r++)g.model.contains(t[r])&&(g.model.isVertex(t[r])||g.model.isEdge(t[r]))&&p.push(t[r]);g.setSelectionCells(p)}},onCancel:function(){}}):wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(389943,"当前没有选中对象!用鼠标单击流程图上的对象可以选中它"),okText:wfGetLabel(83446,"确定"),onOk:function(){}})}this.addAction("new...",function(){g.openLink(r.getUrl())}),this.addAction("open...",function(){window.openNew=!0,window.openKey="open",r.openFile()}),this.addAction("import...",function(){window.openNew=!1,window.openKey="import",window.openFile=new OpenFile(mxUtils.bind(this,function(){r.hideDialog()})),window.openFile.setConsumer(mxUtils.bind(this,function(t,e){try{var n=mxUtils.parseXml(t);d.graph.setSelectionCells(d.graph.importGraphModel(n.documentElement))}catch(t){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+t.message)}})),r.showDialog(new OpenDialog(this).container,320,220,!0,!0,function(){window.openFile=null})}).isEnabled=t,this.addAction("save",function(){r.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=t,this.addAction("saveAs...",function(){r.saveFile(!0)},null,null,Editor.ctrlKey+"+Shift+S").isEnabled=t,this.addAction("export...",function(){var t=new ExportDialog(r),e=Math.max(0,parseFloat(100)||100)/100,n=Math.max(0,parseInt(1)),i=g.background;t.__proto__.constructor.exportFile(r,name,"xml",i,e,n)}).isEnabled=t,this.addAction("editDiagram...",function(){var t=new EditDiagramDialog(r);r.showDialog(t.container,620,420,!0,!1),t.init()}),this.addAction("pageSetup...",function(){r.showDialog(new PageSetupDialog(r).container,320,220,!0,!0)}).isEnabled=t,this.addAction("print...",function(){r.showDialog(new PrintDialog(r).container,300,180,!0,!0)},null,"sprite-print",Editor.ctrlKey+"+P"),this.addAction("preview",function(){mxUtils.show(g,null,10,10)}),this.addAction("undo",function(){r.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z"),this.addAction("redo",function(){r.redo()},null,"sprite-redo",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z"),this.addAction("cut",function(){mxClipboard.cut(g)},null,"sprite-cut",Editor.ctrlKey+"+X"),this.addAction("copy",function(){mxClipboard.copy(g)},null,"sprite-copy",Editor.ctrlKey+"+C"),this.addAction("paste",function(){g.isEnabled()&&!g.isCellLocked(g.getDefaultParent())&&mxClipboard.paste(g)},!1,"sprite-paste",Editor.ctrlKey+"+V"),this.addAction("pasteHere",function(t){if(g.isEnabled()&&!g.isCellLocked(g.getDefaultParent())){g.getModel().beginUpdate();try{var e=mxClipboard.paste(g);if(null!=e){for(var n=!0,i=0;i<e.length&&n;i++)n=n&&g.model.isEdge(e[i]);var o=g.view.translate,s=g.view.scale,l=o.x,r=o.y,a=null;if(1==e.length&&n){var h=g.getCellGeometry(e[0]);null!=h&&(a=h.getTerminalPoint(!0))}if(null!=(a=null!=a?a:g.getBoundingBoxFromGeometry(e,n))){var d=Math.round(g.snap(g.popupMenuHandler.triggerX/s-l)),u=Math.round(g.snap(g.popupMenuHandler.triggerY/s-r));g.cellsMoved(e,d-a.x,u-a.y)}}}finally{g.getModel().endUpdate()}}}),this.addAction("copySize",function(t){var e=g.getSelectionCell();if(g.isEnabled()&&null!=e&&g.getModel().isVertex(e)){var n=g.getCellGeometry(e);null!=n&&(r.copiedSize=new mxRectangle(n.x,n.y,n.width,n.height))}},null,null,"Alt+Shit+X"),this.addAction("pasteSize",function(t){if(g.isEnabled()&&!g.isSelectionEmpty()&&null!=r.copiedSize){g.getModel().beginUpdate();try{for(var e=g.getSelectionCells(),n=0;n<e.length;n++)if(g.getModel().isVertex(e[n])){var i=g.getCellGeometry(e[n]);null!=i&&((i=i.clone()).width=r.copiedSize.width,i.height=r.copiedSize.height,g.getModel().setGeometry(e[n],i))}}finally{g.getModel().endUpdate()}}},null,null,"Alt+Shit+V"),this.addAction("delete",function(t){e(null!=t&&mxEvent.isShiftDown(t))},null,null,"Delete"),this.addAction("deleteAll",function(){e(!0)},null,null,Editor.ctrlKey+"+Delete"),this.addAction("duplicate",function(){g.setSelectionCells(g.duplicateCells())},null,null,Editor.ctrlKey+"+D"),this.put("turn",new Action(mxResources.get("turn")+" / "+mxResources.get("reverse"),function(){g.turnShapes(g.getSelectionCells())},null,null,Editor.ctrlKey+"+R")),this.addAction("selectVertices",function(){g.selectVertices()},null,null,Editor.ctrlKey+"+Shift+I"),this.addAction("selectEdges",function(){g.selectEdges()},null,null,Editor.ctrlKey+"+Shift+E"),this.addAction("selectAll",function(){g.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A"),this.addAction("selectNone",function(){g.clearSelection()},null,null,Editor.ctrlKey+"+Shift+A"),this.addAction("lockUnlock",function(){if(!g.isSelectionEmpty()){g.getModel().beginUpdate();try{var t=g.isCellMovable(g.getSelectionCell())?1:0;g.toggleCellStyles(mxConstants.STYLE_MOVABLE,t),g.toggleCellStyles(mxConstants.STYLE_RESIZABLE,t),g.toggleCellStyles(mxConstants.STYLE_ROTATABLE,t),g.toggleCellStyles(mxConstants.STYLE_DELETABLE,t),g.toggleCellStyles(mxConstants.STYLE_EDITABLE,t),g.toggleCellStyles("connectable",t)}finally{g.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+L"),this.addAction("home",function(){g.home()},null,null,"Home"),this.addAction("exitGroup",function(){g.exitGroup()},null,null,Editor.ctrlKey+"+Shift+Home"),this.addAction("enterGroup",function(){g.enterGroup()},null,null,Editor.ctrlKey+"+Shift+End"),this.addAction("collapse",function(){g.foldCells(!0)},null,null,Editor.ctrlKey+"+Home"),this.addAction("expand",function(){g.foldCells(!1)},null,null,Editor.ctrlKey+"+End"),this.addAction("toFront",function(){g.orderCells(!1)},null,null,Editor.ctrlKey+"+Shift+F"),this.addAction("toBack",function(){g.orderCells(!0)},null,null,Editor.ctrlKey+"+Shift+B"),this.addAction("group",function(){1==g.getSelectionCount()?g.setCellStyles("container","1"):g.setSelectionCell(g.groupCells(null,0))},null,null,Editor.ctrlKey+"+G"),this.addAction("ungroup",function(){1==g.getSelectionCount()&&0==g.getModel().getChildCount(g.getSelectionCell())?g.setCellStyles("container","0"):g.setSelectionCells(g.ungroupCells())},null,null,Editor.ctrlKey+"+Shift+U"),this.addAction("removeFromGroup",function(){g.removeCellsFromParent()}),this.addAction("edit",function(){g.isEnabled()&&g.startEditingAtCell()},null,null,"F2/Enter"),this.addAction("editData...",function(){var t=g.getSelectionCell()||g.getModel().getRoot();r.showDataDialog(t)},null,null,Editor.ctrlKey+"+M"),this.addAction("editTooltip...",function(){var e=r.editor.graph;if(e.isEnabled()&&!e.isSelectionEmpty()){var n=e.getSelectionCell(),t="";if(mxUtils.isNode(n.value)){var i=n.value.getAttribute("tooltip");null!=i&&(t=i)}var o=new TextareaDialog(r,mxResources.get("editTooltip")+":",t,function(t){e.setTooltipForCell(n,t)});r.showDialog(o.container,320,200,!0,!0),o.init()}},null,null,"Alt+Shift+T"),this.addAction("openLink",function(){var t=g.getLinkForCell(g.getSelectionCell());null!=t&&g.openLink(t)}),this.addAction("editLink...",function(){var e=r.editor.graph;if(e.isEnabled()&&!e.isSelectionEmpty()){var n=e.getSelectionCell(),t=e.getLinkForCell(n)||"";r.showLinkDialog(t,mxResources.get("apply"),function(t){t=mxUtils.trim(t),e.setLinkForCell(n,0<t.length?t:null)})}},null,null,"Alt+Shift+L"),this.addAction("insertLink...",function(){g.isEnabled()&&!g.isCellLocked(g.getDefaultParent())&&r.showLinkDialog("",mxResources.get("insert"),function(t,e){if(0<(t=mxUtils.trim(t)).length){var n=null,i=g.getLinkTitle(t);null!=e&&0<e.length&&(n=e[0].iconUrl,30<(i=(i=e[0].name||e[0].type).charAt(0).toUpperCase()+i.substring(1)).length&&(i=i.substring(0,30)+"..."));var o=g.getFreeInsertPoint(),s=new mxCell(i,new mxGeometry(o.x,o.y,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=n?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+n:"spacing=10;"));s.vertex=!0,g.setLinkForCell(s,t),g.cellSizeUpdated(s,!0),g.getModel().beginUpdate();try{s=g.addCell(s),g.fireEvent(new mxEventObject("cellsInserted","cells",[s]))}finally{g.getModel().endUpdate()}g.setSelectionCell(s),g.scrollCellToVisible(g.getSelectionCell())}})}).isEnabled=t,this.addAction("link...",mxUtils.bind(this,function(){var e=r.editor.graph;if(e.isEnabled())if(e.cellEditor.isContentEditing()){var t=e.getSelectedElement(),n=e.getParentByName(t,"A",e.cellEditor.textarea),i="";if(null==n&&null!=t&&null!=t.getElementsByTagName)for(var o=t.getElementsByTagName("a"),s=0;s<o.length&&null==n;s++)o[s].textContent==t.textContent&&(e.selectNode(o[s]),n=o[s]);null!=n&&"A"==n.nodeName&&(i=n.getAttribute("href")||"");var l=e.cellEditor.saveSelection();r.showLinkDialog(i,mxResources.get("apply"),mxUtils.bind(this,function(t){e.cellEditor.restoreSelection(l),null!=t&&e.insertLink(t)}))}else e.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=t,this.addAction("autosize",function(){var t=g.getSelectionCells();if(null!=t){g.getModel().beginUpdate();try{for(var e=0;e<t.length;e++){var n=t[e];if(g.getModel().getChildCount(n))g.updateGroupBounds([n],20);else{var i=g.view.getState(n),o=g.getCellGeometry(n);g.getModel().isVertex(n)&&null!=i&&null!=i.text&&null!=o&&g.isWrapping(n)?((o=o.clone()).height=i.text.boundingBox.height/g.view.scale,g.getModel().setGeometry(n,o)):g.updateCellSize(n)}}}finally{g.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y"),this.addAction("formattedText",function(){var t=g.getView().getState(g.getSelectionCell());if(null!=t){var e="1";g.stopEditing(),g.getModel().beginUpdate();try{if("1"==t.style.html){e=null;var n=g.convertValueToString(t.cell);"0"!=mxUtils.getValue(t.style,"nl2Br","1")&&(n=n.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));var i=document.createElement("div");i.innerHTML=n,n=mxUtils.extractTextWithWhitespace(i.childNodes),g.cellLabelChanged(t.cell,n)}else{n=mxUtils.htmlEntities(g.convertValueToString(t.cell),!1);"0"!=mxUtils.getValue(t.style,"nl2Br","1")&&(n=n.replace(/\n/g,"<br/>")),g.cellLabelChanged(t.cell,g.sanitizeHtml(n))}g.setCellStyles("html",e),r.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=e?e:"0"],"cells",g.getSelectionCells()))}finally{g.getModel().endUpdate()}}}),this.addAction("wordWrap",function(){var t=g.getView().getState(g.getSelectionCell()),e="wrap";g.stopEditing(),null!=t&&"wrap"==t.style[mxConstants.STYLE_WHITE_SPACE]&&(e=null),g.setCellStyles(mxConstants.STYLE_WHITE_SPACE,e)}),this.addAction("rotation",function(){var t="0",e=g.getView().getState(g.getSelectionCell());null!=e&&(t=e.style[mxConstants.STYLE_ROTATION]||t);var n=new FilenameDialog(r,t,mxResources.get("apply"),function(t){null!=t&&0<t.length&&g.setCellStyles(mxConstants.STYLE_ROTATION,t)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");r.showDialog(n.container,375,80,!0,!0),n.init()}),this.addAction("resetView",function(){g.zoomTo(1),r.resetScrollbars()},null,null,Editor.ctrlKey+"+H"),this.addAction("zoomIn",function(t){g.zoomIn()},null,null,Editor.ctrlKey+" + (Numpad) / Alt+Mousewheel"),this.addAction("zoomOut",function(t){g.zoomOut()},null,null,Editor.ctrlKey+" - (Numpad) / Alt+Mousewheel"),this.addAction("fitWindow",function(){g.fit()},null,null,Editor.ctrlKey+"+Shift+H"),this.addAction("fitPage",mxUtils.bind(this,function(){g.pageVisible||this.get("pageView").funct();var t=g.pageFormat,e=g.pageScale,n=g.container.clientWidth-10,i=g.container.clientHeight-10,o=Math.floor(20*Math.min(n/t.width/e,i/t.height/e))/20;if(g.zoomTo(o),mxUtils.hasScrollbars(g.container)){var s=g.getPagePadding();g.container.scrollTop=s.y*g.view.scale-1,g.container.scrollLeft=Math.min(s.x*g.view.scale,(g.container.scrollWidth-g.container.clientWidth)/2)-1}}),null,null,Editor.ctrlKey+"+J"),this.addAction("fitTwoPages",mxUtils.bind(this,function(){g.pageVisible||this.get("pageView").funct();var t=g.pageFormat,e=g.pageScale,n=g.container.clientWidth-10,i=g.container.clientHeight-10,o=Math.floor(20*Math.min(n/(2*t.width)/e,i/t.height/e))/20;if(g.zoomTo(o),mxUtils.hasScrollbars(g.container)){var s=g.getPagePadding();g.container.scrollTop=Math.min(s.y,(g.container.scrollHeight-g.container.clientHeight)/2),g.container.scrollLeft=Math.min(s.x,(g.container.scrollWidth-g.container.clientWidth)/2)}}),null,null,Editor.ctrlKey+"+Shift+J"),this.addAction("fitPageWidth",mxUtils.bind(this,function(){g.pageVisible||this.get("pageView").funct();var t=g.pageFormat,e=g.pageScale,n=g.container.clientWidth-10,i=Math.floor(20*n/t.width/e)/20;if(g.zoomTo(i),mxUtils.hasScrollbars(g.container)){var o=g.getPagePadding();g.container.scrollLeft=Math.min(o.x*g.view.scale,(g.container.scrollWidth-g.container.clientWidth)/2)}})),this.put("customZoom",new Action(mxResources.get("custom")+"...",mxUtils.bind(this,function(){var t=new FilenameDialog(this.editorUi,parseInt(100*g.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(t){var e=parseInt(t);!isNaN(e)&&0<e&&g.zoomTo(e/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(t.container,300,80,!0,!0),t.init()}),null,null,Editor.ctrlKey+"+0")),this.addAction("pageScale...",mxUtils.bind(this,function(){var t=new FilenameDialog(this.editorUi,parseInt(100*g.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(t){var e=parseInt(t);!isNaN(e)&&0<e&&r.setPageScale(e/100)}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(t.container,300,80,!0,!0),t.init()}));var n=null;(n=this.addAction("grid",function(){g.setGridEnabled(!g.isGridEnabled()),r.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G")).setToggleAction(!0),n.setSelectedCallback(function(){return g.isGridEnabled()}),n.setEnabled(!1),(n=this.addAction("guides",function(){g.graphHandler.guidesEnabled=!g.graphHandler.guidesEnabled,r.fireEvent(new mxEventObject("guidesEnabledChanged"))})).setToggleAction(!0),n.setSelectedCallback(function(){return g.graphHandler.guidesEnabled}),n.setEnabled(!1),(n=this.addAction("tooltips",function(){g.tooltipHandler.setEnabled(!g.tooltipHandler.isEnabled())})).setToggleAction(!0),n.setSelectedCallback(function(){return g.tooltipHandler.isEnabled()}),(n=this.addAction("collapseExpand",function(){var t=new ChangePageSetup(r);t.ignoreColor=!0,t.ignoreImage=!0,t.foldingEnabled=!g.foldingEnabled,g.model.execute(t)})).setToggleAction(!0),n.setSelectedCallback(function(){return g.foldingEnabled}),n.isEnabled=t,(n=this.addAction("scrollbars",function(){r.setScrollbars(!r.hasScrollbars())})).setToggleAction(!0),n.setSelectedCallback(function(){return g.scrollbars}),(n=this.addAction("pageView",mxUtils.bind(this,function(){r.setPageVisible(!g.pageVisible)}))).setToggleAction(!0),n.setSelectedCallback(function(){return g.pageVisible}),(n=this.addAction("connectionArrows",function(){g.connectionArrowsEnabled=!g.connectionArrowsEnabled,r.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A")).setToggleAction(!0),n.setSelectedCallback(function(){return g.connectionArrowsEnabled}),(n=this.addAction("connectionPoints",function(){g.setConnectable(!g.connectionHandler.isEnabled()),r.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+P")).setToggleAction(!0),n.setSelectedCallback(function(){return g.connectionHandler.isEnabled()}),(n=this.addAction("copyConnect",function(){g.connectionHandler.setCreateTarget(!g.connectionHandler.isCreateTarget()),r.fireEvent(new mxEventObject("copyConnectChanged"))})).setToggleAction(!0),n.setSelectedCallback(function(){return g.connectionHandler.isCreateTarget()}),n.isEnabled=t,(n=this.addAction("autosave",function(){r.editor.setAutosave(!r.editor.autosave)})).setToggleAction(!0),n.setSelectedCallback(function(){return r.editor.autosave}),n.isEnabled=t,n.visible=!1,this.addAction("help",function(){var t="";mxResources.isLanguageSupported(mxClient.language)&&(t="_"+mxClient.language),g.openLink(RESOURCES_PATH+"/help"+t+".html")});var i=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){i||(r.showDialog(new AboutDialog(r).container,320,280,!0,!0,function(){i=!1}),i=!0)},null,null,"F1"));var o=mxUtils.bind(this,function(t,e,n,i){return this.addAction(t,function(){if(null!=n&&g.cellEditor.isContentEditing())n();else{g.stopEditing(!1),g.getModel().beginUpdate();try{g.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,e),(e&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?g.updateLabelElements(g.getSelectionCells(),function(t){t.style.fontWeight=null,"B"==t.nodeName&&g.replaceElement(t)}):(e&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?g.updateLabelElements(g.getSelectionCells(),function(t){t.style.fontStyle=null,"I"==t.nodeName&&g.replaceElement(t)}):(e&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&g.updateLabelElements(g.getSelectionCells(),function(t){t.style.textDecoration=null,"U"==t.nodeName&&g.replaceElement(t)})}finally{g.getModel().endUpdate()}}},null,null,i)});o("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B"),o("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",!1,null)},Editor.ctrlKey+"+I"),o("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U"),this.addAction("fontColor...",function(){r.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000")}),this.addAction("strokeColor...",function(){r.menus.pickColor(mxConstants.STYLE_STROKECOLOR)}),this.addAction("fillColor...",function(){r.menus.pickColor(mxConstants.STYLE_FILLCOLOR)}),this.addAction("gradientColor...",function(){r.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR)}),this.addAction("backgroundColor...",function(){r.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor")}),this.addAction("borderColor...",function(){r.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR)}),this.addAction("vertical",function(){r.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)}),this.addAction("shadow",function(){r.menus.toggleStyle(mxConstants.STYLE_SHADOW)}),this.addAction("solid",function(){g.getModel().beginUpdate();try{g.setCellStyles(mxConstants.STYLE_DASHED,null),g.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),r.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",g.getSelectionCells()))}finally{g.getModel().endUpdate()}}),this.addAction("dashed",function(){g.getModel().beginUpdate();try{g.setCellStyles(mxConstants.STYLE_DASHED,"1"),g.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),r.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",g.getSelectionCells()))}finally{g.getModel().endUpdate()}}),this.addAction("dotted",function(){g.getModel().beginUpdate();try{g.setCellStyles(mxConstants.STYLE_DASHED,"1"),g.setCellStyles(mxConstants.STYLE_DASH_PATTERN,"1 4"),r.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],"cells",g.getSelectionCells()))}finally{g.getModel().endUpdate()}}),this.addAction("sharp",function(){g.getModel().beginUpdate();try{g.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),g.setCellStyles(mxConstants.STYLE_CURVED,"0"),r.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","0"],"cells",g.getSelectionCells()))}finally{g.getModel().endUpdate()}}),this.addAction("rounded",function(){g.getModel().beginUpdate();try{g.setCellStyles(mxConstants.STYLE_ROUNDED,"1"),g.setCellStyles(mxConstants.STYLE_CURVED,"0"),r.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",g.getSelectionCells()))}finally{g.getModel().endUpdate()}}),this.addAction("toggleRounded",function(){if(!g.isSelectionEmpty()&&g.isEnabled()){g.getModel().beginUpdate();try{var t=g.getSelectionCells(),e=g.view.getState(t[0]),n=null!=e?e.style:g.getCellStyle(t[0]),i="1"==mxUtils.getValue(n,mxConstants.STYLE_ROUNDED,"0")?"0":"1";g.setCellStyles(mxConstants.STYLE_ROUNDED,i),g.setCellStyles(mxConstants.STYLE_CURVED,null),r.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[i,"0"],"cells",g.getSelectionCells()))}finally{g.getModel().endUpdate()}}}),this.addAction("curved",function(){g.getModel().beginUpdate();try{g.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),g.setCellStyles(mxConstants.STYLE_CURVED,"1"),r.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",g.getSelectionCells()))}finally{g.getModel().endUpdate()}}),this.addAction("collapsible",function(){var t=g.view.getState(g.getSelectionCell()),e="1";null!=t&&null!=g.getFoldingImage(t)&&(e="0"),g.setCellStyles("collapsible",e),r.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[e],"cells",g.getSelectionCells()))}),this.addAction("editStyle...",mxUtils.bind(this,function(){var e=g.getSelectionCells();if(null!=e&&0<e.length){var t=g.getModel(),n=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",t.getStyle(e[0])||"",function(t){null!=t&&g.setCellStyle(mxUtils.trim(t),e)},null,null,400,220);this.editorUi.showDialog(n.container,420,300,!0,!0),n.init()}}),null,null,Editor.ctrlKey+"+E"),this.addAction("setAsDefaultStyle",function(){g.isEnabled()&&!g.isSelectionEmpty()&&r.setDefaultStyle(g.getSelectionCell())},null,null,Editor.ctrlKey+"+Shift+D"),this.addAction("clearDefaultStyle",function(){g.isEnabled()&&r.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R"),this.addAction("addWaypoint",function(){var t=g.getSelectionCell();if(null!=t&&g.getModel().isEdge(t)){var e=d.graph.selectionCellsHandler.getHandler(t);if(e instanceof mxEdgeHandler){for(var n=g.view.translate,i=g.view.scale,o=n.x,s=n.y,l=g.getModel().getParent(t),r=g.getCellGeometry(l);g.getModel().isVertex(l)&&null!=r;)o+=r.x,s+=r.y,l=g.getModel().getParent(l),r=g.getCellGeometry(l);var a=Math.round(g.snap(g.popupMenuHandler.triggerX/i-o)),h=Math.round(g.snap(g.popupMenuHandler.triggerY/i-s));e.addPointAt(e.state,a,h)}}}),this.addAction("removeWaypoint",function(){var t=r.actions.get("removeWaypoint");null!=t.handler&&t.handler.removePoint(t.handler.state,t.index)}),this.addAction("clearWaypoints",function(){var t=g.getSelectionCells();if(null!=t){t=g.addAllEdges(t),g.getModel().beginUpdate();try{for(var e=0;e<t.length;e++){var n=t[e];if(g.getModel().isEdge(n)){var i=g.getCellGeometry(n);null!=i&&((i=i.clone()).points=null,g.getModel().setGeometry(n,i))}}}finally{g.getModel().endUpdate()}}},null,null,"Alt+Shift+C"),n=this.addAction("subscript",mxUtils.bind(this,function(){g.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,"),n=this.addAction("superscript",mxUtils.bind(this,function(){g.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+."),this.addAction("image...",function(){if(g.isEnabled()&&!g.isCellLocked(g.getDefaultParent())){var t=mxResources.get("image")+" ("+mxResources.get("url")+"):",e=g.getView().getState(g.getSelectionCell()),n="";null!=e&&(n=e.style[mxConstants.STYLE_IMAGE]||n);var d=g.cellEditor.saveSelection();r.showImageDialog(t,n,function(t,e,n){if(g.cellEditor.isContentEditing())g.cellEditor.restoreSelection(d),g.insertImage(t,e,n);else{var i=g.getSelectionCells();if(null!=t&&(0<t.length||0<i.length)){var o=null;g.getModel().beginUpdate();try{if(0==i.length){var s=g.getFreeInsertPoint();o=i=[g.insertVertex(g.getDefaultParent(),null,"",s.x,s.y,e,n,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")],g.fireEvent(new mxEventObject("cellsInserted","cells",o))}g.setCellStyles(mxConstants.STYLE_IMAGE,0<t.length?t:null,i);var l=g.view.getState(i[0]),r=null!=l?l.style:g.getCellStyle(i[0]);if("image"!=r[mxConstants.STYLE_SHAPE]&&"label"!=r[mxConstants.STYLE_SHAPE]?g.setCellStyles(mxConstants.STYLE_SHAPE,"image",i):0==t.length&&g.setCellStyles(mxConstants.STYLE_SHAPE,null,i),1==g.getSelectionCount()&&null!=e&&null!=n){var a=i[0],h=g.getModel().getGeometry(a);null!=h&&((h=h.clone()).width=e,h.height=n,g.getModel().setGeometry(a,h))}}finally{g.getModel().endUpdate()}null!=o&&(g.setSelectionCells(o),g.scrollCellToVisible(o[0]))}}},g.cellEditor.isContentEditing(),!g.cellEditor.isContentEditing())}}).isEnabled=t,this.addAction("insertImage...",function(){g.isEnabled()&&!g.isCellLocked(g.getDefaultParent())&&(g.clearSelection(),r.actions.get("image").funct())}).isEnabled=t,(n=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(r,document.body.offsetWidth-280,120,220,180),this.layersWindow.window.addListener("show",function(){r.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide",function(){r.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),r.fireEvent(new mxEventObject("layers"))):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L")).setToggleAction(!0),n.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()})),(n=this.addAction("formatPanel",mxUtils.bind(this,function(){r.toggleFormatPanel()}),null,null,Editor.ctrlKey+"+Shift+P")).setToggleAction(!0),n.setSelectedCallback(mxUtils.bind(this,function(){return 0<r.formatWidth})),(n=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(r,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",function(){r.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.addListener("hide",function(){r.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),r.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+O")).setToggleAction(!0),n.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}))},Actions.prototype.addAction=function(t,e,n,i,o){var s;return s="..."==t.substring(t.length-3)?(t=t.substring(0,t.length-3),mxResources.get(t)+"..."):mxResources.get(t),this.put(t,new Action(s,e,n,i,o))},Actions.prototype.put=function(t,e){return this.actions[t]=e,this.actions.save&&(this.actions.save.enabled=!0),e},Actions.prototype.get=function(t){return this.actions[t]},mxUtils.extend(Action,mxEventSource),Action.prototype.createFunction=function(t){return t},Action.prototype.setEnabled=function(t){this.enabled!=t&&(this.enabled=t,this.fireEvent(new mxEventObject("stateChanged")))},Action.prototype.isEnabled=function(){return this.enabled},Action.prototype.setToggleAction=function(t){this.toggleAction=t},Action.prototype.setSelectedCallback=function(t){this.selectedCallback=t},Action.prototype.isSelected=function(){return this.selectedCallback()},Menus=function(t){this.editorUi=t,this.menus=new Object,this.init(),mxClient.IS_SVG||((new Image).src=this.checkmarkImage)},Menus.prototype.defaultFont="Helvetica",Menus.prototype.defaultFontSize="12",Menus.prototype.defaultMenuItems=["file","edit","view","arrange","extras","help"],Menus.prototype.defaultFonts=["Helvetica","Verdana","Times New Roman","Garamond","Comic Sans MS","Courier New","Georgia","Lucida Console","Tahoma"],Menus.prototype.init=function(){var s=this.editorUi.editor.graph,t=mxUtils.bind(s,s.isEnabled);this.customFonts=[],this.customFontSizes=[],this.put("fontFamily",new Menu(mxUtils.bind(this,function(e,n){for(var t=mxUtils.bind(this,function(t){this.styleChange(e,t,[mxConstants.STYLE_FONTFAMILY],[t],null,n,function(){document.execCommand("fontname",!1,t)},function(){s.updateLabelElements(s.getSelectionCells(),function(t){t.removeAttribute("face"),t.style.fontFamily=null,"PRE"==t.nodeName&&s.replaceElement(t,"div")})}).firstChild.nextSibling.style.fontFamily=t}),i=0;i<this.defaultFonts.length;i++)t(this.defaultFonts[i]);if(e.addSeparator(n),0<this.customFonts.length){for(i=0;i<this.customFonts.length;i++)t(this.customFonts[i]);e.addSeparator(n),e.addItem(mxResources.get("reset"),null,mxUtils.bind(this,function(){this.customFonts=[]}),n),e.addSeparator(n)}this.promptChange(e,mxResources.get("custom")+"...","",mxConstants.DEFAULT_FONTFAMILY,mxConstants.STYLE_FONTFAMILY,n,!0,mxUtils.bind(this,function(t){this.customFonts.push(t)}))}))),this.put("formatBlock",new Menu(mxUtils.bind(this,function(n,i){function t(t,e){return n.addItem(t,null,mxUtils.bind(this,function(){s.cellEditor.textarea.focus(),document.execCommand("formatBlock",!1,"<"+e+">")}),i)}t(mxResources.get("normal"),"p"),t("","h1").firstChild.nextSibling.innerHTML='<h1 style="margin:0px;">'+mxResources.get("heading")+" 1</h1>",t("","h2").firstChild.nextSibling.innerHTML='<h2 style="margin:0px;">'+mxResources.get("heading")+" 2</h2>",t("","h3").firstChild.nextSibling.innerHTML='<h3 style="margin:0px;">'+mxResources.get("heading")+" 3</h3>",t("","h4").firstChild.nextSibling.innerHTML='<h4 style="margin:0px;">'+mxResources.get("heading")+" 4</h4>",t("","h5").firstChild.nextSibling.innerHTML='<h5 style="margin:0px;">'+mxResources.get("heading")+" 5</h5>",t("","h6").firstChild.nextSibling.innerHTML='<h6 style="margin:0px;">'+mxResources.get("heading")+" 6</h6>",t("","pre").firstChild.nextSibling.innerHTML='<pre style="margin:0px;">'+mxResources.get("formatted")+"</pre>",t("","blockquote").firstChild.nextSibling.innerHTML='<blockquote style="margin-top:0px;margin-bottom:0px;">'+mxResources.get("blockquote")+"</blockquote>"}))),this.put("fontSize",new Menu(mxUtils.bind(this,function(t,e){for(var n=[6,8,9,10,11,12,14,18,24,36,48,72],i=mxUtils.bind(this,function(n){this.styleChange(t,n,[mxConstants.STYLE_FONTSIZE],[n],null,e,function(){document.execCommand("fontSize",!1,"3");for(var t=s.cellEditor.textarea.getElementsByTagName("font"),e=0;e<t.length;e++)if("3"==t[e].getAttribute("size")){t[e].removeAttribute("size"),t[e].style.fontSize=n+"px";break}})}),o=0;o<n.length;o++)i(n[o]);if(t.addSeparator(e),0<this.customFontSizes.length){for(o=0;o<this.customFontSizes.length;o++)i(this.customFontSizes[o]);t.addSeparator(e),t.addItem(mxResources.get("reset"),null,mxUtils.bind(this,function(){this.customFontSizes=[]}),e),t.addSeparator(e)}this.promptChange(t,mxResources.get("custom")+"...","(pt)","12",mxConstants.STYLE_FONTSIZE,e,!0,mxUtils.bind(this,function(t){this.customFontSizes.push(t)}))}))),this.put("direction",new Menu(mxUtils.bind(this,function(t,e){t.addItem(mxResources.get("flipH"),null,function(){s.toggleCellStyles(mxConstants.STYLE_FLIPH,!1)},e),t.addItem(mxResources.get("flipV"),null,function(){s.toggleCellStyles(mxConstants.STYLE_FLIPV,!1)},e),this.addMenuItems(t,["-","rotation"],e)}))),this.put("align",new Menu(mxUtils.bind(this,function(t,e){t.addItem(mxResources.get("leftAlign"),null,function(){s.alignCells(mxConstants.ALIGN_LEFT)},e),t.addItem(mxResources.get("center"),null,function(){s.alignCells(mxConstants.ALIGN_CENTER)},e),t.addItem(mxResources.get("rightAlign"),null,function(){s.alignCells(mxConstants.ALIGN_RIGHT)},e),t.addSeparator(e),t.addItem(mxResources.get("topAlign"),null,function(){s.alignCells(mxConstants.ALIGN_TOP)},e),t.addItem(mxResources.get("middle"),null,function(){s.alignCells(mxConstants.ALIGN_MIDDLE)},e),t.addItem(mxResources.get("bottomAlign"),null,function(){s.alignCells(mxConstants.ALIGN_BOTTOM)},e)}))),this.put("distribute",new Menu(mxUtils.bind(this,function(t,e){t.addItem(mxResources.get("horizontal"),null,function(){s.distributeCells(!0)},e),t.addItem(mxResources.get("vertical"),null,function(){s.distributeCells(!1)},e)}))),this.put("layout",new Menu(mxUtils.bind(this,function(t,e){var i=mxUtils.bind(this,function(t,e){var n=new FilenameDialog(this.editorUi,t,mxResources.get("apply"),function(t){e(parseFloat(t))},mxResources.get("spacing"));this.editorUi.showDialog(n.container,300,80,!0,!0),n.init()});t.addItem(mxResources.get("horizontalFlow"),null,mxUtils.bind(this,function(){var e=new mxHierarchicalLayout(s,mxConstants.DIRECTION_WEST);this.editorUi.executeLayout(function(){var t=s.getSelectionCells();e.execute(s.getDefaultParent(),0==t.length?null:t)},!0)}),e),t.addItem(mxResources.get("verticalFlow"),null,mxUtils.bind(this,function(){var e=new mxHierarchicalLayout(s,mxConstants.DIRECTION_NORTH);this.editorUi.executeLayout(function(){var t=s.getSelectionCells();e.execute(s.getDefaultParent(),0==t.length?null:t)},!0)}),e),t.addSeparator(e),t.addItem(mxResources.get("horizontalTree"),null,mxUtils.bind(this,function(){var e=s.getSelectionCell(),t=null;if(null==e||0==s.getModel().getChildCount(e)?0==s.getModel().getEdgeCount(e)&&(t=s.findTreeRoots(s.getDefaultParent())):t=s.findTreeRoots(e),null!=t&&0<t.length&&(e=t[0]),null!=e){var n=new mxCompactTreeLayout(s,!0);n.edgeRouting=!1,n.levelDistance=30,i(n.levelDistance,mxUtils.bind(this,function(t){n.levelDistance=t,this.editorUi.executeLayout(function(){n.execute(s.getDefaultParent(),e)},!0)}))}}),e),t.addItem(mxResources.get("verticalTree"),null,mxUtils.bind(this,function(){var e=s.getSelectionCell(),t=null;if(null==e||0==s.getModel().getChildCount(e)?0==s.getModel().getEdgeCount(e)&&(t=s.findTreeRoots(s.getDefaultParent())):t=s.findTreeRoots(e),null!=t&&0<t.length&&(e=t[0]),null!=e){var n=new mxCompactTreeLayout(s,!1);n.edgeRouting=!1,n.levelDistance=30,i(n.levelDistance,mxUtils.bind(this,function(t){n.levelDistance=t,this.editorUi.executeLayout(function(){n.execute(s.getDefaultParent(),e)},!0)}))}}),e),t.addItem(mxResources.get("radialTree"),null,mxUtils.bind(this,function(){var e=s.getSelectionCell(),t=null;if(null==e||0==s.getModel().getChildCount(e)?0==s.getModel().getEdgeCount(e)&&(t=s.findTreeRoots(s.getDefaultParent())):t=s.findTreeRoots(e),null!=t&&0<t.length&&(e=t[0]),null!=e){var n=new mxRadialTreeLayout(s,!1);n.levelDistance=80,n.autoRadius=!0,i(n.levelDistance,mxUtils.bind(this,function(t){n.levelDistance=t,this.editorUi.executeLayout(function(){n.execute(s.getDefaultParent(),e),s.isSelectionEmpty()||(e=s.getModel().getParent(e),s.getModel().isVertex(e)&&s.updateGroupBounds([e],2*s.gridSize,!0))},!0)}))}}),e),t.addSeparator(e),t.addItem(mxResources.get("organic"),null,mxUtils.bind(this,function(){var e=new mxFastOrganicLayout(s);i(e.forceConstant,mxUtils.bind(this,function(t){e.forceConstant=t,this.editorUi.executeLayout(function(){var t=s.getSelectionCell();null!=t&&0!=s.getModel().getChildCount(t)||(t=s.getDefaultParent()),e.execute(t),s.getModel().isVertex(t)&&s.updateGroupBounds([t],2*s.gridSize,!0)},!0)}))}),e),t.addItem(mxResources.get("circle"),null,mxUtils.bind(this,function(){var e=new mxCircleLayout(s);this.editorUi.executeLayout(function(){var t=s.getSelectionCell();null!=t&&0!=s.getModel().getChildCount(t)||(t=s.getDefaultParent()),e.execute(t),s.getModel().isVertex(t)&&s.updateGroupBounds([t],2*s.gridSize,!0)},!0)}),e)}))),this.put("navigation",new Menu(mxUtils.bind(this,function(t,e){this.addMenuItems(t,["home","-","exitGroup","enterGroup","-","expand","collapse","-","collapsible"],e)}))),this.put("arrange",new Menu(mxUtils.bind(this,function(t,e){this.addMenuItems(t,["toFront","toBack","-"],e),this.addSubmenu("direction",t,e),this.addMenuItems(t,["turn","-"],e),this.addSubmenu("align",t,e),this.addSubmenu("distribute",t,e),t.addSeparator(e),this.addSubmenu("navigation",t,e),this.addSubmenu("insert",t,e),this.addSubmenu("layout",t,e),this.addMenuItems(t,["-","group","ungroup","removeFromGroup","-","clearWaypoints","autosize"],e)}))).isEnabled=t,this.put("insert",new Menu(mxUtils.bind(this,function(t,e){this.addMenuItems(t,["insertLink","insertImage"],e)}))),this.put("view",new Menu(mxUtils.bind(this,function(t,e){this.addMenuItems(t,(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers","-","pageView","pageScale","-","scrollbars","tooltips","-","grid","guides","-","connectionArrows","connectionPoints","-","resetView","zoomIn","zoomOut"],e))}))),this.put("viewPanels",new Menu(mxUtils.bind(this,function(t,e){null!=this.editorUi.format&&this.addMenuItems(t,["formatPanel"],e),this.addMenuItems(t,["outline","layers"],e)}))),this.put("viewZoom",new Menu(mxUtils.bind(this,function(e,n){this.addMenuItems(e,["resetView","-"],n);for(var t=[.25,.5,.75,1,1.25,1.5,2,3,4],i=0;i<t.length;i++)!function(t){e.addItem(100*t+"%",null,function(){s.zoomTo(t)},n)}(t[i]);this.addMenuItems(e,["-","fitWindow","fitPageWidth","fitPage","fitTwoPages","-","customZoom"],n)}))),this.put("file",new Menu(mxUtils.bind(this,function(t,e){this.addMenuItems(t,["new","open","-","save","saveAs","-","import","export","-","pageSetup","print"],e)}))),this.put("edit",new Menu(mxUtils.bind(this,function(t,e){this.addMenuItems(t,["undo","redo","-","cut","copy","paste","delete","-","duplicate","-","editData","editTooltip","editStyle","-","edit","-","editLink","openLink","-","selectVertices","selectEdges","selectAll","selectNone","-","lockUnlock"])}))),this.put("extras",new Menu(mxUtils.bind(this,function(t,e){this.addMenuItems(t,["copyConnect","collapseExpand","-","editDiagram"])}))),this.put("help",new Menu(mxUtils.bind(this,function(t,e){this.addMenuItems(t,["help","-","about"])})))},Menus.prototype.put=function(t,e){return this.menus[t]=e},Menus.prototype.get=function(t){return this.menus[t]},Menus.prototype.addSubmenu=function(t,e,n,i){var o=this.get(t);if(null!=o){var s=o.isEnabled();if(e.showDisabled||s){var l=e.addItem(i||mxResources.get(t),null,null,n,null,s);this.addMenu(t,e,l)}}},Menus.prototype.addMenu=function(t,e,n){var i=this.get(t);null!=i&&(e.showDisabled||i.isEnabled())&&this.get(t).execute(e,n)},Menus.prototype.addInsertTableItem=function(t){var r=this.editorUi.editor.graph;var e=t.addItem("",null,mxUtils.bind(this,function(t){var e=r.getParentByName(mxEvent.getSource(t),"TD");if(null!=e){for(var n=r.getParentByName(e,"TR"),i=r.cellEditor.textarea.getElementsByTagName("table"),o=[],s=0;s<i.length;s++)o.push(i[s]);r.container.focus(),r.pasteHtmlAtCaret(function(t,e){for(var n=["<table>"],i=0;i<t;i++){n.push("<tr>");for(var o=0;o<e;o++)n.push("<td><br></td>");n.push("</tr>")}return n.push("</table>"),n.join("")}(n.sectionRowIndex+1,e.cellIndex+1));var l=r.cellEditor.textarea.getElementsByTagName("table");if(l.length==o.length+1)for(s=l.length-1;0<=s;s--)if(0==s||l[s]!=o[s-1]){r.selectNode(l[s].rows[0].cells[0]);break}}})),a='<img src="'+mxClient.imageBasePath+'/transparent.gif" width="16" height="16"/>';e.firstChild.innerHTML="";var h=function(t,e){var n=document.createElement("table");n.setAttribute("border","1"),n.style.borderCollapse="collapse",mxClient.IS_QUIRKS||n.setAttribute("cellPadding","8");for(var i=0;i<t;i++)for(var o=n.insertRow(i),s=0;s<e;s++){var l=o.insertCell(-1);mxClient.IS_QUIRKS&&(l.innerHTML=a)}return n}(5,5);e.firstChild.appendChild(h);var d=document.createElement("div");d.style.padding="4px",d.style.fontSize=Menus.prototype.defaultFontSize+"px",d.innerHTML="1x1",e.firstChild.appendChild(d),mxEvent.addListener(h,"mouseover",function(t){var e=r.getParentByName(mxEvent.getSource(t),"TD");if(null!=e){var n=r.getParentByName(e,"TR");!function(t,e,n){for(var i=t.rows.length;i<e;i++)for(var o=t.insertRow(i),s=0;s<t.rows[0].cells.length;s++){var l=o.insertCell(-1);mxClient.IS_QUIRKS&&(l.innerHTML=a)}for(i=0;i<t.rows.length;i++)for(s=(o=t.rows[i]).cells.length;s<n;s++){l=o.insertCell(-1);mxClient.IS_QUIRKS&&(l.innerHTML=a)}}(h,Math.min(20,n.sectionRowIndex+2),Math.min(20,e.cellIndex+2)),d.innerHTML=e.cellIndex+1+"x"+(n.sectionRowIndex+1);for(var i=0;i<h.rows.length;i++)for(var o=h.rows[i],s=0;s<o.cells.length;s++){var l=o.cells[s];i<=n.sectionRowIndex&&s<=e.cellIndex?l.style.backgroundColor="blue":l.style.backgroundColor="white"}mxEvent.consume(t)}})},Menus.prototype.edgeStyleChange=function(t,e,r,a,n,i,h){return t.addItem(e,null,mxUtils.bind(this,function(){var t=this.editorUi.editor.graph;t.stopEditing(!1),t.getModel().beginUpdate();try{for(var e=t.getSelectionCells(),n=[],i=0;i<e.length;i++){var o=e[i];if(t.getModel().isEdge(o)){if(h){var s=t.getCellGeometry(o);null!=s&&((s=s.clone()).points=null,t.getModel().setGeometry(o,s))}for(var l=0;l<r.length;l++)t.setCellStyles(r[l],a[l],[o]);n.push(o)}}this.editorUi.fireEvent(new mxEventObject("styleChanged","keys",r,"values",a,"cells",n))}finally{t.getModel().endUpdate()}}),i,n)},Menus.prototype.styleChange=function(t,e,n,i,o,s,l,r){var a=this.createStyleChangeFunction(n,i);return t.addItem(e,null,mxUtils.bind(this,function(){var t=this.editorUi.editor.graph;null!=l&&t.cellEditor.isContentEditing()?l():a(r)}),s,o)},Menus.prototype.createStyleChangeFunction=function(i,o){return mxUtils.bind(this,function(t){var e=this.editorUi.editor.graph;e.stopEditing(!1),e.getModel().beginUpdate();try{for(var n=0;n<i.length;n++)e.setCellStyles(i[n],o[n]);null!=t&&t(),this.editorUi.fireEvent(new mxEventObject("styleChanged","keys",i,"values",o,"cells",e.getSelectionCells()))}finally{e.getModel().endUpdate()}})},Menus.prototype.promptChange=function(t,e,o,s,l,n,i,r,a){return t.addItem(e,null,mxUtils.bind(this,function(){var e=this.editorUi.editor.graph,t=s,n=e.getView().getState(e.getSelectionCell());null!=n&&(t=n.style[l]||t);var i=new FilenameDialog(this.editorUi,t,mxResources.get("apply"),mxUtils.bind(this,function(t){if(null!=t&&0<t.length){e.getModel().beginUpdate();try{e.stopEditing(!1),e.setCellStyles(l,t)}finally{e.getModel().endUpdate()}null!=r&&r(t)}}),mxResources.get("enterValue")+(0<o.length?" "+o:""));this.editorUi.showDialog(i.container,300,80,!0,!0),i.init()}),n,a,i)},Menus.prototype.pickColor=function(t,e,n){var i=this.editorUi.editor.graph;if(null!=e&&i.cellEditor.isContentEditing()){var o=i.cellEditor.saveSelection(),s=new ColorDialog(this.editorUi,n||"000000",mxUtils.bind(this,function(t){i.cellEditor.restoreSelection(o),document.execCommand(e,!1,t!=mxConstants.NONE?t:"transparent")}),function(){i.cellEditor.restoreSelection(o)});this.editorUi.showDialog(s.container,230,430,!0,!0),s.init()}else{null==this.colorDialog&&(this.colorDialog=new ColorDialog(this.editorUi)),this.colorDialog.currentColorKey=t;var l=i.getView().getState(i.getSelectionCell()),r="none";null!=l&&(r=l.style[t]||r),"none"==r?(r="ffffff",this.colorDialog.picker.fromString("ffffff"),this.colorDialog.colorInput.value="none"):this.colorDialog.picker.fromString(r),this.editorUi.showDialog(this.colorDialog.container,230,430,!0,!0),this.colorDialog.init()}},Menus.prototype.toggleStyle=function(t,e){var n=this.editorUi.editor.graph,i=n.toggleCellStyles(t,e);this.editorUi.fireEvent(new mxEventObject("styleChanged","keys",[t],"values",[i],"cells",n.getSelectionCells()))},Menus.prototype.addMenuItem=function(t,e,n,i,o,s){var l=this.editorUi.actions.get(e);if(null!=l&&(t.showDisabled||l.isEnabled())&&l.visible){var r=t.addItem(s||l.label,null,function(){l.funct(i)},n,o,l.isEnabled());return l.toggleAction&&l.isSelected()&&t.addCheckmark(r,Editor.checkmarkImage),this.addShortcut(r,l),r}return null},Menus.prototype.addShortcut=function(t,e){if(null!=e.shortcut){var n=t.firstChild.nextSibling.nextSibling,i=document.createElement("span");i.style.color="gray",mxUtils.write(i,e.shortcut),n.appendChild(i)}},Menus.prototype.addMenuItems=function(t,e,n,i,o){for(var s=0;s<e.length;s++)"-"==e[s]?t.addSeparator(n):this.addMenuItem(t,e[s],n,i,null!=o?o[s]:null)},Menus.prototype.createPopupMenu=function(t,e,n){var i=this.editorUi.editor.graph;if(t.smartSeparators=!0,i.isSelectionEmpty()?this.addMenuItems(t,["undo","redo","pasteHere"],null,n):this.addMenuItems(t,["delete","-","cut","copy","-","duplicate"],null,n),i.isSelectionEmpty())this.addMenuItems(t,["-","selectVertices","selectEdges","selectAll","-","clearDefaultStyle"],null,n);else{1==i.getSelectionCount()&&this.addMenuItems(t,["setAsDefaultStyle"],null,n),t.addSeparator(),e=i.getSelectionCell();var o=i.view.getState(e);if(null!=o){var s=!1;if(this.addMenuItems(t,["toFront","toBack","-"],null,n),i.getModel().isEdge(e)&&"entityRelationEdgeStyle"!=mxUtils.getValue(o.style,mxConstants.STYLE_EDGE,null)&&"arrow"!=mxUtils.getValue(o.style,mxConstants.STYLE_SHAPE,null)){var l=i.selectionCellsHandler.getHandler(e),r=!1;if(l instanceof mxEdgeHandler&&null!=l.bends&&2<l.bends.length){var a=l.getHandleForEvent(i.updateMouseEvent(new mxMouseEvent(n))),h=this.editorUi.actions.get("removeWaypoint");h.handler=l,r=0<(h.index=a)&&a<l.bends.length-1}t.addSeparator(),this.addMenuItem(t,"turn",null,n,null,mxResources.get("reverse")),this.addMenuItems(t,[r?"removeWaypoint":"addWaypoint"],null,n);var d=i.getModel().getGeometry(e);s=null!=d&&null!=d.points&&0<d.points.length}1==i.getSelectionCount()&&(s||i.getModel().isVertex(e)&&0<i.getModel().getEdgeCount(e))&&this.addMenuItems(t,["clearWaypoints"],null,n),1<i.getSelectionCount()?(t.addSeparator(),this.addMenuItems(t,["group"],null,n)):1==i.getSelectionCount()&&!i.getModel().isEdge(e)&&!i.isSwimlane(e)&&0<i.getModel().getChildCount(e)&&(t.addSeparator(),this.addMenuItems(t,["ungroup"],null,n)),1==i.getSelectionCount()&&(t.addSeparator(),this.addMenuItems(t,["editData","editLink"],null,n),i.getModel().isVertex(e)&&null!=mxUtils.getValue(o.style,mxConstants.STYLE_IMAGE,null)&&(t.addSeparator(),this.addMenuItem(t,"image",null,n).firstChild.nextSibling.innerHTML=mxResources.get("editImage")+"..."))}}},Menus.prototype.createMenubar=function(t){for(var n=new Menubar(this.editorUi,t),i=this.defaultMenuItems,o=0;o<i.length;o++)mxUtils.bind(this,function(t){var e=n.addMenu(mxResources.get(i[o]),mxUtils.bind(this,function(){t.funct.apply(this,arguments)}));this.menuCreated(t,e)})(this.get(i[o]));return n},Menus.prototype.menuCreated=function(t,e,n){null!=e&&(n=null!=n?n:"geItem",t.addListener("stateChanged",function(){e.enabled=t.enabled,t.enabled?(e.className=n,8==document.documentMode&&(e.style.color="")):(e.className=n+" mxDisabled",8==document.documentMode&&(e.style.color="#c3c3c3"))}))},Menubar.prototype.hideMenu=function(){this.editorUi.hideCurrentMenu()},Menubar.prototype.addMenu=function(t,e,n){var i=document.createElement("a");return i.setAttribute("href","javascript:void(0);"),i.className="geItem",mxUtils.write(i,t),this.addMenuHandler(i,e),null!=n?this.container.insertBefore(i,n):this.container.appendChild(i),i},Menubar.prototype.addMenuHandler=function(i,o){if(null!=o){var s=!0,e=mxUtils.bind(this,function(t){if(s&&null==i.enabled||i.enabled){this.editorUi.editor.graph.popupMenuHandler.hideMenu();var e=new mxPopupMenu(o);e.div.className+=" geMenubarMenu",e.smartSeparators=!0,e.showDisabled=!0,e.autoExpand=!0,e.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(e,arguments),this.editorUi.resetCurrentMenu(),e.destroy()});var n=mxUtils.getOffset(i);e.popup(n.x,n.y+i.offsetHeight,null,t),this.editorUi.setCurrentMenu(e,i)}mxEvent.consume(t)});mxEvent.addListener(i,"mousemove",mxUtils.bind(this,function(t){null!=this.editorUi.currentMenu&&this.editorUi.currentMenuElt!=i&&(this.editorUi.hideCurrentMenu(),e(t))})),mxEvent.addListener(i,"mousedown",mxUtils.bind(this,function(){s=this.currentElt!=i})),mxEvent.addListener(i,"click",mxUtils.bind(this,function(t){e(t),s=!0}))}},Menubar.prototype.destroy=function(){},mxUtils.extend(Menu,mxEventSource),Menu.prototype.isEnabled=function(){return this.enabled},Menu.prototype.setEnabled=function(t){this.enabled!=t&&(this.enabled=t,this.fireEvent(new mxEventObject("stateChanged")))},Menu.prototype.execute=function(t,e){this.funct(t,e)},EditorUi.prototype.createMenus=function(){return new Menus(this)},WfPanel.prototype.init=function(){WfPanel.prototype.triangleUp=HoverIcons.prototype.triangleUp,WfPanel.prototype.triangleRight=HoverIcons.prototype.triangleRight,WfPanel.prototype.triangleDown=HoverIcons.prototype.triangleDown,WfPanel.prototype.triangleLeft=HoverIcons.prototype.triangleLeft,WfPanel.prototype.refreshTarget=HoverIcons.prototype.refreshTarget,WfPanel.prototype.roundDrop=HoverIcons.prototype.roundDrop,WfPanel.prototype.rowGroups=[],WfPanel.prototype.colGroups=[],this.editorUi.isFromWfForm||this.drawActions(),this.editorUi.isFromWfForm||this.addGeneralPalette(!0)},WfPanel.prototype.collapsedImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAJmZmf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozNUQyRTJFNjZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozNUQyRTJFNzZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFERjc3MEUxNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFERjc3MEUyNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhSMj6lrwAjcC1GyahV+dcZJgeIIFgA7":IMAGE_PATH+"/collapsed.gif",WfPanel.prototype.expandedImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQANAIABAJmZmf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxREY3NzBERjZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxREY3NzBFMDZGNUYxMUU1QjZEOThCNDYxMDQ2MzNCQiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjFERjc3MERENkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjFERjc3MERFNkY1RjExRTVCNkQ5OEI0NjEwNDYzM0JCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAA0ADQAAAhGMj6nL3QAjVHIu6azbvPtWAAA7":IMAGE_PATH+"/expanded.gif",WfPanel.prototype.tooltipImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAbCAMAAAB7jU7LAAAACVBMVEX///+ZmZn///9Y2COLAAAAA3RSTlP//wDXyg1BAAAAOElEQVR42mXQMQ4AMAgDsWv//+iutcJmIQSk+9dJpVKpVCqVSqVSqZTdncWzF8/NeP7FkxWenPEDOnUBiL3jWx0AAAAASUVORK5CYII=":IMAGE_PATH+"/tooltip.png",WfPanel.prototype.searchImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAEaSURBVHjabNGxS5VxFIfxz71XaWuQUJCG/gCHhgTD9VpEETg4aMOlQRp0EoezObgcd220KQiXmpretTAHQRBdojlQEJyukPdt+b1ywfvAGc7wnHP4nlZd1yKijQW8xzNc4Su+ZOYfQ3T6/f4YNvEJYzjELXp4VVXVz263+7cR2niBxAFeZ2YPi3iHR/gYERPDwhpOsd6sz8x/mfkNG3iOlWFhFj8y89J9KvzGXER0GuEaD42mgwHqUtoljbcRsTBCeINpfM/MgZLKPpaxFxGbOCqDXmILN7hoJrTKH+axhxmcYRxP0MIDnOBDZv5q1XUNIuJxifJp+UNV7t7BFM6xeic0RMQ4Bpl5W/ol7GISx/eEUUTECrbx+f8A8xhiZht9zsgAAAAASUVORK5CYII=":IMAGE_PATH+"/search.png",WfPanel.prototype.dragPreviewBorder="1px dashed black",WfPanel.prototype.enableTooltips=!0,WfPanel.prototype.tooltipBorder=16,WfPanel.prototype.tooltipDelay=300,WfPanel.prototype.dropTargetDelay=200,WfPanel.prototype.gearImage=STENCIL_PATH+"/clipart/Gear_128x128.png",WfPanel.prototype.thumbWidth=36,WfPanel.prototype.thumbHeight=36,WfPanel.prototype.thumbPadding=5<=document.documentMode?0:1,WfPanel.prototype.thumbBorder=2,WfPanel.prototype.sidebarTitleSize=9,WfPanel.prototype.sidebarTitles=!1,WfPanel.prototype.tooltipTitles=!0,WfPanel.prototype.maxTooltipWidth=400,WfPanel.prototype.maxTooltipHeight=400,WfPanel.prototype.addStencilsToIndex=!0,WfPanel.prototype.defaultImageWidth=80,WfPanel.prototype.defaultImageHeight=80,WfPanel.prototype.refresh=function(t,e){setTimeout(function(){var t=workflowUi.editor.undoManager,e=t.history,n=t.indexOfNextAdd,i=document.getElementsByClassName("icon-workflow-chexiao")[0],o=document.getElementsByClassName("icon-workflow-fanhui")[0];i&&o&&(0<e.length?(0==n?(i.style.color="#ddd",i.style.cursor="not-allowed"):(i.style.color="#000",i.style.cursor="pointer"),n==e.length?(o.style.color="#ddd",o.style.cursor="not-allowed"):(o.style.color="#000",o.style.cursor="pointer")):(i.style.color="#ddd",i.style.cursor="not-allowed",o.style.color="#ddd",o.style.cursor="not-allowed"))},0)},WfPanel.prototype.drawActions=function(){for(var t,e=this.editorUi.actions,n=this.editorUi.editor.graph,i=[{icon:"icon-workflow-baocun",action:e.get("save"),title:wfGetLabel(386820,"保存")},{icon:"icon-workflow-daochu",action:"iconActions.get('export')",title:wfGetLabel(384125,"导出")+"xml"},{icon:"icon-workflow-chexiao",action:e.get("undo"),title:wfGetLabel(126037,"撤销")},{icon:"icon-workflow-fanhui",action:e.get("redo"),title:wfGetLabel(385193,"恢复")},{icon:"icon-workflow-shanchu",action:e.get("delete"),title:wfGetLabel(387789,"删除")},{icon:"icon-workflow-tianjiafenzu",action:"",title:wfGetLabel(384113,"添加")+wfGetLabel(81313,"分组")},{icon:"icon-workflow-wenbenshuoming",action:"",title:wfGetLabel(389963,"文本说明")},{icon:"icon-workflow-hengxiangfenzu",action:"1",title:wfGetLabel(383908,"横向")+wfGetLabel(81313,"分组")},{icon:"icon-workflow-zongxiangfenzu",action:"1",title:wfGetLabel(383907,"纵向")+wfGetLabel(81313,"分组")},{icon:"icon-workflow-kaozuoduiqi",action:"1",title:wfGetLabel(16202,"左对齐")},{icon:"icon-workflow-shangxiadengjian",action:"1",title:wfGetLabel(500634,"上下等间距对齐")},{icon:"icon-workflow-kaoyouduiqi",action:"1",title:wfGetLabel(16204,"右对齐")},{icon:"icon-workflow-kaoshangduiqi",action:"1",title:wfGetLabel(389964,"上对齐")},{icon:"icon-workflow-zuoyoudengjian",action:"1",title:wfGetLabel(500635,"左右等间距对齐")},{icon:"icon-workflow-kaoxiaduiqi",action:"1",title:wfGetLabel(389966,"下对齐")},{icon:"icon-workflow-biaochi",action:"1",title:wfGetLabel(389968,"标尺")},{icon:"icon-workflow-wangge workflowIcon-is-clicked",action:"1",title:wfGetLabel(389969,"网格")},{icon:"icon-workflow-xianshifenzu workflowIcon-is-clicked",action:{funct:this.setTipInfoShow.bind(this)},title:wfGetLabel(389944,"隐藏分组")},{icon:"icon-workflow-huifuyuanbil",action:e.get("resetView"),title:wfGetLabel(389970,"恢复原比例")},{icon:"icon-workflow-suoxiao",action:e.get("zoomOut"),title:wfGetLabel(22209,"缩小")},{icon:"icon-workflow-fangda",action:e.get("zoomIn"),title:wfGetLabel(22208,"放大")},{icon:"icon-workflow-ceshi",action:"1",title:wfGetLabel(389954,"开始测试")},{icon:"icon-workflow-tingzhi",action:"1",title:wfGetLabel(83899,"停止")}],o=0;o<i.length;++o){if(0==o||5==o||9==o||15==o||21==o){(t=document.createElement("div")).className=(21==o?"testAction":"")+" action-area";var s=document.createElement("div");s.className="action-area-tip",s.innerHTML=0==o?wfGetLabel(93,"编辑"):5==o?wfGetLabel(389971,"标注"):9==o?wfGetLabel(385291,"对齐方式"):15==o?wfGetLabel(32559,"视图")+"(100%)":21==o?wfGetLabel(387075,"测试"):"",s.style.display=this.tipInfoDisplay,t.appendChild(s)}var l=this.createIconElement(i[o],this,this.editorUi.editor);if(t.appendChild(l),19==o){var r=this.createIconRangeInput(n);t.appendChild(r)}if((4==o||8==o||14==o||20==o||22==o||o==i.length-1)&&(this.container.appendChild(t),o!=i.length-1)){var a=document.createElement("span");a.className="wfEditor-split",this.container.appendChild(a)}}},WfPanel.prototype.createIconRangeInput=function(t){return this.wfCreateRangeInput()},WfPanel.prototype.wfCreateRangeInput=function(){var t,e,n=this.editorUi.editor.graph.view.scale;if(document.getElementById("wf-custom-range-slider"))return t=document.getElementById("wf-custom-range-slider");t=document.createElement("div"),e=document.createElement("div"),t.id="wf-custom-range-slider",e.id="wf-custom-range-thumb";return e.style.left=44*n+"px",this.customRangeAddElementEvent(e,t),t.appendChild(e),t},WfPanel.prototype.customRangeAddElementEvent=function(r,a){var h=this.editorUi.editor.graph;r.onmousedown=function(t){t.stopPropagation(),mouseDownX=t.pageX,mouseDownY=t.pageY,initX=r.offsetLeft,initY=r.offsetTop,document.onmousemove=function(t){var e=(a.offsetWidth-r.offsetWidth)/100,n=document.getElementsByClassName("action-area-tip")[4],i=t.pageX,o=parseInt(i)-parseInt(mouseDownX)+parseInt(initX);o<=0&&(o=0),o>a.offsetWidth-r.offsetWidth&&(o=a.offsetWidth-r.offsetWidth),r.style.left=o+"px";var s=Math.floor(o/e);a.style.backgroundSize=s+"% 100%";var l=s/44;l<.15&&(l=.15),2<l&&(l=2),h.zoomTo(l),n.innerHTML=wfGetLabel(32559,"视图")+"("+Math.round(100*l)+"%)"}},document.onmouseup=function(t){t.stopPropagation(),document.onmousemove=null}},WfPanel.prototype.customRangeSetValue=function(t){var e=document.getElementById("wf-custom-range-slider"),n=document.getElementById("wf-custom-range-thumb"),i=document.getElementById("show-val"),o=e.offsetWidth-n.offsetWidth,s=o/100;(t*=s)<0&&(t=0),o<t&&(t=o),n.style.left=t+"px",i.innerHTML=t/s},WfPanel.prototype.createIconElement=function(e,n,t){var i;return i="icon-workflow-tianjiafenzu"===e.icon?n.drawAreaGroup():"icon-workflow-wenbenshuoming"===e.icon?n.drawHelpfulText():document.createElement("span"),"icon-workflow-ceshi"==e.icon&&(i.id="workflow-ceshiOrPause",i.title=wfGetLabel(389954,"开始测试")),i.className=e.icon+" icon-workflow",i.title=e.title||"title",i.onclick=function(t){e.action&&n.setIconsActions(e.action,t,e.icon)},i},WfPanel.prototype.setIconsActions=function(t,e,n){var i=this.editorUi.editor.graph;if(-1<n.indexOf("icon-workflow-wangge")){var o=i.isGridEnabled(),s=i.view.gridColor;i.setGridEnabled(!o),o?e.target.className="icon-workflow-wangge icon-workflow":(this.editorUi.setGridColor(s),e.target.className="icon-workflow-wangge icon-workflow workflowIcon-is-clicked"),this.editorUi.fireEvent(new mxEventObject("gridEnabledChanged"))}else if("icon-workflow-biaochi"==n){o=i.isRuleEnabled();i.setRuleEnabled(!o),e.target.className=o?"icon-workflow-biaochi icon-workflow":"icon-workflow-biaochi icon-workflow workflowIcon-is-clicked",this.clickRuleResizeGraph(!o),this.editorUi.fireEvent(new mxEventObject("ruleEnabledChanged")),this.editorUi.wfGroups.refresh()}else if("icon-workflow-kaozuoduiqi"==n||"icon-workflow-shangxiadengjian"==n||"icon-workflow-kaoyouduiqi"==n||"icon-workflow-kaoshangduiqi"==n||"icon-workflow-zuoyoudengjian"==n||"icon-workflow-kaoxiaduiqi"==n)"icon-workflow-kaozuoduiqi"==n&&i.alignCells(mxConstants.ALIGN_LEFT),"icon-workflow-shangxiadengjian"==n&&i.alignCells(mxConstants.ALIGN_SAME_TOP_AND_BOTTOM),"icon-workflow-kaoyouduiqi"==n&&i.alignCells(mxConstants.ALIGN_RIGHT),"icon-workflow-kaoshangduiqi"==n&&i.alignCells(mxConstants.ALIGN_TOP),"icon-workflow-zuoyoudengjian"==n&&i.alignCells(mxConstants.ALIGN_SAME_LEFT_AND_RIGHT),"icon-workflow-kaoxiaduiqi"==n&&i.alignCells(mxConstants.ALIGN_BOTTOM);else if("icon-workflow-hengxiangfenzu"==n)this.drawRowGroup();else if("icon-workflow-zongxiangfenzu"==n)this.drawColGroup();else if("icon-workflow-ceshi"==n)this.doWorkflowTest(e);else if("icon-workflow-tingzhi"==n)this.stopWorkflowTest();else if("icon-workflow-daochu"==n)this.getWorkflowXml();else{if(("icon-workflow-chexiao"==n||"icon-workflow-fanhui"==n)&&"not-allowed"==e.target.style.cursor)return;if(t.funct(e),"icon-workflow-suoxiao"==n||"icon-workflow-fangda"==n||"icon-workflow-huifuyuanbil"==n){document.getElementsByClassName("action-area-tip")[4].innerHTML=wfGetLabel(32559,"视图")+"("+Math.round(i.view.scale<=.15?15:100*i.view.scale)+"%)";var l=document.getElementById("wf-custom-range-slider"),r=document.getElementById("wf-custom-range-thumb");l.style.backgroundSize=i.view.scale<=.15?0:50*i.view.scale+"% 100%";var a=44*(i.view.scale<=.15?0:i.view.scale);a<=0&&(a=0),88<a&&(a=88),r.style.left=a+"px"}}},WfPanel.prototype.clickRuleResizeGraph=function(t){this.editorUi.wfEditor;var e=this.editorUi.diagramContainer,n=this.editorUi.editor.graph;n.model;try{t?(e.style.left="20px",e.style.top="20px",n.pageFormat.height=n.pageFormat.height-12,n.pageFormat.width=n.pageFormat.width-12):(e.style.left="8px",e.style.top="8px",n.pageFormat.height=n.pageFormat.height+12,n.pageFormat.width=n.pageFormat.width+12),n.refresh()}finally{}},WfPanel.prototype.drawHelpfulText=function(){var t,e=wfGetLabel(389963,"文本说明"),n=wfGetLabel(389963,"文本说明"),i=wfGetLabel(389963,"文本说明");return(t=[new mxCell(wfGetLabel(389963,"文本说明"),new mxGeometry(10,10,150,100),"text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;connectable=0;")])[0].vertex=!0,t[0].isHelpfulText=!0,this.createItem(t,e,n,i,150,100,void 0,void 0,!0)},WfPanel.prototype.wfPanelNowCellsNum=0,WfPanel.prototype.WfPanelNoNeedRefresh=!1,WfPanel.prototype.getWorkflowXml=function(){wfMessage.loading(wfGetLabel(81558,"正在加载数据,请稍候..."),0);var i=this;mxUtils.post(WORKFLOW_GET_XML,"wfId="+(window.urlParams.workflowId||""),function(t){wfMessage.destroy();var e=t.request.responseText,n=JSON.parse(e).filePath||"";i.WfPanelNoNeedRefresh=!0,location.href=n})},WfPanel.prototype.drawRowGroup=function(){var t=workflowUi.wfGroups,e={type:"row",position:{left:0},panelWidth:180,value:wfGetLabel(81313,"分组")+"("+wfGetLabel(383908,"横向")+")"};t.addRowGroup(e)},WfPanel.prototype.drawColGroup=function(){var t=workflowUi.wfGroups,e={type:"col",position:{top:0},panelWidth:180,value:wfGetLabel(81313,"分组")+"("+wfGetLabel(383907,"纵向")+")"};t.addColGroup(e)},WfPanel.prototype.groupDragAction=function(i,o){var s,l,r,a;i.onmousedown=function(t){t.stopPropagation(),s=t.pageX,l=t.pageY,r=i.offsetLeft,a=i.offsetTop,document.onmousemove=function(t){var e=t.pageX,n=t.pageY;"col"==o?i.style.left=parseInt(e)-parseInt(s)+parseInt(r)+"px":i.style.top=parseInt(n)-parseInt(l)+parseInt(a)+"px"}},document.onmouseup=function(t){t.stopPropagation(),document.onmousemove=null}},WfPanel.prototype.drawAreaGroup=function(){var t,e=wfGetLabel(81313,"分组"),n=wfGetLabel(81313,"分组"),i=wfGetLabel(81313,"分组");return(t=[new mxCell(wfGetLabel(81313,"分组"),new mxGeometry(10,10,160,140),"shape=mxgraph.flowchart.process;fillColor=none;dashed=1;strokeColor=#666666;strokeWidth=2;labelPosition=center;verticalLabelPosition=center;align=center;verticalAlign=top;connectable=0;fontWeight:normal;fontSize=12;fontStyle=1;wrap=1;fontColor=#000000;")])[0].vertex=!0,t[0].isGroupArea=!0,this.createItem(t,e,n,i,160,140,void 0,void 0,!0)},WfPanel.prototype.setTipInfoBtn=function(){var t=document.createElement("button");t.innerHTML="show tip",t.onclick=this.setTipInfoShow.bind(this),this.container.appendChild(t)},WfPanel.prototype.setTipInfoShow=function(){for(var t=document.getElementsByClassName("action-area-tip"),e=document.getElementsByClassName("icon-workflow-xianshifenzu")[0],n=0;n<t.length;++n)"none"==this.tipInfoDisplay?(t[n].style.display="block",e.className="icon-workflow-xianshifenzu workflowIcon-is-clicked icon-workflow",e.title=wfGetLabel(389944,"隐藏分组")):(t[n].style.display="none",e.className="icon-workflow-xianshifenzu icon-workflow",e.title=wfGetLabel(389946,"显示分组"));this.tipInfoDisplay="none"==this.tipInfoDisplay?this.tipInfoDisplay="block":this.tipInfoDisplay="none",this.reDrawGraphSize("block"==this.tipInfoDisplay)},WfPanel.prototype.reDrawGraphSize=function(t){var e=this.editorUi.wfEditor,n=(this.editorUi.diagramContainer,this.editorUi.wfPanelContainer),i=this.editorUi.editor.graph;i.model;this.nodePanelHide=!this.nodePanelHide;var o=e.container.clientHeight;try{n.style.top=o+"px",i.pageFormat.height=window.innerHeight-o-20,i.refresh()}finally{}},WfPanel.prototype.doCheckBranchNode=function(t){for(var e=!1,n=!1,i=0;i<t.length;++i)1==t[i].nodeAttriBute?e=!0:5!=t[i].nodeAttriBute&&3!=t[i].nodeAttriBute&&4!=t[i].nodeAttriBute||(n=!0);return!e&&n?(wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(389947,"只有分叉合并节点,没有分叉起始节点!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}}),!1):e&&!n?(wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(389948,"只有分叉起始节点,没有分叉合并节点!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}}),!1):!!(!e&&!n||e&&n)||void 0},WfPanel.prototype.pauseWorkflowTest=function(t){for(var e=0;e<this.wfTestTimeOutList.length;++e)clearTimeout(this.wfTestTimeOutList[e]);jQuery(".workflow-test").stop(!0);var n=document.getElementById("workflow-ceshiOrPause");n.className="icon-workflow icon-workflow-ceshi",n.title=wfGetLabel(1256,"继续"),n.onclick=this.startAgainWorkflowTest.bind(this)},WfPanel.prototype.startAgainWorkflowTest=function(t){t.target.className="icon-workflow icon-workflow-zanting",t.target.title=wfGetLabel(389950,"暂停测试"),t.target.onclick=this.pauseWorkflowTest.bind(this);var e=this.editorUi.editor.graph,n=e.view,i=n.scale,o=e.minimumGraphSize.x||0,s=e.minimumGraphSize.y||0,l=e.minimumGraphSize.width*i||1e5,r=e.minimumGraphSize.height*i||1e5,a=e.getAllCells(o,s,l,r),h=document.getElementsByClassName("workflow-test");if(h)for(var d=0;d<h.length;++d)h[d].title&&this.startAgainWorkflowTest_(h[d],a,n,{x:h[d].offsetLeft+6,y:h[d].offsetTop+6});for(d=0;d<this.wfTestTimeOutCellNodeList.length;++d)this.wfTestTimeOutCellNodeList[d]&&this.workflowTestV2(this.wfTestTimeOutCellNodeList[d])},WfPanel.prototype.startAgainWorkflowTest_=function(t,e,n,i){var o,s,l=1;o=t.title.split(",")[1];for(var r=0;r<e.length;++r)e[r].edge&&e[r].id==o&&(s=e[r]);for(var a=n.getState(s).absolutePoints,h=[],d=0;d<a.length-1;++d){if(i.x==a[d].x&&i.x==a[d+1].x){if(i.y==a[d].y||i.y>a[d].y&&i.y<a[d+1].y||i.y<a[d].y&&i.y>a[d+1].y){l=d+1;break}if(i.y==a[d+1].y){l=d+2;break}}if(i.y==a[d].y&&i.y==a[d+1].y){if(i.x==a[d].x||i.x>a[d].x&&i.x<a[d+1].x||i.x<a[d].x&&i.x>a[d+1].x){l=d+1;break}if(i.x==a[d+1].x){l=d+2;break}}}for(d=0;d<a.length;++d)l<=d&&h.push(a[d]);h.unshift(i),this.startWorkflowTest_v2(h,s)},WfPanel.prototype.doWorkflowTest=function(t){document.getElementById("workflow-cellEditor")&&(document.getElementById("workflow-cellEditor").style.display="none");for(var e=document.getElementsByClassName("wf-word-line"),n=0;n<e.length;++n)e[n]&&(e[n].style.visibility="visible");this.workflowTestIsPassed=!0;var i=t?t.target:document.getElementById("workflow-ceshiOrPause"),o=this.editorUi.editor.graph,s=o.view.scale,l=o.minimumGraphSize.x||0,r=o.minimumGraphSize.y||0,a=o.minimumGraphSize.width*s||1e5,h=o.minimumGraphSize.height*s||1e5,d=o.getAllCells(l,r,a,h);if(this.doCheckBranchNode(d)){for(var u=[],p=null,m=!1,c=(n=0,d.length);n<c;++n)0==d[n].nodeType&&(p=d[n]),3==d[n].nodeType&&(m=!0),d[n].edge&&u.push(d[n]);p?m?(this.wfTestIsIng=!0,this.createWfTestTagsContainer(p),this.createTestMask(),i.className="icon-workflow icon-workflow-zanting",i.title=wfGetLabel(389950,"暂停测试"),i.onclick=this.pauseWorkflowTest.bind(this)):wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(389953,"至少有一个归档节点!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}}):(wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(389951,"必须有一个创建节点!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}}),this.wfTestIsIng=!0,this.openWorkflowTestPanel("NO_START_CELL"),this.createTestMask(),i.className="icon-workflow icon-workflow-zanting",i.title=wfGetLabel(389950,"暂停测试"),i.onclick=this.pauseWorkflowTest.bind(this))}},WfPanel.prototype.createTestMask=function(){if(document.getElementById("workflow-test-mask")){var t=document.getElementById("workflow-test-mask"),e=document.getElementById("test-action-mask");return t?t.style.display="block":((t=document.createElement("div")).id="workflow-test-mask",this.container.appendChild(e)),void(e?e.style.display="block":((e=document.createElement("div")).id="test-action-mask",this.container.appendChild(e)))}t=document.createElement("div");(e=document.createElement("div")).id="test-action-mask",t.id="workflow-test-mask",this.container.appendChild(e),document.body.appendChild(t)},WfPanel.prototype.createSaveMask=function(t){if(t){if(document.getElementById("workflow-save-mask"))(e=document.getElementById("workflow-save-mask")).style.display="block";else(e=document.createElement("div")).id="workflow-save-mask",this.container.appendChild(e);if(document.getElementById("workflow-test-mask"))(e=document.getElementById("workflow-test-mask")).style.zIndex=16,e.style.display="block";else(e=document.createElement("div")).id="workflow-test-mask",e.style.zIndex=16,document.body.appendChild(e)}else{if(!document.getElementById("workflow-save-mask"))return;var e;if((e=document.getElementById("workflow-save-mask")).style.display="none",document.getElementById("workflow-test-mask"))(e=document.getElementById("workflow-test-mask")).style.zIndex=11,e.style.display="none"}},WfPanel.prototype.wfTestIsIng=!1,WfPanel.prototype.wfTestTimeOutList=[],WfPanel.prototype.wfTestTimeOutCellNodeList=[],WfPanel.prototype.doAni_v2=function(a,h,t,e,d,u,p,n,i,m){var c=this.editorUi.editor.graph.view,g=this;a.title="edge,"+p.id;var o,x,s=n/180*1e3;o="up"==i?"icon-workflow-shang":"down"==i?"icon-workflow-xia":"left"==i?"icon-workflow-zuo":"icon-workflow-you",x="up"==m?"icon-workflow-shang":"down"==m?"icon-workflow-xia":"left"==m?"icon-workflow-zuo":"icon-workflow-you",1==d&&(a.className="workflow-test "+o),jQuery(h).animate({left:t+"px",top:e+"px"},s,function(){if(a.title="edge,"+p.id,m&&(a.className="workflow-test "+x),d==u.length-1){a.title=null,jQuery(h).remove();var t,e=c.getState(p),n=e?e.shape.node:"";if(mxClient.IS_IE)for(var i=n.childNodes,o=0;o<i.length;++o)for(var s=i[o].attributes,l=0;l<s.length;++l)"#FF8C00"==s[l].nodeValue.toUpperCase()&&i[o].setAttribute(s[l].nodeName,"#228B22");else(t=n?n.innerHTML.replace(/#FF8C00/g,"#228B22"):"")&&(n.innerHTML=t);var r=setTimeout(function(){g.createWfTestTagsContainer(p.target),clearTimeout(r)},1e3);g.wfTestTimeOutList.push(r),g.wfTestTimeOutCellNodeList.push(p.target)}})},WfPanel.prototype.startWorkflowTest_v2=function(t,e){var n,i=t;this.editorUi.wfPanelContainer,jQuery(".geDiagramContainer").offset();if(document.getElementById("wfTestball_"+e.id))n=document.getElementById("wfTestball_"+e.id);else{var o=document.getElementsByClassName("geBackgroundPage")[0];(n=document.createElement("div")).id="wfTestball_"+e.id,n.className="workflow-test",n.style.left=i[0].x-6+"px",n.style.top=i[0].y-6+"px",o.appendChild(n)}for(var s=1;s<i.length;++s){var l=0,r="up",a="";i[s].x==i[s-1].x?(r=0<=i[s].y-i[s-1].y?"down":"up",l=Math.abs(i[s].y-i[s-1].y)):i[s].y==i[s-1].y&&(r=0<=i[s].x-i[s-1].x?"right":"left",l=Math.abs(i[s].x-i[s-1].x)),i[s+1]&&(i[s+1].x==i[s].x?a=0<=i[s+1].y-i[s].y?"down":"up":i[s+1].y==i[s].y&&(a=0<=i[s+1].x-i[s].x?"right":"left")),this.doAni_v2(n,"#wfTestball_"+e.id,i[s].x-6,i[s].y-6,s,i,e,l,r,a)}},WfPanel.prototype.workflowTestV2=function(t){if(this.wfTestIsIng&&!t.isTested){t.isTested=!0;var e=this.editorUi.editor.graph,n=(e.model,e.view),i=null,o=!1;if(null!=t&&3!=t.nodeType&&null!=t.edges&&0<t.edges.length){i=t.edges;for(var s=0;s<i.length;++s)if(i[s].source.id==t.id){o=!0;var l,r,a=n.getState(i[s]),h=a?a.shape.node:"";if(mxClient.IS_IE)for(var d=h.childNodes,u=0;u<d.length;++u)for(var p=d[u].attributes,m=0;m<p.length;++m)"#8c8c8c"==p[m].nodeValue&&d[u].setAttribute(p[m].nodeName,"#FF8C00");else(r=h?h.innerHTML.replace(/#8c8c8c/g,"#FF8C00"):"")&&(h.innerHTML=r);l=n.getState(i[s]).absolutePoints,i[s].isTested||this.startWorkflowTest_v2(l,i[s]),i[s].isTested=!0}if(!o)document.getElementsByClassName("workflow-test").length}3==t.nodeType&&(o=!0),this.openWorkflowTestPanel(t,o,i)}},WfPanel.prototype.createWfTestTagsContainer=function(e){var t=this.editorUi.editor.graph.view.scale;if(!e.isTested){var n,i,o=this,s=document.getElementsByClassName("geBackgroundPage")[0];document.getElementById("workflowTestTags-container-"+e.id)?i=document.getElementById("workflowTestTags-container-"+e.id):((i=document.createElement("div")).id="workflowTestTags-container-"+e.id,i.className="wf-test-node-result"),i.style.left=(e.geometry.x+e.geometry.width+5)*t+"px",i.style.top=(e.geometry.y-10)*t+"px",(n=document.createElement("img")).src="/workflow/workflowDesign/images/shalou.gif",n.id="wfTestloading-gif"+e.id,n.onload=function(){document.getElementById("wfTestloading-gif"+e.id)||(i.appendChild(n),s.appendChild(i));var t=setTimeout(function(){o.workflowTestV2(e),clearTimeout(t)},1e3);o.wfTestTimeOutList.push(t),o.wfTestTimeOutCellNodeList.push(e)}}},WfPanel.prototype.stopWorkflowTest=function(t){for(var e=this.editorUi.editor.graph,n=e.view,i=n.scale,o=e.minimumGraphSize.x||0,s=e.minimumGraphSize.y||0,l=e.minimumGraphSize.width*i||1e5,r=e.minimumGraphSize.height*i||1e5,a=0;a<this.wfTestTimeOutList.length;++a)clearTimeout(this.wfTestTimeOutList[a]);this.wfTestTimeOutList=[],this.wfTestTimeOutCellNodeList=[],this.wfTestIsIng=!1;for(var h=e.getAllCells(o,s,l,r),d=(a=0,h.length);a<d;++a)if(h[a].isTested=!1,h[a].edge){h[a].isTested=!1;var u,p=n.getState(h[a]),m=p?p.shape.node:"";if(mxClient.IS_IE)for(var c=m.childNodes,g=0;g<c.length;++g)for(var x=c[g].attributes,y=0;y<x.length;++y)"#FF8C00"==x[y].nodeValue.toUpperCase()&&c[g].setAttribute(x[y].nodeName,"#8c8c8c"),"#228B22"==x[y].nodeValue.toUpperCase()&&c[g].setAttribute(x[y].nodeName,"#8c8c8c");else(u=(u=m?m.innerHTML.replace(/#FF8C00/g,"#8c8c8c"):"").replace(/#228B22/g,"#8c8c8c"))&&(m.innerHTML=u)}var f=document.getElementsByClassName("workflow-test");for(a=0,d=f.length;a<d;++a)f[0].style.display="none",f[0].parentNode.removeChild(f[0]);this.hideWorkflowTestPanel(t),this.editorUi.editor.setModified(!1);var v=document.getElementById("workflow-ceshiOrPause");v.className="icon-workflow icon-workflow-ceshi",v.title=wfGetLabel(389954,"开始测试"),v.onclick=this.doWorkflowTest.bind(this),t||(jQuery(".workflow-test").stop(!0),jQuery(".wf-test-node-result").remove())},WfPanel.prototype.openWorkflowTestPanel=function(t,e,n){var i,o,s,l=this.editorUi.diagramContainer;document.getElementById("workflow-test-detail-panel")?(i=document.getElementById("workflow-test-detail-panel")).style.bottom="8px":((s=document.createElement("div")).id="workflow-test-detail-panel",i=s,document.body.appendChild(i));document.getElementById("test-panel-split")?((o=document.getElementById("test-panel-split")).style.bottom=i.clientHeight+"px",l.style.bottom=i.clientHeight+10+"px"):((s=document.createElement("div")).id="test-panel-split",s.className="geVsplit",(o=s).style.bottom=i.clientHeight+"px",l.style.bottom=i.clientHeight+10+"px",document.body.appendChild(o),o.style.height="10px",workflowUi.addSplitHandler(o,!1,0,mxUtils.bind(workflowUi,function(t){t<=0&&(t=0),i.style.height=t+"px",i.style.bottom=t<=8?"0px":"8px",o.style.bottom=t+"px",l.style.bottom=t<=8?"8px":t+10+"px"})));i.style.width=workflowUi.wfNodeInfo.nodePanelHide?"100%":"calc(100% - 250px)","NO_START_CELL"!=t?this.writeWorkflowTestInfo(i,t,e,n):this.writeWorkflowTestInfo(i,t)},WfPanel.prototype.hideWorkflowTestPanel=function(t){var e;if(document.getElementById("workflow-test-detail-panel")&&(e=document.getElementById("workflow-test-detail-panel"),1!=t)){var n=document.getElementById("workflow-test-mask"),i=document.getElementById("test-action-mask");n&&(n.style.display="none"),i&&(i.style.display="none");var o=document.getElementById("test-panel-split");o&&(o.style.bottom="0px"),e.style.bottom=-e.clientHeight+"px",this.editorUi.diagramContainer.style.bottom="8px"}},WfPanel.prototype.workflowTestIsPassed=!0,WfPanel.prototype.writeWorkflowTestInfo=function(t,e,n,i){var o=this.editorUi.editor.graph.view.scale,s=e.value;-1<s.indexOf("base64")&&(s=Base64.decode(s.split("_")[1])),s=wfFormatMultiLang(s);var l=document.getElementById("workflow-test-detail-panel");if("NO_START_CELL"==e){var r=document.createElement("p"),a=document.createElement("p"),h=document.createElement("p");return r.className="wfTest-detail-item",a.className="wfTest-detail-item",h.className="wfTest-detail-item wfTest-item-wrong",r.innerHTML="["+wfGetLabel(383908,"信息")+"] ****************************************************************************************************************",a.innerHTML="["+wfGetLabel(383908,"信息")+" "+wfGetLabel(26361,"工作流")+" "+wfGetLabel(389973,"开始检查"),h.innerHTML="["+wfGetLabel(382055,"错误")+"] "+wfGetLabel(389974,"当前流程无创建节点"),t.appendChild(r),t.appendChild(a),t.appendChild(h),void(l.scrollTop=1e4)}var d=document.getElementsByClassName("geBackgroundPage")[0],u=document.getElementById("workflowTestTags-container-"+e.id),p=document.createElement("span");if(u?(u.innerHTML="",u.appendChild(p)):(p.style.left=(e.geometry.x+e.geometry.width+5)*o+"px",p.style.top=(e.geometry.y-10)*o+"px"),i){for(var m,c,g=!0,x="",y=0;y<i.length;++y)i[y].source.id==e.id&&(i[y].target.id!=x&&""!=x&&(g=!1),""==x&&(x=i[y].target.id),m=i[y].target.edges,c=i[y].target);if(1==g&&m){for(var f=!0,v=!0,C=!1,E=0;E<m.length;++E)m[E].isTested||(v=!1),m[E].source.id==c.id&&(C=!0,m[E].target.id!=e.id&&(f=!1));if(f&&v&&C){a=document.createElement("p"),h=document.createElement("p");return a.className="wfTest-detail-item wfTest-item-wrong",h.className="wfTest-detail-item wfTest-item-wrong",a.innerHTML="["+wfGetLabel(382055,"错误")+"] "+wfGetLabel(389975,"工作流检查 严重错误,死循环!"),h.innerHTML="["+wfGetLabel(382055,"错误")+"] "+wfGetLabel(15586,"节点")+":["+s+"] "+wfGetLabel(389976,"此节点与节点")+" ["+wfFormatMultiLang(c.value)+"] "+wfGetLabel(389977,"形成死循环!无法正常结束")+"!",p.className="wf-test-node-result icon-workflow-wrong",d.appendChild(p),t.appendChild(a),t.appendChild(h),void(l.scrollTop=1e4)}}}if(0==e.nodeType){r=document.createElement("p"),a=document.createElement("p");r.className="wfTest-detail-item",a.className="wfTest-detail-item",r.innerHTML="["+wfGetLabel(383908,"信息")+"] ****************************************************************************************************************",a.innerHTML="["+wfGetLabel(383908,"信息")+" "+wfGetLabel(26361,"工作流")+" "+wfGetLabel(389973,"开始检查"),t.appendChild(r),t.appendChild(a)}var w,S;w=0==e.nodeType?wfGetLabel(125,"创建"):1==e.nodeType?wfGetLabel(83518,"审批"):2==e.nodeType?wfGetLabel(553,"处理"):3==e.nodeType?wfGetLabel(251,"归档"):"",S=0==e.nodeAttriBute?wfGetLabel(383490,"一般"):1==e.nodeAttriBute?wfGetLabel(21394,"分叉起始点"):2==e.nodeAttriBute?wfGetLabel(21395,"分叉中间点"):3==e.nodeAttriBute?wfGetLabel(21396,"通过分支数合并"):4==e.nodeAttriBute?wfGetLabel(21397,"指定通过分支合并"):5==e.nodeAttriBute?wfGetLabel(126603,"比例合并"):"";var b=document.createElement("p");if(n?(p.className="wf-test-node-result icon-workflow-duigou",b.className="wfTest-detail-item",b.innerHTML="["+wfGetLabel(383908,"信息")+"] "+wfGetLabel(15586,"节点")+":["+s+"] "+wfGetLabel(384128,"基本信息")+":["+wfGetLabel(126206,"节点名称")+":"+s+","+wfGetLabel(15536,"节点类型")+":"+w+","+wfGetLabel(21393,"节点属性")+":"+S+"]"):(p.className="wf-test-node-result icon-workflow-wrong",this.workflowTestIsPassed=!1,b.className="wfTest-detail-item wfTest-item-wrong",b.innerHTML="["+wfGetLabel(382055,"错误")+"] "+wfGetLabel(15586,"节点")+":["+s+"] "+wfGetLabel(389979,"没有出口")),setTimeout(function(){u||d.appendChild(p)},1e3),t.appendChild(b),"1"==e.nodeType){var T=!1;for(y=0;y<i.length;++y)1==i[y].isreject&&(T=!0);if(!T)(L=document.createElement("p")).className="wfTest-detail-item wfTest-item-warning",L.innerHTML="["+wfGetLabel(382056,"警告")+"] "+wfGetLabel(15586,"节点")+":["+s+"] "+wfGetLabel(389980,"审批节点应该包含退回出口"),t.appendChild(L)}if(3==e.nodeAttriBute||4==e.nodeAttriBute||5==e.nodeAttriBute){var A=[];for(y=0;y<i.length;++y)i[y].target.id==e.id&&A.push(i[y].id);if(A.length<=1)(L=document.createElement("p")).className="wfTest-detail-item wfTest-item-warning",L.innerHTML="["+wfGetLabel(382056,"警告")+"] "+wfGetLabel(15586,"节点")+":["+s+"] "+wfGetLabel(389981,"合并节点至少应该有两条或两条以上的入口"),t.appendChild(L)}if("3"==e.nodeType){var L=document.createElement("p");this.workflowTestIsPassed?(L.className="wfTest-detail-item wfTest-item-success",L.innerHTML="["+wfGetLabel(25008,"成功")+"] "+wfGetLabel(15586,"节点")+":["+s+"] "+wfGetLabel(389983,"此流向正常结束")):(L.className="wfTest-detail-item wfTest-item-wrong",L.innerHTML="["+wfGetLabel(388508,"失败")+"] "+wfGetLabel(15586,"节点")+":["+s+"] "+wfGetLabel(389984,"此流向测试异常")),t.appendChild(L)}l.scrollTop=1e4},WfPanel.prototype.hideTooltip=function(){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null),null!=this.tooltip&&(this.tooltip.style.display="none",this.tooltipImage.style.visibility="hidden",this.currentElt=null)},WfPanel.prototype.addGeneralPalette=function(t){var e="fillColor=#BFF3C3;strokeColor=#5ABD6B;resizable=0;fontColor=#345e3a;",n=[this.createVertexTemplateEntry('ellipse;whiteSpace=wrap;html=1;icons={"right":"icon-workflow-ceshi"};'+e,93,93,wfGetLabel(125,"创建"),wfGetLabel(125,"创建"),null,null,"rounded rect rectangle box","icon-workflow-chuangjian","","0","0"),this.createVertexTemplateEntry("rounded=0;whiteSpace=wrap;html=1;"+e,108,70,wfGetLabel(553,"处理"),wfGetLabel(553,"处理"),null,null,"rect rectangle box","icon-workflow-chuli","","2","0"),this.createVertexTemplateEntry("rhombus;whiteSpace=wrap;html=1;"+e,110,100,wfGetLabel(83518,"审批"),wfGetLabel(83518,"审批"),null,null,"diamond rhombus if condition decision conditional question test","icon-workflow-shenpi","","1","0"),this.createVertexTemplateEntry('rounded=0;whiteSpace=wrap;html=1;icons={"left":"icon-workflow-fencha"};'+e,108,70,wfGetLabel(21394,"分叉起始点"),wfGetLabel(21394,"分叉起始点"),null,null,"rect rectangle box","icon-workflow-fencha","oneToBranch","2","1"),this.createVertexTemplateEntry('rounded=0;whiteSpace=wrap;html=1;icons={"left":"icon-workflow-fenchazhongjiandian"};'+e,108,70,wfGetLabel(21395,"分叉中间点"),wfGetLabel(21395,"分叉中间点"),null,null,"rect rectangle box","icon-workflow-fenchazhongjiandian","branchCenter","2","2"),this.createVertexTemplateEntry('rounded=0;whiteSpace=wrap;html=1;icons={"left":"icon-workflow-hebing"};'+e,108,70,wfGetLabel(131468," 分叉合并节点 "),wfGetLabel(131468," 分叉合并节点 "),null,null,"rect rectangle box","icon-workflow-hebing","branchToOne","2","3"),this.createVertexTemplateEntry('ellipse;whiteSpace=wrap;html=1;icons={"right":"icon-workflow-tingzhi"};'+e,93,93,wfGetLabel(251,"归档"),wfGetLabel(251,"归档"),null,null,"rounded rect rectangle box","icon-workflow-guidang","","3","0")];this.addPaletteFunctions("1","111",null==t||t,n)},WfPanel.prototype.addPaletteFunctions=function(t,e,n,i){this.addPalette(t,e,n,mxUtils.bind(this,function(t){for(var e=0;e<i.length;e++)t.appendChild(i[e](t))}))},WfPanel.prototype.addPalette=function(t,e,n,i){var o=document.createElement("div");o.className="action-area";var s=document.createElement("div");s.className="action-area-tip",s.innerHTML=wfGetLabel(15586,"节点"),o.appendChild(s),mxClient.IS_POINTER&&(o.style.touchAction="none"),n?(i(o),i=null):o.style.display="none";var l=document.createElement("div");return l.className="wfEditor-split",this.container.insertBefore(o,this.container.childNodes[2]),this.container.insertBefore(l,this.container.childNodes[3]),o},WfPanel.prototype.createTitle=function(t){var e=document.createElement("a");return e.setAttribute("href","javascript:void(0);"),e.setAttribute("title",mxResources.get("sidebarTooltip")),e.className="geTitle",mxUtils.write(e,t),e},WfPanel.prototype.addFoldingHandler=function(n,i,o){var s=!1;(!mxClient.IS_IE||8<=document.documentMode)&&(n.style.backgroundImage="none"==i.style.display?"url('"+this.collapsedImage+"')":"url('"+this.expandedImage+"')"),n.style.backgroundRepeat="no-repeat",n.style.backgroundPosition="0% 50%",mxEvent.addListener(n,"click",mxUtils.bind(this,function(t){if("none"==i.style.display){if(s)i.style.display="block";else if(s=!0,null!=o){n.style.cursor="wait";var e=n.innerHTML;n.innerHTML=mxResources.get("loading")+"...",window.setTimeout(function(){var t=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,o(i),mxClient.NO_FO=t,i.style.display="block",n.style.cursor="",n.innerHTML=e},0)}else i.style.display="block";n.style.backgroundImage="url('"+this.expandedImage+"')"}else n.style.backgroundImage="url('"+this.collapsedImage+"')",i.style.display="none";mxEvent.consume(t)}))},WfPanel.prototype.createVertexTemplateEntry=function(t,e,n,i,o,s,l,r,a,h,d,u){return r=null!=r&&0<r.length?r:o.toLowerCase(),this.addEntry(r,mxUtils.bind(this,function(){return this.createVertexTemplate(t,e,n,i,o,s,l,"",a,h,d,u)}))},WfPanel.prototype.createVertexTemplate=function(t,e,n,i,o,s,l,r,a,h,d,u){var p=[new mxCell(null!=i?i:"",new mxGeometry(0,0,e,n),t,h)];return p[0].vertex=!0,p[0].nodeType=d,p[0].nodeAttriBute=u,"-1"==d&&(p[0].isGroupArea=!0),this.createVertexTemplateFromCells(p,e,n,o,s,l,r,a)},WfPanel.prototype.createVertexTemplateFromCells=function(t,e,n,i,o,s,l,r){return this.createItem(t,i,o,s,e,n,l,r)},WfPanel.prototype.addEntry=function(t,n){if(null!=this.taglist&&null!=t&&0<t.length)for(var e=t.toLowerCase().replace(/[\/\,\(\)]/g," ").split(" "),i=mxUtils.bind(this,function(t){if(1<t.length){var e=this.taglist[t];"object"!=typeof e&&(e={entries:[],dict:new mxDictionary},this.taglist[t]=e),null==e.dict.get(n)&&(e.dict.put(n,n),e.entries.push(n))}}),o=0;o<e.length;o++){i(e[o]);var s=e[o].replace(/\.*\d*$/,"");s!=e[o]&&i(s)}return n},WfPanel.prototype.createThumb=function(t,e,n,i,o,s,l,r,a){this.graph.labelsVisible=null==s||s;var h=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,this.graph.view.scaleAndTranslate(1,0,0),this.graph.addCells(t);var d=this.graph.getGraphBounds(),u=Math.floor(100*Math.min((e-2*this.thumbBorder)/d.width,(n-2*this.thumbBorder)/d.height))/100;this.graph.view.scaleAndTranslate(u,Math.floor((e-d.width*u)/2/u-d.x),Math.floor((n-d.height*u)/2/u-d.y));var p=null;if(this.graph.dialect!=mxConstants.DIALECT_SVG||mxClient.NO_FO?((p=this.graph.container.cloneNode(!1)).innerHTML=this.graph.container.innerHTML,!mxClient.IS_QUIRKS&&8!=document.documentMode||(p.firstChild.style.overflow="visible")):p=this.graph.view.getCanvas().ownerSVGElement.cloneNode(!0),this.graph.getModel().clear(),mxClient.NO_FO=h,mxClient.IS_IE6&&(i.style.backgroundImage="url("+this.editorUi.editor.transparentImage+")"),p.style.position="relative",p.style.overflow="hidden",p.style.cursor="move",p.style.left=this.thumbBorder+"px",p.style.top=this.thumbBorder+"px",p.style.width=e+"px",p.style.height=n+"px",p.style.visibility="",p.style.minWidth="",p.style.minHeight="",i.appendChild(p),this.sidebarTitles&&null!=o&&0!=l){var m=mxClient.IS_QUIRKS?2*this.thumbPadding+2:0;i.style.height=this.thumbHeight+m+this.sidebarTitleSize+8+"px";var c=document.createElement("div");c.style.fontSize=this.sidebarTitleSize+"px",c.style.color="#303030",c.style.textAlign="center",c.style.whiteSpace="nowrap",mxClient.IS_IE&&(c.style.height=this.sidebarTitleSize+12+"px"),c.style.paddingTop="4px",mxUtils.write(c,o),i.appendChild(c)}return d},WfPanel.prototype.createItem=function(e,n,i,t,o,s,l,r,a){var h=document.createElement("span");h.className=r+" icon-workflow",h.setAttribute("title",n),mxClient.IS_IE6&&(h.style.border="none"),mxEvent.addListener(h,"click",function(t){mxEvent.consume(t)});var d=new mxRectangle(0,0,o,s);if(1<e.length||e[0].vertex){var u=this.createDragSource(h,this.createDropHandler(e,!0,l,d),this.createDragPreview(o,s),e,d,a);this.addClickHandler(h,u,e),u.isGuidesEnabled=mxUtils.bind(this,function(){return this.editorUi.editor.graph.graphHandler.guidesEnabled})}else if(null!=e[0]&&e[0].edge){u=this.createDragSource(h,this.createDropHandler(e,!1,l,d),this.createDragPreview(o,s),e,d,a);this.addClickHandler(h,u,e)}return mxClient.IS_IOS||a||mxEvent.addGestureListeners(h,null,mxUtils.bind(this,function(t){mxEvent.isMouseEvent(t)&&this.showTooltip(h,e,d.width,d.height,n,i)})),h},WfPanel.prototype.createDragSource=function(t,a,e,C,m,n){for(var i=this.editorUi,o=i.editor.graph,c=null,E=null,g=this,s=0;s<C.length&&(null==E&&this.editorUi.editor.graph.model.isVertex(C[s])?E=s:null==c&&this.editorUi.editor.graph.model.isEdge(C[s])&&null==this.editorUi.editor.graph.model.getTerminal(C[s],!0)&&(c=s),null==E||null==c);s++);var w=mxUtils.makeDraggable(t,this.editorUi.editor.graph,mxUtils.bind(this,function(t,e,n,i,o){if(null!=this.updateThread&&window.clearTimeout(this.updateThread),null!=C&&null!=T&&D==P){var s=t.isCellSelected(T.cell)?t.getSelectionCells():[T.cell],l=this.updateShapes(t.model.isEdge(T.cell)?C[0]:C[E],s);t.setSelectionCells(l)}else if(null!=C&&null!=D&&null!=S&&D!=P){var r=t.model.isEdge(S.cell)||null==c?E:c;t.setSelectionCells(this.dropAndConnect(S.cell,C,H,r,e))}else a.apply(this,arguments);null!=this.editorUi.hoverIcons&&this.editorUi.hoverIcons.update(t.view.getState(t.getSelectionCell()))}),e,0,0,o.autoscroll,!0,!0);o.addListener(mxEvent.ESCAPE,function(t,e){w.isActive()&&w.reset()});var l=w.mouseDown;function r(t,e){var n=null;return mxClient.IS_IE&&!mxClient.IS_SVG?(mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?((n=document.createElement(mxClient.VML_PREFIX+":image")).setAttribute("src",t.src),n.style.borderStyle="none"):((n=document.createElement("div")).style.backgroundImage="url("+t.src+")",n.style.backgroundPosition="center",n.style.backgroundRepeat="no-repeat"),n.style.width=t.width+4+"px",n.style.height=t.height+4+"px",n.style.display=mxClient.IS_QUIRKS?"inline":"inline-block"):((n=mxUtils.createImage(t.src)).style.width=t.width+"px",n.style.height=t.height+"px"),null!=e&&n.setAttribute("title",e),mxUtils.setOpacity(n,t==this.refreshTarget?30:20),n.style.position="absolute",n.style.cursor="crosshair",n}w.mouseDown=function(t){mxEvent.isPopupTrigger(t)||mxEvent.isMultiTouchEvent(t)||(o.stopEditing(),l.apply(this,arguments))};var S=null,b=null,T=null,A=!1,L=r(this.triangleUp,mxResources.get("connect")),I=r(this.triangleRight,mxResources.get("connect")),M=r(this.triangleDown,mxResources.get("connect")),R=r(this.triangleLeft,mxResources.get("connect")),P=r(this.refreshTarget,mxResources.get("replace")),O=null,N=r(this.roundDrop),G=r(this.roundDrop),H=mxConstants.DIRECTION_NORTH,D=null;function _(t,e,n,i){return null!=i.parentNode&&(mxUtils.contains(n,t,e)?(mxUtils.setOpacity(i,100),D=i):mxUtils.setOpacity(i,i==P?30:20)),n}var h=w.createPreviewElement;w.createPreviewElement=function(t){var e=h.apply(this,arguments);return mxClient.IS_SVG&&(e.style.pointerEvents="none"),this.previewElementWidth=e.style.width,this.previewElementHeight=e.style.height,e};var d=w.dragEnter;w.dragEnter=function(t,e){null!=i.hoverIcons&&i.hoverIcons.setDisplay("none"),d.apply(this,arguments)};var u=w.dragExit;w.dragExit=function(t,e){null!=i.hoverIcons&&i.hoverIcons.setDisplay(""),u.apply(this,arguments)},w.dragOver=function(t,e){if(mxDragSource.prototype.dragOver.apply(this,arguments),null!=this.currentGuide&&null!=D&&this.currentGuide.hide(),null!=this.previewElement){var n=t.view;if(null!=T&&D==P)this.previewElement.style.display=t.model.isEdge(T.cell)?"none":"",this.previewElement.style.left=T.x+"px",this.previewElement.style.top=T.y+"px",this.previewElement.style.width=T.width+"px",this.previewElement.style.height=T.height+"px";else if(null!=S&&null!=D){var i=t.model.isEdge(S.cell)||null==c?E:c,o=g.getDropAndConnectGeometry(S.cell,C[i],H,C),s=t.model.isEdge(S.cell)?null:t.getCellGeometry(S.cell),l=t.getCellGeometry(C[i]),r=t.model.getParent(S.cell),a=n.translate.x*n.scale,h=n.translate.y*n.scale;if(null!=s&&!s.relative&&t.model.isVertex(r)&&r!=n.currentRoot){var d=n.getState(r);a=d.x,h=d.y}var u=l.x,p=l.y;t.model.isEdge(C[i])&&(p=u=0),this.previewElement.style.left=(o.x-u)*n.scale+a+"px",this.previewElement.style.top=(o.y-p)*n.scale+h+"px",1==C.length&&(this.previewElement.style.width=o.width*n.scale+"px",this.previewElement.style.height=o.height*n.scale+"px"),this.previewElement.style.display=""}else null!=w.currentHighlight.state&&t.model.isEdge(w.currentHighlight.state.cell)?(this.previewElement.style.left=Math.round(parseInt(this.previewElement.style.left)-m.width*n.scale/2)+"px",this.previewElement.style.top=Math.round(parseInt(this.previewElement.style.top)-m.height*n.scale/2)+"px"):(this.previewElement.style.width=this.previewElementWidth,this.previewElement.style.height=this.previewElementHeight,this.previewElement.style.display="")}};var U=(new Date).getTime(),k=0,V=null,F=this.editorUi.editor.graph.getCellStyle(C[0]);return w.getDropTarget=mxUtils.bind(this,function(t,e,n,i){var o=mxEvent.isAltDown(i)||null==C?null:t.getCellAt(e,n);if(null!=o&&!this.graph.isCellConnectable(o)){var s=this.graph.getModel().getParent(o);this.graph.getModel().isVertex(s)&&this.graph.isCellConnectable(s)&&(o=s)}t.isCellLocked(o)&&(o=null);var l=t.view.getState(o),r=D=null;if(V!=l?(V=l,U=(new Date).getTime(),k=0,null!=this.updateThread&&window.clearTimeout(this.updateThread),null!=l&&(this.updateThread=window.setTimeout(function(){null==D&&(V=l,w.getDropTarget(t,e,n,i))},this.dropTargetDelay+10))):k=(new Date).getTime()-U,k<2500&&null!=l&&!mxEvent.isShiftDown(i)&&(mxUtils.getValue(l.style,mxConstants.STYLE_SHAPE)!=mxUtils.getValue(F,mxConstants.STYLE_SHAPE)&&(mxUtils.getValue(l.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE||mxUtils.getValue(l.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE)!=mxConstants.NONE||mxUtils.getValue(l.style,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.NONE)!=mxConstants.NONE)||"image"==mxUtils.getValue(F,mxConstants.STYLE_SHAPE)||1500<k||t.model.isEdge(l.cell))&&k>this.dropTargetDelay&&(t.model.isVertex(l.cell)&&null!=E||t.model.isEdge(l.cell)&&t.model.isEdge(C[0])))T=l,a=new mxRectangle((a=t.model.isEdge(l.cell)?t.view.getPoint(l):new mxPoint(l.getCenterX(),l.getCenterY())).x-this.refreshTarget.width/2,a.y-this.refreshTarget.height/2,this.refreshTarget.width,this.refreshTarget.height),P.style.left=Math.floor(a.x)+"px",P.style.top=Math.floor(a.y)+"px",null==O&&(t.container.appendChild(P),O=P.parentNode),_(e,n,a,P);else if(null==T||!mxUtils.contains(T,e,n)||1500<k&&!mxEvent.isShiftDown(i))(T=null)!=O&&(P.parentNode.removeChild(P),O=null);else if(null!=T&&null!=O){var a;a=new mxRectangle((a=t.model.isEdge(T.cell)?t.view.getPoint(T):new mxPoint(T.getCenterX(),T.getCenterY())).x-this.refreshTarget.width/2,a.y-this.refreshTarget.height/2,this.refreshTarget.width,this.refreshTarget.height),_(e,n,a,P)}if(A&&null!=S&&!mxEvent.isAltDown(i)&&null==D){if(r=mxRectangle.fromRectangle(S),t.model.isEdge(S.cell)){var h=S.absolutePoints;if(null!=N.parentNode){var d=h[0];r.add(_(e,n,new mxRectangle(d.x-this.roundDrop.width/2,d.y-this.roundDrop.height/2,this.roundDrop.width,this.roundDrop.height),N))}if(null!=G.parentNode){var u=h[h.length-1];r.add(_(e,n,new mxRectangle(u.x-this.roundDrop.width/2,u.y-this.roundDrop.height/2,this.roundDrop.width,this.roundDrop.height),G))}}else{var p=mxRectangle.fromRectangle(S);null!=S.shape&&null!=S.shape.boundingBox&&(p=mxRectangle.fromRectangle(S.shape.boundingBox)),p.grow(this.graph.tolerance),p.grow(HoverIcons.prototype.arrowSpacing),null!=(y=this.graph.selectionCellsHandler.getHandler(S.cell))&&(p.x-=y.horizontalOffset/2,p.y-=y.verticalOffset/2,p.width+=y.horizontalOffset,p.height+=y.verticalOffset,null!=y.rotationShape&&null!=y.rotationShape.node&&"hidden"!=y.rotationShape.node.style.visibility&&"none"!=y.rotationShape.node.style.display&&null!=y.rotationShape.boundingBox&&p.add(y.rotationShape.boundingBox)),r.add(_(e,n,new mxRectangle(S.getCenterX()-this.triangleUp.width/2,p.y-this.triangleUp.height,this.triangleUp.width,this.triangleUp.height),L)),r.add(_(e,n,new mxRectangle(p.x+p.width,S.getCenterY()-this.triangleRight.height/2,this.triangleRight.width,this.triangleRight.height),I)),r.add(_(e,n,new mxRectangle(S.getCenterX()-this.triangleDown.width/2,p.y+p.height,this.triangleDown.width,this.triangleDown.height),M)),r.add(_(e,n,new mxRectangle(p.x-this.triangleLeft.width,S.getCenterY()-this.triangleLeft.height/2,this.triangleLeft.width,this.triangleLeft.height),R))}null!=r&&r.grow(10)}H=mxConstants.DIRECTION_NORTH,D==I?H=mxConstants.DIRECTION_EAST:D==M||D==G?H=mxConstants.DIRECTION_SOUTH:D==R&&(H=mxConstants.DIRECTION_WEST),null!=T&&D==P&&(l=T);var m=(null==E||t.isCellConnectable(C[E]))&&(t.model.isEdge(o)&&null!=E||t.model.isVertex(o)&&t.isCellConnectable(o));if(null!=S&&5e3<=k||S!=l&&(null==r||!mxUtils.contains(r,e,n)||500<k&&null==D&&m))if(A=!1,null!=(S=k<5e3&&k>this.dropTargetDelay||t.model.isEdge(o)?l:null)&&m){for(var c=[N,G,L,I,M,R],g=0;g<c.length;g++)null!=c[g].parentNode&&c[g].parentNode.removeChild(c[g]);if(t.model.isEdge(o)){if(null!=(h=l.absolutePoints)){d=h[0],u=h[h.length-1];var x=t.tolerance;new mxRectangle(e-x,n-x,2*x,2*x);N.style.left=Math.floor(d.x-this.roundDrop.width/2)+"px",N.style.top=Math.floor(d.y-this.roundDrop.height/2)+"px",G.style.left=Math.floor(u.x-this.roundDrop.width/2)+"px",G.style.top=Math.floor(u.y-this.roundDrop.height/2)+"px",null==t.model.getTerminal(o,!0)&&t.container.appendChild(N),null==t.model.getTerminal(o,!1)&&t.container.appendChild(G)}}else{var y;p=mxRectangle.fromRectangle(l);null!=l.shape&&null!=l.shape.boundingBox&&(p=mxRectangle.fromRectangle(l.shape.boundingBox)),p.grow(this.graph.tolerance),p.grow(HoverIcons.prototype.arrowSpacing),null!=(y=this.graph.selectionCellsHandler.getHandler(l.cell))&&(p.x-=y.horizontalOffset/2,p.y-=y.verticalOffset/2,p.width+=y.horizontalOffset,p.height+=y.verticalOffset,null!=y.rotationShape&&null!=y.rotationShape.node&&"hidden"!=y.rotationShape.node.style.visibility&&"none"!=y.rotationShape.node.style.display&&null!=y.rotationShape.boundingBox&&p.add(y.rotationShape.boundingBox)),L.style.left=Math.floor(l.getCenterX()-this.triangleUp.width/2)+"px",L.style.top=Math.floor(p.y-this.triangleUp.height)+"px",I.style.left=Math.floor(p.x+p.width)+"px",I.style.top=Math.floor(l.getCenterY()-this.triangleRight.height/2)+"px",M.style.left=L.style.left,M.style.top=Math.floor(p.y+p.height)+"px",R.style.left=Math.floor(p.x-this.triangleLeft.width)+"px",R.style.top=I.style.top,"eastwest"!=l.style.portConstraint&&(t.container.appendChild(L),t.container.appendChild(M)),t.container.appendChild(I),t.container.appendChild(R)}null!=l&&null!=(b=t.selectionCellsHandler.getHandler(l.cell))&&null!=b.setHandlesVisible&&b.setHandlesVisible(!1),A=!0}else for(c=[N,G,L,I,M,R],g=0;g<c.length;g++)null!=c[g].parentNode&&c[g].parentNode.removeChild(c[g]);A||null==b||b.setHandlesVisible(!0);var f=mxEvent.isAltDown(i)&&!mxEvent.isShiftDown(i)||null!=T&&D==P?null:mxDragSource.prototype.getDropTarget.apply(this,arguments),v=t.getModel();if(null!=f&&(null!=D||!t.isSplitTarget(f,C,i))){for(;null!=f&&!t.isValidDropTarget(f,C,i)&&v.isVertex(v.getParent(f));)f=v.getParent(f);(t.view.currentRoot==f||!t.isValidRoot(f)&&0==t.getModel().getChildCount(f)||t.isCellLocked(f)||v.isEdge(f))&&(f=null)}return f}),w.stopDrag=function(){mxDragSource.prototype.stopDrag.apply(this,arguments);for(var t=[N,G,P,L,I,M,R],e=0;e<t.length;e++)null!=t[e].parentNode&&t[e].parentNode.removeChild(t[e]);null!=S&&null!=b&&b.reset(),D=O=T=S=b=null},w},WfPanel.prototype.createDragPreview=function(t,e){var n=document.createElement("div");return n.style.border=this.dragPreviewBorder,n.style.width=t+"px",n.style.height=e+"px",n},WfPanel.prototype.createDropHandler=function(x,y,f,v){return f=null==f||f,mxUtils.bind(this,function(t,e,n,i,o,s){for(var l=s?null:mxEvent.isTouchEvent(e)||mxEvent.isPenEvent(e)?document.elementFromPoint(mxEvent.getClientX(e),mxEvent.getClientY(e)):mxEvent.getSource(e);null!=l&&l!=this.container;)l=l.parentNode;if(null==l&&t.isEnabled()){if(0<(x=t.getImportableCells(x)).length){t.stopEditing();var r=null!=n&&!mxEvent.isAltDown(e)&&t.isValidDropTarget(n,x,e),a=null;if(null==n||r||(n=null),!t.isCellLocked(n||t.getDefaultParent())){t.model.beginUpdate();try{if(i=Math.round(i),o=Math.round(o),y&&t.isSplitTarget(n,x,e)){var h=t.cloneCells(x);t.splitEdge(n,h,null,i-v.width/2,o-v.height/2),a=h}else 0<x.length&&(a=t.importCells(x,i,o,n));if(null!=t.layoutManager){var d=t.layoutManager.getLayout(n);if(null!=d)for(var u=t.view.scale,p=t.view.translate,m=(i+p.x)*u,c=(o+p.y)*u,g=0;g<a.length;g++)d.moveCell(a[g],m,c)}f&&t.fireEvent(new mxEventObject("cellsInserted","cells",a))}finally{t.model.endUpdate()}null!=a&&0<a.length&&(t.scrollCellToVisible(a[0]),t.setSelectionCells(a)),t.editAfterInsert&&null!=e&&mxEvent.isMouseEvent(e)&&null!=a&&1==a.length&&window.setTimeout(function(){t.startEditing(a[0])},0)}}mxEvent.consume(e)}})},WfPanel.prototype.addClickHandler=function(e,n,i){var t=this.editorUi.editor.graph,o=n.mouseDown,s=n.mouseMove,l=n.mouseUp,r=t.tolerance,a=null,h=this;n.mouseDown=function(t){o.apply(this,arguments),a=new mxPoint(mxEvent.getClientX(t),mxEvent.getClientY(t)),null!=this.dragElement&&(this.dragElement.style.display="none",mxUtils.setOpacity(e,50))},n.mouseMove=function(t){null!=this.dragElement&&"none"==this.dragElement.style.display&&null!=a&&(Math.abs(a.x-mxEvent.getClientX(t))>r||Math.abs(a.y-mxEvent.getClientY(t))>r)&&(this.dragElement.style.display="",mxUtils.setOpacity(e,100)),s.apply(this,arguments)},n.mouseUp=function(t){mxEvent.isPopupTrigger(t)||null!=this.currentGraph||null==this.dragElement||"none"!=this.dragElement.style.display||h.itemClicked(i,n,t,e),l.apply(n,arguments),mxUtils.setOpacity(e,100),a=null,h.currentElt=e}},WfPanel.prototype.itemClicked=function(t,e,n,i){var o=this.editorUi.editor.graph;if(o.container.focus(),mxEvent.isAltDown(n)){if(1==o.getSelectionCount()&&o.model.isVertex(o.getSelectionCell())){for(var s=null,l=0;l<t.length&&null==s;l++)o.model.isVertex(t[l])&&(s=l);null!=s&&(o.setSelectionCells(this.dropAndConnect(o.getSelectionCell(),t,mxEvent.isMetaDown(n)||mxEvent.isControlDown(n)?mxEvent.isShiftDown(n)?mxConstants.DIRECTION_WEST:mxConstants.DIRECTION_NORTH:mxEvent.isShiftDown(n)?mxConstants.DIRECTION_EAST:mxConstants.DIRECTION_SOUTH,s,n)),o.scrollCellToVisible(o.getSelectionCell()))}}else if(mxEvent.isShiftDown(n)&&!o.isSelectionEmpty())this.updateShapes(t[0],o.getSelectionCells()),o.scrollCellToVisible(o.getSelectionCell());else{var r=o.getFreeInsertPoint();r.x<50&&(r.x=50),r.y<50&&(r.y=50),t[0].isRowGroup&&(r.x=50,t[0].geometry.width=o.pageFormat.width-100),t[0].isColGroup&&(r.y=0),e.drop(o,n,null,r.x,r.y,!0),null!=this.editorUi.hoverIcons&&(mxEvent.isTouchEvent(n)||mxEvent.isPenEvent(n))&&this.editorUi.hoverIcons.update(o.view.getState(o.getSelectionCell()))}},WfPanel.prototype.updateShapes=function(t,e){var n=this.editorUi.editor.graph,i=n.getCellStyle(t),o=[];n.model.beginUpdate();try{for(var s=n.getModel().getStyle(t),l=["shadow","dashed","dashPattern","fontFamily","fontSize","fontColor","align","startFill","startSize","endFill","endSize","strokeColor","strokeWidth","fillColor","gradientColor","html","part","noEdgeStyle","edgeStyle","elbow","childLayout","recursiveResize","container","collapsible","connectable"],r=0;r<e.length;r++){var a=e[r];if(n.getModel().isVertex(a)==n.getModel().isVertex(t)||n.getModel().isEdge(a)==n.getModel().isEdge(t)){var h=n.view.getState(a),d=null!=h?h.style:n.getCellStyle(e[r]);if(n.getModel().setStyle(a,s),null!=h&&"1"==mxUtils.getValue(h.style,"composite","0"))for(var u=n.model.getChildCount(a);0<=u;u--)n.model.remove(n.model.getChildAt(a,u));if(null!=d){"umlLifeline"==d[mxConstants.STYLE_SHAPE]&&"umlLifeline"!=i[mxConstants.STYLE_SHAPE]&&(n.setCellStyles(mxConstants.STYLE_SHAPE,"umlLifeline",[a]),n.setCellStyles("participant",i[mxConstants.STYLE_SHAPE],[a]));for(u=0;u<l.length;u++){var p=d[l[u]];null!=p&&n.setCellStyles(l[u],p,[a])}}o.push(a)}}}finally{n.model.endUpdate()}return o},WfPanel.prototype.dropAndConnect=function(t,e,n,i,o){var s=this.getDropAndConnectGeometry(t,e[i],n,e),l=[];if(null!=s){var r=this.editorUi.editor.graph,a=null;r.model.beginUpdate();try{var h=r.getCellGeometry(t),d=r.getCellGeometry(e[i]),u=r.model.getParent(t),p=!0;if(null!=r.layoutManager){var m=r.layoutManager.getLayout(u);if(null!=m&&m.constructor==mxStackLayout)if(p=!1,null!=(l=r.view.getState(u))){var c=new mxPoint(l.x/r.view.scale-r.view.translate.x,l.y/r.view.scale-r.view.translate.y);s.x+=c.x,s.y+=c.y;var g=s.getTerminalPoint(!1);null!=g&&(g.x+=c.x,g.y+=c.y)}}var x=d.x,y=d.y;r.model.isEdge(e[i])&&(y=x=0);var f=r.model.isEdge(t)||null!=h&&!h.relative&&p;if(l=e=r.importCells(e,s.x-(f?x:0),s.y-(f?y:0),f?u:null),r.model.isEdge(t))r.model.setTerminal(t,e[i],n==mxConstants.DIRECTION_NORTH);else if(r.model.isEdge(e[i])){r.model.setTerminal(e[i],t,!0);var v=r.getCellGeometry(e[i]);if((v.points=null)!=v.getTerminalPoint(!1))v.setTerminalPoint(s.getTerminalPoint(!1),!1);else if(f&&r.model.isVertex(u)){var C=r.view.getState(u);c=C.cell!=r.view.currentRoot?new mxPoint(C.x/r.view.scale-r.view.translate.x,C.y/r.view.scale-r.view.translate.y):new mxPoint(0,0);r.cellsMoved(e,c.x,c.y,null,null,!0)}}else d=r.getCellGeometry(e[i]),x=s.x-Math.round(d.x),y=s.y-Math.round(d.y),s.x=Math.round(d.x),s.y=Math.round(d.y),r.model.setGeometry(e[i],s),r.cellsMoved(e,x,y,null,null,!0),l=e.slice(),a=1==l.length?l[0]:null,e.push(r.insertEdge(null,null,"",t,e[i],r.createCurrentEdgeStyle()));r.fireEvent(new mxEventObject("cellsInserted","cells",e))}finally{r.model.endUpdate()}r.editAfterInsert&&null!=o&&mxEvent.isMouseEvent(o)&&null!=a&&window.setTimeout(function(){r.startEditing(a)},0)}return l},WfPanel.prototype.getDropAndConnectGeometry=function(t,e,n,i){var o=this.editorUi.editor.graph,s=o.view,l=1<i.length,r=o.getCellGeometry(t),a=o.getCellGeometry(e);if(null!=r&&null!=a)if(a=a.clone(),o.model.isEdge(t)){var h=(p=o.view.getState(t)).absolutePoints,d=h[0],u=h[h.length-1];n==mxConstants.DIRECTION_NORTH?(a.x=d.x/s.scale-s.translate.x-a.width/2,a.y=d.y/s.scale-s.translate.y-a.height/2):(a.x=u.x/s.scale-s.translate.x-a.width/2,a.y=u.y/s.scale-s.translate.y-a.height/2)}else{if(r.relative){var p=o.view.getState(t);(r=r.clone()).x=(p.x-s.translate.x)/s.scale,r.y=(p.y-s.translate.y)/s.scale}var m=o.defaultEdgeLength;if(o.model.isEdge(e)&&null!=a.getTerminalPoint(!0)&&null!=a.getTerminalPoint(!1)){d=a.getTerminalPoint(!0);var c=(u=a.getTerminalPoint(!1)).x-d.x,g=u.y-d.y;m=Math.sqrt(c*c+g*g),a.x=r.getCenterX(),a.y=r.getCenterY(),a.width=1,a.height=1,n==mxConstants.DIRECTION_NORTH?(a.height=m,a.y=r.y-m,a.setTerminalPoint(new mxPoint(a.x,a.y),!1)):n==mxConstants.DIRECTION_EAST?(a.width=m,a.x=r.x+r.width,a.setTerminalPoint(new mxPoint(a.x+a.width,a.y),!1)):n==mxConstants.DIRECTION_SOUTH?(a.height=m,a.y=r.y+r.height,a.setTerminalPoint(new mxPoint(a.x,a.y+a.height),!1)):n==mxConstants.DIRECTION_WEST&&(a.width=m,a.x=r.x-m,a.setTerminalPoint(new mxPoint(a.x,a.y),!1))}else if(!l&&45<a.width&&45<a.height&&45<r.width&&45<r.height&&(a.width=a.width*(r.height/a.height),a.height=r.height),a.x=r.x+r.width/2-a.width/2,a.y=r.y+r.height/2-a.height/2,n==mxConstants.DIRECTION_NORTH?a.y=a.y-r.height/2-a.height/2-m:n==mxConstants.DIRECTION_EAST?a.x=a.x+r.width/2+a.width/2+m:n==mxConstants.DIRECTION_SOUTH?a.y=a.y+r.height/2+a.height/2+m:n==mxConstants.DIRECTION_WEST&&(a.x=a.x-r.width/2-a.width/2-m),o.model.isEdge(e)&&null!=a.getTerminalPoint(!0)&&null!=e.getTerminal(!1)){var x=o.getCellGeometry(e.getTerminal(!1));null!=x&&(n==mxConstants.DIRECTION_NORTH?(a.x-=x.getCenterX(),a.y-=x.getCenterY()+x.height/2):n==mxConstants.DIRECTION_EAST?(a.x-=x.getCenterX()-x.width/2,a.y-=x.getCenterY()):n==mxConstants.DIRECTION_SOUTH?(a.x-=x.getCenterX(),a.y-=x.getCenterY()-x.height/2):n==mxConstants.DIRECTION_WEST&&(a.x-=x.getCenterX()+x.width/2,a.y-=x.getCenterY()))}}return a},WfPanel.prototype.showTooltip=function(m,c,g,x,y,f){if(this.enableTooltips&&this.showTooltips&&this.currentElt!=m){null!=this.thread&&(window.clearTimeout(this.thread),this.thread=null);var t=mxUtils.bind(this,function(){null==this.tooltip&&(this.tooltip=document.createElement("div"),this.tooltip.className="geSidebarTooltip",this.tooltip.style.zIndex=mxPopupMenu.prototype.zIndex-1,document.body.appendChild(this.tooltip),this.graph2=new Graph(this.tooltip,null,null,this.editorUi.editor.graph.getStylesheet()),this.graph2.resetViewOnRootChange=!1,this.graph2.foldingEnabled=!1,this.graph2.gridEnabled=!1,this.graph2.autoScroll=!1,this.graph2.setTooltips(!1),this.graph2.setConnectable(!1),this.graph2.setEnabled(!1),mxClient.IS_SVG||(this.graph2.view.canvas.style.position="relative"),this.tooltipImage=mxUtils.createImage(this.tooltipImage),this.tooltipImage.className="geSidebarTooltipImage",this.tooltipImage.style.zIndex=mxPopupMenu.prototype.zIndex-1,this.tooltipImage.style.position="absolute",this.tooltipImage.style.width="14px",this.tooltipImage.style.height="27px"),this.graph2.model.clear(),this.graph2.view.setTranslate(this.tooltipBorder,this.tooltipBorder),g>this.maxTooltipWidth||x>this.maxTooltipHeight?this.graph2.view.scale=Math.round(100*Math.min(this.maxTooltipWidth/g,this.maxTooltipHeight/x))/100:this.graph2.view.scale=1,this.tooltip.style.display="block",this.graph2.labelsVisible=null==f||f;var t=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject,this.graph2.addCells(c),mxClient.NO_FO=t;var e=this.graph2.getGraphBounds(),n=e.width+2*this.tooltipBorder+4,i=e.height+2*this.tooltipBorder;if(mxClient.IS_QUIRKS?(i+=4,this.tooltip.style.overflow="hidden"):this.tooltip.style.overflow="visible",this.tooltipImage.style.visibility="visible",this.tooltip.style.width=n+"px",this.tooltipTitles&&null!=y&&0<y.length){null==this.tooltipTitle?(this.tooltipTitle=document.createElement("div"),this.tooltipTitle.style.borderTop="1px solid gray",this.tooltipTitle.style.textAlign="center",this.tooltipTitle.style.width="100%",this.tooltipTitle.style.overflow="hidden",this.tooltipTitle.style.position="absolute",this.tooltipTitle.style.paddingTop="6px",this.tooltipTitle.style.bottom="6px",this.tooltip.appendChild(this.tooltipTitle)):this.tooltipTitle.innerHTML="",this.tooltipTitle.style.display="",mxUtils.write(this.tooltipTitle,y);var o=this.tooltipTitle.offsetHeight+10;i+=o,mxClient.IS_SVG?this.tooltipTitle.style.marginTop=2-o+"px":(i-=6,this.tooltipTitle.style.top=i-o+"px")}else null!=this.tooltipTitle&&null!=this.tooltipTitle.parentNode&&(this.tooltipTitle.style.display="none");this.tooltip.style.height=i+"px";var s=-Math.round(e.x-this.tooltipBorder),l=-Math.round(e.y-this.tooltipBorder),r=document.body,a=document.documentElement,h=this.getTooltipOffset(),d=Math.max(r.clientHeight||0,a.clientHeight),u=this.container.clientWidth+this.editorUi.splitSize+3+this.editorUi.container.offsetLeft+h.x,p=Math.min(d-i-20,Math.max(0,this.editorUi.container.offsetTop+this.container.offsetTop+m.offsetTop-this.container.scrollTop-i/2+16))+h.y;mxClient.IS_SVG?0!=s||0!=l?this.graph2.view.canvas.setAttribute("transform","translate("+s+","+l+")"):this.graph2.view.canvas.removeAttribute("transform"):(this.graph2.view.drawPane.style.left=s+"px",this.graph2.view.drawPane.style.top=l+"px"),this.tooltip.style.position="absolute",this.tooltip.style.top=p+100+"px",this.tooltipImage.style.left=u-13+"px",this.tooltipImage.style.top=p+i/2-13+"px"});null!=this.tooltip&&"none"!=this.tooltip.style.display?t():this.thread=window.setTimeout(t,this.tooltipDelay),this.currentElt=m}},WfPanel.prototype.getTooltipOffset=function(){return new mxPoint(0,0)},WfNodeInfo.prototype.drawHeader=function(){var t,e=this.editorUi.editor.graph.getSelectionCells(),n=wfGetLabel(32210,"流程信息");1==e.length&&(e[0].isGroupArea||e[0].isHelpfulText||(n=e[0].edge?wfGetLabel(15606,"出口信息"):wfGetLabel(15615,"节点信息"))),document.getElementById("nodeInfo-header")?(t=document.getElementById("nodeInfo-header")).innerHTML=n:((t=document.createElement("div")).id="nodeInfo-header",t.style.position="relative",t.style.zIndex="11",t.innerHTML=n,this.container.appendChild(t))},WfNodeInfo.prototype.refresh=function(){this.editorUi.editor.graph.getSelectionCell();this.editorUi.isFromWfForm||(this.drawHeader(),this.drawFoder(),this.nodeActions())},WfNodeInfo.prototype.clearSelectionState=function(){this.selectionState=null},WfNodeInfo.prototype.getSelectionState=function(){return null==this.selectionState&&(this.selectionState=this.createSelectionState()),this.selectionState},WfNodeInfo.prototype.createSelectionState=function(){this.editorUi.editor.graph.getSelectionCells();return this.initSelectionState()},WfNodeInfo.prototype.initSelectionState=function(){return{vertices:[],edges:[],x:null,y:null,width:null,height:null,style:{},containsImage:!1,containsLabel:!1,fill:!0,glass:!0,rounded:!0,comic:!0,autoSize:!1,image:!0,shadow:!0,lineJumps:!0}},WfNodeInfo.prototype.nodeActions=function(){var t=this.editorUi.editor.graph,e=(t.workflowDetailDatas,t.getSelectionCells());jQuery(".ant-dropdown").addClass("ant-dropdown-hidden"),mxClient.IS_IE||null==window.console||console.log(e,"celsss");var n=!1,i=!1;null!=document.getElementById("nodeInfo-detail-shouldSaveFirst")&&this.container.removeChild(document.getElementById("nodeInfo-detail-shouldSaveFirst"));for(var o=0;o<e.length;++o)e[o].isGroupArea&&t.orderCells(!0),e[o]instanceof mxCell&&1==e.length&&!e[o].isGroupArea&&!e[o].isHelpfulText&&(e[o].nodeId||e[o].linkId?(null!=document.getElementById("nodeInfo-no-node1")&&this.container.removeChild(document.getElementById("nodeInfo-no-node1")),this.drawNodeDetail()):i=!0,n=!0);if(n||this.renderWorkdlowItem(),n&&i){if(this.renderWorkdlowItem(),null!=document.getElementById("nodeInfo-detail-shouldSaveFirst")){var s=document.getElementById("nodeInfo-detail-shouldSaveFirst");this.container.removeChild(s)}if(null!=document.getElementById("nodeInfo-detail-nodeLinkDetail"))document.getElementById("nodeInfo-detail-nodeLinkDetail").style.display="none";var l=document.createElement("p");l.id="nodeInfo-detail-shouldSaveFirst",l.innerHTML=wfGetLabel(390419,"温馨提示:需要先保存流程图才能对新增节点和出口进行详细属性设置!"),this.container.appendChild(l)}if((!n||i)&&document.getElementById("nodeName-container")){var r=document.getElementById("nodeName-container");r&&r.parentNode.removeChild(r)}},WfNodeInfo.prototype.renderWorkdlowItem=function(){var t=this.editorUi.editor.graph.workflowDetailDatas,e=document.getElementById("nodeInfo-no-node1");null!=document.getElementById("nodeInfo-node-detail")&&(document.getElementById("nodeInfo-node-detail").style.display="none");if(null==e){e=document.createElement("p");var n=document.createElement("span"),i=document.createElement("div");e.id="nodeInfo-no-node1",e.className="nodeInfo-detail-item",n.className="detail-item-left detail-item-span",i.className="detail-item-right detail-item-span",e.appendChild(n),e.appendChild(i),n.innerHTML=wfGetLabel(81651,"路径名称"),i.innerHTML=t&&t.workflowDatas&&t.workflowDatas.workflowName||"workflowName",this.container.appendChild(e)}else e.childNodes[1].innerHTML=t&&t.workflowDatas&&t.workflowDatas.workflowName||"workflowName"},WfNodeInfo.prototype.drawNodeDetail=function(){var t=this.editorUi.editor.graph,e=t.view,n=t.workflowDetailDatas,i=t.getSelectionCell(),o=(e.getState(i),!1),s={};if((this.preCells=i).edge&&(o=!0),null!=i.nodeId&&!0,null!=n){var l=null;for(var r in l=o?n.linkDatas||{}:n.nodeDatas||{})(!o&&r==i.nodeId||o&&r==i.linkId)&&(s=l[r])}if(null!=document.getElementById("nodeInfo-node-detail")){var a=document.getElementById("nodeInfo-node-detail");this.container.removeChild(a)}var h=[{label:wfGetLabel(15070,"节点名称"),value:"",key:"name"},{label:wfGetLabel(99,"操作者"),value:"",key:"operators"},{label:wfGetLabel(33473,"表单内容"),value:"",key:"formContent"},{label:wfGetLabel(16380,"操作菜单"),value:"",key:"hasCusRigKey"},{label:wfGetLabel(18009,"节点前附加操作"),value:"",key:"hasNodeBefAddOpr"},{label:wfGetLabel(18010,"节点后附加操作"),value:"",key:"hasNodeAftAddOpr"},{label:wfGetLabel(33483,"签字意见设置"),value:"",key:"hasOperateSign"},{label:wfGetLabel(33482,"标题显示设置"),value:"",key:"hasOperateTitle"},{label:wfGetLabel(21584,"子流程设置"),value:"",key:"hasOperateSubwf"},{label:wfGetLabel(390420,"流程异常处理"),value:"",key:"hasOperateException"},{label:wfGetLabel(387604,"类型"),value:"",key:"changeNodeType"},{label:"指定流转",value:"",key:"selectNextFlow"}];o||1!==n.workflowDatas.isOpenOverTime||1!=i.nodeType&&2!=i.nodeType||h.push({label:wfGetLabel(18818,"超时设置"),value:"",key:"overtimeSet"}),!i.nodeAttriBute||3!=i.nodeAttriBute&&4!=i.nodeAttriBute&&5!=i.nodeAttriBute||(h.push({label:wfGetLabel(390421,"合并类型"),value:"",key:"branchToOneType"}),h.push({label:5==i.nodeAttriBute?wfGetLabel(390422,"通过比例(%)"):4==i.nodeAttriBute?wfGetLabel(390423,"指定通过分支"):wfGetLabel(21396,"通过分支数合并"),value:"",key:"branchToOneSubType"}));var d=[{label:wfGetLabel(15611,"出口名称"),value:"",key:"name"},{label:wfGetLabel(15074,"目标节点"),value:"",key:"targetCell"},{label:wfGetLabel(20576,"生成编号"),value:"",key:"isBuildCode"},{label:wfGetLabel(15364,"条件"),value:"",key:"hasCondition"},{label:wfGetLabel(15610,"附加规则"),value:"",key:"hasRole"},{label:wfGetLabel(21642,"出口提示信息"),value:"",key:"remindMsg"}];o&&i.source&&"1"==i.source.nodeType&&d.splice(2,0,{label:wfGetLabel(15075,"是否退回"),value:"",key:"linkNeedBack"}),!o&&n.workflowDatas.isModifyLog&&h.splice(9,0,{label:wfGetLabel(33485,"表单日志查看范围"),value:"",key:"formLogViewRange"}),!o&&n.workflowDatas.isSecondAuth&&h.push({label:wfGetLabel(506288,"二次认证设置"),value:"",key:"hasSecondAuth"});var u,p=o?d:h,m=document.createElement("div");m.id="nodeInfo-node-detail",(u=document.createElement("div")).id="nodeInfo-detail-nodeLinkDetail";for(r=0;r<p.length;++r){var c=this.createNodeItem(o,p[r],s,i);c&&u.appendChild(c)}m.appendChild(u),this.container.appendChild(m),jQuery("#nodeInfo-detail-nodeLinkDetail").bind("scroll",function(t){jQuery("#nodeName-container").css("top",47-jQuery("#nodeInfo-detail-nodeLinkDetail").scrollTop())})},WfNodeInfo.prototype.createNodeItem=function(t,e,n,i){var o=document.createElement("p"),s=document.createElement("span"),l=document.createElement("div");if(o.className="nodeInfo-detail-item",s.className="detail-item-left detail-item-span",l.className="detail-item-right detail-item-span "+("operators"===e.key||"name"===e.key||"targetCell"===e.key||"isBuildCode"===e.key||"remindMsg"===e.key||"changeNodeType"===e.key||"branchToOneType"===e.key||"branchToOneSubType"===e.key?"isEcComs-item":""),"changeNodeType"===e.key){if(1!=i.nodeType&&2!=i.nodeType&&1!=i.nodeAttriBute&&2!=i.nodeAttriBute&&(3!=i.nodeType||3!=i.nodeAttriBute&&4!=i.nodeAttriBute&&5!=i.nodeAttriBute))return!1;(d=document.createElement("div")).id="changeNodeType-container",l.appendChild(d);var r=this;setTimeout(function(){r.createChangeNodeTypeElement(t,e.key,n,i)},0)}if("name"===e.key){document.getElementById("nodeName-container")?((d=document.getElementById("nodeName-container")).style.display="block",d.style.top="47px"):((d=document.createElement("div")).id="nodeName-container",d.style.position="absolute",d.style.zIndex="10",d.style.top="47px",d.style.right="10px",d.style.width="110px",this.container.appendChild(d)),this.nodePanelHide&&(d.style.visibility="hidden");r=this;setTimeout(function(){r.createNodeNameElement(t,e.key,n,i)},0)}else if("operators"===e.key){(d=document.createElement("div")).id="operators-container",l.appendChild(d);r=this;setTimeout(function(){r.createOperatorElement(t,e.key,n,i)},0)}else if("branchToOneType"===e.key){var a=document.createElement("div");a.id="branchToOneType-container",l.appendChild(a);r=this;setTimeout(function(){r.createBranchToOneTypeElement(t,e.key,n,i)},0)}else if("branchToOneSubType"===e.key){var h=document.createElement("div");h.id="branchToOneSubType-container",l.appendChild(h);r=this;setTimeout(function(){r.createBranchToOneTypeSubElement(t,e.key,n,i)},0)}else if("targetCell"===e.key){(d=document.createElement("div")).id="targetCell-container",l.appendChild(d);r=this;setTimeout(function(){r.createTargetNodeElement(t,e.key,n,i)},0)}else if("isBuildCode"===e.key){(d=document.createElement("div")).id="isBuildCode-container",l.appendChild(d);r=this;setTimeout(function(){r.createBuildCodeElement(t,e.key,n,i)},0)}else if("linkNeedBack"===e.key){(d=document.createElement("div")).id="linkNeedBack-container",l.appendChild(d);r=this;setTimeout(function(){r.createLinkNeedBackElement(t,e.key,n,i)},0)}else if("remindMsg"===e.key){var d;(d=document.createElement("div")).id="remindMsg-container",l.appendChild(d);r=this;setTimeout(function(){r.createRemindMsgElement(t,e.key,n,i)},0)}else if("formContent"===e.key){var u=document.createElement("a");u.innerHTML=n[e.key],u.onclick=this.createDetailDialog.bind(this,e.key,e.label,i.nodeId?i.nodeId:i.linkId,"","",t),l.appendChild(u)}else{var p;if("changeNodeType"!==e.key)if((p=document.createElement("span")).className="icon-workflow-shezhi",p.onclick=this.createDetailDialog.bind(this,e.key,e.label,i.nodeId?i.nodeId:i.linkId,"","",t),l.appendChild(p),"true"==n[e.key]||"formLogViewRange"==e.key)(p=document.createElement("span")).className="icon-workflow-duigou",l.appendChild(p)}return s.innerHTML=e.label,o.appendChild(s),o.appendChild(l),o},WfNodeInfo.prototype.createBranchToOneTypeElement=function(t,e,n,i){this.editorUi.editor.graph.model;for(var o=window.ecCom.WeaSelect,s=[{key:"3",selected:3==i.nodeAttriBute,showname:wfGetLabel(390424,"通过分支数")},{key:"4",selected:4==i.nodeAttriBute,showname:wfGetLabel(390423,"指定通过分支")},{key:"5",selected:5==i.nodeAttriBute,showname:wfGetLabel(126603,"比例合并")}],l=this,r=i.edges||[],a=2,h=0;h<r.length;++h)null!=r[h].linkId&&null!=r[h].linkId&&""!=r[h].linkId||(a=1);ReactDOM.render(React.createElement(o,{viewAttr:a,options:s,onChange:function(t,e){i.nodeAttriBute=t,l.refresh()}}),document.getElementById("branchToOneType-container"))},WfNodeInfo.prototype.createBranchToOneTypeSubElement=function(t,e,n,i){var o=this.editorUi.editor.graph,s=(o.model,window.ecCom.WeaSelect),l=window.ecCom.WeaInput,r=[];if(4==i.nodeAttriBute&&i.edges&&0<i.edges.length)for(var a=i.edges,h=0;h<a.length;++h)if(a[h].target.id==i.id){var d={key:a[h].id,selected:!1,showname:a[h].value||wfGetLabel(15587,"出口")+a[h].id};r.push(d)}if(4==i.nodeAttriBute&&i.targetBranchValue&&-1<i.targetBranchValue.indexOf("link_")){var u=i.targetBranchValue.split(","),p=[];for(h=0;h<u.length;++h)p.push(Number(u[h].split("_")[1]));var m=[],c=o.view.scale,g=o.minimumGraphSize.x||0,x=o.minimumGraphSize.y||0,y=o.minimumGraphSize.width*c||1e5,f=o.minimumGraphSize.height*c||1e5,v=o.getAllCells(g,x,y,f);for(h=0;h<v.length;++h)v[h].edge&&-1<p.indexOf(Number(v[h].linkId))&&m.push(v[h].id);i.targetBranchValue=m.join(",")}a=i.edges||[];var C=2;for(h=0;h<a.length;++h)null!=a[h].linkId&&null!=a[h].linkId&&""!=a[h].linkId||(C=1);var E=4==i.nodeAttriBute?s:l,w=4==i.nodeAttriBute?{multiple:!0,viewAttr:C,value:i.targetBranchValue||"",options:r,onChange:function(t,e){i.targetBranchValue=t}}:{viewAttr:C,value:3==i.nodeAttriBute?i.passBranchNum||"0":i.proportMerge||"0",onChange:function(t){100<t&&(t=100),3==i.nodeAttriBute?i.passBranchNum=t:i.proportMerge=t}};ReactDOM.render(React.createElement(E,w),document.getElementById("branchToOneSubType-container"))},WfNodeInfo.prototype.createChangeNodeTypeElement=function(t,e,n,a){var i=this.editorUi.editor.graph,h=i.model,o=window.ecCom.WeaSelect,s=i.view.scale,l=i.minimumGraphSize.x||0,r=i.minimumGraphSize.y||0,d=i.minimumGraphSize.width*s||1e5,u=i.minimumGraphSize.height*s||1e5,p=i.getAllCells(l,r,d,u),m=[{key:"2",selected:2==a.nodeType,showname:wfGetLabel(553,"处理")},{key:"1",selected:1==a.nodeType,showname:wfGetLabel(83518,"审批")}];1==a.nodeAttriBute?m.unshift({key:"0",selected:0==a.nodeType,showname:wfGetLabel(125,"创建")}):3!=a.nodeAttriBute&&4!=a.nodeAttriBute&&5!=a.nodeAttriBute||m.unshift({key:"3",selected:3==a.nodeType,showname:wfGetLabel(251,"归档")});for(var c=a.edges||[],g=2,x=0;x<c.length;++x)null!=c[x].linkId&&null!=c[x].linkId&&""!=c[x].linkId||(g=1);ReactDOM.render(React.createElement(o,{viewAttr:g,options:m,onChange:function(t,e){for(var n=!1,i=0;i<p.length;++i)p[i].edge||0!=p[i].nodeType||(n=!0);if(n&&0==t)wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390412,"只能有一个创建节点!"),okText:wfGetLabel(83446,"确定"),onOk:function(){}});else{var o="",s=new mxGeometry(a.geometry.x,a.geometry.y,a.geometry.width,a.geometry.height);h.beginUpdate();try{if(1==t&&1!=a.nodeType){-1!=a.style.indexOf("rounded=0;")?o=a.style.replace(/rounded=0;/,"rhombus;"):-1!=a.style.indexOf("shape=ellipse;")&&(o=a.style.replace(/shape=ellipse;/,"rhombus;"));var l=o.split(";");s.height=100,s.width=110;for(i=0;i<l.length;++i){if(0<=l[i].indexOf("icon-workflow-ceshi")&&0<=l[i].indexOf("icon-workflow-fencha")||0<=l[i].indexOf("icon-workflow-tingzhi")&&0<=l[i].indexOf("icon-workflow-hebing"))delete(r=JSON.parse(l[i].split("=")[1])).right,l[i]="icons="+JSON.stringify(r)}}else if(2==t&&2!=a.nodeType){s.height=70,s.width=108,-1!=a.style.indexOf("rhombus;")?o=a.style.replace(/rhombus;/,"rounded=0;"):-1!=a.style.indexOf("shape=ellipse;")&&(o=a.style.replace(/shape=ellipse;/,"rounded=0;"));for(l=o.split(";"),i=0;i<l.length;++i){if(0<=l[i].indexOf("icon-workflow-ceshi")&&0<=l[i].indexOf("icon-workflow-fencha")||0<=l[i].indexOf("icon-workflow-tingzhi")&&0<=l[i].indexOf("icon-workflow-hebing"))delete(r=JSON.parse(l[i].split("=")[1])).right,l[i]="icons="+JSON.stringify(r)}}else if(0==t&&0!=a.nodeType){s.height=93,s.width=93,-1!=a.style.indexOf("rounded=0;")?o=a.style.replace(/rounded=0;/,"shape=ellipse;"):-1!=a.style.indexOf("rhombus;")&&(o=a.style.replace(/rhombus;/,"shape=ellipse;"));for(l=o.split(";"),i=0;i<l.length;++i){if(0<=l[i].indexOf("icons"))(r=JSON.parse(l[i].split("=")[1])).left="icon-workflow-fencha",r.right="icon-workflow-ceshi",l[i]="icons="+JSON.stringify(r)}}else if(3==t&&3!=a.nodeType){s.height=93,s.width=93,-1!=a.style.indexOf("rounded=0;")?o=a.style.replace(/rounded=0;/,"shape=ellipse;"):-1!=a.style.indexOf("rhombus;")&&(o=a.style.replace(/rhombus;/,"shape=ellipse;"));for(l=o.split(";"),i=0;i<l.length;++i){var r;if(0<=l[i].indexOf("icons"))(r=JSON.parse(l[i].split("=")[1])).left="icon-workflow-hebing",r.right="icon-workflow-tingzhi",l[i]="icons="+JSON.stringify(r)}}h.setNodeType(a,t),h.setStyle(a,l.join(";")),h.setGeometry(a,s)}finally{h.endUpdate()}}}}),document.getElementById("changeNodeType-container"))},WfNodeInfo.prototype.createTargetNodeElement=function(t,e,n,i){for(var o=this.editorUi.editor.graph,s=o.model,l=window.ecCom.WeaSelect,r=o.view.scale,a=o.minimumGraphSize.x||0,h=o.minimumGraphSize.y||0,d=o.minimumGraphSize.width*r||1e5,u=o.minimumGraphSize.height*r||1e5,p=o.getAllCells(a,h,d,u),m=[],c=0;c<p.length;++c)p[c].isGroupArea||p[c].isHelpfulText||(2!=i.source.nodeAttriBute||p[c].edge?3!=i.source.nodeAttriBute&&4!=i.source.nodeAttriBute&&5!=i.source.nodeAttriBute||p[c].edge?p[c].edge||2==p[c].nodeAttriBute&&2!=i.source.nodeAttriBute&&2!=i.target.nodeAttriBute||m.push(p[c]):2!=p[c].nodeAttriBute&&m.push(p[c]):2!=p[c].nodeAttriBute&&3!=p[c].nodeAttriBute&&4!=p[c].nodeAttriBute&&5!=p[c].nodeAttriBute||m.push(p[c]));var g=[];for(c=0;c<m.length;++c){var x={};x.key=""+m[c].id,x.selected=m[c].id==i.target.id,x.showname=wfFormatMultiLang(m[c].value),g.push(x)}var y=this;ReactDOM.render(React.createElement(l,{options:g,onChange:function(n,t){wfModal.confirm({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390408,"确定要将出口:")+i.value+wfGetLabel(390409,"的目标节点从")+i.target.value+wfGetLabel(21623,"改为")+t+wfGetLabel(82179,"吗?"),okText:wfGetLabel(83446,"确定"),cancelText:wfGetLabel(31129,"取消"),onOk:function(){for(var t=[],e=0;e<m.length;++e)m[e].id==n&&t.push(m[e]);s.beginUpdate();try{o.cellConnected(i,t[0],!1,{name:"",perimeter:!0,point:{x:0,y:.5}})}finally{s.endUpdate()}},onCancel:function(){y.refresh()}})}}),document.getElementById("targetCell-container"))},WfNodeInfo.prototype.createLinkNeedBackElement=function(t,e,n,i){this.editorUi.editor.graph.model;var o=window.ecCom.WeaCheckbox;ReactDOM.render(React.createElement(o,{value:!!i.isreject&&i.isreject,onChange:function(t){i.isreject=t}}),document.getElementById("linkNeedBack-container"))},WfNodeInfo.prototype.createBuildCodeElement=function(t,e,n,i){this.editorUi.editor.graph.model;var o=window.ecCom.WeaCheckbox;ReactDOM.render(React.createElement(o,{value:i.isBuildCode?i.isBuildCode:"true"==n[e],onChange:function(t){i.isBuildCode=t}}),document.getElementById("isBuildCode-container"))},WfNodeInfo.prototype.createRemindMsgElement=function(t,e,n,i){this.editorUi.editor.graph.model;var o=window.ecCom.WeaInput;ReactDOM.render(React.createElement(o,{viewAttr:2,value:i.exitInfo?i.exitInfo:n[e],inputType:"multilang",isBase64:!0,layout:document.getElementById("remindMsg-container"),onBlur:function(t){i.exitInfo=t}}),document.getElementById("remindMsg-container"))},WfNodeInfo.prototype.noNeedRefresh=!1,WfNodeInfo.prototype.createNodeNameElement=function(e,t,n,i){var o=this.editorUi.editor.graph.model,s=window.ecCom.WeaInput,l=this;e&&!i.value&&(i.value=wfGetLabel(15587,"出口")+i.id),ReactDOM.render(React.createElement(s,{viewAttr:3,value:i.value?i.value:n[t],inputType:"multilang",isBase64:!0,layout:document.getElementById("nodeName-container"),customBlur:function(t){if(""==wfFormatMultiLang(t).trim())wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:e?wfGetLabel(390417,"当前语言出口名称不能为空!"):wfGetLabel(390418,"当前语言节点名称不能为空!"),okText:wfGetLabel(83446,"确定"),onOk:function(){jQuery("#nodeName-container .ant-input").val(wfFormatMultiLang(i.value))}});else{o.beginUpdate();try{o.setValue(i,t)}finally{o.endUpdate()}}},onBlur:function(t){},ref:function(t){l.nodeNameRef=t}}),document.getElementById("nodeName-container"))},WfNodeInfo.prototype.createOperatorElement=function(t,e,n,i){for(var o=window.ecCom.WeaBrowser,s=0;s<n.operatorGroups.length;++s)n.operatorGroups[s].name="<a onclick=\"window.workflowUi.wfNodeInfo.createDetailDialog('operator','"+wfGetLabel(15072,"操作组")+"','"+i.nodeId+"','"+i.nodeType+"','"+n.operatorGroups[s].id+"',"+t+')">'+wfFormatMultiLang(n.operatorGroups[s].name)+"</a>";var l=this;ReactDOM.render(React.createElement(o,{viewAttr:1,hasAddBtn:!0,isSingle:!1,replaceDatas:n.operatorGroups||[],whiteBackground:!0,hasBorder:!0,addOnClick:function(){l.createDetailDialog("operator",wfGetLabel(15072,"操作组"),i.nodeId,i.nodeType,"-1",t)},layout:document.body}),document.getElementById("operators-container"))},WfNodeInfo.prototype.drawFoder=function(){var t;document.getElementById("nodeInfo-panel-folder")||((t=document.createElement("div")).id="nodeInfo-panel-folder",t.className="nodeInfo-panel-close",this.container.appendChild(t),t.onclick=this.clickNodeFolder.bind(this,t))},WfNodeInfo.prototype.clickNodeFolder=function(t){var e=this.editorUi.wfEditor,n=(this.editorUi.diagramContainer,this.editorUi.wfPanelContainer),i=this.editorUi.editor.graph;i.model;this.nodePanelHide=!this.nodePanelHide;var o=document.getElementById("workflow-test-detail-panel"),s=document.getElementById("test-panel-split");o&&(this.nodePanelHide?o.style.width="100%":o.style.width="calc(100% - 250px)"),s&&(this.nodePanelHide?s.style.right="0":s.style.right="250px");try{var l=document.getElementById("wf-row-rule-canvas"),r=(document.getElementById("wf-col-rule-canvas"),e.container);this.nodePanelHide?(document.getElementById("nodeName-container")&&(document.getElementById("nodeName-container").style.display="none"),e.container.style.width="100%",n.style.top=r.clientHeight+"px",n.style.width="100%",l&&(l.width=n.clientWidth),i.pageFormat.width=window.innerWidth-(i.isRuleEnabled()?30:18),this.container.style.right="-240px",this.container.style.zIndex=14,t.style.left="-18px",t.className="nodeInfo-panel-open"):(document.getElementById("nodeName-container")&&(document.getElementById("nodeName-container").style.display="block",document.getElementById("nodeName-container").style.visibility="visible"),this.container.style.zIndex=10,this.container.style.right="0",t.style.left="-2px",t.className="nodeInfo-panel-close",e.container.style.width="calc(100% - 240px)",n.style.width="calc(100% - 240px)",n.style.top=r.clientHeight+"px",l&&(l.width=n.clientWidth),i.pageFormat.width=window.innerWidth-(i.isRuleEnabled()?270:258)),i.pageFormat.height=window.innerHeight-r.clientHeight-(i.isRuleEnabled()?32:18),i.refresh()}finally{}};var workflowDesignE9_dialog,workflowDesignE9_dialog_params={};function workflowDesign_callback(t,e,n){jQuery(".ant-message").remove(),jQuery(".ant-modal-mask"),wfMessage.destroy();var i;if(i=workflowDesignE9_dialog_params.hasOwnProperty("linkId")?(!1,workflowDesignE9_dialog_params.linkId):workflowDesignE9_dialog_params.nodeId,"operator"==t){var o=window.urlParams.workflowId||"";mxUtils.post(WORKFLOW_GETDETAILINFO_PATH,"workflowId="+o,function(t){var e=t.request.responseText,n=JSON.parse(e);workflowUi.editor.graph.workflowDetailDatas=n,workflowUi.wfNodeInfo.refresh()})}else{var s=workflowUi.editor.graph.workflowDetailDatas;if("showpreaddinoperate"==t)s.nodeDatas[i].hasNodeBefAddOpr=e,checkIsChangCellIcon(workflowDesignE9_dialog_params.nowCell,e,"beforeNode");else if("showaddinoperate_node"==t){s.nodeDatas[i].hasNodeAftAddOpr=e,checkIsChangCellIcon(workflowDesignE9_dialog_params.nowCell,e,"nodeAfter")}else"showNodeAttrOperate_sign"==t?s.nodeDatas[i].hasOperateSign=e:"showNodeAttrOperate_title"==t?s.nodeDatas[i].hasOperateTitle=e:"showNodeAttrOperate_subWorkflow"==t?s.nodeDatas[i].hasOperateSubwf=e:"showNodeAttrOperate_exceptionhandle"==t?s.nodeDatas[i].hasOperateException=e:"formContent"==t?s.nodeDatas[i].formContent=e:"showButtonNameOperate"==t?s.nodeDatas[i].hasCusRigKey=e:"showaddinoperate_link"==t?s.linkDatas[i].hasRole=e:"hasCondition"==t?s.linkDatas[i].hasCondition=""!=e?"true":"false":"overtimeSet"==t?s.nodeDatas[i].overtimeSet=e?"true":"false":"selectNextFlow"==t?s.nodeDatas[i].selectNextFlow=e?"true":"false":"hasSecondAuth"==t&&(s.nodeDatas[i].hasSecondAuth=e);workflowUi.editor.graph.workflowDetailDatas=s,workflowUi.wfNodeInfo.refresh()}"formContent"!=t&&"overtimeSet"!=t&&workflowDesignE9_dialog&&workflowDesignE9_dialog.close()}function checkIsChangCellIcon(t,e,n){var i=workflowUi.editor.graph,o=i.model,s=t.style,l=t.style;o.beginUpdate();try{if("true"==e&&l.indexOf("icons=")<0)s=l+'icons={"'+n+'":'+("beforeNode"==n?'"icon-workflow-caozuoqian"':'"icon-workflow-caozuohou"')+"};";else if("false"==e&&-1<l.indexOf("icons=")){for(var r=l.split(";"),a=0;a<r.length;++a)if(-1<r[a].indexOf("icons=")){var h=JSON.parse(r[a].split("=")[1]);for(var d in h)d==n&&delete h[d];0==Object.keys(h).length?r.splice(a,1):r[a]="icons="+JSON.stringify(h)}s=r.join(";")}else if("true"==e&&-1<l.indexOf("icons=")){for(r=l.split(";"),a=0;a<r.length;++a){if(-1<r[a].indexOf("icons="))(h=JSON.parse(r[a].split("=")[1]))[n]="beforeNode"==n?"icon-workflow-caozuoqian":"icon-workflow-caozuohou",r[a]="icons="+JSON.stringify(h)}s=r.join(";")}o.setStyle(t,s)}finally{o.endUpdate(),i.refresh()}}function wfGroups(t,e){this.editorUi=t,this.container=e,this.rowGroups=[],this.colGroups=[],this.init()}WfNodeInfo.prototype.createDetailDialog=function(t,e,n,i,o,s){for(var l,r=window.ecCom.WeaTools,a=this.editorUi.editor.graph,h=a.view.scale,d=a.minimumGraphSize.x||0,u=a.minimumGraphSize.y||0,p=a.minimumGraphSize.width*h||1e5,m=a.minimumGraphSize.height*h||1e5,c=a.getAllCells(d,u,p,m),g=0;g<c.length;++g)if(s){if(c[g].edge&&c[g].linkId==n){l=c[g];break}}else if(!c[g].edge&&c[g].nodeId==n){l=c[g];break}workflowDesignE9_dialog_params={key:t,modalName:e,nodetype:i,groupid:o,nowCell:l},"hasRole"==t||"hasCondition"==t?workflowDesignE9_dialog_params.linkId=n:workflowDesignE9_dialog_params.nodeId=n;var x=this.editorUi.editor.graph.workflowDetailDatas,y=0==i?1:"",f=s?l.source.nodeType:"",v=window.urlParams.workflowId||"",C={operator:"#/main/workflowengine/path/pathSet/operatorSet?isSingle=true&workflowId="+v+"&wfid="+v+"&nodeid="+n+"&nodetype="+i+"&groupid="+o+"&isCreate="+y+"&isClose4e9=true&formid="+x.workflowDatas.formId+"&isbill="+x.workflowDatas.isBill,hasCusRigKey:"#/main/workflowengine/path/pathset/perationMenuSet?nodeId="+n+"&workflowId="+v+"&isRoute=true&isClose4e9=true&_key=2r5y2t",formContent:"#/main/workflowengine/path/pathset/formcontent?nodeid="+n+"&workflowId="+v+"&isRoute=true&isClose4e9=true&_key=6vyr0l",hasNodeBefAddOpr:"#/main/workflowengine/path/pathSet/addInOperate?isRoute=true&workflowId="+v+"&nodeId="+n+"&ispreoperator=1&isClose4e9=true",hasNodeAftAddOpr:"#/main/workflowengine/path/pathSet/addInOperate?isRoute=true&workflowId="+v+"&nodeId="+n+"&ispreoperator=0&isClose4e9=true",hasOperateSign:"#/main/workflowengine/path/pathSet/nodeMore?_key=hsdkby&workflowId="+v+"&nodeId="+n+"&type=sign&isSingle=true&isClose4e9=true",hasOperateTitle:"#/main/workflowengine/path/pathSet/nodeMore?_key=hsdkby&workflowId="+v+"&nodeId="+n+"&type=title&isSingle=true&isClose4e9=true",hasOperateSubwf:"#/main/workflowengine/path/pathSet/nodeMore?_key=hsdkby&workflowId="+v+"&nodeId="+n+"&type=subWf&isSingle=true&isClose4e9=true",hasOperateException:"#/main/workflowengine/path/pathSet/nodeMore?_key=hsdkby&workflowId="+v+"&nodeId="+n+"&type=exception&isSingle=true&isClose4e9=true",formLogViewRange:"#/main/workflowengine/path/pathSet/formLog?isSingle=true&isClose4e9=true&workflowId="+v+"&nodeid="+n+"&design=1&action=",hasRole:"#/main/workflowengine/path/pathSet/addInOperate?isRoute=true&workflowId="+v+"&linkId="+n+"&isClose4e9=true",hasCondition:"#/main/workflowengine/path/exportConditionSetting?rulesrc=1&formid="+x.workflowDatas.formId+"&isbill="+x.workflowDatas.isBill+"&linkid="+n+"&isnew=1&wfid="+v+"&rownum=0&curtype="+f+"&isSinglePage=1&isNeedFooter=1",overtimeSet:"#/main/workflowengine/path/nodeOvertimeList?isSinglePage=1&workflowId="+v+"&nodeid="+n+"&isClose4e9=true",selectNextFlow:"#main/workflowengine/path/pathSet/selectNextflow?isRoute=true&nodeId="+n+"&workflowId="+v,hasSecondAuth:"#/main/workflowengine/path/pathSet/nodeMore?_key=hsdkby&workflowId="+v+"&nodeId="+n+"&type=protectionDB&isSingle=true&isClose4e9=true"};if(C[t]){var E="/spa/workflow/static4engine/engine.html"+C[t];(workflowDesignE9_dialog=r.createDialog({title:"hasCondition"==t?wfGetLabel(18850,"出口条件设置")+"("+l.value+")":e||"test",moduleName:"workflow",url:E,style:{width:"hasCondition"==t?936:950,height:"hasCondition"==t?560:522},callback:function(t){jQuery(".ant-message").remove(),jQuery(".ant-modal-mask")},onCancel:function(){wfMessage.destroy(),jQuery(".ant-message").remove(),jQuery(".ant-modal-mask"),window.top.jQuery(".ant-modal-mask.fade-leave.fade-leave-active")[0].remove()}})).show()}},wfGroups.prototype.init=function(t){t=t||{},this.rowGroups=t.row||[],this.colGroups=t.col||[],(0<this.rowGroups.length||0<this.colGroups.length)&&this.refresh()},wfGroups.prototype.refresh=function(t){var e=this.editorUi.editor.graph,n=e.view.scale,i=e.minimumGraphSize;this.container.style.top="0px",this.container.style.left="0px",this.container.style.width=(i?i.width-12:mxClient.cellMaxWidth)*n+"px",this.container.style.height=(i?i.height:mxClient.cellMaxHeight)*n+"px",mxClient.IS_READONLY_PAGE&&mxClient.IS_FREE_WORKFLOW&&(0==this.colGroups.length&&(this.container.style.width=mxClient.cellMaxWidth*n+"px"),0==this.rowGroups.length&&(this.container.style.height=mxClient.cellMaxHeight*n+"px")),this.container.innerHTML="",this.paintGroups(),t||e.graphModelChanged([])},wfGroups.prototype.addRowGroup=function(t){for(var e=0,n=0;n<this.rowGroups.length;++n)this.rowGroups[n].position.top&&this.rowGroups[n].position.top>e&&(e=this.rowGroups[n].position.top);e+=180,t.position.top=e,this.rowGroups.push(t),this.refresh()},wfGroups.prototype.addColGroup=function(t){for(var e=0,n=0;n<this.colGroups.length;++n)this.colGroups[n].position.left&&this.colGroups[n].position.left>e&&(e=this.colGroups[n].position.left);e+=180,t.position.left=e,this.colGroups.push(t),this.refresh()},wfGroups.prototype.paintGroups=function(){this.editorUi.diagramContainer;for(var t=this.editorUi.wfNodeInfo,e=(this.editorUi.wfPanelContainer,this.editorUi.editor.graph),n=e.view.scale,i=(this.editorUi.wfEditor.container.clientHeight,e.isRuleEnabled(),t.nodePanelHide,0);i<this.colGroups.length;++i){if(mxClient.IS_READONLY_PAGE&&0==i){var o={type:"col",position:{left:0,top:0},panelWidth:0,value:""},s=this.createGroupElement(o);this.container.appendChild(s)}var l=this.createGroupElement(this.colGroups[i],i),r=this.createGroupPanelElement(this.colGroups[i],i);this.container.appendChild(r),this.container.appendChild(l)}var a=0;for(i=0;i<this.rowGroups.length;++i){a+=this.rowGroups[i].panelWidth}for(i=0;i<this.rowGroups.length;++i){if(mxClient.IS_READONLY_PAGE&&0==i){o={type:"row",position:{left:0,top:0},panelWidth:0,value:""},s=this.createGroupElement(o);this.container.appendChild(s)}l=this.createGroupElement(this.rowGroups[i],i),r=this.createGroupPanelElement(this.rowGroups[i],i,a);this.container.appendChild(r),this.container.appendChild(l)}jQuery(".geDiagramContainer").bind("scroll",function(t){jQuery("#row-group-panel-area").css("top",jQuery(".geDiagramContainer").scrollTop()/n),jQuery("#col-group-panel-area").css("left",jQuery(".geDiagramContainer").scrollLeft()/n)})},wfGroups.prototype.createGroupElement=function(t,e){var n=this.editorUi.editor.graph.view.scale;if(null!=t){var i=document.createElement("p");for(var o in"col"==t.type?i.className="workflow-col-group":i.className="workflow-row-group",mxClient.IS_READONLY_PAGE&&("col"==t.type?i.className="workflow-col-group-wfForm":i.className="workflow-row-group-wfForm"),t.position)i.style[o]=t.position[o]*n+"px";return mxClient.IS_READONLY_PAGE||this.groupDragAction(i,t.type,e),i}},wfGroups.prototype.createGroupPanelElement=function(t,e,n){var i,o,s=this.editorUi.editor.graph,l=s.view.scale;if(null!=t)return"row"==t.type?(document.getElementById("col-group-panel-area")?i=document.getElementById("col-group-panel-area"):(i=document.createElement("div")).id="col-group-panel-area",s.minimumGraphSize&&(i.style.width=s.minimumGraphSize.height+"px")):document.getElementById("row-group-panel-area")?i=document.getElementById("row-group-panel-area"):(i=document.createElement("div")).id="row-group-panel-area",mxClient.IS_IE&&(i.style.zIndex=4),"true"==window.urlParams.isFromWfForm&&(i.style.zIndex=3,i.style.backgroundColor="#f4f4f4",i.style.border="1px solid #ddd",i.style.width=n+2+"px"),"true"==window.urlParams.backstageReadOnly&&(i.style.zIndex=3,i.style.width=n+2+"px"),i.style.zoom=l,o=this.createGroupPanelItem(t,e,l),i.appendChild(o),i},wfGroups.prototype.createGroupPanelItem=function(i,t,e){var n=document.createElement("div"),o=document.createElement("div"),s=document.createElement("p"),l=document.createElement("div"),r=document.createElement("input");r.className="group-item-input",r.classListIndex=t;var a=this;r.onblur=function(t){this.style.display="none",t.target.previousSibling&&(t.target.previousSibling.style.display="block");var e=t.target.value;t.target.id="";var n=Number(this.classListIndex);""==e.trim()?wfModal.warning({title:wfGetLabel(131329,"信息确认"),content:wfGetLabel(390396,"分组名称不能为空"),okText:wfGetLabel(83446,"确定"),onOk:function(){t.target.value="col"==i.type?a.colGroups[n].value:a.rowGroups[n].value}}):"col"==i.type?a.colGroups[n].value=e:a.rowGroups[n].value=e,a.refresh()};for(var h=["icon-coms-Last-step","icon-coms-Next-step","anticon anticon-cross"],d=0;d<h.length;++d){var u=document.createElement("span");u.className=h[d]+" action-item",u=this.groupPanelActionEvent(u,h[d],t,i),l.appendChild(u)}return n.className=i.type+"-group-item","true"!=window.urlParams.isFromWfForm&&"true"!=window.urlParams.backstageReadOnly||(n.className=i.type+"-group-item-wfForm"),n.style.width=(i.panelWidth||150)+"px",l.className="group-item-action",o.className="group-item-info",s.innerHTML=i.value,r.value=i.value,e<1&&(l.style.transform="scale("+e+")",l.style.transformOrigin="center top",l.style.msTransform="scale("+e+")",l.style.msTransformOrigin="center top",l.style.position="absolute",l.style.right="0",o.style.transform="scale("+e+")",o.style.transformOrigin="center top",o.style.msTransform="scale("+e+")",o.style.msTransformOrigin="center top"),o.title=i.value,"true"!=window.urlParams.isFromWfForm&&"true"!=window.urlParams.backstageReadOnly&&(o.ondblclick=function(t){if("group-item-input"!=t.target.className){t.stopPropagation(),t.target.style.display="none";var e=t.target.nextSibling;if(e.style.display="inline-block",e.focus(),e.value=i.value,document.getElementById("groups-item-focused"))document.getElementById("groups-item-focused").setAttribute("id","");e.id="groups-item-focused"}}),o.appendChild(s),o.appendChild(r),n.appendChild(o),n.appendChild(l),n},wfGroups.prototype.groupDragAction=function(e,p,m){if("true"!=window.urlParams.isFromWfForm&&"true"!=window.urlParams.backstageReadOnly){var c,g,x,y,f=this;e.onmousedown=function(t){t.stopPropagation(),c=t.pageX,g=t.pageY,x=e.offsetLeft,y=e.offsetTop,document.onmousemove=function(t){var e=f.editorUi.editor.graph.view.scale,n=150*e,i=100*e,o=t.pageX,s=t.pageY;if("col"==p){var l=parseInt(o)-parseInt(c)+parseInt(x),r=f.colGroups,a=l-f.colGroups[m].position.left*e;r[m].panelWidth*e+a<=n&&(a=0);for(var h=0;h<r.length;++h)m<=h&&"col"==r[h].type&&(r[h].position.left=r[h].position.left+a/e,h==m&&(r[h].panelWidth=r[m].panelWidth+a/e));f.colGroups=r}else{var d=parseInt(s)-parseInt(g)+parseInt(y),u=(r=f.rowGroups,d-f.rowGroups[m].position.top*e);r[m].panelWidth*e+u<=i&&(u=0);for(h=0;h<r.length;++h)m<=h&&"row"==r[h].type&&(r[h].position.top=r[h].position.top+u/e,h==m&&(r[h].panelWidth=r[h].panelWidth+u/e));f.rowGroups=r}f.refresh()}},document.onmouseup=function(t){t.stopPropagation(),document.onmousemove=null}}},wfGroups.prototype.groupPanelActionEvent=function(t,e,i,o){if("true"==window.urlParams.isFromWfForm||"true"==window.urlParams.backstageReadOnly)return t;var s=this;return-1!=e.indexOf("Last")?t.onclick=function(){var t=document.getElementById("groups-item-focused");if(t&&t.blur(),0!=i){var e="col"==o.type?s.colGroups:s.rowGroups;e.splice(i,1),"col"==o.type?o.position.left-=e[i-1].panelWidth:o.position.top-=e[i-1].panelWidth,e.splice(i-1,0,o),"col"==o.type?e[i].position.left+=o.panelWidth:e[i].position.top+=o.panelWidth,s.refresh()}}:-1!=e.indexOf("Next")?t.onclick=function(){var t=document.getElementById("groups-item-focused");t&&t.blur();var e="col"==o.type?s.colGroups:s.rowGroups;i!=e.length-1&&(e.splice(i,1),"col"==o.type?o.position.left+=e[i].panelWidth:o.position.top+=e[i].panelWidth,e.splice(i+1,0,o),"col"==o.type?e[i].position.left-=o.panelWidth:e[i].position.top-=o.panelWidth,s.refresh())}:t.onclick=function(){var t=document.getElementById("groups-item-focused");t&&t.blur();var e="col"==o.type?s.colGroups:s.rowGroups;e.splice(i,1);for(var n=0;n<e.length;++n)i<=n&&("col"==o.type?e[n].position.left-=o.panelWidth:e[n].position.top-=o.panelWidth);s.refresh()},t},wfGroups.prototype.getGroupsValue=function(){return{row:this.rowGroups,col:this.colGroups}};