(self.webpackChunk=self.webpackChunk||[]).push([[21557],{57838:function(t,e,i){"use strict";i.d(e,{Z:function(){return o}});var n=i(67294);function o(){const[,t]=n.useReducer((t=>t+1),0);return t}},85418:function(t,e,i){"use strict";i.d(e,{Z:function(){return y}});var n=i(56153),o=i(94184),r=i.n(o),s=i(67294),a=i(64582),h=i(71577),l=i(53124),u=i(93421),c=i(4173),f=i(66748),d=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o{const{getPopupContainer:e,getPrefixCls:i,direction:o}=s.useContext(l.E_),{prefixCls:p,type:g="default",danger:m,disabled:y,loading:v,onClick:x,htmlType:b,children:w,className:k,menu:M,arrow:S,autoFocus:N,overlay:P,trigger:C,align:T,open:L,onOpenChange:A,placement:j,getPopupContainer:F,href:D,icon:O=s.createElement(a.Z,null),title:B,buttonsRender:I=(t=>t),mouseEnterDelay:z,mouseLeaveDelay:R,overlayClassName:E,overlayStyle:V,destroyPopupOnHide:Y,dropdownRender:G}=t,X=d(t,["prefixCls","type","danger","disabled","loading","onClick","htmlType","children","className","menu","arrow","autoFocus","overlay","trigger","align","open","onOpenChange","placement","getPopupContainer","href","icon","title","buttonsRender","mouseEnterDelay","mouseLeaveDelay","overlayClassName","overlayStyle","destroyPopupOnHide","dropdownRender"]),U=i("dropdown",p),q=`${U}-button`,[H,K]=(0,f.Z)(U),W={menu:M,arrow:S,autoFocus:N,align:T,disabled:y,trigger:y?[]:C,onOpenChange:A,getPopupContainer:F||e,mouseEnterDelay:z,mouseLeaveDelay:R,overlayClassName:E,overlayStyle:V,destroyPopupOnHide:Y,dropdownRender:G},{compactSize:J,compactItemClassnames:Z}=(0,c.ri)(U,o),$=r()(q,Z,k,K);"overlay"in t&&(W.overlay=P),"open"in t&&(W.open=L),W.placement="placement"in t?j:"rtl"===o?"bottomLeft":"bottomRight";const _=s.createElement(h.ZP,{type:g,danger:m,disabled:y,loading:v,onClick:x,htmlType:b,href:D,title:B},w),Q=s.createElement(h.ZP,{type:g,danger:m,icon:O}),[tt,et]=I([_,Q]);return H(s.createElement(u.Z.Compact,Object.assign({className:$,size:J,block:!0},X),tt,s.createElement(n.Z,Object.assign({},W),et)))};p.__ANT_BUTTON=!0;var g=p;const m=n.Z;m.Button=g;var y=m},11486:function(t,e,i){"use strict";i.d(e,{Z:function(){return D}});var n=i(94184),o=i.n(n),r=i(67294),s=i(53124),a=i(65223),h=i(47673);var l=t=>{const{getPrefixCls:e,direction:i}=(0,r.useContext)(s.E_),{prefixCls:n,className:l}=t,u=e("input-group",n),c=e("input"),[f,d]=(0,h.ZP)(c),p=o()(u,{[`${u}-lg`]:"large"===t.size,[`${u}-sm`]:"small"===t.size,[`${u}-compact`]:t.compact,[`${u}-rtl`]:"rtl"===i},d,l),g=(0,r.useContext)(a.aM),m=(0,r.useMemo)((()=>Object.assign(Object.assign({},g),{isFormItemInput:!1})),[g]);return f(r.createElement("span",{className:p,style:t.style,onMouseEnter:t.onMouseEnter,onMouseLeave:t.onMouseLeave,onFocus:t.onFocus,onBlur:t.onBlur},r.createElement(a.aM.Provider,{value:m},t.children)))},u=i(82586),c=i(87462),f={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},d=i(44327),p=function(t,e){return r.createElement(d.Z,(0,c.Z)({},t,{ref:e,icon:f}))};var g=r.forwardRef(p),m=i(43481),y=i(10366),v=i(17799),x=i(72922),b=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);ot?r.createElement(m.Z,null):r.createElement(g,null),k={click:"onClick",hover:"onMouseOver"};var M=r.forwardRef(((t,e)=>{const{visibilityToggle:i=!0}=t,n="object"==typeof i&&void 0!==i.visible,[a,h]=(0,r.useState)((()=>!!n&&i.visible)),l=(0,r.useRef)(null);r.useEffect((()=>{n&&h(i.visible)}),[n,i]);const c=(0,x.Z)(l),f=()=>{const{disabled:e}=t;e||(a&&c(),h((t=>{var e;const n=!t;return"object"==typeof i&&(null===(e=i.onVisibleChange)||void 0===e||e.call(i,n)),n})))},{className:d,prefixCls:p,inputPrefixCls:g,size:m}=t,M=b(t,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:S}=r.useContext(s.E_),N=S("input",g),P=S("input-password",p),C=i&&(e=>{const{action:i="click",iconRender:n=w}=t,o=k[i]||"",s=n(a),h={[o]:f,className:`${e}-icon`,key:"passwordIcon",onMouseDown:t=>{t.preventDefault()},onMouseUp:t=>{t.preventDefault()}};return r.cloneElement(r.isValidElement(s)?s:r.createElement("span",null,s),h)})(P),T=o()(P,d,{[`${P}-${m}`]:!!m}),L=Object.assign(Object.assign({},(0,y.Z)(M,["suffix","iconRender","visibilityToggle"])),{type:a?"text":"password",className:T,prefixCls:N,suffix:C});return m&&(L.size=m),r.createElement(u.Z,Object.assign({ref:(0,v.sQ)(e,l)},L))})),S=i(42480),N=i(96159),P=i(71577),C=i(98675),T=i(4173),L=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o{const{prefixCls:i,inputPrefixCls:n,className:a,size:h,suffix:l,enterButton:c=!1,addonAfter:f,loading:d,disabled:p,onSearch:g,onChange:m,onCompositionStart:y,onCompositionEnd:x}=t,b=L(t,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:w,direction:k}=r.useContext(s.E_),M=r.useRef(!1),A=w("input-search",i),j=w("input",n),{compactSize:F}=(0,T.ri)(A,k),D=(0,C.Z)((t=>{var e;return null!==(e=null!=h?h:F)&&void 0!==e?e:t})),O=r.useRef(null),B=t=>{var e;document.activeElement===(null===(e=O.current)||void 0===e?void 0:e.input)&&t.preventDefault()},I=t=>{var e,i;g&&g(null===(i=null===(e=O.current)||void 0===e?void 0:e.input)||void 0===i?void 0:i.value,t,{source:"input"})},z="boolean"==typeof c?r.createElement(S.Z,null):null,R=`${A}-button`;let E;const V=c||{},Y=V.type&&!0===V.type.__ANT_BUTTON;E=Y||"button"===V.type?(0,N.Tm)(V,Object.assign({onMouseDown:B,onClick:t=>{var e,i;null===(i=null===(e=null==V?void 0:V.props)||void 0===e?void 0:e.onClick)||void 0===i||i.call(e,t),I(t)},key:"enterButton"},Y?{className:R,size:D}:{})):r.createElement(P.ZP,{className:R,type:c?"primary":void 0,size:D,disabled:p,key:"enterButton",onMouseDown:B,onClick:I,loading:d,icon:z},c),f&&(E=[E,(0,N.Tm)(f,{key:"addonAfter"})]);const G=o()(A,{[`${A}-rtl`]:"rtl"===k,[`${A}-${D}`]:!!D,[`${A}-with-button`]:!!c},a);return r.createElement(u.Z,Object.assign({ref:(0,v.sQ)(O,e),onPressEnter:t=>{M.current||d||I(t)}},b,{size:D,onCompositionStart:t=>{M.current=!0,null==y||y(t)},onCompositionEnd:t=>{M.current=!1,null==x||x(t)},prefixCls:j,addonAfter:E,suffix:l,onChange:t=>{t&&t.target&&"click"===t.type&&g&&g(t.target.value,t,{source:"clear"}),m&&m(t)},className:G,disabled:p}))})),j=i(96330);const F=u.Z;F.Group=l,F.Search=A,F.TextArea=j.Z,F.Password=M;var D=F},93421:function(t,e,i){"use strict";i.d(e,{Z:function(){return v}});var n=i(67294),o=i(94184),r=i.n(o),s=i(37419),a=i(53124),h=i(4173);const l=n.createContext({latestIndex:0}),u=l.Provider;var c=t=>{let{className:e,index:i,children:o,split:r,style:s}=t;const{latestIndex:a}=n.useContext(l);return null==o?null:n.createElement(n.Fragment,null,n.createElement("div",{className:e,style:s},o),i{var i,o;const{getPrefixCls:h,space:l,direction:m}=n.useContext(a.E_),{size:y=(null==l?void 0:l.size)||"small",align:v,className:x,rootClassName:b,children:w,direction:k="horizontal",prefixCls:M,split:S,style:N,wrap:P=!1,classNames:C,styles:T}=t,L=g(t,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[A,j]=Array.isArray(y)?y:[y,y],F=d(j),D=d(A),O=p(j),B=p(A),I=(0,s.Z)(w,{keepEmpty:!0}),z=void 0===v&&"horizontal"===k?"center":v,R=h("space",M),[E,V]=(0,f.Z)(R),Y=r()(R,null==l?void 0:l.className,V,`${R}-${k}`,{[`${R}-rtl`]:"rtl"===m,[`${R}-align-${z}`]:z,[`${R}-gap-row-${j}`]:F,[`${R}-gap-col-${A}`]:D},x,b),G=r()(`${R}-item`,null!==(i=null==C?void 0:C.item)&&void 0!==i?i:null===(o=null==l?void 0:l.classNames)||void 0===o?void 0:o.item);let X=0;const U=I.map(((t,e)=>{var i,o;null!=t&&(X=e);const r=t&&t.key||`${G}-${e}`;return n.createElement(c,{className:G,key:r,index:e,split:S,style:null!==(i=null==T?void 0:T.item)&&void 0!==i?i:null===(o=null==l?void 0:l.styles)||void 0===o?void 0:o.item},t)})),q=n.useMemo((()=>({latestIndex:X})),[X]);if(0===I.length)return null;const H={};return P&&(H.flexWrap="wrap"),!D&&B&&(H.columnGap=A),!F&&O&&(H.rowGap=j),E(n.createElement("div",Object.assign({ref:e,className:Y,style:Object.assign(Object.assign(Object.assign({},H),null==l?void 0:l.style),N)},L),n.createElement(u,{value:q},U)))}));const y=m;y.Compact=h.ZP;var v=y},43481:function(t,e,i){"use strict";i.d(e,{Z:function(){return h}});var n=i(87462),o=i(67294),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},s=i(44327),a=function(t,e){return o.createElement(s.Z,(0,n.Z)({},t,{ref:e,icon:r}))};var h=o.forwardRef(a)},80500:function(t,e,i){"use strict";i.d(e,{FI:function(){return a}});var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},n(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}Object.create;Object.create;var r=i(23495),s=i(67294),a=function(t){function e(e){var i=t.call(this,e)||this;return i.wasCleared=!1,i.modelChangedListener=null,i.divRef=s.createRef(),i}return o(e,t),e.prototype.getDiagram=function(){return null===this.divRef.current?null:r.S0.fromDiv(this.divRef.current)},e.prototype.clear=function(){var t=this.getDiagram();null!==t&&(t.clear(),this.wasCleared=!0)},e.prototype.componentDidMount=function(){var t=this;if(null!==this.divRef.current){var e=this.props.initDiagram();e.div=this.divRef.current,this.modelChangedListener=function(e){if(e.isTransactionFinished&&e.model&&!e.model.isReadOnly&&t.props.onModelChange){var i=e.model.toIncrementalData(e);null!==i&&t.props.onModelChange(i)}},e.addModelChangedListener(this.modelChangedListener),e.delayInitialization((function(){t.mergeData(e,!0)}))}},e.prototype.componentWillUnmount=function(){var t=this.getDiagram();null!==t&&(t.div=null,null!==this.modelChangedListener&&(t.removeModelChangedListener(this.modelChangedListener),this.modelChangedListener=null))},e.prototype.shouldComponentUpdate=function(t,e){return t.divClassName!==this.props.divClassName||t.style!==this.props.style||!t.skipsDiagramUpdate&&(t.nodeDataArray!==this.props.nodeDataArray||t.linkDataArray!==this.props.linkDataArray||t.modelData!==this.props.modelData)},e.prototype.componentDidUpdate=function(t,e){var i=this;if(t.nodeDataArray!==this.props.nodeDataArray||t.linkDataArray!==this.props.linkDataArray||t.modelData!==this.props.modelData){var n=this.getDiagram();null!==n&&(this.wasCleared?n.delayInitialization((function(){i.mergeData(n,!0),i.wasCleared=!1})):this.mergeData(n,!1))}},e.prototype.mergeData=function(t,e){var i=this;t.model.commit((function(t){void 0!==i.props.modelData&&t.assignAllDataProperties(t.modelData,i.props.modelData),t.mergeNodeDataArray(i.props.nodeDataArray),void 0!==i.props.linkDataArray&&t instanceof r.FJ&&t.mergeLinkDataArray(i.props.linkDataArray)}),e?"initial merge":"merge data")},e.prototype.render=function(){return s.createElement("div",{ref:this.divRef,className:this.props.divClassName,style:this.props.style})},e}(s.Component);(function(t){function e(e){var i=t.call(this,e)||this;return i.divRef=s.createRef(),i}o(e,t),e.prototype.getOverview=function(){return null===this.divRef.current?null:r.S0.fromDiv(this.divRef.current)},e.prototype.componentDidMount=function(){var t;null!==this.divRef.current&&(void 0!==this.props.initOverview?t=this.props.initOverview():(t=new r.g2).contentAlignment=r.z6.Center,t.div=this.divRef.current,t.observed=this.props.observedDiagram)},e.prototype.componentWillUnmount=function(){var t=this.getOverview();null!==t&&(t.div=null,t.observed=null)},e.prototype.shouldComponentUpdate=function(t,e){return t.divClassName!==this.props.divClassName||t.style!==this.props.style||t.observedDiagram!==this.props.observedDiagram},e.prototype.componentDidUpdate=function(t,e){if(t.observedDiagram!==this.props.observedDiagram){var i=this.getOverview();null!==i&&(i.observed=this.props.observedDiagram)}},e.prototype.render=function(){return s.createElement("div",{ref:this.divRef,className:this.props.divClassName,style:this.props.style})}})(s.Component),function(t){function e(e){var i=t.call(this,e)||this;return i.wasCleared=!1,i.divRef=s.createRef(),i}o(e,t),e.prototype.getPalette=function(){return null===this.divRef.current?null:r.S0.fromDiv(this.divRef.current)},e.prototype.clear=function(){var t=this.getPalette();null!==t&&(t.clear(),this.wasCleared=!0)},e.prototype.componentDidMount=function(){var t=this;if(null!==this.divRef.current){var e=this.props.initPalette();e.div=this.divRef.current,e.delayInitialization((function(){t.mergeData(e,!0)}))}},e.prototype.componentWillUnmount=function(){var t=this.getPalette();null!==t&&(t.div=null)},e.prototype.shouldComponentUpdate=function(t,e){return t.divClassName!==this.props.divClassName||t.style!==this.props.style||(t.nodeDataArray!==this.props.nodeDataArray||t.linkDataArray!==this.props.linkDataArray||t.modelData!==this.props.modelData)},e.prototype.componentDidUpdate=function(t,e){var i=this;if(t.nodeDataArray!==this.props.nodeDataArray||t.linkDataArray!==this.props.linkDataArray||t.modelData!==this.props.modelData){var n=this.getPalette();null!==n&&(this.wasCleared?n.delayInitialization((function(){i.mergeData(n,!0),i.wasCleared=!1})):this.mergeData(n,!1))}},e.prototype.mergeData=function(t,e){var i=this;t.model.commit((function(t){void 0!==i.props.modelData&&t.assignAllDataProperties(t.modelData,i.props.modelData),t.mergeNodeDataArray(i.props.nodeDataArray),void 0!==i.props.linkDataArray&&t instanceof r.FJ&&t.mergeLinkDataArray(i.props.linkDataArray)}),e?"initial merge":"merge data")},e.prototype.render=function(){return s.createElement("div",{ref:this.divRef,className:this.props.divClassName,style:this.props.style})}}(s.Component)},23495:function(t,e,i){"use strict";i.d(e,{$u:function(){return r},BD:function(){return g},E9:function(){return o},FF:function(){return M},FJ:function(){return u},Hn:function(){return l},KX:function(){return c},NB:function(){return b},S0:function(){return d},UL:function(){return s},Vk:function(){return h},al:function(){return x},bn:function(){return v},bx:function(){return m},g2:function(){return p},h1:function(){return f},hD:function(){return k},rU:function(){return w},s_:function(){return y},z6:function(){return a}}),t=i.hmd(t),function(){var e;function n(t){var e=0;return function(){return ee&&(e=Math.max(0,n+e)),(null==i||i>n)&&(i=n),0>(i=Number(i))&&(i=Math.max(0,n+i)),e=Number(e||0);e=t.length?t.push(i):t.splice(e,0,i):w("Cannot insert an object into an HTMLCollection or NodeList: "+i+" at "+e)}function L(t,e){Array.isArray(t)?e>=t.length?t.pop():t.splice(e,1):w("Cannot remove an object from an HTMLCollection or NodeList at "+e)}function A(){var t=E.pop();return void 0===t?[]:t}function j(t){t.length=0,E.push(t)}function F(t){if("function"==typeof t){if(t.className)return t.className;if(t.name)return t.name;var e=t.toString();if(""!==(e=e.substring(9,e.indexOf("(")).trim()))return t._className=e}else if(N(t)&&t.constructor)return F(t.constructor);return typeof t}function D(t){var e=t;return N(t)&&(t.text?e=t.text:t.name?e=t.name:void 0!==t.key?e=t.key:void 0!==t.id?e=t.id:t.constructor===Object&&(t.Text?e=t.Text:t.Name?e=t.Name:void 0!==t.Key?e=t.Key:void 0!==t.Id?e=t.Id:void 0!==t.ID&&(e=t.ID))),void 0===e?"undefined":null===e?"null":e.toString()}function O(t,e){if(t.hasOwnProperty(e))return!0;for(t=Object.getPrototypeOf(t);t&&t!==Function;){if(t.hasOwnProperty(e))return!0;var i=t.CA;if(i&&i[e])return!0;t=Object.getPrototypeOf(t)}return!1}function B(t,e,i){Object.defineProperty(xi.prototype,t,{get:e,set:i})}function I(t){for(var e=[],i=0;256>i;i++)e["0123456789abcdef".charAt(i>>4)+"0123456789abcdef".charAt(15&i)]=String.fromCharCode(i);t.length%2&&(t="0"+t),i=[];for(var n=0,o=0;oi;i++)e[i]=i;for(i=n=0;256>i;i++)n=(n+e[i]+119)%256,o=e[i],e[i]=e[n],e[n]=o;n=i=0;for(var r="",s=0;s-1||r.indexOf("© 1998-2021 Northwoods Software")>-1||r.indexOf("Not for distribution or production use")>-1||r.indexOf("gojs.net")>-1?"":r}void 0===m.requestAnimationFrame&&(void 0===m.setImmediate?m.requestAnimationFrame=function(t){m.setTimeout(t,0)}:m.requestAnimationFrame=m.setImmediate);var z=void 0!==m.navigator&&0this.key)return!1;var e=(t=t.s).length,i=++this.Za,n=this.qf;if(null!==n)for(;ithis.key)return!1;var e=--this.Za;return 0<=e?(this.key=e,this.value=t.s[e],!0):(this.de(),!1)},J.prototype.Ad=function(){return this.next()},J.prototype.first=function(){var t=this.Bb;this.qa=t.Ja;var e=t.s;return this.Za=t=e.length-1,0<=t?(e=e[t],this.key=t,this.value=e):null},J.prototype.any=function(t){var e=this.Bb;e.Hg=null;var i=(e=e.s).length;for(this.Za=i,--i;0<=i;i--)if(t(e[i]))return!0;return!1},J.prototype.all=function(t){var e=this.Bb;e.Hg=null;var i=(e=e.s).length;for(this.Za=i,--i;0<=i;i--)if(!t(e[i]))return!1;return!0},J.prototype.each=function(t){var e=this.Bb;e.Hg=null;var i=(e=e.s).length;for(this.Za=i,--i;0<=i;i--)t(e[i]);return this},J.prototype.map=function(t){var e=this.Bb;e.Hg=null;var i=[],n=(e=e.s).length;for(this.Za=n,--n;0<=n;n--)i.push(t(e[n]));return(t=new Z).s=i,t.xb(),t.iterator},J.prototype.filter=function(t){var e=this.Bb;e.Hg=null;var i=[],n=(e=e.s).length;for(this.Za=n,--n;0<=n;n--){var o=e[n];t(o)&&i.push(o)}return(t=new Z).s=i,t.xb(),t.iterator},J.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.Bb.Hg=this},J.prototype.toString=function(){return"ListIteratorBackwards("+this.Za+"/"+this.Bb.count+")"},f.Object.defineProperties(J.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Bb.s.length}}}),J.prototype.first=J.prototype.first,J.prototype.hasNext=J.prototype.Ad,J.prototype.next=J.prototype.next,J.prototype.reset=J.prototype.reset,J.className="ListIteratorBackwards",(e=Z.prototype).xb=function(){var t=this.Ja;999999999<++t&&(t=0),this.Ja=t},e.freeze=function(){return this._isFrozen=!0,this},e.ka=function(){return this._isFrozen=!1,this},e.toString=function(){return"List()#"+et(this)},e.add=function(t){return null===t||(this._isFrozen&&k(this,t),this.s.push(t),this.xb()),this},e.push=function(t){this.add(t)},e.addAll=function(t){if(null===t)return this;this._isFrozen&&k(this);var e=this.s;if(P(t))for(var i=t.length,n=0;nt||t>=e.length)&&M(t,"0 <= i < length",Z,"elt:i"),e[t]},e.get=function(t){return this.M(t)},e.cd=function(t,e){var i=this.s;(0>t||t>=i.length)&&M(t,"0 <= i < length",Z,"setElt:i"),this._isFrozen&&k(this,t),i[t]=e},e.set=function(t,e){this.cd(t,e)},e.first=function(){var t=this.s;return 0===t.length?null:t[0]},e.jc=function(){var t=this.s,e=t.length;return 0t&&M(t,">= 0",Z,"insertAt:i"),this._isFrozen&&k(this,t);var i=this.s;t>=i.length?i.push(e):i.splice(t,0,e),this.xb()},e.remove=function(t){if(null===t)return!1;this._isFrozen&&k(this,t);var e=this.s;return-1!==(t=e.indexOf(t))&&(t===e.length-1?e.pop():e.splice(t,1),this.xb(),!0)},e.delete=function(t){return this.remove(t)},e.mb=function(t){var e=this.s;(0>t||t>=e.length)&&M(t,"0 <= i < length",Z,"removeAt:i"),this._isFrozen&&k(this,t),t===e.length-1?e.pop():e.splice(t,1),this.xb()},e.removeRange=function(t,e){var i=this.s,n=i.length;if(0>t)t=0;else if(t>=n)return this;if(0>e)return this;if(e>=n&&(e=n-1),t>e)return this;this._isFrozen&&k(this);for(var o=t,r=e+1;r=r)return this;if((0>e||e>=o-1)&&M(e,"0 <= from < length",Z,"sortRange:from"),2===r)return 0=o)n.sort(t);else for((e=n.slice(0,i)).sort(t),t=0;t=o)for((i=n.slice(e)).sort(t),t=e;t=this.s.length)return H;var t=this.Sa;return null!==t?(t.reset(),t):new W(this)}},iteratorBackwards:{get:function(){if(0>=this.s.length)return H;var t=this.Hg;return null!==t?(t.reset(),t):new J(this)}}}),Z.prototype.reverse=Z.prototype.reverse,Z.prototype.sortRange=Z.prototype.zi,Z.prototype.sort=Z.prototype.sort,Z.prototype.toSet=Z.prototype.Iv,Z.prototype.toArray=Z.prototype.Fa,Z.prototype.removeRange=Z.prototype.removeRange,Z.prototype.removeAt=Z.prototype.mb,Z.prototype.delete=Z.prototype.delete,Z.prototype.remove=Z.prototype.remove,Z.prototype.insertAt=Z.prototype.Gb,Z.prototype.pop=Z.prototype.pop,Z.prototype.last=Z.prototype.jc,Z.prototype.first=Z.prototype.first,Z.prototype.set=Z.prototype.set,Z.prototype.setElt=Z.prototype.cd,Z.prototype.get=Z.prototype.get,Z.prototype.elt=Z.prototype.M,Z.prototype.indexOf=Z.prototype.indexOf,Z.prototype.has=Z.prototype.has,Z.prototype.contains=Z.prototype.contains,Z.prototype.clear=Z.prototype.clear,Z.prototype.addAll=Z.prototype.addAll,Z.prototype.push=Z.prototype.push,Z.prototype.add=Z.prototype.add,Z.prototype.thaw=Z.prototype.ka,Z.prototype.freeze=Z.prototype.freeze,Z.className="List",$.prototype.reset=function(){var t=this.eg;t.Sa=null,this.qa=t.Ja,this.sa=null},$.prototype.next=function(){var t=this.eg;if(t.Ja!==this.qa&&null===this.key)return!1;var e=this.sa;return null!==(e=null===e?t.ea:e.va)?(this.sa=e,this.value=e.value,this.key=e.key,!0):(this.de(),!1)},$.prototype.Ad=function(){return this.next()},$.prototype.first=function(){var t=this.eg;if(this.qa=t.Ja,null!==(t=t.ea)){this.sa=t;var e=t.value;return this.key=t.key,this.value=e}return null},$.prototype.any=function(t){var e=this.eg;for(this.sa=e.Sa=null,e=e.ea;null!==e;){if(t(e.value))return!0;e=e.va}return!1},$.prototype.all=function(t){var e=this.eg;for(this.sa=e.Sa=null,e=e.ea;null!==e;){if(!t(e.value))return!1;e=e.va}return!0},$.prototype.each=function(t){var e=this.eg;for(this.sa=e.Sa=null,e=e.ea;null!==e;)t(e.value),e=e.va;return this},$.prototype.map=function(t){var e=this.eg;e.Sa=null;var i=new Z;for(e=e.ea;null!==e;)i.add(t(e.value)),e=e.va;return i.iterator},$.prototype.filter=function(t){var e=this.eg;e.Sa=null;var i=new Z;for(e=e.ea;null!==e;){var n=e.value;t(n)&&i.add(n),e=e.va}return i.iterator},$.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.eg.Sa=this},$.prototype.toString=function(){return null!==this.sa?"SetIterator@"+this.sa.value:"SetIterator"},f.Object.defineProperties($.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.eg.Sb}}}),$.prototype.first=$.prototype.first,$.prototype.hasNext=$.prototype.Ad,$.prototype.next=$.prototype.next,$.prototype.reset=$.prototype.reset,$.className="SetIterator",(e=_.prototype).xb=function(){var t=this.Ja;999999999<++t&&(t=0),this.Ja=t},e.freeze=function(){return this._isFrozen=!0,this},e.ka=function(){return this._isFrozen=!1,this},e.toString=function(){return"Set()#"+et(this)},e.add=function(t){if(null===t)return this;this._isFrozen&&k(this,t);var e=t;return N(t)&&(e=tt(t)),void 0===this.Tb[e]&&(this.Sb++,t=new ct(t,t),this.Tb[e]=t,null===(e=this.kf)?this.ea=t:(t.ll=e,e.va=t),this.kf=t,this.xb()),this},e.addAll=function(t){if(null===t)return this;if(this._isFrozen&&k(this),P(t))for(var e=t.length,i=0;i=this.Sb)return H;var t=this.Sa;return null!==t?(t.reset(),t):new $(this)}}}),_.prototype.toList=_.prototype.Hv,_.prototype.toArray=_.prototype.Fa,_.prototype.clear=_.prototype.clear,_.prototype.retainAll=_.prototype.pA,_.prototype.removeAll=_.prototype.hp,_.prototype.delete=_.prototype.delete,_.prototype.remove=_.prototype.remove,_.prototype.first=_.prototype.first,_.prototype.containsAny=_.prototype.Ty,_.prototype.containsAll=_.prototype.Sy,_.prototype.has=_.prototype.has,_.prototype.contains=_.prototype.contains,_.prototype.addAll=_.prototype.addAll,_.prototype.add=_.prototype.add,_.prototype.thaw=_.prototype.ka,_.prototype.freeze=_.prototype.freeze;var it,nt,ot,rt,st,at=1;function ht(t){this.ma=t,this.qa=t.Ja,this.sa=null}function lt(t){_.call(this),Q(this),this._isFrozen=!0,this.ma=t}function ut(t){this.ma=t,t.jf=null,this.qa=t.Ja,this.sa=null}function ct(t,e){this.key=t,this.value=e,this.ll=this.va=null}function ft(t){this.ma=t,t.Sa=null,this.qa=t.Ja,this.sa=null}function dt(t){Q(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.jf=this.Sa=null,this.Ja=0,this.kf=this.ea=null,"string"==typeof t&&w("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),void 0!==t&&this.addAll(t)}function pt(t,e){void 0===t?this.y=this.x=0:"number"==typeof t&&"number"==typeof e?(this.x=t,this.y=e):w("Invalid arguments to Point constructor: "+t+", "+e),this._isFrozen=!1}function gt(t){if("string"==typeof t){t=t.split(" ");for(var e=0,i=0;""===t[e];)e++;var n=t[e++];n&&(i=parseFloat(n));for(var o=0;""===t[e];)e++;return(n=t[e++])&&(o=parseFloat(n)),new pt(i,o)}return new pt}function mt(t){return t.x.toString()+" "+t.y.toString()}function yt(t,e){if(0===t)return 0e?270:0;if(0===e)return 0t?i=0>e?i+180:180-i:0>e&&(i=360-i),i}function vt(t,e){return e.Cd(t),t}function xt(t,e,i,n,o,r){var s=o-i,a=r-n,h=s*s+a*a,l=-(i-=t)*s-(n-=e)*a;return 0>=l||l>=h?(s=o-t,a=r-e,Math.min(i*i+n*n,s*s+a*a)):(t=s*n-a*i)*t/h}function bt(t,e,i,n){return(t=i-t)*t+(e=n-e)*e}function wt(t,e,i,n){return e=n-e,0===(t=i-t)?0e?270:0:0===e?0t?n=0>e?n+180:180-n:0>e&&(n=360-n),n)}_.className="Set",_.uniqueHash=Q,_.hashIdUnique=tt,_.hashId=et,ht.prototype.reset=function(){this.qa=this.ma.Ja,this.sa=null},ht.prototype.next=function(){var t=this.ma;if(t.Ja!==this.qa&&null===this.key)return!1;var e=this.sa;return null!==(e=null===e?t.ea:e.va)?(this.sa=e,this.value=this.key=t=e.key,!0):(this.de(),!1)},ht.prototype.Ad=function(){return this.next()},ht.prototype.first=function(){var t=this.ma;return this.qa=t.Ja,null!==(t=t.ea)?(this.sa=t,this.value=this.key=t=t.key):null},ht.prototype.any=function(t){var e=this.ma;for(this.sa=null,e=e.ea;null!==e;){if(t(e.key))return!0;e=e.va}return!1},ht.prototype.all=function(t){var e=this.ma;for(this.sa=null,e=e.ea;null!==e;){if(!t(e.key))return!1;e=e.va}return!0},ht.prototype.each=function(t){var e=this.ma;for(this.sa=null,e=e.ea;null!==e;)t(e.key),e=e.va;return this},ht.prototype.map=function(t){var e=this.ma;this.sa=null;var i=new Z;for(e=e.ea;null!==e;)i.add(t(e.key)),e=e.va;return i.iterator},ht.prototype.filter=function(t){var e=this.ma;this.sa=null;var i=new Z;for(e=e.ea;null!==e;){var n=e.key;t(n)&&i.add(n),e=e.va}return i.iterator},ht.prototype.de=function(){this.value=this.key=null,this.qa=-1},ht.prototype.toString=function(){return null!==this.sa?"MapKeySetIterator@"+this.sa.value:"MapKeySetIterator"},f.Object.defineProperties(ht.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),ht.prototype.first=ht.prototype.first,ht.prototype.hasNext=ht.prototype.Ad,ht.prototype.next=ht.prototype.next,ht.prototype.reset=ht.prototype.reset,ht.className="MapKeySetIterator",c(lt,_),(e=lt.prototype).freeze=function(){return this},e.ka=function(){return this},e.toString=function(){return"MapKeySet("+this.ma.toString()+")"},e.add=function(){w("This Set is read-only: "+this.toString())},e.contains=function(t){return this.ma.contains(t)},e.has=function(t){return this.contains(t)},e.remove=function(){w("This Set is read-only: "+this.toString())},e.delete=function(t){return this.remove(t)},e.clear=function(){w("This Set is read-only: "+this.toString())},e.first=function(){var t=this.ma.ea;return null!==t?t.key:null},lt.prototype.any=function(t){for(var e=this.ma.ea;null!==e;){if(t(e.key))return!0;e=e.va}return!1},lt.prototype.all=function(t){for(var e=this.ma.ea;null!==e;){if(!t(e.key))return!1;e=e.va}return!0},lt.prototype.each=function(t){for(var e=this.ma.ea;null!==e;)t(e.key),e=e.va;return this},lt.prototype.map=function(t){for(var e=new _,i=this.ma.ea;null!==i;)e.add(t(i.key)),i=i.va;return e},lt.prototype.filter=function(t){for(var e=new _,i=this.ma.ea;null!==i;){var n=i.key;t(n)&&e.add(n),i=i.va}return e},lt.prototype.copy=function(){return new lt(this.ma)},lt.prototype.Iv=function(){var t,e=new _,i=this.ma.Tb;for(t in i)e.add(i[t].key);return e},lt.prototype.Fa=function(){var t,e=this.ma.Tb,i=Array(this.ma.Sb),n=0;for(t in e)i[n]=e[t].key,n++;return i},lt.prototype.Hv=function(){var t,e=new Z,i=this.ma.Tb;for(t in i)e.add(i[t].key);return e},f.Object.defineProperties(lt.prototype,{count:{get:function(){return this.ma.Sb}},size:{get:function(){return this.ma.Sb}},iterator:{get:function(){return 0>=this.ma.Sb?H:new ht(this.ma)}}}),lt.prototype.toList=lt.prototype.Hv,lt.prototype.toArray=lt.prototype.Fa,lt.prototype.toSet=lt.prototype.Iv,lt.prototype.first=lt.prototype.first,lt.prototype.clear=lt.prototype.clear,lt.prototype.delete=lt.prototype.delete,lt.prototype.remove=lt.prototype.remove,lt.prototype.has=lt.prototype.has,lt.prototype.contains=lt.prototype.contains,lt.prototype.add=lt.prototype.add,lt.prototype.thaw=lt.prototype.ka,lt.prototype.freeze=lt.prototype.freeze,lt.className="MapKeySet",ut.prototype.reset=function(){var t=this.ma;t.jf=null,this.qa=t.Ja,this.sa=null},ut.prototype.next=function(){var t=this.ma;if(t.Ja!==this.qa&&null===this.key)return!1;var e=this.sa;return null!==(e=null===e?t.ea:e.va)?(this.sa=e,this.value=e.value,this.key=e.key,!0):(this.de(),!1)},ut.prototype.Ad=function(){return this.next()},ut.prototype.first=function(){var t=this.ma;if(this.qa=t.Ja,null!==(t=t.ea)){this.sa=t;var e=t.value;return this.key=t.key,this.value=e}return null},ut.prototype.any=function(t){var e=this.ma;for(this.sa=e.jf=null,e=e.ea;null!==e;){if(t(e.value))return!0;e=e.va}return!1},ut.prototype.all=function(t){var e=this.ma;for(this.sa=e.jf=null,e=e.ea;null!==e;){if(!t(e.value))return!1;e=e.va}return!0},ut.prototype.each=function(t){var e=this.ma;for(this.sa=e.jf=null,e=e.ea;null!==e;)t(e.value),e=e.va;return this},ut.prototype.map=function(t){var e=this.ma;this.sa=e.jf=null;var i=new Z;for(e=e.ea;null!==e;)i.add(t(e.value)),e=e.va;return i.iterator},ut.prototype.filter=function(t){var e=this.ma;this.sa=e.jf=null;var i=new Z;for(e=e.ea;null!==e;){var n=e.value;t(n)&&i.add(n),e=e.va}return i.iterator},ut.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.jf=this},ut.prototype.toString=function(){return null!==this.sa?"MapValueSetIterator@"+this.sa.value:"MapValueSetIterator"},f.Object.defineProperties(ut.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),ut.prototype.first=ut.prototype.first,ut.prototype.hasNext=ut.prototype.Ad,ut.prototype.next=ut.prototype.next,ut.prototype.reset=ut.prototype.reset,ut.className="MapValueSetIterator",ct.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"},ct.className="KeyValuePair",ft.prototype.reset=function(){var t=this.ma;t.Sa=null,this.qa=t.Ja,this.sa=null},ft.prototype.next=function(){var t=this.ma;if(t.Ja!==this.qa&&null===this.key)return!1;var e=this.sa;return null!==(e=null===e?t.ea:e.va)?(this.sa=e,this.key=e.key,this.value=e.value,!0):(this.de(),!1)},ft.prototype.Ad=function(){return this.next()},ft.prototype.first=function(){var t=this.ma;return this.qa=t.Ja,null!==(t=t.ea)?(this.sa=t,this.key=t.key,this.value=t.value,t):null},ft.prototype.any=function(t){var e=this.ma;for(this.sa=e.Sa=null,e=e.ea;null!==e;){if(t(e))return!0;e=e.va}return!1},ft.prototype.all=function(t){var e=this.ma;for(this.sa=e.Sa=null,e=e.ea;null!==e;){if(!t(e))return!1;e=e.va}return!0},ft.prototype.each=function(t){var e=this.ma;for(this.sa=e.Sa=null,e=e.ea;null!==e;)t(e),e=e.va;return this},ft.prototype.map=function(t){var e=this.ma;this.sa=e.Sa=null;var i=new Z;for(e=e.ea;null!==e;)i.add(t(e)),e=e.va;return i.iterator},ft.prototype.filter=function(t){var e=this.ma;this.sa=e.Sa=null;var i=new Z;for(e=e.ea;null!==e;)t(e)&&i.add(e),e=e.va;return i.iterator},ft.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.Sa=this},ft.prototype.toString=function(){return null!==this.sa?"MapIterator@"+this.sa:"MapIterator"},f.Object.defineProperties(ft.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),ft.prototype.first=ft.prototype.first,ft.prototype.hasNext=ft.prototype.Ad,ft.prototype.next=ft.prototype.next,ft.prototype.reset=ft.prototype.reset,ft.className="MapIterator",(e=dt.prototype).xb=function(){var t=this.Ja;999999999<++t&&(t=0),this.Ja=t},e.freeze=function(){return this._isFrozen=!0,this},e.ka=function(){return this._isFrozen=!1,this},e.toString=function(){return"Map()#"+et(this)},e.add=function(t,e){this._isFrozen&&k(this,t);var i=t;N(t)&&(i=tt(t));var n=this.Tb[i];return void 0===n?(this.Sb++,t=new ct(t,e),this.Tb[i]=t,null===(i=this.kf)?this.ea=t:(t.ll=i,i.va=t),this.kf=t,this.xb()):n.value=e,this},e.set=function(t,e){return this.add(t,e)},e.addAll=function(t){if(null===t)return this;if(P(t))for(var e=t.length,i=0;i=this.count)return H;var t=this.Sa;return null!==t?(t.reset(),t):new ft(this)}},iteratorKeys:{get:function(){return 0>=this.count?H:new ht(this)}},iteratorValues:{get:function(){if(0>=this.count)return H;var t=this.jf;return null!==t?(t.reset(),t):new ut(this)}}}),dt.prototype.toKeySet=dt.prototype.Lf,dt.prototype.toArray=dt.prototype.Fa,dt.prototype.clear=dt.prototype.clear,dt.prototype.delete=dt.prototype.delete,dt.prototype.remove=dt.prototype.remove,dt.prototype.get=dt.prototype.get,dt.prototype.getValue=dt.prototype.I,dt.prototype.has=dt.prototype.has,dt.prototype.contains=dt.prototype.contains,dt.prototype.first=dt.prototype.first,dt.prototype.addAll=dt.prototype.addAll,dt.prototype.set=dt.prototype.set,dt.prototype.add=dt.prototype.add,dt.prototype.thaw=dt.prototype.ka,dt.prototype.freeze=dt.prototype.freeze,dt.className="Map",pt.prototype.assign=function(t){return this.x=t.x,this.y=t.y,this},pt.prototype.h=function(t,e){return this.x=t,this.y=e,this},pt.prototype.sg=function(t,e){return this.x=t,this.y=e,this},pt.prototype.set=function(t){return this.x=t.x,this.y=t.y,this},pt.prototype.copy=function(){var t=new pt;return t.x=this.x,t.y=this.y,t},(e=pt.prototype).ja=function(){return this._isFrozen=!0,Object.freeze(this),this},e.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},e.freeze=function(){return this._isFrozen=!0,this},e.ka=function(){return Object.isFrozen(this)&&w("cannot thaw constant: "+this),this._isFrozen=!1,this},e.toString=function(){return"Point("+this.x+","+this.y+")"},e.D=function(t){return t instanceof pt&&(this.x===t.x&&this.y===t.y)},e.hi=function(t,e){return this.x===t&&this.y===e},e.Xa=function(t){return Xe.B(this.x,t.x)&&Xe.B(this.y,t.y)},e.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.re=function(t){return this.x-=t.x,this.y-=t.y,this},e.offset=function(t,e){return this.x+=t,this.y+=e,this},pt.prototype.rotate=function(t){if(0===t)return this;var e=this.x,i=this.y;if(0===e&&0===i)return this;if(360<=t?t-=360:0>t&&(t+=360),90===t){t=0;var n=1}else 180===t?(t=-1,n=0):270===t?(t=0,n=-1):(n=t*Math.PI/180,t=Math.cos(n),n=Math.sin(n));return this.x=t*e-n*i,this.y=n*e+t*i,this},(e=pt.prototype).scale=function(t,e){return this.x*=t,this.y*=e,this},e.Bf=function(t){var e=t.x-this.x;return e*e+(t=t.y-this.y)*t},e.zd=function(t,e){return(t-=this.x)*t+(e-=this.y)*e},e.normalize=function(){var t=this.x,e=this.y,i=Math.sqrt(t*t+e*e);return 0e.width+10+10+o||o>i+n)&&(i=t.height,t=t.y,n=e.y-10,!(t>e.height+10+10+n||n>i+t))}function Gt(t,e,i,n,o){var r=Math.min(t.x,e),s=Math.min(t.y,i);return e=Math.max(t.x+t.width,e+n),i=Math.max(t.y+t.height,i+o),t.x=r,t.y=s,t.width=e-r,t.height=i-s,t}function Xt(t,e,i,n,o,r,s,a){return void 0===s&&(s=0),void 0===a&&(a=0),t<=o&&o+s<=t+i&&e<=r&&r+a<=e+n}function Ut(t,e,i,n,o,r,s,a){return!(t>s+o||o>i+t)&&!(e>a+r||r>n+e)}At.className="Size",At.parse=jt,At.stringify=Ft,At.ZeroSize=kt=new At(0,0).ja(),At.OneSize=Mt=new At(1,1).ja(),At.SixSize=St=new At(6,6).ja(),At.EightSize=Nt=new At(8,8).ja(),At.TenSize=Pt=new At(10,10).ja(),At.InfiniteSize=Ct=new At(1/0,1/0).ja(),At.NoSize=Tt=new At(NaN,NaN).ja(),At.parse=jt,At.stringify=Ft,(e=Ot.prototype).assign=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},e.h=function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},e.sg=function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},e.set=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},e.dd=function(t){return this.x=t.x,this.y=t.y,this},e.tA=function(t){return this.width=t.width,this.height=t.height,this},Ot.prototype.copy=function(){var t=new Ot;return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},(e=Ot.prototype).ja=function(){return this._isFrozen=!0,Object.freeze(this),this},e.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},e.freeze=function(){return this._isFrozen=!0,this},e.ka=function(){return Object.isFrozen(this)&&w("cannot thaw constant: "+this),this._isFrozen=!1,this},e.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"},e.D=function(t){return t instanceof Ot&&(this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height)},e.hi=function(t,e,i,n){return this.x===t&&this.y===e&&this.width===i&&this.height===n},e.Xa=function(t){return Xe.B(this.x,t.x)&&Xe.B(this.y,t.y)&&Xe.B(this.width,t.width)&&Xe.B(this.height,t.height)},e.ca=function(t){return this.x<=t.x&&this.x+this.width>=t.x&&this.y<=t.y&&this.y+this.height>=t.y},e.Re=function(t){return this.x<=t.x&&t.x+t.width<=this.x+this.width&&this.y<=t.y&&t.y+t.height<=this.y+this.height},e.contains=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),this.x<=t&&t+i<=this.x+this.width&&this.y<=e&&e+n<=this.y+this.height},e.offset=function(t,e){return this.x+=t,this.y+=e,this},e.Bc=function(t,e){return Et(this,e,t,e,t)},e.Co=function(t){return Et(this,t.top,t.right,t.bottom,t.left)},e.Fv=function(t){return Et(this,-t.top,-t.right,-t.bottom,-t.left)},e.Hz=function(t,e,i,n){return Et(this,t,e,i,n)},e.Ex=function(t){return Vt(this,t.x,t.y,t.width,t.height)},e.Uu=function(t,e,i,n){return Vt(this,t,e,i,n)},e.Yc=function(t){return this.Vu(t.x,t.y,t.width,t.height)},e.Vu=function(t,e,i,n){var o=this.width,r=this.x;return!(1/0!==o&&1/0!==i&&(o+=r,i+=t,isNaN(i)||isNaN(o)||r>i||t>o))&&(t=this.height,i=this.y,!(1/0!==t&&1/0!==n&&(t+=i,n+=e,isNaN(n)||isNaN(t)||i>n||e>t)))},e.Ye=function(t){return Gt(this,t.x,t.y,0,0)},e.ed=function(t){return Gt(this,t.x,t.y,t.width,t.height)},e.Kv=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Gt(this,t,e,i,n)},e.yi=function(t,e,i){return this.x=t-i.offsetX-i.x*this.width,this.y=e-i.offsetY-i.y*this.height,this},e.w=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.Mz=function(){return 0===this.width&&0===this.height},Ot.alloc=function(){var t=Kt.pop();return void 0===t?new Ot:t},Ot.allocAt=function(t,e,i,n){var o=Kt.pop();return void 0===o?new Ot(t,e,i,n):o.h(t,e,i,n)},Ot.free=function(t){Kt.push(t)},f.Object.defineProperties(Ot.prototype,{left:{get:function(){return this.x},set:function(t){this.x=t}},top:{get:function(){return this.y},set:function(t){this.y=t}},right:{get:function(){return this.x+this.width},set:function(t){this.x+=t-(this.x+this.width)}},bottom:{get:function(){return this.y+this.height},set:function(t){this.y+=t-(this.y+this.height)}},position:{get:function(){return new pt(this.x,this.y)},set:function(t){this.x=t.x,this.y=t.y}},size:{get:function(){return new At(this.width,this.height)},set:function(t){this.width=t.width,this.height=t.height}},center:{get:function(){return new pt(this.x+this.width/2,this.y+this.height/2)},set:function(t){this.x=t.x-this.width/2,this.y=t.y-this.height/2}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}}),Ot.prototype.isEmpty=Ot.prototype.Mz,Ot.prototype.isReal=Ot.prototype.w,Ot.intersectsLineSegment=function(t,e,i,n,o,r,s,a){return Xe.Fx(t,e,i,n,o,r,s,a)},Ot.prototype.setSpot=Ot.prototype.yi,Ot.prototype.union=Ot.prototype.Kv,Ot.prototype.unionRect=Ot.prototype.ed,Ot.prototype.unionPoint=Ot.prototype.Ye,Ot.prototype.intersects=Ot.prototype.Vu,Ot.prototype.intersectsRect=Ot.prototype.Yc,Ot.prototype.intersect=Ot.prototype.Uu,Ot.prototype.intersectRect=Ot.prototype.Ex,Ot.prototype.grow=Ot.prototype.Hz,Ot.prototype.subtractMargin=Ot.prototype.Fv,Ot.prototype.addMargin=Ot.prototype.Co,Ot.prototype.inflate=Ot.prototype.Bc,Ot.prototype.offset=Ot.prototype.offset,Ot.prototype.contains=Ot.prototype.contains,Ot.prototype.containsRect=Ot.prototype.Re,Ot.prototype.containsPoint=Ot.prototype.ca,Ot.prototype.equalsApprox=Ot.prototype.Xa,Ot.prototype.equalTo=Ot.prototype.hi,Ot.prototype.equals=Ot.prototype.D,Ot.prototype.setSize=Ot.prototype.tA,Ot.prototype.setPoint=Ot.prototype.dd,Ot.prototype.set=Ot.prototype.set,Ot.prototype.setTo=Ot.prototype.sg;var qt,Ht,Kt=[];function Wt(t,e,i,n){void 0===t?this.left=this.bottom=this.right=this.top=0:void 0===e?this.left=this.bottom=this.right=this.top=t:void 0===i?(this.top=t,this.right=e,this.bottom=t,this.left=e):void 0!==n?(this.top=t,this.right=e,this.bottom=i,this.left=n):w("Invalid arguments to Margin constructor: "+t+", "+e+", "+i+", "+n),this._isFrozen=!1}function Jt(t){if("string"==typeof t){t=t.split(" ");for(var e=0,i=NaN;""===t[e];)e++;var n=t[e++];if(n&&(i=parseFloat(n)),isNaN(i))return new Wt;for(var o=NaN;""===t[e];)e++;if((n=t[e++])&&(o=parseFloat(n)),isNaN(o))return new Wt(i);for(var r=NaN;""===t[e];)e++;if((n=t[e++])&&(r=parseFloat(n)),isNaN(r))return new Wt(i,o);for(var s=NaN;""===t[e];)e++;return(n=t[e++])&&(s=parseFloat(n)),isNaN(s)?new Wt(i,o):new Wt(i,o,r,s)}return new Wt}function Zt(t){return t.top.toString()+" "+t.right.toString()+" "+t.bottom.toString()+" "+t.left.toString()}Ot.className="Rect",Ot.parse=It,Ot.stringify=zt,Ot.contains=Xt,Ot.intersects=Ut,Ot.ZeroRect=qt=new Ot(0,0,0,0).ja(),Ot.NoRect=Ht=new Ot(NaN,NaN,NaN,NaN).ja(),Ot.parse=It,Ot.stringify=zt,Ot.contains=Xt,Ot.intersects=Ut,Wt.prototype.assign=function(t){return this.top=t.top,this.right=t.right,this.bottom=t.bottom,this.left=t.left,this},Wt.prototype.sg=function(t,e,i,n){return this.top=t,this.right=e,this.bottom=i,this.left=n,this},Wt.prototype.set=function(t){return this.top=t.top,this.right=t.right,this.bottom=t.bottom,this.left=t.left,this},Wt.prototype.copy=function(){var t=new Wt;return t.top=this.top,t.right=this.right,t.bottom=this.bottom,t.left=this.left,t},(e=Wt.prototype).ja=function(){return this._isFrozen=!0,Object.freeze(this),this},e.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},e.freeze=function(){return this._isFrozen=!0,this},e.ka=function(){return Object.isFrozen(this)&&w("cannot thaw constant: "+this),this._isFrozen=!1,this},e.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"},e.D=function(t){return t instanceof Wt&&(this.top===t.top&&this.right===t.right&&this.bottom===t.bottom&&this.left===t.left)},e.hi=function(t,e,i,n){return this.top===t&&this.right===e&&this.bottom===i&&this.left===n},e.Xa=function(t){return Xe.B(this.top,t.top)&&Xe.B(this.right,t.right)&&Xe.B(this.bottom,t.bottom)&&Xe.B(this.left,t.left)},e.w=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)},Wt.alloc=function(){var t=Be.pop();return void 0===t?new Wt:t},Wt.free=function(t){Be.push(t)},Wt.prototype.isReal=Wt.prototype.w,Wt.prototype.equalsApprox=Wt.prototype.Xa,Wt.prototype.equalTo=Wt.prototype.hi,Wt.prototype.equals=Wt.prototype.D,Wt.prototype.set=Wt.prototype.set,Wt.prototype.setTo=Wt.prototype.sg;var $t,_t,Qt,te,ee,ie,ne,oe,re,se,ae,he,le,ue,ce,fe,de,pe,ge,me,ye,ve,xe,be,we,ke,Me,Se,Ne,Pe,Ce,Te,Le,Ae,je,Fe,De,Oe,Be=[];function Ie(t,e,i,n){void 0===t?this.offsetY=this.offsetX=this.y=this.x=0:(void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.offsetX=i,this.offsetY=n),this._isFrozen=!1}function ze(t,e){return t.x=NaN,t.y=NaN,t.offsetX=e,t}function Re(t){if("string"==typeof t){if("None"===(t=t.trim()))return Qt;if("TopLeft"===t)return te;if("Top"===t||"TopCenter"===t||"MiddleTop"===t)return ee;if("TopRight"===t)return ie;if("Left"===t||"LeftCenter"===t||"MiddleLeft"===t)return ne;if("Center"===t)return oe;if("Right"===t||"RightCenter"===t||"MiddleRight"===t)return re;if("BottomLeft"===t)return se;if("Bottom"===t||"BottomCenter"===t||"MiddleBottom"===t)return ae;if("BottomRight"===t)return he;if("TopSide"===t)return le;if("LeftSide"===t)return ue;if("RightSide"===t)return ce;if("BottomSide"===t)return fe;if("TopBottomSides"===t)return de;if("LeftRightSides"===t)return pe;if("TopLeftSides"===t)return ge;if("TopRightSides"===t)return me;if("BottomLeftSides"===t)return ye;if("BottomRightSides"===t)return ve;if("NotTopSide"===t)return xe;if("NotLeftSide"===t)return be;if("NotRightSide"===t)return we;if("NotBottomSide"===t)return ke;if("AllSides"===t)return Me;if("Default"===t)return Se;t=t.split(" ");for(var e=0,i=0;""===t[e];)e++;var n=t[e++];void 0!==n&&0t&&(t+=360),0===t)return this;if(this.translate(e,i),90===t){t=0;var n=1}else 180===t?(t=-1,n=0):270===t?(t=0,n=-1):(n=t*Math.PI/180,t=Math.cos(n),n=Math.sin(n));var o=this.m12*t+this.m22*n,r=this.m11*-n+this.m21*t,s=this.m12*-n+this.m22*t;return this.m11=this.m11*t+this.m21*n,this.m12=o,this.m21=r,this.m22=s,this.translate(-e,-i),this},(e=Ye.prototype).translate=function(t,e){return this.dx+=this.m11*t+this.m21*e,this.dy+=this.m12*t+this.m22*e,this},e.scale=function(t,e){return void 0===e&&(e=t),this.m11*=t,this.m12*=t,this.m21*=e,this.m22*=e,this},e.Ga=function(t){var e=t.x,i=t.y;return t.h(e*this.m11+i*this.m21+this.dx,e*this.m12+i*this.m22+this.dy)},e.Cd=function(t){var e=1/(this.m11*this.m22-this.m12*this.m21),i=t.x,n=t.y;return t.h(i*this.m22*e+n*-this.m21*e+e*(this.m21*this.dy-this.m22*this.dx),i*-this.m12*e+n*this.m11*e+e*(this.m12*this.dx-this.m11*this.dy))},e.Eu=function(t){var e=1/(this.m11*this.m22-this.m12*this.m21),i=1.25*t.x,n=1.2*t.y;return t.h(i*this.m22*e+n*-this.m21*e+e*(this.m21*this.dy-this.m22*this.dx),i*-this.m12*e+n*this.m11*e+e*(this.m12*this.dx-this.m11*this.dy))},e.pp=function(t){var e=t.x,i=t.y,n=e+t.width,o=i+t.height,r=this.m11,s=this.m12,a=this.m21,h=this.m22,l=this.dx,u=this.dy,c=e*r+i*a+l,f=e*s+i*h+u,d=n*r+i*a+l,p=n*s+i*h+u;return i=e*r+o*a+l,e=e*s+o*h+u,r=n*r+o*a+l,n=n*s+o*h+u,o=Math.min(c,d),c=Math.max(c,d),d=Math.min(f,p),f=Math.max(f,p),o=Math.min(o,i),c=Math.max(c,i),d=Math.min(d,e),f=Math.max(f,e),o=Math.min(o,r),c=Math.max(c,r),d=Math.min(d,n),f=Math.max(f,n),t.h(o,d,c-o,f-d),t},Ye.alloc=function(){var t=Ge.pop();return void 0===t?new Ye:t},Ye.free=function(t){Ge.push(t)},Ye.prototype.transformRect=Ye.prototype.pp,Ye.prototype.transformPoint=Ye.prototype.Ga,Ye.prototype.scale=Ye.prototype.scale,Ye.prototype.translate=Ye.prototype.translate,Ye.prototype.rotate=Ye.prototype.rotate,Ye.prototype.invert=Ye.prototype.Vj,Ye.prototype.multiplyInverted=Ye.prototype.bv,Ye.prototype.multiply=Ye.prototype.multiply,Ye.prototype.reset=Ye.prototype.reset,Ye.prototype.isIdentity=Ye.prototype.ws,Ye.prototype.equals=Ye.prototype.D,Ye.prototype.setTransform=Ye.prototype.setTransform,Ye.prototype.set=Ye.prototype.set;var Ge=[];Ye.className="Transform",Ye.xF="54a702f3e53909c447824c6706603faf4c";var Xe={AA:"7da71ca0ad381e90",wg:(Math.sqrt(2)-1)/3*4,Uv:null,sqrt:function(t){if(0>=t)return 0;var e=Xe.Uv;if(null===e){e=[];for(var i=0;2e3>=i;i++)e[i]=Math.sqrt(i);Xe.Uv=e}return 1>t?2e3>=(i=1/t)?1/e[0|i]:Math.sqrt(t):2e3>=t?e[0|t]:Math.sqrt(t)},B:function(t,e){return.5>(t-=e)&&-.5(t-=e)&&-5e-8=o&&(o=1e-6),tu-l){if(!(t-i>o||i-t>o))return!0;if((r=(n-e)/(i-t)*(r-t)+e)-o<=s&&s<=r+o)return!0}else{if(!(e-n>o||n-e>o))return!0;if((s=(i-t)/(n-e)*(s-e)+t)-o<=r&&r<=s+o)return!0}return!1},cs:function(t,e,i,n,o,r,s,a,h,l,u,c){if(Xe.Yb(t,e,s,a,c,i,n)&&Xe.Yb(t,e,s,a,c,o,r))return Xe.Yb(t,e,s,a,c,l,u);var f=(t+i)/2,d=(e+n)/2,p=(i+o)/2,g=(n+r)/2,m=((n=(f+p)/2)+(p=(p+(o=(o+s)/2))/2))/2,y=((i=(d+g)/2)+(g=(g+(r=(r+a)/2))/2))/2;return Xe.cs(t,e,f,d,n,i,m,y,h,l,u,c)||Xe.cs(m,y,p,g,o,r,s,a,h,l,u,c)},ax:function(t,e,i,n,o,r,s,a,h){var l=(i+o)/2,u=(n+r)/2;return h.h((((t+i)/2+l)/2+(l+(o+s)/2)/2)/2,(((e+n)/2+u)/2+(u+(r+a)/2)/2)/2),h},My:function(t,e,i,n,o,r,s,a){var h=(i+o)/2,l=(n+r)/2;return wt(((t+i)/2+h)/2,((e+n)/2+l)/2,(h+(o+s)/2)/2,(l+(r+a)/2)/2)},Dl:function(t,e,i,n,o,r,s,a,h,l){if(Xe.Yb(t,e,s,a,h,i,n)&&Xe.Yb(t,e,s,a,h,o,r))Gt(l,t,e,0,0),Gt(l,s,a,0,0);else{var u=(t+i)/2,c=(e+n)/2,f=(i+o)/2,d=(n+r)/2,p=((n=(u+f)/2)+(f=(f+(o=(o+s)/2))/2))/2,g=((i=(c+d)/2)+(d=(d+(r=(r+a)/2))/2))/2;Xe.Dl(t,e,u,c,n,i,p,g,h,l),Xe.Dl(p,g,f,d,o,r,s,a,h,l)}return l},Qe:function(t,e,i,n,o,r,s,a,h,l){if(Xe.Yb(t,e,s,a,h,i,n)&&Xe.Yb(t,e,s,a,h,o,r))0===l.length&&(l.push(t),l.push(e)),l.push(s),l.push(a);else{var u=(t+i)/2,c=(e+n)/2,f=(i+o)/2,d=(n+r)/2,p=((n=(u+f)/2)+(f=(f+(o=(o+s)/2))/2))/2,g=((i=(c+d)/2)+(d=(d+(r=(r+a)/2))/2))/2;Xe.Qe(t,e,u,c,n,i,p,g,h,l),Xe.Qe(p,g,f,d,o,r,s,a,h,l)}return l},jv:function(t,e,i,n,o,r,s,a,h,l){if(Xe.Yb(t,e,o,r,l,i,n))return Xe.Yb(t,e,o,r,l,a,h);var u=(t+i)/2,c=(e+n)/2,f=(u+(i=(i+o)/2))/2,d=(c+(n=(n+r)/2))/2;return Xe.jv(t,e,u,c,f,d,s,a,h,l)||Xe.jv(f,d,i,n,o,r,s,a,h,l)},OA:function(t,e,i,n,o,r,s){return s.h(((t+i)/2+(i+o)/2)/2,((e+n)/2+(n+r)/2)/2),s},iv:function(t,e,i,n,o,r,s,a){if(Xe.Yb(t,e,o,r,s,i,n))Gt(a,t,e,0,0),Gt(a,o,r,0,0);else{var h=(t+i)/2,l=(e+n)/2,u=(h+(i=(i+o)/2))/2,c=(l+(n=(n+r)/2))/2;Xe.iv(t,e,h,l,u,c,s,a),Xe.iv(u,c,i,n,o,r,s,a)}return a},ep:function(t,e,i,n,o,r,s,a){if(Xe.Yb(t,e,o,r,s,i,n))0===a.length&&(a.push(t),a.push(e)),a.push(o),a.push(r);else{var h=(t+i)/2,l=(e+n)/2,u=(h+(i=(i+o)/2))/2,c=(l+(n=(n+r)/2))/2;Xe.ep(t,e,h,l,u,c,s,a),Xe.ep(u,c,i,n,o,r,s,a)}return a},Eo:function(t,e,i,n,o,r,s,a,h,l,u,c,f,d){if(Xe.Yb(t,e,s,a,f,i,n)&&Xe.Yb(t,e,s,a,f,o,r))return!!Xe.Rl(t,e,s,a,h,l,u,c)&&(0!=(f=(t-s)*(l-c)-(e-a)*(h-u))&&(d.h(((t*a-e*s)*(h-u)-(t-s)*(h*c-l*u))/f,((t*a-e*s)*(l-c)-(e-a)*(h*c-l*u))/f),!0));var p=(t+i)/2,g=(e+n)/2,m=(i+o)/2,y=(n+r)/2,v=((n=(p+m)/2)+(m=(m+(o=(o+s)/2))/2))/2,x=((i=(g+y)/2)+(y=(y+(r=(r+a)/2))/2))/2,b=1/0,w=!1,k=0,M=0;return Xe.Eo(t,e,p,g,n,i,v,x,h,l,u,c,f,d)&&((t=(d.x-h)*(d.x-h)+(d.y-l)*(d.y-l))=u)return d;if((h>u?h-u:u-h)<(l>c?l-c:c-l)){if(et)return d}else if(tt)return d;0f&&d--}else{g=(e+n)/2;var m=(i+o)/2,y=(n+r)/2,v=((n=((p=(t+i)/2)+m)/2)+(m=(m+(o=(o+s)/2))/2))/2,x=((i=(g+y)/2)+(y=(y+(r=(r+a)/2))/2))/2;d+=Xe.Fo(t,e,p,g,n,i,v,x,h,l,u,c,f),d+=Xe.Fo(v,x,m,y,o,r,s,a,h,l,u,c,f)}return d},qh:function(t,e,i,n,o,r,s){return Xe.$(t,i)?(ee?(s.h(t,e),!1):(s.h(t,r),!0)):Xe.$(e,n)?(tt?(s.h(t,e),!1):(s.h(o,e),!0)):-5e-6>(o=((t-o)*(t-i)+(e-r)*(e-n))/((i-t)*(i-t)+(n-e)*(n-e)))?(s.h(t,e),!1):1.000005e?(h.h(t,e),!1):(h.h(t,i),!0)):(s=(n-e)/(i-t),Xe.$(a,s)?(Xe.qh(t,e,i,n,o,r,h),!1):(o=(s*t-a*o+r-e)/(s-a),Xe.$(s,0)?(tt?(h.h(t,e),!1):(h.h(o,e),!0)):Xe.qh(t,e,i,n,o,s*(o-t)+e,h))))},MA:function(t,e,i,n,o){return Xe.Ve(i.x,i.y,n.x,n.y,t.x,t.y,e.x,e.y,o)},KA:function(t,e,i,n,o,r,s,a,h,l){function u(i,n){var o=(i-t)*(i-t)+(n-e)*(n-e);o(i>t?i-t:t-i)){if(0>(f=1-(i-o)*(i-o)/(f*f)))return h;n=-l*(f=Math.sqrt(f))+r,u(i,l*f+r),u(i,n)}else{if(0>(f=(a=2*(i=(n-e)/(i-t))*(e-i*t)/(l*l)-2*i*r/(l*l)-2*o/(f*f))*a-4*(n=1/(f*f)+i*i/(l*l))*(2*i*t*r/(l*l)-2*e*r/(l*l)+r*r/(l*l)+o*o/(f*f)-1+(e-i*t)*(e-i*t)/(l*l))))return h;u(l=(-a+(f=Math.sqrt(f)))/(2*n),i*l-i*t+e),u(f=(-a-f)/(2*n),i*f-i*t+e)}return h},Ff:function(t,e,i,n,o,r,s,a,h){var l=1e21,u=t,c=e;if(Xe.Ve(t,e,t,n,o,r,s,a,h)){var f=(h.x-o)*(h.x-o)+(h.y-r)*(h.y-r);fl},us:function(t,e,i){return Xe.Fx(t.x,t.y,t.width,t.height,e.x,e.y,i.x,i.y)},Fx:function(t,e,i,n,o,r,s,a){var h=t+i,l=e+n;return o===s?(r=e):r===a?(o=t):!!(Xt(t,e,i,n,o,r)||Xt(t,e,i,n,s,a)||Xe.Rl(t,e,h,e,o,r,s,a)||Xe.Rl(h,e,h,l,o,r,s,a)||Xe.Rl(h,l,t,l,o,r,s,a)||Xe.Rl(t,l,t,e,o,r,s,a))},Rl:function(t,e,i,n,o,r,s,a){return t===i&&e===n&&o===s&&r===a?t===o&&e===r:0>=Xe.Fl(t,e,i,n,o,r)*Xe.Fl(t,e,i,n,s,a)&&0>=Xe.Fl(o,r,s,a,t,e)*Xe.Fl(o,r,s,a,i,n)},Fl:function(t,e,i,n,o,r){return i-=t,0===(r=(t=o-t)*(n-=e)-(e=r-e)*i)&&(0<(r=t*i+e*n)&&(0>(r=(t-i)*i+(e-n)*n)&&(r=0))),r},bp:function(t){return 0>t&&(t+=360),360<=t&&(t-=360),t},jx:function(t,e,i,n,o,r){var s=Math.PI;r||(n*=s/180,o*=s/180);var a=n>o?-1:1;r=[];var h=s/2,l=n;if(1e-5>(n=Math.min(2*s,Math.abs(o-n))))return h=l+a*Math.min(n,h),a=t+i*Math.cos(l),l=e+i*Math.sin(l),t+=i*Math.cos(h),e+=i*Math.sin(h),i=(a+t)/2,h=(l+e)/2,r.push([a,l,i,h,i,h,t,e]),r;for(;1e-5i,r=0>n;if(tl&&((e=.5*(a+h))!==a&&e!==h);++l){var u=t/(e+o),c=s/(e+r);if(0<(u=u*u+c*c-1))a=e;else{if(!(0>u))break;h=e}}i=o*i/(e+o)-i,n=r*n/(e+r)-n,i=Math.sqrt(i*i+n*n)}else i=Math.abs(n-e);else(r=t*i)<(n=t*t-e*e)?(n=r/n,r=e*Math.sqrt(Math.abs(1-n*n)),i=t*n-i,i=Math.sqrt(i*i+r*r)):i=Math.abs(i-t);return i},Ze:new X,um:new X,Mf:new X,Nf:0,vm:100};function Ue(t){Q(this),this.l=2,void 0===t&&(t=Ue.o),this.na=t,this.Ec=this.Dc=this.pd=this.od=0,t===Ue.o?this.ee=new Z:(null===Ue.V&&(Ue.V=(new Z).freeze()),this.ee=Ue.V),this.aq=this.ee.Ja,this.Ip=(new Ot).freeze(),this.ym=this.tk=null,this.zm=NaN,this.fg=te,this.gg=he,this.Rk=this.Sk=NaN,this.Uf=cs}function qe(t,e){return t.type===Ue.j&&e.type===Ue.o&&!!(1===e.figures.count&&(e=e.figures.M(0),1===e.segments.count&&Xe.B(t.startX,e.startX)&&Xe.B(t.startY,e.startY)&&(e=e.segments.M(0),e.type===ni&&Xe.B(t.endX,e.endX)&&Xe.B(t.endY,e.endY))))}function He(t,e,i){switch(t.type){case Ue.j:case Ue.u:case Ue.F:i?e.h(t.od,t.pd,0,0):Gt(e,t.od,t.pd,0,0),Gt(e,t.Dc,t.Ec,0,0);break;case Ue.o:var n=t.figures;t=n.s,n=n.length;for(var o=0;o=t)return 0;if((o>s?o-s:s-o)<(r>a?r-a:a-r)){if(ra)return 0}else if(er)return 0}else if(os)return 0}else if(lo)return 0;return 0(t=r%360)&&(t+=360),this.Ne=t,this.Vh=0,this.Wh=Math.max(n,0),this.Pg=Math.max(o,0),"boolean"==typeof s?s&&(this.isLargeArc=!0):"number"==typeof s&&s&&(this.isLargeArc=!0),a&&(this.isClockwiseArc=!0)):(this.Ne=n,this.Vh=o,t===si&&(r=Math.max(r,0)),this.Wh=r,"number"==typeof s?(t===si&&(s=Math.max(s,0)),this.Pg=s):this.Pg=0),this.ae=null}function ti(t,e){if(null!==t.ae&&!1===e._isInvalidBounds)return t.ae;var i=t.radiusX,n=t.radiusY;if(void 0===n&&(n=i),0===i||0===n)return t.ae=[],t.ae;e=t.Ne;var o=t.Vh,r=Xe.jx(0,0,i=(d=(c*d+l*a)/(Math.sqrt(c*c+l*l)*Math.sqrt(d*d+a*a)))?s=Math.PI:1<=d&&(s=0),!h&&0s&&(s+=2*Math.PI),h=e>r?1:e/r,d=e>r?r/e:1,e=Xe.jx(0,0,e>r?e:r,u,u+s,!0),(r=Ye.alloc()).reset(),r.translate(i,n),r.rotate(t.Ne,0,0),r.scale(h,d),Ue.Ha(e,r),Ye.free(r),t.ae=e,t.ae}Xe.za=Xe.AA,Ue.prototype.copy=function(){var t=new Ue;if(t.l=-2&this.l,t.na=this.na,t.od=this.od,t.pd=this.pd,t.Dc=this.Dc,t.Ec=this.Ec,this.na===Ue.o){for(var e=this.ee.s,i=t.ee,n=0;nt?"M"+this.startX.toString()+" "+this.startY.toString()+"L"+this.endX.toString()+" "+this.endY.toString():"M"+this.startX.toFixed(t)+" "+this.startY.toFixed(t)+"L"+this.endX.toFixed(t)+" "+this.endY.toFixed(t);case Ue.u:var e=new Ot(this.startX,this.startY,0,0);return e.Kv(this.endX,this.endY,0,0),0>t?"M"+e.x.toString()+" "+e.y.toString()+"H"+e.right.toString()+"V"+e.bottom.toString()+"H"+e.left.toString()+"z":"M"+e.x.toFixed(t)+" "+e.y.toFixed(t)+"H"+e.right.toFixed(t)+"V"+e.bottom.toFixed(t)+"H"+e.left.toFixed(t)+"z";case Ue.F:if((e=new Ot(this.startX,this.startY,0,0)).Kv(this.endX,this.endY,0,0),0>t)return"M"+(t=e.left.toString()+" "+(e.y+e.height/2).toString())+"A"+(e.width/2).toString()+" "+(e.height/2).toString()+" 0 0 1 "+e.right.toString()+" "+(e.y+e.height/2).toString()+"A"+(e.width/2).toString()+" "+(e.height/2).toString()+" 0 0 1 "+t;var i=e.left.toFixed(t)+" "+(e.y+e.height/2).toFixed(t);return"M"+i+"A"+(e.width/2).toFixed(t)+" "+(e.height/2).toFixed(t)+" 0 0 1 "+e.right.toFixed(t)+" "+(e.y+e.height/2).toFixed(t)+"A"+(e.width/2).toFixed(t)+" "+(e.height/2).toFixed(t)+" 0 0 1 "+i;case Ue.o:e="";for(var n=(i=this.figures.s).length,o=0;o=b-1||null!==l[g+1].match(w)}function n(){return g++,l[g]}function o(t){var e=parseFloat(n()),i=parseFloat(n());m===m.toLowerCase()&&(e=x.x+e,i=x.y+i),t.h(e,i)}function r(){return o(x),x}function s(){return o(v),v}function a(){var t=y.toLowerCase();return"c"!==t&&"s"!==t&&"q"!==t&&"t"!==t?x:new pt(2*x.x-v.x,2*x.y-v.y)}void 0===e&&(e=!1);var h=/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,l=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/,/gm," ")).replace(h,"$1 $2")).replace(h,"$1 $2")).replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([^s])/gm,"$1 $2")).replace(/([^s])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2")).replace(/([0-9])([+\-])/gm,"$1 $2")).replace(/[\s\r\t\n]+/gm," ")).replace(/^\s+|\s+$/g,"")).split(" ");for(t=0;t=b-1);)if(y=m,""!==(m=n()))switch(m.toUpperCase()){case"X":d=!0,c=u=!1;break;case"M":for(p=r(),null===t.mc||!0===d?(du(t,p.x,p.y,u,!c,f),d=!1):t.moveTo(p.x,p.y),h.assign(x);!i();)p=r(),t.lineTo(p.x,p.y);break;case"L":for(;!i();)p=r(),t.lineTo(p.x,p.y);break;case"H":for(;!i();)x=new pt((m===m.toLowerCase()?x.x:0)+parseFloat(n()),x.y),t.lineTo(x.x,x.y);break;case"V":for(;!i();)x=new pt(x.x,(m===m.toLowerCase()?x.y:0)+parseFloat(n())),t.lineTo(x.x,x.y);break;case"C":for(;!i();){o(p=new pt);var k=s(),M=r();gu(t,p.x,p.y,k.x,k.y,M.x,M.y)}break;case"S":for(;!i();)p=a(),k=s(),M=r(),gu(t,p.x,p.y,k.x,k.y,M.x,M.y);break;case"Q":for(;!i();)p=s(),k=r(),mu(t,p.x,p.y,k.x,k.y);break;case"T":for(;!i();)v=p=a(),k=r(),mu(t,p.x,p.y,k.x,k.y);break;case"B":for(;!i();){p=parseFloat(n()),k=parseFloat(n()),M=parseFloat(n());var S=parseFloat(n()),N=parseFloat(n()),P=N,C=!1;i()||(P=parseFloat(n()),i()||(C=0!==parseFloat(n()))),m===m.toLowerCase()&&(M+=x.x,S+=x.y),t.arcTo(p,k,M,S,N,P,C)}break;case"A":for(;!i();)p=Math.abs(parseFloat(n())),k=Math.abs(parseFloat(n())),M=parseFloat(n()),N=S=!1,C=P=0,1===(P=n()).length?(S=!!parseFloat(P),N=!!parseFloat(n()),P=parseFloat(n())):2===P.length?(S=!!parseFloat(P[0]),N=!!parseFloat(P[1]),P=parseFloat(n())):(S=!!parseFloat(P[0]),N=!!parseFloat(P[1]),P=parseFloat(P.slice(2))),C=parseFloat(n()),m===m.toLowerCase()&&(P=x.x+P,C=x.y+C),x.h(P,C),yu(t,p,k,M,S,N,P,C);break;case"Z":pu(t),x.assign(h);break;case"F":for(p="",k=1;l[g+k];)if("0"===l[g+k])f=!0,k++;else if(null!==l[g+k].match(/[Uu]/))k++;else{if(null!==l[g+k].match(w)){p=l[g+k];break}k++}p.match(/[Mm]/)?u=!0:0(s=180*Math.atan2(e,t)/Math.PI)&&(s+=360),p.startAngle+=s),0>t&&(p.startAngle=180-p.startAngle,p.sweepAngle=-p.sweepAngle),0>n&&(p.startAngle=-p.startAngle,p.sweepAngle=-p.sweepAngle),p.radiusX*=Math.sqrt(t*t+i*i),void 0!==p.radiusY&&(p.radiusY*=Math.sqrt(e*e+n*n));break;case ai:if(s=p.endX,a=p.endY,p.endX=s*t+a*i+o,p.endY=s*e+a*n+r,0===p.radiusX||0===p.radiusY)break;0!==e&&(0>(s=180*Math.atan2(e,t)/Math.PI)&&(s+=360),p.xAxisRotation+=s),0>t&&(p.xAxisRotation=180-p.xAxisRotation,p.isClockwiseArc=!p.isClockwiseArc),0>n&&(p.xAxisRotation=-p.xAxisRotation,p.isClockwiseArc=!p.isClockwiseArc),p.radiusX*=Math.sqrt(t*t+i*i),p.radiusY*=Math.sqrt(e*e+n*n);break;default:w("Unknown Segment type: "+p.type)}}}}return this._isInvalidBounds=!0,this},e.ca=function(t,e){void 0===e&&(e=0);var i=this.od,n=this.pd,o=this.Dc,r=this.Ec;switch(this.type){case Ue.j:return Xe.Yb(i,n,o,r,e,t.x,t.y);case Ue.u:var s=Ot.allocAt(Math.min(i,o)-e,Math.min(n,r)-e,Math.abs(o-i)+2*e,Math.abs(r-n)+2*e);return t=s.ca(t),Ot.free(s),t;case Ue.F:s=Math.min(i,o)-e;var a=Math.min(n,r)-e;return i=(Math.abs(o-i)+2*e)/2,e=(Math.abs(r-n)+2*e)/2,0>=i||0>=e?!1:1>=(s=t.x-(s+i))*s/(i*i)+(a=t.y-(a+e))*a/(e*e);case Ue.o:return Ke(this,t,e,!0,!1);default:return!1}},e.Pu=function(t,e){if(0>t?t=0:1=r)return n=r-s,n=0===u?0:n/u,a=(i=i[a])[2*t],o=i[2*t+1],e.h(a+(i[2*t+2]-a)*n,o+(i[2*t+3]-o)*n),e;s+=u}}return e},e.wx=function(t){if(0>t?t=0:1=o)return e=(o=e[s])[2*t],i=o[2*t+1],n=o[2*t+2],t=o[2*t+3],1>Math.abs(n-e)&&1>Math.abs(t-i)?0:1>Math.abs(n-e)?0<=t-i?90:270:1>Math.abs(t-i)?0<=n-e?0:180:180*Math.atan2(t-i,n-e)/Math.PI;r+=l}}return NaN},e.Qu=function(t,e){if(0>t?t=0:1=r)return n=r-s,n=0===u?0:n/u,i=(u=i[a])[2*t],a=u[2*t+1],o=u[2*t+2],t=u[2*t+3],e[0]=i+(o-i)*n,e[1]=a+(t-a)*n,e[2]=1>Math.abs(o-i)&&1>Math.abs(t-a)?0:1>Math.abs(o-i)?0<=t-a?90:270:1>Math.abs(t-a)?0<=o-i?0:180:180*Math.atan2(t-a,o-i)/Math.PI,e;s+=u}}return e},e.xx=function(t){if(this.type===Ue.j){var e=this.startX,i=this.startY,n=this.endX,o=this.endY;if(e!==n||i!==o){var r=t.x;if(t=t.y,e===n){if(i=n?n===i?0:1:Math.abs(t-i)/(n-s)}if(i===o)return e=n?n===e?0:1:Math.abs(r-e)/(n-s);s=(n-e)*(n-e)+(o-i)*(o-i);var a=pt.alloc();return Xe.qh(e,i,n,o,r,t,a),t=a.x,r=a.y,pt.free(a),Math.sqrt(((t-e)*(t-e)+(r-i)*(r-i))/s)}}else{if(this.type!==Ue.u){e=this.flattenedSegments,i=this.flattenedLengths,r=this.flattenedTotalLength,n=pt.alloc(),o=1/0,a=s=0,y=e.length;for(var h=v=0,l=0;l(t=s/r)?0:1t?"M"+this.startX.toString()+" "+this.startY.toString():"M"+this.startX.toFixed(t)+" "+this.startY.toFixed(t),i=this.segments.s,n=i.length,o=0;ot?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;case ni:t=0>t?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;case oi:t=0>t?"C"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.point2X.toString()+" "+this.point2Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"C"+this.point1X.toFixed(t)+" "+this.point1Y.toFixed(t)+" "+this.point2X.toFixed(t)+" "+this.point2Y.toFixed(t)+" "+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;case ri:t=0>t?"Q"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"Q"+this.point1X.toFixed(t)+" "+this.point1Y.toFixed(t)+" "+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;case si:t=0>t?"B"+this.startAngle.toString()+" "+this.sweepAngle.toString()+" "+this.centerX.toString()+" "+this.centerY.toString()+" "+this.radiusX.toString()+" "+this.radiusY.toString():"B"+this.startAngle.toFixed(t)+" "+this.sweepAngle.toFixed(t)+" "+this.centerX.toFixed(t)+" "+this.centerY.toFixed(t)+" "+this.radiusX.toFixed(t)+" "+this.radiusY.toFixed(t);break;case ai:t=0>t?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.xAxisRotation.toString()+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toString()+" "+this.endY.toString():"A"+this.radiusX.toFixed(t)+" "+this.radiusY.toFixed(t)+" "+this.xAxisRotation.toFixed(t)+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;default:t=this.type.toString()}return t+(this.isClosed?"z":"")},e.freeze=function(){return this._isFrozen=!0,this},e.ka=function(){return this._isFrozen=!1,this},e.close=function(){return this.isClosed=!0,this},f.Object.defineProperties(Qe.prototype,{_isFrozen:{get:function(){return 0!=(1&this.l)},set:function(t){this.l=t?1|this.l:-2&this.l}},_isInvalidBounds:{get:function(){return 0!=(2&this.l)},set:function(t){this.l=t?2|this.l:-3&this.l}},isClosed:{get:function(){return 0!=(8&this.l)},set:function(t){this.isClosed!==t&&(this.l=t?8|this.l:-9&this.l,this._isInvalidBounds=!0)}},type:{get:function(){return this.na},set:function(t){this._isFrozen&&k(this,t),this.na=t,this._isInvalidBounds=!0}},endX:{get:function(){return this.Dc},set:function(t){this._isFrozen&&k(this,t),this.Dc=t,this._isInvalidBounds=!0}},endY:{get:function(){return this.Ec},set:function(t){this._isFrozen&&k(this,t),this.Ec=t,this._isInvalidBounds=!0}},point1X:{get:function(){return this.Ne},set:function(t){this._isFrozen&&k(this,t),this.Ne=t,this._isInvalidBounds=!0}},point1Y:{get:function(){return this.Vh},set:function(t){this._isFrozen&&k(this,t),this.Vh=t,this._isInvalidBounds=!0}},point2X:{get:function(){return this.Wh},set:function(t){this._isFrozen&&k(this,t),this.Wh=t,this._isInvalidBounds=!0}},point2Y:{get:function(){return this.Pg},set:function(t){this._isFrozen&&k(this,t),this.Pg=t,this._isInvalidBounds=!0}},centerX:{get:function(){return this.Ne},set:function(t){this._isFrozen&&k(this,t),this.Ne=t,this._isInvalidBounds=!0}},centerY:{get:function(){return this.Vh},set:function(t){this._isFrozen&&k(this,t),this.Vh=t,this._isInvalidBounds=!0}},radiusX:{get:function(){return this.Wh},set:function(t){0>t&&M(t,">= zero",Qe,"radiusX"),this._isFrozen&&k(this,t),this.Wh=t,this._isInvalidBounds=!0}},radiusY:{get:function(){return this.Pg},set:function(t){0>t&&M(t,">= zero",Qe,"radiusY"),this._isFrozen&&k(this,t),this.Pg=t,this._isInvalidBounds=!0}},startAngle:{get:function(){return this.Dc},set:function(t){this._isFrozen&&k(this,t),0>(t%=360)&&(t+=360),this.Dc=t,this._isInvalidBounds=!0}},sweepAngle:{get:function(){return this.Ec},set:function(t){this._isFrozen&&k(this,t),360t&&(t=-360),this.Ec=t,this._isInvalidBounds=!0}},isClockwiseArc:{get:function(){return 0!=(4&this.l)},set:function(t){this._isFrozen&&k(this,t),this.l=t?4|this.l:-5&this.l,this._isInvalidBounds=!0}},isLargeArc:{get:function(){return 0!=(16&this.l)},set:function(t){this._isFrozen&&k(this,t),this.l=t?16|this.l:-17&this.l,this._isInvalidBounds=!0}},xAxisRotation:{get:function(){return this.Ne},set:function(t){this._isFrozen&&k(this,t),0>(t%=360)&&(t+=360),this.Ne=t,this._isInvalidBounds=!0}}}),Qe.prototype.equalsApprox=Qe.prototype.Xa;var ii=new V(Qe,"Move",0),ni=new V(Qe,"Line",1),oi=new V(Qe,"Bezier",2),ri=new V(Qe,"QuadraticBezier",3),si=new V(Qe,"Arc",4),ai=new V(Qe,"SvgArc",4);function hi(){this.H=null,this.xu=new pt(0,0).freeze(),this.mt=new pt(0,0).freeze(),this.Bp=this.Rq=0,this.Cp=1,this.xq="",this.Wr=this.Tp=!1,this.Rp=this.Ep=0,this.xg=this.nq=this.tq=!1,this.Zp=null,this.Rr=0,this.xd=this.Nr=null}function li(){this.H=null,this.xa="",this.ar=this.Lr=null}function ui(){this.Fm=fi,this.rf=this.Qq="",this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null}Qe.className="PathSegment",Qe.Move=ii,Qe.Line=ni,Qe.Bezier=oi,Qe.QuadraticBezier=ri,Qe.Arc=si,Qe.SvgArc=ai,hi.prototype.copy=function(){var t=new hi;return this.clone(t)},hi.prototype.clone=function(t){return t.H=this.H,t.xu.assign(this.viewPoint),t.mt.assign(this.documentPoint),t.Rq=this.Rq,t.Bp=this.Bp,t.Cp=this.Cp,t.xq=this.xq,t.Tp=this.Tp,t.Wr=this.Wr,t.Ep=this.Ep,t.Rp=this.Rp,t.tq=this.tq,t.nq=this.nq,t.xg=this.xg,t.Zp=this.Zp,t.Rr=this.Rr,t.Nr=this.Nr,t.xd=this.xd,t},hi.prototype.toString=function(){var t="^";return 0!==this.modifiers&&(t+="M:"+this.modifiers),0!==this.button&&(t+="B:"+this.button),""!==this.key&&(t+="K:"+this.key),0!==this.clickCount&&(t+="C:"+this.clickCount),0!==this.delta&&(t+="D:"+this.delta),this.handled&&(t+="h"),this.bubbles&&(t+="b"),null!==this.documentPoint&&(t+="@"+this.documentPoint.toString()),t},hi.prototype.So=function(t,e){var i=this.diagram;return null===i||Zo(i,t,e),e},hi.prototype.Bz=function(t,e){var i=this.diagram;return null===i||(Zo(i,t,e),e.assign(i.Ps(e))),e},f.Object.defineProperties(hi.prototype,{diagram:{get:function(){return this.H},set:function(t){this.H=t}},viewPoint:{get:function(){return this.xu},set:function(t){this.xu.assign(t)}},documentPoint:{get:function(){return this.mt},set:function(t){this.mt.assign(t)}},modifiers:{get:function(){return this.Rq},set:function(t){this.Rq=t}},button:{get:function(){return this.Bp},set:function(t){if(this.Bp=t,null===this.event)switch(t){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}}},buttons:{get:function(){return this.Cp},set:function(t){this.Cp=t}},key:{get:function(){return this.xq},set:function(t){this.xq=t}},down:{get:function(){return this.Tp},set:function(t){this.Tp=t}},up:{get:function(){return this.Wr},set:function(t){this.Wr=t}},clickCount:{get:function(){return this.Ep},set:function(t){this.Ep=t}},delta:{get:function(){return this.Rp},set:function(t){this.Rp=t}},isMultiTouch:{get:function(){return this.tq},set:function(t){this.tq=t}},handled:{get:function(){return this.nq},set:function(t){this.nq=t}},bubbles:{get:function(){return this.xg},set:function(t){this.xg=t}},event:{get:function(){return this.Zp},set:function(t){this.Zp=t}},isTouchEvent:{get:function(){var t=this.event;return null!==t&&("touch"===t.pointerType||"pen"===t.pointerType)}},timestamp:{get:function(){return this.Rr},set:function(t){this.Rr=t}},targetDiagram:{get:function(){return this.Nr},set:function(t){this.Nr=t}},targetObject:{get:function(){return this.xd},set:function(t){this.xd=t}},control:{get:function(){return 0!=(1&this.modifiers)},set:function(t){this.modifiers=t?1|this.modifiers:-2&this.modifiers}},shift:{get:function(){return 0!=(4&this.modifiers)},set:function(t){this.modifiers=t?4|this.modifiers:-5&this.modifiers}},alt:{get:function(){return 0!=(2&this.modifiers)},set:function(t){this.modifiers=t?2|this.modifiers:-3&this.modifiers}},meta:{get:function(){return 0!=(8&this.modifiers)},set:function(t){this.modifiers=t?8|this.modifiers:-9&this.modifiers}},left:{get:function(){var t=this.event;return null===t||"mousedown"!==t.type&&"mouseup"!==t.type&&"pointerdown"!==t.type&&"pointerup"!==t.type?0!=(1&this.buttons):0===this.button},set:function(t){this.buttons=t?1|this.buttons:-2&this.buttons}},right:{get:function(){var t=this.event;return null===t||"mousedown"!==t.type&&"mouseup"!==t.type&&"pointerdown"!==t.type&&"pointerup"!==t.type?0!=(2&this.buttons):2===this.button},set:function(t){this.buttons=t?2|this.buttons:-3&this.buttons}},middle:{get:function(){var t=this.event;return null===t||"mousedown"!==t.type&&"mouseup"!==t.type&&"pointerdown"!==t.type&&"pointerup"!==t.type?0!=(4&this.buttons):1===this.button},set:function(t){this.buttons=t?4|this.buttons:-5&this.buttons}}}),hi.prototype.getMultiTouchDocumentPoint=hi.prototype.Bz,hi.prototype.getMultiTouchViewPoint=hi.prototype.So,hi.className="InputEvent",li.prototype.copy=function(){var t=new li;return t.H=this.H,t.xa=this.xa,t.Lr=this.Lr,t.ar=this.ar,t},li.prototype.toString=function(){var t="*"+this.name;return null!==this.subject&&(t+=":"+this.subject.toString()),null!==this.parameter&&(t+="("+this.parameter.toString()+")"),t},f.Object.defineProperties(li.prototype,{diagram:{get:function(){return this.H},set:function(t){this.H=t}},name:{get:function(){return this.xa},set:function(t){this.xa=t}},subject:{get:function(){return this.Lr},set:function(t){this.Lr=t}},parameter:{get:function(){return this.ar},set:function(t){this.ar=t}}}),li.className="DiagramEvent",ui.prototype.clear=function(){this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null},ui.prototype.copy=function(){var t=new ui;t.Fm=this.Fm,t.Qq=this.Qq,t.rf=this.rf,t.cc=this.cc,t.H=this.H,t.Qn=this.Qn;var e=this.Sn;return t.Sn=N(e)&&"function"==typeof e.J?e.J():e,e=this.Rn,t.Rn=N(e)&&"function"==typeof e.J?e.J():e,e=this.Mn,t.Mn=N(e)&&"function"==typeof e.J?e.J():e,e=this.Ln,t.Ln=N(e)&&"function"==typeof e.J?e.J():e,t},ui.prototype.qb=function(t){t.classType===ui&&(this.change=t)},ui.prototype.toString=function(){var t="";return t=this.change===ci?t+"* ":this.change===fi?t+(null!==this.model?"!m":"!d"):t+(null!==this.model?"!m":"!d")+this.change,this.propertyName&&"string"==typeof this.propertyName&&(t+=" "+this.propertyName),this.modelChange&&this.modelChange!==this.propertyName&&(t+=" "+this.modelChange),t+=": ",this.change===ci?null!==this.oldValue&&(t+=" "+this.oldValue):(null!==this.object&&(t+=D(this.object)),null!==this.oldValue&&(t+=" old: "+D(this.oldValue)),null!==this.oldParam&&(t+=" "+this.oldParam),null!==this.newValue&&(t+=" new: "+D(this.newValue)),null!==this.newParam&&(t+=" "+this.newParam)),t},ui.prototype.I=function(t){return t?this.oldValue:this.newValue},ui.prototype.Dz=function(t){return t?this.oldParam:this.newParam},ui.prototype.canUndo=function(){return null!==this.model||null!==this.diagram},ui.prototype.undo=function(){this.canUndo()&&(null!==this.model?this.model.changeState(this,!0):null!==this.diagram&&this.diagram.changeState(this,!0))},ui.prototype.canRedo=function(){return null!==this.model||null!==this.diagram},ui.prototype.redo=function(){this.canRedo()&&(null!==this.model?this.model.changeState(this,!1):null!==this.diagram&&this.diagram.changeState(this,!1))},f.Object.defineProperties(ui.prototype,{model:{get:function(){return this.cc},set:function(t){this.cc=t}},diagram:{get:function(){return this.H},set:function(t){this.H=t}},change:{get:function(){return this.Fm},set:function(t){this.Fm=t}},modelChange:{get:function(){return this.Qq},set:function(t){this.Qq=t}},propertyName:{get:function(){return this.rf},set:function(t){this.rf=t}},isTransactionFinished:{get:function(){return this.Fm===ci&&("CommittedTransaction"===this.rf||"FinishedUndo"===this.rf||"FinishedRedo"===this.rf)}},object:{get:function(){return this.Qn},set:function(t){this.Qn=t}},oldValue:{get:function(){return this.Sn},set:function(t){this.Sn=t}},oldParam:{get:function(){return this.Rn},set:function(t){this.Rn=t}},newValue:{get:function(){return this.Mn},set:function(t){this.Mn=t}},newParam:{get:function(){return this.Ln},set:function(t){this.Ln=t}}}),ui.prototype.redo=ui.prototype.redo,ui.prototype.canRedo=ui.prototype.canRedo,ui.prototype.undo=ui.prototype.undo,ui.prototype.canUndo=ui.prototype.canUndo,ui.prototype.getParam=ui.prototype.Dz,ui.prototype.getValue=ui.prototype.I,ui.prototype.clear=ui.prototype.clear;var ci=new V(ui,"Transaction",-1),fi=new V(ui,"Property",0),di=new V(ui,"Insert",1),pi=new V(ui,"Remove",2);function gi(){this.o=(new Z).freeze(),this.xa="",this.j=!1}function mi(){this.Pt=new _,this.Jd=!1,this.u=(new Z).freeze(),this.Ce=-1,this.o=999,this.Fe=!1,this.Np=null,this.bi=0,this.j=!1,this.Ie=(new Z).freeze(),this.hl=new Z,this.tt=!0,this.Dt=this.rq=this.Gt=this.Ft=!1}function yi(t,e,i){if(t.isUndoingRedoing)return!1;t.checksTransactionLevel&&1>t.transactionLevel&&S("Ending transaction without having started a transaction: "+i);var n=1===t.transactionLevel,o=t.currentTransaction;n&&e&&(t.isInternalTransaction||t.Ob("CommittingTransaction",i,o));var r=0;if(0=n&&(null!==(r=e.M(0))&&r.clear(),e.mb(0),t.Ce--)),0===n||0!==e.count&&e.get(e.count-1)===o||(e.add(o),t.Ce++),e.freeze()),t.isInternalTransaction||t.Ob("CommittedTransaction",i,o);else{t.Fe=!0;try{t.isEnabled&&null!==o&&(o.isComplete=!0,o.undo())}finally{t.isInternalTransaction||t.Ob("RolledBackTransaction",i,o),t.Fe=!1}null!==o&&o.clear()}return t.Np=null,t.isPendingClear&&t.clear(),t.isPendingClear=!1,t.isPendingUnmodified=!1,!0}if(t.isEnabled&&!e&&null!==o){for(t=r,o=(i=o.changes).count-1;o>=t;o--)null!==(e=i.M(o))&&e.undo(),i.ka(),i.mb(o);i.freeze()}return!1}function vi(){Q(this),this.H=bo,this.xa="",this.Jd=!0,this.nb=!1,this.wm=null,this.yy=new hi,this.Zr=-1}function xi(){vi.call(this),this.name="ToolManager",this.hb=new Z,this.ob=new Z,this.Hb=new Z,this.F=this.V=850,this.o=new At(2,2).ja(),this.Ha=5e3,this.ia=ki,this.u=Ni,this.Mp=this.j=null,this.zj=-1}function bi(t,e){t.standardMouseOver(),t.isBeyondDragSize()&&t.standardWaitAfter(t.isActive?t.holdDelay:t.hoverDelay,e.lastInput)}ui.className="ChangedEvent",ui.Transaction=ci,ui.Property=fi,ui.Insert=di,ui.Remove=pi,gi.prototype.toString=function(t){var e="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(void 0!==t&&0e&&t.cd(e,n),e++);for(;t.length>e;)t.pop();t.freeze()}},f.Object.defineProperties(gi.prototype,{changes:{get:function(){return this.o}},name:{get:function(){return this.xa},set:function(t){this.xa=t}},isComplete:{get:function(){return this.j},set:function(t){this.j=t}}}),gi.prototype.optimize=gi.prototype.ak,gi.prototype.redo=gi.prototype.redo,gi.prototype.canRedo=gi.prototype.canRedo,gi.prototype.undo=gi.prototype.undo,gi.prototype.canUndo=gi.prototype.canUndo,gi.prototype.clear=gi.prototype.clear,gi.className="Transaction",mi.prototype.toString=function(t){var e="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength;e+="[";for(var i=this.nestedTransactionNames.count,n=0;nthis.historyIndex;e--){var i=t.M(e);null!==i&&i.clear(),t.mb(e),this.rq=!0}t.freeze()}},mi.prototype.canUndo=function(){if(!this.isEnabled||0=this.transactionLevel&&!this.tt&&(null!==(t=t.diagram)&&!1===t.pi||S("Change not within a transaction: "+i.toString()))}},mi.prototype.skipsEvent=function(t){if(null===t||0>t.change.value)return!0;if(null===(t=t.object))return!1;if(void 0!==t.layer){if(null!==(t=t.layer)&&t.isTemporary)return!0}else if(t.isTemporary)return!0;return!1},f.Object.defineProperties(mi.prototype,{models:{get:function(){return this.Pt.iterator}},isEnabled:{get:function(){return this.Jd},set:function(t){this.Jd=t}},transactionToUndo:{get:function(){return 0<=this.historyIndex&&this.historyIndex<=this.history.count-1?this.history.M(this.historyIndex):null}},transactionToRedo:{get:function(){return this.historyIndexo||Math.abs(e.y-t.y)>n},f.Object.defineProperties(vi.prototype,{diagram:{get:function(){return this.H},set:function(t){t instanceof To&&(this.H=t)}},name:{get:function(){return this.xa},set:function(t){this.xa=t}},isEnabled:{get:function(){return this.Jd},set:function(t){this.Jd=t}},isActive:{get:function(){return this.nb},set:function(t){this.nb=t}},transactionResult:{get:function(){return this.wm},set:function(t){this.wm=t}}}),vi.prototype.startTransaction=vi.prototype.Ea,vi.className="Tool",c(xi,vi),xi.prototype.initializeStandardTools=function(){},xi.prototype.updateAdornments=function(t){var e=this.currentToolTip;if(e instanceof Ku&&this.Mp===t){var i=e.adornedObject;(null!==t?i.part===t:null===i)?this.showToolTip(e,i):this.hideToolTip()}},xi.prototype.doMouseDown=function(){var t=this.diagram,e=t.lastInput;if(e.isTouchEvent&&this.gestureBehavior===Pi&&(e.bubbles=!1),e.isMultiTouch){if(this.cancelWaitAfter(),this.gestureBehavior===Ci)return void(e.bubbles=!0);if(this.gestureBehavior===Pi)return;if(t.currentTool.canStartMultiTouch())return void t.currentTool.standardPinchZoomStart()}for(var i=this.mouseDownTools.length,n=0;no.right&&(i.x-=n.width+5/e.scale),i.xo.bottom?i.y-(n.height+5/e.scale):i.y+20/e.scale,i.yi.pointsCount)){var n=t.diagram;if(!n.isReadOnly){var o=t.Oe;if(null!==o){var r=null,s=null;null===i.fromNode&&(null!==(r=Vi(t,i.i(0),!1))&&(s=r.part));var a=null,h=null;null===i.toNode&&(null!==(a=Vi(t,i.i(i.pointsCount-1),!0))&&(h=a.part)),o.isValidLink(s,r,h,a)?e?(i.defaultFromPoint=i.i(0),i.defaultToPoint=i.i(i.pointsCount-1),i.suspendsRouting=!1,i.fromNode=s,null!==r&&(i.fromPortId=r.portId),i.toNode=h,null!==a&&(i.toPortId=a.portId),i.fromPort!==n.Mx&&n.R("LinkRelinked",i,n.Mx),i.toPort!==n.Nx&&n.R("LinkRelinked",i,n.Nx)):rn(o,s,r,h,a):rn(o,null,null,null,null)}}}}function Gi(t,e){var i=t.diagram;t.dragsLink&&Yi(t,!0),Ai(t);var n=t.findDragOverObject(e),o=i.lastInput;if(o.targetObject=n,null!==n){o.handled=!1;for(var r=n;null!==r;){var s=r.mouseDrop;if(null!==s&&(s(o,r),o.handled))break;Xi(t,o,r),r=Ei(r)}}else null!==(r=i.mouseDrop)&&r(o);if(t.isActive||null!==Hi){for(o=(t.copiedParts||t.draggedParts).iterator;o.next();)(r=o.key)instanceof Ju&&r.linksConnected.each((function(t){t.suspendsRouting=!1}));if(t.doDropOnto(e,n),t.isActive||null!==Hi){for(t=Ot.alloc(),e=i.selection.iterator;e.next();)(n=e.value)instanceof Ju&&Ui(i,n,t);Ot.free(t)}}}function Xi(t,e,i){t=t.diagram,i=i.part,!t.handlesDragDropForTopLevelParts||!i.isTopLevel||i instanceof gc||null!==(i=t.mouseDrop)&&i(e)}function Ui(t,e,i){var n=!1;if(i=e.getAvoidableRect(i),t.viewportBounds.Re(i)&&(n=!0),0!==(t=t.Nu(i,(function(t){return t.part}),(function(t){return t instanceof wc}),!0,(function(t){return t instanceof wc}),n)).count)for(t=t.iterator;t.next();)!(i=t.value).Td(e)&&i.isAvoiding&&i.bb()}function qi(t,e,i,n){if(null===t.copiedParts){var o=t.diagram;if(!o.isReadOnly&&!o.isModelReadOnly){o.skipsUndoManager=!i,o.partManager.addsToTemporaryLayer=!i,t.startPoint=n.documentPoint,i=o.Kj(e,o,!0);var r=Ot.alloc();o=n=1/0;for(var s=-1/0,a=-1/0,h=e.iterator;h.next();){var l=h.value;if(l.isVisible()){var u=l.location;l=u.x,u=u.y,isNaN(l)||isNaN(u)||(ls&&(s=l),u>a&&(a=u))}}for(1/0===n?r.h(0,0,0,0):r.h(n,o,s-n,a-o),n=r.x+r.width/2,o=r.y+r.height/2,Ot.free(r),r=t.Fr,s=new dt,a=pt.alloc(),h=e.iterator;h.next();)(l=h.value)instanceof wc&&l.canCopy()&&(null!==(u=i.I(l))&&(u.points=l.points,Sc(u,r.x-n,r.y-o),u.suspendsRouting=!0,s.add(u,t.Pd())));for(e=e.iterator;e.next();)(l=e.value).Zc()&&l.canCopy()&&(null!==(h=i.I(l))&&(l=l.location,a.h(r.x-(n-l.x),r.y-(o-l.y)),h.location=a,h.Va(),s.add(h,t.Pd(a))));pt.free(a),t.copiedParts=s,Li(t,s.Lf()),null!==t.draggedLink&&(e=(i=t.draggedLink).routeBounds,Sc(i,t.startPoint.x-(e.x+e.width/2),t.startPoint.y-(e.y+e.height/2))),t.doUpdateCursor(null)}}}xi.className="ToolManager",xi.WheelScroll=ki,xi.WheelZoom=Mi,xi.WheelNone=Si,xi.GestureZoom=Ni,xi.GestureCancel=Pi,xi.GestureNone=Ci,c(Ti,vi),Ti.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;if(t.isReadOnly&&!t.allowDragOut||!t.allowMove&&!t.allowCopy&&!t.allowDragOut||!t.allowSelect)return!1;var e=t.lastInput;return!(!e.left||t.currentTool!==this&&(!this.isBeyondDragSize()||e.isTouchEvent&&e.timestamp-t.firstInput.timestamp=n&&(n=.1);var o=this,r=e.og(i,n,(function(e){return o.findValidLinkablePort(e,t)}),null,!0);for(n=1/0,e=null,r=r.iterator;r.next();){var s=r.value,a=s.part;if(a instanceof Ju){var h=s.ga(oe,pt.alloc()),l=i.x-h.x,u=i.y-h.y;pt.free(h),(h=l*l+u*u)i){if(null!==this.originalLink&&t===this.originalFromNode&&e===this.originalFromPort)return!0;if(null===(e=e.portId)&&(e=""),t.Mo(e).count>=i)return!1}return!0},Wi.prototype.isValidTo=function(t,e){if(null===t||null===e)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(null!==t.layer&&!t.layer.allowLink||!0!==e.toLinkable))return!1;var i=e.toMaxLinks;if(1/0>i){if(null!==this.originalLink&&t===this.originalToNode&&e===this.originalToPort)return!0;if(null===(e=e.portId)&&(e=""),t.Sd(e).count>=i)return!1}return!0},Wi.prototype.isInSameNode=function(t,e){return null!==t&&null!==e&&(t===e||(t=t.part,e=e.part,null!==t&&t===e))},Wi.prototype.isLinked=function(t,e){if(null===t||null===e)return!1;var i=t.part;if(!(i instanceof Ju))return!1;null===(t=t.portId)&&(t="");var n=e.part;if(!(n instanceof Ju))return!1;for(null===(e=e.portId)&&(e=""),e=n.Sd(e);e.next();)if((n=e.value).fromNode===i&&n.fromPortId===t)return!0;return!1},Wi.prototype.isValidLink=function(t,e,i,n){if(!this.isValidFrom(t,e)||!this.isValidTo(i,n)||!(null===e||null===n||(e.fromLinkableSelfNode&&n.toLinkableSelfNode||!this.isInSameNode(e,n))&&(e.fromLinkableDuplicates&&n.toLinkableDuplicates||!this.isLinked(e,n)))||null!==this.originalLink&&(null!==t&&this.isLabelDependentOnLink(t,this.originalLink)||null!==i&&this.isLabelDependentOnLink(i,this.originalLink))||null!==t&&null!==i&&(null===t.data&&null!==i.data||null!==t.data&&null===i.data)||!this.isValidCycle(t,i,this.originalLink))return!1;if(null!==t){var o=t.linkValidation;if(null!==o&&!o(t,e,i,n,this.originalLink))return!1}return!(null!==i&&null!==(o=i.linkValidation)&&!o(t,e,i,n,this.originalLink))&&(null===(o=this.linkValidation)||o(t,e,i,n,this.originalLink))},Wi.prototype.isLabelDependentOnLink=function(t,e){if(null===t)return!1;var i=t.labeledLink;if(null===i)return!1;if(i===e)return!0;var n=new _;return n.add(t),Ji(this,i,e,n)},Wi.prototype.isValidCycle=function(t,e,i){if(void 0===i&&(i=null),null===t||null===e)return this.isUnconnectedLinkValid;var n=this.diagram.validCycle;if(n!==Hr){if(n===Zr){if(null!==(n=i||this.temporaryLink)&&!n.isTreeLink)return!0;for(n=e.linksConnected;n.next();){var o=n.value;if(o!==i&&o.isTreeLink&&o.toNode===e)return!1}return!Zi(this,t,e,i,!0)}if(n===$r){if(null!==(n=i||this.temporaryLink)&&!n.isTreeLink)return!0;for(n=t.linksConnected;n.next();)if((o=n.value)!==i&&o.isTreeLink&&o.fromNode===t)return!1;return!Zi(this,t,e,i,!0)}if(n===Kr)return t===e?t=!0:((n=new _).add(e),t=$i(this,n,t,e,i)),!t;if(n===Wr)return!Zi(this,t,e,i,!1);if(n===Jr)return t===e?t=!0:((n=new _).add(e),t=_i(this,n,t,e,i)),!t}return!0},f.Object.defineProperties(Wi.prototype,{portGravity:{get:function(){return this.te},set:function(t){0<=t&&(this.te=t)}},isUnconnectedLinkValid:{get:function(){return this.Ha},set:function(t){this.Ha=t}},linkingCursor:{get:function(){return this.u},set:function(t){this.u=t}},temporaryLink:{get:function(){return this.Ci},set:function(t){this.Ci=t}},temporaryFromNode:{get:function(){return this.Bi},set:function(t){(this.Bi=t)&&(this.j=t.port)}},temporaryFromPort:{get:function(){return this.j},set:function(t){if(null!==this.j){var e=this.j.panel;if(null!==e){var i=e.O.indexOf(this.j);e.mb(i),e.Gb(i,t)}}this.j=t}},temporaryToNode:{get:function(){return this.Di},set:function(t){(this.Di=t)&&(this.o=t.port)}},temporaryToPort:{get:function(){return this.o},set:function(t){if(null!==this.o){var e=this.o.panel;if(null!==e){var i=e.O.indexOf(this.o);e.mb(i),e.Gb(i,t)}}this.o=t}},originalLink:{get:function(){return this.Hb},set:function(t){this.Hb=t}},originalFromNode:{get:function(){return this.hb},set:function(t){this.hb=t}},originalFromPort:{get:function(){return this.ob},set:function(t){this.ob=t}},originalToNode:{get:function(){return this.Oc},set:function(t){this.Oc=t}},originalToPort:{get:function(){return this.Pc},set:function(t){this.Pc=t}},isForwards:{get:function(){return this.ia},set:function(t){this.ia=t}},validPortsCache:{get:function(){return this.hy}},targetPort:{get:function(){return this.Pf},set:function(t){this.Pf=t}},linkValidation:{get:function(){return this.gj},set:function(t){this.gj=t}},portTargeted:{get:function(){return this.Of},set:function(t){this.Of=t}}}),Wi.className="LinkingBaseTool",c(Qi,Wi),Qi.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return!(t.isReadOnly||t.isModelReadOnly||!t.allowLink||!t.model.xs()||!t.lastInput.left||t.currentTool!==this&&!this.isBeyondDragSize())&&null!==this.findLinkablePort()},Qi.prototype.findLinkablePort=function(){var t=this.diagram,e=this.startObject;if(null===e&&(e=t.ic(t.firstInput.documentPoint,null,null)),null===e)return null;if(!((t=e.part)instanceof Ju))return null;var i=this.direction;if(i===tn||i===en){var n=this.findValidLinkablePort(e,!1);if(null!==n||this.startObject===t&&(n=t.port,this.findValidLinkablePort(n,!1)))return this.isForwards=!0,n}return(i===tn||i===nn)&&(null!==(e=this.findValidLinkablePort(e,!0))||this.startObject===t&&(e=t.port,this.findValidLinkablePort(e,!0)))?(this.isForwards=!1,e):null},Qi.prototype.doActivate=function(){var t=this.diagram,e=this.findLinkablePort();null===e?this.stopTool():(this.Ea(this.name),t.isMouseCaptured=!0,t.currentCursor=this.linkingCursor,this.isForwards?(null!==this.temporaryToNode&&(this.temporaryToNode.location=t.lastInput.documentPoint),this.originalFromPort=e,(e=this.originalFromPort.part)instanceof Ju&&(this.originalFromNode=e),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1)):(null!==this.temporaryFromNode&&(this.temporaryFromNode.location=t.lastInput.documentPoint),this.originalToPort=e,(e=this.originalToPort.part)instanceof Ju&&(this.originalToNode=e),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)),t.add(this.temporaryFromNode),this.temporaryFromNode&&this.temporaryFromNode.Va(),t.add(this.temporaryToNode),this.temporaryToNode&&this.temporaryToNode.Va(),null!==this.temporaryLink&&(null!==this.temporaryFromNode&&(this.temporaryLink.fromNode=this.temporaryFromNode),null!==this.temporaryToNode&&(this.temporaryLink.toNode=this.temporaryToNode),this.temporaryLink.isTreeLink=this.isNewTreeLink(),this.temporaryLink.bb(),t.add(this.temporaryLink)),this.isActive=!0)},Qi.prototype.doDeactivate=function(){this.isActive=!1;var t=this.diagram;t.remove(this.temporaryLink),t.remove(this.temporaryFromNode),t.remove(this.temporaryToNode),t.isMouseCaptured=!1,t.currentCursor="",this.stopTransaction()},Qi.prototype.doStop=function(){Wi.prototype.doStop.call(this),this.startObject=null},Qi.prototype.doMouseUp=function(){if(this.isActive){var t=this.diagram,e=this.transactionResult=null,i=null,n=null,o=null,r=null;try{var s=this.targetPort=this.findTargetPort(this.isForwards);if(null!==s){var a=s.part;a instanceof Ju&&(this.isForwards?(null!==this.originalFromNode&&(e=this.originalFromNode,i=this.originalFromPort),n=a,o=s):(e=a,i=s,null!==this.originalToNode&&(n=this.originalToNode,o=this.originalToPort)))}else this.isForwards?null!==this.originalFromNode&&this.isUnconnectedLinkValid&&(e=this.originalFromNode,i=this.originalFromPort):null!==this.originalToNode&&this.isUnconnectedLinkValid&&(n=this.originalToNode,o=this.originalToPort);null!==e||null!==n?null!==(r=this.insertLink(e,i,n,o))?(null===s&&(this.isForwards?r.defaultToPoint=t.lastInput.documentPoint:r.defaultFromPoint=t.lastInput.documentPoint),t.allowSelect&&(t.R("ChangingSelection",t.selection),t.clearSelection(!0),r.isSelected=!0),this.transactionResult=this.name,t.R("LinkDrawn",r)):this.doNoLink(e,i,n,o):this.isForwards?this.doNoLink(this.originalFromNode,this.originalFromPort,null,null):this.doNoLink(null,null,this.originalToNode,this.originalToPort)}finally{this.stopTool(),r&&t.allowSelect&&t.R("ChangedSelection",t.selection)}}},Qi.prototype.isNewTreeLink=function(){var t=this.archetypeLinkData;if(null===t)return!0;if(t instanceof wc)return t.isTreeLink;var e=this.diagram;return null===e||(t=e.partManager.getLinkCategoryForData(t),null===(e=e.partManager.findLinkTemplateForCategory(t))||e.isTreeLink)},Qi.prototype.insertLink=function(t,e,i,n){return this.diagram.partManager.insertLink(t,e,i,n)},Qi.prototype.doNoLink=function(){},f.Object.defineProperties(Qi.prototype,{archetypeLinkData:{get:function(){return this.V},set:function(t){this.V=t}},archetypeLabelNodeData:{get:function(){return this.F},set:function(t){this.F=t}},direction:{get:function(){return this.K},set:function(t){this.K=t}},startObject:{get:function(){return this.Xd},set:function(t){this.Xd=t}}});var tn=new V(Qi,"Either",0),en=new V(Qi,"ForwardsOnly",0),nn=new V(Qi,"BackwardsOnly",0);function on(){Wi.call(this),this.name="Relinking";var t=new pl;t.figure="Diamond",t.desiredSize=Nt,t.fill="lightblue",t.stroke="dodgerblue",t.cursor=this.linkingCursor,t.segmentIndex=0,this.V=t,(t=new pl).figure="Diamond",t.desiredSize=Nt,t.fill="lightblue",t.stroke="dodgerblue",t.cursor=this.linkingCursor,t.segmentIndex=-1,this.Xd=t,this.F=null,this.Ew=new Ot}function rn(t,e,i,n,o){null!==e?(t.copyPortProperties(e,i,t.temporaryFromNode,t.temporaryFromPort,!1),t.diagram.add(t.temporaryFromNode)):t.diagram.remove(t.temporaryFromNode),null!==n?(t.copyPortProperties(n,o,t.temporaryToNode,t.temporaryToPort,!0),t.diagram.add(t.temporaryToNode)):t.diagram.remove(t.temporaryToNode)}function sn(){vi.call(this),this.name="LinkReshaping";var t=new pl;t.figure="Rectangle",t.desiredSize=St,t.fill="lightblue",t.stroke="dodgerblue",this.o=t,(t=new pl).figure="Diamond",t.desiredSize=Nt,t.fill="lightblue",t.stroke="dodgerblue",t.cursor="move",this.u=t,this.F=3,this.Ts=this.j=null,this.Fw=new pt,this.Yq=new Z}function an(t,e,i,n,o,r){return r?Math.abs(e.y-i.y)e.firstPickIndex+1&&i=i.x)e=0>=i.y?e+225:1<=i.y?e+135:e+180;else if(1<=i.x)0>=i.y?e+=315:1<=i.y&&(e+=45);else if(0>=i.y)e+=270;else{if(!(1<=i.y))break t;e+=90}0>e?e+=360:360<=e&&(e-=360),t.cursor=22.5>e?"e-resize":67.5>e?"se-resize":112.5>e?"s-resize":157.5>e?"sw-resize":202.5>e?"w-resize":247.5>e?"nw-resize":292.5>e?"n-resize":337.5>e?"ne-resize":"e-resize"}else if(t instanceof Ch)for(t=t.elements;t.next();)this.updateResizeHandles(t.value,e)},fn.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return!(t.isReadOnly||!t.allowResize||!t.lastInput.left)&&null!==this.findToolHandleAt(t.firstInput.documentPoint,this.name)},fn.prototype.doActivate=function(){var t=this.diagram;null===this.handle&&(this.handle=this.findToolHandleAt(t.firstInput.documentPoint,this.name)),null!==this.handle&&(this.adornedObject=this.handle.part.adornedObject,null!==this.adornedObject&&(t.isMouseCaptured=!0,t.animationManager.Cc(),this.Ea(this.name),this.Xq.set(this.adornedObject.ga(this.handle.alignment.gv())),this.Tn.set(this.adornedObject.part.location),this.Dw.set(this.adornedObject.desiredSize),this.pt=this.computeCellSize(),this.rt=this.computeMinSize(),this.qt=this.computeMaxSize(),this.isActive=!0))},fn.prototype.doDeactivate=function(){var t=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.isActive=t.isMouseCaptured=!1},fn.prototype.stopTransaction=function(){var t=this.diagram,e=vi.prototype.stopTransaction.call(this);return e&&null!==t.undoManager.transactionToUndo&&t.undoManager.transactionToUndo.ak(),e},fn.prototype.doCancel=function(){null!==this.adornedObject&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation),this.stopTool()},fn.prototype.doMouseMove=function(){var t=this.diagram;if(this.isActive){var e=this.rt,i=this.qt,n=this.pt,o=this.adornedObject.qs(t.lastInput.documentPoint,pt.alloc()),r=this.computeReshape();e=this.computeResize(o,this.handle.alignment,e,i,n,r),this.resize(e),t.bd(),pt.free(o)}},fn.prototype.doMouseUp=function(){var t=this.diagram;if(this.isActive){var e=this.rt,i=this.qt,n=this.pt,o=this.adornedObject.qs(t.lastInput.documentPoint,pt.alloc()),r=this.computeReshape();e=this.computeResize(o,this.handle.alignment,e,i,n,r),this.resize(e),pt.free(o),t.Ya(),this.transactionResult=this.name,t.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()},fn.prototype.resize=function(t){var e=this.diagram,i=this.adornedObject;if(null!==i){if(i.desiredSize=t.size,(t=i.part).Va(),i=i.ga(this.handle.alignment.gv()),t instanceof gc){var n=new Z;if(n.add(t),!this.dragsMembers&&null===t.placeholder){var o=new Ms;o.dragsMembers=!1}e.moveParts(n,this.oppositePoint.copy().re(i),!0,o)}else t.location=t.location.copy().re(i).add(this.oppositePoint);e.bd()}},fn.prototype.computeResize=function(t,e,i,n,o,r){e.Mc()&&(e=oe);var s=this.adornedObject.naturalBounds,a=s.x,h=s.y,l=s.x+s.width,u=s.y+s.height,c=1;if(!r){c=s.width;var f=s.height;0>=c&&(c=1),0>=f&&(f=1),c=f/c}return f=pt.alloc(),Xe.No(t.x,t.y,a,h,o.width,o.height,f),t=s.copy(),0>=e.x?0>=e.y?(t.x=Math.max(f.x,l-n.width),t.x=Math.min(t.x,l-i.width),t.width=Math.max(l-t.x,i.width),t.y=Math.max(f.y,u-n.height),t.y=Math.min(t.y,u-i.height),t.height=Math.max(u-t.y,i.height),r||(1<=t.height/t.width?(t.height=Math.max(Math.min(c*t.width,n.height),i.height),t.width=t.height/c):(t.width=Math.max(Math.min(t.height/c,n.width),i.width),t.height=c*t.width),t.x=l-t.width,t.y=u-t.height)):1<=e.y?(t.x=Math.max(f.x,l-n.width),t.x=Math.min(t.x,l-i.width),t.width=Math.max(l-t.x,i.width),t.height=Math.max(Math.min(f.y-h,n.height),i.height),r||(1<=t.height/t.width?(t.height=Math.max(Math.min(c*t.width,n.height),i.height),t.width=t.height/c):(t.width=Math.max(Math.min(t.height/c,n.width),i.width),t.height=c*t.width),t.x=l-t.width)):(t.x=Math.max(f.x,l-n.width),t.x=Math.min(t.x,l-i.width),t.width=l-t.x,r||(t.height=Math.max(Math.min(c*t.width,n.height),i.height),t.width=t.height/c,t.y=h+.5*(u-h-t.height))):1<=e.x?0>=e.y?(t.width=Math.max(Math.min(f.x-a,n.width),i.width),t.y=Math.max(f.y,u-n.height),t.y=Math.min(t.y,u-i.height),t.height=Math.max(u-t.y,i.height),r||(1<=t.height/t.width?(t.height=Math.max(Math.min(c*t.width,n.height),i.height),t.width=t.height/c):(t.width=Math.max(Math.min(t.height/c,n.width),i.width),t.height=c*t.width),t.y=u-t.height)):1<=e.y?(t.width=Math.max(Math.min(f.x-a,n.width),i.width),t.height=Math.max(Math.min(f.y-h,n.height),i.height),r||(1<=t.height/t.width?(t.height=Math.max(Math.min(c*t.width,n.height),i.height),t.width=t.height/c):(t.width=Math.max(Math.min(t.height/c,n.width),i.width),t.height=c*t.width))):(t.width=Math.max(Math.min(f.x-a,n.width),i.width),r||(t.height=Math.max(Math.min(c*t.width,n.height),i.height),t.width=t.height/c,t.y=h+.5*(u-h-t.height))):0>=e.y?(t.y=Math.max(f.y,u-n.height),t.y=Math.min(t.y,u-i.height),t.height=u-t.y,r||(t.width=Math.max(Math.min(t.height/c,n.width),i.width),t.height=c*t.width,t.x=a+.5*(l-a-t.width))):1<=e.y&&(t.height=Math.max(Math.min(f.y-h,n.height),i.height),r||(t.width=Math.max(Math.min(t.height/c,n.width),i.width),t.height=c*t.width,t.x=a+.5*(l-a-t.width))),pt.free(f),t},fn.prototype.computeReshape=function(){var t=fs;return this.adornedObject instanceof pl&&(t=yl(this.adornedObject)),!(t===ds||this.diagram.lastInput.shift)},fn.prototype.computeMinSize=function(){var t=this.adornedObject.minSize.copy(),e=this.minSize;return!isNaN(e.width)&&e.width>t.width&&(t.width=e.width),!isNaN(e.height)&&e.height>t.height&&(t.height=e.height),t},fn.prototype.computeMaxSize=function(){var t=this.adornedObject.maxSize.copy(),e=this.maxSize;return!isNaN(e.width)&&e.widthi?i+=360:360<=i&&(i-=360),i=Math.round(45*Math.round(i/45));var n=this.handleDistance;return 0===i?e.x=t.naturalBounds.width+n:45===i?(e.x=t.naturalBounds.width+n,e.y=t.naturalBounds.height+n):90===i?e.y=t.naturalBounds.height+n:135===i?(e.x=-n,e.y=t.naturalBounds.height+n):180===i?e.x=-n:225===i?(e.x=-n,e.y=-n):270===i?e.y=-n:315===i&&(e.x=t.naturalBounds.width+n,e.y=-n),t.ga(e)},dn.prototype.doDeactivate=function(){var t=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.kr=new pt(NaN,NaN),this.isActive=t.isMouseCaptured=!1},dn.prototype.stopTransaction=function(){var t=this.diagram,e=vi.prototype.stopTransaction.call(this);return e&&null!==t.undoManager.transactionToUndo&&t.undoManager.transactionToUndo.ak(),e},dn.prototype.doCancel=function(){this.diagram.delaysLayout=!1,this.rotate(this.originalAngle),this.stopTool()},dn.prototype.doMouseMove=function(){var t=this.diagram;this.isActive&&(t=this.computeRotate(t.lastInput.documentPoint),this.rotate(t))},dn.prototype.doMouseUp=function(){var t=this.diagram;if(this.isActive){t.delaysLayout=!1;var e=this.computeRotate(t.lastInput.documentPoint);this.rotate(e),t.Ya(),this.transactionResult=this.name,t.R("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()},dn.prototype.rotate=function(t){var e=this.adornedObject;if(null!==e){e.angle=t,(e=e.part).Va();var i=e.locationObject,n=e.rotateObject;(i===n||i.rg(n))&&(i=this.Tn.copy(),e.location=i.re(this.rotationPoint).rotate(t-this.originalAngle).add(this.rotationPoint)),this.diagram.bd()}},dn.prototype.computeRotate=function(t){t=this.rotationPoint.ab(t)-this.handleAngle;var e=this.adornedObject.panel;null!==e&&(t-=e.li()),360<=t?t-=360:0>t&&(t+=360),e=Math.min(Math.abs(this.snapAngleMultiple),180);var i=Math.min(Math.abs(this.snapAngleEpsilon),e/2);return!this.diagram.lastInput.shift&&0e-i&&(t=(Math.floor(t/e)+1)*e)),360<=t?t-=360:0>t&&(t+=360),t},f.Object.defineProperties(dn.prototype,{handleArchetype:{get:function(){return this.o},set:function(t){this.o=t}},handle:{get:function(){return this.j},set:function(t){if(null!==t&&!(t.part instanceof Ku))throw Error("new handle is not in an Adornment: "+t);this.j=t}},adornedObject:{get:function(){return this.ue},set:function(t){if(null!==t&&t.part instanceof Ku)throw Error("new handle must not be in an Adornment: "+t);this.ue=t}},snapAngleMultiple:{get:function(){return this.ia},set:function(t){this.ia=t}},snapAngleEpsilon:{get:function(){return this.V},set:function(t){this.V=t}},originalAngle:{get:function(){return this.Cw}},rotationPoint:{get:function(){return this.kr},set:function(t){this.kr=t.copy()}},handleAngle:{get:function(){return this.u},set:function(t){this.u=t}},handleDistance:{get:function(){return this.F},set:function(t){this.F=t}}}),dn.className="RotatingTool",B("rotatingTool",(function(){return this.findTool("Rotating")}),(function(t){this.gb("Rotating",t,this.mouseDownTools)})),c(pn,vi),pn.prototype.canStart=function(){return!(!this.isEnabled||this.isBeyondDragSize())},pn.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip()),this.stopTool()},pn.className="ClickSelectingTool",c(gn,vi),gn.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram,e=t.lastInput,i=t.ic(e.documentPoint,(function(t){for(;null!==t.panel&&!t.isActionable;)t=t.panel;return t}));return null!==i&&(!!i.isActionable&&(this.pk=i,t.Ck=t.ic(e.documentPoint,null,null),!0))},gn.prototype.doMouseDown=function(){if(this.isActive){var t=this.diagram.lastInput,e=this.pk;null!==e&&(t.targetObject=e,null!==e.actionDown&&e.actionDown(t,e))}else this.canStart()&&this.doActivate()},gn.prototype.doMouseMove=function(){if(this.isActive){var t=this.diagram.lastInput,e=this.pk;null!==e&&(t.targetObject=e,null!==e.actionMove&&e.actionMove(t,e))}},gn.prototype.doMouseUp=function(){if(this.isActive){var t=this.diagram.lastInput,e=this.pk;if(null===e)return;t.targetObject=e,null!==e.actionUp&&e.actionUp(t,e),this.standardMouseClick((function(t){for(;null!==t.panel&&(!t.isActionable||t!==e);)t=t.panel;return t}),(function(t){return t===e}))}this.stopTool()},gn.prototype.doCancel=function(){var t=this.diagram.lastInput,e=this.pk;null!==e&&(t.targetObject=e,null!==e.actionCancel&&e.actionCancel(t,e),this.stopTool())},gn.prototype.doStop=function(){this.pk=null},gn.className="ActionTool",c(mn,vi),mn.prototype.canStart=function(){if(!this.isEnabled||null===this.archetypeNodeData)return!1;var t=this.diagram;if(t.isReadOnly||t.isModelReadOnly||!t.allowInsert||!t.lastInput.left||this.isBeyondDragSize())return!1;if(this.isDoubleClick){if(1===t.lastInput.clickCount&&(this.mw=t.lastInput.viewPoint.copy()),2!==t.lastInput.clickCount||this.isBeyondDragSize(this.mw))return!1}else if(1!==t.lastInput.clickCount)return!1;return t.currentTool===this||null===t.Ol(t.lastInput.documentPoint,!0)},mn.prototype.doMouseUp=function(){var t=this.diagram;this.isActive&&this.insertPart(t.lastInput.documentPoint),this.stopTool()},mn.prototype.insertPart=function(t){var e=this.diagram,i=this.archetypeNodeData;if(null===i)return null;var n=null;try{if(e.R("ChangingSelection",e.selection),this.Ea(this.name),i instanceof ku)i.Zc()&&(Wh(i),null!==(n=i.copy())&&e.add(n));else if(null!==i){var o=e.model.copyNodeData(i);N(o)&&(e.model.xf(o),n=e.Lc(o))}if(null!==n){var r=pt.allocAt(t.x,t.y);this.isGridSnapEnabled&&cr(this.diagram,n,t,r),n.location=r,e.allowSelect&&(e.clearSelection(!0),n.isSelected=!0),pt.free(r)}e.Ya(),this.transactionResult=this.name,e.R("PartCreated",n)}finally{this.stopTransaction(),e.R("ChangedSelection",e.selection)}return n},f.Object.defineProperties(mn.prototype,{archetypeNodeData:{get:function(){return this.Ri},set:function(t){this.Ri=t}},isDoubleClick:{get:function(){return this.o},set:function(t){this.o=t}},isGridSnapEnabled:{get:function(){return this.j},set:function(t){this.j=t}}}),mn.className="ClickCreatingTool",c(yn,vi),yn.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;if(!t.allowSelect)return!1;var e=t.lastInput;return!(!e.left||t.currentTool!==this&&(!this.isBeyondDragSize()||e.timestamp-t.firstInput.timestampo.right&&(i.x-=n.width+5/e.scale),i.xo.bottom&&(i.y-=n.height+5/e.scale),i.yt.lastInput.clickCount)},Ln.prototype.doStart=function(){Un=this,null!==this.textBlock&&this.doActivate()},Ln.prototype.doActivate=function(){if(!this.isActive){var t=this.diagram;if(null!==t){var e=this.textBlock;if(null===e&&(e=t.ic(t.lastInput.documentPoint)),null!==e&&e instanceof Pl&&(this.textBlock=e,null!==e.part)){t.animationManager.Cc(),this.isActive=!0,this.qa=En;var i=this.defaultTextEditor;null!==e.textEditor&&(i=e.textEditor),this.Zh=this.textBlock.copy();var n=new Ot(this.textBlock.ga(te),this.textBlock.ga(he));t.tv(n),i.show(e,t,this),this.currentTextEditor=i}}}},Ln.prototype.doCancel=function(){this.stopTool()},Ln.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()},Ln.prototype.doMouseDown=function(){this.isActive&&this.acceptText(Fn)},Ln.prototype.acceptText=function(t){switch(t){case Fn:this.qa===Xn?this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus():this.qa!==En&&this.qa!==Gn&&this.qa!==Vn||(this.qa=Yn,An(this));break;case jn:case On:case Dn:On===t&&!0===this.textBlock.isMultiline||this.qa!==En&&this.qa!==Gn&&this.qa!==Vn||(this.qa=Yn,An(this))}},Ln.prototype.doError=function(t,e){var i=this.textBlock;null!==i.errorFunction&&i.errorFunction(this,t,e),(t=this.currentTextEditor)&&t.show(i,this.diagram,this)},Ln.prototype.doSuccess=function(t,e){var i=this.textBlock;null!==i.textEdited&&i.textEdited(i,t,e)},Ln.prototype.doDeactivate=function(){var t=this.diagram;null!==t&&(this.qa=Rn,null!==this.currentTextEditor&&this.currentTextEditor.hide(t,this),this.textBlock=null,this.isActive=!1)},Ln.prototype.doStop=function(){Un=null},Ln.prototype.isValidText=function(t,e,i){var n=this.textValidation;return!(null!==n&&!n(t,e,i))&&!(null!==(n=t.textValidation)&&!n(t,e,i))},Ln.prototype.Lx=function(t){var e=this.Zh;return e.text=t,e.measure(this.textBlock.Ih,1/0),e},f.Object.defineProperties(Ln.prototype,{textBlock:{get:function(){return this.ia},set:function(t){this.ia=t}},currentTextEditor:{get:function(){return this.o},set:function(t){this.o=t}},defaultTextEditor:{get:function(){return this.j},set:function(t){this.j=t}},starting:{get:function(){return this.V},set:function(t){this.V=t}},textValidation:{get:function(){return this.vj},set:function(t){this.vj=t}},minimumEditorScale:{get:function(){return this.u},set:function(t){this.u=t}},selectsTextOnActivate:{get:function(){return this.F},set:function(t){this.F=t}},state:{get:function(){return this.qa},set:function(t){this.qa!==t&&(this.qa=t)}}}),Ln.prototype.measureTemporaryTextBlock=Ln.prototype.Lx;var jn=new V(Ln,"LostFocus",0),Fn=new V(Ln,"MouseDown",1),Dn=new V(Ln,"Tab",2),On=new V(Ln,"Enter",3),Bn=new V(Ln,"SingleClick",0),In=new V(Ln,"SingleClickSelected",1),zn=new V(Ln,"DoubleClick",2),Rn=new V(Ln,"StateNone",0),En=new V(Ln,"StateActive",1),Vn=new V(Ln,"StateEditing",2),Yn=new V(Ln,"StateValidating",3),Gn=new V(Ln,"StateInvalid",4),Xn=new V(Ln,"StateValidated",5),Un=null;function qn(t){oo||(io(),oo=!0),this.H=bo,this.Ok=this.zb=this.vq=this.bc=!1,this.Qw=!0,this.Pk=ro,this.Dm=!1,this.Gh=this.Jd=!0,this.Dg=600,this.cw=this.Ow=!1,this.Zd=new _,this.ce=new ho,this.ce.Yd=this,this.Ei=new _,this.pu=new _,this.Sr=new _,this.pr=new _,t&&Object.assign(this,t)}function Hn(t,e){t.Jd&&t.canStart(e)&&(t.Zd.add(e),t.defaultAnimation.isAnimating&&t.Cc(),Qo(t.H),t.zb=!0)}function Kn(t){if(t.Jd&&t.zb){var e=t.ce,i=t.H,n=t.Zd.contains("Model");n&&(t.Ok=!0,t.Pk===ro?(e.isViewportUnconstrained=!0,e.vc.clear(),e.add(i,"position",i.position.copy().offset(0,-200),i.position),e.add(i,"opacity",0,1)):t.Pk===ao&&e.vc.clear(),t.Qw=!(t.Pk!==so||!i.du.D(i.pa)),i.R("InitialAnimationStarting",t)),n&&!t.Gh||0===e.vc.count?(t.Zd.clear(),t.zb=!1,e.vc.clear(),lo(e,i),t.Ok=!1,i.N()):(t.Zd.clear(),i.kg=!1,n=e.vc.get(i),i.autoScale!==Xr&&null!==n&&(delete n.start.scale,delete n.end.scale),m.requestAnimationFrame((function(){!1===t.zb||e.bc||(i.Gf("temporaryPixelRatio")&&Do(i),Bo(i),t.zb=!1,e.start(),e.bc&&(Zn(t),i.Ya(),po(e,0),_o(i,!0),$n(t),i.R("AnimationStarting",t)))})))}}function Wn(t){return t.Zd.contains("Trigger")&&1===t.Zd.count}function Jn(t,e,i,n){t.isTicking||Wn(t)||e instanceof wc&&(null!==e.fromNode||null!==e.toNode)||t.ce.add(e,"position",i,n,!1)}function Zn(t){if(!t.vq){var e=t.H;t.Ow=e.skipsUndoManager,t.cw=e.skipsModelSourceBindings,e.skipsUndoManager=!0,e.skipsModelSourceBindings=!0,t.vq=!0}}function $n(t){var e=t.H;e.skipsUndoManager=t.Ow,e.skipsModelSourceBindings=t.cw,t.vq=!1}function _n(t,e,i){!t.zb||e.D(i)||Wn(t)||(t.H.pi||(e=i.copy()),uo(t.ce,t.H,"position",e,i))}function Qn(t,e,i){e.fd&&(e.Tg=i,t.pr.add(e))}function to(t,e){for(e=e.findLinksConnected();e.next();){var i=e.value;i.fd&&(i.Tg=i.points.copy(),t.pr.add(i))}}function eo(t,e,i,n,o){null===t&&(t=[0,0,0,0]),null===e&&(e=[0,0,0,0]);var r=t[0],s=t[1],a=t[2];t=t[3];var h=e[0],l=e[1],u=e[2];return e=e[3],0===a||100===a?(r=h,s=l):0!==u&&100!==u||(h=r,l=s),180r?r+=360:h+=360),"hsla("+(r=o(i,r,h-r,n)%360)+", "+(s=o(i,s,l-s,n))+"%, "+(a=o(i,a,u-a,n))+"%, "+(i=o(i,t,e-t,n))+")"}function io(){function t(t,e,i,n,o,r){t.position=new pt(n(o,e.x,i.x-e.x,r),n(o,e.y,i.y-e.y,r))}var e=new dt;e.add("position:diagram",t),e.add("position",t),e.add("position:part",(function(t,e,i,n,o,r){ot&&M(t,">= 1",qn,"duration"),this.Dg=t}},isAnimating:{get:function(){return this.bc}},isTicking:{get:function(){return this.vq}},isInitial:{get:function(){return this.Gh},set:function(t){this.Gh=t}},defaultAnimation:{get:function(){return this.ce}},activeAnimations:{get:function(){return this.Ei}},initialAnimationStyle:{get:function(){return this.Pk},set:function(t){this.Pk=t}}}),qn.prototype.stopAnimation=qn.prototype.Cc;var no=null,oo=!1,ro=new V(qn,"Default",1),so=new V(qn,"AnimateLocations",2),ao=new V(qn,"None",3);function ho(t){this.vu=this.Nw=this.Yd=this.H=null,this.Xk=this.bc=this.j=!1,this.cn=this.Qd=0,this.Lp=this.ot=go,this.Wk=this.ho=!1,this.cu=1,this.au=0,this.Gd=this.Dg=NaN,this.gw=0,this.dn=null,this.o=it,this.vc=new dt,this.Tt=new dt,this.yl=new _,this.Ut=new _,this.dw=_r,t&&Object.assign(this,t)}function lo(t,e){if(t.Tt.clear(),t.Wk=!1,t.au=0,t.Gd=NaN,0t.cn?t.Gd:n-t.Qd;e&&((o=t.gw)t.cn&&(t.ho&&!t.Wk?(t.Qd=+new Date,t.cn=t.Qd+t.Gd,t.Wk=!0):t.Ml(!1))}}}function po(t,e){for(var i=t.Gd,n=t.vc.iterator,o=t.Wk;n.next();){var r=n.key;if(!(r instanceof Ds&&null===r.diagram)){var s=n.value,a=o?s.end:s.start;s=o?s.start:s.end;var h,l=no;for(h in s)"position"===h&&(s["position:placeholder"]||s["position:nodeCollapse"])||null===l.get(h)||l.get(h)(r,a[h],s[h],t.Lp,e,i,t)}}}function go(t,e,i,n){return 1>(t/=n/2)?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e}function mo(t,e,i,n){return t===n?e+i:i*(1-Math.pow(2,-10*t/n))+e}function yo(t,e,i){this.start=t,this.end=e,this.Ku={},this.Hu=i,this.nv=!1}function vo(t,e,i){this.xd=null,this.rf=t,this.so=i||wo,this.uk=null,void 0!==e&&(this.uk=e,void 0===i&&(this.so=ko))}qn.className="AnimationManager",qn.defineAnimationEffect=function(t,e){oo||(io(),oo=!0),no.add(t,e)},qn.Default=ro,qn.AnimateLocations=so,qn.None=ao,ho.prototype.suspend=function(){this.Xk=!0},ho.prototype.advanceTo=function(t,e){e&&(this.Xk=!1),this.ho&&t>=this.Gd&&(this.Wk=!0,t-=this.Gd),this.gw=t,fo(this,!0),Zn(this.Yd),_o(this.H),$n(this.Yd),this.H.redraw()},(e=ho.prototype).start=function(){if(0===this.vc.count||this.bc)return this;for(var t=this.H,e=this.vc.iterator;e.next();){var i=e.key;null===t&&(i instanceof To?t=i:i instanceof Ds&&(t=i.diagram))}return null===t?this:(this.H=t,this.Yd=t.animationManager,!1===(e=this.Yd).isEnabled||(this.Gd=isNaN(this.Dg)?e.duration:this.Dg,this.Lp=this.ot,e.Ok&&e.Pk===ro&&this===e.defaultAnimation&&(this.Lp=mo,this.Gd=isNaN(this.Dg)?600===e.duration?900:e.duration:this.Dg),this.dw=t.scrollMode,this.isViewportUnconstrained&&(t.sj=Qr),Zn(e),this.yl.each((function(e){e.data=null,t.add(e)})),$n(e),this.bc=!0,this.Qd=+new Date,this.cn=this.Qd+this.Gd,function(t,e){function i(){if(0this.au?(this.Wk=!1,this.start()):(this.dn&&this.dn(this),lo(this,null),i.Ml(this),e.$b())}},e.Cj=function(t,e){var i=e.actualBounds,n=null;if(e instanceof gc&&(n=e.placeholder),null!==n?(i=n.ga(te),n=n.padding,i.x+=n.left,i.y+=n.top,this.add(t,"position",i,t.position,!1)):this.add(t,"position",new pt(i.x+i.width/2,i.y+i.height/2),t.position,!1),this.add(t,"scale",.01,t.scale,!1),t instanceof gc)for(t=t.memberParts;t.next();)(n=t.value)instanceof Ju&&this.Cj(n,e)},e.Aj=function(t,e){if(t.isVisible()){var i=null;if(e instanceof gc&&(i=e.placeholder),null!==i){var n=i.ga(te);i=i.padding,n.x+=i.left,n.y+=i.top,this.add(t,"position:placeholder",t.position,n,!0)}else this.add(t,"position:nodeCollapse",t.position,e,!0);if(this.add(t,"scale",t.scale,.01,!0),(n=this.vc).contains(t)&&(n.I(t).nv=!0),t instanceof gc)for(t=t.memberParts;t.next();)(n=t.value)instanceof Ju&&this.Aj(n,e)}},e.Ez=function(t){var e=this.Tt.get(t);return null===e&&(e={},this.Tt.add(t,e)),e},f.Object.defineProperties(ho.prototype,{duration:{get:function(){return this.Dg},set:function(t){1>t&&M(t,">= 1",ho,"duration"),this.Dg=t}},reversible:{get:function(){return this.ho},set:function(t){this.ho=t}},runCount:{get:function(){return this.cu},set:function(t){0=o)return e;if(0>e&&(e=t.indexOf(i)),0>e)return-1;for(var r=e-1,s=NaN;0<=r&&(s=t.M(r).zOrder,isNaN(s));)r--;for(var a=e+1,h=NaN;an)for(;;){if(-1===r||s<=n){if(++r===e)break;return t.mb(e),t.Gb(r,i),r}for(s=NaN;0<=--r&&(s=t.M(r).zOrder,isNaN(s)););}else if(!isNaN(h)&&h=n){if(--a===e)break;return t.mb(e),t.Gb(a,i),a}for(h=NaN;++an&&a.containingGroup===i&&(n=s,0<=e))break}!(0>n)&&no;o++)e[I("7ca11abfd7330390")](I(n[o-1]),10,15*o);for(e[i]=I("39f046ebb36e4b"),i=1;5>i;i++)e[I("7ca11abfd7330390")](I(n[i-1]),10,15*i);4===n.length&&"5"===n[0][0]&&"7"===n[3][0]||(Ye.prototype.Cd=Ye.prototype.Eu),ss=t}}(),as=!0),Q(this),bo=this,this.vb=!0,this.Ka=null,this.ya=this.Aa=0,this.ta=null,Vr){var i=this,n=function(){i.removeEventListener(m.document,"DOMContentLoaded",n,!1),i.setRTL()};null!==m.document.body?this.setRTL():i.addEventListener(m.document,"DOMContentLoaded",n,!1)}this.ol=null,Rr.add("Model",Qf);var o=this;return this.Hb=function(t){var e=o.partManager;if(t.model===e.diagram.model&&e.diagram.aa){e.diagram.aa=!1;try{var i=t.change;""===t.modelChange&&i===fi&&e.updateDataBindings(t.object,t.propertyName)}finally{e.diagram.aa=!0}}},this.Oc=function(t){o.partManager.doModelChanged(t)},this.hu=this.ku=null,Lo(this),this.model=Bd(),this.Wg=!0,Io(this),this.layout=new Ff,this.Wg=!1,this.ck=this.ek=this.fk=this.dk=this.ui=this.aA=this.$j=this.Ov=null,this.hk=function(){},this.preventDefault=null,this.rn=!1,this.Yf=new hs,void 0!==t&&("string"==typeof t||m.Element&&t instanceof Element?Fo(this,t):e=t),this.vb=!1,e&&this.nm(e),this}function Lo(t){t.Yd=new qn,t.Yd.Xe(t),t.Db=17,t.Gw=!1,t.tn=!1,t.bu="default",t.Wa=new Z,t.pj=new dt,t.nl="default",t.Tx(),t.Sx(),t.pb=1,t.pa=new pt(NaN,NaN).freeze(),t.du=new pt(NaN,NaN),t.Ca=1,t.Pp=1,t.zt=new pt(NaN,NaN).freeze(),t.At=NaN,t.Ot=1e-4,t.Mt=100,t.Ab=new Ye,t.zu=new pt(NaN,NaN).freeze(),t.ut=new Ot(NaN,NaN,NaN,NaN).freeze(),t.rj=new Wt(0,0,0,0).freeze(),t.sj=_r,t.nu=!1,t.Zt=null,t.fu=null,t.yh=Xr,t.zk=Se,t.Fg=Xr,t.pq=Se,t.yt=te,t.Bt=te,t.Fc=!0,t.pn=!1,t.De=new _,t.Eh=new dt,t.Xm=!0,t.vp=250,t.vk=-1,t.xp=new Wt(16,16,16,16).freeze(),t.kg=!1,t.Jk=!1,t.fn=!0,t.bq=new hi,t.bq.diagram=t,t.Qg=new hi,t.Qg.diagram=t,t.cj=new hi,t.cj.diagram=t,t.zg=null,t.pf=null,t.qu=!1,function(t){function e(t){var e=t.toLowerCase(),o=new Z;i.add(t,o),i.add(e,o),n.add(t,t),n.add(e,t)}var i=new dt,n=new dt;e("InitialAnimationStarting"),e("AnimationStarting"),e("AnimationFinished"),e("BackgroundSingleClicked"),e("BackgroundDoubleClicked"),e("BackgroundContextClicked"),e("ClipboardChanged"),e("ClipboardPasted"),e("DocumentBoundsChanged"),e("ExternalObjectsDropped"),e("GainedFocus"),e("InitialLayoutCompleted"),e("LayoutCompleted"),e("LinkDrawn"),e("LinkRelinked"),e("LinkReshaped"),e("LostFocus"),e("Modified"),e("ObjectSingleClicked"),e("ObjectDoubleClicked"),e("ObjectContextClicked"),e("PartCreated"),e("PartResized"),e("PartRotated"),e("SelectionMoved"),e("SelectionCopied"),e("SelectionDeleting"),e("SelectionDeleted"),e("SelectionGrouped"),e("SelectionUngrouped"),e("ChangingSelection"),e("ChangedSelection"),e("SubGraphCollapsed"),e("SubGraphExpanded"),e("TextEdited"),e("TreeCollapsed"),e("TreeExpanded"),e("ViewportBoundsChanged"),e("InvalidateDraw"),t.iw=i,t.hw=n}(t),t.ai=new _,t.Ht=!0,t.uu=ts,t.pw=!1,t.wu=Hr,t.it="auto",t.Op="auto",t.zh=null,t.Fh=null,t.Bh=null,t.Qh=null,t.Oh=null,t.Nh=null,t.Qt=null,t.Lh=null,t.xt=!1,t.Mh=null,t.Ph=null,t.$h=null,t.Ch=null,t.Rt=!1,t.Yt={},t.oj=[null,null],t.Wg=!1,t.Iw=!1,t.ou=!1,t.lt=!1,t.rw=!0,t.ld=!1,t.$i=!1,t.Tw=!0,t.Ce=-2,t.Og=new dt,t.Xn=new Z,t.Gg=!1,t.Jd=!0,t.Us=!0,t.Fi=!0,t.Gi=!0,t.Vs=!1,t.Ws=!0,t.Pi=!0,t.Hi=!0,t.Qi=!0,t.Ys=!0,t.Ii=!0,t.Ki=!0,t.Ji=!0,t.Li=!0,t.Mi=!0,t.Ni=!0,t.Oi=!0,t.Zs=!0,t.at=!0,t.qw=!1,t.Vk=!1,t.mn=!0,t.nn=!0,t.Xs=!0,t.$s=!0,t.iu=16,t.mu=16,t.qr=!1,t.gu=!1,t.lu=0,t.ju=0,t.yb=new Wt(5).freeze(),t.Hw=(new _).freeze(),t.Nt=999999999,t.nw=(new _).freeze(),t.Zi=!0,t.Ee=!0,t.vd=!0,t.Be=!1,t.gf=!1,t.xh=!0,t.hf=!1,t.sy=new _,t.ow=new _,t.Xh=null,t.aw=new At(8,8),t.bw=999,t.Bw=1,t.Jw=0,t.fc={scale:1,position:new pt,bounds:new Ot,Py:new At,bA:new At,Oz:!1},t.fc.canvasSize=t.fc.Py,t.fc.newCanvasSize=t.fc.bA,t.fc.isScroll=!1,t.Rw=new Ot(NaN,NaN,NaN,NaN).freeze(),t.wo=new At(NaN,NaN).freeze(),t.Sp=new Ot(NaN,NaN,NaN,NaN).freeze(),t.It=!1,t.Lg=new dt;var e=new Ju,i=new Pl;i.bind(new Gd("text","",D)),e.add(i),t.ny=e,t.Lg.add("",e),e=new Ju,(i=new Pl).stroke="brown",i.bind(new Gd("text","",D)),e.add(i),t.Lg.add("Comment",e),(e=new Ju).selectable=!1,e.avoidable=!1,(i=new pl).figure="Ellipse",i.fill="black",i.stroke=null,i.desiredSize=new At(3,3).ja(),e.add(i),t.Lg.add("LinkLabel",e),t.Yi=new dt,(e=new gc).selectionObjectName="GROUPPANEL",e.type=Ch.Vertical,(i=new Pl).font="bold 12pt sans-serif",i.bind(new Gd("text","",D)),e.add(i),(i=new Ch(Ch.Auto)).name="GROUPPANEL";var n=new pl;n.figure="Rectangle",n.fill="rgba(128,128,128,0.2)",n.stroke="black",i.add(n),(n=new bc).padding=new Wt(5,5,5,5).ja(),i.add(n),e.add(i),t.ly=e,t.Yi.add("",e),t.Kh=new dt,e=new wc,(i=new pl).isPanelMain=!0,e.add(i),(i=new pl).toArrow="Standard",i.fill="black",i.stroke=null,i.strokeWidth=0,e.add(i),t.my=e,t.Kh.add("",e),e=new wc,(i=new pl).isPanelMain=!0,i.stroke="brown",e.add(i),t.Kh.add("Comment",e),(e=new Ku).type=Ch.Auto,(i=new pl).fill=null,i.stroke="dodgerblue",i.strokeWidth=3,e.add(i),(i=new bc).margin=new Wt(1.5,1.5,1.5,1.5).ja(),e.add(i),t.St=e,t.wt=e,(e=new Ku).type=Ch.Link,(i=new pl).isPanelMain=!0,i.fill=null,i.stroke="dodgerblue",i.strokeWidth=3,e.add(i),t.Kt=e,t.fe=null,t.mq=!1,t.Ck=null,t.partManager=new Qf,t.toolManager=new xi,t.toolManager.initializeStandardTools(),t.defaultTool=t.toolManager,t.currentTool=t.defaultTool,t.nt=null,t.Wm=new Ms,t.Vt=null,t.Wt=null,t.Mr=!1,t.commandHandler=jo(),t.eq=null,t.fq=st,t.Pw=!1,t.Mb=1,t.Yh=null,t.Oq=1,t.Sq=0,t.zw=[0,0,0,0,0],t.Tq=0,t.yq=1,t.tw=0,t.uw=new pt,t.zy=500,t.wp=new pt,t.wq=!1}function Ao(t,e){t.animationManager.Cc(!0),t.Hw=(new _).freeze(),t.nw=(new _).freeze();var i=t.skipsUndoManager,n=null!==t.cc&&void 0!==t.cc;n&&(t.skipsUndoManager=!0);var o=null;null!==t.fe&&(null!==(o=t.fe.part)&&t.remove(o));var r=[],s=t.Wa.length;if(e){for(e=0;eMath.abs(e.deltaY)?-n:-o):void 0!==e.wheelDeltaX?(0!==e.wheelDeltaX&&(n=0Math.abs(e.wheelDeltaY)?-n:-o):void 0!==e.wheelDelta&&0!==e.wheelDelta&&(i.delta=0i||Math.abs(o.y-e.screenY)>i)?t.yq++:t.yq=1,n.clickCount=t.yq,t.tw=e.timeStamp,t.uw.sg(e.screenX,e.screenY),t.doMouseDown(),1===e.button?e.preventDefault():Wo(n,e)}},t.dk=function(e){if(t.isEnabled){t.Vk=!0;var i=t.oj;if(null===i[0]||i[0].pointerId!==e.pointerId&&i[0].pointerType===e.pointerType){if(null!==i[1]&&i[1].pointerId===e.pointerId)return void(i[1]=e);if(null!==i[0])return;i[0]=e}else i[0]=e;if(i[0].pointerId===e.pointerId){i=Ko(t,e,!1,!1,!1,null!==i[1]);var n=m.document.elementFromPoint(e.clientX,e.clientY)||null;null!==n&&void 0!==n.shadowRoot&&null!==n.shadowRoot&&(n=n.shadowRoot.elementFromPoint(e.clientX,e.clientY));var o=t,r=e;n&&n.H&&(r=e,o=n.H),i.targetDiagram=o,Jo(t,r,i),i.targetObject=null,t.doMouseMove(),Wo(i,e)}}},t.fk=function(e){if(t.isEnabled){t.Vk=!0;var i="touch"===e.pointerType||"pen"===e.pointerType,n=t.Yt;if(i&&t.qu)delete n[e.pointerId],e.preventDefault();else if(null===(n=t.oj)[0]||n[0].pointerId!==e.pointerId&&n[0].pointerType===e.pointerType)null!==n[1]&&n[1].pointerId===e.pointerId&&(n[1]=null);else{n[0]=null,n=Ko(t,e,!1,!0,!0,!1);var o=m.document.elementFromPoint(e.clientX,e.clientY)||null;null!==o&&void 0!==o.shadowRoot&&null!==o.shadowRoot&&(o=o.shadowRoot.elementFromPoint(e.clientX,e.clientY)),null!==o&&o.H instanceof To&&o.H!==t&&Jo(o.H,e,n),null===o&&(o=e.target),Jo(t,e,n),n.clickCount=t.yq,n.targetDiagram=Ho(e,o),n.targetObject=null,t.doMouseUp(),Wo(n,e),i&&(t.wq=!1)}}},t.ek=function(e){if(t.isEnabled){t.Vk=!1;var i=t.Yt;i[e.pointerId]&&delete i[e.pointerId],null!==(i=t.oj)[0]&&i[0].pointerId===e.pointerId&&(i[0]=null),null!==i[1]&&i[1].pointerId===e.pointerId&&(i[1]=null),"touch"!==e.pointerType&&"pen"!==e.pointerType&&((e=t.currentTool).cancelWaitAfter(),e.standardMouseOver())}},t.ck=function(e){var i=t.oj;null!==i[0]&&i[0].pointerId===e.pointerId?(i[0]=null,t.wq=!1):null!==i[1]&&i[1].pointerId===e.pointerId&&(i[1]=null)},t.Vp=n.Z["d"+ws[1]+ws[2]+"wI"+rs.slice(1,5)]["b"+Ud.slice(1,e)](n.Z,ss,e,e),n.Vc(!0),function(t){var e=t.ta.Oa;e instanceof HTMLCanvasElement||(e=t.div),t.addEventListener(e,"pointerdown",t.ui,!1),t.addEventListener(e,"pointermove",t.dk,!1),t.addEventListener(e,"pointerup",t.fk,!1),t.addEventListener(e,"pointerout",t.ek,!1),t.addEventListener(e,"pointercancel",t.ck,!1),t.addEventListener(e,"pointerenter",t.bz,!1),t.addEventListener(e,"pointerleave",t.cz,!1),t.addEventListener(e,"wheel",t.$j,!1),t.addEventListener(e,"keydown",t.Qz,!1),t.addEventListener(e,"keyup",t.Rz,!1),t.addEventListener(e,"blur",t.Ny,!1),t.addEventListener(e,"focus",t.Oy,!1),t.addEventListener(e,"selectstart",(function(t){return t.preventDefault(),!1}),!1),t.addEventListener(e,"contextmenu",(function(t){return t.preventDefault(),!1}),!1),t.addEventListener(m,"resize",t.Ov,!1)}(t),"svg"===t.nl&&(e=t.pj.get("svg"),t.Ka.appendChild(e.Oa),t.ib=e.context)}}function Do(t){30i&&(e=i),et.maxScale&&(e=t.maxScale),e):e===qr?((e=h>a?(s-t.Db)/n:(r-t.Db)/o)>i&&(e=i),et.maxScale&&(e=t.maxScale),e):t.scale}function Xo(t,e,i,n,o,r){var s=pt.allocAt(t.pa.x,t.pa.y),a=s.x,h=s.y;if(null!==t.eq){var l=pt.alloc();a=(l=t.eq.ga(te,l)).x-t.fq.x/t.scale,h=l.y-t.fq.y/t.scale,o=Qt,pt.free(l)}(r||t.scrollMode===_r)&&(o.sb()&&(i>e.width&&(a=e.x+(o.x*e.width+o.offsetX)-(o.x*i-o.offsetX)),n>e.height&&(h=e.y+(o.y*e.height+o.offsetY)-(o.y*n-o.offsetY))),o=t.rj,r=i-e.width,ie.left?a=e.left:ae.top?h=e.top:he;e++){var i=t.De.iterator;if(null===i||0===t.De.count)break;t.De=new _,t.Nv(i,t.De)}t.nodes.each((function(t){t instanceof gc&&0!=(65536&t.U)!=!1&&(t.U=65536^t.U)}))}}function tr(t,e){for(var i=A(),n=A(),o=e.memberParts;o.next();){var r=o.value;r.isVisible()&&(r instanceof gc?(ea(r)||na(r)||Iu(r))&&tr(t,r):r instanceof wc?r.fromNode===e||r.toNode===e?n.push(r):i.push(r):(r.measure(1/0,1/0),r.arrange()))}for(t=i.length,o=0;ow&&(y=M.left,v=M.right),m.height>k&&(x=M.top,b=M.bottom)):(y=M.left,v=M.right,x=M.top,b=M.bottom);var S=m.width+y+v,N=m.height+x+b,P=S>h/(M=t.scale),C=N>l/M;if(!(r||t.gf||t.Be||P||C))return!0;y=m.x-y,h=u.x,v=m.right+v,l=u.right+s,x=m.y-x;var T=u.y;m=m.bottom+b,u=u.bottom+a;var L="1px";if(b="1px",t.scrollMode===_r&&(P||C)&&(P&&t.hasHorizontalScrollbar&&t.allowHorizontalScroll&&(P=1,y+1l+1&&(P=Math.max((v-l)*M+t.Aa,P)),w+s+1u+1&&(P=Math.max((m-u)*M+t.ya,P)),k+a+1l+1&&(s=Math.max((v-l)*M+t.Aa,s)),w+1u+1&&(a=Math.max((m-u)*M+s,a)),k+1l+1&&(e=t.position.x*M)),t.tn)switch(t.bu){case"negative":e=-(p.scrollWidth-e-p.clientWidth);break;case"reverse":e=p.scrollWidth-e-p.clientWidth}return p.scrollLeft=e,t.hasVerticalScrollbar&&t.allowVerticalScroll&&(k+1u+1&&(p.scrollTop=t.position.y*M)),h=t.Aa,l=t.ya,p.style.width=h+(t.gf?t.Db:0)+"px",p.style.height=l+(t.Be?t.Db:0)+"px",i===h&&n===l&&!t.animationManager.zb||(i=Ot.allocAt(o,c,f,d),t.onViewportBoundsChanged(i,t.viewportBounds,M,r),Ot.free(i),!1)}function ar(t,e,i){var n=e.layer;null!==n&&n.diagram===t&&(e.isSelected=!1,e.isHighlighted=!1,e.C(2),i&&e.Lj(),0<=(i=n.pc(-1,e,!1))&&t.cb(pi,"parts",n,e,null,i,null),null!==(t=e.layerChanged)&&t(e,n,null))}function hr(t,e,i,n,o,r){if(!e.contains(i)&&(void 0===r&&(r=!1),!n||r||i.canMove()||i.canCopy()))if(void 0===o&&(o=ur(t)),i instanceof Ju){if(e.add(i,t.Pd(o,i,i.location)),i instanceof gc&&(null!==i.placeholder||o.dragsMembers))for(r=i.memberParts;r.next();)hr(t,e,r.value,n,o,o.groupsAlwaysMove);for(r=i.linksConnected;r.next();){var s=r.value;if(!e.contains(s)){var a=s.fromNode,h=s.toNode;null!==a&&e.contains(a)&&null!==h&&e.contains(h)&&hr(t,e,s,n,o)}}if(o.dragsTree)for(i=i.Ou();i.next();)hr(t,e,i.value,n,o)}else if(i instanceof wc)for(e.add(i,t.Pd(o,i)),i=i.labelNodes;i.next();)hr(t,e,i.value,n,o);else i instanceof Ku||e.add(i,t.Pd(o,i,i.location))}function lr(t,e,i,n,o){if(null!==e&&0!==e.count){var r=pt.alloc(),s=pt.alloc();s.assign(i),isNaN(s.x)&&(s.x=0),isNaN(s.y)&&(s.y=0),(i=t.Mr)||fr(t,e);for(var a=A(),h=A(),l=e.iterator,u=pt.alloc();l.next();){var c=l.key,f=l.value;if(c.Zc()){var d=pr(t,c,e);null!==d?a.push(new ks(c,f,d)):o&&!c.canMove()||(d=f.point,r.assign(d),t.computeMove(c,r.add(s),n,u),c.location=u,void 0===f.shifted&&(f.shifted=new pt),f.shifted.assign(u.re(d)))}else l.key instanceof wc&&h.push(l.sa)}for(pt.free(u),o=a.length,l=0;lt.maxScale&&(i=t.maxScale),r=pt.allocAt(t.pa.x+a/e-a/i,t.pa.y+h/e-h/i),t.position=r,pt.free(r),t.Ca=i,kr(t),t.vb=!1,t.onViewportBoundsChanged(o,t.viewportBounds,e,!1),Yo(t,!1),n.zb&&(Wn(n)||n.ce.add(n.H,"scale",e,t.Ca))}}function yr(t,e){var i=t.fe;if(null!==i&&i.visible){for(var n=At.alloc(),o=1,r=1,s=i.O.s,a=s.length,h=0;hu||(Fh(l.figure)?r=r*u/Xe.vx(r,u):o=o*u/Xe.vx(o,u))}if(s=i.gridCellSize,n.h(r*s.width,o*s.height),void 0!==e)o=e.width,r=e.height,t=e.x,s=e.y;else{if(e=Ot.alloc(),t=t.viewportBounds,e.h(t.x,t.y,t.width,t.height),!e.w())return void Ot.free(e);o=e.width,r=e.height,t=e.x,s=e.y,Ot.free(e)}i.width=o+2*n.width,i.height=r+2*n.height,e=pt.alloc(),Xe.No(t,s,0,0,n.width,n.height,e),e.offset(-n.width,-n.height),At.free(n),i.part.location=e,pt.free(e)}}function vr(t){var e=t.isModified;t.Tw!==e&&(t.Tw=e,t.R("Modified"))}function xr(t,e){for(var i=(e=e.O.s).length,n=0;n=n&&!r.defaultAnimation.isAnimating&&!r.zb&&(e||Hn(r,"Layout")),t.xh=!1;for(var s=t.ai.iterator;s.next();)Cr(t,s.value,e,n);o.isValidLayout||(!e||o.isRealtime||null===o.isRealtime||0===n?(o.doLayout(t),Qo(t),o.isValidLayout=!0):t.xh=!0)}finally{e=t.undoManager.isInternalTransaction,0===n&&(t.eb("Layout"),t.undoManager.isInternalTransaction=!1),!e||0!==n&&1!==n||Kn(r),t.aa=i}}}function Cr(t,e,i,n){if(null!==e){for(var o=e.gl.iterator;o.next();)Cr(t,o.value,i,n);null===(o=e.layout)||o.isValidLayout||(!i||o.isRealtime||0===n?(e.rh=!e.location.w(),o.doLayout(e),e.C(32),tr(t,e),o.isValidLayout=!0):t.xh=!0)}}function Tr(t,e){var i=t.hw.I(e);return null!==i?i:t.hw.I(e.toLowerCase())}function Lr(t,e){var i=t.iw.I(e);return null!==i||null!==(i=t.iw.I(e.toLowerCase()))?i:void w("Unknown DiagramEvent name: "+e)}function Ar(t){if(t.animationManager.isTicking)return!1;var e=t.currentTool;return e!==t.toolManager.findTool("Dragging")||(!t.Mr||e.isComplexRoutingRealtime)}function jr(t,e,i,n){var o=t.Xh;if(null===o&&(t.Xh=o=new pf(t.avoidanceCellSize)),o.vs||o.group!==i||o.Yx!==n){if(o.Hx=Math.max(o.Os+1,Math.floor(t.avoidanceLimit/t.avoidanceCellSize.width)),o.Ix=Math.max(o.Os+1,Math.floor(t.avoidanceLimit/t.avoidanceCellSize.height)),null!==i&&(i=Fr(t,i)),null===i){e=Ot.alloc(),t.computeOccupiedArea(e),e.Bc(100,100),o.initialize(e);for(var r=t.nodes;r.next();){var s=r.value,a=s.layer;null!==a&&a.visible&&!a.isTemporary&&Dr(t,s,n,e)}Ot.free(e)}else{for(0h?e(i,o,a):m.requestAnimationFrame(n)}for(var o=i.callback,r=!0,s=t.Og.iterator;s.next();)if(!s.value[0].al){r=!1;break}if("function"!=typeof o||r)return e(i,o,t);var a=t,h=i.callbackTimeout||300,l=+new Date;return m.requestAnimationFrame((function(){n()})),null}function zr(t,e,i,n){if(t.animationManager.Cc(),t.bd(),null===t.ta)return null;"object"!=typeof e&&w("properties argument must be an Object.");var o=e.size||null,r=e.scale||null;void 0!==e.scale&&isNaN(e.scale)&&(r="NaN");var s=e.maxSize;void 0===e.maxSize&&(s="SVG"===i?new At(1/0,1/0):new At(2e3,2e3));var a=e.position||null,h=e.parts||null,l=void 0===e.padding?1:e.padding,u=e.background||null,c=e.omitTemporary;void 0===c&&(c=!0);var f=e.document||document,d=e.elementFinished||null,p=e.showTemporary;void 0===p&&(p=!c),void 0===(e=e.showGrid)&&(e=p),null!==o&&isNaN(o.width)&&isNaN(o.height)&&(o=null),"number"==typeof l?l=new Wt(l):l instanceof Wt||w("MakeImage padding must be a Margin or a number."),l.left=Math.max(l.left,0),l.right=Math.max(l.right,0),l.top=Math.max(l.top,0),l.bottom=Math.max(l.bottom,0),t.ib.Vc(!0);var g=(c=new Fa(null,f,void 0,!0)).context;if(!(o||r||h||a))return c.width=t.Aa+Math.ceil(l.left+l.right),c.height=t.ya+Math.ceil(l.top+l.bottom),"SVG"===i?null===n?null:(n.resize(c.width,c.height,c.width,c.height),n.ownerDocument=f,n.hs=d,er(t,n.context,l,new At(c.width,c.height),t.Ca,t.pa,h,u,p,e),n.context):(t.Xm=!1,er(t,g,l,new At(c.width,c.height),t.Ca,t.pa,h,u,p,e),t.Xm=!0,c.context);var m=t.Pp,y=t.documentBounds.copy();if(y.Fv(t.yb),p)for(var v=t.Wa.s,x=v.length,b=0;bm?(r=m,o=y.width,y=y.height):(o=s.width,y=s.height):(o=y.width*r,y=y.height*r):(r=m,o=y.width,y=y.height),null!==l?(o+=a,y+=x):l=new Wt(0),null!==s&&(m=s.width,s=s.height,isNaN(m)&&(m=2e3),isNaN(s)&&(s=2e3),isFinite(m)&&(o=Math.min(o,m)),isFinite(s)&&(y=Math.min(y,s))),c.width=Math.ceil(o),c.height=Math.ceil(y),"SVG"===i?null===n?null:(n.resize(c.width,c.height,c.width,c.height),n.ownerDocument=f,n.hs=d,er(t,n.context,l,new At(Math.ceil(o),Math.ceil(y)),r,v,h,u,p,e),n.context):(t.Xm=!1,er(t,g,l,new At(Math.ceil(o),Math.ceil(y)),r,v,h,u,p,e),t.Xm=!0,c.context)}vo.className="AnimationTrigger",vo.Default=wo,vo.Immediate=ko,vo.Bundled=Mo,(e=So.prototype).clear=function(){for(var t=this.Pa,e=0;e=t)return e;for(var i=0,n=0,o=0,r=0,s=0,a=this.Pa.iterator;a.next();){var h=a.value;h instanceof gc?o++:h instanceof Ju?n++:h instanceof wc?r++:h instanceof Ku?s++:i++}if(a="",0i.Oq||a.height*o>i.Oq?e.gc(t,i):(o=e.actualBounds,r=e.naturalBounds,0===o.width||0===o.height||isNaN(o.x)||isNaN(o.y)||!e.isVisible()||(i=e.transform,null!==e.areaBackground&&(Us(e,t,e.areaBackground,!0,!0,r,o),t.fillRect(o.x,o.y,o.width,o.height)),null===e.areaBackground&&null===e.background&&(Us(e,t,"rgba(0,0,0,0.3)",!0,!1,r,o),t.fillRect(o.x,o.y,o.width,o.height)),null!==e.background&&(t.transform(i.m11,i.m12,i.m21,i.m22,i.dx,i.dy),Us(e,t,e.background,!0,!1,r,o),t.fillRect(0,0,r.width/2,r.height/2),i.ws()||(e=1/(i.m11*i.m22-i.m12*i.m21),t.transform(i.m22*e,-i.m12*e,-i.m21*e,i.m11*e,e*(i.m21*i.dy-i.m22*i.dx),e*(i.m12*i.dx-i.m11*i.dy)))))),n&&(t.restore(),t.Vc(!0))}},e.g=function(t,e,i,n,o){var r=this.diagram;null!==r&&r.cb(fi,t,this,e,i,n,o)},e.oi=function(t,e,i){var n=this.Pa;if(e.Ig=this,null===this&&Xs(e),t>=n.count)t=n.count;else if(n.M(t)===e)return-1;return n.Gb(t,e),e.Vo(i),null!==(n=this.diagram)&&(i?n.N():n.oi(e)),Co(this,t,e),t},e.pc=function(t,e,i){if(!i&&e.layer!==this&&null!==e.layer)return e.layer.pc(t,e,i);var n=this.Pa;if(0>t||t>=n.length){if(0>(t=n.indexOf(e)))return-1}else if(n.M(t)!==e&&0>(t=n.indexOf(e)))return-1;return e.Wo(i),n.mb(t),null!==(n=this.diagram)&&(i?n.N():n.pc(e)),e.Ig=null,Xs(e),t},f.Object.defineProperties(So.prototype,{parts:{get:function(){return this.Pa.iterator}},partsBackwards:{get:function(){return this.Pa.iteratorBackwards}},diagram:{get:function(){return this.H}},name:{get:function(){return this.xa},set:function(t){var e=this.xa;if(e!==t){var i=this.diagram;if(null!==i)for(""===e&&w("Cannot rename default Layer to: "+t),i=i.layers;i.next();)i.value.name===t&&w("Layer.name is already present in this diagram: "+t);for(this.xa=t,this.g("name",e,t),t=this.Pa.iterator;t.next();)t.value.layerName=this.xa}}},opacity:{get:function(){return this.pb},set:function(t){var e=this.pb;e!==t&&((0>t||1=t)return e;for(var i=this.Wa.iterator;i.next();)e+="\n "+i.value.toString(t-1);return e},To.prototype.addEventListener=function(t,e,i,n){t.addEventListener(e,i,{capture:n,passive:!1})},To.prototype.removeEventListener=function(t,e,i,n){t.removeEventListener(e,i,{capture:n})},To.prototype.computePixelRatio=function(){return null!==this.Yh?this.Yh:m.devicePixelRatio||1},To.prototype.doMouseMove=function(){this.currentTool.doMouseMove()},To.prototype.doMouseDown=function(){this.currentTool.doMouseDown()},To.prototype.doMouseUp=function(){this.currentTool.doMouseUp()},To.prototype.doMouseWheel=function(){this.currentTool.doMouseWheel()},To.prototype.doKeyDown=function(){this.currentTool.doKeyDown()},To.prototype.doKeyUp=function(){this.currentTool.doKeyUp()},To.prototype.doFocus=function(){this.focus()},To.prototype.focus=function(){if(this.ta)if(this.scrollsPageOnFocus)this.ta.focus();else{var t=m.scrollX||m.pageXOffset,e=m.scrollY||m.pageYOffset;this.ta.focus(),m.scrollTo(t,e)}},To.prototype.Oy=function(){this.H.R("GainedFocus")},To.prototype.Ny=function(){this.H.R("LostFocus")},To.prototype.kx=function(t){if(null!==this.ta){var e=this.ku,i=this.hu;this.qr=!0;var n=this.documentBounds,o=this.viewportBounds,r=this.rj,s=n.x-r.left,a=n.y-r.top,h=n.width+r.left+r.right,l=n.height+r.top+r.bottom,u=n.right+r.right;r=n.bottom+r.bottom;var c=o.x;n=o.y;var f=o.width,d=o.height,p=o.right,g=o.bottom;o=this.scale;var m=t.scrollLeft;if(this.tn)switch(this.bu){case"negative":m=m+t.scrollWidth-t.clientWidth;break;case"reverse":m=t.scrollWidth-m-t.clientWidth}var y=m;fp&&(this.position=m.h(-(e.scrollWidth-this.Aa)+y-this.Aa/o+u,this.position.y))),t.vy&&this.allowVerticalScroll&&(ag&&(this.position=m.h(this.position.x,-(e.scrollHeight-this.ya)+t.scrollTop-this.ya/o+r))),pt.free(m),this.vd=!0,this.Ee=this.qr=!1,n=this.documentBounds,o=this.viewportBounds,u=n.right,p=o.right,r=n.bottom,g=o.bottom,s=n.x,c=o.x,a=n.y,n=o.y,f>=h&&s>=c&&u<=p&&(i.style.width="1px"),d>=l&&a>=n&&r<=g&&(i.style.height="1px"))}},To.prototype.computeBounds=function(t){return void 0===t&&(t=new Ot),Qo(this),Vo(this,t)},To.prototype.computePartsBounds=function(t,e){void 0===e&&(e=!1);var i=null;if(P(t))for(var n=0;no/i?(r-(this.Be?this.Db:0))/n:(o-(this.gf?this.Db:0))/i:Math.min(r/n,o/i)}this.scale=o,this.position=new pt(t.x,t.y)}},e.Jy=function(t,e){this.Va();var i=this.documentBounds,n=this.viewportBounds;this.position=new pt(i.x+(t.x*i.width+t.offsetX)-(e.x*n.width-e.offsetX),i.y+(t.y*i.height+t.offsetY)-(e.y*n.height-e.offsetY))},e.zz=function(t){if(t instanceof Ds){this.eq=t;var e=pt.alloc();this.fq=this.op(t.ga(te,e)),pt.free(e)}else this.eq=null,this.fq=st},e.Ol=function(t,e){if(void 0===e&&(e=!0),e){if((t=Uo(this,t,(function(t){return t.part}),(function(t){return t.canSelect()})))instanceof ku)return t}else if((t=Uo(this,t,(function(t){return t.part})))instanceof ku)return t;return null},e.ic=function(t,e,i){void 0===e&&(e=null),void 0===i&&(i=null),Qo(this);for(var n=this.Wa.iteratorBackwards;n.next();){var o=n.value;if(o.visible&&null!==(o=o.ic(t,e,i)))return o}return null},e.lz=function(t,e,i){return void 0===e&&(e=!0),function(t,e,i,n,o){for(void 0===i&&(i=null),void 0===n&&(n=null),o instanceof Z||o instanceof _||(o=new _),Qo(t),t=t.Wa.iteratorBackwards;t.next();){var r=t.value;r.visible&&!r.isTemporary&&r.ji(e,i,n,o)}return o}(this,t,(function(t){return t.part}),e?function(t){return t instanceof ku&&t.canSelect()}:null,i)},e.ji=function(t,e,i,n){void 0===e&&(e=null),void 0===i&&(i=null),n instanceof Z||n instanceof _||(n=new _),Qo(this);for(var o=this.Wa.iteratorBackwards;o.next();){var r=o.value;r.visible&&r.ji(t,e,i,n)}return n},e.ux=function(t,e,i,n){return void 0===e&&(e=!1),void 0===i&&(i=!0),function(t,e,i,n,o){var r=null;for(void 0===r&&(r=null),void 0===i&&(i=null),void 0===n&&(n=!1),o instanceof Z||o instanceof _||(o=new _),Qo(t),t=t.Wa.iteratorBackwards;t.next();){var s=t.value;s.visible&&!s.isTemporary&&s.Cf(e,r,i,n,o)}return o}(this,t,(function(t){return t instanceof ku&&(!i||t.canSelect())}),e,n)},e.Cf=function(t,e,i,n,o){void 0===e&&(e=null),void 0===i&&(i=null),void 0===n&&(n=!1),o instanceof Z||o instanceof _||(o=new _),Qo(this);for(var r=this.Wa.iteratorBackwards;r.next();){var s=r.value;s.visible&&s.Cf(t,e,i,n,o)}return o},e.Nu=function(t,e,i,n,o,r){var s=new _;Qo(this);for(var a=this.Wa.iteratorBackwards;a.next();){var h=a.value;h.visible&&h.Nu(t,e,i,n,s,o,r)}return s},e.mz=function(t,e,i,n,o){return void 0===i&&(i=!0),void 0===n&&(n=!0),function(t,e,i,n,o,r){var s=null;void 0===s&&(s=null),void 0===n&&(n=null),void 0===o&&(o=!0),!1!==o&&!0!==o&&((o instanceof Z||o instanceof _)&&(r=o),o=!0);for(r instanceof Z||r instanceof _||(r=new _),Qo(t),t=t.Wa.iteratorBackwards;t.next();){var a=t.value;a.visible&&!a.isTemporary&&a.og(e,i,s,n,o,r)}return r}(this,t,e,(function(t){return t instanceof ku&&(!n||t.canSelect())}),i,o)},e.og=function(t,e,i,n,o,r){void 0===i&&(i=null),void 0===n&&(n=null),void 0===o&&(o=!0),!1!==o&&!0!==o&&((o instanceof Z||o instanceof _)&&(r=o),o=!0),r instanceof Z||r instanceof _||(r=new _),Qo(this);for(var s=this.Wa.iteratorBackwards;s.next();){var a=s.value;a.visible&&a.og(t,e,i,n,o,r)}return r},To.prototype.acceptEvent=function(t){return qo(this,t,t instanceof MouseEvent)},To.prototype.Qz=function(t){var e=this.H;if(!this.H.isEnabled)return!1;var i=qo(e,t,!1);switch(i.key=String.fromCharCode(t.which),i.down=!0,t.which){case 8:i.key="Backspace";break;case 33:i.key="PageUp";break;case 34:i.key="PageDown";break;case 35:i.key="End";break;case 36:i.key="Home";break;case 37:i.key="Left";break;case 38:i.key="Up";break;case 39:i.key="Right";break;case 40:i.key="Down";break;case 45:i.key="Insert";break;case 46:i.key="Del";break;case 48:i.key="0";break;case 187:case 61:case 107:i.key="Add";break;case 189:case 173:case 109:i.key="Subtract";break;case 27:i.key="Esc"}return e.doKeyDown(),Wo(i,t)},To.prototype.Rz=function(t){var e=this.H;if(!e.isEnabled)return!1;var i=qo(e,t,!1);switch(i.key=String.fromCharCode(t.which),i.up=!0,t.which){case 8:i.key="Backspace";break;case 33:i.key="PageUp";break;case 34:i.key="PageDown";break;case 35:i.key="End";break;case 36:i.key="Home";break;case 37:i.key="Left";break;case 38:i.key="Up";break;case 39:i.key="Right";break;case 40:i.key="Down";break;case 45:i.key="Insert";break;case 46:i.key="Del"}return e.doKeyUp(),Wo(i,t)},To.prototype.bz=function(t){var e=this.H;if(!e.isEnabled)return!1;var i=qo(e,t,!0);return null!==e.mouseEnter&&e.mouseEnter(i),e.currentTool.standardMouseOver(),Wo(i,t)},To.prototype.cz=function(t){var e=this.H;if(!e.isEnabled)return!1;var i=qo(e,t,!0);return null!==e.mouseLeave&&e.mouseLeave(i),Wo(i,t)},To.prototype.getMouse=function(t){var e=this.ta;if(null===e)return new pt(0,0);var i=e.getBoundingClientRect();return e=t.clientX-this.Aa/i.width*i.left,t=t.clientY-this.ya/i.height*i.top,null!==this.Ab?vt(new pt(e,t),this.Ab):new pt(e,t)},To.prototype.Ya=function(){this.Zi||(this.Zi=!0,this.$b(!1))},To.prototype.redraw=function(){this.vb||this.ld||(this.N(),this.bd())},(e=To.prototype).Pz=function(){return this.kg},e.Xy=function(t){void 0===t&&(t=null);var e=this.animationManager,i=e.isEnabled;e.Cc(),e.isEnabled=!1,_o(this),this.hf=!1,this.du=new pt(NaN,NaN),e.isEnabled=i,this.ld=!0;var n=this;null!==t&&x((function(){n.ld=!1,Hn(e,"Model"),t(n)}),1)},e.$b=function(t){if(void 0===t&&(t=!1),!0!==this.kg&&!(this.vb||!1===t&&this.ld)){this.kg=!0;var e=this;m.requestAnimationFrame((function(){e.kg&&e.bd()}))}},e.bd=function(){this.fn&&!this.kg||(this.fn&&(this.fn=!1),_o(this))},e.Nv=function(t,e){for(t.reset();t.next();){var i=t.value;!i.Zc()||i instanceof gc||(i.si()?(i.measure(1/0,1/0),i.arrange()):e.add(i))}for(t.reset();t.next();)(i=t.value)instanceof gc&&i.isVisible()&&tr(this,i);for(t.reset();t.next();)(i=t.value)instanceof wc&&i.isVisible()&&(i.si()?(i.measure(1/0,1/0),i.arrange()):e.add(i));for(t.reset();t.next();)(i=t.value)instanceof Ku&&i.isVisible()&&(i.si()?(i.measure(1/0,1/0),i.arrange()):e.add(i))},e.Fd=function(t,e,i,n){if(this.vd||this.animationManager.isAnimating)for(var o=0;on&&this.Ya(),this},e.Cy=function(t,e){gr(this,t,e),t.Xe(this);var i=this.Wa,n=i.indexOf(t);0<=n&&(i.remove(t),null!==this.cc&&this.cb(pi,"layers",this,t,null,n,null));var o,r=i.count;for(o=0;on&&this.Ya(),this},e.kA=function(t){if(t.diagram!==this&&w("Cannot remove a Layer from another Diagram: "+t+" of "+t.diagram),""!==t.name){var e=this.Wa,i=e.indexOf(t);if(e.remove(t)){for(e=t.Pa.copy().iterator;e.next();){var n=e.value,o=n.layerName;o!==t.name?n.layerName=o:n.layerName=""}null!==this.cc&&this.cb(pi,"layers",this,t,null,i,null),this.N(),this.Ya()}}},e.Qj=function(t){for(var e=this.layers;e.next();){var i=e.value;if(i.name===t)return i}return null},e.Yw=function(t){return null===this.pf&&(this.pf=new Z),this.pf.add(t),this.model.Pe(t),this},e.mA=function(t){null!==this.pf&&(this.pf.remove(t),0===this.pf.count&&(this.pf=null)),this.model.ik(t)},e.Pe=function(t){return null===this.zg&&(this.zg=new Z),this.zg.add(t),this},e.ik=function(t){null!==this.zg&&(this.zg.remove(t),0===this.zg.count&&(this.zg=null))},e.ds=function(t){if(this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.Tu(t),t.change!==ci&&(this.isModified=!0),null!==this.zg)for(var e=this.zg,i=e.length,n=0;nc.Pa.indexOf(d)&&c.oi(f,d,p):(d.isSelected=!1,d.isHighlighted=!1,d.Wb(),c.pc(p?f:-1,d,p)))}else c instanceof To?"number"==typeof f&&d instanceof So&&(e?(d.Xe(this),this.Wa.Gb(f,d)):this.Wa.mb(f)):w("unknown ChangedEvent.Remove object: "+t.toString());this.isModified=!0}else n!==ci&&w("unknown ChangedEvent: "+t.toString())}finally{this.skipsModelSourceBindings=i}}},To.prototype.Ea=function(t){return this.undoManager.Ea(t)},To.prototype.eb=function(t){return this.undoManager.eb(t)},To.prototype.Kf=function(){return this.undoManager.Kf()},To.prototype.commit=function(t,e){void 0===e&&(e="");var i=this.skipsUndoManager;null===e&&(this.skipsUndoManager=!0,e=""),this.undoManager.Ea(e);var n=!1;try{t(this),n=!0}finally{n?this.undoManager.eb(e):this.undoManager.Kf(),this.skipsUndoManager=i}},To.prototype.updateAllTargetBindings=function(t){this.partManager.updateAllTargetBindings(t)},To.prototype.rp=function(){this.partManager.rp()},To.prototype.onViewportBoundsChanged=function(t,e,i,n){if(!t.D(e)){void 0===n&&(n=!1),n||(this.Ee=!0),this.vd=!0;var o=this.layout;null===o||!o.isViewportSized||this.autoScale!==Xr||t.width===e.width&&t.height===e.height||o.C(),o=this.currentTool,!0===this.Vk&&o instanceof xi&&(this.lastInput.documentPoint=this.Ps(this.lastInput.viewPoint),bi(o,this)),this.vb||this.invalidateViewport(t,e),yr(this),this.fc.scale=i,this.fc.position.x=t.x,this.fc.position.y=t.y,this.fc.bounds.assign(t),this.fc.canvasSize.width=Math.round(t.width*i),this.fc.canvasSize.height=Math.round(t.height*i),this.fc.newCanvasSize.width=this.Aa,this.fc.newCanvasSize.height=this.ya,this.fc.isScroll=n,this.R("ViewportBoundsChanged",this.fc,t),this.isVirtualized&&this.links.each((function(t){t.isAvoiding&&t.actualBounds.Yc(e)&&t.bb()}))}},To.prototype.clearSelection=function(t){void 0===t&&(t=!1);var e=this.selection;if(0!==e.count){t||this.R("ChangingSelection",e);for(var i=e.Fa(),n=i.length,o=0;o=i.top&&0>=i.left&&0>=i.right&&0>=i.bottom)return e;var n=this.viewportBounds,o=this.scale;n=Ot.allocAt(0,0,n.width*o,n.height*o);var r=pt.allocAt(0,0);if(t.x>=n.x&&t.xn.x+n.width-i.right&&this.allowHorizontalScroll&&(s=Math.max(this.scrollHorizontalLineChange,1),s|=0,r.x+=s,t.x>n.x+n.width-i.right/2&&(r.x+=s),t.x>n.x+n.width-i.right/4&&(r.x+=4*s));return t.y>=n.y&&t.yn.y+n.height-i.bottom&&this.allowVerticalScroll&&(s=Math.max(this.scrollVerticalLineChange,1),s|=0,r.y+=s,t.y>n.y+n.height-i.bottom/2&&(r.y+=s),t.y>n.y+n.height-i.bottom/4&&(r.y+=4*s)),r.Xa(it)||(e=new pt(e.x+r.x/o,e.y+r.y/o)),Ot.free(n),pt.free(r),e},(e=To.prototype).Cs=function(){return null},e.av=function(){return null},e.bs=function(t,e){this.pj.add(t,e)},e.Fu=function(t){(this.Pw=t)||this.nodes.each((function(t){t instanceof gc&&(t.$p=null)}))},e.Wz=function(t){return Vr?(void 0===t&&(t={}),t.returnType="Image",this.Jx(t)):null},e.Jx=function(t){return void 0===t&&(t={}),Ir(this,this.Xz,t)},e.Xz=function(t,e,i){var n=zr(i,t,"canvas",null);if(null===n)return null;var o=null;if(null!==(i=n.Z.canvas))switch(o=t.returnType,o=void 0===o?"string":o.toLowerCase(),o){case rs+"data":o=n.getImageData(0,0,i.width,i.height);break;case rs:(n=(t.document||document).createElement("img")).src=i.toDataURL(t.type,t.details),o=n;break;case"blob":return"function"!=typeof e&&w('Error: Diagram.makeImageData called with "returnType: toBlob", but no required "callback" function property defined.'),"function"==typeof i.toBlob?(i.toBlob(e,t.type,t.details),"toBlob"):(e(null),null);default:o=i.toDataURL(t.type,t.details)}return"function"==typeof e?(e(o),null):o},f.Object.defineProperties(To.prototype,{renderer:{get:function(){return this.nl},set:function(t){this instanceof Ps||(""===t&&(t="default"),(t=t.toLowerCase())!==this.nl&&(this.nl=t,"default"===t||"canvas"===t?(null!==(t=this.pj.get("svg"))&&t.Oa.remove(),this.ta&&(this.ib=this.ta.context)):"svg"===t?(this.pj.contains("svg")?t=this.pj.get("svg"):(t=new ya(this,m.document),this.bs("svg",t)),null!==this.div&&this.div.appendChild(t.Oa),this.ib=t.context,this.ta&&(this.ta.context.setTransform(this.Mb,0,0,this.Mb,0,0),this.ta.context.clearRect(0,0,this.Aa,this.ya))):"debug"!==t||this.pj.contains("SVG")||(t=new ya(this,m.document),this.bs("SVG",t),t.Oa.style.backgroundColor="whitesmoke",null!==this.div&&this.div.after(t.Oa)),this.hk()))}},div:{get:function(){return this.Ka},set:function(t){if(this.Ka!==t){var e=this.Ka;null!==e?(e.H=void 0,e.goDiagram=void 0,e.go=void 0,e.innerHTML="",null!==this.ta&&(e=this.ta.Oa,this.removeEventListener(e,"pointermove",this.dk,!1),this.removeEventListener(e,"pointerdown",this.ui,!1),this.removeEventListener(e,"pointerup",this.fk,!1),this.removeEventListener(e,"pointerout",this.ek,!1),this.removeEventListener(e,"pointercancel",this.ck,!1),this.ta.mx()),this.ol&&(this.ol.disconnect(),this.ol=null),null!==(e=this.toolManager)&&(e.mouseDownTools.each((function(t){t.cancelWaitAfter()})),e.mouseMoveTools.each((function(t){t.cancelWaitAfter()})),e.mouseUpTools.each((function(t){t.cancelWaitAfter()}))),e.cancelWaitAfter(),this.currentTool.doCancel(),this.ta=null,this.removeEventListener(m,"resize",this.Ov,!1),this.removeEventListener(m,"wheel",this.$j,!0),bo===this&&(bo=null)):null===this.ui&&(this.hf=!1),this.Ka=null,null!==t&&((e=t.H)&&(e.div=null),Fo(this,t),this.hk())}}},$w:{get:function(){return this.Sq}},pi:{get:function(){return this.hf}},draggedLink:{get:function(){return this.nt},set:function(t){this.nt!==t&&(this.nt=t,null!==t&&(this.Vt=t.fromPort,this.Wt=t.toPort))}},Mx:{get:function(){return this.Vt},set:function(t){this.Vt=t}},Nx:{get:function(){return this.Wt},set:function(t){this.Wt=t}},animationManager:{get:function(){return this.Yd}},undoManager:{get:function(){return this.cc.undoManager}},skipsUndoManager:{get:function(){return this.Wg},set:function(t){this.Wg=t,this.cc.skipsUndoManager=t}},delaysLayout:{get:function(){return this.lt},set:function(t){this.lt=t}},opacity:{get:function(){return this.pb},set:function(t){var e=this.pb;e!==t&&((0>t||1t&&M(t,">= 0",To,"scrollHorizontalLineChange"),this.iu=t,this.g("scrollHorizontalLineChange",e,t))}},scrollVerticalLineChange:{get:function(){return this.mu},set:function(t){var e=this.mu;e!==t&&(0>t&&M(t,">= 0",To,"scrollVerticalLineChange"),this.mu=t,this.g("scrollVerticalLineChange",e,t))}},lastInput:{get:function(){return this.cj},set:function(t){this.cj=t}},previousInput:{get:function(){return this.Qg},set:function(t){this.Qg=t}},firstInput:{get:function(){return this.bq},set:function(t){this.bq=t}},currentCursor:{get:function(){return this.it},set:function(t){if(""===t&&(t=this.Op),this.it!==t){var e=this.ta,i=this.Ka;if(null!==e&&null!==i){this.it=t;var n=e.style.cursor;e.style.cursor=t,i.style.cursor=t,e.style.cursor===n&&(e.style.cursor="-webkit-"+t,i.style.cursor="-webkit-"+t,e.style.cursor===n&&(e.style.cursor="-moz-"+t,i.style.cursor="-moz-"+t,e.style.cursor===n&&(e.style.cursor=t,i.style.cursor=t)))}}}},defaultCursor:{get:function(){return this.Op},set:function(t){""===t&&(t="auto");var e=this.Op;e!==t&&(this.Op=t,this.g("defaultCursor",e,t))}},click:{get:function(){return this.zh},set:function(t){var e=this.zh;e!==t&&(this.zh=t,this.g("click",e,t))}},doubleClick:{get:function(){return this.Fh},set:function(t){var e=this.Fh;e!==t&&(this.Fh=t,this.g("doubleClick",e,t))}},contextClick:{get:function(){return this.Bh},set:function(t){var e=this.Bh;e!==t&&(this.Bh=t,this.g("contextClick",e,t))}},mouseOver:{get:function(){return this.Qh},set:function(t){var e=this.Qh;e!==t&&(this.Qh=t,this.g("mouseOver",e,t))}},mouseHover:{get:function(){return this.Oh},set:function(t){var e=this.Oh;e!==t&&(this.Oh=t,this.g("mouseHover",e,t))}},mouseHold:{get:function(){return this.Nh},set:function(t){var e=this.Nh;e!==t&&(this.Nh=t,this.g("mouseHold",e,t))}},mouseDragOver:{get:function(){return this.Qt},set:function(t){var e=this.Qt;e!==t&&(this.Qt=t,this.g("mouseDragOver",e,t))}},mouseDrop:{get:function(){return this.Lh},set:function(t){var e=this.Lh;e!==t&&(this.Lh=t,this.g("mouseDrop",e,t))}},handlesDragDropForTopLevelParts:{get:function(){return this.xt},set:function(t){var e=this.xt;e!==t&&(this.xt=t,this.g("handlesDragDropForTopLevelParts",e,t))}},mouseEnter:{get:function(){return this.Mh},set:function(t){var e=this.Mh;e!==t&&(this.Mh=t,this.g("mouseEnter",e,t))}},mouseLeave:{get:function(){return this.Ph},set:function(t){var e=this.Ph;e!==t&&(this.Ph=t,this.g("mouseLeave",e,t))}},toolTip:{get:function(){return this.$h},set:function(t){var e=this.$h;e!==t&&(this.$h=t,this.g("toolTip",e,t))}},contextMenu:{get:function(){return this.Ch},set:function(t){var e=this.Ch;e!==t&&(this.Ch=t,this.g("contextMenu",e,t))}},commandHandler:{get:function(){return this.nb},set:function(t){this.nb!==t&&(this.nb=t,t.Xe(this))}},toolManager:{get:function(){return this.te},set:function(t){this.te!==t&&(this.te=t,t.diagram=this)}},defaultTool:{get:function(){return this.ob},set:function(t){var e=this.ob;e!==t&&(this.ob=t,t.diagram=this,this.currentTool===e&&(this.currentTool=t))}},currentTool:{get:function(){return this.hb},set:function(t){var e=this.hb;e&&(e.isActive&&e.doDeactivate(),e.cancelWaitAfter(),e.doStop()),null===t&&(t=this.defaultTool),null!==t&&(this.hb=t,t.diagram=this,t.doStart())}},selection:{get:function(){return this.Hw}},maxSelectionCount:{get:function(){return this.Nt},set:function(t){var e=this.Nt;if(e!==t)if(0<=t&&!isNaN(t)){if(this.Nt=t,this.g("maxSelectionCount",e,t),!this.undoManager.isUndoingRedoing&&0<(t=this.selection.count-t)){this.R("ChangingSelection",this.selection),e=this.selection.Fa();for(var i=0;i= 0",To,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{get:function(){return this.St},set:function(t){var e=this.St;e!==t&&(this.St=t,this.g("nodeSelectionAdornmentTemplate",e,t))}},groupSelectionAdornmentTemplate:{get:function(){return this.wt},set:function(t){var e=this.wt;e!==t&&(this.wt=t,this.g("groupSelectionAdornmentTemplate",e,t))}},linkSelectionAdornmentTemplate:{get:function(){return this.Kt},set:function(t){var e=this.Kt;e!==t&&(this.Kt=t,this.g("linkSelectionAdornmentTemplate",e,t))}},highlighteds:{get:function(){return this.nw}},isModified:{get:function(){var t=this.undoManager;return t.isEnabled?null!==t.currentTransaction||this.rn&&this.Ce!==t.historyIndex:this.rn},set:function(t){if(this.rn!==t){this.rn=t;var e=this.undoManager;!t&&e.isEnabled&&(this.Ce=e.historyIndex),t||vr(this)}}},model:{get:function(){return this.cc},set:function(t){var e=this.cc;if(e!==t){this.currentTool.doCancel(),e&&e.undoManager!==t.undoManager&&e.undoManager.isInTransaction&&w("Do not replace a Diagram.model while a transaction is in progress."),this.animationManager.Cc(!0);var i=Ao(this,!0);this.hf=!1,this.fn=!0,this.Ce=-2,this.kg=!1;var n=this.vb;this.vb=!0,Hn(this.animationManager,"Model"),e&&(null!==this.pf&&this.pf.each((function(t){return e.ik(t)})),e.ik(this.Oc)),this.cc=t,this.partManager=function(t){return null!==(t=Rr.get(t))?new t:new Qf}(this.cc.type);for(var o=0;othis.scale&&(this.scale=t)):M(t,"> 0",To,"minScale"))}},maxScale:{get:function(){return this.Mt},set:function(t){var e=this.Mt;e!==t&&(0 0",To,"maxScale"))}},zoomPoint:{get:function(){return this.zu},set:function(t){this.zu.D(t)||(this.zu=t=t.J())}},contentAlignment:{get:function(){return this.zk},set:function(t){var e=this.zk;e.D(t)||(this.zk=t=t.J(),this.g("contentAlignment",e,t),Yo(this,!1))}},initialContentAlignment:{get:function(){return this.pq},set:function(t){var e=this.pq;e.D(t)||(this.pq=t=t.J(),this.g("initialContentAlignment",e,t))}},padding:{get:function(){return this.yb},set:function(t){"number"==typeof t&&(t=new Wt(t));var e=this.yb;e.D(t)||(this.yb=t=t.J(),this.Ya(),this.g("padding",e,t))}},partManager:{get:function(){return this.Pc},set:function(t){var e=this.Pc;e!==t&&(null!==t.diagram&&w("Cannot share PartManagers between Diagrams: "+t.toString()),e&&e.Xe(null),this.Pc=t,t.Xe(this))}},nodes:{get:function(){return this.partManager.nodes.iterator}},links:{get:function(){return this.partManager.links.iterator}},parts:{get:function(){return this.partManager.parts.iterator}},layout:{get:function(){return this.Sc},set:function(t){var e=this.Sc;e!==t&&(this.Sc=t,t.diagram=this,t.group=null,this.xh=!0,this.g("layout",e,t),this.$b())}},isTreePathToChildren:{get:function(){return this.Ht},set:function(t){var e=this.Ht;if(e!==t&&(this.Ht=t,this.g("isTreePathToChildren",e,t),!this.undoManager.isUndoingRedoing))for(t=this.nodes;t.next();)oc(t.value)}},treeCollapsePolicy:{get:function(){return this.uu},set:function(t){var e=this.uu;e!==t&&(t!==ts&&t!==es&&t!==is&&w("Unknown Diagram.treeCollapsePolicy: "+t),this.uu=t,this.g("treeCollapsePolicy",e,t))}},Ue:{get:function(){return this.pw},set:function(t){this.pw=t}},avoidanceCellSize:{get:function(){return this.aw},set:function(t){this.Xh=null,this.aw=new At(Math.max(1,t.width),Math.max(1,t.height))}},avoidanceLimit:{get:function(){return this.bw},set:function(t){this.bw=Math.max(1,t)}},autoScrollInterval:{get:function(){return this.vp},set:function(t){var e=this.vp;e!==t&&(this.vp=t,this.g("autoScrollInterval",e,t))}},autoScrollRegion:{get:function(){return this.xp},set:function(t){"number"==typeof t&&(t=new Wt(t));var e=this.xp;e.D(t)||(this.xp=t=t.J(),this.Ya(),this.g("autoScrollRegion",e,t))}}}),f.Object.defineProperties(To,{licenseKey:{get:function(){return ns.jc()},set:function(t){ns.add(t.replace(/\s/g,""))}},version:{get:function(){return os}}}),To.prototype.makeImageData=To.prototype.Jx,To.prototype.makeImage=To.prototype.Wz,To.prototype.cacheGroupExternalLinks=To.prototype.Fu,To.prototype.addRenderer=To.prototype.bs,To.prototype.makeSVG=To.prototype.av,To.prototype.makeSvg=To.prototype.Cs,To.prototype.stopAutoScroll=To.prototype.ug,To.prototype.doAutoScroll=To.prototype.gs,To.prototype.isUnoccupied=To.prototype.Yj,To.prototype.raiseDiagramEvent=To.prototype.R,To.prototype.removeDiagramListener=To.prototype.am,To.prototype.addDiagramListener=To.prototype.Bj,To.prototype.findTreeRoots=To.prototype.yz,To.prototype.layoutDiagram=To.prototype.Uz,To.prototype.findTopLevelGroups=To.prototype.qz,To.prototype.findTopLevelNodesAndLinks=To.prototype.rz,To.prototype.ensureBounds=To.prototype.Va,To.prototype.findLinksByExample=To.prototype.ls,To.prototype.findNodesByExample=To.prototype.ms,To.prototype.findLinkForData=To.prototype.Kc,To.prototype.findNodeForData=To.prototype.ii,To.prototype.findPartForData=To.prototype.Lc,To.prototype.findLinkForKey=To.prototype.findLinkForKey,To.prototype.findNodeForKey=To.prototype.Vb,To.prototype.findPartForKey=To.prototype.findPartForKey,To.prototype.rebuildParts=To.prototype.Wd,To.prototype.transformViewToDoc=To.prototype.Ps,To.prototype.transformRectDocToView=To.prototype.zA,To.prototype.transformDocToView=To.prototype.op,To.prototype.centerRect=To.prototype.es,To.prototype.scrollToRect=To.prototype.tv,To.prototype.scroll=To.prototype.scroll,To.prototype.highlightCollection=To.prototype.Jz,To.prototype.highlight=To.prototype.Iz,To.prototype.selectCollection=To.prototype.rA,To.prototype.select=To.prototype.select,To.prototype.updateAllRelationshipsFromData=To.prototype.rp,To.prototype.updateAllTargetBindings=To.prototype.updateAllTargetBindings,To.prototype.commit=To.prototype.commit,To.prototype.rollbackTransaction=To.prototype.Kf,To.prototype.commitTransaction=To.prototype.eb,To.prototype.startTransaction=To.prototype.Ea,To.prototype.raiseChanged=To.prototype.g,To.prototype.raiseChangedEvent=To.prototype.cb,To.prototype.removeChangedListener=To.prototype.ik,To.prototype.addChangedListener=To.prototype.Pe,To.prototype.removeModelChangedListener=To.prototype.mA,To.prototype.addModelChangedListener=To.prototype.Yw,To.prototype.findLayer=To.prototype.Qj,To.prototype.removeLayer=To.prototype.kA,To.prototype.addLayerAfter=To.prototype.Cy,To.prototype.addLayerBefore=To.prototype.Ww,To.prototype.addLayer=To.prototype.Al,To.prototype.moveParts=To.prototype.moveParts,To.prototype.copyParts=To.prototype.Kj,To.prototype.removeParts=To.prototype.Is,To.prototype.remove=To.prototype.remove,To.prototype.add=To.prototype.add,To.prototype.clearDelayedGeometries=To.prototype.bx,To.prototype.setProperties=To.prototype.nm,To.prototype.attach=To.prototype.Du,To.prototype.set=To.prototype.set,To.prototype.resetInputOptions=To.prototype.Sx,To.prototype.setInputOption=To.prototype.sA,To.prototype.getInputOption=To.prototype.Ql,To.prototype.resetRenderingHints=To.prototype.Tx,To.prototype.setRenderingHint=To.prototype.Xx,To.prototype.getRenderingHint=To.prototype.Gf,To.prototype.maybeUpdate=To.prototype.bd,To.prototype.requestUpdate=To.prototype.$b,To.prototype.delayInitialization=To.prototype.Xy,To.prototype.isUpdateRequested=To.prototype.Pz,To.prototype.invalidateDocumentBounds=To.prototype.Ya,To.prototype.findObjectsNear=To.prototype.og,To.prototype.findPartsNear=To.prototype.mz,To.prototype.findObjectsIn=To.prototype.Cf,To.prototype.findPartsIn=To.prototype.ux,To.prototype.findObjectsAt=To.prototype.ji,To.prototype.findPartsAt=To.prototype.lz,To.prototype.findObjectAt=To.prototype.ic,To.prototype.findPartAt=To.prototype.Ol,To.prototype.focusObject=To.prototype.zz,To.prototype.alignDocument=To.prototype.Jy,To.prototype.zoomToRect=To.prototype.BA,To.prototype.zoomToFit=To.prototype.zoomToFit,To.prototype.diagramScroll=To.prototype.kx,To.prototype.focus=To.prototype.focus;var Rr=new dt,Er=null,Vr=void 0!==m.document,Yr=null,Gr="",Xr=new V(To,"None",0),Ur=new V(To,"Uniform",1),qr=new V(To,"UniformToFill",2),Hr=new V(To,"CycleAll",10),Kr=new V(To,"CycleNotDirected",11),Wr=new V(To,"CycleNotDirectedFast",12),Jr=new V(To,"CycleNotUndirected",13),Zr=new V(To,"CycleDestinationTree",14),$r=new V(To,"CycleSourceTree",15),_r=new V(To,"DocumentScroll",1),Qr=new V(To,"InfiniteScroll",2),ts=new V(To,"TreeParentCollapsed",21),es=new V(To,"AllParentsCollapsed",22),is=new V(To,"AnyParentsCollapsed",23),ns=new Z,os="2.3.10",rs="image",ss=null,as=!1;function hs(){this.wy=null,this.j="zz@orderNum","63ad05bbe23a1786468a4c741b6d2"===this._tk?this.Rc=this.j=!0:this.Rc=null}function ls(t,e){if(e.ib.setTransform(e.Mb,0,0,e.Mb,0,0),e.ib.yc(),null===t.Rc)t:{e="f";var i=m[I("76a715b2f73f148a")][I("72ba13b5")]||"";if(t.Rc=!0,Vr){var n=To[I("76a115b6ed251eaf4692")];if(n)for(var o=ns.iterator;o.next()&&!(6>(n=I(n=o.value).split(I("39e9"))).length);){var r=I(n[1]).split(".");if("7da71ca0"!==n[4])break;var s=I(y[I("6cae19")]).split(".");if(r[0]>s[0]||r[0]===s[0]&&r[1]>=s[1]){var a=m[I("74a900bae4370f8b51")][I("6fbb13a1c2311e8a57")].toLowerCase();if(s=a[I("73a612b6fb191d")](I("3aad1ab6e022098b4dc4")),r=I(n[2]),-1(s=e[I("73a612b6fb191d")](r))&&r!==I("7da71ca0ad381e90")&&(s=e[I("73a612b6fb191d")](I("76a715b2ef3e149757"))),0>s&&(s=e[I("73a612b6fb191d")](I("76a715b2ef3e149757"))),0>s&&(s=e[I("73a612b6fb191d")](I("2bfa41fdb3784bca12"))),0>s&&(s=i[I("73a612b6fb191d")](I("7baa19a6f76c1988428554"))),t.Rc=!(0<=s&&sa),!t.Rc))break;if("#"===r[0]){s=m.document.createElement("div");for(var h=n[0].replace(/[A-Za-z]/g,"");4>h.length;)h+="9";if(a=h,h=h.substr(h.length-4),n="",n+=["gsh","gsf"][parseInt(h.substr(0,1),10)%2],n+=["Header","Background","Display","Feedback"][parseInt(h.substr(0,1),10)%4],s[I("79a417a0f0181a8946")]=n,m.document[I("78a712aa")]){m.document[I("78a712aa")][I("7bb806b6ed32388c4a875b")](s),h=m.getComputedStyle(s).getPropertyValue(I("78a704b7e62456904c9b12701b6532a8"));var l=m.getComputedStyle(s).getPropertyValue(I("75b817b0ea2202"));if(m.document[I("78a712aa")][I("68ad1bbcf533388c4a875b")](s),h){if(s=m[I("77a902b0eb1b1e804a8a")],l==="0."+parseInt(a,10)%100||-1!==h.indexOf(parseInt(r[1]+r[2],16))&&-1!==h.indexOf(parseInt(r[3]+r[4],16))){t.Rc=!1;break}if(s&&s(I("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches)for(n="."+n,r=0;rn.updateDelay?n.N():n.o||(n.o=!0,setTimeout((function(){return n.redraw()}),n.updateDelay))},i.Of=function(){null!==n.observed&&Ts(n)},i.autoScale=Ur,i.vb=!1,e&&Object.assign(i,e),i}function Cs(t){var e=t.observed;if(null!==e){var i=t.drawsTemporaryLayers,n=t.drawsGrid&&i,o=e.grid;n&&null!==o&&o.visible&&!isNaN(o.width)&&!isNaN(o.height)&&(yr(e,o=Ot.alloc().assign(t.viewportBounds).ed(e.viewportBounds)),Ot.free(o),Qo(e));var r=t.Ab;r.reset(),1!==t.scale&&r.scale(t.scale),0===t.position.x&&0===t.position.y||r.translate(-t.position.x,-t.position.y),(o=t.ib).scale(t.Mb,t.Mb),o.transform(r.m11,r.m12,r.m21,r.m22,r.dx,r.dy),o.yc(),r=(e=e.Wa.s).length;for(var s=0;sn||r>o)&&(ia(t,!0),t.measure(i>n?n:i,r>o?o:r,0,0));break;case cs:ia(t,!0),t.measure(n,o,0,0);break;case ps:ia(t,!0),t.measure(n,r,0,0);break;case gs:ia(t,!0),t.measure(i,o,0,0)}}}function Rs(t,e){return null!==e&&(Vh(e)&&(e=e.panel),0!=(512&e.l)||(e.type===Ch.Auto||e.type===Ch.Spot)&&e.Pb()!==t)}function Es(t,e,i,n){Us(t,e,t.areaBackground,!0,!0,i,n),t.areaBackground instanceof Ia&&t.areaBackground.type===_a?(e.beginPath(),e.rect(n.x,n.y,n.width,n.height),e.ng(t.areaBackground)):e.fillRect(n.x,n.y,n.width,n.height)}function Vs(t,e,i,n){var o=t.kq(),r=i.x,s=i.y,a=i.width+o,h=i.height+o;Us(t,e,t.Ma,!0,!1,i,n),t.Ma instanceof Ia&&t.Ma.type===_a?(e.beginPath(),e.rect(r-o/2,s-o/2,a,h),e.ng(t.Ma)):e.fillRect(r-o/2,s-o/2,a,h)}function Ys(t,e,i){for(var n=e.O.s,o=n.length,r=-1,s=0;so)&&w("Must specify non-negative integer row for RowColumnDefinition "+e+", not: "+o),t.isRow=!0,t.index=o):void 0!==e.column&&((null==(o=e.column)||1/0===o||isNaN(o)||0>o)&&w("Must specify non-negative integer column for RowColumnDefinition "+e+", not: "+o),t.isRow=!1,t.index=o),o=new X,e)"row"!==i&&"column"!==i&&(o[i]=e[i]);nr(t,o)}else nr(t,e);else w('Unknown initializer "'+e+'" for object being constructed by GraphObject.make: '+t)}function la(t,e){ca.add(t,e)}function ua(t,e,i){void 0===i&&(i=null);var n=t[1];if("function"==typeof i?i(n):"string"==typeof n)return t.splice(1,1),n;if(void 0===e)throw Error("no "+("function"==typeof i?"satisfactory":"string")+" argument for GraphObject builder "+t[0]);return e}us.className="DraggingInfo",ks.className="DraggingNodeInfoPair",Ms.prototype.reset=function(){this.isGridSnapEnabled=!1,this.isGridSnapRealtime=!0,this.gridSnapCellSize=new At(NaN,NaN).freeze(),this.gridSnapCellSpot=te,this.gridSnapOrigin=new pt(NaN,NaN).freeze(),this.groupsSnapMembers=this.dragsTree=this.dragsLink=!1,this.dragsMembers=this.groupsAlwaysMove=!0},Ms.className="DraggingOptions",c(Ss,To),Ss.prototype.reset=function(){To.prototype.reset.call(this),Ns(this)},Ss.className="Palette",c(Ps,To),Ps.prototype.computePixelRatio=function(){return 1},Ps.prototype.redraw=function(){if(this.o&&1<=this.updateDelay){this.o=!1;var t=this.ta,e=this.ib;if(null!==t&&null!==e){if(or(this),null===this.ql){var i=new Fa(null);i.width=t.width,i.height=t.height,this.ql=i}try{this.ta=this.ql,this.ib=this.ta.context,this.ib.Vc(!0),this.ib.setTransform(1,0,0,1,0,0),this.ib.clearRect(0,0,this.ta.width,this.ta.height),Cs(this)}finally{this.ta=t,this.ib=e}}}To.prototype.redraw.call(this)},Ps.prototype.gc=function(){if(null===this.Ka&&w("No div specified"),null===this.ta&&w("No canvas specified"),!(this.ta instanceof ya)&&(Su(this.box),this.Fc)){var t=this.observed;if(null!==t&&!t.animationManager.defaultAnimation.isAnimating&&t.pi){or(this);var e=this.ta;(t=this.ib).Vc(!0),t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.width,e.height),1>this.updateDelay?Cs(this):null!==this.ql&&(t.drawImage(this.ql.Oa,0,0),(e=this.Ab).reset(),1!==this.scale&&e.scale(this.scale),0===this.position.x&&0===this.position.y||e.translate(-this.position.x,-this.position.y),t.scale(this.Mb,this.Mb),t.transform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy),t.yc());for(var i=(e=this.Wa.s).length,n=0;nt&&(t=0),this.ia!==t&&(this.ia=t)}}}),Ps.className="Overview",c(Ls,Ti),Ls.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;if(null===t||!t.allowMove||!t.allowSelect)return!1;var e=t.observed;if(null===e)return!1;var i=t.lastInput;return!(!i.left||t.currentTool!==this&&(!this.isBeyondDragSize()||i.isTouchEvent&&i.timestamp-t.firstInput.timestampe.maxScale||(e.scale=t))},As.prototype.canDecreaseZoom=function(t){void 0===t&&(t=1/this.zoomFactor);var e=this.diagram;return e.autoScale===Xr&&(!((t=e.scale*t)e.maxScale)&&e.allowZoom)},As.prototype.increaseZoom=function(t){void 0===t&&(t=this.zoomFactor);var e=this.diagram;e.autoScale===Xr&&((t=e.scale*t)e.maxScale||(e.scale=t))},As.prototype.canIncreaseZoom=function(t){void 0===t&&(t=this.zoomFactor);var e=this.diagram;return e.autoScale===Xr&&(!((t=e.scale*t)e.maxScale)&&e.allowZoom)},As.prototype.resetZoom=function(t){void 0===t&&(t=this.defaultScale);var e=this.diagram;te.maxScale||(e.scale=t)},As.prototype.canResetZoom=function(t){void 0===t&&(t=this.defaultScale);var e=this.diagram;return!(te.maxScale)&&e.allowZoom},As.prototype.zoomToFit=function(){var t=this.diagram,e=t.animationManager;e.Cc(),t.redraw();var i=t.position,n=t.scale;Hn(e,"Zoom To Fit"),this.isZoomToFitRestoreEnabled&&n===this.Au&&!isNaN(this.Jt)&&t.documentBounds.D(this.yu)?(t.scale=this.Jt,t.position=this.sw,this.Au=NaN,this.yu=qt):(this.Jt=n,this.sw=i.copy(),t.zoomToFit(),this.Au=t.scale,this.yu=t.documentBounds.copy()),Kn(e)},As.prototype.canZoomToFit=function(){return this.diagram.allowZoom},As.prototype.scrollToPart=function(t){void 0===t&&(t=null);var e=this.diagram;if(e.Va(),null===t){try{null!==this.cg&&(this.cg.next()?t=this.cg.value:this.cg=null)}catch(t){this.cg=null}null===t&&(0(t=180*Math.atan2(t.m12,t.m11)/Math.PI)&&(t+=360),t},e.Df=function(){if(0!=(4096&this.l)==!1)return this.Kk;var t=this.Ca;return null!==this.panel?t*this.panel.Df():t},e.qs=function(t,e){return void 0===e&&(e=new pt),e.assign(t),this.oe.Cd(e),e},e.rs=function(t,e,i){return this.Sj(t.x,t.y,e.x,e.y,i)},e.Sj=function(t,e,i,n,o){var r=this.transform,s=1/(r.m11*r.m22-r.m12*r.m21),a=r.m22*s,h=-r.m12*s,l=-r.m21*s,u=r.m11*s,c=s*(r.m21*r.dy-r.m22*r.dx),f=s*(r.m12*r.dx-r.m11*r.dy);return null!==this.areaBackground?(r=this.actualBounds,Xe.Ff(r.left,r.top,r.right,r.bottom,t,e,i,n,o)):(s=t*a+e*l+c,t=t*h+e*u+f,e=i*a+n*l+c,i=i*h+n*u+f,o.h(0,0),n=this.naturalBounds,i=Xe.Ff(0,0,n.width,n.height,s,t,e,i,o),o.transform(r),i)},Ds.prototype.measure=function(t,e,i,n){if(!1!==ea(this)){var o=this.Kg,r=o.right+o.left;o=o.top+o.bottom,t=Math.max(t-r,0),e=Math.max(e-o,0),i=Math.max((i||0)-r,0),n=Math.max((n||0)-o,0),r=this.angle,o=this.desiredSize;var s=this.kq();90===r||270===r?(t=isFinite(o.height)?o.height+s:t,e=isFinite(o.width)?o.width+s:e):(t=isFinite(o.width)?o.width+s:t,e=isFinite(o.height)?o.height+s:e),o=i||0,s=n||0;var a=this instanceof Ch;switch(Ks(this,!0)){case fs:s=o=0,a&&(e=t=1/0);break;case cs:isFinite(t)&&t>i&&(o=t),isFinite(e)&&e>n&&(s=e);break;case ps:isFinite(t)&&t>i&&(o=t),s=0,a&&(e=1/0);break;case gs:isFinite(e)&&e>n&&(s=e),o=0,a&&(t=1/0)}a=this.maxSize;var h=this.minSize;o>a.width&&h.widtha.height&&h.heightt.height||this.Cb>t.width))&&(i=!0)),this.l=i?256|this.l:-257&this.l,this.Ib.w()||w("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ib.toString()),this.Xl(r,this.Ib),oa(this,!1),Ot.free(r)},(e=Ds.prototype).eh=function(){},e.Xl=function(t,e){var i=this.part;null!==i&&null!==i.diagram&&(i.selectionObject!==this&&i.resizeObject!==this&&i.rotateObject!==this||Ru(i,!0),this.N(),Rt(t,e)||(i.oh(),this.Pn(i)))},e.Pn=function(t){null!==this.portId&&(Ru(t,!0),t instanceof Ju&&Qu(t,this))},e.gc=function(t,e){if(!function(t,e,i){if(!(e instanceof va))return!1;if(!t.visible||0===t.opacity||t.Dd()&&!t.isVisible())return null!==t.svg&&null!==t.svg.parentNode&&t.svg.remove(),!0;var n=t.panel,o=t.nk(e);if(t.kk(e,i,o))return null!==t.svg.parentElement?(t.Dd()&&(e.ti=t.svg),!0):(t.Dd()?(null!==e.ti?e.ti.after(t.svg):e.Nj.prepend(t.svg),e.ti=t.svg):n&&Ys(t,n,t.svg),!0);if(t.Dd()&&t.isShadowed){var r=t.shadowOffset;e.Ev(r.x*i.scale*t.scale*i.Mb,r.y*i.scale*t.scale*i.Mb,t.shadowBlur),Aa(e),e.shadowColor=t.shadowColor}t instanceof Pl&&(e.font=t.font),e.yd=null;var s=t.transform;r=t instanceof Ch;var a=t instanceof Ch&&Vh(t);0!=(4096&t.l)==!0&&qs(t);var h=t.Ib;if(e.rb.ha=[1,0,0,1,0,0],e.o=!1,o&&(e.o=!0,r&&a?(Ca(e,1,0,0,1,0,0),t.svg=e.ad):r?(Ca(e,s.m11,s.m12,s.m21,s.m22,s.dx,s.dy),t.svg=e.ad):Ca(e,1,0,0,1,0,0)),o=t.naturalBounds,null!==t.areaBackground){var l=s.copy().Vj();e.rb.ha=[l.m11,l.m12,l.m21,l.m22,l.dx,l.dy],Es(t,e,o,h),e.rb.ha=[1,0,0,1,0,0],e.yd.gd=e.ad,e.yd.prepend(e.ad)}return r||(e.rb.ha=[s.m11,s.m12,s.m21,s.m22,s.dx,s.dy]),null!==t.background&&(r?(a&&(e.rb.ha=[s.m11,s.m12,s.m21,s.m22,s.dx,s.dy]),Vs(t,e,o,h),a&&(e.rb.ha=[1,0,0,1,0,0])):(e.rb.ha=[s.m11,s.m12,s.m21,s.m22,s.dx,s.dy],Vs(t,e,o,h)),e.yd.Ma=e.ad,e.yd.prepend(e.ad)),s=e.yd,o=t.part,a=!1,o&&i.Gf("drawShadows")&&(a=o.isShadowed),e.clipInsteadOfFill&&(a=!1),t.Dd()&&a&&Aa(e),a&&!0===t.shadowVisible?Aa(e):a&&!1===t.shadowVisible&&La(e),o=t.panel,a&&Rs(t,o)&&null===t.shadowVisible&&La(e),e.Il&&(l=i.computePixelRatio(),l="drop-shadow("+e.shadowOffsetX/l+"px "+e.shadowOffsetY/l+"px "+e.shadowBlur/l/2+"px "+e.shadowColor+")",null!==t.background&&s.Ma.setAttributeNS(null,"filter",l),null!==t.areaBackground&&s.gd.setAttributeNS(null,"filter",l)),a&&(null!==t.Ma||null!==t.areaBackground||Rs(t,o))?(Zs(t,!0),null===t.shadowVisible&&La(e)):Zs(t,!1),o=a,t.hh(e,i),r&&e.nh.pop(),e.o&&e.nh.pop(),s=e.Gv.hs,a=r?t.svg:e.yd,l=t.svg,r||null===l||a===l||l.parentNode!==t.panel.svg?(t.svg=a,null!==s&&null===a&&(Ta(e),e.nh.pop()),null===a||(t.$o(e,n,h,a),e.Il&&(i=i.computePixelRatio(),t.Dv(a,"drop-shadow("+e.shadowOffsetX/i+"px "+e.shadowOffsetY/i+"px "+e.shadowBlur/i/2+"px "+e.shadowColor+")")),o&&0!=(512&t.l)==!0&&Aa(e),t.Dd()&&La(e),i=t.Dd()?t.opacity*e.globalAlpha:t.opacity,1!==i&&a.setAttributeNS(null,"opacity",i.toString()),""!==t.filter&&a.setAttributeNS(null,"filter",t.filter),t.Dd()?(e.ti?e.ti.after(a):e.Nj.prepend(a),e.ti=a):null!==n&&Ys(t,n,a),null!==s&&s(t,a)),!0):(t.svg.replaceWith(a),t.svg=a,null!==a&&t.$o(e,n,h,a),Gs(e,l),!0)}(this,t,e)&&this.visible){var i=this.opacity;if(0!==i){var n=1;1!==i&&(n=t.globalAlpha,t.globalAlpha=n*i);var o="";""!==this.filter&&(o=t.filter,t.filter=this.filter);var r=this instanceof Ch&&Vh(this),s=this.Ib;if(r){var a=this.Ib,h=this.dc,l=this.areaBackground,u=this.Ma;null===l&&null===u||t.yc(),null!==l&&(Us(this,t,l,!0,!0,h,a),l instanceof Ia&&l.type===_a?(t.beginPath(),t.rect(a.x,a.y,a.width,a.height),t.ng(l)):t.fillRect(a.x,a.y,a.width,a.height)),null!==u&&(Us(this,t,u,!0,!1,h,a),u instanceof Ia&&u.type===_a?(t.beginPath(),t.rect(a.x,a.y,a.width,a.height),t.ng(u)):t.fillRect(a.x,a.y,a.width,a.height)),this.hh(t,e)}if(!r&&(r||0!==s.width&&0!==s.height&&!isNaN(s.x)&&!isNaN(s.y))){r=this.transform,a=this.panel,0!=(4096&this.l)==!0&&qs(this),h=!1;var c,f=0;if((l=this.part)&&e.Gf("drawShadows")&&(h=l.isShadowed)&&(u=l.shadowOffset,f=Math.max(u.y,u.x)*e.scale*e.Mb),u=this.Dd(),!(c=e.$i||!u)){var d,p=this.naturalBounds,g=(c=this.wh).m11,m=c.m21,y=c.dx,v=c.m12,x=c.m22,b=c.dy,w=d=0;c=d*g+w*m+y;var k=d*v+w*x+b,M=(d=p.width+f)*g+(w=0)*m+y;d=d*v+w*x+b,w=Math.min(c,M);var S=Math.min(k,d),N=Math.max(c+0,M)-w,P=Math.max(k+0,d)-S;c=w,k=S,M=(d=p.width+f)*g+(w=p.height+f)*m+y,d=d*v+w*x+b,w=Math.min(c,M),S=Math.min(k,d),N=Math.max(c+N,M)-w,P=Math.max(k+P,d)-S,c=w,k=S,M=(d=0)*g+(w=p.height+f)*m+y,d=d*v+w*x+b,w=Math.min(c,M),S=Math.min(k,d),N=Math.max(c+N,M)-w,P=Math.max(k+P,d)-S,c=w,k=S,p=(f=e.viewportBounds).x,g=f.y,c=!(c>f.width+p||p>N+c||k>f.height+g||g>P+k)}if(c){if(c=0!=(256&this.l),t.clipInsteadOfFill&&(c=!1),this instanceof Pl&&(t.font=this.font),c){if(k=a.se()?a.naturalBounds:a.actualBounds,N=Math.max(s.x,k.x),P=Math.max(s.y,k.y),f=Math.min(s.right,k.right)-N,p=Math.min(s.bottom,k.bottom)-P,null!==(g=this.tb)&&(N=g.x,P=g.y,f=g.width,p=g.height),N>s.width+s.x||s.x>k.width+k.x)return 1!==i&&(t.globalAlpha=n),void(""!==this.filter&&(t.filter=o));t.save(),t.beginPath(),t.rect(N,P,f,p),t.clip()}if(u){if(!l.isVisible())return 1!==i&&(t.globalAlpha=n),void(""!==this.filter&&(t.filter=o));h&&(k=l.shadowOffset,t.Ev(k.x*e.scale*this.scale*e.Mb,k.y*e.scale*this.scale*e.Mb,l.shadowBlur),Aa(t),t.shadowColor=l.shadowColor)}h&&!0===this.shadowVisible?Aa(t):h&&!1===this.shadowVisible&&La(t),l=this.naturalBounds,null!==this.areaBackground&&(t.yc(),Es(this,t,l,s)),t.transform(r.m11,r.m12,r.m21,r.m22,r.dx,r.dy),h&&Rs(this,a)&&null===this.shadowVisible&&La(t),null!==this.Ma&&(t.yc(),Vs(this,t,l,s)),h&&(null!==this.Ma||null!==this.areaBackground||Rs(this,a))?(Zs(this,!0),null===this.shadowVisible&&La(t)):Zs(this,!1),this.hh(t,e),h&&0!=(512&this.l)==!0&&Aa(t),u&&h&&La(t),c&&(t.restore(),t.Vc(this instanceof Ch)),r.ws()||(e=1/(r.m11*r.m22-r.m12*r.m21),t.transform(r.m22*e,-r.m12*e,-r.m21*e,r.m11*e,e*(r.m21*r.dy-r.m22*r.dx),e*(r.m12*r.dx-r.m11*r.dy)))}}1!==i&&(t.globalAlpha=n),""!==this.filter&&(t.filter=o)}}},e.Dv=function(){},e.$o=function(t,e,i,n){var o=0!=(256&this.l);if(t.clipInsteadOfFill&&(o=!1),o){var r=e.se()?e.naturalBounds:e.actualBounds;e=Math.max(i.x,r.x),o=Math.max(i.y,r.y);var s=Math.min(i.right,r.right)-e;i=Math.min(i.bottom,r.bottom)-o,null!==(r=this.tb)&&(e=r.x,o=r.y,s=r.width,i=r.height);var a=null;null!==(r=n.getAttribute("clip-path"))&&(a=t.svg.getElementById(r.split("#")[1].slice(0,-1))),null===a?(r="CLIP"+at++,a=t.Ud("clipPath",{id:r}),e=t.Ud("rect",{x:e,y:o,width:s,height:i}),this instanceof Ch&&(o=this.transform.copy().Vj(),e.setAttribute("transform","matrix("+o.m11+", "+o.m12+", "+o.m21+", "+o.m22+", "+o.dx+", "+o.dy+")")),a.appendChild(e),t.svg.appendChild(a),n.setAttributeNS(null,"clip-path","url(#"+r+")")):((t=a.firstElementChild).setAttribute("x",e.toString()),t.setAttribute("y",o.toString()),t.setAttribute("width",s.toString()),t.setAttribute("height",i.toString()))}else n.removeAttributeNS(null,"clip-path"),Gs(t,n)},e.hh=function(){},e.lv=function(){this.Uc=!0},e.kk=function(t,e,i){if(this.Uc)return this.lv(),this.Uc=!1;if(null===(e=this.svg))return!1;if(!this.visible)return e.remove(),!1;if("g"!==e.nodeName&&i||"g"===e.nodeName&&!i)return!1;var n=this.transform,o=this instanceof Ch&&Vh(this);if(!(this instanceof Ch&&o))if(this instanceof ou){var r=this.bt;t.rb.ha=[n.m11,n.m12,n.m21,n.m22,n.dx,n.dy],null!==r&&ba(t,r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]),i?e.lastElementChild.setAttributeNS(null,"transform",wa(t)):e.setAttributeNS(null,"transform",wa(t))}else if(!i||this instanceof Ch)e.setAttributeNS(null,"transform","matrix("+n.m11+", "+n.m12+", "+n.m21+", "+n.m22+", "+n.dx+", "+n.dy+")");else if(this instanceof pl){r=e.getElementsByTagName("path");for(var s=0;st?t=0:1t||1=t&&w("GraphObject.scale for "+this+" must be greater than zero, not: "+t),this.Ca=t,this.v(),this.g("scale",e,t))}},angle:{get:function(){return this.Kb},set:function(t){var e=this.Kb;e!==t&&(0>(t%=360)&&(t+=360),e!==t&&(this.Kb=t,sa(this),this.v(),this.g("angle",e,t)))}},desiredSize:{get:function(){return this.jd},set:function(t){var e=t.width,i=t.height,n=this.jd,o=n.width,r=n.height;(o===e||isNaN(o)&&isNaN(e))&&(r===i||isNaN(r)&&isNaN(i))||(this.jd=t=t.J(),this.v(),this instanceof pl&&this.qc(),this.g("desiredSize",n,t),$s(this)&&(null!==(t=this.part)&&(Bs(this,t,"width"),Bs(this,t,"height"))))}},width:{get:function(){return this.jd.width},set:function(t){var e=this.jd.width;e===t||isNaN(e)&&isNaN(t)||(e=this.jd,this.jd=t=new At(t,this.jd.height).freeze(),this.v(),this instanceof pl&&this.qc(),this.g("desiredSize",e,t),$s(this)&&(null!==(t=this.part)&&Bs(this,t,"width")))}},height:{get:function(){return this.jd.height},set:function(t){var e=this.jd.height;e===t||isNaN(e)&&isNaN(t)||(e=this.jd,this.jd=t=new At(this.jd.width,t).freeze(),this.v(),this instanceof pl&&this.qc(),this.g("desiredSize",e,t),$s(this)&&(null!==(t=this.part)&&Bs(this,t,"height")))}},minSize:{get:function(){return null!==this.A?this.A.u:kt},set:function(t){var e=this.minSize;e.D(t)||(t=t.copy(),isNaN(t.width)&&(t.width=0),isNaN(t.height)&&(t.height=0),t.freeze(),Os(this),this.A.u=t,this.v(),this.g("minSize",e,t))}},maxSize:{get:function(){return null!==this.A?this.A.o:Ct},set:function(t){var e=this.maxSize;e.D(t)||(t=t.copy(),isNaN(t.width)&&(t.width=1/0),isNaN(t.height)&&(t.height=1/0),t.freeze(),Os(this),this.A.o=t,this.v(),this.g("maxSize",e,t))}},measuredBounds:{get:function(){return this.uc}},naturalBounds:{get:function(){return this.dc}},margin:{get:function(){return this.Kg},set:function(t){"number"==typeof t&&(t=new Wt(t));var e=this.Kg;e.D(t)||(this.Kg=t=t.J(),this.v(),this.g("margin",e,t))}},transform:{get:function(){return 0!=(2048&this.l)==!0&&qs(this),this.Ab}},oe:{get:function(){return 0!=(4096&this.l)==!0&&qs(this),this.wh}},animationTriggers:{get:function(){return null!==this.A?this.A.hb:null},set:function(t){this.animationTriggers!==t&&(Os(this),this.A.hb=t)}},reshapingBehavior:{get:function(){return null!==this.A?this.A.Pf:fs},set:function(t){this.reshapingBehavior!==t&&(Os(this),this.A.Pf=t)}},alignment:{get:function(){return this.Jb},set:function(t){var e=this.Jb;e.D(t)||(t.Mc()&&!t.Xb()&&w("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+t),this.Jb=t=t.J(),Hs(this),this.g("alignment",e,t))}},column:{get:function(){return this.Ag},set:function(t){t=Math.round(t);var e=this.Ag;e!==t&&(0>t&&M(t,">= 0",Ds,"column"),this.Ag=t,this.v(),this.g("column",e,t),null!==this.svg&&this.svg.remove())}},columnSpan:{get:function(){return null!==this.A?this.A.ob:1},set:function(t){t=Math.round(t);var e=this.columnSpan;e!==t&&(1>t&&M(t,">= 1",Ds,"columnSpan"),Os(this),this.A.ob=t,this.v(),this.g("columnSpan",e,t))}},row:{get:function(){return this.io},set:function(t){t=Math.round(t);var e=this.io;e!==t&&(0>t&&M(t,">= 0",Ds,"row"),this.io=t,this.v(),this.g("row",e,t),null!==this.svg&&this.svg.remove())}},rowSpan:{get:function(){return null!==this.A?this.A.Bi:1},set:function(t){t=Math.round(t);var e=this.rowSpan;e!==t&&(1>t&&M(t,">= 1",Ds,"rowSpan"),Os(this),this.A.Bi=t,this.v(),this.g("rowSpan",e,t))}},spanAllocation:{get:function(){return null!==this.A?this.A.Di:null},set:function(t){var e=this.spanAllocation;e!==t&&(Os(this),this.A.Di=t,this.v(),this.g("spanAllocation",e,t))}},alignmentFocus:{get:function(){return this.sk},set:function(t){var e=this.sk;e.D(t)||(this.sk=t=t.J(),this.v(),this.g("alignmentFocus",e,t))}},portId:{get:function(){return this.Yn},set:function(t){var e=this.Yn;if(e!==t){var i=this.part;null===i||i instanceof Ju||w("Cannot set portID on a Link: "+t),null!==e&&null!==i&&ac(i,this),this.Yn=t,null!==t&&null!==i&&(i.Te=!0,sc(i,this)),this.g("portId",e,t)}}},toSpot:{get:function(){return null!==this.ba?this.ba.yj:Qt},set:function(t){var e=this.toSpot;e.D(t)||(t=t.J(),this.Xc(),this.ba.yj=t,this.g("toSpot",e,t),ra(this))}},toEndSegmentLength:{get:function(){return null!==this.ba?this.ba.wj:10},set:function(t){var e=this.toEndSegmentLength;e!==t&&(0>t&&M(t,">= 0",Ds,"toEndSegmentLength"),this.Xc(),this.ba.wj=t,this.g("toEndSegmentLength",e,t),ra(this))}},toShortLength:{get:function(){return null!==this.ba?this.ba.xj:0},set:function(t){var e=this.toShortLength;e!==t&&(this.Xc(),this.ba.xj=t,this.g("toShortLength",e,t),ra(this))}},toLinkable:{get:function(){return null!==this.ba?this.ba.Tr:null},set:function(t){var e=this.toLinkable;e!==t&&(this.Xc(),this.ba.Tr=t,this.g("toLinkable",e,t))}},toMaxLinks:{get:function(){return null!==this.ba?this.ba.Ur:1/0},set:function(t){var e=this.toMaxLinks;e!==t&&(0>t&&M(t,">= 0",Ds,"toMaxLinks"),this.Xc(),this.ba.Ur=t,this.g("toMaxLinks",e,t))}},fromSpot:{get:function(){return null!==this.ba?this.ba.Xi:Qt},set:function(t){var e=this.fromSpot;e.D(t)||(t=t.J(),this.Xc(),this.ba.Xi=t,this.g("fromSpot",e,t),ra(this))}},fromEndSegmentLength:{get:function(){return null!==this.ba?this.ba.Vi:10},set:function(t){var e=this.fromEndSegmentLength;e!==t&&(0>t&&M(t,">= 0",Ds,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=t,this.g("fromEndSegmentLength",e,t),ra(this))}},fromShortLength:{get:function(){return null!==this.ba?this.ba.Wi:0},set:function(t){var e=this.fromShortLength;e!==t&&(this.Xc(),this.ba.Wi=t,this.g("fromShortLength",e,t),ra(this))}},fromLinkable:{get:function(){return null!==this.ba?this.ba.hq:null},set:function(t){var e=this.fromLinkable;e!==t&&(this.Xc(),this.ba.hq=t,this.g("fromLinkable",e,t))}},fromMaxLinks:{get:function(){return null!==this.ba?this.ba.iq:1/0},set:function(t){var e=this.fromMaxLinks;e!==t&&(0>t&&M(t,">= 0",Ds,"fromMaxLinks"),this.Xc(),this.ba.iq=t,this.g("fromMaxLinks",e,t))}},cursor:{get:function(){return null!==this.A?this.A.j:""},set:function(t){var e=this.cursor;e!==t&&(Os(this),this.A.j=t,this.g("cursor",e,t))}},click:{get:function(){return null!==this.A?this.A.zh:null},set:function(t){var e=this.click;e!==t&&(Os(this),this.A.zh=t,this.g("click",e,t))}},doubleClick:{get:function(){return null!==this.A?this.A.Fh:null},set:function(t){var e=this.doubleClick;e!==t&&(Os(this),this.A.Fh=t,this.g("doubleClick",e,t))}},contextClick:{get:function(){return null!==this.A?this.A.Bh:null},set:function(t){var e=this.contextClick;e!==t&&(Os(this),this.A.Bh=t,this.g("contextClick",e,t))}},mouseEnter:{get:function(){return null!==this.A?this.A.Mh:null},set:function(t){var e=this.mouseEnter;e!==t&&(Os(this),this.A.Mh=t,this.g("mouseEnter",e,t))}},mouseLeave:{get:function(){return null!==this.A?this.A.Ph:null},set:function(t){var e=this.mouseLeave;e!==t&&(Os(this),this.A.Ph=t,this.g("mouseLeave",e,t))}},mouseOver:{get:function(){return null!==this.A?this.A.Qh:null},set:function(t){var e=this.mouseOver;e!==t&&(Os(this),this.A.Qh=t,this.g("mouseOver",e,t))}},mouseHover:{get:function(){return null!==this.A?this.A.Oh:null},set:function(t){var e=this.mouseHover;e!==t&&(Os(this),this.A.Oh=t,this.g("mouseHover",e,t))}},mouseHold:{get:function(){return null!==this.A?this.A.Nh:null},set:function(t){var e=this.mouseHold;e!==t&&(Os(this),this.A.Nh=t,this.g("mouseHold",e,t))}},mouseDragEnter:{get:function(){return null!==this.A?this.A.Of:null},set:function(t){var e=this.mouseDragEnter;e!==t&&(Os(this),this.A.Of=t,this.g("mouseDragEnter",e,t))}},mouseDragLeave:{get:function(){return null!==this.A?this.A.Xd:null},set:function(t){var e=this.mouseDragLeave;e!==t&&(Os(this),this.A.Xd=t,this.g("mouseDragLeave",e,t))}},mouseDrop:{get:function(){return null!==this.A?this.A.Lh:null},set:function(t){var e=this.mouseDrop;e!==t&&(Os(this),this.A.Lh=t,this.g("mouseDrop",e,t))}},actionDown:{get:function(){return null!==this.A?this.A.V:null},set:function(t){var e=this.actionDown;e!==t&&(Os(this),this.A.V=t,this.g("actionDown",e,t))}},actionMove:{get:function(){return null!==this.A?this.A.ia:null},set:function(t){var e=this.actionMove;e!==t&&(Os(this),this.A.ia=t,this.g("actionMove",e,t))}},actionUp:{get:function(){return null!==this.A?this.A.Ha:null},set:function(t){var e=this.actionUp;e!==t&&(Os(this),this.A.Ha=t,this.g("actionUp",e,t))}},actionCancel:{get:function(){return null!==this.A?this.A.F:null},set:function(t){var e=this.actionCancel;e!==t&&(Os(this),this.A.F=t,this.g("actionCancel",e,t))}},toolTip:{get:function(){return null!==this.A?this.A.$h:null},set:function(t){var e=this.toolTip;e!==t&&(Os(this),this.A.$h=t,this.g("toolTip",e,t))}},contextMenu:{get:function(){return null!==this.A?this.A.Ch:null},set:function(t){var e=this.contextMenu;e!==t&&(Os(this),this.A.Ch=t,this.g("contextMenu",e,t))}}}),Ds.prototype.trigger=Ds.prototype.Jv,Ds.prototype.findBindingPanel=Ds.prototype.ih,Ds.prototype.findTemplateBinder=Ds.prototype.pz,Ds.prototype.setProperties=Ds.prototype.nm,Ds.prototype.apply=Ds.prototype.apply,Ds.prototype.attach=Ds.prototype.Du,Ds.prototype.set=Ds.prototype.set,Ds.prototype.isEnabledObject=Ds.prototype.If,Ds.prototype.isVisibleObject=Ds.prototype.Ed,Ds.prototype.isContainedBy=Ds.prototype.rg,Ds.prototype.getNearestIntersectionPoint=Ds.prototype.rs,Ds.prototype.getLocalPoint=Ds.prototype.qs,Ds.prototype.getDocumentScale=Ds.prototype.Df,Ds.prototype.getDocumentAngle=Ds.prototype.li,Ds.prototype.getDocumentBounds=Ds.prototype.mi,Ds.prototype.getDocumentPoint=Ds.prototype.ga,Ds.prototype.intersectsRect=Ds.prototype.Yc,Ds.prototype.containedInRect=Ds.prototype.fh,Ds.prototype.containsRect=Ds.prototype.Re,Ds.prototype.containsPoint=Ds.prototype.ca,Ds.prototype.raiseChanged=Ds.prototype.g,Ds.prototype.raiseChangedEvent=Ds.prototype.cb,Ds.prototype.addCopyProperty=Ds.prototype.Vw;var ca=null;function fa(){this.nc=!1,this.xa="",this.zp=-1,this.nb=this.wm=this.te=null,this.j="",this.hb=this.Di=this.Hb=this.Ch=this.$h=this.F=this.Ha=this.ia=this.V=this.Lh=this.Xd=this.Of=this.Nh=this.Oh=this.Qh=this.Ph=this.Mh=this.Bh=this.Fh=this.zh=null,this.u=kt,this.o=Ct,this.hg=ms,this.ob=this.Bi=1,this.Pf=fs,this.Pc=this.Ci=this.gd=null,this.Oc="category"}function da(){this.u=-1/0,this.o=0,this.F=it,this.rr=Wc,this.j=this.V="None"}function pa(){this.yj=this.Xi=Se,this.xj=this.Wi=this.wj=this.Vi=NaN,this.Tr=this.hq=null,this.Ur=this.iq=1/0}function ga(){this.ha=[1,0,0,1,0,0]}function ma(t){this.type=t,this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0,this.gx=[],this.pattern=null}function ya(t,e,i){this.ownerDocument=t=void 0===e?m.document:e,this.cA="http://www.w3.org/2000/svg",void 0!==t&&(this.Oa=this.Ud("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.style.display="block",this.style.letterSpacing="normal",this.style.wordSpacing="normal",this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink")),this.hs=null,this.context=new va(this,i)}function va(t,e){this.Gv=t,this.svg=t.Oa,this.stack=[],this.nh=[],this.fillStyle="#000000",this.font="10px sans-serif",this.globalAlpha=1,this.lineCap="butt",this.lineDashOffset=0,this.lineJoin="miter",this.lineWidth=1,this.miterLimit=10,this.shadowBlur=0,this.shadowColor="rgba(0, 0, 0, 0)",this.shadowOffsetY=this.shadowOffsetX=0,this.Il=!1,this.strokeStyle="#000000",this.textAlign="start",this.clipInsteadOfFill=!1,this.Vg=this.Br=this.Ar=0,this.yd=this.ad=null,this.path=[],this.Yl={},this.Ct=!1,this.Yg=null,this.uj=0,this.rb=new ga,this.j=Ta(this),this.Nj=Ta(this,"gojs-diagram"),this.Hl=this.ti=null;var i=at++,n=this.Ud("clipPath",{id:"mainClip"+i});n.appendChild(this.Ud("rect",{x:0,y:0,width:t.width,height:t.height})),this.ww=n,this.svg.appendChild(this.j),this.j.appendChild(this.Nj),this.svg.appendChild(n),this.j.setAttributeNS(null,"clip-path","url(#mainClip"+i+")"),this.eA={},this.isTemporary=!!e,this.filter="",this.bk=null}function xa(t,e,i,n,o,r,s){void 0===t.Nj?Ca(t,e,i,n,o,r,s):t.Nj.setAttribute("transform","matrix("+e+", "+i+", "+n+", "+o+", "+r+", "+s+")")}function ba(t,e,i,n,o,r,s,a,h){n=a/n,o=h/o,0===r&&0===s||t.rb.translate(r,s),1===n&&1===o||t.rb.scale(n,o),0===e&&0===i||t.rb.translate(-e,-i)}function wa(t){return"matrix("+(t=t.rb.ha)[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function ka(t,e,i,n){"fill"===e?Ma(t,i):"stroke"===e&&Na(t,i),null!==n&&(t=n.ha,i.transform="matrix("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")")}function Ma(t,e){t.fillStyle instanceof ma?e.fill=Pa(t,t.fillStyle,!0):/^rgba\(/.test(t.fillStyle)?(t=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(t.fillStyle),e.fill="rgb("+t[1]+","+t[2]+","+t[3]+")",e["fill-opacity"]=t[4]):e.fill=t.fillStyle}function Sa(t,e,i){i=i?"fill":"stroke",t.fillStyle instanceof ma?e.setAttributeNS(null,"fill",Pa(t,t.fillStyle,!0)):/^rgba\(/.test(t.fillStyle)?(t=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(t.fillStyle),e.setAttributeNS(null,i,"rgb("+t[1]+","+t[2]+","+t[3]+")"),e.setAttributeNS(null,i+"-opacity",t[4])):e.setAttributeNS(null,i,t.fillStyle)}function Na(t,e){if(t.strokeStyle instanceof ma)e.stroke=Pa(t,t.strokeStyle,!1);else if(/^rgba\(/.test(t.strokeStyle)){var i=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(t.strokeStyle);e.stroke="rgb("+i[1]+","+i[2]+","+i[3]+")",e["stroke-opacity"]=i[4]}else e.stroke=t.strokeStyle;e["stroke-width"]=t.lineWidth,e["stroke-linecap"]=t.lineCap,e["stroke-linejoin"]=t.lineJoin,e["stroke-miterlimit"]=t.miterLimit,t.Ct&&(e["stroke-dasharray"]=t.Yg.toString(),e["stroke-dashoffset"]=t.uj)}function Pa(t,e,i){var n="";if(null!==(n=null!==t.Hl?t.Hl.getAttribute(i?"fill":"stroke"):null)&&-1!==n.indexOf("GRAD")?(n=n.split("#")[1].slice(0,-1),null!==(i=t.svg.getElementById(n))&&i.remove()):n="GRAD"+at++,"linear"===e.type)i=t.Ud("linearGradient",{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,id:n,gradientUnits:"userSpaceOnUse"});else{if("radial"!==e.type)throw Error("invalid gradient");i=t.Ud("radialGradient",{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,r1:e.r1,r2:e.r2,id:n})}var o=e.gx;e=o.length;for(var r=[],s=0;se.offset?1:-1})),o=0;ot&&(t+=360),0!==t){if(this.translate(e,i),90===t){t=0;var n=1}else 180===t?(t=-1,n=0):270===t?(t=0,n=-1):(n=t*Math.PI/180,t=Math.cos(n),n=Math.sin(n));var o=this.ha[1]*t+this.ha[3]*n,r=this.ha[0]*-n+this.ha[2]*t,s=this.ha[1]*-n+this.ha[3]*t;this.ha[0]=this.ha[0]*t+this.ha[2]*n,this.ha[1]=o,this.ha[2]=r,this.ha[3]=s,this.translate(-e,-i)}},ga.className="STransform",ma.prototype.addColorStop=function(t,e){this.gx.push({offset:t,color:e})},ma.className="SGradient",ya.prototype.resize=function(t,e,i,n){return(this.width!==t||this.height!==e)&&(this.width=t,this.height=e,this.style.width=i+"px",this.style.height=n+"px",this.Oa.setAttributeNS(null,"width",i+"px"),this.Oa.setAttributeNS(null,"height",n+"px"),this.Oa.setAttributeNS(null,"viewBox","0 0 "+i+" "+n),this.context.ww.firstElementChild.setAttributeNS(null,"width",i+"px"),this.context.ww.firstElementChild.setAttributeNS(null,"height",n+"px"),!0)},ya.prototype.Ud=function(t,e,i){if(t=this.ownerDocument.createElementNS(this.cA,t),N(e))for(var n in e)t.setAttributeNS("href"===n?"http://www.w3.org/1999/xlink":"",n,e[n]);return void 0!==i&&(t.textContent=i),t},ya.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},ya.prototype.focus=function(){this.Oa.focus()},ya.prototype.mx=function(){this.ownerDocument=null},f.Object.defineProperties(ya.prototype,{width:{get:function(){return this.Oa.width.baseVal.value},set:function(t){this.Oa.setAttribute("width",t+"px")}},height:{get:function(){return this.Oa.height.baseVal.value},set:function(t){this.Oa.setAttribute("height",t+"px")}},style:{get:function(){return this.Oa.style}}}),ya.className="SVGSurface",(e=va.prototype).arc=function(t,e,i,n,o,r,s,a){var h=2*Math.PI,l=h-1e-6,u=i*Math.cos(n),c=i*Math.sin(n),f=t+u,d=e+c,p=r?0:1;n=r?n-o:o-n,(1e-6n&&(n=n%h+h),n>l?(this.path.push(["A",i,i,0,1,p,t-u,e-c]),this.path.push(["A",i,i,0,1,p,f,d])):1e-6=Math.PI),p,t+i*Math.cos(o),e+i*Math.sin(o)])},e.beginPath=function(){this.path=[],this.Yl={stroke:"none",fill:"none"}},e.Se=function(t){this.addPath(this.path,this.rb,t||0)},e.bezierCurveTo=function(t,e,i,n,o,r){this.path.push(["C",t,e,i,n,o,r])},e.clearRect=function(){},e.clip=function(){this.Yl.clipPath=!0},e.closePath=function(){this.path.push(["z"])},e.createLinearGradient=function(t,e,i,n){var o=new ma("linear");return o.x1=t,o.y1=e,o.x2=i,o.y2=n,o},e.createPattern=function(t){var e="";t instanceof HTMLCanvasElement&&(e=t.toDataURL()),t instanceof HTMLImageElement&&(e=t.getAttribute("src"));var i=this.eA;if(i[e])return"url(#"+i[e]+")";var n="PATTERN"+at++,o={x:0,y:0,width:t.width,height:t.height,href:e};return(t=this.Ud("pattern",{width:t.width,height:t.height,id:n,patternUnits:"userSpaceOnUse"})).appendChild(this.Ud(rs,o)),this.svg.appendChild(t),i[e]=n,"url(#"+n+")"},e.createRadialGradient=function(t,e,i,n,o,r){var s=new ma("radial");return s.x1=t,s.y1=e,s.r1=i,s.x2=n,s.y2=o,s.r2=r,s},e.drawImage=function(t,e,i,n,o,r,s,a,h){var l="";t instanceof HTMLCanvasElement&&(l=t.toDataURL()),t instanceof HTMLImageElement&&(l=t.getAttribute("src"));var u=t instanceof HTMLImageElement?t.naturalWidth:t.width;t=t instanceof HTMLImageElement?t.naturalHeight:t.height,void 0===n&&(r=e,s=i,a=n=u,h=o=t),ba(this,e,i,n=n||0,o=o||0,r||0,s||0,a=a||0,h=h||0),r={x:0,y:0,width:u||n,height:t||o,href:l},Xe.$(n,a)&&Xe.$(o,h)?-1===l.toLowerCase().indexOf(".svg")&&-1===l.toLowerCase().indexOf("data:image/svg")&&(r.preserveAspectRatio="xMidYMid slice"):r.preserveAspectRatio="none",0===e&&0===i&&n===u&&o===t||(n+=e,o+=i,r["clip-path"]="path('M "+e+","+i+" L "+n+" "+i+" L "+n+" "+o+" L "+e+" "+o+" z')"),ka(this,rs,r,this.rb),this.addElement(rs,r)},e.fill=function(t){t&&(this.Yl["fill-rule"]="evenodd"),Ma(this,this.Yl)},e.ng=function(t,e){this.clipInsteadOfFill?this.clip():this.fill(e)},e.fillRect=function(t,e,i,n){ka(this,"fill",t={x:(t=[t,e,i,n])[0],y:t[1],width:t[2],height:t[3]},this.rb),this.addElement("rect",t)},e.ox=function(t,e,i,n){ka(this,"fill",t={x:t,y:e,width:i,height:n},this.rb),Ma(this,t),this.svg.prepend(this.Ud("rect",t))},e.fillText=function(t,e,i){t=[t,e,i],"left"===(e=this.textAlign)?e="start":"right"===e?e="end":"center"===e&&(e="middle"),ka(this,"fill",e={x:t[1],y:t[2],style:"font: "+this.font,"text-anchor":e},this.rb),this.addElement("text",e,t[0])},e.lineTo=function(t,e){this.path.push(["L",t,e])},e.moveTo=function(t,e){this.path.push(["M",t,e])},e.quadraticCurveTo=function(t,e,i,n){this.path.push(["Q",t,e,i,n])},e.rect=function(t,e,i,n){this.path.push(["M",t,e],["L",t+i,e],["L",t+i,e+n],["L",t,e+n],["z"])},e.restore=function(){this.rb=this.stack.pop(),this.path=this.stack.pop();var t=this.stack.pop();this.fillStyle=t.fillStyle,this.font=t.font,this.globalAlpha=t.globalAlpha,this.lineCap=t.lineCap,this.lineDashOffset=t.lineDashOffset,this.lineJoin=t.lineJoin,this.lineWidth=t.lineWidth,this.miterLimit=t.miterLimit,this.shadowBlur=t.shadowBlur,this.shadowColor=t.shadowColor,this.shadowOffsetX=t.shadowOffsetX,this.shadowOffsetY=t.shadowOffsetY,this.strokeStyle=t.strokeStyle,this.textAlign=t.textAlign,this.bk=t.bk},e.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,lineDashOffset:this.lineDashOffset,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign,bk:this.bk});for(var t=[],e=0;ei?(this.scale(i/t,1),this.translate((t-i)/2,0)):i>t&&(this.scale(1,t/i),this.translate(0,(i-t)/2)),this.Hm?this.clip():this.fill(e),t>i?(this.translate(-(t-i)/2,0),this.scale(1/(i/t),1)):i>t&&(this.translate(0,-(i-t)/2),this.scale(1,1/(t/i)))}else this.Hm?this.clip():this.fill(e)},e.jk=function(){this.Hm||this.stroke()},e.Ev=function(t,e,i){this.Ar=t,this.Br=e,this.Vg=i},e.js=function(t,e){var i=this.Z;void 0!==i.setLineDash&&(i.setLineDash(t),i.lineDashOffset=e)},e.fs=function(){var t=this.Z;void 0!==t.setLineDash&&(t.setLineDash(Oa),t.lineDashOffset=0)},e.Vc=function(t){t&&(this.dt=""),this.ct=this.et=""},e.Hs=function(){},f.Object.defineProperties(Da.prototype,{fillStyle:{get:function(){return this.Z.fillStyle},set:function(t){this.ct!==t&&(this.ct=this.Z.fillStyle=t)}},font:{get:function(){return this.Z.font},set:function(t){this.dt!==t&&(this.dt=this.Z.font=t)}},globalAlpha:{get:function(){return this.Z.globalAlpha},set:function(t){this.Z.globalAlpha=t}},lineCap:{get:function(){return this.Z.lineCap},set:function(t){this.Z.lineCap=t}},lineDashOffset:{get:function(){return this.Z.lineDashOffset},set:function(t){this.Z.lineDashOffset=t}},lineJoin:{get:function(){return this.Z.lineJoin},set:function(t){this.Z.lineJoin=t}},lineWidth:{get:function(){return this.Z.lineWidth},set:function(t){this.Z.lineWidth=t}},miterLimit:{get:function(){return this.Z.miterLimit},set:function(t){this.Z.miterLimit=t}},shadowBlur:{get:function(){return this.Z.shadowBlur},set:function(t){this.Z.shadowBlur=t}},shadowColor:{get:function(){return this.Z.shadowColor},set:function(t){this.Z.shadowColor=t}},shadowOffsetX:{get:function(){return this.Z.shadowOffsetX},set:function(t){this.Z.shadowOffsetX=t}},shadowOffsetY:{get:function(){return this.Z.shadowOffsetY},set:function(t){this.Z.shadowOffsetY=t}},strokeStyle:{get:function(){return this.Z.strokeStyle},set:function(t){this.et!==t&&(this.et=this.Z.strokeStyle=t)}},textAlign:{get:function(){return this.Z.textAlign},set:function(t){this.Z.textAlign=t}},imageSmoothingEnabled:{get:function(){return this.Z.imageSmoothingEnabled},set:function(t){this.Z.imageSmoothingEnabled=t}},filter:{get:function(){return this.Z.filter},set:function(t){this.Z.filter=""===t?"none":t}},clipInsteadOfFill:{get:function(){return this.Hm},set:function(t){this.Hm=t}}});var Oa=Object.freeze([]);function Ba(){this.F=this.o=this.u=this.j=0}function Ia(t,e){uh||(Ja(),uh=!0),Q(this),this._isFrozen=!1,void 0===t?(this.na=Za,this.xk="black"):"string"==typeof t?(this.na=Za,this.xk=t):(this.na=t,this.xk="black"),(t=this.na)===$a?(this.Qd=ee,this.Lk=ae):this.Lk=this.Qd=t===_a?oe:Qt,this.Gr=0,this.Xp=NaN,this.xe=this.cr=this.we=null,this.ft=this.yk=0,e&&Object.assign(this,e)}function za(t,e,i){return e=void 0===e||"number"!=typeof e?.2:e,i=void 0===i?th:i,Ga(t),Ya(e,i)}function Ra(t,e,i){return e=void 0===e||"number"!=typeof e?.2:e,i=void 0===i?th:i,Ga(t),Ya(-e,i)}function Ea(t,e,i){Ga(t),t=sh.j;var n=sh.u,o=sh.o,r=sh.F;return Ga(e),void 0===i&&(i=.5),"rgba("+Math.round((sh.j-t)*i+t)+", "+Math.round((sh.u-n)*i+n)+", "+Math.round((sh.o-o)*i+o)+", "+Math.round((sh.F-r)*i+r)+")"}function Va(t){return!!t&&(t instanceof Ia?t.Gx():(Ga(t),128>(299*sh.j+587*sh.u+114*sh.o)/1e3))}function Ya(t,e){switch(e){case th:e=100*Ua(sh.j);var i=100*Ua(sh.u),n=100*Ua(sh.o);return hh.j=.4124564*e+.3575761*i+.1804375*n,hh.u=.2126729*e+.7151522*i+.072175*n,hh.o=.0193339*e+.119192*i+.9503041*n,hh.F=sh.F,e=Ha(hh.j/oh[0]),i=Ha(hh.u/oh[1]),n=Ha(hh.o/oh[2]),lh.j=116*i-16,lh.u=500*(e-i),lh.o=200*(i-n),lh.F=hh.F,lh.j=Math.min(100,Math.max(0,lh.j+100*t)),e=(t=(lh.j+16)/116)-lh.o/200,hh.j=oh[0]*Ka(lh.u/500+t),hh.u=oh[1]*(lh.j>nh*ih?Math.pow(t,3):lh.j/nh),hh.o=oh[2]*Ka(e),hh.F=lh.F,t=-.969266*hh.j+1.8760108*hh.u+.041556*hh.o,e=.0556434*hh.j+-.2040259*hh.u+1.0572252*hh.o,sh.j=255*qa((3.2404542*hh.j+-1.5371385*hh.u+-.4985314*hh.o)/100),sh.u=255*qa(t/100),sh.o=255*qa(e/100),sh.F=hh.F,sh.j=Math.round(sh.j),255sh.j&&(sh.j=0),sh.u=Math.round(sh.u),255sh.u&&(sh.u=0),sh.o=Math.round(sh.o),255sh.o&&(sh.o=0),"rgba("+sh.j+", "+sh.u+", "+sh.o+", "+sh.F+")";case eh:return Xa(),ah.o=Math.min(100,Math.max(0,ah.o+100*t)),"hsla("+ah.j+", "+ah.u+"%, "+ah.o+"%, "+ah.F+")";default:w("Unknown color space: "+e)}}function Ga(t){uh||(Ja(),uh=!0);var e=rh;if(null!==e){e.clearRect(0,0,1,1),e.fillStyle="#000000";var i=e.fillStyle;e.fillStyle=t,e.fillStyle!==i?(e.fillRect(0,0,1,1),t=e.getImageData(0,0,1,1).data,sh.j=t[0],sh.u=t[1],sh.o=t[2],sh.F=t[3]/255):(e.fillStyle="#FFFFFF",e.fillStyle=t,sh.j=0,sh.u=0,sh.o=0,sh.F=1)}}function Xa(){var t=sh.j/255,e=sh.u/255,i=sh.o/255,n=Math.max(t,e,i),o=Math.min(t,e,i),r=n-o;if(o=(n+o)/2,0===r)var s=t=0;else{switch(n){case t:s=(e-i)/r%6;break;case e:s=(i-t)/r+2;break;case i:s=(t-e)/r+4}0>(s*=60)&&(s+=360),t=r/(1-Math.abs(2*o-1))}ah.j=Math.round(s),ah.u=Math.round(100*t),ah.o=Math.round(100*o),ah.F=sh.F}function Ua(t){return.04045>=(t/=255)?t/12.92:Math.pow((t+.055)/1.055,2.4)}function qa(t){return.0031308>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055}function Ha(t){return t>ih?Math.pow(t,1/3):(nh*t+16)/116}function Ka(t){var e=t*t*t;return e>ih?e:(116*t-16)/nh}function Wa(t,e){"string"!=typeof t&&(t instanceof Ia||w("Value for "+e+" must be a color string or a Brush, not "+t))}function Ja(){rh=Vr?new Fa(null,void 0,{willReadFrequently:!0}).context:null}Da.className="CanvasSurfaceContext",Ba.className="ColorNumbers",Ia.prototype.copy=function(){var t=new Ia;return t.na=this.na,t.xk=this.xk,t.Qd=this.Qd.J(),t.Lk=this.Lk.J(),t.Gr=this.Gr,t.Xp=this.Xp,null!==this.we&&(t.we=this.we.copy()),t.cr=this.cr,t},(e=Ia.prototype).freeze=function(){return this._isFrozen=!0,null!==this.we&&this.we.freeze(),this},e.ka=function(){return Object.isFrozen(this)&&w("cannot thaw constant: "+this),this._isFrozen=!1,null!==this.we&&this.we.ka(),this},e.qb=function(t){t.classType===Ia&&(this.type=t)},e.toString=function(){var t="Brush(";if(this.type===Za)t+=this.color;else if(t=this.type===$a?t+"Linear ":this.type===_a?t+"Radial ":this.type===Qa?t+"Pattern ":t+"(unknown) ",t+=this.start+" "+this.end,null!==this.colorStops)for(var e=this.colorStops.iterator;e.next();)t+=" "+e.key+":"+e.value;return t+")"},e.addColorStop=function(t,e){return this._isFrozen&&k(this),("number"!=typeof t||!isFinite(t)||1t)&&M(t,"0 <= loc <= 1",Ia,"addColorStop:loc"),null===this.we&&(this.we=new dt),this.we.add(t,e),this.na===Za&&(this.type=$a),this.xe=null,this},e.Vz=function(t,e){if(this._isFrozen&&k(this),t=void 0===t||"number"!=typeof t?.2:t,e=void 0===e?th:e,this.type===Za)Ga(this.color),this.color=Ya(t,e);else if((this.type===$a||this.type===_a)&&null!==this.colorStops)for(var i=this.colorStops.iterator;i.next();)Ga(i.value),this.addColorStop(i.key,Ya(t,e));return this},e.Wy=function(t,e){if(this._isFrozen&&k(this),t=void 0===t||"number"!=typeof t?.2:t,e=void 0===e?th:e,this.type===Za)Ga(this.color),this.color=Ya(-t,e);else if((this.type===$a||this.type===_a)&&null!==this.colorStops)for(var i=this.colorStops.iterator;i.next();)Ga(i.value),this.addColorStop(i.key,Ya(-t,e));return this},e.Gx=function(){if(this.type===Za)return Va(this.color);if((this.type===$a||this.type===_a)&&null!==this.colorStops){var t=this.colorStops;if(this.type===_a)return Va(t.first().value);if(null!==t.get(.5))return Va(t.get(.5));if(2===t.count)return Va(Ea((t=t.Fa())[0].value,t[1].value));for(var e=t.iterator,i=-1,n=-1,o=1,r=1;e.next();){var s=e.key,a=Math.abs(.5-e.key);o>r&&a=o&&an&&(r=i,i=n,n=r,r=o),o=n-i,Va(Ea(t.get(i),t.get(n),1-r/o))}return!1},f.Object.defineProperties(Ia.prototype,{type:{get:function(){return this.na},set:function(t){this._isFrozen&&k(this,t),this.na=t,this.start.Mc()&&(t===$a?this.start=ee:t===_a&&(this.start=oe)),this.end.Mc()&&(t===$a?this.end=ae:t===_a&&(this.end=oe)),this.xe=null}},color:{get:function(){return this.xk},set:function(t){this._isFrozen&&k(this,t),this.xk=t,this.xe=null}},start:{get:function(){return this.Qd},set:function(t){this._isFrozen&&k(this,t),this.Qd=t.J(),this.xe=null}},end:{get:function(){return this.Lk},set:function(t){this._isFrozen&&k(this,t),this.Lk=t.J(),this.xe=null}},startRadius:{get:function(){return this.Gr},set:function(t){this._isFrozen&&k(this,t),0>t&&M(t,">= zero",Ia,"startRadius"),this.Gr=t,this.xe=null}},endRadius:{get:function(){return this.Xp},set:function(t){this._isFrozen&&k(this,t),0>t&&M(t,">= zero",Ia,"endRadius"),this.Xp=t,this.xe=null}},colorStops:{get:function(){return this.we},set:function(t){this._isFrozen&&k(this,t),this.we=t,this.xe=null}},pattern:{get:function(){return this.cr},set:function(t){this._isFrozen&&k(this,t),this.cr=t,this.xe=null}}}),Ia.prototype.isDark=Ia.prototype.Gx,Ia.prototype.darkenBy=Ia.prototype.Wy,Ia.prototype.lightenBy=Ia.prototype.Vz,Ia.prototype.addColorStop=Ia.prototype.addColorStop;var Za,$a,_a,Qa,th,eh,ih=216/24389,nh=24389/27,oh=[95.047,100,108.883],rh=null,sh=new Ba,ah=new Ba,hh=new Ba,lh=new Ba,uh=!1;function ch(){this.xa="Base"}function fh(){this.xa="Base"}function dh(){this.xa="Base"}function ph(){this.xa="Base"}function gh(){this.xa="Base"}function mh(t,e,i){var n=null;if(t instanceof Ch&&""!==t.$e&&((n=t.fb(t.$e))===t&&(n=null)),null!==n)for(i&&t.arrange(0,0,e.width,e.height),e.assign(n.actualBounds),n=n.panel;n!==t;)n.transform.pp(e),n=n.panel}function yh(){this.xa="Base"}function vh(){this.xa="Base",this.name="Table"}function xh(){this.xa="Base"}function bh(){this.xa="Base"}function wh(){this.xa="Base"}function kh(){this.xa="Base"}function Mh(t,e,i,n){if(0>e)return t%e===i;if(t%e!==i)return!1;e=n.length;for(var o=0;os.height)continue}else if(l.position>s.width)continue;var u=l.separatorStrokeWidth;isNaN(u)&&(u=i?t.defaultRowSeparatorStrokeWidth:t.defaultColumnSeparatorStrokeWidth);var c=l.separatorStroke;if(null===c&&(c=i?t.defaultRowSeparatorStroke:t.defaultColumnSeparatorStroke),0!==u&&null!==c){Us(t,e,c,!1,!1,s,r),c=!1;var f=l.separatorDashArray;null===f&&(f=i?t.defaultRowSeparatorDashArray:t.defaultColumnSeparatorDashArray),null!==f&&(c=!0,e.js(f,0)),e.beginPath(),f=l.position+u,i?f>s.height&&(u-=f-s.height):f>s.width&&(u-=f-s.width),l=l.position+u/2,e.lineWidth=u,u=t.yb,i?(l+=u.top,f=s.width-u.right,e.moveTo(u.left,l),e.lineTo(f,l)):(l+=u.left,f=s.height-u.bottom,e.moveTo(l,u.top),e.lineTo(l,f)),e.stroke(),e.Se(),c&&e.fs()}}}}function Ah(t,e,i,n,o){for(var r=n.length,s=t.actualBounds,a=t.naturalBounds,h=jh(t,!0),l=jh(t,!1),u=0;uf)){var d=c.Wc(),p=c.separatorStrokeWidth;isNaN(p)&&(p=i?t.defaultRowSeparatorStrokeWidth:t.defaultColumnSeparatorStrokeWidth);var g=c.separatorStroke;null===g&&(g=i?t.defaultRowSeparatorStroke:t.defaultColumnSeparatorStroke),null!==g&&c.index!==(i?h:l)||(p=0),d-=p,(p=c.position+p)+(d+=c.actual)>f&&(d=f-p),0>=d||(f=t.yb,Us(t,e,c.background,!0,!1,a,s),i?e.fillRect(f.left,p+f.top,s.width-(f.left+f.right),d):e.fillRect(p+f.left,f.top,d,s.height-(f.top+f.bottom)))}}}}function jh(t,e){for(var i=e?t.rowCount:t.columnCount,n=0;nh.width||a.y>h.height||0>a.x+a.width||0>a.y+a.height||(s instanceof Ch&&Yh(s,e,i,n),null!==e&&(s=e(s)),null===s||null!==i&&!i(s)||n.add(s))}}}function Gh(t){var e=null;return t instanceof pl&&((e=t.spot1)===Se&&(e=null),null!==(t=t.geometry)&&null===e&&(e=t.spot1)),null===e&&(e=te),e}function Xh(t){var e=null;return t instanceof pl&&((e=t.spot2)===Se&&(e=null),null!==(t=t.geometry)&&null===e&&(e=t.spot2)),null===e&&(e=he),e}function Uh(t,e){t.l=e?16777216|t.l:-16777217&t.l}function qh(t,e,i){var n=t.rowDefs;if(!(0>e)){if(n[e]=i instanceof hl?i:void 0,!i)for(e=n.length-1;0<=e&&void 0===n[e--];)n.length--;t.v()}}function Hh(t,e,i){var n=t.colDefs;if(!(0>e)){if(n[e]=i instanceof hl?i:void 0,!i)for(e=n.length-1;0<=e&&void 0===n[e--];)n.length--;t.v()}}function Kh(t){return null!==(t=t.allBindings)&&t._isFrozen}function Wh(t){var e=t.allBindings;if(null===e)null!==t.data&&w("Template cannot have .data be non-null: "+t),t.allBindings=e=new Z;else if(e._isFrozen)return;var i=new Z;Uh(t,!1),t.qm(t,(function(t,n){n.th();var o=n.localBindings;if(null!==o)for(_s(n,!1),o=o.iterator;o.next();){var r=o.value;r.mode===Hd&&_s(n,!0);var s=r.sourceName;null!==s&&("/"===s&&Uh(t,!0),null!==(s=Xd(r,t,n))&&(i.add(s),null===s.srcBindings&&(s.srcBindings=new Z),s.srcBindings.add(r))),e.add(r)}if(n instanceof Ch&&n.type===Ch.Table){if(0i;)t.pc(t.O.length-1,!1);else if(t.O.length<=i){i=e.length;for(var n=0;ni)){var o=Qh(t,e);if(null!==(o=tl(t,o))){if(Wh(o),0!=(16777216&(o=o.copy()).l)){var r=t.ih();null!==r&&Uh(r,!0)}"object"==typeof e&&(null===t.ge&&(t.ge=new dt),t.ge.add(e,o)),r=i+Jh(t),t.Gb(r,o),n&&(o.ub=e,_h(t,r,i),o.ub=null),o.data=e}}}function _h(t,e,i){for(t=t.O;ee.length&&(e="0"+e),2>n.length&&(n="0"+n),2>t.length&&(t="0"+t),"#"+e+n+t},Ia.isValidColor=function(t){if("black"===t)return!0;if(""===t)return!1;uh||(Ja(),uh=!0);var e=rh;if(null===e)return!0;e.fillStyle="#000000";var i=e.fillStyle;return e.fillStyle=t,e.fillStyle!==i||(e.fillStyle="#FFFFFF",i=e.fillStyle,e.fillStyle=t,e.fillStyle!==i)},Ia.lighten=function(t){return za(t)},Ia.lightenBy=za,Ia.darken=function(t){return Ra(t)},Ia.darkenBy=Ra,Ia.mix=Ea,Ia.isDark=Va,ch.prototype.measure=function(){},ch.prototype.Yz=function(t,e,i,n,o){t.measure(e,i,n,o)},ch.prototype.arrange=function(){},ch.prototype.Ly=function(t,e,i,n,o,r){t.arrange(e,i,n,o,r)},ch.prototype.iA=function(t){t.Uj()},ch.prototype.gc=function(){},f.Object.defineProperties(ch.prototype,{name:{get:function(){return this.xa},set:function(t){this.xa=t}},classType:{get:function(){return Ch}}}),ch.prototype.remeasureObject=ch.prototype.iA,ch.prototype.arrangeElement=ch.prototype.Ly,ch.prototype.measureElement=ch.prototype.Yz,ch.className="PanelLayout",c(fh,ch),fh.prototype.measure=function(t,e,i,n,o,r,s){var a=n.length;t=Dh(t);for(var h=0;hS&&(z=Math.max(S-ot,0));var rt=0===C.oa;C.oc=C.oc+z,C.actual=C.oa+z,S=Math.max(S-(z+(rt?ot:0)),0)}if(1===H.columnSpan&&($===fs||$===gs)){var st=(C=t.Eb(Y)).Wc();(z=Math.max(it-C.actual,0))+st>M&&(z=Math.max(M-st,0));var at=0===C.oa;C.oc=C.oc+z,C.actual=C.oa+z,M=Math.max(M-(z+(at?st:0)),0)}K&&H.Uj()}}}}}j(v);var ht=0,lt=0;r=t.columnCount;for(var ut=0;ut=t.rowCount);ee++)C=t.Fb(Zt.row+ee),z=0,z=$===cs||$===gs?Math.max(C.minimum,0===Xt[Zt.row+ee]?C.maximum:Math.min(Xt[Zt.row+ee],C.maximum)):Math.max(C.minimum,isNaN(C.Hc)?C.maximum:Math.min(C.Hc,C.maximum)),Gt.height+=z,te+=C.minimum;for(var ie=1;ie=t.columnCount);ie++)C=t.Eb(Zt.column+ie),z=0,z=$===cs||$===ps?Math.max(C.minimum,0===Ut[Zt.column+ie]?C.maximum:Math.min(Ut[Zt.column+ie],C.maximum)):Math.max(C.minimum,isNaN(C.Hc)?C.maximum:Math.min(C.Hc,C.maximum)),Gt.width+=z,Qt+=C.minimum;Ct.width+=Gt.width,Ct.height+=Gt.height;var ne=Zt.margin,oe=ne.right+ne.left,re=ne.top+ne.bottom;Zt.measure(Ct.width,Ct.height,Qt,te);for(var se=Zt.measuredBounds,ae=Math.max(se.width+oe,0),he=Math.max(se.height+re,0),le=0,ue=0;ue=t.rowCount);ue++)le+=(C=t.Fb(Zt.row+ue)).total||0;if(le=ce)&&!(Zt.row+pe>=t.rowCount);pe++){var ge=(C=t.Fb(Zt.row+pe)).oa||0,me=de(Zt,C,fe);C.actual=Math.min(C.maximum,ge+me),C.oa!==ge&&(ce-=C.oa-ge)}for(;0ye&&(C.actual=Math.min(C.maximum,ye+ce),C.oa!==ye&&(ce-=C.oa-ye)),0===C.index)break;C=t.Fb(C.index-1)}}for(var ve=0,xe=0;xe=t.columnCount);xe++)ve+=(C=t.Eb(Zt.column+xe)).total||0;if(ve=be)&&!(Zt.column+Me>=t.columnCount);Me++){var Se=(C=t.Eb(Zt.column+Me)).oa||0,Ne=ke(Zt,C,we);C.actual=Math.min(C.maximum,Se+Ne),C.oa!==Se&&(be-=C.oa-Se)}for(;0Pe&&(C.actual=Math.min(C.maximum,Pe+be),C.oa!==Pe&&(be-=C.oa-Pe)),0===C.index)break;C=t.Eb(C.index-1)}}}}j(x),At.free(Gt),At.free(Ct),void 0!==Xt&&j(Xt),void 0!==Ut&&j(Ut);var Ce=0,Te=0,Le=t.desiredSize,Ae=t.maxSize;$=Ks(t,!0);var je=lt=ht=0,Fe=0;r=t.columnCount;for(var De=0;De=t.rowCount);C++){var T=t.Fb(v+C);0!==T.oa&&(y.height+=T.total)}for(C=1;C=t.columnCount);C++)0!==(T=t.Eb(b+C)).oa&&(y.width+=T.total);var L=w.oa+y.width,A=x.oa+y.height;C=a,T=h;var j=L,F=A,D=a,O=h,B=L,I=A;a+L>i.width&&(B=Math.max(i.width-a,0)),h+A>i.height&&(I=Math.max(i.height-h,0));var z=N.alignment;if(z.Xb()){(z=t.defaultAlignment).sb()||(z=oe);var R=z.x,E=z.y,V=z.offsetX;z=z.offsetY;var Y=w.alignment,G=x.alignment;Y.sb()&&(R=Y.x,V=Y.offsetX),G.sb()&&(E=G.y,z=G.offsetY)}else R=z.x,E=z.y,V=z.offsetX,z=z.offsetY;(isNaN(R)||isNaN(E))&&(E=R=.5,z=V=0),Y=P.width,G=P.height;var X=N.margin,U=X.left+X.right,q=X.top+X.bottom,H=Ws(N,x,w,!1);!isNaN(N.desiredSize.width)||H!==cs&&H!==ps||(Y=Math.max(L-U,0)),!isNaN(N.desiredSize.height)||H!==cs&&H!==gs||(G=Math.max(A-q,0)),L=N.maxSize,A=N.minSize,Y=Math.min(L.width,Y),G=Math.min(L.height,G),Y=Math.max(A.width,Y),L=(G=Math.max(A.height,G))+q,C+=j*R-(Y+U)*R+V+X.left,T+=F*E-L*E+z+X.top,N.visible&&(Xt(D,O,B,I,C,T,P.width,P.height)?N.arrange(C,T,Y,G):N.arrange(C,T,Y,G,new Ot(D,O,B,I)))}}for(At.free(y),t=0;t=(i=t.Df()*i.scale)&&(i=1);var n=t.gridCellSize,o=n.width;n=n.height;var r=t.naturalBounds,s=t.actualBounds,a=r.width,h=r.height,l=Math.ceil(a/o),u=Math.ceil(h/n),c=t.gridOrigin,f=c.x;c=c.y,e.save(),e.beginPath(),e.rect(0,0,a,h),e.clip(),e.Se();for(var d=[],p=t.O.s,g=p.length,m=0;mx)){y=Fh(y.figure);for(var b=0;bx&&v.push(w))}}}}for(g=(p=t.O.s).length,m=0;mo*(y=Math.abs(v))*i))){if(x=k.segmentIndex,isFinite(x)&&!isNaN(x)||(x=0),0>x&&(x=y-Math.min(-x,y)),x=Math.round(x%y),b=1,1!==(y=k.opacity)){if(0===y)continue;b=e.globalAlpha,e.globalAlpha=b*y}w=d[m];var M=!1,S=k.strokeDashArray;if(null!==S&&(M=!0,e.js(S,k.strokeDashOffset)),"LineV"===k.figure&&null!==k.stroke&&0c)v.measure(1/0,1/0,0,0),x=v.measuredBounds,i.ed(x),d.push(x);else{var b=v.segmentIndex,w=v.segmentFraction,k=v.alignmentFocus;k.Mc()&&(k=oe);var M=v.segmentOrientation,S=v.segmentOffset;if(isNaN(b)){var N=h.ua;x=A(),N.Qu(w,x);var P=pt.allocAt(x[0],x[1]);if(P.add(h.i(0)),N.type===Ue.j?P.offset(-N.startX,-N.startY):null!==(N=N.figures.first())&&P.offset(-N.startX,-N.startY),N=x[2],M!==Wc){var C=h.computeAngle(v,M,N);v.Kb=C}C=P.x-e.x;var T=P.y-e.y;pt.free(P),j(x)}else if(b<-c||b>=c)x=pt.alloc(),h.vg(),h.computeMidPoint(x),N=h.midAngle,M!==Wc&&(C=h.computeAngle(v,M,N),v.Kb=C),C=x.x-e.x,T=x.y-e.y,pt.free(x);else{if(C=0,0<=b?(T=u.M(b),x=bL+10?0<=b?N.ab(T):T.ab(N):L>P+10?0<=b?x.ab(C):C.ab(x):0<=b?N.ab(C):C.ab(N)}else N=0<=b?T.ab(x):x.ab(T);M!==Wc&&(C=h.computeAngle(v,M,N),v.Kb=C),C=T.x+(x.x-T.x)*w-e.x,T=T.y+(x.y-T.y)*w-e.y}v.measure(1/0,1/0,0,0),x=v.measuredBounds,P=v.naturalBounds;var F=0;v instanceof pl&&(F=v.strokeWidth),L=P.width+F;var D=P.height+F;p.reset(),p.translate(-x.x,-x.y),p.scale(v.scale,v.scale),p.rotate(M===Wc?v.angle:N,L/2,D/2),M!==nf&&M!==af||p.rotate(90,L/2,D/2),M!==of&&M!==hf||p.rotate(-90,L/2,D/2),M===lf&&(45N||225N)&&p.rotate(-N,L/2,D/2),P=new Ot(0,0,L,D),g.xi(P,k),p.Ga(g),k=-g.x+F/2*v.scale,v=-g.y+F/2*v.scale,m.assign(S),F=isNaN(S.x);var O=isNaN(S.y);if(F||O){L=L/2+3,D=D/2+3;var B=45<=N&&135>=N,I=225<=N&&315>=N;M===Wc&&(B||I)?(m.x=O?L:S.y,m.y=F?D:S.x,B?0<=b||isNaN(b)&&.5>w||!F||(m.y=-D):I&&((0<=b||isNaN(b)&&.5>w)&&F&&(m.y=-D),O&&(m.x=-L))):(F&&(m.x=0<=b||isNaN(b)&&.5>w?L:-L),O&&(m.y=-D),m.rotate(N))}else m.rotate(N);C+=m.x,T+=m.y,P.set(x),P.h(C+k,T+v,x.width,x.height),d.push(P),i.ed(P)}}if(null!==s)for(n=s.labelNodes;n.next();)n.value.measure(1/0,1/0);t.jg=i,t.position.h(e.x+i.x,e.y+i.y),Bt(o,i.width||0,i.height||0),Ye.free(p),pt.free(g),pt.free(m)}}}},Sh.prototype.arrange=function(t,e){var i=e.length;if(t instanceof Ku||t instanceof wc){var n=t,o=null;t instanceof Ku&&(n=(o=t).adornedPart);var r=t instanceof Ku?null:n.path,s=t.j;if(0!==s.length){var a=0;if(null!==r&&a=i)m=p=pt.alloc(),(d=c).vg(),d.computeMidPoint(m),d=c.midAngle,l!==Wc&&(c=c.computeAngle(s,l,d),s.angle=c),c=p.x,m=p.y,pt.free(p);else{if(g=0,0<=a?(p=e.s[a],m=av+10?0<=a?d.ab(p):p.ab(d):v>y+10?0<=a?m.ab(g):g.ab(m):0<=a?d.ab(g):g.ab(d)}else d=0<=a?p.ab(m):m.ab(p);l!==Wc&&(c=c.computeAngle(s,l,d),s.angle=c),c=p.x+(m.x-p.x)*h,m=p.y+(m.y-p.y)*h}if(f.ys())s.location=new pt(c,m);else{f.Mc()&&(f=oe),(p=Ye.alloc()).reset(),p.scale(s.scale,s.scale),p.rotate(s.angle,0,0);var x=s.naturalBounds;g=Ot.allocAt(0,0,x.width,x.height),(y=pt.alloc()).xi(g,f),p.Ga(y),f=-y.x,v=-y.y;var b=x.width,w=x.height;(x=pt.alloc()).assign(u);var k=isNaN(u.x),M=isNaN(u.y);if(k||M){b=b/2+3,w=w/2+3;var S=45<=d&&135>=d,N=225<=d&&315>=d;l===Wc&&(S||N)?(x.x=M?b:u.y,x.y=k?w:u.x,S?0<=a||isNaN(a)&&.5>h||!k||(x.y=-w):N&&((0<=a||isNaN(a)&&.5>h)&&k&&(x.y=-w),M&&(x.x=-b))):(k&&(x.x=0<=a||isNaN(a)&&.5>h?b:-b),M&&(x.y=-w),x.rotate(d))}else x.rotate(d);c+=x.x,m+=x.y,p.pp(g),f+=g.x,v+=g.y,a=pt.allocAt(c+f,m+v),s.move(a),pt.free(a),pt.free(x),pt.free(y),Ot.free(g),Ye.free(p)}}null!==o?o.Ul(!1):n.Ul(!1),n=Tu(t),t.location.h(t.position.x+n.x,t.position.y+n.y),pt.free(n)}},c(Ph,ch),Ph.prototype.measure=function(t,e,i,n,o,r,s){var a=t.Pb();t.graduatedBounds=[];var h=a.margin,l=h.right+h.left,u=h.top+h.bottom;a.measure(e,i,r,s);var c=a.measuredBounds,f=new Ot(-h.left,-h.top,Math.max(c.width+l,0),Math.max(c.height+u,0));t.graduatedBounds.push(f),o.assign(f);for(var d=a.geometry,p=a.strokeWidth,g=d.flattenedSegments,m=d.flattenedLengths,y=d.flattenedTotalLength,v=g.length,x=0,b=0,w=A(),k=0;kL&&(L+=360),S.push(L)}x=C,b=T}w.push(S)}if(null===t.graduatedIntervals){for(var F=[],D=t.O.s,O=D.length,B=0;BR))for(var E=0;ER&&z.push(Y)}}}}t.graduatedIntervals=F}var G=t.graduatedIntervals,X=t.O.s,U=X.length,q=0,H=0,K=y;t.graduatedMarks=[];for(var W,J=0;J_*$*y/t.graduatedRange&&null===Z.graduatedSkip)){var Q=m[0][0],tt=0,et=0;H=y*Z.graduatedStart-1e-4,K=y*Z.graduatedEnd+1e-4;var it=_*$,nt=t.graduatedTickBase;if(ntt.graduatedMin+it&&(nt-=Math.floor((nt-t.graduatedMin)/it)*it);for(var rt=G[J],st=nt,at=1e-6*t.graduatedMax,ht=1;nt<=t.graduatedMax+at;ht++){t:{for(var lt=rt.length,ut=0;ut-ft){var dt=!1;break t}}dt=!0}if(dt&&(nt>t.graduatedMax&&(nt=t.graduatedMax),null===Z.graduatedSkip||Z instanceof Pl&&!Z.graduatedSkip(nt,Z)||Z instanceof pl&&!Z.graduatedSkip(nt,Z))&&((q=(nt-t.graduatedMin)*y/t.graduatedRange)>y&&(q=y),H<=q&&q<=K)){for(var gt=w[tt][et],mt=m[tt][et];ttQ&&etbt&&.4995bt?0bt||.9995Nt){var Pt=1-Math.abs(.5-bt);gt=(kt*Pt+St*(1-Pt))%360;break t}}}gt=kt}if(Z instanceof Pl){var Ct="";null!==Z.graduatedFunction?Ct=null!=(Ct=Z.graduatedFunction(nt,Z))?Ct.toString():"":Ct=(+nt.toFixed(2)).toString(),""!==Ct&&W.push({$l:wt,angle:gt,text:Ct})}else W.push({$l:wt,angle:gt})}nt=st+ht*it}}}t.graduatedMarks.push(W)}j(w);var Tt=t.graduatedMarks;if(null!==Tt)for(var Lt=n.length,At=0;AtQt;Qt++){switch(Qt){case 0:Xt.h(Ut,qt);break;case 1:Xt.h(Ut+Et,qt);break;case 2:Xt.h(Ut,qt+Vt);break;case 3:Xt.h(Ut+Et,qt+Vt)}Xt.rotate(_t+jt.angle),Xt.offset(Zt,$t),0===Wt&&0===Qt?Ht.h(Xt.x,Xt.y,0,0):Ht.Ye(Xt),Xt.offset(-Zt,-$t),Xt.rotate(-_t-jt.angle)}pt.free(Xt),null!==Dt.graduatedBounds&&Dt.graduatedBounds.push(Ht),Gt(Bt,Ht.x,Ht.y,Ht.width,Ht.height)}else if(jt instanceof Pl){var te=t,ie=o;null===te.temporaryTextBlock&&(te.temporaryTextBlock=new Pl);var ne=te.temporaryTextBlock;Tl(ne,jt);var oe=jt.alignmentFocus;oe.Mc()&&(oe=ee);for(var re=jt.segmentOrientation,se=jt.segmentOffset,ae=new Ot,he=0,le=0,ue=0,ce=0,fe=0,de=Ft.length,pe=0;peue||225ue)&&be.rotate(-ue,ve/2,xe/2);var we=Ot.allocAt(0,0,ve,xe),ke=pt.alloc();ke.xi(we,oe),be.Ga(ke);var Me=-ke.x,Se=-ke.y,Ne=pt.alloc();Ne.assign(se),isNaN(Ne.x)&&(Ne.x=ve/2+3),isNaN(Ne.y)&&(Ne.y=-(xe/2+3)),Ne.rotate(ue);var Pe=new Ot(he+=Ne.x+Me,le+=Ne.y+Se,me.width,me.height),Ce=new Ot(me.x,me.y,me.width,me.height),Te=new Ot(ye.x,ye.y,ye.width,ye.height);ge.Sz=ce,ge.lineCount=ne.lineCount,ge.lines=[ne.Cb,ne.Ih,ne.df,ne.Le,ne.Qc,ne.Qb,ne.ze],ge.actualBounds=Pe,ge.measuredBounds=Ce,ge.naturalBounds=Te,0===pe?ae.assign(Pe):ae.ed(Pe),pt.free(Ne),pt.free(ke),Ot.free(we),Ye.free(be)}null!==te.graduatedBounds&&te.graduatedBounds.push(ae),Gt(ie,ae.x,ae.y,ae.width,ae.height)}ia(jt,!1)}}},Ph.prototype.arrange=function(t,e,i){if(null!==t.graduatedBounds){var n=t.Pb(),o=t.graduatedMarks;if(null!==o){var r=t.graduatedBounds,s=0,a=r[s];s++,null!==n&&n.arrange(a.x-i.x,a.y-i.y,a.width,a.height);for(var h=e.length,l=0;l=(s=t.Df()*i.scale)&&(s=1);for(var a=r.actualBounds,h=t.O.s,l=t.graduatedMarks,u=h.length,c=0;ct.graduatedTickUnit*f.interval*r.geometry.flattenedTotalLength/t.graduatedRange*s&&null===f.graduatedSkip)){var g=f.measuredBounds,m=f.strokeWidth*f.scale,y=f.alignmentFocus;y.Mc()&&(y=ee);for(var v=0;vn&&o.set(p),pt.free(p)),pt.free(u),r&&o.transform(s),l},e.Gj=function(){for(var t=this.O.s,e=t.length,i=0;ii||r>n)&&(this.v(),this.measure(e>i?i:e,r>n?n:r,0,0));break;case cs:this.v(!0),this.measure(i+a,n+s,0,0);break;case ps:this.v(!0),this.measure(i+a,r+s,0,0);break;case gs:this.v(!0),this.measure(e+a,n+s,0,0)}}this.na.arrange(this,o,this.jg)}},e.gh=function(t){var e=this.naturalBounds,i=Dh(this);if(Xt(0,0,e.width,e.height,t.x,t.y)){for(var n=(e=this.O.s).length,o=pt.allocAt(0,0);n--;){var r=e[n];if((r.visible||r===i)&&(vt(o.set(t),r.transform),r.ca(o)))return pt.free(o),!0}return pt.free(o),null!==this.Ma||null!==this.areaBackground}return!1},e.ks=function(t){if(this.bindingId===t)return this;for(var e=this.O.s,i=e.length,n=0;nf.width||c.y>f.height||0>c.x+c.width||0>c.y+c.height||(c=u,u=u instanceof Ch?u:null,(f=Ye.alloc()).set(s),(null!==u?u.Cf(t,e,i,n,o,f):Is(c,t,n,f))&&(null!==e&&(c=e(c)),null===c||null!==i&&!i(c)||o.add(c)),Ye.free(f))}}return void 0===r&&Ye.free(s),n}return void 0===r&&Ye.free(s),!1},e.og=function(t,e,i,n,o,r){if(!1===this.pickable)return!1;void 0===i&&(i=null),void 0===n&&(n=null);var s=this.naturalBounds,a=this.se(),h=a?t:vt(pt.allocAt(t.x,t.y),this.transform),l=a?e:vt(pt.allocAt(e.x,e.y),this.transform),u=h.Bf(l),c=0m.width||g.y>m.height||0>g.x+g.width||0>g.y+g.height)||(p.se()?(g=p.transform,vt(h.set(t),g),vt(l.set(e),g)):(h.set(t),l.set(e)),g=p,(null!==(p=p instanceof Ch?p:null)?p.og(h,l,i,n,o,r):g.tx(h,l,o))&&(null!==i&&(g=i(g)),null===g||null!==n&&!n(g)||r.add(g)))}}pt.free(h),pt.free(l)}return o?c:s}return!1},e.add=function(t){for(var e=[],i=0;i=o.count&&t>=o.count)return;o.mb(r),n=r}else w("element "+e.toString()+" has panel "+i.toString()+" but is not contained by it.")}(0>t||t>o.count)&&(t=o.count),o.Gb(t,e),(0===t||e.isPanelMain)&&(this.$g=null),ea(this)||this.v(),e.v(!1),(null!==e.portId||e instanceof Ch&&!0===e.Te)&&(this.Te=!0),this.graduatedIntervals=null,this.If()||el(this,e,!1),null!==(i=this.part)&&(i.Rh=null,i.ag=NaN,this.Te&&i instanceof Ju&&(i.Te=!0),i.Te&&i instanceof Ju&&(i.wc=null),null!==(o=this.diagram)&&o.undoManager.isUndoingRedoing||(-1!==n&&i.cb(pi,"elements",this,e,null,n,null),i.cb(di,"elements",this,null,e,null,t)))},e.remove=function(t){for(var e=this.O.s,i=e.length,n=-1,o=0;ot&&M(t,">= 0",Ch,"getRowDefinition:idx"),t=Math.round(t);var e=this.rowDefs;if(void 0===e[t]){var i=new hl;i.wi(this),i.isRow=!0,i.index=t,e[t]=i,this.cb(di,"rowdefs",this,null,i,null,t)}return e[t]},e.oA=function(t){if(0>t&&M(t,">= 0",Ch,"removeRowDefinition:idx"),0!==this.rowCount){t=Math.round(t);var e=this.rowDefs,i=e[t];if(i){e[t]=void 0;for(var n=e.length-1;0<=n&&void 0===e[n--];)e.length--;this.cb(pi,"rowdefs",this,i,null,t,null),this.v()}}},e.Eb=function(t){0>t&&M(t,">= 0",Ch,"getColumnDefinition:idx"),t=Math.round(t);var e=this.colDefs;if(void 0===e[t]){var i=new hl;i.wi(this),i.isRow=!1,i.index=t,e[t]=i,this.cb(di,"coldefs",this,null,i,null,t)}return e[t]},e.jA=function(t){if(0>t&&M(t,">= 0",Ch,"removeColumnDefinition:idx"),0!==this.columnCount){t=Math.round(t);var e=this.colDefs,i=e[t];if(i){e[t]=void 0;for(var n=e.length-1;0<=n&&void 0===e[n--];)e.length--;this.cb(pi,"coldefs",this,i,null,t,null),this.v()}}},e.Gy=function(t){var e=null;return t.isRow?e=this.Fb(t.index):t.isRow||(e=this.Eb(t.index)),e&&ll(e,t),this},e.Hy=function(t,e){return(t=this.Fb(t))&&ll(t,new hl(e)),this},e.By=function(t,e){return(t=this.Eb(t))&&ll(t,new hl(e)),this},e.nz=function(t){if(0>t||this.type!==Ch.Table||0===this.rowCount)return-1;for(var e=0,i=this.rowDefs,n=i.length,o=this.topIndex;ot||this.type!==Ch.Table||0===this.columnCount)return-1;for(var e=0,i=this.colDefs,n=i.length,o=this.leftIndex;ot;)this.pc(this.O.length-1,!1);Zh(this,this.itemArray)},f.Object.defineProperties(Ch.prototype,{type:{get:function(){return this.na},set:function(t){var e=this.na;e!==t&&(this.na=t,this.isAtomic=this.na===Ch.Grid,this.v(),this.g("type",e,t))}},elements:{get:function(){return this.O.iterator}},naturalBounds:{get:function(){return this.dc}},padding:{get:function(){return this.yb},set:function(t){"number"==typeof t?(0>t&&M(t,">= 0",Ch,"padding"),t=new Wt(t)):(0>t.left&&M(t.left,">= 0",Ch,"padding:value.left"),0>t.right&&M(t.right,">= 0",Ch,"padding:value.right"),0>t.top&&M(t.top,">= 0",Ch,"padding:value.top"),0>t.bottom&&M(t.bottom,">= 0",Ch,"padding:value.bottom"));var e=this.yb;e.D(t)||(this.yb=t=t.J(),this.v(),this.g("padding",e,t))}},defaultAlignment:{get:function(){return this.Tm},set:function(t){var e=this.Tm;e.D(t)||(this.Tm=t=t.J(),this.v(),this.g("defaultAlignment",e,t))}},defaultStretch:{get:function(){return this.Uf},set:function(t){var e=this.Uf;e!==t&&(this.Uf=t,this.v(),this.g("defaultStretch",e,t))}},defaultSeparatorPadding:{get:function(){return null!==this.T?this.T.Qp:$t},set:function(t){"number"==typeof t&&(t=new Wt(t));var e=this.defaultSeparatorPadding;e.D(t)||(t=t.J(),null===this.T&&(this.T=new al),this.T.Qp=t,this.v(),this.g("defaultSeparatorPadding",e,t))}},defaultRowSeparatorStroke:{get:function(){return null!==this.T?this.T.ia:null},set:function(t){var e=this.defaultRowSeparatorStroke;e!==t&&(null===t||"string"==typeof t||t instanceof Ia)&&(t instanceof Ia&&t.freeze(),null===this.T&&(this.T=new al),this.T.ia=t,this.N(),this.g("defaultRowSeparatorStroke",e,t))}},defaultRowSeparatorStrokeWidth:{get:function(){return null!==this.T?this.T.Ha:1},set:function(t){var e=this.defaultRowSeparatorStrokeWidth;e!==t&&isFinite(t)&&0<=t&&(null===this.T&&(this.T=new al),this.T.Ha=t,this.v(),this.g("defaultRowSeparatorStrokeWidth",e,t))}},defaultRowSeparatorDashArray:{get:function(){return null!==this.T?this.T.V:null},set:function(t){var e=this.defaultRowSeparatorDashArray;if(e!==t){if(null!==t){for(var i=t.length,n=0,o=0;ot)&&w("Panel.topIndex must be greater than zero and a real number, not: "+t),null===this.T&&(this.T=new al),this.T.Hb=t,this.v(),this.g("topIndex",e,t))}},leftIndex:{get:function(){return null!==this.T?this.T.hb:0},set:function(t){var e=this.leftIndex;e!==t&&((!isFinite(t)||0>t)&&w("Panel.leftIndex must be greater than zero and a real number, not: "+t),null===this.T&&(this.T=new al),this.T.hb=t,this.v(),this.g("leftIndex",e,t))}},data:{get:function(){return this.ub},set:function(t){var e=this.ub;if(e!==t){var i=this instanceof ku&&!(this instanceof Ku);Wh(this),this.ub=t;var n=this.diagram;null!==n&&(i?(i=n.partManager,this instanceof wc?(null!==e&&i.bf.remove(e),null!==t&&i.bf.add(t,this)):this instanceof ku&&(null!==e&&i.cf.remove(e),null!==t&&i.cf.add(t,this))):null!==(i=this.panel)&&null!==i.ge&&(null!==e&&i.ge.remove(e),null!==t&&i.ge.add(t,this))),this.g("data",e,t),null!==n&&n.undoManager.isUndoingRedoing||null!==t&&this.La()}}},itemIndex:{get:function(){return this.zn},set:function(t){var e=this.zn;e!==t&&(this.zn=t,this.g("itemIndex",e,t))}},allBindings:{get:function(){return null!==this.A?this.A.nb:null},set:function(t){this.localBindings!==t&&(null===this.A&&(this.A=new fa),this.A.nb=t)}},itemArray:{get:function(){return this.Hh},set:function(t){var e=this.Hh;if(e!==t||null!==t&&function(t,e){for(var i=(t=t.O.s).length,n=e.length,o=0,r=null;ot&&M(t,">= 0",hl,"height"),this.Hc=t,this.actual=this.oa,null!==this.panel&&this.panel.v(),this.Ob("height",e,t))}},width:{get:function(){return this.Hc},set:function(t){var e=this.Hc;e!==t&&(0>t&&M(t,">= 0",hl,"width"),this.Hc=t,this.actual=this.oa,null!==this.panel&&this.panel.v(),this.Ob("width",e,t))}},minimum:{get:function(){return this.jj},set:function(t){var e=this.jj;e!==t&&((0>t||!isFinite(t))&&M(t,">= 0",hl,"minimum"),this.jj=t,this.actual=this.oa,null!==this.panel&&this.panel.v(),this.Ob("minimum",e,t))}},maximum:{get:function(){return this.hj},set:function(t){var e=this.hj;e!==t&&(0>t&&M(t,">= 0",hl,"maximum"),this.hj=t,this.actual=this.oa,null!==this.panel&&this.panel.v(),this.Ob("maximum",e,t))}},alignment:{get:function(){return this.Jb},set:function(t){var e=this.Jb;e.D(t)||(this.Jb=t.J(),null!==this.panel&&this.panel.v(),this.Ob("alignment",e,t))}},stretch:{get:function(){return this.hg},set:function(t){var e=this.hg;e!==t&&(this.hg=t,null!==this.panel&&this.panel.v(),this.Ob("stretch",e,t))}},separatorPadding:{get:function(){return this.dg},set:function(t){"number"==typeof t&&(t=new Wt(t));var e=this.dg;null!==t&&null!==e&&e.D(t)||(null!==t&&(t=t.J()),this.dg=t,null!==this.panel&&this.panel.v(),this.Ob("separatorPadding",e,t))}},separatorStroke:{get:function(){return this.lo},set:function(t){var e=this.lo;e!==t&&(null!==t&&Wa(t,"RowColumnDefinition.separatorStroke"),t instanceof Ia&&t.freeze(),this.lo=t,null!==this.panel&&this.panel.v(),this.Ob("separatorStroke",e,t))}},separatorStrokeWidth:{get:function(){return this.mo},set:function(t){var e=this.mo;e!==t&&(this.mo=t,null!==this.panel&&this.panel.v(),this.Ob("separatorStrokeWidth",e,t))}},separatorDashArray:{get:function(){return this.tj},set:function(t){var e=this.tj;if(e!==t){if(null!==t){for(var i=t.length,n=0,o=0;oo)){var r=n.measuredBounds,s=Math.max(1,r.width);r=r.height;for(var a,h,l,u,c,f,d=i[0],p=i[1],g=0,m=A(),y=2;yl&&(l=1),o=i=l,h=0!==(a=s/2),l=(f=m[y=0])[0],c=f[1],u=f[2],f=f[3];for(var v=0;.1<=g;){if(0===v&&(h?(o=i,o-=a,g-=a,h=!1):o=i,0===o&&(o=1)),o>g)return void j(m);o>f?(v=o-f,o=f):v=0;var x=Math.sqrt(o*o/(1+u*u));if(0>l&&(x=-x),d+=x,p+=u*x,t.translate(d,p),t.rotate(c),t.translate(-s/2,-r/2),0===v&&n.hh(t,e),t.translate(s/2,r/2),t.rotate(-c),t.translate(-d,-p),g-=o,f-=o,0!==v){if(++y===m.length)return void j(m);l=(f=m[y])[0],c=f[1],u=f[2],f=f[3],o=v}}j(m)}}function yl(t){var e=t.geometryStretch;return null!==t.Rd?e===ms?cs:e:e===ms?Sl[t.figure].defaultStretch:e}function vl(t,e,i,n,o){return(e=(t=i.x-t)*t+(e=i.y-e)*e)i?t-i:i-t)<(e>n?e-n:n-e)?(t=et||Xe.$(h.y,t))&&(h.ye||Xe.$(h.x,e))&&(h.x=t&&n<=e):(t=n&&i<=t)}function wl(t){var e=t.diagram;null!==e&&e.undoManager.isUndoingRedoing||(t.segmentOrientation=ef,"None"!==t.toArrow?(t.segmentIndex=-1,t.alignmentFocus=je):"None"!==t.fromArrow&&(t.segmentIndex=0,t.alignmentFocus=new Ie(1-je.x,je.y)))}function kl(t){var e=Ml[t];if(void 0===e){var i=t.toLowerCase();if("none"===i)return"None";if(void 0===(e=Ml[i])){var n,o=null;for(n in Xe.um)if(n.toLowerCase()===i){o=n;break}if(null!==o)return t=Ue.parse(Xe.um[o],!1),Ml[o]=t,i!==o&&(Ml[i]=o),o}}return"string"==typeof e?e:e instanceof Ue?t:null}hl.className="RowColumnDefinition",hl.Default=cl,hl.None=fl,hl.ProportionalExtra=dl,c(pl,Ds),pl.prototype.cloneProtected=function(t){Ds.prototype.cloneProtected.call(this,t),t.ua=this.ua,t.Rd=this.Rd,t.an=this.an,t.Ui=this.Ui,t.xc=this.xc,t.ig=this.ig,null!==this.Yg&&(t.Yg=C(this.Yg)),null!==this.Na&&(t.Na=this.Na.nc?this.Na:this.Na.copy()),t.Un=this.Un,t.Vn=this.Vn,null!==this.fa&&(t.fa=this.fa.copy())},(e=pl.prototype).th=function(){Ds.prototype.th.call(this),null!==this.Na&&(this.Na.nc=!0)},e.qb=function(t){t===fs||t===ds||t===ys||t===ms?this.geometryStretch=t:Ds.prototype.qb.call(this,t)},e.toString=function(){return"Shape("+("None"!==this.figure?this.figure:"None"!==this.toArrow?this.toArrow:this.fromArrow)+")#"+et(this)},e.hh=function(t,e){var i=this.xc,n=this.Ui;if(null!==i||null!==n){var o=this.ua;if(null!==o){t.yc();var r=this.actualBounds,s=this.naturalBounds;null!==n&&Us(this,t,n,!0,!1,s,r);var a=this.part,h=this.ig;if(null===i||0!==h||null===a||!this.isPanelMain&&a.Pb()!==this||(h=a.type===Ch.Link&&a instanceof Ku&&"Selection"===a.category&&a.adornedObject instanceof pl&&a.adornedPart.Pb()===a.adornedObject?a.adornedObject.strokeWidth:0),0===h&&(i=null),null!==i&&0!==h&&(Us(this,t,i,!1,!1,s,r),t.lineWidth=h,t.lineJoin=this.strokeJoin,t.lineCap=this.strokeCap,t.miterLimit=this.strokeMiterLimit),r=!1,a&&e.Gf("drawShadows")&&(r=a.isShadowed),!1===t.Il&&(r=!1),a=!0,null===i||null!==n&&"transparent"!==n||(a=!1),s=!1,null!==(h=this.strokeDashArray)&&(s=!0,t.js(h,this.strokeDashOffset)),o.type===Ue.j)t.beginPath(),t.moveTo(o.startX,o.startY),t.lineTo(o.endX,o.endY),null!==i&&t.jk(),t.Se();else if(o.type===Ue.u){var l=o.startX;h=o.startY;var u=o.endX,c=o.endY;o=Math.min(l,u);var f=Math.min(h,c);l=Math.abs(u-l),h=Math.abs(c-h),t.beginPath(),t.rect(o,f,l,h),null!==n&&t.ng(n),null!==i&&(a&&r&&La(t),t.jk(),a&&r&&Aa(t)),t.Se()}else if(o.type===Ue.F)l=o.startX,h=o.startY,u=o.endX,c=o.endY,o=Math.abs(u-l)/2,f=Math.abs(c-h)/2,l=Math.min(l,u)+o,h=Math.min(h,c)+f,t.beginPath(),t.moveTo(l,h-f),t.bezierCurveTo(l+Xe.wg*o,h-f,l+o,h-Xe.wg*f,l+o,h),t.bezierCurveTo(l+o,h+Xe.wg*f,l+Xe.wg*o,h+f,l,h+f),t.bezierCurveTo(l-Xe.wg*o,h+f,l-o,h+Xe.wg*f,l-o,h),t.bezierCurveTo(l-o,h-Xe.wg*f,l-Xe.wg*o,h-f,l,h-f),t.closePath(),null!==n&&t.ng(n),null!==i&&(a&&r&&La(t),t.jk(),a&&r&&Aa(t)),t.Se();else if(o.type===Ue.o)for(h=(o=o.figures).length,f=0;fg.sweepAngle,null!==d?d.endX:l.startX,null!==d?d.endY:l.startY)}else if(0===(m=(d=ti(g,l)).length))t.lineTo(g.centerX,g.centerY);else for(var y=0;y(i.startX-i.endX)*(t.x-i.endX)+(i.startY-i.endY)*(t.y-i.endY)||0>n)&&(Ot.free(r),Xe.Yb(i.startX,i.startY,i.endX,i.endY,o,t.x,t.y)));if(i.type===Ue.u){e=i.startX;var s=i.startY,a=i.endX;if(i=i.endY,r.x=Math.min(e,a),r.y=Math.min(s,i),r.width=Math.abs(a-e),r.height=Math.abs(i-s),null===this.fill){if(r.Bc(-n,-n),r.ca(t))return Ot.free(r),!1;r.Bc(n,n)}return null!==this.stroke&&r.Bc(o,o),t=r.ca(t),Ot.free(r),t}if(i.type===Ue.F){s=i.startX,o=i.startY,a=i.endX;var h=i.endY;if(i=Math.min(s,a),e=Math.min(o,h),s=Math.abs(a-s)/2,o=Math.abs(h-o)/2,i=t.x-(i+s),e=t.y-(e+o),null===this.fill){if(o-=n,0>=(s-=n)||0>=o||1>=i*i/(s*s)+e*e/(o*o))return Ot.free(r),!1;s+=n,o+=n}return null!==this.stroke&&(s+=n,o+=n),Ot.free(r),!(0>=s||0>=o)&&1>=i*i/(s*s)+e*e/(o*o)}if(i.type===Ue.o)return Ot.free(r),null===this.fill?Je(i,t.x,t.y,o):Ke(i,t,o,1=this.strokeWidth)u=Xe.Ve(l.startX,l.startY,l.endX,l.endY,r,s,a,h,o);else{if(l.startX===l.endX?(n=c,u=0):(e=(l.endY-l.startY)/(l.endX-l.startX),n=(u=c/Math.sqrt(1+e*e))*e),e=A(),t=new pt,Xe.Ve(l.startX+n,l.startY+u,l.endX+n,l.endY+u,r,s,a,h,t)&&e.push(t),t=new pt,Xe.Ve(l.startX-n,l.startY-u,l.endX-n,l.endY-u,r,s,a,h,t)&&e.push(t),t=new pt,Xe.Ve(l.startX+n,l.startY+u,l.startX-n,l.startY-u,r,s,a,h,t)&&e.push(t),t=new pt,Xe.Ve(l.endX+n,l.endY+u,l.endX-n,l.endY-u,r,s,a,h,t)&&e.push(t),0===(a=e.length))return j(e),!1;for(u=!0,h=1/0,n=0;nMath.abs(i)){if(0>t*t*i*i+l*l-(h=s-u-i*(r-n))*h){o.x=NaN,o.y=NaN,u=!1;break t}a=(-t*t*i*h+t*l*(c=Math.sqrt(t*t*i*i+l*l-h*h)))/(l*l+t*t*i*i)+n,t=(-t*t*i*h-t*l*c)/(l*l+t*t*i*i)+n,l=i*(a-n)+h+u,h=i*(t-n)+h+u,Math.abs((r-a)*(r-a))+Math.abs((s-l)*(s-l))(a-=a/(t*t)*(h=r-n)*h)){o.x=NaN,o.y=NaN,u=!1;break t}a=u+(h=Math.sqrt(a)),h=u-h,Math.abs(a-s)Math.abs(p)?(g*=.5/p,p=.5):0!==g&&.5>Math.abs(g)&&(p*=.5/g,g=.5),y-=p,v-=g;d.contains(y,v);)y-=p,v-=g;for(o.x=a,o.y=h,g=0;go)return!0;return!1}if(i&&null!==this.fill&&this.gh(t,!0))return!0;var o=t.Bf(e),r=o;if(1.5=o||bt(e,r,0,-c)>=o||bt(e,r,0,c)>=o||bt(e,r,u,0)>=o);if((t=Xe.$y(u,c,e,r))*t<=o)return!0}else if(e.type===Ue.o){if(r=(l=e.bounds).x,a=l.y,h=l.x+l.width,l=l.y+l.height,t.x>h&&t.xl&&t.yo&&xt(t.x,t.y,r,a,h,a)>o&&xt(t.x,t.y,h,l,r,l)>o&&xt(t.x,t.y,h,l,h,a)>o)return!1;if(r=Math.sqrt(o),!i){for(i=e.figures,e=0;eo)return!1;for(h=(a=r.segments.s).length,l=0;lo)return!1;break;case oi:var f=A();if(Xe.Qe(s,u,c.point1X,c.point1Y,c.point2X,c.point2Y,c.endX,c.endY,.8,f),s=n(f,t),j(f),s)return!1;if(s=c.endX,u=c.endY,t.zd(s,u)>o)return!1;break;case ri:if(f=A(),Xe.ep(s,u,c.point1X,c.point1Y,c.endX,c.endY,.8,f),s=n(f,t),j(f),s)return!1;if(s=c.endX,u=c.endY,t.zd(s,u)>o)return!1;break;case si:case ai:var d=(f=c.type===si?ti(c,r):ei(c,r,s,u)).length;if(0===d){if(s=c.type===si?c.centerX:c.endX,u=c.type===si?c.centerY:c.endY,t.zd(s,u)>o)return!1;break}c=null;for(var p=A(),g=0;g= 0",pl,"strokeWidth:value")}},strokeCap:{get:function(){return null!==this.Na?this.Na.Hr:"butt"},set:function(t){var e=this.strokeCap;e!==t&&("string"!=typeof t||"butt"!==t&&"round"!==t&&"square"!==t?M(t,'"butt", "round", or "square"',pl,"strokeCap"):(gl(this),this.Na.Hr=t,this.N(),this.g("strokeCap",e,t)))}},strokeJoin:{get:function(){return null!==this.Na?this.Na.Ir:"miter"},set:function(t){var e=this.strokeJoin;e!==t&&("string"!=typeof t||"miter"!==t&&"bevel"!==t&&"round"!==t?M(t,'"miter", "bevel", or "round"',pl,"strokeJoin"):(gl(this),this.Na.Ir=t,this.N(),this.g("strokeJoin",e,t)))}},strokeMiterLimit:{get:function(){return null!==this.Na?this.Na.Jr:10},set:function(t){var e=this.strokeMiterLimit;if(e!==t&&1<=t){gl(this),this.Na.Jr=t,this.N();var i=this.part;null!==i&&(i.ag=NaN),this.g("strokeMiterLimit",e,t)}}},strokeDashArray:{get:function(){return this.Yg},set:function(t){var e=this.Yg;if(e!==t){if(null!==t){for(var i=t.length,n=0,o=0;ot?t=0:1t?t=0:1t.maxLines&&(t.l|=16777216))}function Al(t,e,i,n){var o=t.formatting===ql;o&&(e=e.trim());var r=0,s=t.Ae,a=t.spacingAbove+t.spacingBelow;a=Math.max(0,Dl(t)+a);var h=t.overflow===Ul?Ol(s):0;if(t.Gc>=t.maxLines)null!==n&&n.h(0,a);else if(s=e,t.wrap===El){t.Le=1;var l=Fl(e);if(0===h||l<=i)t.Cb=Math.max(t.Cb,l),Ll(t,e,t.Cb),null!==n&&n.h(l,a);else{for(l=Fl((r=jl(t,s))+(e=jl(t,s=s.substr(r.length))));0i&&1i;){var c=1;for(l=Fl(e.substr(0,c)),u=0;l<=i;)c++,u=l,l=Fl(e.substr(0,c));if(1===c){var f=l;r=Math.max(r,l)}else f=u,r=Math.max(r,u);if(1>--c&&(c=1),Ll(t,e.substr(0,c),f),h++,e=e.substr(c),t.Gc+h>t.maxLines)break}for(l=Fl(e+(u=jl(t,s)));0t.maxLines))break}t.Le=Math.min(t.maxLines,h),t.Cb=Math.max(t.Cb,r),null!==n&&n.h(t.Cb,a*t.Le)}}function jl(t,e){if(t.wrap===Gl)return e.substr(0,1);for(var i=e.length,n=0,o=Kl;n=e.length?e:e.substr(0,n)}function Fl(t){return null===tu?8*t.length:tu.measureText(t).width}function Dl(t){if(null!==t.df)return t.df;var e=t.Ae;if(null===tu){var i=16;return t.df=i}return void 0!==Wl[e]&&5e3>Jl?i=Wl[e]:(i=1.3*tu.measureText("M").width,Wl[e]=i,Jl++),t.df=i}function Ol(t){if(null===tu)return 6;if(void 0!==Zl[t]&&5e3>$l)var e=Zl[t];else e=tu.measureText(_l).width,Zl[t]=e,$l++;return e}function Bl(t,e){var i=t.ec.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),n=t.spacingAbove+t.spacingBelow;if(n=Math.max(0,Dl(t)+n),0===i.length)return t.Cb=0,t.Gc=1,n;if(!t.isMultiline){var o=i.indexOf("\n",0);0<=o&&(i=i.substr(0,o))}o=0;for(var r,s=t.Gc=0,a=!1;!a;){if(-1===(r=i.indexOf("\n",s))&&(r=i.length,a=!0),s<=r){if(s=i.substr(s,r-s),t.wrap!==El){t.Le=0;var h=At.alloc();Al(t,s,e,h),o+=h.height,At.free(h),t.Gc+=t.Le}else Al(t,s,e,null),o+=n,t.Gc++;t.Gc===t.maxLines&&(a=!0)}s=r+1}return t.Lq=o}pl.className="Shape",pl.getFigureGenerators=function(){var t,e=new dt;for(t in Xe.Ze)t!==t.toLowerCase()&&e.add(t,Xe.Ze[t]);return e.freeze(),e},pl.defineFigureGenerator=function(t,e){var i=t.toLowerCase(),n=Xe.Ze;n[t]=e,n[i]=t},pl.getArrowheadGeometries=function(){var t=new dt;for(n in Xe.um)if(void 0===Ml[n]){var e=Ue.parse(Xe.um[n],!1);Ml[n]=e,(e=n.toLowerCase())!==n&&(Ml[e]=n)}for(var i in Ml)if(i!==i.toLowerCase()){var n=Ml[i];n instanceof Ue&&t.add(i,n)}return t.freeze(),t},pl.defineArrowheadGeometry=function(t,e){var i=null;i="string"==typeof e?Ue.parse(e,!1):e,"none"!==(e=t.toLowerCase())&&t!==e||w("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+t);var n=Ml;n[t]=i,n[e]=t},Nl.prototype.copy=function(){var t=new Nl;return t.Hr=this.Hr,t.Ir=this.Ir,t.Jr=this.Jr,t.uj=this.uj,t.br=this.br,t.jq=this.jq,t.fg=this.fg.J(),t.gg=this.gg.J(),t},c(Pl,Ds),Pl.prototype.cloneProtected=function(t){Ds.prototype.cloneProtected.call(this,t),t.ec=this.ec,t.xc=this.xc,t.Ae=this.Ae,t.Gc=this.Gc,t.Cb=this.Cb,t.Lq=this.Lq,t.Gm=this.Gm,null!==this.fa&&(t.fa=this.fa.copy()),null!==this.da&&(t.da=this.da.nc?this.da:this.da.copy()),t.Ih=this.Ih,t.df=this.df,t.Le=this.Le,t.Qc=this.Qc,t.Qb=this.Qb,t.ze=this.ze},(e=Pl.prototype).th=function(){Ds.prototype.th.call(this),null!==this.da&&(this.da.nc=!0)},e.qb=function(t){t.classType===Pl?this.wrap=t:Ds.prototype.qb.call(this,t)},e.toString=function(){return 22(c*c+u*u)*f*f&&(i=!0),e.ib!==t&&(i=!1),e.ib instanceof va&&(i=!1),!1===e.Gf("textGreeking")&&(i=!1),e=this.spacingAbove,c=this.spacingBelow,this.flip){case xs:t.translate(o,0),t.scale(-1,1);break;case vs:t.translate(0,r),t.scale(1,-1);break;case bs:t.translate(o,r),t.scale(-1,-1)}if(t.yc(),r>(f=(e+s+c)*(u=this.Gc))&&(n=(n=this.verticalAlignment).y*r-n.y*f+n.offsetY),1===u&&null!==this.ze)(c=this.Cb)>o&&(c=o),this.Oj(this.ze,t,0,n+e,o,s,c,i,a,h,l);else if(null!==this.Qc&&null!==this.Qb)for(f=0;fo&&(d=o),n+=e,this.Oj(this.Qb[f],t,0,n,o,s,d,i,a,h,l),n+=s+c}switch(this.flip){case xs:t.scale(-1,1),t.translate(-o,0);break;case vs:t.scale(1,-1),t.translate(0,-r);break;case bs:t.scale(-1,-1),t.translate(-o,-r)}}},e.Oj=function(t,e,i,n,o,r,s,a,h,l,u){var c=0;if(a)"left"===h?c=0:"right"===h?c=o-s:"center"===h&&(c=(o-s)/2),e.fillRect(i+c,n+.25*r,s,1);else{if("left"===h?c=0:"right"===h?c=o:"center"===h&&(c=o/2),o=null!==zl?zl(this,r):.75*r,e.fillText(t,i+c,n+o),0===(t=r/20|0)&&(t=1),"right"===h?c-=s:"center"===h&&(c-=s/2),l){h=i+c,l=n+(a=null!==Rl?Rl(this,r):.8*r),o=i+c+s,a=n+a;var f=t;e.beginPath(),e.lineWidth=f,e.moveTo(h,l),e.lineTo(o,a),e.stroke(),e.Se(),e instanceof va&&e.ad.classList.add("gojs-td")}u&&(u=n+r-r/2.2|0,0!=t%2&&(u+=.5),n=i+c,r=u,i=i+c+s,s=u,c=t,e.beginPath(),e.lineWidth=c,e.moveTo(n,r),e.lineTo(i,s),e.stroke(),e.Se(),e instanceof va&&e.ad.classList.add("gojs-td"))}},e.kk=function(t,e,i){if(!Ds.prototype.kk.call(this,t,e,i))return!1;if(Us(this,t,this.xc,!0,!1,this.naturalBounds,this.actualBounds),i){if(0===this.svg.getElementsByTagName("text").length)return!0;for(e=this.svg.getElementsByClassName("gojs-td"),i=0;i=this.Qb.length))){for(this.l|=16777216,l=this.Qb[h],e=Math.max(1,t-e);Fl(l)>e&&1t?t=0:1t?t=0:1=(t=Math.floor(t))&&M(t,"> 0",Pl,"maxLines"),Cl(this),this.da.Jq=t,this.v(),this.g("maxLines",e,t))}},metrics:{get:function(){return{arrSize:null!==this.Qc?this.Qc:[this.Cb],arrText:null!==this.Qb?this.Qb:[this.ze],maxLineWidth:this.Cb,fontHeight:this.df}}},choices:{get:function(){return this.Gm},set:function(t){var e=this.Gm;e!==t&&(this.Gm=t,this.g("choices",e,t))}}});var Il,zl=null,Rl=null,El=new V(Pl,"None",0),Vl=new V(Pl,"WrapFit",1),Yl=new V(Pl,"WrapDesiredSize",2),Gl=new V(Pl,"WrapBreakAll",3),Xl=new V(Pl,"OverflowClip",0),Ul=new V(Pl,"OverflowEllipsis",1),ql=new V(Pl,"FormatTrim",0),Hl=new V(Pl,"FormatNone",0),Kl=/[ \u200b\u00ad]/,Wl=new X,Jl=0,Zl=new X,$l=0,_l="...",Ql="",tu=null,eu=!1;function iu(){this.nc=!1,this.Hd=null,this.Xf=fs,this.gq=ql,this.Jq=1/0,this.$q=Xl,this.Er=this.Dr=0,this.Or="start",this.vj=this.Qr=this.Pr=null,this.Yr=Ce,this.$r=Yl}function nu(){this.Tk=1,this.u=0,this.j=1,this.o=this.F=null}function ou(t,e){Ds.call(this),this.Eg=null,this.qo="",this.Xg=Ht,this.Nk=cs,this.Zg=this.Hd=null,this.Mk=oe,this.Xf=fs,this.vl=null,this.qn=!1,this.en=!0,this.al=!1,this.bt=this.rl=null,"string"==typeof t?this.source=t:t&&Object.assign(this,t),e&&Object.assign(this,e)}function ru(t){void 0===t&&(t=""),""!==t?Il[t]&&(delete Il[t],au--):(Il=new X,au=0)}function su(t,e){e.qy||(e.Fq=function(i){e.sq=!0,e.ln=!1;var n=e.Bg.copy();if(null!=n){for(n=n.iterator;n.next();){var o=n.value;o.N();var r=e.getAttribute("src")||"",s=o.Og.I(r);if(null!==s)for(var a=s.length,h=0;h=n.width&&(r=r+p.offsetX+(c*p.x-n.width*p.x)),f>=n.height&&(s=s+p.offsetY+(f*p.y-n.height*p.y)),h=Math.min(n.width,c),a=Math.min(n.height,f);break;case cs:c=n.width,f=n.height;break;case ds:case ys:d===ds?(c*=d=Math.min(n.height/f,n.width/c),f*=d):d===ys&&(f*=d=Math.max(n.height/f,n.width/c),(c*=d)>=n.width&&(r=(r+p.offsetX+(c*p.x-n.width*p.x)/c)*h),f>=n.height&&(s=(s+p.offsetY+(f*p.y-n.height*p.y)/f)*a),h*=1/(c/n.width),a*=1/(f/n.height),c=n.width,f=n.height)}var g=c*(d=this.Df()*e.scale)*f*d,m=h*a/g,y=i.__goCache;d=null;var v=hu;if(!o){if(i.sq&&void 0!==y&&4v*v)for(null===y.gi&&(uu(y,4,l,u,i),uu(y,16,l,u,i)),l=(o=y.gi).length,u=0;ut)&&(t=5),t=Math.min(t,e/3);var n="rr"+e+","+i+","+(t=Math.min(t,i/3)),o=Xe.Mf[n];if(void 0!==o)return o;var r=t*Xe.wg;return o=(new Ue).add(new _e(t,0,!0).add(new Qe(ni,e-t,0)).add(new Qe(oi,e,t,e-r,0,e,r)).add(new Qe(ni,e,i-t)).add(new Qe(oi,e-t,i,e,i-r,e-r,i)).add(new Qe(ni,t,i)).add(new Qe(oi,0,i-t,r,i,0,i-r)).add(new Qe(ni,0,t)).add(new Qe(oi,t,0,0,r,r,0).close())),1o.x&&t.y>o.y&&t.righto.x&&e.y>o.y&&e.right=i.maxSelectionCount)){this.G^=4096;var n=!1;if(null!==i){n=i.skipsUndoManager,i.skipsUndoManager=!0;var o=i.selection;o.ka(),t?o.add(this):o.remove(this),o.freeze()}this.g("isSelected",e,t),this.Wb(),null!==(t=this.selectionChanged)&&t(this),null!==i&&(i.$b(),i.skipsUndoManager=n)}}}},isHighlighted:{get:function(){return 0!=(524288&this.G)},set:function(t){var e=0!=(524288&this.G);if(e!==t){this.G^=524288;var i=this.diagram;null!==i&&((i=i.highlighteds).ka(),t?i.add(this):i.remove(this),i.freeze()),this.g("isHighlighted",e,t),this.N(),null!==(t=this.highlightedChanged)&&t(this)}}},isShadowed:{get:function(){return 0!=(8192&this.G)},set:function(t){var e=0!=(8192&this.G);e!==t&&(this.G^=8192,this.Uc=!0,this.g("isShadowed",e,t),this.N())}},isAnimated:{get:function(){return 0!=(262144&this.G)},set:function(t){var e=0!=(262144&this.G);e!==t&&(this.G^=262144,this.g("isAnimated",e,t))}},highlightedChanged:{get:function(){return null!==this.P?this.P.oq:null},set:function(t){var e=this.highlightedChanged;e!==t&&(Mu(this),this.P.oq=t,this.g("highlightedChanged",e,t))}},selectionObjectName:{get:function(){return null!==this.P?this.P.vr:""},set:function(t){var e=this.selectionObjectName;e!==t&&(Mu(this),this.P.vr=t,this.Ug=null,this.g("selectionObjectName",e,t))}},selectionAdornmentTemplate:{get:function(){return null!==this.P?this.P.tr:null},set:function(t){var e=this.selectionAdornmentTemplate;e!==t&&(Mu(this),this.P.tr=t,this.g("selectionAdornmentTemplate",e,t))}},selectionObject:{get:function(){if(null===this.Ug){var t=this.selectionObjectName;null!==t&&""!==t?(t=this.fb(t),this.Ug=null!==t?t:this):this instanceof wc?(t=this.path,this.Ug=null!==t?t:this):this.Ug=this}return this.Ug}},selectionChanged:{get:function(){return null!==this.P?this.P.ur:null},set:function(t){var e=this.selectionChanged;e!==t&&(Mu(this),this.P.ur=t,this.g("selectionChanged",e,t))}},resizeAdornmentTemplate:{get:function(){return null!==this.P?this.P.fr:null},set:function(t){var e=this.resizeAdornmentTemplate;e!==t&&(Mu(this),this.P.fr=t,this.g("resizeAdornmentTemplate",e,t))}},resizeObjectName:{get:function(){return null!==this.P?this.P.hr:""},set:function(t){var e=this.resizeObjectName;e!==t&&(Mu(this),this.P.hr=t,this.g("resizeObjectName",e,t))}},resizeObject:{get:function(){var t=this.resizeObjectName;return""!==t&&null!==(t=this.fb(t))?t:this}},resizeCellSize:{get:function(){return null!==this.P?this.P.gr:Tt},set:function(t){var e=this.resizeCellSize;e.D(t)||(t=t.J(),Mu(this),this.P.gr=t,this.g("resizeCellSize",e,t))}},rotateAdornmentTemplate:{get:function(){return null!==this.P?this.P.ir:null},set:function(t){var e=this.rotateAdornmentTemplate;e!==t&&(Mu(this),this.P.ir=t,this.g("rotateAdornmentTemplate",e,t))}},rotateObjectName:{get:function(){return null!==this.P?this.P.jr:""},set:function(t){var e=this.rotateObjectName;e!==t&&(Mu(this),this.P.jr=t,this.g("rotateObjectName",e,t))}},rotateObject:{get:function(){var t=this.rotateObjectName;return""!==t&&null!==(t=this.fb(t))?t:this}},rotationSpot:{get:function(){return null!==this.P?this.P.lr:Se},set:function(t){var e=this.rotationSpot;e.D(t)||(t=t.J(),Mu(this),this.P.lr=t,this.g("rotationSpot",e,t))}},text:{get:function(){return this.ec},set:function(t){var e=this.ec;e!==t&&(this.ec=t,this.g("text",e,t))}},containingGroup:{get:function(){return this.Ah},set:function(t){if(this.Zc()){var e=this.Ah;if(e!==t){null===t||this!==t&&!t.Td(this)||(this===t&&w("Cannot make a Group a member of itself: "+this.toString()),w("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+t.toString())),this.C(2);var i=this.diagram;if(null!==e?yc(e,this):this instanceof gc&&null!==i&&i.ai.remove(this),this.Ah=t,null!==t?mc(t,this):this instanceof gc&&null!==i&&i.ai.add(this),this.C(1),null!==i&&i.aa){var n=this.data,o=i.model;if(null!==n&&o.Xj()){var r=o.wa(null!==t?t.data:null);o.mp(n,r)}}if(null!==(n=this.containingGroupChanged)&&(o=!0,null!==i&&(o=i.aa,i.aa=!0),n(this,e,t),null!==i&&(i.aa=o)),this instanceof gc)for(qu(i=new _,this,!0,0,!0),i=i.iterator;i.next();)if((n=i.value)instanceof Ju)for(n=n.linksConnected;n.next();)kc(n.value);if(this instanceof Ju){for(i=this.linksConnected;i.next();)kc(i.value);null!==(i=this.labeledLink)&&kc(i)}this.g("containingGroup",e,t),null!==t&&(null!==(e=t.layer)&&Co(e,-1,t))}}else w("cannot set the Part.containingGroup of a Link or Adornment")}},containingGroupChanged:{get:function(){return null!==this.P?this.P.Kp:null},set:function(t){var e=this.containingGroupChanged;e!==t&&(Mu(this),this.P.Kp=t,this.g("containingGroupChanged",e,t))}},isTopLevel:{get:function(){return!(null!==this.containingGroup||this instanceof Ju&&null!==this.labeledLink)}},layoutConditions:{get:function(){return null!==this.P?this.P.Cq:127},set:function(t){var e=this.layoutConditions;e!==t&&(Mu(this),this.P.Cq=t,this.g("layoutConditions",e,t))}},dragComputation:{get:function(){return null!==this.P?this.P.Up:null},set:function(t){var e=this.dragComputation;e!==t&&(Mu(this),this.P.Up=t,this.g("dragComputation",e,t))}},shadowOffset:{get:function(){return null!==this.P?this.P.zr:rt},set:function(t){var e=this.shadowOffset;e.D(t)||(t=t.J(),Mu(this),this.P.zr=t,this.N(),this.g("shadowOffset",e,t))}},shadowColor:{get:function(){return null!==this.P?this.P.yr:"gray"},set:function(t){var e=this.shadowColor;e!==t&&(Mu(this),this.P.yr=t,this.N(),this.g("shadowColor",e,t))}},shadowBlur:{get:function(){return null!==this.P?this.P.Vg:4},set:function(t){var e=this.shadowBlur;e!==t&&(Mu(this),this.P.Vg=t,this.N(),this.g("shadowBlur",e,t))}}}),ku.prototype.invalidateLayout=ku.prototype.C,ku.prototype.findCommonContainingGroup=ku.prototype.px,ku.prototype.isMemberOf=ku.prototype.Td,ku.prototype.findTopLevelPart=ku.prototype.sz,ku.prototype.findSubGraphLevel=ku.prototype.oz,ku.prototype.ensureBounds=ku.prototype.Va,ku.prototype.getDocumentBounds=ku.prototype.mi,ku.prototype.findObject=ku.prototype.fb,ku.prototype.moveTo=ku.prototype.moveTo,ku.prototype.invalidateAdornments=ku.prototype.Wb,ku.prototype.clearAdornments=ku.prototype.Ej,ku.prototype.removeAdornment=ku.prototype.Jf,ku.prototype.addAdornment=ku.prototype.bh,ku.prototype.findAdornment=ku.prototype.Pj,ku.prototype.updateTargetBindings=ku.prototype.La;var Hu=!1;function Ku(t,e){void 0===t||t instanceof ch||"string"==typeof t?ku.call(this,t):(ku.call(this),t&&(e=t)),this.G&=-257,this.Jg="Adornment",this.ue=null,this.Aw=0,this.Uw=!1,this.j=this.$a=null,e&&Object.assign(this,e)}function Wu(){this.nc=!1,this.Vr=this.gj=this.Eq=this.Dq=null,this.yp=_t,this.er=dc,this.Kr=this.ij=this.Nq=this.Mq=null}function Ju(t,e){void 0===t||t instanceof ch||"string"==typeof t?ku.call(this,t):(ku.call(this),t&&(e=t)),this.U=13,this.Ba=null,this.jb=new Z,this.wc=this.af=this.Yk=null,this.ci=!1,e&&Object.assign(this,e)}function Zu(t){null===t.Ba?t.Ba=new Wu:t.Ba.nc&&(t.Ba=t.Ba.copy())}function $u(t,e){null!==e&&(null===t.af&&(t.af=new _),t.af.add(e))}function _u(t,e,i,n){if(null===e||null===t.af)return null;for(var o=t.af.iterator;o.next();){var r=o.value;if(r.Ds===t&&r.cv===e&&r.Ox===i&&r.Px===n||r.Ds===e&&r.cv===t&&r.Ox===n&&r.Px===i)return r}return null}function Qu(t,e){for(t=t.linksConnected;t.next();){var i=t.value;i.fromPort!==e&&i.toPort!==e||(tc(i.fromPort),tc(i.toPort),i.bb())}}function tc(t){if(null!==t){var e=t.Zn;null!==e&&e.Sl(),null===(e=(t=t.part).containingGroup)||t.isVisible()||tc(e.port)}}function ec(t,e,i,n){if(null!==e&&!i.has(e)){i.add(e);var o=!0,r=t.diagram;null!==r&&(o=r.isTreePathToChildren),e.linksConnected.each((function(r){r.isTreeLink?(o?r.fromNode===e:r.toNode===e)&&ec(t,o?r.toNode:r.fromNode,i,n):n.add(r)}))}}function ic(t,e,i){tc(i);var n=t.jb.contains(e);if(n||t.jb.add(e),!n||e.fromNode===e.toNode){var o=t.linkConnected;if(null!==o){var r=!0,s=t.diagram;null!==s&&(r=s.aa,s.aa=!0),o(t,e,i),null!==s&&(s.aa=r)}}!n&&e.isTreeLink&&(i=e.fromNode,e=e.toNode,null!==i&&null!==e&&i!==e&&(n=!0,null!==(t=t.diagram)&&(n=t.isTreePathToChildren),r=n?i:e,(o=n?e:i).ci||(o.ci=r),!r.isTreeLeaf||null!==t&&t.undoManager.isUndoingRedoing||(n?i===r&&(r.isTreeLeaf=!1):e===r&&(r.isTreeLeaf=!1))))}function nc(t,e,i){tc(i);var n=t.jb.remove(e),o=null;if(n||e.toNode===e.fromNode){var r=t.linkDisconnected;if(o=t.diagram,null!==r){var s=!0;null!==o&&(s=o.aa,o.aa=!0),r(t,e,i),null!==o&&(o.aa=s)}}n&&e.isTreeLink&&(i=!0,null!==o&&(i=o.isTreePathToChildren),t=i?e.toNode:e.fromNode,e=i?e.fromNode:e.toNode,null!==t&&(t.ci=!1),null===e||e.isTreeLeaf||(0===e.jb.count?(e.ci=null,null!==o&&o.undoManager.isUndoingRedoing||(e.isTreeLeaf=!0)):oc(e)))}function oc(t){if(t.ci=!1,0!==t.jb.count){var e=!0,i=t.diagram;if(null===i||!i.undoManager.isUndoingRedoing){for(null!==i&&(e=i.isTreePathToChildren),i=t.jb.iterator;i.next();){var n=i.value;if(n.isTreeLink)if(e){if(n.fromNode===t)return void(t.isTreeLeaf=!1)}else if(n.toNode===t)return void(t.isTreeLeaf=!1)}t.isTreeLeaf=!0}}}function rc(t){null===t.wc?t.wc=new dt:t.wc.clear(),t.qm(t,(function(t,e){sc(t,e)})),0===t.wc.count&&t.wc.add("",t)}function sc(t,e){var i=e.portId;null!==i&&null!==t.wc&&t.wc.add(i,e)}function ac(t,e,i){var n=e.portId;if(null!==n&&(null!==t.wc&&t.wc.remove(n),null!==(e=t.diagram)&&i)){for(i=null,t=t.findLinksConnected(n);t.next();)n=t.value,null===i&&(i=A()),i.push(n);if(null!==i){for(t=0;tt&&(t=1);var e=this.diagram;if(null!==e&&!e.Ue){e.Ue=!0;var i=new _;i.add(this),lc(this,i,e.isTreePathToChildren,t,e,this,e.treeCollapsePolicy===ts),e.Ue=!1}},Ju.prototype.expandTree=function(t){void 0===t&&(t=2),2>t&&(t=2);var e=this.diagram;if(null!==e&&!e.Ue){e.Ue=!0;var i=new _;i.add(this),cc(this,i,e.isTreePathToChildren,t,e,this,e.treeCollapsePolicy===ts),e.Ue=!1}},f.Object.defineProperties(Ju.prototype,{portSpreading:{get:function(){return null!==this.Ba?this.Ba.er:dc},set:function(t){var e=this.portSpreading;e!==t&&(Zu(this),this.Ba.er=t,this.g("portSpreading",e,t),null!==(t=this.diagram)&&t.undoManager.isUndoingRedoing||this.Bd())}},avoidable:{get:function(){return 0!=(8&this.U)},set:function(t){var e=0!=(8&this.U);if(e!==t){this.U^=8;var i=this.diagram;null!==i&&Or(i,this),this.g("avoidable",e,t)}}},avoidableMargin:{get:function(){return null!==this.Ba?this.Ba.yp:_t},set:function(t){"number"==typeof t&&(t=new Wt(t));var e=this.avoidableMargin;if(!e.D(t)){t=t.J(),Zu(this),this.Ba.yp=t;var i=this.diagram;null!==i&&Or(i,this),this.g("avoidableMargin",e,t)}}},linksConnected:{get:function(){return this.jb.iterator}},linkConnected:{get:function(){return null!==this.Ba?this.Ba.Dq:null},set:function(t){var e=this.linkConnected;e!==t&&(Zu(this),this.Ba.Dq=t,this.g("linkConnected",e,t))}},linkDisconnected:{get:function(){return null!==this.Ba?this.Ba.Eq:null},set:function(t){var e=this.linkDisconnected;e!==t&&(Zu(this),this.Ba.Eq=t,this.g("linkDisconnected",e,t))}},linkValidation:{get:function(){return null!==this.Ba?this.Ba.gj:null},set:function(t){var e=this.linkValidation;e!==t&&(Zu(this),this.Ba.gj=t,this.g("linkValidation",e,t))}},isLinkLabel:{get:function(){return null!==this.Yk}},labeledLink:{get:function(){return this.Yk},set:function(t){var e=this.Yk;if(e!==t){var i=this.diagram,n=this.data;if(null!==e){if(null!==e.wd&&(e.wd.remove(this),e.v()),null!==i&&null!==n&&!i.undoManager.isUndoingRedoing){var o=e.data,r=i.model;if(null!==o&&r.ri()){var s=r.wa(n);void 0!==s&&r.Qx(o,s)}}this.containingGroup=null}this.Yk=t,null!==t&&(Mc(t,this),null===i||null===n||i.undoManager.isUndoingRedoing||(o=t.data,i=i.model,null!==o&&i.ri()&&(void 0!==(n=i.wa(n))&&i.Bu(o,n))),this.containingGroup=t.containingGroup),Hs(this),this.g("labeledLink",e,t)}}},port:{get:function(){return this.ns("")}},ports:{get:function(){return null===this.wc&&rc(this),this.wc.iteratorValues}},isTreeExpanded:{get:function(){return 0!=(1&this.U)},set:function(t){var e=0!=(1&this.U);if(e!==t){this.U^=1;var i=this.diagram;if(this.g("isTreeExpanded",e,t),null!==(e=this.treeExpandedChanged)){var n=!0;null!==i&&(n=i.aa,i.aa=!0),e(this),null!==i&&(i.aa=n)}null!==i&&i.undoManager.isUndoingRedoing?this.Zb(t):t?this.expandTree():this.collapseTree()}}},wasTreeExpanded:{get:function(){return 0!=(2&this.U)},set:function(t){var e=0!=(2&this.U);e!==t&&(this.U^=2,this.g("wasTreeExpanded",e,t))}},treeExpandedChanged:{get:function(){return null!==this.Ba?this.Ba.Vr:null},set:function(t){var e=this.treeExpandedChanged;e!==t&&(Zu(this),this.Ba.Vr=t,this.g("treeExpandedChanged",e,t))}},isTreeLeaf:{get:function(){return 0!=(4&this.U)},set:function(t){var e=0!=(4&this.U);e!==t&&(this.U^=4,this.g("isTreeLeaf",e,t))}}}),Ju.prototype.expandTree=Ju.prototype.expandTree,Ju.prototype.collapseTree=Ju.prototype.collapseTree,Ju.prototype.findTreeParts=Ju.prototype.wz,Ju.prototype.findTreeChildrenNodes=Ju.prototype.Ou,Ju.prototype.findTreeChildrenLinks=Ju.prototype.Qo,Ju.prototype.findTreeLevel=Ju.prototype.uz,Ju.prototype.findTreeParentChain=Ju.prototype.vz,Ju.prototype.findTreeParentNode=Ju.prototype.pg,Ju.prototype.findTreeParentLink=Ju.prototype.kh,Ju.prototype.findCommonTreeParent=Ju.prototype.gz,Ju.prototype.findTreeRoot=Ju.prototype.xz,Ju.prototype.isInTreeOf=Ju.prototype.Nz,Ju.prototype.findPort=Ju.prototype.ns,Ju.prototype.findLinksTo=Ju.prototype.kz,Ju.prototype.findLinksBetween=Ju.prototype.jz,Ju.prototype.findNodesInto=Ju.prototype.Oo,Ju.prototype.findNodesOutOf=Ju.prototype.Po,Ju.prototype.findNodesConnected=Ju.prototype.Mu,Ju.prototype.findLinksInto=Ju.prototype.Sd,Ju.prototype.findLinksOutOf=Ju.prototype.Mo,Ju.prototype.findExternalTreeLinksConnected=Ju.prototype.qx,Ju.prototype.invalidateConnectedLinks=Ju.prototype.Bd,Ju.prototype.invalidateLinkBundle=Ju.prototype.Lz;var fc=new V(Ju,"SpreadingNone",10),dc=new V(Ju,"SpreadingEvenly",11),pc=new V(Ju,"SpreadingPacked",12);function gc(t,e){void 0===t||t instanceof ch||"string"==typeof t?Ju.call(this,t):(Ju.call(this),t&&(e=t)),this.U|=4608,this.Gn=new _,this.$a=null,this.Sc=new Ff,this.Sc.group=this,this.gl=new _,this.tb=this.$p=null,e&&Object.assign(this,e)}function mc(t,e){if(t.Gn.add(e)){e instanceof gc&&t.gl.add(e);var i=t.memberAdded;if(null!==i){var n=!0,o=t.diagram;null!==o&&(n=o.aa,o.aa=!0),i(t,e),null!==o&&(o.aa=n)}t.isVisible()&&t.isSubGraphExpanded||e.Zb(!1)}e instanceof wc&&!t.computesBoundsIncludingLinks||(null===(e=t.$a)&&(e=t),e.v())}function yc(t,e){if(t.Gn.remove(e)){e instanceof gc&&t.gl.remove(e);var i=t.memberRemoved;if(null!==i){var n=!0,o=t.diagram;null!==o&&(n=o.aa,o.aa=!0),i(t,e),null!==o&&(o.aa=n)}t.isVisible()&&t.isSubGraphExpanded||e.Zb(!0)}e instanceof wc&&!t.computesBoundsIncludingLinks||(null===(e=t.$a)&&(e=t),e.v())}function vc(t,e,i,n){for(var o=t.memberParts;o.next();){var r=o.value;if(r.Zb(!1),r instanceof gc&&r.isSubGraphExpanded&&(r.wasSubGraphExpanded=r.isSubGraphExpanded,vc(r,e,i,n)),r instanceof Ju)r.Bd(e),i.Aj(r,n);else if(r instanceof wc)for(r=r.labelNodes;r.next();)r.value.Bd(e)}t.isSubGraphExpanded=!1}function xc(t,e,i,n){for(var o=t.memberParts;o.next();){var r=o.value;if(r.Zb(!0),r instanceof gc&&r.wasSubGraphExpanded&&(r.wasSubGraphExpanded=!1,xc(r,e,i,n)),r instanceof Ju)r.Bd(e),i.Cj(r,n);else if(r instanceof wc)for(r=r.labelNodes;r.next();)r.value.Bd(e)}t.isSubGraphExpanded=!0}function bc(t){Ds.call(this),this.yb=$t,this.ko=new Ot(NaN,NaN,NaN,NaN),t&&Object.assign(this,t)}function wc(t){ku.call(this,Ch.Link),this.Qa=8,this.ef=null,this.ff="",this.uf=this.gn=null,this.vf="",this.uo=null,this.qk=Wc,this.Om=0,this.Qm=Wc,this.Rm=NaN,this.qj=Uc,this.po=.5,this.wd=null,this.Nb=(new Z).freeze(),this.Tg=this.Mg=null,this.ml=new Ot,this.ua=new Ue,this.u=this.o=this.Sf=this.Wf=null,this.su=new pt,this.cq=this.Mw=this.Lw=null,this.vt=NaN,this.ba=null,this.j=[],t&&Object.assign(this,t)}function kc(t){var e=t.fromNode,i=t.toNode,n=null;if(n=null!==e?null!==i?e.px(i):e.containingGroup:null!==i?i.containingGroup:null,e=n,(i=t.Ah)!==e){null!==i&&yc(i,t),t.Ah=e,null!==e&&mc(e,t);var o=t.containingGroupChanged;if(null!==o){var r=!0,s=t.diagram;null!==s&&(r=s.aa,s.aa=!0),o(t,i,e),null!==s&&(s.aa=r)}!t.fd||t.Lw!==i&&t.Mw!==i||t.bb()}if(t.isLabeledLink)for(t=t.labelNodes;t.next();)t.value.containingGroup=n}function Mc(t,e){null===t.wd&&(t.wd=new _),t.wd.add(e),t.v()}function Sc(t,e,i){if(0!==e||0!==i)if(0===t.pointsCount)t.defaultFromPoint&&t.defaultFromPoint.offset(e,i),t.defaultToPoint&&t.defaultToPoint.offset(e,i);else{for(var n=t.fd,o=new Z,r=t.Nb.iterator;r.next();){var s=r.value;o.add(new pt(s.x+e,s.y+i).freeze())}o.freeze(),r=t.Nb,t.Nb=o,s=t.diagram,isNaN(e)||isNaN(i)||null!==s&&s.animationManager.zb?t.v():(t.ke.h(t.ke.x+e,t.ke.y+i),t.pa.h(t.pa.x+e,t.pa.y+i),Hs(t)),n?Nc(t):(t.defaultFromPoint&&(t.defaultFromPoint=t.i(0)),t.defaultToPoint&&(t.defaultToPoint=t.i(t.pointsCount-1))),null!==s&&s.animationManager.zb&&Qn(s.animationManager,t,o),t.g("points",r,o)}}function Nc(t){0===t.Nb.count?t.fd=!1:(t.fd=!0,t.cq=null,t.vt=NaN,t.defaultFromPoint=t.i(0),t.defaultToPoint=t.i(t.pointsCount-1),Rc(t,!1))}function Pc(t,e){return Math.abs(e.x-t.x)>Math.abs(e.y-t.y)?(e.x>=t.x?e.x=t.x+9e9:e.x=t.x-9e9,e.y=t.y):(e.y>=t.y?e.y=t.y+9e9:e.y=t.y-9e9,e.x=t.x),e}function Cc(t,e){var i=e.Zn;return null===i&&((i=new Tf).port=e,i.node=e.part,e.Zn=i),Af(i,t)}function Tc(t){return t===Qt||.5===t.x&&.5===t.y}function Lc(t){return.5===t.x&&.5===t.y?t:oe}function Ac(t){if(null===t.diagram||!t.isAvoiding||!Ar(t.diagram))return!1;var e=t.points.s,i=e.length;if(4>i)return!1;t=jr(t.diagram,!0,t.containingGroup,null);for(var n=1;nSf&&mf(e,u,c)!==l-1&&(mf(e,i-a,n)===l-1?(o=180,u=i-a,c=n):mf(e,i+a,n)===l-1?(o=0,u=i+a,c=n):mf(e,i,n-h)===l-1?(o=270,u=i,c=n-h):mf(e,i,n+h)===l-1&&(o=90,u=i,c=n+h));l>Sf&&mf(e,u,c)===l-1;)i=u,n=c,0===o?u+=a:90===o?c+=h:180===o?u-=a:c-=h,--l;r?l>Sf&&(180===o||0===o?i=Math.floor(i/a)*a+a/2:90!==o&&270!==o||(n=Math.floor(n/h)*h+h/2)):(i=Math.floor(i/a)*a+a/2,n=Math.floor(n/h)*h+h/2),l>Sf&&(r=o,s=i,u=n,0===o?(r=90,u+=h):90===o?(r=180,s-=a):180===o?(r=270,u-=h):270===o&&(r=0,s+=a),mf(e,s,u)===l-1?jc(t,e,s,u,r,!1,r):(s=i,u=n,0===o?(r=270,u-=h):90===o?(r=0,s+=a):180===o?(r=90,u+=h):270===o&&(r=180,s-=a),mf(e,s,u)===l-1&&jc(t,e,s,u,r,!1,r))),t.yf(i,n)}function Fc(t,e,i,n){return t=i-t,isNaN(t)||1/0===t||-1/0===t?NaN:(0>t&&(t=-t),e=n-e,isNaN(e)||1/0===e||-1/0===e?NaN:(0>e&&(e=-e),Xe.$(t,0)?e:Xe.$(e,0)?t:Math.sqrt(t*t+e*e)))}function Dc(t,e,i,n){var o=t.pointsCount;if(2>o)return e;if(i){var r=t.i(1);if(i=r.x-n.x,r=r.y-n.y,0===(n=Fc(e.x,e.y,i,r)))return e;o=2===o?.5*n:n,(t=t.computeShortLength(!0))>o&&(t=o),o=t*(r-e.y)/n,e.x+=t*(i-e.x)/n,e.y+=o}else{if(i=(r=t.i(o-2)).x-n.x,r=r.y-n.y,0===(n=Fc(e.x,e.y,i,r)))return e;o=2===o?.5*n:n,(t=t.computeShortLength(!1))>o&&(t=o),o=t*(e.y-r)/n,e.x-=t*(e.x-i)/n,e.y-=o}return e}function Oc(t,e,i,n){for(var o=t.pointsCount,r=e;Xe.$(e.x,r.x)&&Xe.$(e.y,r.y);){if(i>=o)return o-1;r=t.i(i++)}if(!Xe.$(e.x,r.x)&&!Xe.$(e.y,r.y))return i-1;for(var s=r;Xe.$(e.x,r.x)&&Xe.$(r.x,s.x)&&(!n||(e.y>=r.y?r.y>=s.y:r.y<=s.y))||Xe.$(e.y,r.y)&&Xe.$(r.y,s.y)&&(!n||(e.x>=r.x?r.x>=s.x:r.x<=s.x));){if(i>=o)return o-1;s=t.i(i++)}return i-2}function Bc(t,e,i,n,o,r,s){if(!s&&zc(t)){var a=(s=t.computeJumpLength())/2,h=[],l=0;if(t.isVisible()&&(l=function(t,e,i,n){var o=t.diagram;if(null===o||e.D(i))return 0;for(o=o.layers;o.next();){var r=o.value;if(null!==r&&r.visible)for(var s=(r=r.Pa.s).length,a=0;ac-s;)l--,c=Math.max(u-a,r.x);u=r.y-s+n,c+=i,d=r.y+n,t.curve===Zc?du(e,c,d,!1):gu(e,f,u,c,u,c,d)}else if(Xe.B(o.x,r.x))if(o.yu-s;)l--,u=Math.max(c-a,r.y);c=r.x-s+i,d=r.x+i,u+=n,t.curve===Zc?du(e,d,u,!1):gu(e,c,f,c,u,d,u)}}e.lineTo(r.x+i,r.y+n)}function Ic(t,e,i,n){for(var o=Xe.B(t.y,e.y),r=n.pointsCount,s=n.i(0),a=pt.alloc(),h=1;hs.x&&u.x>=l.x||l.xs.y&&u.y>=l.y||l.ys&&Math.min(p,g)u&&!Xe.B(p,g)){a.x=u,a.y=s,u=!0;break t}}else if(Xe.B(c,d)&&Xe.B(p,g)&&Math.min(u,f)p&&Math.min(s,m)c&&!Xe.B(s,m)){a.x=p,a.y=c,u=!0;break t}a.x=0,a.y=0,u=!1}u&&(o?i.push(a.x):i.push(a.y)),s=l}pt.free(a)}function zc(t){return(t=t.curve)===$c||t===Zc}function Rc(t,e){(e||zc(t))&&(null===(e=t.diagram)||e.animationManager.isTicking||e.Eh.contains(t)||0===t.ml.width&&0===t.ml.height||e.Eh.add(t,t.ml.copy()))}function Ec(t,e,i){if(null!==e&&e.lk&&e.fd&&zc(e)){var n=e.routeBounds;n.w()&&(t.routeBounds.Yc(n)||i.Yc(n))&&(t.usesSamePort(e)||e.qc())}}function Vc(t){var e=t.ef;if(null!==e){var i=t.uf;if(null!==i&&isNaN(t.curviness)){for(var n=t.ff,o=t.vf,r=t=null,s=e.jb.s,a=s.length,h=0;ho&&(o=a.right),a.bottom>r&&(r=a.bottom)}}return isFinite(i)&&isFinite(n)?t.h(i,n,o-i,r-n):(e=e.location,t.h(e.x,e.y,0,0)),t},f.Object.defineProperties(bc.prototype,{padding:{get:function(){return this.yb},set:function(t){"number"==typeof t&&(t=new Wt(t));var e=this.yb;e.D(t)||(this.yb=t=t.J(),this.g("padding",e,t),this.v())}}}),bc.className="Placeholder",c(wc,ku),wc.prototype.cloneProtected=function(t){ku.prototype.cloneProtected.call(this,t),t.Qa=-113&this.Qa,t.ff=this.ff,t.gn=this.gn,t.vf=this.vf,t.uo=this.uo,t.qk=this.qk,t.Om=this.Om,t.Qm=this.Qm,t.Rm=this.Rm,t.qj=this.qj,t.po=this.po,null!==this.ba&&(t.ba=this.ba.copy())},(e=wc.prototype).Af=function(t){ku.prototype.Af.call(this,t),this.ff=t.ff,this.vf=t.vf,t.Mg=null,t.bb(),t.Sf=this.Sf;var e=t.fromPort;null!==e&&tc(e),null!==(t=t.toPort)&&tc(t)},e.qb=function(t){t.classType===wc?2==(2&t.value)?this.routing=t:t===Jc||t===Zc||t===$c?this.curve=t:t===_c||t===Qc||t===tf?this.adjusting=t:t!==Uc&&t!==Wc&&w("Unknown Link enum value for a Link property: "+t):ku.prototype.qb.call(this,t)},e.Xc=function(){null===this.ba&&(this.ba=new pa)},e.si=function(){var t=this.fromNode;if(null!==t){var e=t.findVisibleNode();if(null!==e&&(t=e),na(t)||Iu(t))return!1}return null===(t=this.toNode)||(null!==(e=t.findVisibleNode())&&(t=e),!na(t)&&!Iu(t))},e.zv=function(){return!1},e.Av=function(){},e.Zc=function(){return!1},wc.prototype.computeAngle=function(t,e,i){return wc.computeAngle(e,i)},wc.computeAngle=function(t,e){switch(t){default:case Wc:t=0;break;case ef:t=e;break;case nf:t=e+90;break;case of:t=e-90;break;case rf:t=e+180;break;case sf:90<(t=Xe.bp(e))&&270>t&&(t-=180);break;case af:90<(t=Xe.bp(e+90))&&270>t&&(t-=180);break;case hf:90<(t=Xe.bp(e-90))&&270>t&&(t-=180);break;case lf:if(45<(t=Xe.bp(e))&&135>t||225t)return 0;90t&&(t-=180)}return Xe.bp(t)},(e=wc.prototype).oh=function(){var t=this.containingGroup;null!==t&&this.fromNode!==t&&this.toNode!==t&&t.computesBoundsIncludingLinks&&ku.prototype.oh.call(this)},e.To=function(t){var e=this.fromNode;return t===e?this.toNode:e},e.Cz=function(t){var e=this.fromPort;return t===e?this.toPort:e},e.Vo=function(t){if(ku.prototype.Vo.call(this,t),zc(this)&&this.Xo(this.actualBounds),!t){var e=null;null!==(t=this.ef)&&ic(t,this,e=this.fromPort);var i=this.uf;if(null!==i){var n=this.toPort;i===t&&n===e||ic(i,this,n)}Vc(this)}},e.Wo=function(t){if(ku.prototype.Wo.call(this,t),zc(this)&&this.Xo(this.actualBounds),!t){var e=null;null!==(t=this.ef)&&nc(t,this,e=this.fromPort);var i=this.uf;if(null!==i){var n=this.toPort;i===t&&n===e||nc(i,this,n)}Yc(this)}},e.Lj=function(){if(this.fd=!0,null!==this.wd){var t=this.diagram;if(null!==t)for(var e=this.wd.copy().iterator;e.next();)t.remove(e.value)}null!==this.data&&(null!==(t=this.diagram)&&t.partManager.removeDataForLink(this))},wc.prototype.updateRelationshipsFromData=function(){if(null!==this.data){var t=this.diagram;null!==t&&t.partManager.updateRelationshipsFromData(this)}},wc.prototype.move=function(t,e){var i=e?this.location:this.position,n=i.x;isNaN(n)&&(n=0);var o=i.y;for(isNaN(o)&&(o=0),n=t.x-n,o=t.y-o,!0===e?ku.prototype.move.call(this,t,!1):(t=pt.allocAt(i.x+n,i.y+o),ku.prototype.move.call(this,t,!1),pt.free(t)),Sc(this,n,o),t=this.labelNodes;t.next();)i=(e=t.value).position,e.moveTo(i.x+n,i.y+o)},wc.prototype.canRelinkFrom=function(){if(!this.relinkableFrom)return!1;var t=this.layer;return null===t||!!t.allowRelink&&!(null!==(t=t.diagram)&&!t.allowRelink)},wc.prototype.canRelinkTo=function(){if(!this.relinkableTo)return!1;var t=this.layer;return null===t||!!t.allowRelink&&!(null!==(t=t.diagram)&&!t.allowRelink)},wc.prototype.computeMidPoint=function(t){var e=this.pointsCount;if(0===e)return t.assign(st),t;if(1===e)return t.assign(this.i(0)),t;if(2===e){var i=this.i(0),n=this.i(1);return t.h((i.x+n.x)/2,(i.y+n.y)/2),t}if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===Jc))return this.ua.Pu(.5,t),t.add(this.i(0)),i=this.ua.figures.first(),t.offset(-i.startX,-i.startY),t;if(this.computeCurve()===Jc){if(3===e){i=this.i(0),n=this.i(1);var o=this.i(2);return Xe.ax(i.x,i.y,n.x,n.y,n.x,n.y,o.x,o.y,t),t}if(i=3*((n=(e-1)/3|0)/2|0),1==n%2){n=this.i(i),o=this.i(i+1);var r=this.i(i+2);i=this.i(i+3),Xe.ax(n.x,n.y,o.x,o.y,r.x,r.y,i.x,i.y,t)}else t.assign(this.i(i));return t}var s=this.flattenedLengths;for(i=this.flattenedTotalLength,o=r=n=0;ni/2);)n+=o,r++;return e=this.i(r),r=this.i(r+1),1>Math.abs(e.x-r.x)?e.y>r.y?t.h(e.x,e.y-(i/2-n)):t.h(e.x,e.y+(i/2-n)):1>Math.abs(e.y-r.y)?e.x>r.x?t.h(e.x-(i/2-n),e.y):t.h(e.x+(i/2-n),e.y):(i=(i/2-n)/o,t.h(e.x+i*(r.x-e.x),e.y+i*(r.y-e.y))),t},wc.prototype.computeMidAngle=function(){var t=this.pointsCount;if(2>t)return NaN;if(2===t)return this.i(0).ab(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===Jc))return this.ua.wx(.5);if(this.computeCurve()===Jc&&4<=t){var e=(t-1)/3|0,i=3*(e/2|0);if(1==e%2){i=Math.floor(i),t=this.i(i),e=this.i(i+1);var n=this.i(i+2);return i=this.i(i+3),Xe.My(t.x,t.y,e.x,e.y,n.x,n.y,i.x,i.y)}if(0n/2);)r+=o,i++;if(e=this.i(i),n=this.i(i+1),1>Math.abs(e.x-n.x)&&1>Math.abs(e.y-n.y)){if(0Math.abs(e.x-n.x))return e.y>n.y?270:90;if(1>Math.abs(e.y-n.y))return e.x>n.x?180:0}return e.ab(n)},(e=wc.prototype).i=function(t){return this.Nb.s[t]},e.dd=function(t,e){this.Nb.cd(t,e)},e.L=function(t,e,i){this.Nb.cd(t,new pt(e,i))},e.Kz=function(t,e){this.Nb.Gb(t,e)},e.m=function(t,e,i){this.Nb.Gb(t,new pt(e,i))},e.ne=function(t){this.Nb.add(t)},e.yf=function(t,e){this.Nb.add(new pt(t,e))},e.pv=function(t){this.Nb.mb(t)},e.Fj=function(){this.Nb.clear()},e.uh=function(){null===this.Mg&&(this.Mg=this.Nb,this.Nb=this.Nb.copy())},e.zf=function(){if(null!==this.Mg){for(var t=this.Mg,e=this.Nb,i=1/0,n=1/0,o=t.s,r=o.length,s=0;sl&&(c=-c),m=u*((g=(0>h?-1:1)*c+d)-d)+p);var y=d=r.x+2*a/3,v=p=r.y+2*h/3;Xe.B(h,0)?v=0h?-1:1)*c+d)-d)+p,this.Fj(),this.ne(r),this.yf(g,m),this.yf(y,v),this.ne(f),this.dd(0,this.getLinkPoint(t,e,s,!0,!1,n,o)),this.dd(3,this.getLinkPoint(n,o,i,!1,!1,t,e))}else r=n,f=o,n=this.getLinkPoint(t,e,s,!0,!1,r,f),o=this.getLinkPoint(r,f,i,!1,!1,t,e),this.hasCurviness()?(f=o.x-n.x,i=o.y-n.y,s=this.computeCurviness(),r=t=n.x+f/2,a=e=n.y+i/2,Xe.B(i,0)?a=0s&&(r=-r),a=f*((r=(0>i?-1:1)*r+t)-t)+e),this.ne(n),this.yf(r,a),this.ne(o)):(this.ne(n),this.ne(o),a=Ot.alloc(),e.mi(a),h=a.ca(o),f.mi(a),l=a.ca(n),(h||l)&&(s=e.ga(Lc(s),new pt),this.dd(0,this.getLinkPointFromPoint(t,e,s,o,!0,s)),i=f.ga(Lc(i),new pt),this.dd(1,this.getLinkPointFromPoint(r,f,i,n,!1,i))),Ot.free(a))}else{c=this.isAvoiding,f&&(u&&c||l)&&this.Fj();var x=l?this.computeCurviness():0;c=this.getLinkPoint(t,e,s,!0,u,n,o),d=g=p=0,(u||!a||l)&&(m=this.computeEndSegmentLength(t,e,s,!0),d=this.getLinkDirection(t,e,c,s,!0,u,n,o),l&&(a||s.D(i)||!u&&1===s.x+i.x&&1===s.y+i.y)&&(d-=u?90:30,0>x&&(d-=180)),0>d?d+=360:360<=d&&(d-=360),l&&(m+=Math.abs(x)*(u?1:2)),0===d?p=m:90===d?g=m:180===d?p=-m:270===d?g=-m:(p=m*Math.cos(d*Math.PI/180),g=m*Math.sin(d*Math.PI/180)),s.Mc()&&l&&(m=e.ga(oe,pt.alloc()),y=pt.allocAt(m.x+1e3*p,m.y+1e3*g),this.getLinkPointFromPoint(t,e,m,y,!0,c),pt.free(m),pt.free(y))),m=this.getLinkPoint(n,o,i,!1,u,t,e);var b=v=y=0;if(u||!h||l){var w=this.computeEndSegmentLength(n,o,i,!1);b=this.getLinkDirection(n,o,m,i,!1,u,t,e),l&&(h||s.D(i)||!u&&1===s.x+i.x&&1===s.y+i.y)&&(b+=u?0:30,0>x&&(b+=180)),0>b?b+=360:360<=b&&(b-=360),l&&(w+=Math.abs(x)*(u?1:2)),0===b?y=w:90===b?v=w:180===b?y=-w:270===b?v=-w:(y=w*Math.cos(b*Math.PI/180),v=w*Math.sin(b*Math.PI/180)),i.Mc()&&l&&(i=o.ga(oe,pt.alloc()),s=pt.allocAt(i.x+1e3*y,i.y+1e3*v),this.getLinkPointFromPoint(n,o,i,s,!1,m),pt.free(i),pt.free(s))}i=c,(u||!a||l)&&(i=new pt(c.x+p,c.y+g)),s=m,(u||!h||l)&&(s=new pt(m.x+y,m.y+v)),!f&&!u&&a&&3=u.y&&t.y<=u.y+u.height?a.y=t.y:(i.Hf(le)||i.Hf(fe))&&t.x>=u.x&&t.x<=u.x+u.width&&(a.x=t.x),pt.free(h),pt.free(l)}}return a}}return i=e.ga(Lc(i),pt.alloc()),this.pointsCount>(o?6:2)?(s=n?this.i(1):this.i(this.pointsCount-2),o&&(s=Pc(i,s.copy()))):(h=this.computeSpot(!n,s),r=pt.alloc(),s=s.ga(Lc(h),r),o&&(s=Pc(i,s)),pt.free(r)),this.getLinkPointFromPoint(t,e,i,s,n,a),pt.free(i),a},wc.prototype.getLinkDirection=function(t,e,i,n,o,r,s,a){t:if(n.sb())var h=n.x>n.y?n.x>1-n.y?0:n.x<1-n.y?270:315:n.x1-n.y?90:n.x<1-n.y?180:135:.5>n.x?225:.5(r?6:2)?(a=o?this.i(1):this.i(this.pointsCount-2),a=r?Pc(h,a.copy()):i):(i=pt.alloc(),a=a.ga(oe,i),pt.free(i)),i=Math.abs(a.x-h.x)>Math.abs(a.y-h.y)?a.x>=h.x?0:180:a.y>=h.y?90:270,pt.free(h),h=i}return n.Mc()&&s.Td(t)&&(360<=(h+=180)&&(h-=360)),Tc(n)||0===(t=e.li())||(45<=t&&135>t?h+=90:135<=t&&225>t?h+=180:225<=t&&315>t&&(h+=270),360<=h&&(h-=360)),h},wc.prototype.computeEndSegmentLength=function(t,e,i,n){return null!==e&&i.$c()&&null!==(t=Cc(this,e))?t.Ju:(t=n?this.fromEndSegmentLength:this.toEndSegmentLength,null!==e&&isNaN(t)&&(t=n?e.fromEndSegmentLength:e.toEndSegmentLength),isNaN(t)&&(t=10),t)},wc.prototype.computeSpot=function(t,e){return void 0===e&&(e=null),t?null===(t=e||this.fromPort)?t=oe:((e=this.fromSpot).Xb()&&(e=t.fromSpot),t=e===Se?Qt:e):null===(t=e||this.toPort)?t=oe:((e=this.toSpot).Xb()&&(e=t.toSpot),t=e===Se?Qt:e),t},wc.prototype.computeOtherPoint=function(t,e){return this.computeAdjusting()!==Wc&&4f.width||c.y>f.height||0>c.x+c.width||0>c.y+c.height)){if((c=Ye.alloc()).set(s),u instanceof Ch)a=u.Cf(t,e,i,n,o,c);else if(this.path===u){if(u instanceof pl)if(a=t,f=n,!1===u.pickable)a=!1;else if(c.multiply(u.transform),f)t:{var d=a,p=c;if(u.fh(d,p))a=!0;else{if(void 0===p&&(p=u.transform,d.Re(u.actualBounds))){a=!0;break t}a=d.left,f=d.right;var g=d.top;d=d.bottom;var m=pt.alloc(),y=pt.alloc(),v=pt.alloc(),x=Ye.alloc();x.set(p),x.bv(u.transform),x.Vj(),y.x=f,y.y=g,y.transform(x),m.x=a,m.y=g,m.transform(x),p=!1,bl(u,m,y,v)?p=!0:(m.x=f,m.y=d,m.transform(x),bl(u,m,y,v)?p=!0:(y.x=a,y.y=d,y.transform(x),bl(u,m,y,v)?p=!0:(m.x=a,m.y=g,m.transform(x),bl(u,m,y,v)&&(p=!0)))),Ye.free(x),pt.free(m),pt.free(y),pt.free(v),a=p}}else a=u.fh(a,c)}else a=Is(u,t,n,c);a&&(f=u,null!==e&&(f=e(u)),f&&(null===i||i(f))&&o.add(f)),Ye.free(c)}}}return void 0===r&&Ye.free(s),a||null!==this.background||null!==this.areaBackground}return void 0===r&&Ye.free(s),!1},wc.prototype.computeCurve=function(){if(null===this.Wf){var t=this.fromPort,e=this.isOrthogonal;this.Wf=null!==t&&t===this.toPort&&!e}return this.Wf?Jc:this.curve},wc.prototype.computeCorner=function(){if(this.curve===Jc)return 0;var t=this.corner;return(isNaN(t)||0>t)&&(t=10),t},wc.prototype.findMidLabel=function(){for(var t=this.path,e=this.O.s,i=e.length,n=0;nh?-Math.PI/2:Math.PI/2;else u=Math.atan(h/Math.abs(a)),0>a&&(u=Math.PI-u);s=e.x;var c=e.y;a=n.x-s;var f=n.y-c;for(h=Math.sqrt(a*a+f*f),Xe.$(a,0)?f=0>f?-Math.PI/2:Math.PI/2:(f=Math.atan(f/Math.abs(a)),0>a&&(f=Math.PI-f)),l=h/l,u=f-u,this.dd(t,e),t+=1;th?-Math.PI/2:Math.PI/2:(h=Math.atan(h/Math.abs(a)),0>a&&(h=Math.PI-h)),a=h+u,e*=l,this.L(t,s+e*Math.cos(a),c+e*Math.sin(a)));this.dd(i,n)}}return!0;case tf:if(r=this.i(t),c=this.i(i),!r.Xa(e)||!c.Xa(n)){o=r.x,r=r.y,l=((s=c.x)-o)*(s-o)+((c=c.y)-r)*(c-r),a=e.x,u=e.y,h=n.x,f=n.y;var d=1;if(0!=h-a){var p=(f-u)/(h-a);d=Math.sqrt(1+1/(p*p))}else p=9e9;for(this.dd(t,e),t+=1;te?e+=360:360<=e&&(e-=360),0>n?n+=360:360<=n&&(n-=360);var s=n;e=315<=e||45>e?0:45<=e&&135>e?90:135<=e&&225>e?180:270,n=315<=n||45>n?0:45<=n&&135>n?90:135<=n&&225>n?180:270;var a=o.actualBounds.copy(),h=r.actualBounds.copy();if(a.w()&&h.w()){a.Bc(ff,ff),h.Bc(ff,ff),a.Ye(t),h.Ye(i);var l=pt.alloc(),u=pt.alloc();0===e?i.x>t.x||270===n&&i.yt.x||90===n&&i.y>t.y&&h.right>t.x?(l.h(i.x,t.y),u.h(i.x,(t.y+i.y)/2),180===n?(l.x=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!1),u.x=l.x,u.y=i.y):270===n&&i.yt.y?(l.x=t.xh.bottom)?this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!1):h.right,u.x=l.x,u.y=i.y):0===n&&t.xh.top&&t.ya.bottom)&&(180===n&&(h.ca(t)||a.ca(i))?l.y=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!0):i.yt.y&&(180===n||270===n)&&(l.y=this.computeMidOrthoPosition(t.x,a.bottom,i.x,Math.min(i.y,h.top),!0)),u.x=i.x,u.y=l.y),l.y>a.top&&l.y=a.left&&i.x<=t.x||t.x<=h.right&&t.x>=i.x?90!==n&&270!==n||(l.h(Math.max((t.x+i.x)/2,t.x),t.y),u.h(l.x,i.y)):(l.y=270===n||(0===n||180===n)&&i.yt.y&&h.leftt.y?(l.x=t.x>h.right?this.computeMidOrthoPosition(t.x,t.y,h.right,i.y,!1):t.x>h.left&&(270===n&&t.yh.bottom)?this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!1):h.left,u.x=l.x,u.y=i.y):180===n&&t.x>h.right&&t.y>h.top&&t.ya.bottom)&&(0===n&&(h.ca(t)||a.ca(i))?l.y=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!0):i.yt.y&&(0===n||270===n)&&(l.y=this.computeMidOrthoPosition(t.x,a.bottom,i.x,Math.min(i.y,h.top),!0)),u.x=i.x,u.y=l.y),l.y>a.top&&l.y=t.x||t.x>=h.left&&t.x<=i.x?90!==n&&270!==n||(l.h(Math.min((t.x+i.x)/2,t.x),t.y),u.h(l.x,i.y)):(l.y=270===n||(0===n||180===n)&&i.yt.y||180===n&&i.xt.y||0===n&&i.x>t.x&&h.bottom>t.y?(l.h(t.x,i.y),u.h((t.x+i.x)/2,i.y),270===n?(l.y=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!0),u.x=i.x,u.y=l.y):180===n&&i.xt.x?(l.y=t.yh.right)?this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!0):h.bottom,u.x=i.x,u.y=l.y):90===n&&t.yh.left&&t.xa.right)&&(270===n&&(h.ca(t)||a.ca(i))?l.x=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!1):i.xt.x&&(270===n||180===n)&&(l.x=this.computeMidOrthoPosition(a.right,t.y,Math.min(i.x,h.left),i.y,!1)),u.x=l.x,u.y=i.y),l.x>a.left&&l.x=a.top&&i.y<=t.y||t.y<=h.bottom&&t.y>=i.y?0!==n&&180!==n||(l.h(t.x,Math.max((t.y+i.y)/2,t.y)),u.h(i.x,l.y)):(l.x=180===n||(90===n||270===n)&&i.xt.x&&h.top=t.x?(l.y=t.y>h.bottom?this.computeMidOrthoPosition(t.x,t.y,i.x,h.bottom,!0):t.y>h.top&&(180===n&&t.xh.right)?this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!0):h.top,u.x=i.x,u.y=l.y):270===n&&t.y>h.bottom&&t.x>h.left&&t.xa.right)&&(90===n&&(h.ca(t)||a.ca(i))?l.x=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!1):i.xt.x&&(90===n||180===n)&&(l.x=this.computeMidOrthoPosition(a.right,t.y,Math.min(i.x,h.left),i.y,!1)),u.x=l.x,u.y=i.y),l.x>a.left&&l.x=t.y||t.y>=h.top&&t.y<=i.y?0!==n&&180!==n||(l.h(t.x,Math.min((t.y+i.y)/2,t.y)),u.h(i.x,l.y)):(l.x=180===n||(90===n||270===n)&&i.x=Nf&&(yf(d),a.Bc(d.Ho*d.Hx,d.Go*d.Ix),wf(d,t,e,c,n,a,!1),h=mf(d,c.x,c.y)),!d.abort&&hthis.pointsCount?(0===e||180===e?(a.x=t.x,a.y=c.y):(a.x=c.x,a.y=t.y),this.L(2,a.x,a.y),this.m(3,a.x,a.y)):(s=this.i(3),0===e||180===e?Xe.B(a.x,s.x)?(a=0===e?Math.max(a.x,t.x):Math.min(a.x,t.x),this.L(2,a,t.y),this.L(3,a,s.y)):Xe.B(a.y,s.y)?(Math.abs(t.y-a.y)<=d.Go/2&&(this.L(2,a.x,t.y),this.L(3,s.x,t.y)),this.m(2,a.x,t.y)):this.L(2,t.x,a.y):90!==e&&270!==e||(Xe.B(a.y,s.y)?(a=90===e?Math.max(a.y,t.y):Math.min(a.y,t.y),this.L(2,t.x,a),this.L(3,s.x,a)):Xe.B(a.x,s.x)?(Math.abs(t.x-a.x)<=d.Ho/2&&(this.L(2,t.x,a.y),this.L(3,t.x,s.y)),this.m(2,t.x,a.y)):this.L(2,a.x,t.y))),null!==i&&(t=this.i(1),s=this.i(2),t.x!==s.x&&t.y!==s.y?0===e||180===e?this.m(2,t.x,s.y):this.m(2,s.x,t.y):0===e||180===e?this.m(2,o.x,i.y):this.m(2,i.x,o.y)),null!==p&&(0===n||180===n?this.yf(r.x,p.y):this.yf(p.x,r.y)),e=!0):e=!1}}}else e=!1;e||(this.ne(l.copy()),this.ne(u.copy())),pt.free(l),pt.free(u)}},wc.prototype.computeMidOrthoPosition=function(t,e,i,n,o){var r=0;return!this.hasCurviness()||this.computeSpot(!0,this.fromPort).$c()||this.computeSpot(!1,this.toPort).$c()||(r=this.computeCurviness()),o?(e+n)/2+r:(t+i)/2+r},wc.prototype.ez=function(t){var e=t.x;t=t.y;for(var i=this.i(0),n=this.i(1),o=xt(e,t,i.x,i.y,n.x,n.y),r=0,s=1;sthis.pointsCount?this.lk=!0:this.ua=this.makeGeometry(),null!==(t=this.path)){t.ua=this.ua;for(var e=this.O.s,i=e.length,n=0;n=e&&(n=e-1),h=this.i(n),r.x=Math.min(h.x,r.x),r.y=Math.min(h.y,r.y);n=r.x,h=r.y}else{for(h=0;hm?p>d?(r.x=y-x,r.y=d-x,o.x=y+g,o.y=d+g):(r.x=y-x,r.y=d+x,o.x=y+g,o.y=d-g):p>d?(r.x=y+x,r.y=d-x,o.x=y-g,o.y=d+g):(r.x=y+x,r.y=d+x,o.x=y-g,o.y=d-g)),Xe.$(m,y)&&Xe.$(d,p)&&(d>f?(v>y?(r.x=y-x,r.y=d-x,o.x=y+g):(r.x=y+x,r.y=d-x,o.x=y-g),o.y=d+g):(v>y?(r.x=y-x,r.y=d+x,o.x=y+g):(r.x=y+x,r.y=d+x,o.x=y-g),o.y=d-g)),(Xe.$(m,y)&&Xe.$(y,v)||Xe.$(f,d)&&Xe.$(d,p))&&(m=.5*(m+v),f=.5*(f+p),r.x=m,r.y=f,o.x=m,o.y=f),(1===c||2===c&&Xe.$(s.x,this.i(0).x)&&Xe.$(s.y,this.i(0).y))&&(i.x=.5*(s.x+l.x),i.y=.5*(s.y+l.y)),gu(a,i.x-n,i.y-h,r.x-n,r.y-h,l.x-n,l.y-h),e.set(r),i.set(o),s=l}}l=s.x,s=s.y,u=this.i(this.pointsCount-1),0!==this.computeShortLength(!1)&&(u=Dc(this,u.copy(),!1,it)),l=.5*(l+u.x),s=.5*(s+u.y),gu(a,o.x-n,o.y-h,l-n,s-h,u.x-n,u.y-h),pt.free(e),pt.free(i),pt.free(r),pt.free(o)}else for(i=3;i=e&&(i=e-1),o=this.i(i-1),s=this.i(i),i===e-1&&0!==this.computeShortLength(!1)&&(s=Dc(this,s.copy(),!1,it)),gu(a,r.x-n,r.y-h,o.x-n,o.y-h,s.x-n,s.y-h);else{for((r=pt.alloc()).assign(this.i(0)),(o=pt.alloc()).assign(r),s=this.computeCorner(),c=1,l=0;c=e-1){if(r.D(u)){if(0===l)for(c=1;cr.x?f.x-p:f.x+p,v=y.y>f.y?f.y+x:f.y-x,Bc(this,a,c,m,r,y=pt.allocAt(b,w),g),pt.free(y),mu(a,f.x+c,f.y+m,d+c,v+m),r.h(d,v)}else Xe.B(r.x,f.x)&&Xe.B(f.y,y.y)?(p=Math.min(s,Math.abs(f.y-o.y)/2),p=x=Math.min(p,Math.abs(y.x-f.x)/2),Xe.B(x,0)?(Bc(this,a,c,m,r,f,g),r.assign(f)):(d=b=f.x,v=w=f.y,w=f.y>r.y?f.y-p:f.y+p,d=y.x>f.x?f.x+x:f.x-x,Bc(this,a,c,m,r,y=pt.allocAt(b,w),g),pt.free(y),mu(a,f.x+c,f.y+m,d+c,v+m),r.h(d,v))):(Bc(this,a,c,m,r,f,g),r.assign(f));o.assign(u),c=l}pt.free(r)}xu=a}else(a=this.i(1).copy()).x-=n,a.y-=h,0!==this.computeShortLength(!0)&&(o=Dc(this,o,!0,r)),0!==this.computeShortLength(!1)&&(a=Dc(this,a,!1,r)),t.type=Ue.j,t.startX=o.x,t.startY=o.y,t.endX=a.x,t.endY=a.y;return this.lk=!0,t},wc.prototype.computeJumpLength=function(){return 10},wc.prototype.Xo=function(t){var e=this.layer;if(null!==e&&e.visible&&!e.isTemporary){var i=e.diagram;if(null!==i&&!i.animationManager.isTicking){var n=!1;for(i=i.layers;i.next();){var o=i.value;if(o.visible)if(o===e){n=!0;for(var r=!1,s=(o=o.Pa.s).length,a=0;at&&M(t,">= 0",wc,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=t,this.g("fromEndSegmentLength",e,t),this.bb())}},fromShortLength:{get:function(){return null!==this.ba?this.ba.Wi:NaN},set:function(t){var e=this.fromShortLength;e!==t&&(this.Xc(),this.ba.Wi=t,this.qc(),this.g("fromShortLength",e,t))}},toSpot:{get:function(){return null!==this.ba?this.ba.yj:Se},set:function(t){var e=this.toSpot;e.D(t)||(t=t.J(),this.Xc(),this.ba.yj=t,this.g("toSpot",e,t),(e.$c()||t.$c())&&null!==this.toNode&&tc(this.toPort),this.bb())}},toEndSegmentLength:{get:function(){return null!==this.ba?this.ba.wj:NaN},set:function(t){var e=this.toEndSegmentLength;e!==t&&(0>t&&M(t,">= 0",wc,"toEndSegmentLength"),this.Xc(),this.ba.wj=t,this.g("toEndSegmentLength",e,t),this.bb())}},toShortLength:{get:function(){return null!==this.ba?this.ba.xj:NaN},set:function(t){var e=this.toShortLength;e!==t&&(this.Xc(),this.ba.xj=t,this.qc(),this.g("toShortLength",e,t))}},isLabeledLink:{get:function(){return null!==this.wd&&0=n&&(r=n-1);var a=this.i(r-1),h=this.i(r);Xe.Dl(o.x,o.y,s.x,s.y,a.x,a.y,h.x,h.y,.5,t),e=Math.min(h.x,e),i=Math.min(h.y,i),o=h}else for(o=this.i(0),r=this.i(1),e=Math.min(o.x,r.x),i=Math.min(o.y,r.y),t.h(o.x,o.y,0,0),t.Ye(r),o=2;o(n=o.y-n.y)&&(n=-n):Xe.$(n.y,o.y)?0>(n=o.x-n.x)&&(n=-n):n=Math.sqrt(n.Bf(o)),t.push(n)}}return this.cq}},flattenedTotalLength:{get:function(){var t=this.vt;if(isNaN(t)){for(var e=this.flattenedLengths,i=e.length,n=t=0;nthis.pointsCount)return this.lk=!0,this.ua;this.ua=this.makeGeometry()}return this.ua}},firstPickIndex:{get:function(){return 2>=this.pointsCount?0:this.isOrthogonal||!Tc(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var t=this.pointsCount;return 0===t?0:2>=t?t-1:this.isOrthogonal||!Tc(this.computeSpot(!1))?t-2:t-1}},adjusting:{get:function(){return this.qk},set:function(t){var e=this.qk;e!==t&&(this.qk=t,this.g("adjusting",e,t))}},corner:{get:function(){return this.Om},set:function(t){var e=this.Om;e!==t&&(this.Om=t,this.qc(),this.g("corner",e,t))}},curve:{get:function(){return this.Qm},set:function(t){var e=this.Qm;e!==t&&(this.Qm=t,this.bb(),this.qc(),Rc(this,e===Zc||e===$c||t===Zc||t===$c),this.g("curve",e,t))}},curviness:{get:function(){return this.Rm},set:function(t){var e=this.Rm;e!==t&&(this.Rm=t,this.bb(),this.qc(),this.g("curviness",e,t))}},routing:{get:function(){return this.qj},set:function(t){var e=this.qj;e!==t&&(this.qj=t,this.Wf=null,this.bb(),Rc(this,2==(2&e.value)||2==(2&t.value)),this.g("routing",e,t))}},smoothness:{get:function(){return this.po},set:function(t){var e=this.po;e!==t&&(this.po=t,this.qc(),this.g("smoothness",e,t))}},key:{get:function(){var t=this.diagram;if(null!==t&&t.model.ri())return t.model.Ac(this.data)}}}),wc.prototype.invalidateOtherJumpOvers=wc.prototype.Xo,wc.prototype.findClosestSegment=wc.prototype.ez,wc.prototype.updateRoute=wc.prototype.vg,wc.prototype.invalidateRoute=wc.prototype.bb,wc.prototype.rollbackRoute=wc.prototype.rv,wc.prototype.commitRoute=wc.prototype.zf,wc.prototype.startRoute=wc.prototype.uh,wc.prototype.clearPoints=wc.prototype.Fj,wc.prototype.removePoint=wc.prototype.pv,wc.prototype.addPointAt=wc.prototype.yf,wc.prototype.addPoint=wc.prototype.ne,wc.prototype.insertPointAt=wc.prototype.m,wc.prototype.insertPoint=wc.prototype.Kz,wc.prototype.setPointAt=wc.prototype.L,wc.prototype.setPoint=wc.prototype.dd,wc.prototype.getPoint=wc.prototype.i,wc.prototype.getOtherPort=wc.prototype.Cz,wc.prototype.getOtherNode=wc.prototype.To;var Gc=null,Xc=null,Uc=new V(wc,"Normal",1),qc=new V(wc,"Orthogonal",2),Hc=new V(wc,"AvoidsNodes",6),Kc=new V(wc,"AvoidsNodesStraight",7),Wc=new V(wc,"None",0),Jc=new V(wc,"Bezier",9),Zc=new V(wc,"JumpGap",10),$c=new V(wc,"JumpOver",11),_c=new V(wc,"End",17),Qc=new V(wc,"Scale",18),tf=new V(wc,"Stretch",19),ef=new V(wc,"OrientAlong",21),nf=new V(wc,"OrientPlus90",22),of=new V(wc,"OrientMinus90",23),rf=new V(wc,"OrientOpposite",24),sf=new V(wc,"OrientUpright",25),af=new V(wc,"OrientPlus90Upright",26),hf=new V(wc,"OrientMinus90Upright",27),lf=new V(wc,"OrientUpright45",28),uf=16,cf=14,ff=8;function df(t,e,i,n){Q(this),this.Fe=this.qq=!1,this.Ds=t,this.Ox=e,this.cv=i,this.Px=n,this.links=[]}function pf(t){Q(this),this.Yx=this.group=null,this.vs=!0,this.abort=!1,this.Od=this.Nd=1,this.Fn=this.En=-1,this.rc=t.width,this.sc=t.height,this.ac=null,this.ei=this.di=0,this.Os=11,this.Ix=this.Hx=22}function gf(t,e,i){return t.Nd<=e&&e<=t.En&&t.Od<=i&&i<=t.Fn}function mf(t,e,i){return gf(t,e,i)?(e-=t.Nd,e/=t.rc,i-=t.Od,i/=t.sc,t.ac[0|e][0|i]):Pf}function yf(t){if(null!==t.ac)for(var e=0;e<=t.di;e++)for(var i=t.ac[e],n=0;n<=t.ei;n++)i[n]>=Sf&&(i[n]=Pf)}function vf(t,e,i,n,o,r,s,a,h){if(!(es||ih)){var l=0|e,u=0|i,c=t.ac[l][u];if(c>=Sf&&c=t.ac[l][u]);)t.ac[l][u]=c,c+=1,o?u+=n:l+=n;if(l=o?u:l,o)if(0l;i+=n)vf(t,e,i,1,!o,r,s,a,h),vf(t,e,i,-1,!o,r,s,a,h);else if(0l;e+=n)vf(t,e,i,1,!o,r,s,a,h),vf(t,e,i,-1,!o,r,s,a,h)}}function xf(t,e,i,n,o,r,s,a,h){e|=0,i|=0;var l=Mf,u=Sf;for(t.ac[e][i]=u;l===Mf&&e>r&&ea&&ir&&ea&&i=Math.abs(a-l)&&1>=Math.abs(h-u))t.abort=!0;else{var c=r.x;n=r.y,e=r.x+r.width;var f=r.y+r.height;c-=t.Nd,c/=t.rc,n-=t.Od,n/=t.sc,e-=t.Nd,e/=t.rc,f-=t.Od,f/=t.sc,r=Math.max(0,Math.min(t.di,0|c)),e=Math.min(t.di,Math.max(0,0|e)),c=Math.max(0,Math.min(t.ei,0|n)),f=Math.min(t.ei,Math.max(0,0|f)),h|=0,l|=0,u|=0;var d=0===i||90===i?1:-1;if(i=90===i||270===i,(n=t.ac)[a|=0][h]===Mf?(xf(t,a,h,d,i,r,e,c,f),xf(t,a,h,1,!i,r,e,c,f),xf(t,a,h,-1,!i,r,e,c,f)):xf(t,a,h,d,i,a,h,a,h),n[l][u]===Mf?(bf(t,l,u,0===o||90===o?1:-1,90===o||270===o,r,e,c,f),bf(t,l,u,1,!(90===o||270===o),r,e,c,f),bf(t,l,u,-1,!(90===o||270===o),r,e,c,f)):bf(t,l,u,d,i,l,u,l,u),i=A(),s&&kf(t,l,u,o,a,h,i))for(i[0]===l&&i[1]===u||(i.unshift(u),i.unshift(l)),i[i.length-2]===a&&i[i.length-1]===h||(i.push(a),i.push(h)),t=Sf,o=i[i.length-2],s=i[i.length-1],n[o][s]=t++,r=i.length-4;0<=r;r-=2)for(o=i[r+2],s=i[r+3],e=i[r],l=i[r+1];e>o?o++:es?s++:lo))break;u--}else{if(!(c>r))break;c--}var f=a[u][c];if(0===f||f===Cf)break;h=u,l=c}for(;;){if(u=n,c=h,f=l,0===n?fr&&(u=270,f--):90===n?co&&(u=180,c--):180===n?fr&&(u=270,f--):co&&(u=180,c--),c=a[c][f],u!==n&&0!==c&&c!==Cf){if(s.push(h),s.push(l),kf(t,h,l,u,o,r,s))return!0;s.pop(),s.pop()}if(a[h][l]=Cf,0===n){if(h===e)return!1;h--}else if(90===n){if(l===i)return!1;l--}else if(180===n){if(h===e)return!1;h++}else{if(l===i)return!1;l++}}}wc.className="Link",wc.Normal=Uc,wc.Orthogonal=qc,wc.AvoidsNodes=Hc,wc.AvoidsNodesStraight=Kc,wc.None=Wc,wc.Bezier=Jc,wc.JumpGap=Zc,wc.JumpOver=$c,wc.End=_c,wc.Scale=Qc,wc.Stretch=tf,wc.OrientAlong=ef,wc.OrientPlus90=nf,wc.OrientMinus90=of,wc.OrientOpposite=rf,wc.OrientUpright=sf,wc.OrientPlus90Upright=af,wc.OrientMinus90Upright=hf,wc.OrientUpright45=lf,wc.EndSegmentStep=8,wc.CurvinessStart=uf,wc.SpacingMin=cf,wc.OrthoShortCut=ff,df.prototype.Sl=function(){if(!this.qq){var t=this.links;0=t.width||0>=t.height)){var e=t.y,i=t.x+t.width,n=t.y+t.height;if(this.Nd=Math.floor((t.x-this.rc)/this.rc)*this.rc,this.Od=Math.floor((e-this.sc)/this.sc)*this.sc,this.En=Math.ceil((i+2*this.rc)/this.rc)*this.rc,this.Fn=Math.ceil((n+2*this.sc)/this.sc)*this.sc,t=1+(0|Math.ceil((this.En-this.Nd)/this.rc)),e=1+(0|Math.ceil((this.Fn-this.Od)/this.sc)),null===this.ac||this.dithis.En||t+ithis.Fn||e+nt&&(i+=t,t=0),0>e&&(o+=e,e=0),0>i||0>o)return!0;for(n=0|Math.min(t+i-1,this.di),i=0|Math.min(e+o-1,this.ei);t<=n;t++){o=this.ac[t];for(var r=e;r<=i;r++)if(o[r]===Mf)return!1}return!0},f.Object.defineProperties(pf.prototype,{bounds:{get:function(){return new Ot(this.Nd,this.Od,this.En-this.Nd,this.Fn-this.Od)}},Ho:{get:function(){return this.rc},set:function(t){0=i?180:0}switch(t=180*Math.atan2(t.height,t.width)/Math.PI,e){case 3:return i>t&&i<=180+t?180:270;case 5:return i>180-t&&i<=360-t?270:0;case 12:return i>t&&i<=180+t?90:0;case 10:return i>180-t&&i<=360-t?180:90;case 7:return 90180+t&&i<=360-t?270:0;case 13:return 180t&&180>=i?90:0;case 14:return i>t&&i<=180-t?90:i>180-t&&270>=i?180:0;case 11:return i>180-t&&i<=180+t?180:i>180+t?270:90}return n&&15!==e&&(0>(i-=15)&&(i+=360)),i>t&&i<180-t?90:i>=180-t&&i<=180+t?180:i>180+t&&i<360-t?270:0}function Af(t,e){var i=t.pe;if(0===i.length){t:if(!t.ap){i=t.ap,t.ap=!0;var n=null,o=t.node,r=o instanceof gc?o:null;if(null===r||r.isSubGraphExpanded)var s=o.isTreeExpanded?o.findLinksConnected(t.port.portId):o.qx();else{if(!r.actualBounds.w()){t.ap=i;break t}s=(n=r).Lu()}r=t.pe.length=0;var a=t.port.ga(te,pt.alloc()),h=t.port.ga(he,pt.alloc());for((o=Ot.allocAt(a.x,a.y,0,0)).Ye(h),pt.free(a),pt.free(h),a=pt.allocAt(o.x+o.width/2,o.y+o.height/2),h=t.port.li(),s=s.iterator;s.next();){var l=s.value;if(l.isVisible()&&l.fromPort!==l.toPort){var u=l.fromPort===t.port||null!==l.fromNode&&l.fromNode.Td(n),c=l.computeSpot(u,t.port);if(c.$c()&&null!==(u=u?l.toPort:l.fromPort)){var f=u.part;if(null!==f){var d=f.findVisibleNode();null!==d&&d!==f&&(u=(f=d).port),u=l.computeOtherPoint(f,u),f=a.ab(u),0>(f-=h)?f+=360:360<=f&&(f-=360),0===(c=Lf(o,c,f,l.isOrthogonal))?(c=4,180f&&(f+=360)),void 0===(d=t.pe[r])?(d=new jf(l,f,c),t.pe[r]=d):(d.link=l,d.angle=f,d.Nc=c),d.hv.set(u),r++}}}}for(pt.free(a),t.pe.sort(Tf.prototype.j),h=t.pe.length,n=-1,r=a=0;rMath.abs(g)?(v=Math.abs(g)/f,f=Math.abs(g)):v=1;break;case 2:d>Math.abs(x)?(v=Math.abs(x)/d,d=Math.abs(x)):v=1;break;case 1:c>Math.abs(g)?(v=Math.abs(g)/c,c=Math.abs(g)):v=1;break;default:u>Math.abs(x)?(v=Math.abs(x)/u,u=Math.abs(x)):v=1}y=0}var k=b.Zo;if(n===pc){switch(b=b.link.computeThickness(),b*=v,k.set(w),p){case 8:k.x=w.x+g/2+f/2-y-b/2;break;case 2:k.y=w.y+x/2+d/2-y-b/2;break;case 1:k.x=w.x+g/2-c/2+y+b/2;break;default:k.y=w.y+x/2-u/2+y+b/2}y+=b}else{var M=.5;n===dc&&(M=(b.Uo+1)/(b.Gl+1)),k.x=w.x+g*M,k.y=w.y+x*M}}}for(pt.free(a),pt.free(h),pt.free(s),pt.free(l),w=t.pe,r=0;re?1:0:1:null!==e?-1:0}function Gf(t){Q(this),this.nb=t,this.qd=this.kd=this.$k=this.ub=null}function Xf(t){Ff.call(this),this.isViewportSized=!0,this.yo=this.zo=NaN,this.yg=new At(NaN,NaN).freeze(),this.tf=new At(10,10).freeze(),this.Jb=Hf,this.Rb=Kf,this.nd=$f,this.hd=Uf,t&&Object.assign(this,t)}function Uf(t,e){return(t=t.text)<(e=e.text)?-1:t>e?1:0}pf.className="PositionArray",Tf.prototype.toString=function(){for(var t=this.pe,e=this.node.toString()+" "+t.length.toString()+":",i=0;ie.Nc?1:t.anglee.angle?1:0},Tf.prototype.computeEndSegmentLength=function(t){var e=t.link,i=e.computeEndSegmentLength(this.node,this.port,Qt,e.fromPort===this.port),n=t.Uo;if(0>n)return i;var o=t.Gl;if(1>=o||!e.isOrthogonal)return i;e=t.hv;var r=t.Zo;return 2!==t.Nc&&8!==t.Nc||(n=o-1-n),((t=2===t.Nc||4===t.Nc)?e.y=e-1?(r=0,n=i,o+=s+20,s=0):r++}},Ff.prototype.doMinimalNetworkLayout=function(){var t=Math.ceil(Math.sqrt(this.network.vertexes.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);for(var e=this.arrangementOrigin.x,i=e,n=this.arrangementOrigin.y,o=0,r=0,s=this.network.vertexes.iterator;s.next();){var a=s.value.node;if(!(null===a||a instanceof wc)&&(Of(a),this.rh(a))){var h=a.measuredBounds,l=h.width;h=h.height,a.moveTo(i,n),a instanceof gc&&(a.rh=!1),i+=Math.max(l,50)+20,r=Math.max(r,Math.max(h,50)),o>=t-1?(o=0,i=e,n+=r+20,r=0):o++}}},Ff.prototype.rh=function(t){return!(t.location.w()&&!(t instanceof gc&&t.rh))},Ff.prototype.ni=function(t,e){var i=this.boundsComputation;return null!==i?(e||(e=new Ot),i(t,this,e)):e?(e.set(t.actualBounds),e):t.actualBounds},Ff.prototype.ex=function(t){var e=new _;return t instanceof To?(Df(this,e,t.nodes,!0,null,!0,!0,!0),Df(this,e,t.links,!0,null,!0,!0,!0),Df(this,e,t.parts,!0,null,!0,!0,!0)):Df(this,e,t instanceof gc?t.memberParts:t.iterator,!1,null,!0,!0,!0),e},Ff.prototype.initialOrigin=function(t){var e=this.group;if(null!==e){var i=e.position.copy();return(isNaN(i.x)||isNaN(i.y))&&i.set(t),null!==(e=e.placeholder)&&(i=e.ga(te),(isNaN(i.x)||isNaN(i.y))&&i.set(t),t=e.padding,i.x+=t.left,i.y+=t.top),i}return t},f.Object.defineProperties(Ff.prototype,{diagram:{get:function(){return this.H},set:function(t){this.H=t}},group:{get:function(){return this.o},set:function(t){this.o!==t&&(this.o=t,null!==t&&(this.H=t.diagram))}},isOngoing:{get:function(){return this.sn},set:function(t){this.sn!==t&&(this.sn=t)}},isInitial:{get:function(){return this.Gh},set:function(t){this.Gh=t,t||(this.xn=!0)}},isViewportSized:{get:function(){return this.yn},set:function(t){this.yn!==t&&(this.yn=t)&&this.C()}},isRouting:{get:function(){return this.vn},set:function(t){this.vn!==t&&(this.vn=t)}},isRealtime:{get:function(){return this.un},set:function(t){this.un!==t&&(this.un=t)}},isValidLayout:{get:function(){return this.xn},set:function(t){this.xn!==t&&(this.xn=t,t||null!==(t=this.diagram)&&(t.xh=!0))}},network:{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,null!==t&&(t.layout=this))}},boundsComputation:{get:function(){return this.Em},set:function(t){this.Em!==t&&(this.Em=t,this.C())}},arrangementOrigin:{get:function(){return this.Am},set:function(t){this.Am.D(t)||(this.Am.assign(t),this.C())}}}),Ff.prototype.collectParts=Ff.prototype.ex,Ff.prototype.getLayoutBounds=Ff.prototype.ni,Ff.prototype.invalidateLayout=Ff.prototype.C,Ff.className="Layout",Bf.prototype.clear=function(){if(this.wf)for(var t=this.wf.iterator;t.next();)t.value.clear();if(this.ye)for(t=this.ye.iterator;t.next();)t.value.clear();this.wf=new _,this.ye=new _,this.Es=new dt,this.zs=new dt},Bf.prototype.toString=function(t){void 0===t&&(t=0);var e="LayoutNetwork"+(null!==this.layout?"("+this.layout.toString()+")":"");if(0>=t)return e;if(e+=" vertexes: "+this.wf.count+" edges: "+this.ye.count,1=r&&0>=s&&(r=1),e=this.spacing.width,isFinite(e)||(e=0),i=this.spacing.height,isFinite(i)||(i=0),null!==t&&t.Ea("Layout"),n=[],this.alignment){case qf:var a=e,h=i,l=Ot.alloc(),u=Math.max(this.cellSize.width,1);if(!isFinite(u))for(var c=u=0;cr-1||0s)&&(n.push(new Ot(0,g,s+a,y)),m=0,p=d,g+=y,y=0),y=Math.max(y,k),f===Wf)b=-b.width;else b=0;if(x.moveTo(p+b,g),f===Wf)p-=w;else p+=w;m++}n.push(new Ot(0,g,s+a,y)),Ot.free(l);break;case Hf:for(h=s,u=r,c=e,f=i,s=Ot.alloc(),d=Math.max(this.cellSize.width,1),r=g=l=0,a=pt.alloc(),p=0;p=l&&(h-=l),l=x=0,w=Math.max(this.cellSize.height,1),b=r=0,k=!0,m=pt.alloc(),M=0;Mu-1||0h){for(n.push(new Ot(0,k?v-r:v,h+c,b+r+f)),S=0;Sl&&(r.width+=r.x-l,r.x=l);Ot.free(s)}for(a=r=s=o=0;ac)){var g=c+Jh(p);p.pc(g,!0),_h(p,g,c)}}e.isModified=!0}}finally{e.aa=!0}}}}},Qf.prototype.updateAllTargetBindings=function(t){void 0===t&&(t="");for(var e=this.parts.iterator;e.next();)e.value.La(t);for(e=this.nodes.iterator;e.next();)e.value.La(t);for(e=this.links.iterator;e.next();)e.value.La(t)},Qf.prototype.rp=function(){for(var t=this.H.model,e=new _,i=t.nodeDataArray,n=0;n=n)return"[]";var o=new G;o.add("["),i&&1n)return;L(t.Tc,n)}Cd(t,"nodeDataArray",pi,"nodeDataArray",t,e,null,n,null),t.qp(e)}function jd(t,e,i){if(void 0!==e){var n=t.Vf.I(e);null===n&&(n=new _,t.Vf.add(e,n)),n.add(i)}}function Fd(t,e,i){if(void 0!==e){var n=t.Vf.I(e);n instanceof _&&(null==i?t.Vf.remove(e):(n.remove(i),0===n.count&&t.Vf.remove(e)))}}function Dd(t,e){return void 0===e?null:(t=t.Vf.I(e))instanceof _?t:null}function Od(t,e,i){if(t.copiesArrays&&Array.isArray(e)){var n=[];for(i=0;ie&&(e=t.length),T(t,e,i),Cd(this,"",di,"",t,null,i,null,e)},e.ov=function(t,e){void 0===e&&(e=-1),t===this.Tc&&w("Model.removeArrayItem should not be called on the Model.nodeDataArray"),-1===e&&(e=t.length-1);var i=t[e];L(t,e),Cd(this,"",pi,"",t,i,null,e,null)},e.Ro=function(t){if(null===t)return"";var e=this.lj;return""===e||void 0===(e=Rd(t,e))?"":"string"==typeof e?e:void w("getCategoryForNodeData found a non-string category for "+t+": "+e)},e.jm=function(t,e){if(null!==t){var i=this.lj;if(""!==i)if(this.lb(t)){var n=Rd(t,i);void 0===n&&(n=""),n!==e&&(Ed(t,i,e),Cd(this,"nodeCategory",fi,i,t,n,e))}else Ed(t,i,e)}},e.lm=function(t,e){this.jm(e,this.Ro(t))},e.Tl=function(){return!1},e.Wj=function(){return!1},e.ri=function(){return!1},e.xs=function(){return!1},e.Xj=function(){return!1},f.Object.defineProperties(md.prototype,{name:{get:function(){return this.xa},set:function(t){var e=this.xa;e!==t&&(this.xa=t,this.g("name",e,t))}},dataFormat:{get:function(){return this.Sm},set:function(t){var e=this.Sm;e!==t&&(this.Sm=t,this.g("dataFormat",e,t))}},isReadOnly:{get:function(){return this.Gg},set:function(t){var e=this.Gg;e!==t&&(this.Gg=t,this.g("isReadOnly",e,t))}},modelData:{get:function(){return this.j},set:function(t){var e=this.j;e!==t&&(this.j=t,this.g("modelData",e,t),this.La(t))}},undoManager:{get:function(){return this.o},set:function(t){var e=this.o;e!==t&&(null!==e&&e.Rx(this),this.o=t,null!==t&&t.Xw(this))}},skipsUndoManager:{get:function(){return this.Wg},set:function(t){this.Wg=t}},nodeKeyProperty:{get:function(){return this.Th},set:function(t){var e=this.Th;e!==t&&(""===t&&w("Model.nodeKeyProperty may not be the empty string"),0(n=t.md.indexOf(e)))return;t.md.splice(n,1)}if(Cd(t,"linkDataArray",pi,"linkDataArray",t,e,null,n,null),Fd(t,i=Jd(t,e,!0),e),Fd(t,i=Jd(t,e,!1),e),n=t.Ef(e),Array.isArray(n))for(var o=n.length,r=0;rn.indexOf(t.newValue)&&n.splice(i,0,t.newValue)))}else if(t.change===pi){if(i=t.oldParam,"linkDataArray"===t.modelChange)return void(N(t=t.oldValue)&&"number"==typeof i&&(n=this.Ac(t),e?(this.$f.add(t),this.md[i]!==t&&this.md.splice(i,0,t),void 0!==n&&this.wb.add(n,t)):(this.$f.remove(t),this.md[i]===t&&this.md.splice(i,1),void 0!==n&&this.wb.remove(n))));if("linkLabelKeys"===t.modelChange)return n=this.Ef(t.object),void(Array.isArray(n)&&"number"==typeof i&&(e?0>n.indexOf(t.newValue)&&n.splice(i,0,t.newValue):(i=n.indexOf(t.newValue),0<=i&&n.splice(i,1))))}md.prototype.changeState.call(this,t,e)}},(e=Kd.prototype).Vl=function(t){if(void 0!==t){var e=this.Ri;if(null!==e){var i=this.hc(t);null===i&&(Ed(i=this.copyNodeData(e),this.nodeKeyProperty,t),this.xf(i))}return t}},e.yx=function(t){return Jd(this,t,!0)},e.wv=function(t,e){Zd(this,t,e,!0)},e.Bx=function(t){return Jd(this,t,!1)},e.Bv=function(t,e){Zd(this,t,e,!1)},e.zx=function(t){return $d(this,t,!0)},e.xv=function(t,e){_d(this,t,e,!0)},e.Cx=function(t){return $d(this,t,!1)},e.Cv=function(t,e){_d(this,t,e,!1)},e.Ef=function(t){if(null===t)return np;var e=this.je;return""===e||void 0===(t=Rd(t,e))?np:t},e.Ls=function(t,e){if(null!==t){var i=this.je;if(""!==i)if(this.Jc(t)){var n=Rd(t,i);if(void 0===n&&(n=np),n!==e){if(Array.isArray(n))for(var o=n.length,r=0;ro||(n.splice(o,1),this.Jc(t)&&(Fd(this,e,t),Cd(this,"linkLabelKeys",pi,i,t,e,null,o,null)))}else void 0!==n&&w(i+" property is not an Array; cannot removeLabelKeyforLinkData: "+t)}}},e.Ac=function(t){if(null!==t){var e=this.Jh;if(""!==e&&void 0!==(e=Rd(t,e))){if(Td(e))return e;w("Key value for link data "+t+" is not a number or a string: "+e)}}},e.Ks=function(t,e){if(null!==t){var i=this.Jh;if(""!==i)if(this.Jc(t)){var n=Rd(t,i);n!==e&&null===this.jh(e)&&(Ed(t,i,e),void 0!==n&&this.wb.remove(n),this.wb.add(e,t),Cd(this,"linkKey",fi,i,t,n,e),"string"==typeof i&&this.La(t,i))}else Ed(t,i,e)}},e.jh=function(t){return null===t&&w("GraphLinksModel.findLinkDataForKey:key must not be null"),void 0!==t&&Td(t)?this.wb.I(t):null},e.Bs=function(t){if(null!==t){var e=this.Jh;if(""!==e){var i=this.Ac(t);if(void 0===i||this.wb.contains(i)){var n=this.cl;if(null!==n&&(null!=(i=n(this,t))&&!this.wb.contains(i)))return void Ed(t,e,i);if("string"==typeof i){for(n=2;this.wb.contains(i+n);)n++;Ed(t,e,i+n)}else if(void 0===i||"number"==typeof i){for(i=-this.wb.count-1;this.wb.contains(i);)i--;Ed(t,e,i)}}}}},e.Jc=function(t){return null!==t&&this.$f.contains(t)},e.fi=function(t){null!==t&&(tt(t),this.Jc(t)||Qd(this,t,!0))},e.Ey=function(t){if(Array.isArray(t))for(var e=t.length,i=0;ii){for(r=n+(o===wp?r:-r);0>r;)r+=360;180<(r%=360)&&(r-=360),r*=Math.PI/180,t.gt=r,cp(t,e,i,n,o)}else up(t,e,i,n,o);t.Xr.commit(e)}function up(t,e,i,n,o){var r=t.lc,s=t.Ti,a=t.Zm,h=r*Math.cos(n*Math.PI/180),l=t.me*Math.sin(n*Math.PI/180),u=e.Fa();if(3===u.length)u[0].centerX=r,u[0].centerY=0,u[1].centerX=u[0].centerX-u[0].width/2-u[1].width/2-s,u[1].y=u[0].y,u[2].centerX=(u[0].centerX+u[1].centerX)/2,u[2].y=u[0].y-u[2].height-s;else if(4===u.length)u[0].centerX=r,u[0].centerY=0,u[2].centerX=-u[0].centerX,u[2].centerY=u[0].centerY,u[1].centerX=0,u[1].y=Math.min(u[0].y,u[2].y)-u[1].height-s,u[3].centerX=0,u[3].y=Math.max(u[0].y+u[0].height+s,u[2].y+u[2].height+s);else{r=pt.alloc();for(var c=0;c=u.length-1));c++)fp(t,h,l,u,c,o,r)||dp(t,h,l,u,c,o,r),h=r.x,l=r.y;if(pt.free(r),t.mj++,!(23Math.abs(d)?Math.abs(h-r)<(u[0].width+u[u.length-1].width)/2&&(s=0):s=0Math.abs(f)?0:f,h=Math.abs(r)>Math.abs(c)?0c:0t.mj?t.lc-s/(2*Math.PI):5>u.length&&10=c.length-1));f++)fp(t,h,l,c,f,o,u)||dp(t,h,l,c,f,o,u),h=u.x,l=u.y;if(pt.free(u),t.mj++,!(23t.mj?t.lc-r/(2*Math.PI):t.lc-(0a){if((r=e-t)<-a)return s.x=r,s.y=l,!1;u=!0}}else if((r=e-t)<-a){if((r=e+t)>a)return s.x=r,s.y=l,!1;u=!0}return l=Math.sqrt(1-Math.min(1,r*r/(a*a)))*h,0>i!==u&&(l=-l),Math.abs(i-l)>(n[o].height+n[o+1].height)/2?(s.x=r,s.y=l,!1):(s.x=r,s.y=l,!0)}function dp(t,e,i,n,o,r,s){var a=t.lc,h=t.me,l=0;if(t=(n[o].height+n[o+1].height)/2+t.Ti,n=!1,0<=e!=(r===wp)){if((r=i-t)<-h){if((r=i+t)>h)return s.x=l,void(s.y=r);n=!0}}else if((r=i+t)>h){if((r=i-t)<-h)return s.x=l,void(s.y=r);n=!0}l=Math.sqrt(1-Math.min(1,r*r/(h*h)))*a,0>e!==n&&(l=-l),s.x=l,s.y=r}function pp(t,e,i,n,o){var r=t.ty;if(.001>Math.abs(t.Zm-1))return void 0!==n&&void 0!==o?o*e:2*Math.PI*e;t=e>i?Math.sqrt(e*e-i*i)/e:Math.sqrt(i*i-e*e)/i;for(var s=0,a=void 0!==n&&void 0!==o?o/(r+1):Math.PI/(2*(r+1)),h=0,l=0;l<=r;l++){h=void 0!==n&&void 0!==o?n+l*o/r:l*Math.PI/(2*r);var u=Math.sin(h);s+=Math.sqrt(1-t*t*u*u)*a}return void 0!==n&&void 0!==o?(e>i?e:i)*s:4*(e>i?e:i)*s}function gp(t,e,i,n,o){return e/(void 0!==n&&void 0!==o?pp(t,1,i,n,o):pp(t,1,i))}function mp(t,e,i,n,o){if(.001>Math.abs(t.Zm-1))return o/e;var r=e>i?Math.sqrt(e*e-i*i)/e:Math.sqrt(i*i-e*e)/i,s=0;t=2*Math.PI/(700*t.network.vertexes.count),e>i&&(n+=Math.PI/2);for(var a=0;;a++){var h=Math.sin(n+a*t);if((s+=(e>i?e:i)*Math.sqrt(1-r*r*h*h)*t)>=o)return a*t}}Kd.className="GraphLinksModel",Yd.GraphLinksModel=Kd,md.constructGraphLinksModel=md.constructGraphLinksModel=function(){return new Kd},md.initDiagramModel=Bd=function(){return new Kd},c(op,md),op.constructGraphLinksModel=md.constructGraphLinksModel,op.prototype.cloneProtected=function(t){md.prototype.cloneProtected.call(this,t),t.Ke=this.Ke,t.Nm=this.Nm,t.nj=this.nj},(e=op.prototype).toString=function(t){if(void 0===t&&(t=0),2<=t)return this.np();var e=(""!==this.name?this.name:"")+" TreeModel";if(0=(t=this.network.vertexes).count)1===t.count&&((t=t.first()).centerX=0,t.centerY=0);else{var e=new Z;e.addAll(t.iterator),t=new Z;var i,n,o=new Z,r=this.sort(e),s=this.Jp,a=this.arrangement,h=this.nodeDiameterFormula,l=this.radius;(!isFinite(l)||0>=l)&&(l=NaN);var u=this.aspectRatio;(!isFinite(u)||0>=u)&&(u=1);var c=this.startAngle;isFinite(c)||(c=0);var f=this.sweepAngle;if((!isFinite(f)||360f)&&(f=360),e=this.spacing,isFinite(e)||(e=NaN),a===bp&&h===jp?a=yp:a===bp&&h!==jp&&(a=this.arrangement),(this.direction===Mp||this.direction===Sp)&&this.sorting!==Lp){for(h=0;!(h>=r.length)&&(t.add(r.M(h)),!(h+1>=r.length));h+=2)o.add(r.M(h+1));this.direction===Mp?(this.arrangement===bp&&t.reverse(),(r=new Z).addAll(t),r.addAll(o)):(this.arrangement===bp&&o.reverse(),(r=new Z).addAll(o),r.addAll(t))}h=r.length;for(var d=n=i=0;df&&(0===d||d===r.length-1)&&(g/=2),i+=g,n++}if(isNaN(l)||a===bp){if(isNaN(e)&&(e=6),a!==yp&&a!==bp){for(n=-1/0,s=0;sl?n=(l=i)*u:s=d/(360<=f?h:h-1)}if(this.kw=a,this.lc=l,this.Zm=u,this.lw=c,this.Wp=f,this.Ti=e,this.me=n,this.Jp=s,e=r,r=this.kw,a=this.lc,l=this.lw,u=this.Wp,c=this.Ti,f=this.me,h=this.Jp,this.direction!==Mp&&this.direction!==Sp||r!==bp)if(this.direction===Mp||this.direction===Sp){switch(s=0,r){case vp:s=180*mp(this,a,f,l,h)/Math.PI;break;case yp:h=e=0,null!==(s=t.first())&&(e=Bp(s,Math.PI/2)),null!==(s=o.first())&&(h=Bp(s,Math.PI/2)),s=180*mp(this,a,f,l,c+(e+h)/2)/Math.PI;break;case xp:s=u/e.length}if(this.direction===Mp){switch(r){case vp:hp(this,t,l,kp);break;case yp:ap(this,t,l,kp);break;case xp:sp(this,t,u/2,l,kp)}switch(r){case vp:hp(this,o,l+s,wp);break;case yp:ap(this,o,l+s,wp);break;case xp:sp(this,o,u/2,l+s,wp)}}else{switch(r){case vp:hp(this,o,l,kp);break;case yp:ap(this,o,l,kp);break;case xp:sp(this,o,u/2,l,kp)}switch(r){case vp:hp(this,t,l+s,wp);break;case yp:ap(this,t,l+s,wp);break;case xp:sp(this,t,u/2,l+s,wp)}}}else switch(r){case vp:hp(this,e,l,this.direction);break;case yp:ap(this,e,l,this.direction);break;case xp:sp(this,e,u,l,this.direction);break;case bp:lp(this,e,u,l,this.direction)}else lp(this,e,u,l-u/2,wp)}this.updateParts(),this.network=null,this.isValidLayout=!0},rp.prototype.commitLayout=function(){this.commitNodes(),this.isRouting&&this.commitLinks()},rp.prototype.commitNodes=function(){var t=null!==this.group&&null!==this.group.placeholder&&this.group.isSubGraphExpanded,e=t?this.group.location.copy():null,i=this.actualCenter;t?i=new pt(0,0):(i.x=this.arrangementOrigin.x+this.lc,i.y=this.arrangementOrigin.y+this.me);for(var n=this.network.vertexes.iterator;n.next();){var o=n.value;o.x+=i.x,o.y+=i.y,o.commit()}t&&(this.group.Va(),t=this.group.position.copy(),i=this.group.location.copy(),e=e.re(i.re(t)),this.group.move(e),this.Zv=e.re(t))},rp.prototype.commitLinks=function(){for(var t=this.network.edges.iterator;t.next();)t.value.commit()},rp.prototype.sort=function(t){switch(this.sorting){case Np:break;case Pp:t.reverse();break;case Cp:t.sort(this.comparer);break;case Tp:t.sort(this.comparer),t.reverse();break;case Lp:return this.ak(function(t){for(var e=[],i=0;io&&(o=a,r=s)}else for(s=0;so&&(o=a,r=s);for(i.add(t.M(r)),e[r]=-1,s=(r=t.M(r)).sourceEdges;s.next();)0>(o=t.indexOf(s.value.fromVertex))||0<=e[o]&&e[o]++;for(r=r.destinationEdges;r.next();)0>(o=t.indexOf(r.value.toVertex))||0<=e[o]&&e[o]++}return i}(t));default:w("Invalid sorting type.")}return t},rp.prototype.ak=function(t){for(var e=[],i=0;ie[i].indexOf(o)&&e[i].push(o);for(n=n.sourceEdges;n.next();)(o=t.indexOf(n.value.fromVertex))!==i&&0>e[i].indexOf(o)&&e[i].push(o)}for(r=[],i=0;ie[i[p]].indexOf(i[p===i.length-1?0:p+1])&&d.push(p===i.length-1?0:p+1);if(0===d.length)for(p=0;pi.indexOf(k)||wi.indexOf(k)||w=g?w+1:w)))=g&&w++,(x=r[a[v]])>=g&&x++,w>x&&(b=x,x=w,w=b),x-w<(i.length+2)/2==(w(d=i.indexOf(e[l][f]))||d===u||(c+=du?d-u:u-d)>s-p?1:-1);i.splice(0>c?u:u+1,0,h),n.splice(a,1),a--}else r=!1;if(r)break;i.push(n[0]),n.splice(0,1)}for(e=0;e=t?t:360,this.C())}},arrangement:{get:function(){return this.Rb},set:function(t){this.Rb===t||t!==bp&&t!==yp&&t!==vp&&t!==xp||(this.Rb=t,this.C())}},direction:{get:function(){return this.K},set:function(t){this.K===t||t!==wp&&t!==kp&&t!==Mp&&t!==Sp||(this.K=t,this.C())}},sorting:{get:function(){return this.nd},set:function(t){this.nd===t||t!==Np&&t!==Pp&&t!==Cp&&!Tp&&t!==Lp||(this.nd=t,this.C())}},comparer:{get:function(){return this.hd},set:function(t){this.hd!==t&&(this.hd=t,this.C())}},spacing:{get:function(){return this.tf},set:function(t){this.tf!==t&&(this.tf=t,this.C())}},nodeDiameterFormula:{get:function(){return this.Nn},set:function(t){this.Nn===t||t!==Ap&&t!==jp||(this.Nn=t,this.C())}},actualXRadius:{get:function(){return this.lc}},actualYRadius:{get:function(){return this.me}},actualSpacing:{get:function(){return this.Ti}},actualCenter:{get:function(){return this.Zv}}});var yp=new V(rp,"ConstantSpacing",0),vp=new V(rp,"ConstantDistance",1),xp=new V(rp,"ConstantAngle",2),bp=new V(rp,"Packed",3),wp=new V(rp,"Clockwise",4),kp=new V(rp,"Counterclockwise",5),Mp=new V(rp,"BidirectionalLeft",6),Sp=new V(rp,"BidirectionalRight",7),Np=new V(rp,"Forwards",8),Pp=new V(rp,"Reverse",9),Cp=new V(rp,"Ascending",10),Tp=new V(rp,"Descending",11),Lp=new V(rp,"Optimized",12),Ap=new V(rp,"Pythagorean",13),jp=new V(rp,"Circular",14);function Fp(){this.Pl=-1/0,this.tm=this.mk=null}function Dp(t){Bf.call(this,t)}function Op(t){Vf.call(this,t),this.u=this.Si=NaN}function Bp(t,e){var i=t.network;if(null===i)return NaN;if(null===(i=i.layout))return NaN;if(i.arrangement===bp)if(i.nodeDiameterFormula===jp)t.Si=Math.max(t.width,t.height);else{if(i=Math.abs(Math.sin(e)),e=Math.abs(Math.cos(e)),0===i)return t.width;if(0===e)return t.height;t.Si=Math.min(t.height/i,t.width/e)}else t.Si=i.nodeDiameterFormula===jp?Math.max(t.width,t.height):Math.sqrt(t.width*t.width+t.height*t.height);return t.Si}function Ip(t){Gf.call(this,t)}function zp(t){Ff.call(this),this.ah=null,this.An=0,this.$d=new At(100,100).freeze(),this.Bm=!1,this.sf=!0,this.td=!1,this.dl=100,this.$m=1,this.Zf=1e3,this.In=10,this.fo=Math,this.Hk=.05,this.Gk=50,this.Ek=150,this.Fk=0,this.Vm=10,this.Um=5,t&&Object.assign(this,t)}function Rp(t,e,i){if(function(t,e){if(10t.network.vertexes.count)return!1;for(t.ah=t.network.vertexes.Fa(),(t=t.ah).sort((function(t,e){return null===t||null===e||t===e?0:e.Vd-t.Vd})),e=t.length-1;0<=e&&1>=t[e].Vd;)e--;return 1=(s=o.We.M(o.We.count-1).Rs-o.Vd))){for(var l=a=0,u=h.count-s;u(d=u*c)&&(d=1),s=((a=Xe.sqrt((a+d+l*l*4/(s*s))/d))-1)*u/2,a=(a-1)*c/2,o.bounds=new Ot(r-f.x-s,h-f.y-a,u+2*s,c+2*a),o.focus=new pt(f.x+s,f.y+a)}}return t.network=n,i}(t,e),r=Math.max(0,Math.max(Math.min(t.network.vertexes.count,i*(e+1)/11),10));for(t.maxIterations+=r,Rp(t,e+1,i),Gp(t,r),function(t,e){for(var i=t.network.vertexes.iterator;i.next();){var n=i.value;if(n.network=e,null!==n.We){var o=n.We.M(n.sv);n.Vd=o.Rs;var r=o.Sv,s=o.Tv;n.bounds=new Ot(n.centerX-r,n.centerY-s,o.Ss,o.Qs),n.focus=new pt(r,s),n.sv--}}for(i=t.network.edges.iterator;i.next();)i.value.network=e;t.network=e}(t,o),(e=o.vertexes.Fa()).sort((function(t,e){return null===t||null===e||t===e?0:e.Vd-t.Vd})),i=0;i=c.Vd?h++:(a=!0,l++,s+=Math.atan2(e.centerY-c.centerY,e.centerX-c.centerX))}if(0!==h)for(0>1)+l)*(0==a%2?1:-1),h.centerX=n+u*Math.cos(c),h.centerY=o+u*Math.sin(c),a++}}}function Vp(t,e,i,n,o,r,s){var a=9e19,h=-1,l=0;t:for(;lu.y&&t[f].x-u.xu.x&&t[f].y-u.ye+r?(i=n+o-s,t=t-e-r,Xe.sqrt(i*i+t*t)):t+is+a?t>e+r?(i=n-s-a,t=t-e-r,Xe.sqrt(i*i+t*t)):t+ie+r?t-(e+r):t+i=e.length)return!1;var i=e[0];i.forceX=0,i.forceY=0;for(var n=i.centerX,o=n,r=i=i.centerY,s=1;sr-i)?e.sort((function(t,e){return null===t||null===e||t===e?0:t.centerX-e.centerX})):e.sort((function(t,e){return null===t||null===e||t===e?0:t.centerY-e.centerY})),i=t.Zf;var l=n=a=0;for(r=0;ri||l-h>i){if(o)break}else if(u-d>i||d-u>i){if(!o)break}else{var p=Yp(s,f);1>p?(null===(n=t.randomNumberGenerator)&&(t.randomNumberGenerator=n=new Wp),p=n.random(),a=n.random(),h>l?n=(1+(n=Math.abs(f.bounds.right-s.bounds.x)))*p:hd?l=(1+(l=Math.abs(f.bounds.bottom-s.bounds.y)))*a:h(c=Yp(i,r))?(null===(c=t.randomNumberGenerator)&&(t.randomNumberGenerator=c=new Wp),a=c.random(),c=c.random(),n=(n>h?1:-1)*(1+(r.width>i.width?r.width:i.width))*a,l=(s>u?1:-1)*(1+(r.height>i.height?r.height:i.height))*c):(n=(h-n)/c*(a=a.stiffness*(c-a.length)),l=(u-s)/c*a),i.forceX+=n,i.forceY+=l,r.forceX-=n,r.forceY-=l;for(o=n=0;ot.epsilonDistance*t.epsilonDistance}function Up(){this.Tv=this.Sv=this.Qs=this.Ss=this.Rs=0}function qp(t){Bf.call(this,t)}function Hp(t){Vf.call(this,t),this.ia=!1,this.Ha=this.u=NaN,this.sh=this.Vd=this.V=this.F=0,this.We=this.Hj=null,this.sv=0}function Kp(t){Gf.call(this,t),this.j=this.o=NaN}function Wp(){var t=0;void 0===t&&(t=42),this.seed=t,this.ay=48271,this.ey=2147483647,this.Q=44488.07041494893,this.gy=3399,this.by=1/2147483647,this.random()}function Jp(t){Ff.call(this),this.kc=this.ie=25,this.K=0,this.Dk=Fg,this.Zk=Bg,this.Qk=Rg,this.bj=4,this.rk=Gg,this.bg=15,this.sf=!0,this.Cn=4,this.Ra=this.Iq=this.Ia=-1,this.Md=this.Hn=0,this.Ta=this.Kd=this.Ld=this.he=this.tc=null,this.Kn=0,this.Jn=this.kj=null,this.le=0,this.fl=null,this.Rf=new pt,this.He=[],this.He.length=100,this.xw=this.ve=0,t&&Object.assign(this,t)}function Zp(t){var e=t.fromVertex.node||t.fromVertex.data;return t=t.toVertex.node||t.toVertex.data,null===e&&null===t?8:null===e||null===t?4:1}function $p(t){null===t.kj&&(t.kj=[]);for(var e=0,i=t.network.vertexes.iterator;i.next();){var n=i.value;t.kj[e]=n.layer,e++,t.kj[e]=n.column,e++,t.kj[e]=n.index,e++}return t.kj}function _p(t,e){var i=0;for(t=t.network.vertexes.iterator;t.next();){var n=t.value;n.layer=e[i],i++,n.column=e[i],i++,n.index=e[i],i++}}function Qp(t,e,i){var n=Ag(t,e),o=t.tc[e];(null===t.Jn||t.Jn.lengths)for(var c=s+1;cl;c--)(f=n[c]).near===u&&f.Dj===u.Dj||h++;if(0<=i)for(l=n[s].sourceEdgesArrayAccess,u=0;ug||f===g&&d>p)&&h++,mf||g===f&&p>d)&&h++}}}if(0>=i)for(l=n[s].destinationEdgesArrayAccess,u=0;ug||f===g&&c>m)&&h++,pf||g===f&&m>c)&&h++);for(r[s*o+s]=h,l=s+1;l=i)for(h=n[s].destinationEdgesArrayAccess,x=n[l].destinationEdgesArrayAccess,u=0;u=i&&(h=a.sourceEdgesArrayAccess);var l=null;0<=i&&(l=a.destinationEdgesArrayAccess);var u=0,c=0,f=a.near;if(null!==f&&f.layer===a.layer&&(u+=f.column-1,c++),null!==h)for(f=0;f=i&&(h=a.sourceEdgesArrayAccess);var l=null;0<=i&&(l=a.destinationEdgesArrayAccess);var u=0,c=[],f=a.near;if(null!==f&&f.layer===a.layer&&(c[u]=f.column-1,u++),a=void 0,null!==h)for(f=0;f>1,r[s]=0!=(1&u)?c[l]:c[l-1]+c[l]>>1)}return jg(t,e,n),r}function ng(t,e,i,n,o,r){if(e.component===n){if(e.component=i,o)for(var s=e.destinationEdges;s.next();){var a=s.value,h=a.toVertex,l=e.layer-h.layer;l===(a=t.linkMinLength(a))&&ng(t,h,i,n,o,r)}if(r)for(s=e.sourceEdges;s.next();)(l=(h=(a=s.value).fromVertex).layer-e.layer)===(a=t.linkMinLength(a))&&ng(t,h,i,n,o,r)}}function og(t,e,i,n,o,r){if(e.component===n){if(e.component=i,o)for(var s=e.destinationEdges;s.next();)og(t,s.value.toVertex,i,n,o,r);if(r)for(e=e.sourceEdges;e.next();)og(t,e.value.fromVertex,i,n,o,r)}}function rg(t){for(t=t.vertexes.iterator;t.next();){var e=t.value;if(e.valid)return e}return null}function sg(t){for(t=t.vertexes.iterator;t.next();){var e=t.value;if(e.valid){for(var i=!0,n=e.destinationEdges;n.next();)if(n.value.toVertex.valid){i=!1;break}if(i)return e}}return null}function ag(t){for(t=t.vertexes.iterator;t.next();){var e=t.value;if(e.valid){for(var i=!0,n=e.sourceEdges;n.next();)if(n.value.fromVertex.valid){i=!1;break}if(i)return e}}return null}function hg(t,e){e.Ll=t.Kn,t.Kn++;for(var i=e.destinationEdges;i.next();){var n=i.value,o=n.toVertex;-1===o.Ll&&(n.forest=!0,hg(t,o))}e.finish=t.Kn,t.Kn++}function lg(t){for(var e=t.network.vertexes.iterator;e.next();){var i=ug(t,e.value);t.Ia=Math.max(i,t.Ia)}}function ug(t,e){var i=0;if(-1===e.layer){for(var n=e.destinationEdges;n.next();){var o=n.value,r=o.toVertex;o=t.linkMinLength(o),i=Math.max(i,ug(t,r)+o)}e.layer=i}else i=e.layer;return i}function cg(t,e){var i=0;if(-1===e.layer){for(var n=e.sourceEdges;n.next();){var o=n.value,r=o.fromVertex;o=t.linkMinLength(o),i=Math.max(i,cg(t,r)+o)}e.layer=i}else i=e.layer;return i}function fg(t,e){if(!e.valid){e.valid=!0;for(var i=e.destinationEdges;i.next();)fg(t,i.value.toVertex);for(i=t.network.vertexes.iterator;i.next();)i.value.component=-1;for(var n=e.sourceEdgesArrayAccess,o=n.length,r=0;rs&&ng(t,a,0,-1,!0,!1)}for(ng(t,e,1,-1,!0,!0);0!==e.component;){for(r=0,n=1/0,a=0,h=null,s=t.network.vertexes.iterator;s.next();){var l=s.value;if(1===l.component){var u=0,c=!1,f=l.sourceEdgesArrayAccess;o=f.length;for(var d=0;dr)&&!u&&(a=s,r=l)}if(0>n){for(i.reset();i.next();)1===(n=i.value).component&&(n.layer-=o);e.component=0}else a.component=0}}}function dg(t,e,i){return 90===t.K?i&&!e.rev||!i&&e.rev?270:90:180===t.K?i&&!e.rev||!i&&e.rev?0:180:270===t.K?i&&!e.rev||!i&&e.rev?90:270:i&&!e.rev||!i&&e.rev?180:0}function pg(t,e){var i=e.layer;for(e.index=t.tc[i],t.tc[i]++,e=e.destinationEdgesArrayAccess,i=!0;i;){i=!1;for(var n=0;nr.portFromColOffset&&(i=!0,e[n]=r,e[n+1]=o)}}for(i=0;ir.portToColOffset&&(n=!0,e[i]=r,e[i+1]=o)}for(i=0;in+1&&(f+=4*(v-n),d+=4*(v-(n+1)))}for((b=o[n].destinationEdges.iterator).reset();b.next();)if(x=(v=b.value).toVertex,v.valid&&x.layer===e){for(v=0;o[v]!==x;)v++;v===n+1&&(d+=1)}for((b=o[n+1].sourceEdges.iterator).reset();b.next();)if(x=(v=b.value).fromVertex,v.valid&&x.layer===e){for(v=0;o[v]!==x;)v++;vn+1&&(f+=4*(v-(n+1)),d+=4*(v-n))}for((b=o[n+1].destinationEdges.iterator).reset();b.next();)if(x=(v=b.value).toVertex,v.valid&&x.layer===e){for(v=0;o[v]!==x;)v++;v===n&&(f+=1)}v=x=0,b=s[o[n].index];var w=a[o[n].index],k=s[o[n+1].index],M=a[o[n+1].index];-1!==b&&(x+=Math.abs(b-p),v+=Math.abs(b-y)),-1!==w&&(x+=Math.abs(w-p),v+=Math.abs(w-y)),-1!==k&&(x+=Math.abs(k-g),v+=Math.abs(k-m)),-1!==M&&(x+=Math.abs(M-g),v+=Math.abs(M-m)),(di)for(n=0;nn-1||u-o[n-1].column-1>c+t.nodeMinColumnSpace(o[n-1],!1)?u-1:u,c=n+1>=r||o[n+1].column-u-1>f+t.nodeMinColumnSpace(o[n+1],!0)?u+1:u;var p=f=0,g=0;if(0>=i)for(var m=o[n].sourceEdges.iterator;m.next();){var y=m.value,v=y.fromVertex;if(y.valid&&v.layer!==e){var x=Zp(y),b=y.portFromColOffset;y=y.portToColOffset,v=v.column,f+=(Math.abs(u+y-(v+b))+1)*x,p+=(Math.abs(d+y-(v+b))+1)*x,g+=(Math.abs(c+y-(v+b))+1)*x}}if(0<=i)for(m=o[n].destinationEdges.iterator;m.next();)v=(y=m.value).toVertex,y.valid&&v.layer!==e&&(x=Zp(y),b=y.portFromColOffset,y=y.portToColOffset,v=v.column,f+=(Math.abs(u+b-(v+y))+1)*x,p+=(Math.abs(d+b-(v+y))+1)*x,g+=(Math.abs(c+b-(v+y))+1)*x);y=b=x=0,m=s[o[n].index],v=a[o[n].index],-1!==m&&(x+=Math.abs(m-u),b+=Math.abs(m-d),y+=Math.abs(m-c)),-1!==v&&(x+=Math.abs(v-u),b+=Math.abs(v-d),y+=Math.abs(v-c)),p=s[i]?u=h:l<=s[i]&&(u=l));u!==a&&(r=!0,n[i].column=u)}jg(t,e,n),t.normalize()}function wg(t,e){for(var i=!0,n=t.network.vertexes.iterator;n.next();){var o=n.value,r=t.nodeMinColumnSpace(o,!0),s=t.nodeMinColumnSpace(o,!1);if(o.column-r<=e&&o.column+s>=e){i=!1;break}}if(t=!1,i)for(n.reset();n.next();)(i=n.value).column>e&&(--i.column,t=!0);return t}function kg(t,e){var i,n=e+1,o=[],r=[];for(i=0;i<=t.Ia;i++)o[i]=!1,r[i]=!1;for(var s=t.network.vertexes.iterator;s.next();){var a=(i=s.value).column-t.nodeMinColumnSpace(i,!0),h=i.column+t.nodeMinColumnSpace(i,!1);a<=e&&h>=e&&(o[i.layer]=!0),a<=n&&h>=n&&(r[i.layer]=!0)}for(a=!0,n=!1,i=0;i<=t.Ia;i++)a=a&&!(o[i]&&r[i]);if(a)for(s.reset();s.next();)(t=s.value).column>e&&(--t.column,n=!0);return n}function Mg(t,e){for(var i=0;i<=t.Ra;i++)for(;wg(t,i););for(t.normalize(),i=0;ir?_p(t,o):se)for(i=t.Ra;0<=i;i--)for(o=$p(t),n=(r=tg(t))+1;rr?_p(t,o):si)for(n.reset();n.next();)(o=n.value).column+t.nodeMinColumnSpace(o,!1)>=e&&(o.component=t.le);for(t.le++,n.reset();n.next();)-1===(e=n.value).component&&(og(t,e,t.le,-1,!0,!0),t.le++);var r;for(e=[],r=0;ri)for(s=t.Ra;0i)for(n.reset();n.next();)o[(i=n.value).component]&&(i.column+=1)}function Ng(t,e,i,n){for(var r=90===t.K||270===t.K,s=o(e),a=s.next();!a.done;a=s.next()){var h=o(a.value);for(a=h.next();!a.done;a=h.next())(a=a.value).sd=a,a.shift=1/0,a.zc=NaN,a.qg=0}for(a=90===t.K||270===t.K,h=(s=o(e)).next();!h.done;h=s.next())for(var l=(h=o(h.value)).next();!l.done;l=h.next())if((l=l.value).root===l){for(var u=0,c=l;c.align!==l;){var f=c.align,d=a?c.width:c.height,p=a?f.width:f.height;if(i){var g=Jg(c,f),m=g.portFromPos,y=g.portToPos;null!==g.link&&(c.node&&c.node!==g.link.fromNode&&(m=a?c.focusX:c.focusY),f.node&&f.node!==g.link.toNode&&(y=a?f.focusX:f.focusY))}else m=(g=Jg(f,c)).portToPos,y=g.portFromPos,null!==g.link&&(c.node&&c.node!==g.link.toNode&&(m=a?c.focusX:c.focusY),f.node&&f.node!==g.link.fromNode&&(y=a?f.focusX:f.focusY));d=n?c.qg+(d-m)-(p-y):c.qg+m-y,f.qg=d,u=Math.min(u,d),c=c.align}c=l;do{c.qg=c.qg-u,c=c.align}while(c!==l)}for(a=(i=o(e)).next();!a.done;a=i.next())for(a=(s=o(a.value)).next();!a.done;a=s.next())(a=a.value).root===a&&Pg(t,a,e);for(i=0;i=e[i].length)&&(a=e[i][0]).sd===a){1/0===a.sd.shift&&(a.sd.shift=0),a=i,h=0;do{for(s=e[a][h];s.align!==s.root;)a++,0<(s=s.align).vi&&((h=Cg(s,e)).sd.shift=Math.min(h.sd.shift,s.sd.shift+s.zc+s.qg-(h.zc+h.qg+(r?h.width:h.height)+t.columnSpacing)));h=s.vi+1}while(a(t=t.vi)&&w("Could not determine previous vertex in layer"),e[i][t-1]}function Tg(t,e,i,n,o){if(!e||0===e.count)return i[o]=0,n[o]=0,1/0;var r=1/0,s=-1/0;return e.each((function(e){var i=e.key;e=e.value,i=90===t.K||270===t.K?i.width:i.height,es&&(s=e+i)})),i[o]=r,n[o]=s,s-r}function Lg(t,e){return 270===t.K?e?Le:Fe:90===t.K?e?Fe:Le:180===t.K?e?Ae:je:e?je:Ae}function Ag(t,e){var i=t.tc[e];if(i>=t.He.length){for(var n=[],o=0;othis.Pl||Math.abs(t)t&&0a?(o=f.x+f.width/2,r=f.y+f.height/2,l[0]=new pt(f.x+f.width+n.width,f.y),l[1]=new pt(f.x,f.y+f.height+n.height),a=2):(d=new pt((c=l[h=Vp(l,a,o,r,f.width,f.height,n)]).x+f.width+n.width,c.y),f=new pt(c.x,c.y+f.height+n.height),h+1this.network.vertexes.count)return!1;for(var t=0,e=0,i=this.network.vertexes.first().bounds,n=this.network.vertexes.iterator;n.next();){if(n.value.bounds.Yc(i)&&2<++t)return!0;if(10n&&(e=n),i<-n?i=-n:i>n&&(i=n),t.centerX+=e,t.centerY+=i,e*e+i*i},zp.prototype.moveFixedVertex=function(){},zp.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.isRouting&&this.commitLinks()},zp.prototype.yv=function(){if(this.setsPortSpots)for(var t=this.network.edges.iterator;t.next();){var e=t.value.link;null!==e&&(e.fromSpot=Se,e.toSpot=Se)}},zp.prototype.commitNodes=function(){var t=0,e=0;if(this.arrangesToOrigin){var i=Ot.alloc();this.computeBounds(this.network,i),t=(e=this.arrangementOrigin).x-i.x,e=e.y-i.y,Ot.free(i)}i=Ot.alloc();for(var n=this.network.vertexes.iterator;n.next();){var o=n.value;0===t&&0===e||(i.assign(o.bounds),i.x+=t,i.y+=e,o.bounds=i),o.commit()}Ot.free(i)},zp.prototype.commitLinks=function(){for(var t=this.network.edges.iterator;t.next();)t.value.commit()},zp.prototype.springStiffness=function(t){return t=t.stiffness,isNaN(t)?this.Hk:t},zp.prototype.springLength=function(t){return t=t.length,isNaN(t)?this.Gk:t},zp.prototype.electricalCharge=function(t){return t=t.charge,isNaN(t)?this.Ek:t},zp.prototype.electricalFieldX=function(){return 0},zp.prototype.electricalFieldY=function(){return 0},zp.prototype.gravitationalMass=function(t){return t=t.mass,isNaN(t)?this.Fk:t},zp.prototype.gravitationalFieldX=function(){return 0},zp.prototype.gravitationalFieldY=function(){return 0},zp.prototype.isFixed=function(t){return t.isFixed},f.Object.defineProperties(zp.prototype,{currentIteration:{get:function(){return this.An}},arrangementSpacing:{get:function(){return this.$d},set:function(t){this.$d.D(t)||(this.$d.assign(t),this.C())}},arrangesToOrigin:{get:function(){return this.Bm},set:function(t){this.Bm!==t&&(this.Bm=t,this.C())}},setsPortSpots:{get:function(){return this.sf},set:function(t){this.sf!==t&&(this.sf=t,this.C())}},comments:{get:function(){return this.td},set:function(t){this.td!==t&&(this.td=t,this.C())}},maxIterations:{get:function(){return this.dl},set:function(t){this.dl!==t&&0<=t&&(this.dl=t,this.C())}},epsilonDistance:{get:function(){return this.$m},set:function(t){this.$m!==t&&0g&&0g&&0t[this.Md]&&(this.Iq=t[i]-1,this.Md=i),t[i]e.toVertex.index&&(t.gm(e),e.rev=!0);break;case Fg:for(n=this.network.vertexes.iterator;n.next();)(t=n.value).Ll=-1,t.finish=-1;for(t=this.network.edges.iterator;t.next();)t.value.forest=!1;for(this.Kn=0,n.reset();n.next();)0===(e=n.value).sourceEdges.count&&hg(this,e);for(n.reset();n.next();)-1===(e=n.value).Ll&&hg(this,e);for(t.reset();t.next();)(n=t.value).forest||(i=(e=n.fromVertex).finish,r=(o=n.toVertex).finish,o.Lln){if(0>n)for(e.reset();e.next();)e.value.layer-=n;for(n=[],e.reset();e.next();)void 0===(o=n[(i=e.value).layer])?n[i.layer]=[i]:o.push(i);for(i=e=0;i=n;e--)i=yg(this,e,-1)||i;for((a=this.countCrossings())>=r?_p(this,s):(r=a,s=$p(this)),i=!0;i;)for(i=!1,e=t;e>=n;e--)i=yg(this,e,1)||i;for((a=this.countCrossings())>=r?_p(this,s):(r=a,s=$p(this)),i=!0;i;)for(i=!1,e=n;e<=t;e++)i=yg(this,e,1)||i;for(a>=r?_p(this,s):(r=a,s=$p(this)),i=!0;i;)for(i=!1,e=n;e<=t;e++)i=yg(this,e,-1)||i;for(a>=r?_p(this,s):(r=a,s=$p(this)),i=!0;i;)for(i=!1,e=t;e>=n;e--)i=yg(this,e,0)||i;for(a>=r?_p(this,s):(r=a,s=$p(this)),i=!0;i;)for(i=!1,e=n;e<=t;e++)i=yg(this,e,0)||i;a>=r?_p(this,s):(r=a,s=$p(this))}break;default:for(t=this.Ia,n=0,o=r+1;(e=this.countCrossings())=n;e--)i=yg(this,e,-1)||i;for((a=this.countCrossings())>=r?_p(this,s):(r=a,s=$p(this)),i=!0;i;)for(i=!1,e=t;e>=n;e--)i=yg(this,e,1)||i;for((a=this.countCrossings())>=r?_p(this,s):(r=a,s=$p(this)),i=!0;i;)for(i=!1,e=n;e<=t;e++)i=yg(this,e,1)||i;for(a>=r?_p(this,s):(r=a,s=$p(this)),i=!0;i;)for(i=!1,e=n;e<=t;e++)i=yg(this,e,-1)||i;for(a>=r?_p(this,s):(r=a,s=$p(this)),i=!0;i;)for(i=!1,e=t;e>=n;e--)i=yg(this,e,0)||i;for(a>=r?_p(this,s):(r=a,s=$p(this)),i=!0;i;)for(i=!1,e=n;e<=t;e++)i=yg(this,e,0)||i;a>=r?_p(this,s):(r=a,s=$p(this))}}_p(this,s)},Jp.prototype.straightenAndPack=function(){if(0===this.ve){var t=0!=(1&this.bg),e=0!=(this.bg&Ug);if(1e3>1)+8*n;this.Ra*=8}if(0!=(2&this.bg))for(i=!0;i;){for(i=!1,e=this.Md+1;e<=this.Ia;e++)i=vg(this,e,1)||i;for(e=this.Md-1;0<=e;e--)i=vg(this,e,-1)||i;i=vg(this,this.Md,0)||i}if(0!=(4&this.bg)){for(e=this.Md+1;e<=this.Ia;e++)bg(this,e,1);for(e=this.Md-1;0<=e;e--)bg(this,e,-1);bg(this,this.Md,0)}if(t&&(Mg(this,-1),Mg(this,1)),0!=(2&this.bg))for(i=!0;i;){for(i=!1,i=vg(this,this.Md,0)||i,e=this.Md+1;e<=this.Ia;e++)i=vg(this,e,0)||i;for(e=this.Md-1;0<=e;e--)i=vg(this,e,0)||i}}else!function(t){for(var e=A(),i=t.fl.length,n=0;n<=i;n++)e[n]=[];for(n=t.network.vertexes.iterator;n.next();){var r=n.value;e[i-r.layer][r.index]=r}i=new _,function(t,e){for(var i=t.length,n=1;nc)&&e.add(f);s++}r=c}}}(e,i);var s=null,a=null,h=null,l=null,u=0!=(1&t.ve),c=0!=(2&t.ve),f=0!=(4&t.ve),d=0!=(8&t.ve);for(u&&(t.verticalAlignment(e,i,!0),s=Ng(t,e,!0,!1)),e.reverse(),f&&(t.verticalAlignment(e,i,!1),h=Ng(t,e,!1,!1)),n=o(e),r=n.next();!r.done;r=n.next())r.value.reverse();d&&(t.verticalAlignment(e,i,!1),l=Ng(t,e,!1,!0)),e.reverse(),c&&(t.verticalAlignment(e,i,!0),a=Ng(t,e,!0,!0)),j(e),t.u(s,a,h,l),t.network.vertexes.each((function(t){var e=A();u&&e.push(s.get(t)),c&&e.push(a.get(t)),f&&e.push(h.get(t)),d&&e.push(l.get(t)),e.sort((function(t,e){return t-e}));var i=e.length;i=(e[Math.floor((i-1)/2)]+e[Math.ceil((i-1)/2)])/2,j(e),t.zc=i}))}(this)},Jp.prototype.verticalAlignment=function(t,e,i){!function(t){for(var e=0;es;s++)if(e[s]){var a=Tg(this,e[s],n,o,s);as;r={delta:r.delta},s++)e[s]&&(r.delta=0===s||2===s?n[i]-n[s]:o[i]-o[s],0!==r.delta&&e[s].each(function(t){return function(e){e.value+=t.delta}}(r)));j(n),j(o)},Jp.prototype.commitLayout=function(){if(this.setsPortSpots)for(var t=Lg(this,!0),e=Lg(this,!1),i=this.network.edges.iterator;i.next();){var n=i.value.link;null!==n&&(n.fromSpot=t,n.toSpot=e)}this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()},Jp.prototype.commitNodes=function(){this.he=[],this.Ld=[],this.Kd=[],this.Ta=[];for(var t=0;t<=this.Ia;t++)this.he[t]=0,this.Ld[t]=0,this.Kd[t]=0,this.Ta[t]=0;for(t=this.network.vertexes.iterator;t.next();){var e=t.value,i=e.layer;this.he[i]=Math.max(this.he[i],this.nodeMinLayerSpace(e,!0)),this.Ld[i]=Math.max(this.Ld[i],this.nodeMinLayerSpace(e,!1))}e=0,i=this.ie;for(var n=0;n<=this.Ia;n++){var o=i;0>=this.he[n]+this.Ld[n]&&(o=0),0=c.bounds.bottom?(c=c.bounds.y+c.bounds.height,t.m(g++,b,c+k),t.m(g++,b,c),t.m(g++,b,c-x)):(t.m(g++,b,w+k),t.m(g++,b,w),t.m(g++,b,w-x)):270===this.K?w<=c.bounds.y?(c=c.bounds.y,t.m(g++,b,c-x),t.m(g++,b,c),t.m(g++,b,c+k)):(t.m(g++,b,w-x),t.m(g++,b,w),t.m(g++,b,w+k)):0===this.K&&(b>=c.bounds.right?(c=c.bounds.x+c.bounds.width,t.m(g++,c+k,w),t.m(g++,c,w),t.m(g++,c-x,w)):(t.m(g++,b+k,w),t.m(g++,b,w),t.m(g++,b-x,w)));else{t.m(g++,y,v);var M=0;180===this.K||0===this.K?((180===this.K?b>=c.bounds.right:b<=c.bounds.x)&&(M=(0===this.K?-x:k)/2),t.m(g++,y+M,w)):((270===this.K?w>=c.bounds.bottom:w<=c.bounds.y)&&(M=(90===this.K?-x:k)/2),t.m(g++,b,v+M)),t.m(g++,b,w)}}else x=Math.max(10,this.he[m.layer]),k=Math.max(10,this.Ld[m.layer]),f?180===this.K?(t.m(g++,b-x-p,w),t.m(g++,Math.min(b-x+p/2,b),w),t.m(g++,b,w),t.m(g++,b,w),t.m(g++,Math.max(b+k-p/2,b),w),t.m(g++,b+k+p,w)):90===this.K?(t.m(g++,b,w+k+p),t.m(g++,b,Math.max(w+k-p/2,w)),t.m(g++,b,w),t.m(g++,b,w),t.m(g++,b,Math.min(w-x+p/2,w)),t.m(g++,b,w-x-p)):270===this.K?(t.m(g++,b,w-x-p),t.m(g++,b,Math.min(w-x+p/2,w)),t.m(g++,b,w),t.m(g++,b,w),t.m(g++,b,Math.max(w+k-p/2,w)),t.m(g++,b,w+k+p)):(t.m(g++,b+k+p,w),t.m(g++,Math.max(b+k-p/2,b),w),t.m(g++,b,w),t.m(g++,b,w),t.m(g++,Math.min(b-x+p/2,b),w),t.m(g++,b-x-p,w)):t.m(g++,b,w)}c=m}(null===a||l!==Qt||d)&&(y=t.i(g-1).x,v=t.i(g-1).y,b=t.i(g).x,w=t.i(g).y,d?(p=this.Ld[u.layer],180===this.K||0===this.K?((d=v)>=u.bounds.y&&d<=u.bounds.bottom&&(180===this.K?b>=u.bounds.x:b<=u.bounds.right)&&(c=u.centerX+(180===this.K?-p:p),d=d=u.bounds.x&&d<=u.bounds.right&&(270===this.K?w>=u.bounds.y:w<=u.bounds.bottom)&&(c=u.centerY+(270===this.K?-p:p),d=d=u.bounds.x?(c=u.bounds.x+u.bounds.width,t.L(g-2,c,v),t.L(g-1,c+k,v)):90===this.K&&w<=u.bounds.bottom?(c=u.bounds.y,t.L(g-2,y,c),t.L(g-1,y,c-x)):270===this.K&&w>=u.bounds.y?(c=u.bounds.y+u.bounds.height,t.L(g-2,y,c),t.L(g-1,y,c+k)):0===this.K&&b<=u.bounds.right&&(c=u.bounds.x,t.L(g-2,c,v),t.L(g-1,c-x,v))):(x=Math.max(10,this.he[u.layer]),k=Math.max(10,this.Ld[u.layer]),d=0,180===this.K||0===this.K?((180===this.K?b<=u.bounds.x:b>=u.bounds.right)&&(d=(0===this.K?k:-x)/2),t.m(g++,b+d,v)):((270===this.K?w<=u.bounds.y:w>=u.bounds.bottom)&&(d=(90===this.K?k:-x)/2),t.m(g++,y,w+d)),t.m(g++,b,w)))}else{for(;null!==u&&u!==c;){for(x=m=null,u=u.destinationEdges.iterator;u.next()&&((y=u.value).link!==i.link||(m=y.toVertex,null!==(x=y.fromVertex).node&&(x=null),null!==m.node)););if(null===m)break;m!==c&&(y=t.i(g-1).x,v=t.i(g-1).y,b=m.centerX,w=m.centerY,d?180===this.K||0===this.K?(null!==x?x.centerY:v)!==w&&(x=this.Ta[m.layer]+this.Rf.x,g===t.firstPickIndex+1&&(x=0===this.K?Math.max(x,y):Math.min(x,y)),t.m(g++,x,v),t.m(g++,x,w)):(null!==x?x.centerX:y)!==b&&(x=this.Ta[m.layer]+this.Rf.y,g===t.firstPickIndex+1&&(x=90===this.K?Math.max(x,v):Math.min(x,v)),t.m(g++,y,x),t.m(g++,b,x)):(x=Math.max(10,this.he[m.layer]),k=Math.max(10,this.Ld[m.layer]),f?180===this.K?(t.m(g++,b+k+p,w),t.m(g++,Math.max(b+k-p/2,b),w),t.m(g++,b,w),t.m(g++,b,w),t.m(g++,Math.min(b-x+p/2,b),w),t.m(g++,b-x-p,w)):90===this.K?(t.m(g++,b,w-x-p),t.m(g++,b,Math.min(w-x+p/2,w)),t.m(g++,b,w),t.m(g++,b,w),t.m(g++,b,Math.max(w+k-p/2,w)),t.m(g++,b,w+k+p)):270===this.K?(t.m(g++,b,w+k+p),t.m(g++,b,Math.max(w+k-p/2,w)),t.m(g++,b,w),t.m(g++,b,w),t.m(g++,b,Math.min(w-x+p/2,w)),t.m(g++,b,w-x-p)):(t.m(g++,b-x-p,w),t.m(g++,Math.min(b-x+p/2,b),w),t.m(g++,b,w),t.m(g++,b,w),t.m(g++,Math.max(b+k-p/2,b),w),t.m(g++,b+k+p,w)):180===this.K?(t.m(g++,b+k,w),t.m(g++,b-x,w)):90===this.K?(t.m(g++,b,w-x),t.m(g++,b,w+k)):270===this.K?(t.m(g++,b,w+k),t.m(g++,b,w-x)):(t.m(g++,b-x,w),t.m(g++,b+k,w)))),u=m}d&&(y=t.i(g-1).x,v=t.i(g-1).y,b=t.i(g).x,w=t.i(g).y,180===this.K||0===this.K?v!==w&&(x=0===this.K?Math.min(Math.max((b+y)/2,this.Ta[c.layer]+this.Rf.x),b):Math.max(Math.min((b+y)/2,this.Ta[c.layer]+this.Rf.x),b),t.m(g++,x,v),t.m(g++,x,w)):y!==b&&(x=90===this.K?Math.min(Math.max((w+v)/2,this.Ta[c.layer]+this.Rf.y),w):Math.max(Math.min((w+v)/2,this.Ta[c.layer]+this.Rf.y),w),t.m(g++,y,x),t.m(g++,b,x)))}null!==n&&f&&4<=t.pointsCount&&(null!==s&&(s=l===Qt?t.getLinkPointFromPoint(o,s,s.ga(oe),t.i(3),!0):t.i(0),l===Qt&&(l=t.i(2),n=t.i(3),90===this.direction||270===this.direction?(t.L(1,(s.x+l.x)/2,l.y),t.L(2,n.x,(l.y+n.y)/2)):(t.L(1,l.x,(s.y+l.y)/2),t.L(2,(l.x+n.x)/2,n.y))),s.w()||s.set(o.actualBounds.center),t.L(0,s.x,s.y)),null!==a&&(o=h===Qt?t.getLinkPointFromPoint(r,a,a.ga(oe),t.i(t.pointsCount-4),!1):t.i(t.pointsCount-1),h===Qt&&(a=t.i(t.pointsCount-3),h=t.i(t.pointsCount-4),90===this.direction||270===this.direction?(t.L(t.pointsCount-2,(o.x+a.x)/2,a.y),t.L(t.pointsCount-2,h.x,(a.y+h.y)/2)):(t.L(t.pointsCount-2,a.x,(o.y+a.y)/2),t.L(t.pointsCount-3,(a.x+h.x)/2,h.y))),o.w()||o.set(r.actualBounds.center),t.L(t.pointsCount-1,o.x,o.y))),t.zf(),i.commit()}}}this.avoidOrthogonalOverlaps()},Jp.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var t=new Z,e=this.network.edges.iterator;e.next();){var i=e.value.link;null!==i&&i.isOrthogonal&&!t.contains(i)&&t.add(i)}if(0r.y&&(u=l.y>r.y?0:s.xr.x&&(u=l.x>r.x?0:s.ye.layer?1:t.rde.rd?1:t.Ice.Ic?1:0:0},e.Ux=function(t,e){return t instanceof qg&&e instanceof qg&&t!==e?t.firste.first||t.je.j||t.rde.rd?1:t.Ice.Ic?1:0:0},e.Js=function(t,e){return t instanceof qg&&e instanceof qg&&t!==e?t.jce.jc||t.je.j||t.rde.rd?1:t.Ice.Ic?1:0:0},e.B=function(t,e){return-1<(t-=e)&&1>t},e.zi=function(t,e,i,n){var o=t.length,r=n-i;if(!(1>=r))if((0>i||i>=o-1)&&w("not in range 0 <= from < length: "+i),2===r)0=o)t.sort(e);else for((i=t.slice(0,n)).sort(e),e=0;e=o)for((n=t.slice(i)).sort(e),e=i;et&&(this.bg=t,this.C())}},alignOption:{get:function(){return this.ve},set:function(t){this.ve!==t&&0<=t&&16>t&&(this.ve=t,this.C())}},setsPortSpots:{get:function(){return this.sf},set:function(t){this.sf!==t&&(this.sf=t,this.C())}},linkSpacing:{get:function(){return this.Cn},set:function(t){this.Cn!==t&&0<=t&&(this.Cn=t,this.C())}},maxLayer:{get:function(){return this.Ia}},maxIndex:{get:function(){return this.Iq}},maxColumn:{get:function(){return this.Ra}},minIndexLayer:{get:function(){return this.Hn}},maxIndexLayer:{get:function(){return this.Md}}});var Fg=new V(Jp,"CycleDepthFirst",0),Dg=new V(Jp,"CycleGreedy",1),Og=new V(Jp,"CycleFromLayers",2),Bg=new V(Jp,"LayerOptimalLinkLength",0),Ig=new V(Jp,"LayerLongestPathSink",1),zg=new V(Jp,"LayerLongestPathSource",2),Rg=new V(Jp,"InitDepthFirstOut",0),Eg=new V(Jp,"InitDepthFirstIn",1),Vg=new V(Jp,"InitNaive",2),Yg=new V(Jp,"AggressiveNone",0),Gg=new V(Jp,"AggressiveLess",1),Xg=new V(Jp,"AggressiveMore",2),Ug=8;function qg(){this.index=this.Ic=this.rd=this.jc=this.first=this.layer=0,this.link=null,this.j=0}function Hg(t){Bf.call(this,t)}function Kg(t){Vf.call(this,t),this.$n=this.bo=this.ao=this.co=null,this.Za=this.Ag=this.Ig=-1,this.u=NaN,this.F=null,this.valid=!1,this.finish=this.Ll=NaN,this.Dj=0,this.dv=this.ev=null}function Wg(t,e){return t.index-e.index}function Jg(t,e){if(!t.$n){for(var i=[],n=o(t.destinationEdgesArrayAccess),r=n.next();!r.done;r=n.next())(r=r.value).valid&&i.push(r);t.$n=i}for(i=(t=o(t.$n)).next();!i.done;i=t.next())if((i=i.value).toVertex===e)return i;w("Unable to find destination edge to given vertex")}function Zg(t){if(!t.co){for(var e=[],i=o(t.sourceEdgesArrayAccess),n=i.next();!n.done;n=i.next())(n=n.value).valid&&e.push(n.fromVertex);e.sort(Wg),t.co=e}return t.co}function $g(t){if(!t.ao){for(var e=[],i=o(t.destinationEdgesArrayAccess),n=i.next();!n.done;n=i.next())(n=n.value).valid&&e.push(n.toVertex);e.sort(Wg),t.ao=e}return t.ao}function _g(t){Gf.call(this,t),this.j=this.ia=this.Ha=!1,this.V=this.u=NaN,this.F=this.o=0}function Qg(t){Ff.call(this),this.Ub=new _,this.Wn=Cm,this.ud=Tm,this.vo=Um,this.Bq=$m,this.$v=[],this.td=!0,this.Rb=Wm,this.$d=new At(10,10).freeze();var e=new ty(this);this.W=new ey(e),this.Y=new ey(e),this.ru=[],t&&Object.assign(this,t)}function tm(t){var e=new _;for(t=t.iterator;t.next();){var i=t.value;i.initialized||e.add(i)}return e}function em(t,e){var i=999999,n=null;for(e=e.iterator;e.next();){var o=e.value;switch(t.ud){case Tm:o.sourceEdges.counte.level)return!1;t.removeChild(i.parent,i)}return!0}function om(t,e){if(null!==e){t.initializeTreeVertexValues(e),e.alignment===Em&&t.sortTreeVertexChildren(e);for(var i=0,n=e.childrenCount,o=0,r=e.children,s=r.length,a=0;an?cm(t,e,o,C,x,b):fm(t,e,o,C,x,b)).x,x=b.width,b=b.height;break;case Vm:for(f=0;ff&&(kf&&(Mc&&(c=0),135y&&(y=0)),e.la.h(c,y),e.Da.h(x,b)}}function cm(t,e,i,n,o,r){var s=i.length;if(0===s)return new Ot(n,0,o,r);if(1===s)return new Ot(n,0,o=(e=i[0]).Da.width,r=e.Da.height);for(var a=e.nodeSpacing,h=e.rowSpacing,l=90===Pm(e),u=0,c=0,f=0,d=0;dl&&(o-=l),r=Math.max(r,Math.max(d,f)+t+s.height),0>i.S.x&&(n=dm(e,i.S.x,!1,n,a))):(i.S.h(o+t,n+a/2-i.focus.y-i.la.y),o=Math.max(o,Math.max(p,c)+t+s.width),f=n+a/2-i.focus.y-i.la.y,r=Math.max(r,f+s.height),0>f&&(r-=f),0>i.S.y&&(n=dm(e,i.S.y,!0,n,a)))),new Ot(n,0,o,r)}function fm(t,e,i,n,o,r){var s=i.length;if(0===s)return new Ot(n,0,o,r);if(1===s)return new Ot(n,0,o=(i=i[0]).Da.width,r=i.Da.height);for(var a=e.nodeSpacing,h=e.rowSpacing,l=270===Pm(e),u=0,c=0,f=0,d=0;dc&&(o-=c),r=Math.max(r,Math.abs(Math.min(d,f))+t+u.height),0>h.S.x&&(n=dm(e,h.S.x,!1,n,a))):(h.S.h(-o-u.width-t,n+a/2-h.focus.y-h.la.y),o=Math.max(o,Math.abs(Math.min(p,c))+t+u.width),f=n+a/2-h.focus.y-h.la.y,r=Math.max(r,f+u.height),0>f&&(r-=f),0>h.S.y&&(n=dm(e,h.S.y,!0,n,a)))),e=0;ee&&(e=i+t.width),0>i&&(e-=i),e;case Im:return t.width>e?t.width:e;case zm:return 2*t.focus.x>e?t.width:e+t.width-2*t.focus.x;case Rm:case Em:return Math.max(t.width,Math.max(e,i+t.width)-Math.min(0,i));case Vm:return t.width-t.focus.x+t.nodeSpacing/2+e;case Ym:return Math.max(t.width,t.focus.x+t.nodeSpacing/2+e);default:return e}}function gm(t,e,i){switch(t.alignment){case Bm:case Om:return i+t.height>e&&(e=i+t.height),0>i&&(e-=i),e;case Im:return t.height>e?t.height:e;case zm:return 2*t.focus.y>e?t.height:e+t.height-2*t.focus.y;case Rm:case Em:return Math.max(t.height,Math.max(e,i+t.height)-Math.min(0,i));case Vm:return t.height-t.focus.y+t.nodeSpacing/2+e;case Ym:return Math.max(t.height,t.focus.y+t.nodeSpacing/2+e);default:return e}}function mm(t,e,i){switch(t){case Om:case Bm:e/=2,i/=2;break;case Im:i=e=0;break;case zm:break;default:w("Unhandled alignment value "+t.toString())}return new pt(e,i)}function ym(t,e,i,n,o,r){vm(t,(e=mm(e,i,n)).x,e.y,o,r)}function vm(t,e,i,n,o){if(0!==e||0!==i)for(t=t.children;n<=o;n++){var r=t[n].S;r.x+=e,r.y+=i}}function xm(t,e,i,n){var o=e.parent;switch(t.ud){case Tm:for(t=e.sourceEdges;t.next();)(e=t.value).fromVertex===o&&e.relativePoint.h(i,n);break;case Lm:for(t=e.destinationEdges;t.next();)(e=t.value).toVertex===o&&e.relativePoint.h(i,n);break;default:w("Unhandled path value "+t.ud.toString())}}function bm(t,e,i){for(var n=0;nc.length||null===d||2>d.length))for(o=i=0;il&&r.yr.y&&le.length||null===i||2>i.length)n=null;else{for(u=km(t,e.length+i.length),n=r=h=0;rh;)l=i[r++],u[n++].h(l.x+o,l.y);for(i=km(t,n),h=0;hc.length||null===r||2>r.length)o=null;else{for(u=km(t,c.length+r.length),o=l=i=0;ir;)h=c[i++],u[o++].h(h.x,h.y);for(r=km(t,o),i=0;ic.length||null===d||2>d.length))for(o=i=0;ih&&r.xr.x&&he.length||null===i||2>i.length)n=null;else{for(u=km(t,e.length+i.length),n=r=h=0;rh;)l=i[r++],u[n++].h(l.x,l.y+o);for(i=km(t,n),h=0;hc.length||null===r||2>r.length)o=null;else{for(u=km(t,c.length+r.length),o=l=i=0;ir;)h=c[i++],u[o++].h(h.x,h.y);for(r=km(t,o),i=0;i=(t=t.angle)?0:135>=t?90:225>=t?180:315>=t?270:0}Jp.className="LayeredDigraphLayout",Jp.CycleDepthFirst=Fg,Jp.CycleGreedy=Dg,Jp.CycleFromLayers=Og,Jp.LayerOptimalLinkLength=Bg,Jp.LayerLongestPathSink=Ig,Jp.LayerLongestPathSource=zg,Jp.InitDepthFirstOut=Rg,Jp.InitDepthFirstIn=Eg,Jp.InitNaive=Vg,Jp.AggressiveNone=Yg,Jp.AggressiveLess=Gg,Jp.AggressiveMore=Xg,Jp.PackNone=0,Jp.PackExpand=1,Jp.PackStraighten=2,Jp.PackMedian=4,Jp.PackAll=15,Jp.AlignNone=0,Jp.AlignUpperLeft=1,Jp.AlignUpperRight=2,Jp.AlignLowerLeft=4,Jp.AlignLowerRight=8,Jp.AlignAll=15,qg.className="SegInfo",c(Hg,Bf),Hg.prototype.createVertex=function(){return new Kg(this)},Hg.prototype.createEdge=function(){return new _g(this)},Hg.className="LayeredDigraphNetwork",c(Kg,Vf),Kg.prototype.Cl=function(t){Vf.prototype.Cl.call(this,t),this.bo=this.co=null},Kg.prototype.Kl=function(t){Vf.prototype.Kl.call(this,t),this.bo=this.co=null},Kg.prototype.zl=function(t){Vf.prototype.zl.call(this,t),this.$n=this.ao=null},Kg.prototype.Jl=function(t){Vf.prototype.Jl.call(this,t),this.$n=this.ao=null},f.Object.defineProperties(Kg.prototype,{layer:{get:function(){return this.Ig},set:function(t){this.Ig!==t&&(this.Ig=t)}},column:{get:function(){return this.Ag},set:function(t){this.Ag!==t&&(this.Ag=t)}},index:{get:function(){return this.Za},set:function(t){this.Za!==t&&(this.Za=t)}},component:{get:function(){return this.u},set:function(t){this.u!==t&&(this.u=t)}},near:{get:function(){return this.F},set:function(t){this.F!==t&&(this.F=t)}}}),Kg.prototype.deleteDestinationEdge=Kg.prototype.Jl,Kg.prototype.addDestinationEdge=Kg.prototype.zl,Kg.prototype.deleteSourceEdge=Kg.prototype.Kl,Kg.prototype.addSourceEdge=Kg.prototype.Cl,Kg.className="LayeredDigraphVertex",c(_g,Gf),f.Object.defineProperties(_g.prototype,{fromVertex:{get:function(){return this.kd},set:function(t){this.kd!==t&&(this.kd=t)}},toVertex:{get:function(){return this.qd},set:function(t){this.qd!==t&&(this.qd=t)}},valid:{get:function(){return this.Ha},set:function(t){this.Ha!==t&&(this.Ha=t)}},rev:{get:function(){return this.ia},set:function(t){this.ia!==t&&(this.ia=t)}},forest:{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t)}},portFromPos:{get:function(){return this.u},set:function(t){this.u!==t&&(this.u=t)}},portToPos:{get:function(){return this.V},set:function(t){this.V!==t&&(this.V=t)}},portFromColOffset:{get:function(){return this.o},set:function(t){this.o!==t&&(this.o=t)}},portToColOffset:{get:function(){return this.F},set:function(t){this.F!==t&&(this.F=t)}}}),_g.className="LayeredDigraphEdge",c(Qg,Ff),Qg.prototype.cloneProtected=function(t){Ff.prototype.cloneProtected.call(this,t),t.Wn=this.Wn,t.vo=this.vo,t.Bq=this.Bq,t.td=this.td,t.Rb=this.Rb,t.$d.assign(this.$d),t.W.copyInheritedPropertiesFrom(this.W),t.Y.copyInheritedPropertiesFrom(this.Y)},Qg.prototype.qb=function(t){t.classType===Qg?0===t.name.indexOf("Alignment")?this.alignment=t:0===t.name.indexOf("Arrangement")?this.arrangement=t:0===t.name.indexOf("Compaction")?this.compaction=t:0===t.name.indexOf("Path")?this.path=t:0===t.name.indexOf("Sorting")?this.sorting=t:0===t.name.indexOf("Style")?this.treeStyle=t:w("Unknown enum value: "+t):Ff.prototype.qb.call(this,t)},Qg.prototype.createNetwork=function(){return new ty(this)},Qg.prototype.makeNetwork=function(t){function e(t){if(t instanceof Ju)return!t.isLinkLabel&&"Comment"!==t.category;if(t instanceof wc){var e=t.fromNode;return null!==e&&!e.isLinkLabel&&"Comment"!==e.category&&(null!==(t=t.toNode)&&!t.isLinkLabel&&"Comment"!==t.category)}return!1}var i=this.createNetwork();return t instanceof To?(i.lg(t.nodes,!0,e),i.lg(t.links,!0,e)):t instanceof gc?i.lg(t.memberParts,!1,e):i.lg(t.iterator,!1,e),i},Qg.prototype.doLayout=function(t){null===this.network&&(this.network=this.makeNetwork(t)),this.arrangement!==Zm&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var e=this.diagram;if(null===e&&t instanceof To&&(e=t),this.path===Cm&&null!==e?this.ud=e.isTreePathToChildren?Tm:Lm:this.ud=this.path===Cm?Tm:this.path,0o?cm(this,t,s,F,y,v):fm(this,t,s,F,y,v)).x,y=v.width,v=v.height;break;case Vm:for(b=0;bc&&(NI&&(vm(t,-I,0,L,D-1),bm(b,-I,0),bm(k,-I,0),I=0)}O.S.h(I,P),y=Math.max(y,M),v=Math.max(v,x+(0===C?0:p)+B.height),N=M}else 0c&&(PI&&(vm(t,0,-I,L,D-1),bm(b,0,-I),bm(k,0,-I),I=0)),O.S.h(N,I),v=Math.max(v,S),y=Math.max(y,x+(0===C?0:p)+B.width),P=S;T++}switch(0l&&(l=0),135g&&(g=0),h===Ym&&(a+=f/2+t.focus.y),s+=n+i):e?(null===t.comments?n>y&&(s=(y=mm(h,n-y,0)).x,a=y.y,y=n,l=0):y=pm(t,y,l),0>l&&(s-=l,l=0),135v&&(s=(v=mm(h,0,m-v)).x,a=v.y,v=m,g=0):v=gm(t,v,g),0>g&&(a-=g,g=0),s+=n+i),0o[0].x?o[2].assign(o[1]):o[1].assign(o[2])),o[3].yo[0].x?o[3].assign(o[2]):o[2].assign(o[3])),C[0].h(l+n,0),C[1].h(C[0].x,m),C[2].yo[0].y?o[2].assign(o[1]):o[1].assign(o[2])),o[3].xo[0].y?o[3].assign(o[2]):o[2].assign(o[3])),C[0].h(0,g+m),C[1].h(n,C[0].y),C[2].x=t&&(this.W.nodeIndentPastParent=t,this.C())}},nodeSpacing:{get:function(){return this.W.nodeSpacing},set:function(t){this.W.nodeSpacing!==t&&(this.W.nodeSpacing=t,this.C())}},layerSpacing:{get:function(){return this.W.layerSpacing},set:function(t){this.W.layerSpacing!==t&&(this.W.layerSpacing=t,this.C())}},layerSpacingParentOverlap:{get:function(){return this.W.layerSpacingParentOverlap},set:function(t){this.W.layerSpacingParentOverlap!==t&&0<=t&&1>=t&&(this.W.layerSpacingParentOverlap=t,this.C())}},compaction:{get:function(){return this.W.compaction},set:function(t){this.W.compaction===t||t!==Gm&&t!==Xm||(this.W.compaction=t,this.C())}},breadthLimit:{get:function(){return this.W.breadthLimit},set:function(t){this.W.breadthLimit!==t&&0<=t&&(this.W.breadthLimit=t,this.C())}},rowSpacing:{get:function(){return this.W.rowSpacing},set:function(t){this.W.rowSpacing!==t&&(this.W.rowSpacing=t,this.C())}},rowIndent:{get:function(){return this.W.rowIndent},set:function(t){this.W.rowIndent!==t&&0<=t&&(this.W.rowIndent=t,this.C())}},commentSpacing:{get:function(){return this.W.commentSpacing},set:function(t){this.W.commentSpacing!==t&&(this.W.commentSpacing=t,this.C())}},commentMargin:{get:function(){return this.W.commentMargin},set:function(t){this.W.commentMargin!==t&&(this.W.commentMargin=t,this.C())}},setsPortSpot:{get:function(){return this.W.setsPortSpot},set:function(t){this.W.setsPortSpot!==t&&(this.W.setsPortSpot=t,this.C())}},portSpot:{get:function(){return this.W.portSpot},set:function(t){this.W.portSpot.D(t)||(this.W.portSpot=t,this.C())}},setsChildPortSpot:{get:function(){return this.W.setsChildPortSpot},set:function(t){this.W.setsChildPortSpot!==t&&(this.W.setsChildPortSpot=t,this.C())}},childPortSpot:{get:function(){return this.W.childPortSpot},set:function(t){this.W.childPortSpot.D(t)||(this.W.childPortSpot=t,this.C())}},alternateSorting:{get:function(){return this.Y.sorting},set:function(t){this.Y.sorting===t||t!==Am&&t!==jm&&t!==Fm&&!Dm||(this.Y.sorting=t,this.C())}},alternateComparer:{get:function(){return this.Y.comparer},set:function(t){this.Y.comparer!==t&&(this.Y.comparer=t,this.C())}},alternateAngle:{get:function(){return this.Y.angle},set:function(t){this.Y.angle===t||0!==t&&90!==t&&180!==t&&270!==t||(this.Y.angle=t,this.C())}},alternateAlignment:{get:function(){return this.Y.alignment},set:function(t){this.Y.alignment!==t&&(this.Y.alignment=t,this.C())}},alternateNodeIndent:{get:function(){return this.Y.nodeIndent},set:function(t){this.Y.nodeIndent!==t&&0<=t&&(this.Y.nodeIndent=t,this.C())}},alternateNodeIndentPastParent:{get:function(){return this.Y.nodeIndentPastParent},set:function(t){this.Y.nodeIndentPastParent!==t&&0<=t&&1>=t&&(this.Y.nodeIndentPastParent=t,this.C())}},alternateNodeSpacing:{get:function(){return this.Y.nodeSpacing},set:function(t){this.Y.nodeSpacing!==t&&(this.Y.nodeSpacing=t,this.C())}},alternateLayerSpacing:{get:function(){return this.Y.layerSpacing},set:function(t){this.Y.layerSpacing!==t&&(this.Y.layerSpacing=t,this.C())}},alternateLayerSpacingParentOverlap:{get:function(){return this.Y.layerSpacingParentOverlap},set:function(t){this.Y.layerSpacingParentOverlap!==t&&0<=t&&1>=t&&(this.Y.layerSpacingParentOverlap=t,this.C())}},alternateCompaction:{get:function(){return this.Y.compaction},set:function(t){this.Y.compaction===t||t!==Gm&&t!==Xm||(this.Y.compaction=t,this.C())}},alternateBreadthLimit:{get:function(){return this.Y.breadthLimit},set:function(t){this.Y.breadthLimit!==t&&0<=t&&(this.Y.breadthLimit=t,this.C())}},alternateRowSpacing:{get:function(){return this.Y.rowSpacing},set:function(t){this.Y.rowSpacing!==t&&(this.Y.rowSpacing=t,this.C())}},alternateRowIndent:{get:function(){return this.Y.rowIndent},set:function(t){this.Y.rowIndent!==t&&0<=t&&(this.Y.rowIndent=t,this.C())}},alternateCommentSpacing:{get:function(){return this.Y.commentSpacing},set:function(t){this.Y.commentSpacing!==t&&(this.Y.commentSpacing=t,this.C())}},alternateCommentMargin:{get:function(){return this.Y.commentMargin},set:function(t){this.Y.commentMargin!==t&&(this.Y.commentMargin=t,this.C())}},alternateSetsPortSpot:{get:function(){return this.Y.setsPortSpot},set:function(t){this.Y.setsPortSpot!==t&&(this.Y.setsPortSpot=t,this.C())}},alternatePortSpot:{get:function(){return this.Y.portSpot},set:function(t){this.Y.portSpot.D(t)||(this.Y.portSpot=t,this.C())}},alternateSetsChildPortSpot:{get:function(){return this.Y.setsChildPortSpot},set:function(t){this.Y.setsChildPortSpot!==t&&(this.Y.setsChildPortSpot=t,this.C())}},alternateChildPortSpot:{get:function(){return this.Y.childPortSpot},set:function(t){this.Y.childPortSpot.D(t)||(this.Y.childPortSpot=t,this.C())}}});var Cm=new V(Qg,"PathDefault",-1),Tm=new V(Qg,"PathDestination",0),Lm=new V(Qg,"PathSource",1),Am=new V(Qg,"SortingForwards",10),jm=new V(Qg,"SortingReverse",11),Fm=new V(Qg,"SortingAscending",12),Dm=new V(Qg,"SortingDescending",13),Om=new V(Qg,"AlignmentCenterSubtrees",20),Bm=new V(Qg,"AlignmentCenterChildren",21),Im=new V(Qg,"AlignmentStart",22),zm=new V(Qg,"AlignmentEnd",23),Rm=new V(Qg,"AlignmentBus",24),Em=new V(Qg,"AlignmentBusBranching",25),Vm=new V(Qg,"AlignmentTopLeftBus",26),Ym=new V(Qg,"AlignmentBottomRightBus",27),Gm=new V(Qg,"CompactionNone",30),Xm=new V(Qg,"CompactionBlock",31),Um=new V(Qg,"StyleLayered",40),qm=new V(Qg,"StyleLastParents",41),Hm=new V(Qg,"StyleAlternating",42),Km=new V(Qg,"StyleRootOnly",43),Wm=new V(Qg,"ArrangementVertical",50),Jm=new V(Qg,"ArrangementHorizontal",51),Zm=new V(Qg,"ArrangementFixedRoots",52),$m=new V(Qg,"LayerIndividual",60),_m=new V(Qg,"LayerSiblings",61),Qm=new V(Qg,"LayerUniform",62);function ty(t){Bf.call(this,t)}function ey(t){Vf.call(this,t),this.V=!1,this.hb=null,this.u=[],this.nb=this.Ha=this.F=this.ia=0,this.td=null,this.S=new pt(0,0),this.Da=new At(0,0),this.la=new pt(0,0),this.im=this.hm=this.qA=!1,this.kp=this.Yo=null,this.nd=Am,this.hd=Yf,this.Kb=0,this.Jb=Bm,this.Vq=this.Uq=0,this.Wq=20,this.ie=50,this.Aq=0,this.Hp=Xm,this.Ap=0,this.nr=25,this.Gp=this.mr=10,this.Fp=20,this.xr=!0,this.dr=Se,this.wr=!0,this.Dp=Se}function iy(t){Gf.call(this,t),this.$t=new pt(0,0)}Qg.className="TreeLayout",Qg.PathDefault=Cm,Qg.PathDestination=Tm,Qg.PathSource=Lm,Qg.SortingForwards=Am,Qg.SortingReverse=jm,Qg.SortingAscending=Fm,Qg.SortingDescending=Dm,Qg.AlignmentCenterSubtrees=Om,Qg.AlignmentCenterChildren=Bm,Qg.AlignmentStart=Im,Qg.AlignmentEnd=zm,Qg.AlignmentBus=Rm,Qg.AlignmentBusBranching=Em,Qg.AlignmentTopLeftBus=Vm,Qg.AlignmentBottomRightBus=Ym,Qg.CompactionNone=Gm,Qg.CompactionBlock=Xm,Qg.StyleLayered=Um,Qg.StyleLastParents=qm,Qg.StyleAlternating=Hm,Qg.StyleRootOnly=Km,Qg.ArrangementVertical=Wm,Qg.ArrangementHorizontal=Jm,Qg.ArrangementFixedRoots=Zm,Qg.LayerIndividual=$m,Qg.LayerSiblings=_m,Qg.LayerUniform=Qm,c(ty,Bf),ty.prototype.createVertex=function(){return new ey(this)},ty.prototype.createEdge=function(){return new iy(this)},ty.className="TreeNetwork",c(ey,Vf),ey.prototype.copyInheritedPropertiesFrom=function(t){null!==t&&(this.nd=t.sorting,this.hd=t.comparer,this.Kb=t.angle,this.Jb=t.alignment,this.Uq=t.nodeIndent,this.Vq=t.nodeIndentPastParent,this.Wq=t.nodeSpacing,this.ie=t.layerSpacing,this.Aq=t.layerSpacingParentOverlap,this.Hp=t.compaction,this.Ap=t.breadthLimit,this.nr=t.rowSpacing,this.mr=t.rowIndent,this.Gp=t.commentSpacing,this.Fp=t.commentMargin,this.xr=t.setsPortSpot,this.dr=t.portSpot,this.wr=t.setsChildPortSpot,this.Dp=t.childPortSpot)},f.Object.defineProperties(ey.prototype,{initialized:{get:function(){return this.V},set:function(t){this.V!==t&&(this.V=t)}},parent:{get:function(){return this.hb},set:function(t){this.hb!==t&&(this.hb=t)}},children:{get:function(){return this.u},set:function(t){if(this.u!==t){if(null!==t)for(var e=t.length,i=0;id.y+i.rowIndent&&(r=Math.min(r,Math.max(c.y,r-e.computeNodeIndent(i))))):i.alignment===Im?(r=n.top+o.y,0===o.y&&c.yd.x+i.rowIndent&&(r=Math.min(r,Math.max(c.x,r-e.computeNodeIndent(i))))):i.alignment===Im?(r=n.left+o.x,0===o.x&&c.xd.y+i.rowIndent&&(r=Math.min(r,Math.max(c.y,r-e.computeNodeIndent(i))))):i.alignment===Im?(r=n.top+o.y,0===o.y&&c.yd.x+i.rowIndent&&(r=Math.min(r,Math.max(c.x,r-e.computeNodeIndent(i))))):i.alignment===Im?(r=n.left+o.x,0===o.x&&c.x